![]() |
HAL
|
#include <gui_api.h>
Classes | |
struct | ModuleGateIdPair |
Static Public Member Functions | |
static int | isolateInNew (const std::vector< Module * > modules, const std::vector< Gate * > gates) |
static bool | deleteView (int id) |
static bool | addTo (int id, const std::vector< Module * > modules, const std::vector< Gate * > gates) |
static bool | removeFrom (int id, const std::vector< Module * > modules, const std::vector< Gate * > gates) |
static bool | setName (int id, const std::string &name) |
static int | getId (const std::string &name) |
static std::string | getName (int id) |
static std::vector< Module * > | getModules (int id) |
static std::vector< Gate * > | getGates (int id) |
static std::vector< u32 > | getIds (const std::vector< Module * > modules, const std::vector< Gate * > gates) |
static bool | foldModule (int view_id, Module *module) |
static bool | unfoldModule (int view_id, Module *module) |
static ModuleGateIdPair | getValidObjects (int viewId, const std::vector< Module * >, const std::vector< Gate * >) |
static GridPlacement * | getGridPlacement (int viewId) |
static bool | setGridPlacement (int viewId, GridPlacement *gp) |
static u32 | getCurrentDirectory () |
static void | setCurrentDirectory (u32 id) |
static u32 | createNewDirectory (const std::string &name) |
static void | deleteDirectory (u32 id) |
static void | moveView (u32 viewId, std::optional< u32 > destinationDirectoryId, std::optional< int > row) |
static void | moveDirectory (u32 directoryId, std::optional< u32 > destinationDirectoryId, std::optional< int > row) |
static std::optional< std::vector< u32 > > | getChildDirectories (u32 directoryId) |
static std::optional< std::vector< u32 > > | getChildViews (u32 directoryId) |
|
static |
Adds modules and gates to a view.
id | - The id of the view. |
modules | - The list of modules to be added to the view. |
gates | - The list of gates to be added to the view. |
Definition at line 534 of file gui_api.cpp.
References hal::UserActionObjectType::ContextView, hal::UserActionManager::executeActionBlockThread(), hal::GuiApiClasses::View::ModuleGateIdPair::gateIds, hal::Module::get_id(), hal::Netlist::get_top_module(), hal::GraphContextManager::getContextById(), hal::GraphContext::getExclusiveModuleId(), getValidObjects(), hal::gGraphContextManager, hal::gNetlist, hal::UserActionManager::instance(), hal::GraphContext::isShowingModuleExclusively(), log_warning, hal::GuiApiClasses::View::ModuleGateIdPair::moduleIds, and hal::UserAction::setObject().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Creates a new directory with a given name.
name | - The name of the new directory. |
Definition at line 954 of file gui_api.cpp.
References hal::UserActionObjectType::ContextDir, hal::UserActionManager::executeActionBlockThread(), QString::fromStdString(), hal::UserActionObject::id(), id, hal::UserActionManager::instance(), name, and hal::UserAction::object().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Deleted a directory.
id | - The id of the directory. |
Definition at line 962 of file gui_api.cpp.
References hal::UserActionObjectType::ContextDir, hal::UserActionManager::executeActionBlockThread(), hal::UserActionManager::instance(), and hal::UserAction::setObject().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Deletes a view.
id | - The id of the view. |
Definition at line 519 of file gui_api.cpp.
References hal::UserActionObjectType::ContextView, hal::UserActionManager::executeActionBlockThread(), hal::GraphContextManager::getContextById(), hal::gGraphContextManager, hal::UserActionManager::instance(), and hal::UserAction::setObject().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Fold a specific module. Hides the submodules and gates, shows the specific module.
view_id | - The id of the view. |
module | - The Module to fold. |
Definition at line 764 of file gui_api.cpp.
References QSet::contains(), hal::UserActionManager::executeActionBlockThread(), hal::GraphContext::gates(), hal::Module::get_gates(), hal::Module::get_id(), hal::Module::get_submodules(), hal::GraphContextManager::getContextById(), hal::gGraphContextManager, hal::UserActionManager::instance(), log_warning, hal::ShortestPath::module(), and hal::GraphContext::modules().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Returns a list of child directories for a given directory.
directoryId | - The id of the parent directory. |
Definition at line 1027 of file gui_api.cpp.
References hal::ContextTreeModel::getChildDirectoriesOf(), hal::GraphContextManager::getContextTreeModel(), hal::ContextTreeModel::getDirectory(), and hal::gGraphContextManager.
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Returns a list of child views for a given directory.
directoryId | - The id of the parent directory. |
Definition at line 1036 of file gui_api.cpp.
References hal::ContextTreeModel::getChildContextsOf(), hal::GraphContextManager::getContextTreeModel(), hal::ContextTreeModel::getDirectory(), and hal::gGraphContextManager.
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Returns the id of the current directory.
Used for selection and similar.
Definition at line 935 of file gui_api.cpp.
References hal::ContextTreeItem::directory(), hal::GraphContextManager::getContextTreeModel(), hal::ContextTreeModel::getCurrentDirectory(), hal::gGraphContextManager, and hal::ContextDirectory::id().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Returns the gates contained in a view.
id | - The id of the view. |
Definition at line 666 of file gui_api.cpp.
References hal::GraphContext::gates(), hal::Netlist::get_gate_by_id(), hal::GraphContextManager::getContextById(), hal::gGraphContextManager, and hal::gNetlist.
Referenced by getValidObjects(), and hal::PYBIND11_PLUGIN().
|
static |
Definition at line 921 of file gui_api.cpp.
References hal::GraphContextManager::getContextById(), hal::GraphContext::getLayouter(), hal::gGraphContextManager, and hal::GraphLayouter::gridPlacementFactory().
Referenced by hal::ActionMoveNode::exec(), and hal::PYBIND11_PLUGIN().
|
static |
Returns the id of a view.
name | - The name of the view to search for. |
Definition at line 629 of file gui_api.cpp.
References hal::GraphContextManager::contextWithNameExists(), QString::fromStdString(), hal::GraphContextManager::getContexts(), hal::gGraphContextManager, and name.
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Returns the ids of views containing at least the given modules and gates.
modules | - List of required modules. |
gates | - List of required gates. |
Definition at line 679 of file gui_api.cpp.
References hal::Module::get_id(), hal::GraphContextManager::getContexts(), hal::gGraphContextManager, QSet::insert(), log_warning, and hal::ShortestPath::module().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Returns the modules contained in a view.
id | - The id of the view. |
Definition at line 653 of file gui_api.cpp.
References hal::Netlist::get_module_by_id(), hal::GraphContextManager::getContextById(), hal::gGraphContextManager, hal::gNetlist, and hal::GraphContext::modules().
Referenced by getValidObjects(), and hal::PYBIND11_PLUGIN().
|
static |
Returns the name of a view.
id | - The id of the view. |
Definition at line 644 of file gui_api.cpp.
References hal::GraphContextManager::getContextById(), hal::gGraphContextManager, hal::GraphContext::name(), and QString::toStdString().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Definition at line 795 of file gui_api.cpp.
References QSet::contains(), hal::GuiApiClasses::View::ModuleGateIdPair::gateIds, hal::Module::get_id(), hal::Module::get_parent_module(), hal::Netlist::get_top_module(), getGates(), getModules(), hal::gNetlist, QSet::insert(), hal::GuiApiClasses::View::ModuleGateIdPair::moduleIds, and QSet::remove().
Referenced by addTo(), and isolateInNew().
|
static |
Isolates given modules and gates into a new view. If only one module and no gates are given and there already exists a view which is exclusively bound the given module, then that view is returned instead.
modules | - List of modules to be added. |
gates | - List of gates to be added |
Definition at line 449 of file gui_api.cpp.
References hal::UserActionCompound::addAction(), QString::arg(), hal::UserActionObjectType::ContextView, hal::GraphContextManager::contextWithNameExists(), hal::UserActionManager::executeActionBlockThread(), QString::fromStdString(), hal::GuiApiClasses::View::ModuleGateIdPair::gateIds, hal::GraphContextManager::getContextById(), hal::GraphContextManager::getContexts(), getValidObjects(), hal::gGraphContextManager, hal::UserActionObject::id(), hal::UserActionManager::instance(), QSet::isEmpty(), log_warning, hal::GuiApiClasses::View::ModuleGateIdPair::moduleIds, name, hal::GraphContextManager::nextViewName(), hal::UserAction::object(), hal::GraphContext::setDirty(), hal::GraphContext::setExclusiveModuleId(), and hal::UserActionCompound::setUseCreatedObject().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Moves a directory under another directory.
directoryId | - The id of the directory to move. |
destinationDirectoryId | - The id of the destination directory. If not given, the current directory is used instead. |
row | - Optional. The row there the view is inserted. |
Definition at line 993 of file gui_api.cpp.
References hal::UserActionObjectType::ContextDir, hal::ActionMoveItem::exec(), hal::GraphContextManager::getContextTreeModel(), hal::ContextTreeModel::getDirectory(), hal::BaseTreeItem::getParent(), hal::BaseTreeModel::getRootItem(), hal::gGraphContextManager, log_warning, and hal::UserAction::setObject().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Moves a view to a directory.
viewId | - The id of the view. |
destinationDirectoryId | - The id of the destination directory. If not given, the current directory is used instead. |
row | - Optional. The row there the view is inserted. |
Definition at line 972 of file gui_api.cpp.
References hal::UserActionObjectType::ContextView, hal::ActionMoveItem::exec(), hal::ContextTreeModel::getContext(), hal::GraphContextManager::getContextTreeModel(), hal::BaseTreeItem::getParent(), hal::BaseTreeModel::getRootItem(), hal::gGraphContextManager, and hal::UserAction::setObject().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Removes modules and gates from a view.
id | - The id of the view to remove the modules and gates from. |
modules | - The modules to be removed from the view. |
gates | - The gates to be removed from the view. |
Definition at line 573 of file gui_api.cpp.
References hal::UserActionObjectType::ContextView, hal::UserActionManager::executeActionBlockThread(), hal::Module::get_id(), hal::GraphContextManager::getContextById(), hal::gGraphContextManager, QSet::insert(), hal::UserActionManager::instance(), log_warning, hal::ShortestPath::module(), and hal::UserAction::setObject().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Sets the id of the current directory.
Used for selection and similar.
id | - The id of the new current directory. |
Definition at line 948 of file gui_api.cpp.
References hal::GraphContextManager::getContextTreeModel(), hal::ContextTreeModel::getDirectory(), hal::gGraphContextManager, and hal::ContextTreeModel::setCurrentDirectory().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Definition at line 928 of file gui_api.cpp.
References hal::UserActionManager::executeActionBlockThread(), and hal::UserActionManager::instance().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Sets the name of a view.
id | - The id of the view. |
name | - The new name of the view. |
Definition at line 610 of file gui_api.cpp.
References hal::UserActionObjectType::ContextView, hal::GraphContextManager::contextWithNameExists(), hal::UserActionManager::executeActionBlockThread(), QString::fromStdString(), hal::GraphContextManager::getContextById(), hal::gGraphContextManager, hal::UserActionManager::instance(), hal::GraphContext::isShowingModuleExclusively(), name, and hal::UserAction::setObject().
Referenced by hal::PYBIND11_PLUGIN().
|
static |
Unfold a specific module. Hides the module, shows submodules and gates.
view_id | - The id of the view. |
module | - The Module to unfold. |
Definition at line 745 of file gui_api.cpp.
References QSet::contains(), hal::UserActionManager::executeActionBlockThread(), hal::Module::get_id(), hal::GraphContextManager::getContextById(), hal::gGraphContextManager, hal::UserActionManager::instance(), log_warning, hal::ShortestPath::module(), and hal::GraphContext::modules().
Referenced by hal::PYBIND11_PLUGIN().