15 return text.toInt(
nullptr,16);
29 int val =
input.toInt(&ok,16);
30 if (ok && 0 <= val && val <=
maximum())
38 :
QWidget(parent), mLabel(nullptr), mSpinBox(nullptr)
58 void LogicEvaluatorValue::handleSpinBoxValueChanged(
int val)
66 return mSpinBox->
value();
67 return mLabel->
text().toInt();
91 if (n != mNet)
return;
97 :
QFrame(parent), mOutput(outp)
99 constructor(nets,grpName);
103 :
QFrame(parent), mOutput(outp)
105 std::vector<const Net*> nets;
110 void LogicEvaluatorPingroup::constructor(
const std::vector<const Net *> &nets,
const QString &grpName)
112 int nbits = nets.size();
125 mGroupValue =
new LogicEvaluatorValue(mOutput?0:nbits,
this);
130 for (
const Net*
net : nets)
132 LogicEvaluatorCheckBox* lecb =
new LogicEvaluatorCheckBox(
net,
this);
135 lecb->setDisabled(
true);
140 mPinList.prepend(lecb);
159 void LogicEvaluatorPingroup::handleCheckStateChanged(
int state)
163 int mask = 1 << (mPinList.size()-1);
165 for (LogicEvaluatorCheckBox* cb : mPinList)
167 if (cb->isChecked()) val |=
mask;
175 void LogicEvaluatorPingroup::handleGroupValueChanged(
int val)
177 int mask = 1 << (mPinList.size()-1);
178 for (LogicEvaluatorCheckBox* cb : mPinList)
180 cb->setChecked(val&
mask);
188 return mPinList.at(
index)->getValue();
Value
represents the type of the node
void setValue(const Net *n, BooleanFunction::Value val)
LogicEvaluatorCheckBox(const Net *n, QWidget *parent=nullptr)
QPair< const Net *, BooleanFunction::Value > getValue() const
LogicEvaluatorHexSpinbox(QWidget *parent=nullptr)
virtual QString textFromValue(int val) const override
int valueFromText(const QString &text) const override
QValidator::State validate(QString &input, int &pos) const override
LogicEvaluatorPingroup(const std::vector< const Net * > &nets, bool outp, const QString &grpName, QWidget *parent=nullptr)
void setValue(const Net *n, BooleanFunction::Value val)
QPair< const Net *, BooleanFunction::Value > getValue(int index) const
void valueChanged(int val)
LogicEvaluatorValue(int nbits, QWidget *parent=nullptr)
void addLayout(QLayout *layout, int stretch)
void addSpacing(int size)
void setSpacing(int spacing)
void stateChanged(int state)
void setMargin(int margin)
bool setAlignment(QWidget *w, Qt::Alignment alignment)
void setContentsMargins(int left, int top, int right, int bottom)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool isEmpty() const const
QString number(int n, int base)
QString toUpper() const const