HAL
ram_wizardpage.cpp
Go to the documentation of this file.
4 
5 namespace hal
6 {
8  {
9  setTitle("RAM");
10  setSubTitle("Enter parameters for RAM component");
11  mLayout = new QGridLayout(this);
12 
13  mBitSize = new QLineEdit(this);
14 
15  mLabBitSize = new QLabel("RAM bit size: ");
16 
17  mLayout->addWidget(mLabBitSize, 0, 0);
18  mLayout->addWidget(mBitSize, 0, 1);
19 
20  setLayout(mLayout);
21 
23  }
24 
27  {
28  auto ram = gate->get_component_as<RAMComponent>([](const GateTypeComponent* c) {return RAMComponent::is_class_of(c);});
29 
30  if(ram != nullptr)
31  {
32  mBitSize->setText(QString::fromStdString(std::to_string(ram->get_bit_size())));
33  }
34  }
35 
36  }
37 }
bool has_component_of_type(const GateTypeComponent::ComponentType type) const
Definition: gate_type.cpp:54
T * get_component_as(const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const
Definition: gate_type.h:89
static bool is_class_of(const GateTypeComponent *component)
RAMWizardPage(QWidget *parent=nullptr)
void setData(GateType *gate)
void addWidget(QWidget *widget, int row, int column, Qt::Alignment alignment)
void setText(const QString &)
void textChanged(const QString &text)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString fromStdString(const std::string &str)
void setLayout(QLayout *layout)
void completeChanged()
void setSubTitle(const QString &subTitle)
void setTitle(const QString &title)