HAL
module_details_tab_widget.cpp
Go to the documentation of this file.
2 
8 
10 #include "gui/gui_globals.h"
13 
14 namespace hal
15 {
17  : DetailsTabWidget(parent), mModuleId(0)
18  {
20 
21  //general tab
22  mModuleInfoTable = new ModuleInfoTable(this);
23  mModuleInformationFrame = new DetailsFrameWidget(mModuleInfoTable, "Module Information", this);
24  addTab("General", mModuleInformationFrame, true);
25 
26  //groupings tab
27  mGroupingsOfItemTable = new GroupingsOfItemWidget;
28  mGroupingsFrame = new DetailsFrameWidget(mGroupingsOfItemTable, "Groupings", this);
29  connect(mGroupingsOfItemTable, &GroupingsOfItemWidget::updateText, mGroupingsFrame, &DetailsFrameWidget::setText);
30  addTab("Groupings", mGroupingsFrame, false);
31 
32  //ports tab
33  mPinsTree = new ModulePinsTree(this);
34  mPinsFrame = new DetailsFrameWidget(mPinsTree, "Pins", this);
36 
37  addTab("Pins", mPinsFrame, false);
38 
39  //elements tab
40  mElementsTree = new ModuleElementsTree(this);
41  mElementsFrame = new DetailsFrameWidget(mElementsTree, "Elements", this);
42 
43  addTab("Elements", mElementsFrame, false);
44 
45  //data tab
46  mDataTable = new DataTableWidget(this);
47  mDataFrame = new DetailsFrameWidget(mDataTable, "Data", this);
48 
49  addTab("Data", mDataFrame, false);
50 
51  //comment tab
52  mCommentWidget = new CommentWidget(this);
53  QTabWidget::addTab(mCommentWidget, "Comments");
54 
55  connect(gNetlistRelay->getModuleColorManager(),&ModuleColorManager::moduleColorChanged,this,&ModuleDetailsTabWidget::handleModuleColorChanged);
56  }
57 
58  void ModuleDetailsTabWidget::handleModuleColorChanged(u32 id)
59  {
60  if (!mModuleId || mModuleId != id) return;
62  }
63 
65  {
66  if (module)
67  {
69  mModuleId = module->get_id();
70  //pass module or other stuff to widgets
71  mModuleInfoTable->setModule(module);
72  mPinsTree->setModule(module);
73  mElementsTree->setModule(module);
74  mGroupingsOfItemTable->setModule(module);
75  mDataTable->setModule(module);
76  mCommentWidget->nodeChanged(Node(module->get_id(), Node::NodeType::Module));
77  }
78  else
79  {
80  mModuleId = 0;
81  mElementsTree->removeContent();
82  mCommentWidget->nodeChanged(Node());
83  }
84  }
85 
87  {
88  mPinsTree->removeContent();
89  mElementsTree->removeContent();
90  }
91 }
void nodeChanged(const Node &nd)
A widget to display the data of a DataContainer (Module, Gate or Net)
void setModule(Module *module)
void setText(const QString &text)
int addTab(const QString &label, QList< DetailsFrameWidget * > frames)
void setIcon(SelectionDetailsIconProvider::IconCategory catg, u32 itemId=0)
A TableView to display all groupings that contain a specified Gate, Net or Module.
void updateText(const QString &text)
void moduleColorChanged(u32 id) const
ModuleDetailsTabWidget(QWidget *parent=nullptr)
A widget to display the specific (direct submodules, gates) items of a given module.
u32 get_id() const
Definition: module.cpp:82
void setModule(hal::Module *module)
A widget to display the ports of a given module.
void updateText(const QString &newHeadline)
void setModule(u32 moduleID)
ModuleColorManager * getModuleColorManager() const
The Node class object represents a module or a gate.
Definition: gui_def.h:61
const Module * module(const Gate *g, const NodeBoxes &boxes)
NetlistRelay * gNetlistRelay
Definition: plugin_gui.cpp:81
quint32 u32
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
int addTab(QWidget *page, const QString &label)