HAL
netlist_relay.cpp
Go to the documentation of this file.
2 
4 #include "gui/gui_globals.h"
21 #include "hal_core/netlist/gate.h"
24 #include "hal_core/netlist/net.h"
25 #include "hal_core/utilities/log.h"
26 
27 #include <QApplication>
28 #include <QColorDialog>
29 #include <QDebug>
30 #include <QInputDialog>
31 #include <functional>
32 
33 namespace hal
34 {
36  : QObject(parent), mModuleColorManager(new ModuleColorManager(this))
37  {
40  }
41 
43  {
45  }
46 
48  {
49  if (!gNetlist)
50  return; // no netlist -> no registered callbacks
51  gNetlist->get_event_handler()->unregister_callback("gui_netlist_handler");
52  gNetlist->get_event_handler()->unregister_callback("gui_module_handler");
53  gNetlist->get_event_handler()->unregister_callback("gui_gate_handler");
54  gNetlist->get_event_handler()->unregister_callback("gui_net_handler");
55  gNetlist->get_event_handler()->unregister_callback("gui_grouping_handler");
56  }
57 
59  {
61  "gui_netlist_handler",
62  std::function<void(NetlistEvent::event, Netlist*, u32)>(std::bind(&NetlistRelay::relayNetlistEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
63 
65  "gui_module_handler",
66  std::function<void(ModuleEvent::event, Module*, u32)>(std::bind(&NetlistRelay::relayModuleEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
67 
69  "gui_gate_handler", std::function<void(GateEvent::event, Gate*, u32)>(std::bind(&NetlistRelay::relayGateEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
70 
72  "gui_net_handler", std::function<void(NetEvent::event, Net*, u32)>(std::bind(&NetlistRelay::relayNetEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
73 
75  "gui_grouping_handler",
76  std::function<void(GroupingEvent::event, Grouping*, u32)>(std::bind(&NetlistRelay::relayGroupingEvent, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)));
77  }
78 
79  void NetlistRelay::handleNetlistModified()
80  {
81  if (!mNotified)
82  {
83  mNotified = true;
85  }
86  }
87 
89  {
90  return mModuleColorManager->moduleColor(id);
91  }
92 
94  {
95  return mModuleColorManager;
96  }
97 
99  {
100  QString oldName;
101  QString prompt;
102  UserActionObject uao;
103 
105  {
106  Module* m = gNetlist->get_module_by_id(id);
107  assert(m);
108  oldName = QString::fromStdString(m->get_name());
109  prompt = "Change module name";
111  }
113  {
114  Gate* g = gNetlist->get_gate_by_id(id);
115  assert(g);
116  oldName = QString::fromStdString(g->get_name());
117  prompt = "Change gate name";
119  }
121  {
122  Net* n = gNetlist->get_net_by_id(id);
123  assert(n);
124  oldName = QString::fromStdString(n->get_name());
125  prompt = "Change net name";
127  }
128  else return;
129 
130  bool confirm;
131  QString newName =
132  QInputDialog::getText(nullptr, prompt, "New name:", QLineEdit::Normal,
133  oldName, &confirm);
134  if (confirm)
135  {
136  ActionRenameObject* act = new ActionRenameObject(newName);
137  act->setObject(uao);
138  act->exec();
139  }
140  }
141 
143  {
144  // NOT THREADSAFE
145 
146  Module* m = gNetlist->get_module_by_id(id);
147  assert(m);
148 
149  bool ok;
150  QString text = QInputDialog::getText(nullptr, "Change Module Type", "New Type", QLineEdit::Normal, QString::fromStdString(m->get_type()), &ok);
151 
152  if (ok)
153  {
154  ActionSetObjectType* act = new ActionSetObjectType(text);
156  act->exec();
157  }
158  }
159 
161  {
162  // NOT THREADSAFE
163 
164  Module* m = gNetlist->get_module_by_id(id);
165  assert(m);
166 
167  QColor color = QColorDialog::getColor();
168 
169  if (!color.isValid())
170  return;
171 
172  ActionSetObjectColor* act = new ActionSetObjectColor(color);
174  act->exec();
175  }
176 
178  {
179  // prepare set of content, find first (reference-) node
180  Node firstNode = node;
181  QSet<u32> gatIds;
182  QSet<u32> modIds;
183 
185  Q_ASSERT(context);
186 
187  // exclusive module view will update automatically if module elements get moved
188  bool specialUpdateRequired = !context->getExclusiveModuleId();
189 
190  if (node.isNull())
191  {
193  {
194  if (specialUpdateRequired && ! context->gates().contains(id))
195  specialUpdateRequired = false;
196  if (firstNode.isNull()) firstNode = Node(id,Node::Gate);
197  gatIds.insert(id);
198  }
199 
201  {
202  if (specialUpdateRequired && ! context->modules().contains(id))
203  specialUpdateRequired = false;
204  if (firstNode.isNull()) firstNode = Node(id,Node::Module);
205  modIds.insert(id);
206  }
207  }
208  else if (node.isModule())
209  modIds.insert(node.id());
210  else
211  gatIds.insert(node.id());
212  if (firstNode.isNull()) return; // nothing to move
213 
214  // find common parent, if nullptr top_level was selected => abort
215  std::unordered_set<Gate*> gatsContent;
216  for (u32 id : gatIds)
217  gatsContent.insert(gNetlist->get_gate_by_id(id));
218 
219  std::unordered_set<Module*> modsContent;
220  for (u32 id : modIds)
221  modsContent.insert(gNetlist->get_module_by_id(id));
222 
223  Module* parentModule = gui_utility::firstCommonAncestor(modsContent, gatsContent);
224  if (!parentModule) return;
225  QString parentName = QString::fromStdString(parentModule->get_name());
226 
227  ModuleDialog md({},"Move to module",false,nullptr,qApp->activeWindow());
228  if (md.exec() != QDialog::Accepted) return;
229 
230 
231  UserActionCompound* compound = new UserActionCompound;
232  compound->setUseCreatedObject();
233 
234  if (md.isNewModule())
235  {
236  bool ok;
237  QString name = QInputDialog::getText(nullptr, "",
238  "New module will be created under \"" + parentName + "\"\nModule Name:",
239  QLineEdit::Normal, "", &ok);
240  if (!ok || name.isEmpty()) return;
242  actNewModule->setParentId(parentModule->get_id());
243  compound->addAction(actNewModule);
244  compound->addAction(new ActionAddItemsToObject(modIds,gatIds));
245  }
246  else
247  {
248  u32 targetModuleId = md.selectedId();
249  ActionAddItemsToObject* actAddItems = new ActionAddItemsToObject(modIds,gatIds);
250  actAddItems->setObject(UserActionObject(targetModuleId,UserActionObjectType::Module));
251  compound->addAction(actAddItems);
252  specialUpdateRequired = false;
253  }
254 
255  // move module to position of first content node
256  const NodeBox* box = context->getLayouter()->boxes().boxForNode(firstNode);
257  if (box && (specialUpdateRequired || context->getExclusiveModuleId()))
258  {
259  ActionMoveNode* actMoveNode = new ActionMoveNode(context->id(), QPoint(box->x(),box->y()));
260  compound->addAction(actMoveNode);
261  }
262 
263  if (specialUpdateRequired)
264  {
265  context->setSpecialUpdate(true);
266  context->setScheduleRemove(modIds,gatIds);
267  }
268 
269  compound->exec();
270 
271  // update selection
273  gSelectionRelay->addModule(compound->object().id());
277  }
278 
280  {
281  // NOT THREADSAFE
282 
283  bool ok;
284  QString name = QInputDialog::getText(nullptr, "", "Module Name:", QLineEdit::Normal, "", &ok);
285 
286  if (!ok || name.isEmpty())
287  return;
288 
289  Module* m = gNetlist->get_module_by_id(id);
290 
291  if (!m)
292  return;
293 
295  act->setParentId(id);
296  act->exec();
297  }
298 
300  {
303 
305  if (ctx)
306  {
307  // module exclusively connected to context, so delete context too
311  compnd->addAction(delCtx);
312  compnd->addAction(delMod);
313  compnd->exec();
314  }
315  else
316  {
317  delMod->exec();
318  }
319  }
320 
322  {
323  mNotified = false;
324  }
325 
326  void NetlistRelay::relayNetlistEvent(NetlistEvent::event ev, Netlist* object, u32 associated_data)
327  {
328  if (!object)
329  return; // SHOULD NEVER BE REACHED
330 
331  if (object != gNetlist)
332  return;
333 
334  handleNetlistModified();
335 
336  if (dynamic_cast<PythonThread*>(QThread::currentThread()))
337  {
338  Q_EMIT signalThreadEvent(TetNetlist, (int)ev, object, associated_data);
339  qApp->processEvents();
340  return;
341  }
342 
343  switch (ev)
344  {
347 
348  Q_EMIT netlistIdChanged(object, associated_data);
349  break;
350  }
353 
355  break;
356  }
359 
361  break;
362  }
365 
367  break;
368  }
371 
372  Q_EMIT netlistMarkedGlobalVcc(object, associated_data);
373  break;
374  }
377 
378  Q_EMIT netlistMarkedGlobalGnd(object, associated_data);
379  break;
380  }
383 
384  Q_EMIT netlistUnmarkedGlobalVcc(object, associated_data);
385  break;
386  }
389 
390  Q_EMIT netlistUnmarkedGlobalGnd(object, associated_data);
391  break;
392  }
396 
397  Q_EMIT netlistMarkedGlobalInput(object, associated_data);
398  break;
399  }
403 
404  Q_EMIT netlistMarkedGlobalOutput(object, associated_data);
405  break;
406  }
410 
411  Q_EMIT netlistUnmarkedGlobalInput(object, associated_data);
412  break;
413  }
417 
418  Q_EMIT netlistUnmarkedGlobalOutput(object, associated_data);
419  break;
420  }
421  }
422  }
423 
424  void NetlistRelay::relayGroupingEvent(GroupingEvent::event ev, Grouping* grp, u32 associated_data)
425  {
426  if (!grp)
427  return; // SHOULD NEVER BE REACHED
428 
429  if (grp->get_netlist() != gNetlist)
430  return;
431 
432  handleNetlistModified();
433 
434  if (dynamic_cast<PythonThread*>(QThread::currentThread()))
435  {
436  Q_EMIT signalThreadEvent(TetGrouping, (int)ev, grp, associated_data);
437  qApp->processEvents();
438  return;
439  }
440 
441  switch (ev)
442  {
444  Q_EMIT groupingCreated(grp);
445  break;
447  Q_EMIT groupingRemoved(grp);
448  break;
451  break;
454  break;
456  Q_EMIT groupingGateAssigned(grp, associated_data);
457  break;
459  Q_EMIT groupingGateRemoved(grp, associated_data);
460  break;
462  Q_EMIT groupingNetAssigned(grp, associated_data);
463  break;
465  Q_EMIT groupingNetRemoved(grp, associated_data);
466  break;
468  Q_EMIT groupingModuleAssigned(grp, associated_data);
469  break;
471  Q_EMIT groupingModuleRemoved(grp, associated_data);
472  break;
473  }
474  }
475 
476  void NetlistRelay::relayModuleEvent(ModuleEvent::event ev, Module* mod, u32 associated_data)
477  {
478  if (!mod)
479  return; // SHOULD NEVER BE REACHED
480 
481  if (mod->get_netlist() != gNetlist)
482  return;
483 
484  handleNetlistModified();
485 
486  if (dynamic_cast<PythonThread*>(QThread::currentThread()))
487  {
488  Q_EMIT signalThreadEvent(TetModule, (int)ev, mod, associated_data);
489  qApp->processEvents();
490  return;
491  }
492 
493  switch (ev)
494  {
496  //< no associated_data
497 
498  // suppress actions if we receive this for the top module
499  if (mod->get_parent_module() != nullptr)
500  {
501  mModuleColorManager->setRandomColor(mod->get_id());
502  }
503 
505 
506  Q_EMIT moduleCreated(mod);
507  break;
508  }
510  //< no associated_data
511 
512  mModuleColorManager->removeColor(mod->get_id());
513 
515  gSelectionRelay->handleModuleRemoved(mod->get_id());
516 
517  Q_EMIT moduleRemoved(mod);
518  break;
519  }
521  //< no associated_data
522 
524 
526  break;
527  }
529  //< no associated_data
530 
532  break;
533  }
535  //< associated_data = id of added module
536 
537  gGraphContextManager->handleModuleSubmoduleAdded(mod, associated_data);
538 
539  Q_EMIT moduleSubmoduleAdded(mod, associated_data);
540  break;
541  }
543  //< associated_data = id of removed module
544 
545  gGraphContextManager->handleModuleSubmoduleRemoved(mod, associated_data);
546 
547  Q_EMIT moduleSubmoduleRemoved(mod, associated_data);
548  break;
549  }
551  //< associated_data = id of inserted gate
552 
553  gGraphContextManager->handleModuleGateAssigned(mod, associated_data);
554 
555  Q_EMIT moduleGateAssigned(mod, associated_data);
556  break;
557  }
559  //< associated_data = id of removed gate
560 
561  gGraphContextManager->handleModuleGateRemoved(mod, associated_data);
562 
563  Q_EMIT moduleGateRemoved(mod, associated_data);
564  break;
565  }
567  //< associated_data = [4LSB: type of action] [28HSB: id of pin group or pin]
568  PinEvent pev = (PinEvent) (associated_data&0xF);
569  u32 id = (associated_data >> 4);
571 
572  Q_EMIT modulePortsChanged(mod,pev,id);
573  break;
574  }
576  //< no associated_data
577 
579 
581  break;
582  }
584  //< associated_data = number of gates
585 
586  Q_EMIT moduleGatesAssignBegin(mod, associated_data);
587  break;
588  }
590  //< associated_data = number of gates
591 
592  Q_EMIT moduleGatesAssignEnd(mod, associated_data);
593  break;
594  }
596  //< associated_data = number of gates
597 
598  Q_EMIT moduleGatesRemoveBegin(mod, associated_data);
599  break;
600  }
602  //< associated_data = number of gates
603 
604  Q_EMIT moduleGatesRemoveEnd(mod, associated_data);
605  break;
606  }
607  }
608  }
609 
610  void NetlistRelay::relayGateEvent(GateEvent::event ev, Gate* gat, u32 associated_data)
611  {
612  UNUSED(associated_data);
613  if (!gat)
614  return; // SHOULD NEVER BE REACHED
615 
616  if (gat->get_netlist() != gNetlist)
617  return;
618 
619  handleNetlistModified();
620 
621  if (dynamic_cast<PythonThread*>(QThread::currentThread()))
622  {
623  Q_EMIT signalThreadEvent(TetGate, (int)ev, gat, associated_data);
624  qApp->processEvents();
625  return;
626  }
627 
628  switch (ev)
629  {
631  //< no associated_data
632 
633  Q_EMIT gateCreated(gat);
634  break;
635  }
637  //< no associated_data
638 
639  gSelectionRelay->handleGateRemoved(gat->get_id());
640 
642 
643  Q_EMIT gateRemoved(gat);
644  break;
645  }
647  //< no associated_data
648 
650 
651  Q_EMIT gateNameChanged(gat);
652  break;
653  }
655  //< no associated_data
656 
658  break;
659  }
661  //< no associated_data
662 
664  break;
665  }
666  default:
667  break;
668  }
669  }
670 
671  void NetlistRelay::relayNetEvent(NetEvent::event ev, Net* net, u32 associated_data)
672  {
673  if (!net)
674  return; // SHOULD NEVER BE REACHED
675 
676  if (net->get_netlist() != gNetlist)
677  return;
678 
679  handleNetlistModified();
680 
681  if (dynamic_cast<PythonThread*>(QThread::currentThread()))
682  {
683  Q_EMIT signalThreadEvent(TetNet, (int)ev, net, associated_data);
684  qApp->processEvents();
685  return;
686  }
687 
688  switch (ev)
689  {
691  //< no associated_data
692 
694 
696  break;
697  }
699  //< no associated_data
700 
703 
705  break;
706  }
708  //< no associated_data
709 
711 
713  break;
714  }
715  // FIXME add src_added, src_removed
716  // case NetEvent::event::src_changed:
717  // {
718  // //< no associated_data
719 
720  // gGraphContextManager->handle_net_source_changed(object);
721 
722  // Q_EMIT net_source_changed(object);
723  // break;
724  // }
726  //< associated_data = id of src gate
727 
728  gGraphContextManager->handleNetSourceAdded(net, associated_data);
729 
730  Q_EMIT netSourceAdded(net, associated_data);
731  break;
732  }
734  //< associated_data = id of src gate
735 
737 
738  Q_EMIT netSourceRemoved(net, associated_data);
739  break;
740  }
742  //< associated_data = id of dst gate
743 
745 
746  Q_EMIT netDestinationAdded(net, associated_data);
747  break;
748  }
750  //< associated_data = id of dst gate
751 
753 
754  Q_EMIT netDestinationRemoved(net, associated_data);
755  break;
756  }
757  }
758  }
759 
760  void NetlistRelay::handleThreadEvent(int type, int evt, void* object, u32 associated_data)
761  {
762  switch (type)
763  {
764  case TetNetlist:
765  // qDebug() << "Evt nlst" << evt << associated_data;
766  relayNetlistEvent((NetlistEvent::event)evt, static_cast<Netlist*>(object), associated_data);
767  break;
768  case TetModule:
769  // qDebug() << "Evt modu" << evt << static_cast<Module*>(object)->get_id() << associated_data;
770  relayModuleEvent((ModuleEvent::event)evt, static_cast<Module*>(object), associated_data);
771  break;
772  case TetGate:
773  // qDebug() << "Evt gate" << evt << static_cast<Gate*>(object)->get_id() << associated_data;
774  relayGateEvent((GateEvent::event)evt, static_cast<Gate*>(object), associated_data);
775  break;
776  case TetNet:
777  // qDebug() << "Evt net_" << evt << static_cast<Net*>(object)->get_id() << associated_data;
778  relayNetEvent((NetEvent::event)evt, static_cast<Net*>(object), associated_data);
779  break;
780  case TetGrouping:
781  // qDebug() << "Evt grup" << evt << static_cast<Grouping*>(object)->get_id() << associated_data;
782  relayGroupingEvent((GroupingEvent::event)evt, static_cast<Grouping*>(object), associated_data);
783  break;
784  }
785  }
786 
787  void NetlistRelay::dumpModuleRecursion(Module *m)
788  {
789  for (int i=0; i<m->get_submodule_depth(); i++)
790  std::cerr << " ";
791  std::cerr << "Mod " << m->get_id() << " <" << m->get_name() << ">\n";
792  for (Module* sm : m->get_submodules())
793  dumpModuleRecursion(sm);
794  }
795 
797  {
798  for (Module* m : gNetlist->get_modules())
799  mModuleColorManager->setRandomColor(m->get_id());
800  mColorSerializer.restore(mModuleColorManager);
801  }
802 
804  {
805  }
806 } // 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:259
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
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()