HAL
gatelibrary_frame_lut.cpp
Go to the documentation of this file.
1
#include "
gui/gatelibrary_management/gatelibrary_frames/gatelibrary_frame_lut.h
"
2
#include "
gui/gatelibrary_management/gatelibrary_label.h
"
3
#include "
hal_core/netlist/gate_library/gate_type_component/lut_component.h
"
4
5
namespace
hal
6
{
7
GatelibraryFrameLut::GatelibraryFrameLut
(
QWidget
* parent)
8
:
GatelibraryComponentFrame
(
"LUT Init"
, parent)
9
{
10
mAscending =
new
GateLibraryLabel
(
true
,
" - "
,
this
);
11
12
mLayout
->
addRow
(
new
GateLibraryLabel
(
false
,
"Bit Order:"
,
parent
), mAscending);
13
14
mLayout
->
setFieldGrowthPolicy
(
QFormLayout::AllNonFixedFieldsGrow
);
15
}
16
17
void
GatelibraryFrameLut::update
(
GateType
* gt)
18
{
19
if
(gt->
has_component_of_type
(
GateTypeComponent::ComponentType::init
))
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
hal::GateLibraryLabel
Definition:
gatelibrary_label.h:34
hal::GateTypeComponent
Definition:
gate_type_component.h:40
hal::GateTypeComponent::ComponentType::init
@ init
hal::GateType
Definition:
gate_type.h:52
hal::GateType::has_component_of_type
bool has_component_of_type(const GateTypeComponent::ComponentType type) const
Definition:
gate_type.cpp:54
hal::GateType::get_component_as
T * get_component_as(const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const
Definition:
gate_type.h:89
hal::GatelibraryComponentFrame
Definition:
gatelibrary_component_frame.h:38
hal::GatelibraryComponentFrame::mLayout
QFormLayout * mLayout
Definition:
gatelibrary_component_frame.h:43
hal::GatelibraryFrameLut::GatelibraryFrameLut
GatelibraryFrameLut(QWidget *parent=nullptr)
Definition:
gatelibrary_frame_lut.cpp:7
hal::LUTComponent
Definition:
lut_component.h:33
hal::LUTComponent::is_class_of
static bool is_class_of(const GateTypeComponent *component)
Definition:
lut_component.cpp:14
gatelibrary_frame_lut.h
gatelibrary_label.h
lut_component.h
hal
Definition:
parser_liberty.cpp:10
QFormLayout::AllNonFixedFieldsGrow
AllNonFixedFieldsGrow
QFormLayout::addRow
void addRow(QWidget *label, QWidget *field)
QFormLayout::setFieldGrowthPolicy
void setFieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy)
QLabel::setText
void setText(const QString &)
QObject::parent
QObject * parent() const const
QString::fromStdString
QString fromStdString(const std::string &str)
QWidget
QWidget::hide
void hide()
QWidget::show
void show()
QWidget::update
void update()
plugins
gui
src
gatelibrary_management
gatelibrary_frames
gatelibrary_frame_lut.cpp
Generated on Fri Feb 14 2025 14:22:42 for HAL by
1.9.1