HAL
netlist_relay.cpp
Go to the documentation of this file.
2 
4 #include "gui/gui_globals.h"
20 #include "hal_core/netlist/gate.h"
23 #include "hal_core/netlist/net.h"
24 
25 #include <QApplication>
26 #include <QColorDialog>
27 #include <QDebug>
28 #include <QInputDialog>
29 #include <functional>
30 
31 namespace hal
32 {
34  : QObject(parent), mModuleColorManager(new ModuleColorManager(this))
35  {
38  }
39 
41  {
43  }
44 
46  {
47  if (!gNetlist)
48  return; // no netlist -> no registered callbacks
49  gNetlist->get_event_handler()->unregister_callback("gui_netlist_handler");
50  gNetlist->get_event_handler()->unregister_callback("gui_module_handler");
51  gNetlist->get_event_handler()->unregister_callback("gui_gate_handler");
52  gNetlist->get_event_handler()->unregister_callback("gui_net_handler");
53  gNetlist->get_event_handler()->unregister_callback("gui_grouping_handler");
54  }
55 
57  {
59  "gui_netlist_handler",
60  std::function<void(NetlistEvent::event, Netlist*, u32)>(std::bind(&NetlistRelay::relayNetlistEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
61 
63  "gui_module_handler",
64  std::function<void(ModuleEvent::event, Module*, u32)>(std::bind(&NetlistRelay::relayModuleEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
65 
67  "gui_gate_handler", std::function<void(GateEvent::event, Gate*, u32)>(std::bind(&NetlistRelay::relayGateEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
68 
70  "gui_net_handler", std::function<void(NetEvent::event, Net*, u32)>(std::bind(&NetlistRelay::relayNetEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
71 
73  "gui_grouping_handler",
74  std::function<void(GroupingEvent::event, Grouping*, u32)>(std::bind(&NetlistRelay::relayGroupingEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
75  }
76 
77  void NetlistRelay::handleNetlistModified()
78  {
79  if (!mNotified)
80  {
81  mNotified = true;
83  }
84  }
85 
87  {
88  return mModuleColorManager->moduleColor(id);
89  }
90 
92  {
93  return mModuleColorManager;
94  }
95 
97  {
98  QString oldName;
99  QString prompt;
100  UserActionObject uao;
101 
103  {
104  Module* m = gNetlist->get_module_by_id(id);
105  assert(m);
106  oldName = QString::fromStdString(m->get_name());
107  prompt = "Change module name";
109  }
111  {
112  Gate* g = gNetlist->get_gate_by_id(id);
113  assert(g);
114  oldName = QString::fromStdString(g->get_name());
115  prompt = "Change gate name";
117  }
119  {
120  Net* n = gNetlist->get_net_by_id(id);
121  assert(n);
122  oldName = QString::fromStdString(n->get_name());
123  prompt = "Change net name";
125  }
126  else return;
127 
128  bool confirm;
129  QString newName =
130  QInputDialog::getText(nullptr, prompt, "New name:", QLineEdit::Normal,
131  oldName, &confirm);
132  if (confirm)
133  {
134  ActionRenameObject* act = new ActionRenameObject(newName);
135  act->setObject(uao);
136  act->exec();
137  }
138  }
139 
141  {
142  // NOT THREADSAFE
143 
144  Module* m = gNetlist->get_module_by_id(id);
145  assert(m);
146 
147  bool ok;
148  QString text = QInputDialog::getText(nullptr, "Change Module Type", "New Type", QLineEdit::Normal, QString::fromStdString(m->get_type()), &ok);
149 
150  if (ok)
151  {
152  ActionSetObjectType* act = new ActionSetObjectType(text);
154  act->exec();
155  }
156  }
157 
159  {
160  // NOT THREADSAFE
161 
162  Module* m = gNetlist->get_module_by_id(id);
163  assert(m);
164 
165  QColor color = QColorDialog::getColor();
166 
167  if (!color.isValid())
168  return;
169 
170  ActionSetObjectColor* act = new ActionSetObjectColor(color);
172  act->exec();
173  }
174 
176  {
177  // prepare set of content, find first (reference-) node
178  Node firstNode = node;
179  QSet<u32> gatIds;
180  QSet<u32> modIds;
181 
183  Q_ASSERT(context);
184 
185  // exclusive module view will update automatically if module elements get moved
186  bool specialUpdateRequired = !context->getExclusiveModuleId();
187 
188  if (node.isNull())
189  {
191  {
192  if (specialUpdateRequired && ! context->gates().contains(id))
193  specialUpdateRequired = false;
194  if (firstNode.isNull()) firstNode = Node(id,Node::Gate);
195  gatIds.insert(id);
196  }
197 
199  {
200  if (specialUpdateRequired && ! context->modules().contains(id))
201  specialUpdateRequired = false;
202  if (firstNode.isNull()) firstNode = Node(id,Node::Module);
203  modIds.insert(id);
204  }
205  }
206  else if (node.isModule())
207  modIds.insert(node.id());
208  else
209  gatIds.insert(node.id());
210  if (firstNode.isNull()) return; // nothing to move
211 
212  // find common parent, if nullptr top_level was selected => abort
213  std::unordered_set<Gate*> gatsContent;
214  for (u32 id : gatIds)
215  gatsContent.insert(gNetlist->get_gate_by_id(id));
216 
217  std::unordered_set<Module*> modsContent;
218  for (u32 id : modIds)
219  modsContent.insert(gNetlist->get_module_by_id(id));
220 
221  Module* parentModule = gui_utility::firstCommonAncestor(modsContent, gatsContent);
222  if (!parentModule) return;
223  QString parentName = QString::fromStdString(parentModule->get_name());
224 
225  ModuleDialog md({},"Move to module",false,nullptr,qApp->activeWindow());
226  if (md.exec() != QDialog::Accepted) return;
227 
228 
229  UserActionCompound* compound = new UserActionCompound;
230  compound->setUseCreatedObject();
231 
232  if (md.isNewModule())
233  {
234  bool ok;
235  QString name = QInputDialog::getText(nullptr, "",
236  "New module will be created under \"" + parentName + "\"\nModule Name:",
237  QLineEdit::Normal, "", &ok);
238  if (!ok || name.isEmpty()) return;
240  actNewModule->setParentId(parentModule->get_id());
241  compound->addAction(actNewModule);
242  compound->addAction(new ActionAddItemsToObject(modIds,gatIds));
243  }
244  else
245  {
246  u32 targetModuleId = md.selectedId();
247  ActionAddItemsToObject* actAddItems = new ActionAddItemsToObject(modIds,gatIds);
248  actAddItems->setObject(UserActionObject(targetModuleId,UserActionObjectType::Module));
249  compound->addAction(actAddItems);
250  specialUpdateRequired = false;
251  }
252 
253  // move module to position of first content node
254  const NodeBox* box = context->getLayouter()->boxes().boxForNode(firstNode);
255  if (box && (specialUpdateRequired || context->getExclusiveModuleId()))
256  {
257  ActionMoveNode* actMoveNode = new ActionMoveNode(context->id(), QPoint(box->x(),box->y()));
258  compound->addAction(actMoveNode);
259  }
260 
261  if (specialUpdateRequired)
262  {
263  context->setSpecialUpdate(true);
264  context->setScheduleRemove(modIds,gatIds);
265  }
266 
267  compound->exec();
268 
269  // update selection
271  gSelectionRelay->addModule(compound->object().id());
275  }
276 
278  {
279  // NOT THREADSAFE
280 
281  bool ok;
282  QString name = QInputDialog::getText(nullptr, "", "Module Name:", QLineEdit::Normal, "", &ok);
283 
284  if (!ok || name.isEmpty())
285  return;
286 
287  Module* m = gNetlist->get_module_by_id(id);
288 
289  if (!m)
290  return;
291 
293  act->setParentId(id);
294  act->exec();
295  }
296 
298  {
301 
303  if (ctx)
304  {
305  // module exclusively connected to context, so delete context too
309  compnd->addAction(delCtx);
310  compnd->addAction(delMod);
311  compnd->exec();
312  }
313  else
314  {
315  delMod->exec();
316  }
317  }
318 
320  {
321  mNotified = false;
322  }
323 
324  void NetlistRelay::relayNetlistEvent(NetlistEvent::event ev, Netlist* object, u32 associated_data)
325  {
326  if (!object)
327  return; // SHOULD NEVER BE REACHED
328 
329  if (object != gNetlist)
330  return;
331 
332  handleNetlistModified();
333 
334  if (dynamic_cast<PythonThread*>(QThread::currentThread()))
335  {
336  Q_EMIT signalThreadEvent(TetNetlist, (int)ev, object, associated_data);
337  qApp->processEvents();
338  return;
339  }
340 
341  switch (ev)
342  {
345 
346  Q_EMIT netlistIdChanged(object, associated_data);
347  break;
348  }
351 
353  break;
354  }
357 
359  break;
360  }
363 
365  break;
366  }
369 
370  Q_EMIT netlistMarkedGlobalVcc(object, associated_data);
371  break;
372  }
375 
376  Q_EMIT netlistMarkedGlobalGnd(object, associated_data);
377  break;
378  }
381 
382  Q_EMIT netlistUnmarkedGlobalVcc(object, associated_data);
383  break;
384  }
387 
388  Q_EMIT netlistUnmarkedGlobalGnd(object, associated_data);
389  break;
390  }
394 
395  Q_EMIT netlistMarkedGlobalInput(object, associated_data);
396  break;
397  }
401 
402  Q_EMIT netlistMarkedGlobalOutput(object, associated_data);
403  break;
404  }
408 
409  Q_EMIT netlistUnmarkedGlobalInput(object, associated_data);
410  break;
411  }
415 
416  Q_EMIT netlistUnmarkedGlobalOutput(object, associated_data);
417  break;
418  }
419  }
420  }
421 
422  void NetlistRelay::relayGroupingEvent(GroupingEvent::event ev, Grouping* grp, u32 associated_data)
423  {
424  if (!grp)
425  return; // SHOULD NEVER BE REACHED
426 
427  if (grp->get_netlist() != gNetlist)
428  return;
429 
430  handleNetlistModified();
431 
432  if (dynamic_cast<PythonThread*>(QThread::currentThread()))
433  {
434  Q_EMIT signalThreadEvent(TetGrouping, (int)ev, grp, associated_data);
435  qApp->processEvents();
436  return;
437  }
438 
439  switch (ev)
440  {
442  Q_EMIT groupingCreated(grp);
443  break;
445  Q_EMIT groupingRemoved(grp);
446  break;
449  break;
452  break;
454  Q_EMIT groupingGateAssigned(grp, associated_data);
455  break;
457  Q_EMIT groupingGateRemoved(grp, associated_data);
458  break;
460  Q_EMIT groupingNetAssigned(grp, associated_data);
461  break;
463  Q_EMIT groupingNetRemoved(grp, associated_data);
464  break;
466  Q_EMIT groupingModuleAssigned(grp, associated_data);
467  break;
469  Q_EMIT groupingModuleRemoved(grp, associated_data);
470  break;
471  }
472  }
473 
474  void NetlistRelay::relayModuleEvent(ModuleEvent::event ev, Module* mod, u32 associated_data)
475  {
476  if (!mod)
477  return; // SHOULD NEVER BE REACHED
478 
479  if (mod->get_netlist() != gNetlist)
480  return;
481 
482  handleNetlistModified();
483 
484  if (dynamic_cast<PythonThread*>(QThread::currentThread()))
485  {
486  Q_EMIT signalThreadEvent(TetModule, (int)ev, mod, associated_data);
487  qApp->processEvents();
488  return;
489  }
490 
491  switch (ev)
492  {
494  //< no associated_data
495 
496  // suppress actions if we receive this for the top module
497  if (mod->get_parent_module() != nullptr)
498  {
499  mModuleColorManager->setRandomColor(mod->get_id());
500  }
501 
503 
504  Q_EMIT moduleCreated(mod);
505  break;
506  }
508  //< no associated_data
509 
510  mModuleColorManager->removeColor(mod->get_id());
511 
513  gSelectionRelay->handleModuleRemoved(mod->get_id());
515  Q_EMIT moduleRemoved(mod);
516  break;
517  }
519  //< no associated_data
520 
522 
524  break;
525  }
527  //< no associated_data
528 
530  break;
531  }
533  //< associated_data = id of added module
534 
535  gGraphContextManager->handleModuleSubmoduleAdded(mod, associated_data);
536 
537  Q_EMIT moduleSubmoduleAdded(mod, associated_data);
538  break;
539  }
541  //< associated_data = id of removed module
542 
543  gGraphContextManager->handleModuleSubmoduleRemoved(mod, associated_data);
544 
545  Q_EMIT moduleSubmoduleRemoved(mod, associated_data);
546  break;
547  }
549  //< associated_data = id of inserted gate
550 
551  gGraphContextManager->handleModuleGateAssigned(mod, associated_data);
552 
553  Q_EMIT moduleGateAssigned(mod, associated_data);
554  break;
555  }
557  //< associated_data = id of removed gate
558 
559  gGraphContextManager->handleModuleGateRemoved(mod, associated_data);
560 
561  Q_EMIT moduleGateRemoved(mod, associated_data);
562  break;
563  }
565  //< associated_data = [4LSB: type of action] [28HSB: id of pin group or pin]
566  PinEvent pev = (PinEvent) (associated_data&0xF);
567  u32 id = (associated_data >> 4);
568 
569  /* Dump pin event for debugging
570  std::cerr << "Pin Event <" << enum_to_string<PinEvent>(pev) << "> ID=" << id << "\n";
571  for (PinGroup<ModulePin>* pg : mod->get_pin_groups())
572  {
573  std::cerr << " " << pg->get_start_index() << " " << pg->get_name() << " [" << pg->get_id() << "]"
574  << (pg->is_ascending() ? " asc\n" : " desc\n");
575  for (ModulePin* pin : pg->get_pins())
576  std::cerr << " " << pg->get_index(pin).get() << " " << pin->get_name() << "\n";
577  }
578  std::cerr << "---------------------" << std::endl;
579  */
580 
582 
583  Q_EMIT modulePortsChanged(mod,pev,id);
584  break;
585  }
587  //< no associated_data
588 
590 
592  break;
593  }
595  //< associated_data = number of gates
596 
597  Q_EMIT moduleGatesAssignBegin(mod, associated_data);
598  break;
599  }
601  //< associated_data = number of gates
602 
603  Q_EMIT moduleGatesAssignEnd(mod, associated_data);
604  break;
605  }
607  //< associated_data = number of gates
608 
609  Q_EMIT moduleGatesRemoveBegin(mod, associated_data);
610  break;
611  }
613  //< associated_data = number of gates
614 
615  Q_EMIT moduleGatesRemoveEnd(mod, associated_data);
616  break;
617  }
618  }
619  }
620 
621  void NetlistRelay::relayGateEvent(GateEvent::event ev, Gate* gat, u32 associated_data)
622  {
623  UNUSED(associated_data);
624  if (!gat)
625  return; // SHOULD NEVER BE REACHED
626 
627  if (gat->get_netlist() != gNetlist)
628  return;
629 
630  handleNetlistModified();
631 
632  if (dynamic_cast<PythonThread*>(QThread::currentThread()))
633  {
634  Q_EMIT signalThreadEvent(TetGate, (int)ev, gat, associated_data);
635  qApp->processEvents();
636  return;
637  }
638 
639  switch (ev)
640  {
642  //< no associated_data
643 
644  Q_EMIT gateCreated(gat);
645  break;
646  }
648  //< no associated_data
649 
650  gSelectionRelay->handleGateRemoved(gat->get_id());
651 
653 
654  Q_EMIT gateRemoved(gat);
655  break;
656  }
658  //< no associated_data
659 
661 
662  Q_EMIT gateNameChanged(gat);
663  break;
664  }
666  //< no associated_data
667 
669  break;
670  }
672  //< no associated_data
673 
675  break;
676  }
677  default:
678  break;
679  }
680  }
681 
682  void NetlistRelay::relayNetEvent(NetEvent::event ev, Net* net, u32 associated_data)
683  {
684  if (!net)
685  return; // SHOULD NEVER BE REACHED
686 
687  if (net->get_netlist() != gNetlist)
688  return;
689 
690  handleNetlistModified();
691 
692  if (dynamic_cast<PythonThread*>(QThread::currentThread()))
693  {
694  Q_EMIT signalThreadEvent(TetNet, (int)ev, net, associated_data);
695  qApp->processEvents();
696  return;
697  }
698 
699  switch (ev)
700  {
702  //< no associated_data
703 
705 
707  break;
708  }
710  //< no associated_data
711 
714 
716  break;
717  }
719  //< no associated_data
720 
722 
724  break;
725  }
726  // FIXME add src_added, src_removed
727  // case NetEvent::event::src_changed:
728  // {
729  // //< no associated_data
730 
731  // gGraphContextManager->handle_net_source_changed(object);
732 
733  // Q_EMIT net_source_changed(object);
734  // break;
735  // }
737  //< associated_data = id of src gate
738 
739  gGraphContextManager->handleNetSourceAdded(net, associated_data);
740 
741  Q_EMIT netSourceAdded(net, associated_data);
742  break;
743  }
745  //< associated_data = id of src gate
746 
748 
749  Q_EMIT netSourceRemoved(net, associated_data);
750  break;
751  }
753  //< associated_data = id of dst gate
754 
756 
757  Q_EMIT netDestinationAdded(net, associated_data);
758  break;
759  }
761  //< associated_data = id of dst gate
762 
764 
765  Q_EMIT netDestinationRemoved(net, associated_data);
766  break;
767  }
768  }
769  }
770 
771  void NetlistRelay::handleThreadEvent(int type, int evt, void* object, u32 associated_data)
772  {
773  switch (type)
774  {
775  case TetNetlist:
776  // qDebug() << "Evt nlst" << evt << associated_data;
777  relayNetlistEvent((NetlistEvent::event)evt, static_cast<Netlist*>(object), associated_data);
778  break;
779  case TetModule:
780  // qDebug() << "Evt modu" << evt << static_cast<Module*>(object)->get_id() << associated_data;
781  relayModuleEvent((ModuleEvent::event)evt, static_cast<Module*>(object), associated_data);
782  break;
783  case TetGate:
784  // qDebug() << "Evt gate" << evt << static_cast<Gate*>(object)->get_id() << associated_data;
785  relayGateEvent((GateEvent::event)evt, static_cast<Gate*>(object), associated_data);
786  break;
787  case TetNet:
788  // qDebug() << "Evt net_" << evt << static_cast<Net*>(object)->get_id() << associated_data;
789  relayNetEvent((NetEvent::event)evt, static_cast<Net*>(object), associated_data);
790  break;
791  case TetGrouping:
792  // qDebug() << "Evt grup" << evt << static_cast<Grouping*>(object)->get_id() << associated_data;
793  relayGroupingEvent((GroupingEvent::event)evt, static_cast<Grouping*>(object), associated_data);
794  break;
795  }
796  }
797 
798  void NetlistRelay::dumpModuleRecursion(Module *m)
799  {
800  for (int i=0; i<m->get_submodule_depth(); i++)
801  std::cerr << " ";
802  std::cerr << "Mod " << m->get_id() << " <" << m->get_name() << ">\n";
803  for (Module* sm : m->get_submodules())
804  dumpModuleRecursion(sm);
805  }
806 
808  {
809  for (Module* m : gNetlist->get_modules())
810  mModuleColorManager->setRandomColor(m->get_id());
811  mColorSerializer.restore(mModuleColorManager);
812  }
813 
815  {
816  }
817 } // namespace hal
Adds an item to a module or grouping.
Assigns a new type to a module.
GraphTabWidget * getGraphTabWidget()
Get hal's graph tab widget.
ContextManagerWidget * getContextManagerWidget()
NETLIST_API void unregister_callback(const std::string &name)
NETLIST_API void register_callback(const std::string &name, std::function< void(NetlistEvent::event e, Netlist *netlist, u32 associated_data)> function)
static FileManager * get_instance()
void fileOpened(const QString &fileName)
@ boolean_function_changed
no associated_data
@ location_changed
no associated_data
@ removed
no associated_data
@ name_changed
no associated_data
@ created
no associated_data
Definition: gate.h:58
Logical container for modules, gates, and nets.
Definition: graph_context.h:55
void setSpecialUpdate(bool state)
u32 getExclusiveModuleId() const
const QSet< u32 > & gates() const
const QSet< u32 > & modules() const
void setScheduleRemove(const QSet< u32 > &mods, const QSet< u32 > &gats)
GraphLayouter * getLayouter() const
void handleModuleNameChanged(Module *m) const
void handleMarkedGlobalOutput(u32 mNetId)
void handleNetNameChanged(Net *n) const
void handleModuleTypeChanged(Module *m) const
GraphContext * getContextByExclusiveModuleId(u32 module_id) const
void handleMarkedGlobalInput(u32 mNetId)
void handleNetDestinationRemoved(Net *n, const u32 dst_gate_id) const
void handleGateRemoved(Gate *g) const
void handleModuleGateAssigned(Module *m, const u32 inserted_gate) const
void handleNetSourceRemoved(Net *n, const u32 src_gate_id) const
void handleUnmarkedGlobalOutput(u32 mNetId)
void handleUnmarkedGlobalInput(u32 mNetId)
void handleNetDestinationAdded(Net *n, const u32 dst_gate_id) const
void handleModuleCreated(Module *m) const
void handleModuleSubmoduleAdded(Module *m, const u32 added_module) const
void handleModulePortsChanged(Module *m, PinEvent pev, u32 pgid)
void handleModuleGateRemoved(Module *m, const u32 removed_gate)
void handleModuleSubmoduleRemoved(Module *m, const u32 removed_module)
void handleNetSourceAdded(Net *n, const u32 src_gate_id) const
void handleGateNameChanged(Gate *g) const
const NodeBoxes & boxes() const
@ net_assigned
associated_data = id of inserted net
@ module_removed
associated_data = id of removed module
@ color_changed
no associated_data
@ gate_assigned
associated_data = id of inserted gate
@ module_assigned
associated_data = id of inserted module
@ gate_removed
associated_data = id of removed gate
@ removed
no associated_data
@ net_removed
associated_data = id of removed net
@ name_changed
no associated_data
@ created
no associated_data
QColor moduleColor(u32 id) const
void restore(ModuleColorManager *mcm)
The ModuleDialog class opens a popup window for module selection.
Definition: module_dialog.h:63
bool isNewModule() const
Definition: module_dialog.h:87
u32 selectedId() const
Definition: module_dialog.h:80
@ gates_remove_end
associated_data = number of removed gates
@ gate_assigned
associated_data = id of inserted gate
@ gate_removed
associated_data = id of removed gate
@ pin_changed
associated_data = [4LSB: type of action] [28HSB: id of pin group or pin]
@ submodule_removed
associated_data = id of removed module
@ gates_assign_begin
associated_data = number of gates to assign
@ type_changed
no associated_data
@ gates_assign_end
associated_data = number of assigned gates
@ gates_remove_begin
associated_data = number of gates to remove
@ submodule_added
associated_data = id of added module
@ removed
no associated_data
@ parent_changed
no associated_data
@ name_changed
no associated_data
@ created
no associated_data
int get_submodule_depth() const
Definition: module.cpp:159
std::string get_name() const
Definition: module.cpp:87
std::vector< Module * > get_submodules(const std::function< bool(Module *)> &filter=nullptr, bool recursive=false) const
Definition: module.cpp:261
std::string get_type() const
Definition: module.cpp:106
u32 get_id() const
Definition: module.cpp:82
@ src_added
associated_data = id of src gate
@ dst_removed
associated_data = id of dst gate
@ src_removed
associated_data = id of src gate
@ dst_added
associated_data = id of dst gate
@ removed
no associated_data
@ name_changed
no associated_data
@ created
no associated_data
Definition: net.h:58
@ marked_global_gnd
associated_data = id of gate
@ unmarked_global_output
associated_data = id of net
@ id_changed
associated_data = old id
@ device_name_changed
no associated_data
@ unmarked_global_gnd
associated_data = id of gate
@ input_filename_changed
no associated_data
@ unmarked_global_vcc
associated_data = id of gate
@ marked_global_vcc
associated_data = id of gate
@ unmarked_global_input
associated_data = id of net
@ design_name_changed
no associated_data
@ marked_global_output
associated_data = id of net
@ marked_global_input
associated_data = id of net
Gate * get_gate_by_id(const u32 gate_id) const
Definition: netlist.cpp:193
const std::vector< Module * > & get_modules() const
Definition: netlist.cpp:624
Module * get_module_by_id(u32 module_id) const
Definition: netlist.cpp:613
Net * get_net_by_id(u32 net_id) const
Definition: netlist.cpp:353
EventHandler * get_event_handler() const
Definition: netlist.cpp:137
void addToModuleDialog(const Node &node=Node())
void netDestinationRemoved(Net *n, const u32 dst_gate_id) const
void groupingColorChanged(Grouping *grp) const
void moduleGatesAssignEnd(Module *m, u32 number_gates) const
void groupingCreated(Grouping *grp) const
void netlistUnmarkedGlobalOutput(Netlist *n, const u32 associated_data) const
void netlistDeviceNameChanged(Netlist *n) const
void addChildModuleDialog(const u32 id)
void netlistIdChanged(Netlist *n, const u32 associated_data) const
void netlistUnmarkedGlobalInput(Netlist *n, const u32 associated_data) const
void moduleGatesRemoveBegin(Module *m, u32 number_gates) const
void moduleTypeChanged(Module *m) const
void netCreated(Net *n) const
void registerNetlistCallbacks()
void netlistMarkedGlobalVcc(Netlist *n, const u32 associated_data) const
ModuleColorManager * getModuleColorManager() const
void groupingGateAssigned(Grouping *grp, u32 id) const
void deleteModule(const u32 id)
void changeModuleColorDialog(const u32 id)
void groupingModuleAssigned(Grouping *grp, u32 id) const
void netlistInputFilenameChanged(Netlist *n) const
void unregisterNetlistCallbacks()
void groupingModuleRemoved(Grouping *grp, u32 id) const
void changeElementNameDialog(ModuleItem::TreeItemType type, u32 id)
void netSourceAdded(Net *n, const u32 src_gate_id) const
void moduleGateRemoved(Module *m, const u32 removed_gate) const
void moduleGateAssigned(Module *m, const u32 assigned_gate) const
void netSourceRemoved(Net *n, const u32 src_gate_id) const
void netlistMarkedGlobalInput(Netlist *n, const u32 associated_data) const
void netRemoved(Net *n) const
void groupingRemoved(Grouping *grp) const
void netlistMarkedGlobalOutput(Netlist *n, const u32 associated_data) const
NetlistRelay(QObject *parent=nullptr)
void gateCreated(Gate *g) const
void groupingNetAssigned(Grouping *grp, u32 id) const
void netlistUnmarkedGlobalVcc(Netlist *n, const u32 associated_data) const
void netDestinationAdded(Net *n, const u32 dst_gate_id) const
void moduleSubmoduleRemoved(Module *m, const u32 removed_module) const
void groupingNameChanged(Grouping *grp) const
void moduleNameChanged(Module *m) const
void handleThreadEvent(int type, int evt, void *object, u32 associated_data)
void gateRemoved(Gate *g) const
void gateNameChanged(Gate *g) const
void moduleRemoved(Module *m) const
void moduleParentChanged(Module *m) const
void modulePortsChanged(Module *m, PinEvent pev, u32 pgid) const
void changeModuleTypeDialog(const u32 id)
void moduleSubmoduleAdded(Module *m, const u32 added_module) const
void groupingNetRemoved(Grouping *grp, u32 id) const
void moduleCreated(Module *m) const
void moduleGatesRemoveEnd(Module *m, u32 number_gates) const
void netlistDesignNameChanged(Netlist *n) const
void signalThreadEvent(int type, int evt, void *object, u32 associated_data)
void netlistMarkedGlobalGnd(Netlist *n, const u32 associated_data) const
void netlistUnmarkedGlobalGnd(Netlist *n, const u32 associated_data) const
void gateBooleanFunctionChanged(Gate *g) const
void gateLocationChanged(Gate *g) const
void groupingGateRemoved(Grouping *grp, u32 id) const
void moduleGatesAssignBegin(Module *m, u32 number_gates) const
void netNameChanged(Net *n) const
QColor getModuleColor(const u32 id)
The NodeBox class represents a node placed at a grid position within a hal view.
Definition: node_box.h:50
int x() const
x getter for X-grid position
Definition: node_box.h:93
int y() const
y getter for Y-grid position
Definition: node_box.h:99
NodeBox * boxForNode(const Node &n) const
boxForNode find NodeBox by node
Definition: node_box.h:200
The Node class object represents a module or a gate.
Definition: gui_def.h:61
bool isModule() const
isModule test wheter node is a module
Definition: gui_def.h:95
@ Module
Definition: gui_def.h:63
@ Gate
Definition: gui_def.h:63
bool isNull() const
isNull test for null-Node object typically returned from functions
Definition: gui_def.h:83
u32 id() const
id getter for ID information
Definition: gui_def.h:77
static SelectionDetailsIconProvider * instance()
void setFocus(ItemType ftype, u32 fid, Subfocus sfoc=Subfocus::None, u32 sfinx=0)
void relaySelectionChanged(void *sender)
QList< u32 > selectedModulesList() const
void handleNetRemoved(const u32 id)
QList< u32 > selectedGatesList() const
void handleGateRemoved(const u32 id)
void handleModuleRemoved(const u32 id)
void addAction(UserAction *act)
virtual void setObject(const UserActionObject &obj)
Definition: user_action.cpp:32
virtual UserActionObject object() const
Definition: user_action.h:102
The UserActionObject class represents a single object used in UserAction.
#define UNUSED(expr)
Definition: defines.h:49
Module * firstCommonAncestor(std::unordered_set< Module * > modules, const std::unordered_set< Gate * > &gates)
Definition: netlist.cpp:34
ContentManager * gContentManager
Definition: plugin_gui.cpp:78
FileStatusManager * gFileStatusManager
Definition: plugin_gui.cpp:84
PinEvent
Definition: pin_event.h:42
GraphContextManager * gGraphContextManager
Definition: plugin_gui.cpp:85
SelectionRelay * gSelectionRelay
Definition: plugin_gui.cpp:83
Netlist * gNetlist
Definition: plugin_gui.cpp:80
n
Definition: test.py:6
quint32 u32
PinType type
Net * net
std::string name
bool isValid() const const
QColor getColor(const QColor &initial, QWidget *parent, const QString &title, QColorDialog::ColorDialogOptions options)
virtual int exec()
QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode, const QString &text, bool *ok, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool contains(const T &value) const const
QSet::iterator insert(const T &value)
QString fromStdString(const std::string &str)
BlockingQueuedConnection
QThread * currentThread()