HAL
gatelibrary_frame_latch.cpp
Go to the documentation of this file.
1
#include "
gui/gatelibrary_management/gatelibrary_frames/gatelibrary_frame_latch.h
"
2
#include "
gui/gatelibrary_management/gatelibrary_label.h
"
3
#include "
hal_core/netlist/gate_library/gate_type_component/latch_component.h
"
4
5
namespace
hal
6
{
7
GateLibraryFrameLatch::GateLibraryFrameLatch
(
QWidget
* parent)
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
16
mLayout
->
setFieldGrowthPolicy
(
QFormLayout::AllNonFixedFieldsGrow
);
17
18
}
19
20
void
GateLibraryFrameLatch::update
(
GateType
* gt)
21
{
22
if
(gt->
has_component_of_type
(
GateTypeComponent::ComponentType::latch
))
23
{
24
auto
latch
= gt->
get_component_as
<
LatchComponent
>([](
const
GateTypeComponent
* c) {
return
LatchComponent::is_class_of
(c);});
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
hal::GateLibraryFrameLatch::GateLibraryFrameLatch
GateLibraryFrameLatch(QWidget *parent=nullptr)
Definition:
gatelibrary_frame_latch.cpp:7
hal::GateLibraryLabel
Definition:
gatelibrary_label.h:34
hal::GateTypeComponent
Definition:
gate_type_component.h:40
hal::GateTypeComponent::ComponentType::latch
@ latch
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::LatchComponent
Definition:
latch_component.h:35
hal::LatchComponent::is_class_of
static bool is_class_of(const GateTypeComponent *component)
Definition:
latch_component.cpp:14
gatelibrary_frame_latch.h
gatelibrary_label.h
latch_component.h
hal
Definition:
parser_liberty.cpp:10
hal::GateTypeProperty::latch
@ latch
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_latch.cpp
Generated on Fri Feb 14 2025 14:22:42 for HAL by
1.9.1