HAL
gatelibrary_frame_latch.cpp
Go to the documentation of this file.
4 
5 namespace hal
6 {
8  : GatelibraryComponentFrame("Latch", parent)
9  {
10  mEnableOn = new GateLibraryLabel(true, " - ", this);
11  mDataIn = new GateLibraryLabel(true, " - ", this);
12 
13  mLayout->addRow(new GateLibraryLabel(false, "Enable behaviour function:", parent), mEnableOn);
14  mLayout->addRow(new GateLibraryLabel(false, "Data input function:", parent), mDataIn);
15 
17 
18  }
19 
21  {
23  {
25 
26  if(latch != nullptr)
27  {
28  mEnableOn->setText(QString::fromStdString(latch->get_enable_function().to_string()));
29  mDataIn->setText(QString::fromStdString(latch->get_data_in_function().to_string()));
30  show();
31  }
32  else
33  hide();
34  }
35  else
36  hide();
37  }
38 }
39 
GateLibraryFrameLatch(QWidget *parent=nullptr)
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)
void addRow(QWidget *label, QWidget *field)
void setFieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy)
void setText(const QString &)
QObject * parent() const const
QString fromStdString(const std::string &str)
void hide()
void show()
void update()