1 #pragma GCC diagnostic push
2 #pragma GCC diagnostic ignored "-Wshadow"
3 #pragma GCC diagnostic ignored "-Wself-assign-overloaded"
5 #pragma clang diagnostic ignored "-Wnested-anon-types"
6 #pragma clang diagnostic ignored "-Wshadow-field-in-constructor-modified"
11 #include "pybind11/operators.h"
12 #include "pybind11/pybind11.h"
13 #include "pybind11/stl.h"
14 #include "pybind11/stl_bind.h"
15 #include "pybind11/functional.h"
21 #pragma GCC diagnostic pop
26 #ifdef PYBIND11_MODULE
28 PYBIND11_MODULE(hal_gui, m)
30 m.doc() =
"hal python bindings";
34 py::module m(
"hal_gui",
"hal gui python bindings");
37 auto py_console = m.def_submodule(
"console", R
"(
46 py::module m2 = py_console.def_submodule(
"redirector",
"redirector");
54 auto gui_input = m.def_submodule(
"gui_input", R
"(
57 gui_input.def("inputString", [](std::string prompt = std::string(
"Please enter value"), std::string defval = std::string()) ->
61 gui_input.def(
"inputNumber", [](std::string prompt = std::string(
"Please enter number"),
int defval = 0) ->
65 gui_input.def(
"inputGate", [](std::string prompt = std::string(
"Please select gate")) ->
69 gui_input.def(
"inputModule", [](std::string prompt = std::string(
"Please select module")) ->
73 gui_input.def(
"inputFilename", [](std::string prompt = std::string(
"Please select filename"), std::string filetype = std::string()) ->
77 gui_input.def(
"wait_for_menu_selection", []() ->
void {
81 py::class_<GuiApi> py_gui_api(m,
"GuiApi", R
"(GUI API)");
83 py::class_<GridPlacement>(py_gui_api,"GridPlacement",R
"(
84 Helper class to determine placement of nodes on gui grid.
87 .def(py::init<>(), R"(
88 Constructor for empty placement hash.
92 Set position for gate identified by ID.
94 :param int gateId: Gate ID.
95 :param tuple(int,int) pos: New position.
96 :param bool swap: set the swap of positions of the nodes
100 Set position for module identified by ID.
102 :param int moduleId: Module ID.
103 :param tuple(int,int) pos: New position.
104 :param bool swap: set the swap of positions of the nodes
108 Query position for gate identified by ID.
110 :param int gateId: Gate ID.
111 :returns: Position of gate or ``None`` if gate not found in hash.
112 :rtype: tuple(int,int) or None
116 Query position for module identified by ID.
118 :param int moduleId: Module ID.
119 :returns: Position of module or ``None`` if module not found in hash.
120 :rtype: tuple(int,int) or None
123 py::class_<GuiApiClasses::View>(py_gui_api, "View")
125 Isolates given modules and gates into a new view
127 :param list[hal_py.module] modules: List of modules to be added.
128 :param list[hal_py.Gate] gates: List of gates to be added.
129 :returns: ID of created view or the existing one if view is exclusively bound to a module.
133 Renames the view specified by the given ID.
135 :param int viewId: ID of the view.
136 :param string name: New unique name.
137 :returns: ``True`` on success, ``False`` otherwise.
141 Adds the given modules and gates to the view specified by the ID.
143 :param int viewId: ID of the view.
144 :param list[hal.py.module] modules: Modules to be added.
145 :param list[hal.py.Gate] gates: Gates to be added.
146 :returns: ``True`` on success, ``False`` otherwise.
150 Deletes the view specified by the ID.
152 :param int viewId: ID of the view.
153 :returns: ``True`` on success, ``False`` otherwise.
157 Removes the given modules and gates from the view specified by the ID.
159 :param int viewId: ID of the view.
160 :param list[hal.py.module] modules: Modules to be removed.
161 :param list[hal.py.Gate] gates: Gates to be removed.
162 :returns: ``True`` on success, ``False`` otherwise.
166 Returns the ID of the view with the given name if existing.
168 :param string name: Name of the view.
169 :returns: ID of the specified view or 0 if none is found.
173 Returns the name of the view with the given ID if existing.
175 :param int viewId: ID of the view.
176 :returns: Name of the view specified by the ID or empty string if none is found.
180 Returns all modules attached to the view.
182 :param int viewId: ID of the view.
183 :returns: List of the attached modules.
184 :rtype: list[hal.py.module]
187 Returns all gates attached to the view
189 :param int viewId: ID of the view.
190 :returns: List of the attached gates.
191 :rtype: list[hal.py.Gate]
194 Returns the ID of each View containing at least the given modules and gates.
196 :param list[hal.py.module] modules: Required modules.
197 :param list[hal.py.Gate] gates: Required gates.
198 :returns: List of ID of views which contains modules and gates.
202 Unfold a specific module. Hides the module, shows submodules and gates
204 :param int viewId: ID of the view.
205 :param Module* module: module to unfold
206 :returns: ``True`` on success, ``False`` otherwise.
210 Fold a specific module. Hides the submodules and gates, shows the specific module
212 :param int viewId: ID of the view.
213 :param Module* module: module to fold
214 :returns: ``True`` on success, ``False`` otherwise.
218 Get positions of all nodes in the view specified by id
220 :param int viewId: ID of the view.
221 :returns: GridPlacement of the specified view.
222 :rtype: GridPlacement
225 Set grid placement to the view specified by id
227 :param int viewId ID of the view.
228 :param GridPlacement* gp: grid placement.
232 Gets the CurrentDirectory.
234 :returns: ID of the current directory. 0, if it's the top level directory.
238 Sets the CurrentDirectory.
240 :param int id ID of the new current directory.
243 Creates a new directory under the current directory.
245 :param string name: Name of the new directory.
246 :returns: ID of the new directory.
250 Deletes the directory specified by a given id.
252 :param int id: ID of the directory to delete.
254 .def_static("moveView", &
GuiApiClasses::View::moveView, py::arg(
"viewId"), py::arg(
"destinationDirectoryId") = py::none(), py::arg(
"row") = py::none(), R
"(
255 Moves a view to a directory.
257 :param int viewId: ID of the view to move.
258 :param int destinationDirectoryId: ID of the destination directory to which the view will be moved.
259 If ``None``, the view is instead moved to the current directory.
260 :param int row: The row index in the parent directory, where the view will be inserted.
262 .def_static("moveDirectory", &
GuiApiClasses::View::moveDirectory, py::arg(
"directoryId"), py::arg(
"destinationDirectoryId") = py::none(), py::arg(
"row") = py::none(), R
"(
263 Moves a directory under another directory.
265 :param int directoryId: ID of the directory to move.
266 :param int destinationDirectoryId: ID of the destination directory to which the directory will be moved.
267 If ``None``, the directory is instead moved to the current directory.
268 :param int row: The row index in the parent directory, where the directory will be inserted.
271 Returns the ids of all direct child directories of a given directory.
273 :param int directoryId: ID of the parent directory, whose direct children will be returned
274 :returns: List of the ids of all direct child directories of the specified directory.
275 Returns ``None``, if the given directory does not exist.
276 :rtype: list[int]|None
279 Returns the ids of all direct child views of a given directory.
281 :param int directoryId: ID of the parent directory, whose direct children will be returned
282 :returns: List of the ids of all direct child views of the specified directory.
283 Returns ``None``, if the given directory does not exist.
284 :rtype: list[int]|None
289 Get the gate ids of currently selected gates in the graph view of the GUI.
291 :returns: List of the ids of the currently selected gates.
296 Get the net ids of currently selected nets in the graph view of the GUI.
298 :returns: List of the ids of the currently selected nets.
303 Get the module ids of currently selected modules in the graph view of the GUI.
305 :returns: List of the ids of the currently selected modules.
310 Get all item ids of the currently selected items in the graph view of the GUI.
312 :returns: Tuple of lists of the currently selected items.
313 :rtype: tuple(int, int, int)
317 Get the gates which are currently selected in the graph view of the GUI.
319 :returns: List of currently selected gates.
320 :rtype: list[hal_py.Gate]
324 Get the nets which are currently selected in the graph view of the GUI.
326 :returns: List of currently selected nets.
327 :rtype: list[hal_py.Net]
331 Get the modules which are currently selected in the graph view of the GUI.
333 :returns: List of currently selected modules.
334 :rtype: list[hal_py.Module]
338 Get all selected items which are currently selected in the graph view of the GUI.
340 :returns: Tuple of currently selected items.
341 :rtype: tuple(hal_py.Gate, hal_py.Net, hal_py.Module)
344 py_gui_api.def("selectGate", py::overload_cast<u32, bool, bool>(&
GuiApi::selectGate), py::arg(
"gate_id"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
345 Select the gate with id 'gate_id' in the graph view of the GUI.
346 If 'clear_current_selection' is ``False``, the gate with the id 'gate_id' will be added to the currently existing selection.
347 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
349 :param int gate_id: The gate id of the gate to be selected.
350 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gate.
351 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
354 py_gui_api.def("selectGate", py::overload_cast<Gate*, bool, bool>(&
GuiApi::selectGate), py::arg(
"gate"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
355 Select the gate in the graph view of the GUI.
356 If 'clear_current_selection' is ``False``, the gate will be added to the currently existing selection.
357 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
359 :param hal_py.Gate gate: The gate to be selected.
360 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gate.
361 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
364 py_gui_api.def("selectGate", py::overload_cast<
const std::vector<u32>&,
bool,
bool>(&
GuiApi::selectGate), py::arg(
"gate_ids"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
365 Select the gates with the ids in list 'gate_ids' in the graph view of the GUI.
366 If 'clear_current_selection' is ``False``, the gate with the id 'gate_id' will be added to the currently existing selection.
367 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
369 :param list[int] gate_ids: List of gate ids of the gates to be selected.
370 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gates.
371 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
374 py_gui_api.def("selectGate", py::overload_cast<
const std::vector<Gate*>&,
bool,
bool>(&
GuiApi::selectGate), py::arg(
"gates"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
375 Select the gates in the graph view of the GUI.
376 If 'clear_current_selection' is ``False``, the gates will be added to the currently existing selection.
377 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
379 :param list[hal_py.Gate] gates: The gates to be selected.
380 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gates.
381 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
384 py_gui_api.def("selectNet", py::overload_cast<u32, bool, bool>(&
GuiApi::selectNet), py::arg(
"mNetId"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
385 Select the net with id 'mNetId' in the graph view of the GUI.
386 If 'clear_current_selection' is ``False``, the net with the id 'mNetId' will be added to the currently existing selection.
387 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
389 :param int mNetId: The net id of the net to be selected.
390 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the net.
391 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
394 py_gui_api.def("selectNet", py::overload_cast<Net*, bool, bool>(&
GuiApi::selectNet), py::arg(
"net"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
395 Select the net in the graph view of the GUI.
396 If 'clear_current_selection' is ``False``, the net will be added to the currently existing selection.
397 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
399 :param hal_py.Net net: The net to be selected.
400 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the net.
401 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
404 py_gui_api.def("selectNet", py::overload_cast<
const std::vector<u32>&,
bool,
bool>(&
GuiApi::selectNet), py::arg(
"net_ids"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
405 Select the nets with the ids in list 'net_ids' in the graph view of the GUI.
406 If 'clear_current_selection' is ``False``, the net with the id 'mNetId' will be added to the currently existing selection.
407 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
409 :param list[int] net_ids: List of net ids of the nets to be selected.
410 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the nets.
411 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
414 py_gui_api.def("selectNet", py::overload_cast<
const std::vector<Net*>&,
bool,
bool>(&
GuiApi::selectNet), py::arg(
"nets"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
415 Select the nets in the graph view of the GUI.
416 If 'clear_current_selection' is ``False``, the nets will be added to the currently existing selection.
417 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
419 :param list[hal_py.Net] nets: The nets to be selected.
420 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the nets.
421 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
424 py_gui_api.def("selectModule", py::overload_cast<u32, bool, bool>(&
GuiApi::selectModule), py::arg(
"module_id"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
425 Select the module with id 'module_id' in the graph view of the GUI.
426 If 'clear_current_selection' is ``False``, the module with the id 'module_id' will be added to the currently existing selection.
427 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
429 :param int module_id: The module id of the module to be selected.
430 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the module.
431 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
434 py_gui_api.def("selectModule", py::overload_cast<Module*, bool, bool>(&
GuiApi::selectModule), py::arg(
"module"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
435 Select the module in the graph view of the GUI.
436 If 'clear_current_selection' is ``False``, the module will be added to the currently existing selection.
437 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
439 :param hal_py.module module: The module to be selected.
440 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the module.
441 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
444 py_gui_api.def("selectModule", py::overload_cast<
const std::vector<u32>&,
bool,
bool>(&
GuiApi::selectModule), py::arg(
"module_ids"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
445 Select the modules with the ids in list 'module_ids' in the graph view of the GUI.
446 If 'clear_current_selection' is ``False``, the module with the id 'module_id' will be added to the currently existing selection.
447 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
449 :param list[int] module_ids: List of module ids of the modules to be selected.
450 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the modules.
451 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
454 py_gui_api.def("selectModule", py::overload_cast<
const std::vector<Module*>&,
bool,
bool>(&
GuiApi::selectModule), py::arg(
"modules"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
455 Select the modules in the graph view of the GUI.
456 If 'clear_current_selection' is ``False``, the modules will be added to the currently existing selection.
457 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
459 :param list[hal_py.module] modules: The modules to be selected.
460 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the modules.
461 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
464 py_gui_api.def("select", py::overload_cast<Gate*, bool, bool>(&
GuiApi::select), py::arg(
"gate"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
465 Select the gate in the graph view of the GUI.
466 If 'clear_current_selection' is ``False``, the gate will be added to the currently existing selection.
467 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
469 :param hal_py.Gate gate: The gate to be selected.
470 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gate.
471 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
474 py_gui_api.def("select", py::overload_cast<Net*, bool, bool>(&
GuiApi::select), py::arg(
"net"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
475 Select the net in the graph view of the GUI.
476 If 'clear_current_selection' is ``False``, the net will be added to the currently existing selection.
477 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
479 :param hal_py.Net net: The net to be selected.
480 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the net.
481 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
484 py_gui_api.def("select", py::overload_cast<Module*, bool, bool>(&
GuiApi::select), py::arg(
"module"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
485 Select the module in the graph view of the GUI.
486 If 'clear_current_selection' is ``False``, the module will be added to the currently existing selection.
487 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
489 :param hal_py.module module: The module to be selected.
490 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the module.
491 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
494 py_gui_api.def("select", py::overload_cast<
const std::vector<Gate*>&,
bool,
bool>(&
GuiApi::select), py::arg(
"gates"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
495 Select the gates in the graph view of the GUI.
496 If 'clear_current_selection' is ``False``, the gates will be added to the currently existing selection.
497 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
499 :param list[hal_py.Gate] gates: The gates to be selected.
500 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gates.
501 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
504 py_gui_api.def("select", py::overload_cast<
const std::vector<Net*>&,
bool,
bool>(&
GuiApi::select), py::arg(
"nets"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
505 Select the nets in the graph view of the GUI.
506 If 'clear_current_selection' is ``False``, the nets will be added to the currently existing selection.
507 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
509 :param list[hal_py.Net] nets: The nets to be selected.
510 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the nets.
511 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
514 py_gui_api.def("select", py::overload_cast<
const std::vector<Module*>&,
bool,
bool>(&
GuiApi::select), py::arg(
"modules"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
515 Select the modules in the graph view of the GUI.
516 If 'clear_current_selection' is ``False``, the modules will be added to the currently existing selection.
517 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
519 :param list[hal_py.module] modules: The modules to be selected.
520 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the modules.
521 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
524 py_gui_api.def("select", py::overload_cast<
const std::vector<u32>&,
const std::vector<u32>&,
const std::vector<u32>&,
bool,
bool>(&
GuiApi::select), py::arg(
"gate_ids"), py::arg(
"net_ids"), py::arg(
"module_ids"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
525 Select the gates, nets and modules with the passed ids in the graph view of the GUI.
526 If 'clear_current_selection' is ``False``, the gates, nets and modules will be added to the currently existing selection.
527 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
529 :param list[hal_py.Gate] gates: The ids of the gates to be selected.
530 :param list[hal_py.Net] nets: The ids of the nets to be selected.
531 :param list[hal_py.module] modules: The ids of the modules to be selected.
532 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the modules.
533 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
536 py_gui_api.def("select", py::overload_cast<
const std::vector<Gate*>&,
const std::vector<Net*>&,
const std::vector<Module*>&,
bool,
bool>(&
GuiApi::select), py::arg(
"gates"), py::arg(
"nets"), py::arg(
"modules"), py::arg(
"clear_current_selection") =
true, py::arg(
"navigate_to_selection") =
true, R
"(
537 Select the gates, nets and modules in the graph view of the GUI.
538 If 'clear_current_selection' is ``False``, the gates, nets and modules will be added to the currently existing selection.
539 If 'navigate_to_selection' is ``False``, the graph view will not modify the graph view camera position to fit all selected items.
541 :param list[hal_py.Gate] gates: The gates to be selected.
542 :param list[hal_py.Net] nets: The nets to be selected.
543 :param list[hal_py.module] modules: The modules to be selected.
544 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the modules.
545 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
548 py_gui_api.def("deselectGate", py::overload_cast<u32>(&
GuiApi::deselectGate), py::arg(
"gate_id"), R
"(
549 Deselect the gate with id 'gate_id' in the graph view of the GUI.
551 :param int gate_id: The gate id of the gate to be selected.
554 py_gui_api.def("deselectGate", py::overload_cast<Gate*>(&
GuiApi::deselectGate), py::arg(
"gate"), R
"(
555 Deselect the gate in the graph view of the GUI.
557 :param hal_py.Gate gate: The gate to be deselected.
560 py_gui_api.def("deselectGate", py::overload_cast<
const std::vector<u32>&>(&
GuiApi::deselectGate), py::arg(
"gate_ids"), R
"(
561 Deselect the gates with the ids in list 'gate_ids' in the graph view of the GUI.
563 :param list[int] gate_ids: List of gate ids of the gates to be deselected.
566 py_gui_api.def("deselectGate", py::overload_cast<
const std::vector<Gate*>&>(&
GuiApi::deselectGate), py::arg(
"gates"), R
"(
567 Deselect the gates in the graph view of the GUI.
569 :param list[hal_py.Gate] gates: The gates to be deselected.
572 py_gui_api.def("deselectNet", py::overload_cast<u32>(&
GuiApi::deselectNet), py::arg(
"mNetId"), R
"(
573 Deselect the net with id 'mNetId' in the graph view of the GUI.
575 :param int mNetId: The net id of the net to be selected.
578 py_gui_api.def("deselectNet", py::overload_cast<Net*>(&
GuiApi::deselectNet), py::arg(
"net"), R
"(
579 Deselect the net in the graph view of the GUI.
581 :param hal_py.Net Net: The net to be deselected.
584 py_gui_api.def("deselectNet", py::overload_cast<
const std::vector<u32>&>(&
GuiApi::deselectNet), py::arg(
"net_ids"), R
"(
585 Deselect the nets with the ids in list 'net_ids' in the graph view of the GUI.
587 :param list[int] net_ids: List of net ids of the nets to be deselected.
590 py_gui_api.def("deselectNet", py::overload_cast<
const std::vector<Net*>&>(&
GuiApi::deselectNet), py::arg(
"nets"), R
"(
591 Deselect the nets in the graph view of the GUI.
593 :param list[hal_py.Net] nets: The nets to be deselected.
596 py_gui_api.def("deselectModule", py::overload_cast<u32>(&
GuiApi::deselectModule), py::arg(
"module_id"), R
"(
597 Deselect the module with id 'module_id' in the graph view of the GUI.
599 :param int module_id: The module id of the module to be selected.
602 py_gui_api.def("deselectModule", py::overload_cast<Module*>(&
GuiApi::deselectModule), py::arg(
"module"), R
"(
603 Deselect the module in the graph view of the GUI.
605 :param hal_py.module module: The module to be deselected.
608 py_gui_api.def("deselectModule", py::overload_cast<
const std::vector<u32>&>(&
GuiApi::deselectModule), py::arg(
"module_ids"), R
"(
609 Deselect the modules with the ids in list 'module_ids' in the graph view of the GUI.
611 :param list[int] module_ids: List of module ids of the modules to be deselected.
614 py_gui_api.def("deselectModule", py::overload_cast<
const std::vector<Module*>&>(&
GuiApi::deselectModule), py::arg(
"modules"), R
"(
615 Deselect the modules in the graph view of the GUI.
617 :param list[hal_py.module] modules: The modules to be deselected.
620 py_gui_api.def("deselect", py::overload_cast<Gate*>(&
GuiApi::deselect), py::arg(
"gate"), R
"(
621 Deselect the gate in the graph view of the GUI.
623 :param hal_py.Gate gate: The gate to be deselected.
626 py_gui_api.def("deselect", py::overload_cast<Net*>(&
GuiApi::deselect), py::arg(
"net"), R
"(
627 Deselect the net in the graph view of the GUI.
629 :param hal_py.Net Net: The net to be deselected.
632 py_gui_api.def("deselect", py::overload_cast<Module*>(&
GuiApi::deselect), py::arg(
"module"), R
"(
633 Deselect the module in the graph view of the GUI.
635 :param hal_py.module module: The module to be deselected.
638 py_gui_api.def("deselect", py::overload_cast<
const std::vector<Gate*>&>(&
GuiApi::deselect), py::arg(
"gates"), R
"(
639 Deselect the gates in the graph view of the GUI.
641 :param list[hal_py.Gate] gates: The gates to be deselected.
644 py_gui_api.def("deselect", py::overload_cast<
const std::vector<Net*>&>(&
GuiApi::deselect), py::arg(
"nets"), R
"(
645 Deselect the nets in the graph view of the GUI.
647 :param list[hal_py.Net] nets: The nets to be deselected.
650 py_gui_api.def("deselect", py::overload_cast<
const std::vector<Module*>&>(&
GuiApi::deselect), py::arg(
"modules"), R
"(
651 Deselect the modules in the graph view of the GUI.
653 :param list[hal_py.module] modules: The modules to be deselected.
656 py_gui_api.def("deselect", py::overload_cast<
const std::vector<u32>&,
const std::vector<u32>&,
const std::vector<u32>&>(&
GuiApi::deselect), py::arg(
"gate_ids"), py::arg(
"net_ids"), py::arg(
"module_ids"), R
"(
657 Deselect the gates, nets and modules with the passed ids in the graph view of the GUI.
659 :param list[hal_py.Gate] gates: The ids of the gates to be deselected.
660 :param list[hal_py.Net] nets: The ids of the nets to be deselected.
661 :param list[hal_py.module] modules: The ids of the modules to be deselected.
664 py_gui_api.def("deselect", py::overload_cast<
const std::vector<Gate*>&,
const std::vector<Net*>&,
const std::vector<Module*>&>(&
GuiApi::deselect), py::arg(
"gates"), py::arg(
"nets"), py::arg(
"modules"), R
"(
665 Deselect the gates, nets and modules in the graph view of the GUI.
667 :param list[hal_py.Gate] gates: The gates to be deselected.
668 :param list[hal_py.Net] nets: The nets to be deselected.
669 :param list[hal_py.module] modules: The modules to be deselected.
673 Deselect all gates, nets and modules in the graph view of the GUI.
678 #ifndef PYBIND11_MODULE
std::pair< int, int > * gatePosition(u32 gateId) const
std::pair< int, int > * modulePosition(u32 moduleId) const
void setGatePosition(u32 gateId, std::pair< int, int >p, bool swap=false)
void setModulePosition(u32 moduleId, std::pair< int, int >p, bool swap=false)
static bool foldModule(int view_id, Module *module)
static void deleteDirectory(u32 id)
static bool unfoldModule(int view_id, Module *module)
static void moveDirectory(u32 directoryId, std::optional< u32 > destinationDirectoryId, std::optional< int > row)
static int getId(const std::string &name)
static bool removeFrom(int id, const std::vector< Module * > modules, const std::vector< Gate * > gates)
static int isolateInNew(const std::vector< Module * > modules, const std::vector< Gate * > gates)
static bool setName(int id, const std::string &name)
static void moveView(u32 viewId, std::optional< u32 > destinationDirectoryId, std::optional< int > row)
static std::string getName(int id)
static GridPlacement * getGridPlacement(int viewId)
static bool setGridPlacement(int viewId, GridPlacement *gp)
static u32 createNewDirectory(const std::string &name)
static std::vector< Gate * > getGates(int id)
static std::optional< std::vector< u32 > > getChildDirectories(u32 directoryId)
static bool addTo(int id, const std::vector< Module * > modules, const std::vector< Gate * > gates)
static std::optional< std::vector< u32 > > getChildViews(u32 directoryId)
static bool deleteView(int id)
static std::vector< Module * > getModules(int id)
static void setCurrentDirectory(u32 id)
static std::vector< u32 > getIds(const std::vector< Module * > modules, const std::vector< Gate * > gates)
static u32 getCurrentDirectory()
void deselectNet(u32 netId)
void deselectModule(u32 module_id)
std::vector< u32 > getSelectedNetIds()
std::tuple< std::vector< Gate * >, std::vector< Net * >, std::vector< Module * > > getSelectedItems()
std::vector< u32 > getSelectedModuleIds()
std::vector< Gate * > getSelectedGates()
std::vector< Net * > getSelectedNets()
void deselect(Gate *gate)
void selectNet(u32 netId, bool clear_current_selection=true, bool navigate_to_selection=true)
void select(Gate *gate, bool clear_current_selection=true, bool navigate_to_selection=true)
std::vector< u32 > getSelectedGateIds()
std::vector< Module * > getSelectedModules()
std::tuple< std::vector< u32 >, std::vector< u32 >, std::vector< u32 > > getSelectedItemIds()
void selectModule(u32 module_id, bool clear_current_selection=true, bool navigate_to_selection=true)
void selectGate(u32 gate_id, bool clear_current_selection=true, bool navigate_to_selection=true)
void deselectGate(u32 gate_id)
PythonThread * pythonThread() const
void forwardError(const QString &output)
void forwardStdout(const QString &output)
Gate * handleGateInput(const QString &prompt)
void handleStdout(const QString &output) override
std::string handleStringInput(const QString &prompt, const QString &defval)
int handleNumberInput(const QString &prompt, int defval)
bool getInput(InputType type, QString prompt, QVariant defaultValue)
std::string handleConsoleInput(const QString &prompt)
Module * handleModuleInput(const QString &prompt)
void handleError(const QString &output) override
std::string handleFilenameInput(const QString &prompt, const QString &filetype)
const Module * module(const Gate *g, const NodeBoxes &boxes)
PythonContext * gPythonContext
QString fromStdString(const std::string &str)