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"
9 #include "pybind11/operators.h"
10 #include "pybind11/pybind11.h"
11 #include "pybind11/stl.h"
12 #include "pybind11/stl_bind.h"
13 #include "pybind11/functional.h"
19 #pragma GCC diagnostic pop
23 namespace py = pybind11;
24 #ifdef PYBIND11_MODULE
26 PYBIND11_MODULE(hal_gui, m)
28 m.doc() =
"hal python bindings";
32 py::module m(
"hal_gui",
"hal gui python bindings");
35 auto py_console = m.def_submodule(
"console", R
"(
39 py_console.def("clear", []() ->
void {
gPythonContext->scheduleClear(); });
40 py_console.def(
"reset", []() ->
void {
gPythonContext->scheduleReset(); });
44 py::module m2 = py_console.def_submodule(
"redirector",
"redirector");
49 m2.def(
"thread_stdin", [](std::string s) -> std::string {
return (
gPythonContext->pythonThread()
52 auto gui_input = m.def_submodule(
"gui_input", R
"(
55 gui_input.def("inputString", [](std::string prompt = std::string(
"Please enter value"), std::string defval = std::string()) ->
59 gui_input.def(
"inputNumber", [](std::string prompt = std::string(
"Please enter number"),
int defval = 0) ->
63 gui_input.def(
"inputGate", [](std::string prompt = std::string(
"Please select gate")) ->
67 gui_input.def(
"inputModule", [](std::string prompt = std::string(
"Please select module")) ->
71 gui_input.def(
"inputFilename", [](std::string prompt = std::string(
"Please select filename"), std::string filetype = std::string()) ->
75 gui_input.def(
"wait_for_menu_selection", []() ->
void {
79 py::class_<GuiApi> py_gui_api(m,
"GuiApi", R
"(GUI API)");
81 py::class_<GridPlacement>(py_gui_api,"GridPlacement",R
"(
82 Helper class to determine placement of nodes on gui grid.
85 .def(py::init<>(), R"(
86 Constructor for empty placement hash.
90 Set position for gate identified by ID.
92 :param int gateId: Gate ID.
93 :param tuple(int,int) pos: New position.
94 :param bool swap: set the swap of positions of the nodes
98 Set position for module identified by ID.
100 :param int moduleId: Module ID.
101 :param tuple(int,int) pos: New position.
102 :param bool swap: set the swap of positions of the nodes
106 Query position for gate identified by ID.
108 :param int gateId: Gate ID.
109 :returns: Position of gate or None if gate not found in hash.
110 :rtype: tuple(int,int) or None
114 Query position for module identified by ID.
116 :param int moduleId: Module ID.
117 :returns: Position of module or None if module not found in hash.
118 :rtype: tuple(int,int) or None
121 py::class_<GuiApiClasses::View>(py_gui_api, "View")
123 Isolates given modules and gates into a new view
125 :param list[hal_py.module] modules: List of modules to be added.
126 :param list[hal_py.Gate] gates: List of gates to be added.
127 :returns: ID of created view or the existing one if view is exclusively bound to a module.
131 Renames the view specified by the given ID.
133 :param int viewId: ID of the view.
134 :param string name: New unique name.
135 :returns: True on success otherwise False.
139 Adds the given modules and gates to the view specified by the ID.
141 :param int viewId: ID of the view.
142 :param list[hal.py.module] modules: Modules to be added.
143 :param list[hal.py.Gate] gates: Gates to be added.
144 :returns: True on success, otherwise False.
148 Deletes the view specified by the ID.
150 :param int viewId: ID of the view.
151 :returns: True on success, otherwise False.
155 Removes the given modules and gates from the view specified by the ID.
157 :param int viewId: ID of the view.
158 :param list[hal.py.module] modules: Modules to be removed.
159 :param list[hal.py.Gate] gates: Gates to be removed.
160 :returns: True on success, otherwise False.
164 Returns the ID of the view with the given name if existing.
166 :param string name: Name of the view.
167 :returns: ID of the specified view or 0 if none is found.
171 Returns the name of the view with the given ID if existing.
173 :param int viewId: ID of the view.
174 :returns: Name of the view specified by the ID or empty string if none is found.
178 Returns all modules attached to the view.
180 :param int viewId: ID of the view.
181 :returns: List of the attached modules.
182 :rtype: list[hal.py.module]
185 Returns all gates attached to the view
187 :param int viewId: ID of the view.
188 :returns: List of the attached gates.
189 :rtype: list[hal.py.Gate]
192 Returns the ID of each View containing at least the given modules and gates.
194 :param list[hal.py.module] modules: Required modules.
195 :param list[hal.py.Gate] gates: Required gates.
196 :returns: List of ID of views which contains modules and gates.
200 Unfold a specific module. Hides the module, shows submodules and gates
202 :param int viewId: ID of the view.
203 :param Module* module: module to unfold
204 :returns: True on success, otherwise False.
208 Fold a specific module. Hides the submodules and gates, shows the specific module
210 :param int viewId: ID of the view.
211 :param Module* module: module to fold
212 :returns: True on success, otherwise False.
216 Get positions of all nodes in the view specified by id
218 :param int viewId: ID of the view.
219 :returns: GridPlacement of the specified view.
220 :rtype: GridPlacement
223 Set grid placement to the view specified by id
225 :param int viewId ID of the view.
226 :param GridPlacement* gp: grid placement.
230 Gets the CurrentDirectory.
232 :returns: ID of the current directory. 0, if it's the top level directory.
236 Sets the CurrentDirectory.
238 :param int id ID of the new current directory.
241 Creates a new directory under the current directory.
243 :param string name: Name of the new directory.
244 :returns: ID of the new directory.
248 Deletes the directory specified by a given id.
250 :param int id: ID of the directory to delete.
252 .def_static("moveView", &
GuiApiClasses::View::moveView, py::arg(
"viewId"), py::arg(
"destinationDirectoryId") = py::none(), py::arg(
"row") = py::none(), R
"(
253 Moves a view to a directory.
255 :param int viewId: ID of the view to move.
256 :param int destinationDirectoryId: ID of the destination directory to which the view will be moved.
257 If None, the view is instead moved to the current directory.
258 :param int row: The row index in the parent directory, where the view will be inserted.
260 .def_static("moveDirectory", &
GuiApiClasses::View::moveDirectory, py::arg(
"directoryId"), py::arg(
"destinationDirectoryId") = py::none(), py::arg(
"row") = py::none(), R
"(
261 Moves a directory under another directory.
263 :param int directoryId: ID of the directory to move.
264 :param int destinationDirectoryId: ID of the destination directory to which the directory will be moved.
265 If None, the directory is instead moved to the current directory.
266 :param int row: The row index in the parent directory, where the directory will be inserted.
269 Returns the ids of all direct child directories of a given directory.
271 :param int directoryId: ID of the parent directory, whose direct children will be returned
272 :returns: List of the ids of all direct child directories of the specified directory.
273 Returns None, if the given directory does not exist.
274 :rtype: list[int]|None
277 Returns the ids of all direct child views of a given directory.
279 :param int directoryId: ID of the parent directory, whose direct children will be returned
280 :returns: List of the ids of all direct child views of the specified directory.
281 Returns None, if the given directory does not exist.
282 :rtype: list[int]|None
287 Get the gate ids of currently selected gates in the graph view of the GUI.
289 :returns: List of the ids of the currently selected gates.
294 Get the net ids of currently selected nets in the graph view of the GUI.
296 :returns: List of the ids of the currently selected nets.
301 Get the module ids of currently selected modules in the graph view of the GUI.
303 :returns: List of the ids of the currently selected modules.
308 Get all item ids of the currently selected items in the graph view of the GUI.
310 :returns: Tuple of lists of the currently selected items.
311 :rtype: tuple(int, int, int)
315 Get the gates which are currently selected in the graph view of the GUI.
317 :returns: List of currently selected gates.
318 :rtype: list[hal_py.Gate]
322 Get the nets which are currently selected in the graph view of the GUI.
324 :returns: List of currently selected nets.
325 :rtype: list[hal_py.Net]
329 Get the modules which are currently selected in the graph view of the GUI.
331 :returns: List of currently selected modules.
332 :rtype: list[hal_py.module]
336 Get all selected items which are currently selected in the graph view of the GUI.
338 :returns: Tuple of currently selected items.
339 :rtype: tuple(hal_py.Gate, hal_py.Net, hal_py.module)
342 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
"(
343 Select the gate with id 'gate_id' in the graph view of the GUI.
344 If 'clear_current_selection' is false, the gate with the id 'gate_id' will be added to the currently existing selection.
345 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
347 :param int gate_id: The gate id of the gate to be selected.
348 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gate.
349 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
352 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
"(
353 Select the gate in the graph view of the GUI.
354 If 'clear_current_selection' is false, the gate will be added to the currently existing selection.
355 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
357 :param hal_py.Gate gate: The gate to be selected.
358 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gate.
359 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
362 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
"(
363 Select the gates with the ids in list 'gate_ids' in the graph view of the GUI.
364 If 'clear_current_selection' is false, the gate with the id 'gate_id' will be added to the currently existing selection.
365 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
367 :param list[int] gate_ids: List of gate ids of the gates to be selected.
368 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gates.
369 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
372 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
"(
373 Select the gates in the graph view of the GUI.
374 If 'clear_current_selection' is false, the gates will be added to the currently existing selection.
375 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
377 :param list[hal_py.Gate] gates: The gates to be selected.
378 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gates.
379 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
382 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
"(
383 Select the net with id 'mNetId' in the graph view of the GUI.
384 If 'clear_current_selection' is false, the net with the id 'mNetId' will be added to the currently existing selection.
385 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
387 :param int mNetId: The net id of the net to be selected.
388 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the net.
389 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
392 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
"(
393 Select the net in the graph view of the GUI.
394 If 'clear_current_selection' is false, the net will be added to the currently existing selection.
395 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
397 :param hal_py.Net net: The net to be selected.
398 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the net.
399 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
402 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
"(
403 Select the nets with the ids in list 'net_ids' in the graph view of the GUI.
404 If 'clear_current_selection' is false, the net with the id 'mNetId' will be added to the currently existing selection.
405 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
407 :param list[int] net_ids: List of net ids of the nets to be selected.
408 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the nets.
409 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
412 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
"(
413 Select the nets in the graph view of the GUI.
414 If 'clear_current_selection' is false, the nets will be added to the currently existing selection.
415 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
417 :param list[hal_py.Net] nets: The nets to be selected.
418 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the nets.
419 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
422 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
"(
423 Select the module with id 'module_id' in the graph view of the GUI.
424 If 'clear_current_selection' is false, the module with the id 'module_id' will be added to the currently existing selection.
425 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
427 :param int module_id: The module id of the module to be selected.
428 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the module.
429 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
432 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
"(
433 Select the module in the graph view of the GUI.
434 If 'clear_current_selection' is false, the module will be added to the currently existing selection.
435 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
437 :param hal_py.module module: The module to be selected.
438 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the module.
439 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
442 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
"(
443 Select the modules with the ids in list 'module_ids' in the graph view of the GUI.
444 If 'clear_current_selection' is false, the module with the id 'module_id' will be added to the currently existing selection.
445 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
447 :param list[int] module_ids: List of module ids of the modules to be selected.
448 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the modules.
449 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
452 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
"(
453 Select the modules in the graph view of the GUI.
454 If 'clear_current_selection' is false, the modules will be added to the currently existing selection.
455 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
457 :param list[hal_py.module] modules: The modules to be selected.
458 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the modules.
459 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
462 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
"(
463 Select the gate in the graph view of the GUI.
464 If 'clear_current_selection' is false, the gate will be added to the currently existing selection.
465 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
467 :param hal_py.Gate gate: The gate to be selected.
468 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gate.
469 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
472 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
"(
473 Select the net in the graph view of the GUI.
474 If 'clear_current_selection' is false, the net will be added to the currently existing selection.
475 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
477 :param hal_py.Net net: The net to be selected.
478 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the net.
479 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
482 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
"(
483 Select the module in the graph view of the GUI.
484 If 'clear_current_selection' is false, the module will be added to the currently existing selection.
485 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
487 :param hal_py.module module: The module to be selected.
488 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the module.
489 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
492 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
"(
493 Select the gates in the graph view of the GUI.
494 If 'clear_current_selection' is false, the gates will be added to the currently existing selection.
495 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
497 :param list[hal_py.Gate] gates: The gates to be selected.
498 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the gates.
499 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
502 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
"(
503 Select the nets in the graph view of the GUI.
504 If 'clear_current_selection' is false, the nets will be added to the currently existing selection.
505 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
507 :param list[hal_py.Net] nets: The nets to be selected.
508 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the nets.
509 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
512 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
"(
513 Select the modules in the graph view of the GUI.
514 If 'clear_current_selection' is false, the modules will be added to the currently existing selection.
515 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
517 :param list[hal_py.module] modules: The modules to be selected.
518 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the modules.
519 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
522 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
"(
523 Select the gates, nets and modules with the passed ids in the graph view of the GUI.
524 If 'clear_current_selection' is false, the gates, nets and modules will be added to the currently existing selection.
525 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
527 :param list[hal_py.Gate] gates: The ids of the gates to be selected.
528 :param list[hal_py.Net] nets: The ids of the nets to be selected.
529 :param list[hal_py.module] modules: The ids of the modules to be selected.
530 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the modules.
531 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
534 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
"(
535 Select the gates, nets and modules in the graph view of the GUI.
536 If 'clear_current_selection' is false, the gates, nets and modules will be added to the currently existing selection.
537 If 'navigate_to_selection' is false, the graph view will not modify the graph view camera position to fit all selected items.
539 :param list[hal_py.Gate] gates: The gates to be selected.
540 :param list[hal_py.Net] nets: The nets to be selected.
541 :param list[hal_py.module] modules: The modules to be selected.
542 :param bool clear_current_selection: Determines if the previous selection gets cleared before the selection of the modules.
543 :param bool navigate_to_selection: Determines if the graph view scrolls and zooms to show all selected items.
546 py_gui_api.def("deselectGate", py::overload_cast<u32>(&
GuiApi::deselectGate), py::arg(
"gate_id"), R
"(
547 Deselect the gate with id 'gate_id' in the graph view of the GUI.
549 :param int gate_id: The gate id of the gate to be selected.
552 py_gui_api.def("deselectGate", py::overload_cast<Gate*>(&
GuiApi::deselectGate), py::arg(
"gate"), R
"(
553 Deselect the gate in the graph view of the GUI.
555 :param hal_py.Gate gate: The gate to be deselected.
558 py_gui_api.def("deselectGate", py::overload_cast<
const std::vector<u32>&>(&
GuiApi::deselectGate), py::arg(
"gate_ids"), R
"(
559 Deselect the gates with the ids in list 'gate_ids' in the graph view of the GUI.
561 :param list[int] gate_ids: List of gate ids of the gates to be deselected.
564 py_gui_api.def("deselectGate", py::overload_cast<
const std::vector<Gate*>&>(&
GuiApi::deselectGate), py::arg(
"gates"), R
"(
565 Deselect the gates in the graph view of the GUI.
567 :param list[hal_py.Gate] gates: The gates to be deselected.
570 py_gui_api.def("deselectNet", py::overload_cast<u32>(&
GuiApi::deselectNet), py::arg(
"mNetId"), R
"(
571 Deselect the net with id 'mNetId' in the graph view of the GUI.
573 :param int mNetId: The net id of the net to be selected.
576 py_gui_api.def("deselectNet", py::overload_cast<Net*>(&
GuiApi::deselectNet), py::arg(
"net"), R
"(
577 Deselect the net in the graph view of the GUI.
579 :param hal_py.Net Net: The net to be deselected.
582 py_gui_api.def("deselectNet", py::overload_cast<
const std::vector<u32>&>(&
GuiApi::deselectNet), py::arg(
"net_ids"), R
"(
583 Deselect the nets with the ids in list 'net_ids' in the graph view of the GUI.
585 :param list[int] net_ids: List of net ids of the nets to be deselected.
588 py_gui_api.def("deselectNet", py::overload_cast<
const std::vector<Net*>&>(&
GuiApi::deselectNet), py::arg(
"nets"), R
"(
589 Deselect the nets in the graph view of the GUI.
591 :param list[hal_py.Net] nets: The nets to be deselected.
594 py_gui_api.def("deselectModule", py::overload_cast<u32>(&
GuiApi::deselectModule), py::arg(
"module_id"), R
"(
595 Deselect the module with id 'module_id' in the graph view of the GUI.
597 :param int module_id: The module id of the module to be selected.
600 py_gui_api.def("deselectModule", py::overload_cast<Module*>(&
GuiApi::deselectModule), py::arg(
"module"), R
"(
601 Deselect the module in the graph view of the GUI.
603 :param hal_py.module module: The module to be deselected.
606 py_gui_api.def("deselectModule", py::overload_cast<
const std::vector<u32>&>(&
GuiApi::deselectModule), py::arg(
"module_ids"), R
"(
607 Deselect the modules with the ids in list 'module_ids' in the graph view of the GUI.
609 :param list[int] module_ids: List of module ids of the modules to be deselected.
612 py_gui_api.def("deselectModule", py::overload_cast<
const std::vector<Module*>&>(&
GuiApi::deselectModule), py::arg(
"modules"), R
"(
613 Deselect the modules in the graph view of the GUI.
615 :param list[hal_py.module] modules: The modules to be deselected.
618 py_gui_api.def("deselect", py::overload_cast<Gate*>(&
GuiApi::deselect), py::arg(
"gate"), R
"(
619 Deselect the gate in the graph view of the GUI.
621 :param hal_py.Gate gate: The gate to be deselected.
624 py_gui_api.def("deselect", py::overload_cast<Net*>(&
GuiApi::deselect), py::arg(
"net"), R
"(
625 Deselect the net in the graph view of the GUI.
627 :param hal_py.Net Net: The net to be deselected.
630 py_gui_api.def("deselect", py::overload_cast<Module*>(&
GuiApi::deselect), py::arg(
"module"), R
"(
631 Deselect the module in the graph view of the GUI.
633 :param hal_py.module module: The module to be deselected.
636 py_gui_api.def("deselect", py::overload_cast<
const std::vector<Gate*>&>(&
GuiApi::deselect), py::arg(
"gates"), R
"(
637 Deselect the gates in the graph view of the GUI.
639 :param list[hal_py.Gate] gates: The gates to be deselected.
642 py_gui_api.def("deselect", py::overload_cast<
const std::vector<Net*>&>(&
GuiApi::deselect), py::arg(
"nets"), R
"(
643 Deselect the nets in the graph view of the GUI.
645 :param list[hal_py.Net] nets: The nets to be deselected.
648 py_gui_api.def("deselect", py::overload_cast<
const std::vector<Module*>&>(&
GuiApi::deselect), py::arg(
"modules"), R
"(
649 Deselect the modules in the graph view of the GUI.
651 :param list[hal_py.module] modules: The modules to be deselected.
654 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
"(
655 Deselect the gates, nets and modules with the passed ids in the graph view of the GUI.
657 :param list[hal_py.Gate] gates: The ids of the gates to be deselected.
658 :param list[hal_py.Net] nets: The ids of the nets to be deselected.
659 :param list[hal_py.module] modules: The ids of the modules to be deselected.
662 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
"(
663 Deselect the gates, nets and modules in the graph view of the GUI.
665 :param list[hal_py.Gate] gates: The gates to be deselected.
666 :param list[hal_py.Net] nets: The nets to be deselected.
667 :param list[hal_py.module] modules: The modules to be deselected.
671 Deselect all gates, nets and modules in the graph view of the GUI.
676 #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)
const Module * module(const Gate *g, const NodeBoxes &boxes)
PythonContext * gPythonContext
QString fromStdString(const std::string &str)