HAL
gatelibrary_frame_lut.cpp
Go to the documentation of this file.
4 
5 namespace hal
6 {
8  : GatelibraryComponentFrame("LUT Init", parent)
9  {
10  mAscending = new GateLibraryLabel(true, " - ", this);
11 
12  mLayout->addRow(new GateLibraryLabel(false, "Bit Order:", parent), mAscending);
13 
15  }
16 
18  {
20  {
21  auto lutc = gt->get_component_as<LUTComponent>([](const GateTypeComponent* c) { return LUTComponent::is_class_of(c); });
22 
23  if(lutc != nullptr)
24  {
25  mAscending->setText(QString::fromStdString(lutc->is_init_ascending() ? "Ascending" : "Descending"));
26  show();
27  }
28  else hide();
29  }
30  else hide();
31  }
32 }
33 
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
GatelibraryFrameLut(QWidget *parent=nullptr)
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()