|
HAL
v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
#include </home/runner/work/hal/hal/plugins/dot_viewer/include/dot_viewer/dot_viewer_factory.h>


Public Member Functions | |
| DotViewerFactory (const QString &name) | |
| void | restoreDotViewer (const std::filesystem::path &loaddir, const std::string &jsonfile) |
| ExternalContentWidget * | contentFactory () const |
| std::string | serialize (Netlist *netlist, const std::filesystem::path &savedir, bool isAutosave) override |
| void | deserialize (Netlist *netlist, const std::filesystem::path &loaddir) override |
| void | restore () |
Public Member Functions inherited from hal::ContentFactory | |
| ContentFactory (const QString &nam=QString()) | |
| QString | name () const |
Creates DotViewer widgets on demand and restores the DOT files that were open when the project was last saved.
Definition at line 36 of file dot_viewer_factory.h.
| hal::DotViewerFactory::DotViewerFactory | ( | const QString & | name | ) |
Construct a new factory.
| [in] | name | - The name that the created content widget is registered under. |
Definition at line 16 of file dot_viewer_factory.cpp.
|
virtual |
Create a new DOT viewer widget.
Implements hal::ContentFactory.
Definition at line 20 of file dot_viewer_factory.cpp.
References QString::isEmpty(), hal::DotViewer::loadDotFile(), and hal::ContentFactory::name().
|
overridevirtual |
Read back the .dot file that was displayed when the project was saved.
| [in] | netlist | - The netlist of the project. |
| [in] | loaddir | - The project directory to load from. |
Implements hal::ProjectSerializer.
Definition at line 57 of file dot_viewer_factory.cpp.
References hal::ProjectManager::get_filename(), hal::ProjectManager::instance(), hal::ProjectSerializer::m_name, and restoreDotViewer().
| void hal::DotViewerFactory::restore | ( | ) |
Reopen the previously stored .dot file in the DOT viewer.
Definition at line 27 of file dot_viewer_factory.cpp.
References hal::ProjectManager::get_filename(), hal::ProjectManager::get_project_directory(), hal::ProjectManager::instance(), hal::ProjectSerializer::m_name, and restoreDotViewer().
| void hal::DotViewerFactory::restoreDotViewer | ( | const std::filesystem::path & | loaddir, |
| const std::string & | jsonfile | ||
| ) |
Restore the DOT viewer from the state that was stored in the given project file.
| [in] | loaddir | - The project directory to load from. |
| [in] | jsonfile | - The name of the file within the project directory that holds the stored state. |
Definition at line 65 of file dot_viewer_factory.cpp.
References QDir::absoluteFilePath(), QJsonObject::contains(), QJsonDocument::fromJson(), QString::fromStdString(), hal::ProjectManager::get_project_directory(), hal::DotViewer::getDotviewerInstance(), hal::ProjectManager::instance(), QString::isEmpty(), hal::DotViewer::loadDotFile(), QJsonDocument::object(), QFile::open(), QIODevice::readAll(), and QIODevice::ReadOnly.
Referenced by deserialize(), and restore().
|
overridevirtual |
Store the .dot file that is currently displayed so that it can be restored with the project.
| [in] | netlist | - The netlist of the project. |
| [in] | savedir | - The project directory to save to. |
| [in] | isAutosave | - true if the call was issued by the autosave, false otherwise. |
Implements hal::ProjectSerializer.
Definition at line 35 of file dot_viewer_factory.cpp.
References QDir::absoluteFilePath(), QJsonDocument::Compact, hal::DotViewer::creatorPlugin(), hal::DotViewer::filename(), QString::fromStdString(), hal::ProjectManager::get_project_directory(), hal::ProjectDirectory::get_relative_file_path(), hal::DotViewer::getDotviewerInstance(), hal::ProjectManager::instance(), QFile::open(), QString::toStdString(), QIODevice::write(), and QIODevice::WriteOnly.