79 mLeft =
"set_reset_behavior";
80 mRight = cPBehaviourToString(cPBehavior);
81 mCPBehavior =cPBehavior;
90 QString CPBehaviorEntry::cPBehaviourToString (std::pair<hal::AsyncSetResetBehavior, hal::AsyncSetResetBehavior> cPBehaviour)
100 return QString(cPBehaviourToString[cPBehaviour.first] +
", " + cPBehaviourToString[cPBehaviour.second]);
107 mLeft = enumTypeToString();
113 switch (specificType)
121 QString StateComponentEntry::enumTypeToString()
123 const QString types[] = {
"Internal state",
"Negated internal state"};
124 return types[specificType];
145 return mEntries.size();
158 return (mEntries[row]->getEntryIdentifier());
166 return (mEntries[row]->getEntryValueString());
193 Q_UNUSED(orientation);
208 return mEntries[row];
220 mSpecificType =
type;
221 mLeft = enumToString();
228 mSpecificType = FFCompFunc::SetResetBehav;
229 mLeft = enumToString();
230 mRight = behaviorToString(behav);
235 switch (mSpecificType)
246 QString FFComponentEntry::enumToString()
248 static QString types[] = {
"Clock",
"Next state",
"Asynchronous set",
"Asynchronous reset",
"Set-Reset behavior"};
249 return types[mSpecificType];
252 QString FFComponentEntry::behaviorToString(std::pair<AsyncSetResetBehavior, AsyncSetResetBehavior> behav)
262 return QString(cPBehaviourToString[behav.first] +
", " + cPBehaviourToString[behav.second]);
268 mSpecificType =
type;
269 mLeft = enumToString();
276 mSpecificType = LatchCompFunc::SetResetBehav;
277 mLeft = enumToString();
278 mRight = behaviorToString(behav);
283 switch (mSpecificType)
294 QString LatchComponentEntry::enumToString()
296 const QString types[] = {
"Enable",
"Data in bf",
"Asynchronous set",
"Asynchronous Reset",
"Set reset behavior"};
297 return types[mSpecificType];
300 QString LatchComponentEntry::behaviorToString(std::pair<AsyncSetResetBehavior, AsyncSetResetBehavior> behav)
310 return QString(cPBehaviourToString[behav.first] +
", " + cPBehaviourToString[behav.second]);
QString getPythonCode() override
BooleanFunction getBooleanFunction() const
BooleanFunctionEntry(u32 gateId, QString functionName, BooleanFunction bf)
static std::string to_string(Value value)
An entry in the boolean function table model.
@ BooleanFunctionStandard
EntryType getEntryType() const
QString getEntryValueString() const
BooleanFunctionTableEntry(u32 gateId)
QString getEntryIdentifier() const
QSharedPointer< BooleanFunctionTableEntry > getEntryAtRow(int row) const
BooleanFunctionTableModel(QObject *parent=nullptr)
void setEntries(QVector< QSharedPointer< BooleanFunctionTableEntry >> entries)
bool setData(const QModelIndex &index, const QVariant &value, int role) override
QVariant data(const QModelIndex &index, int role) const override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
std::pair< hal::AsyncSetResetBehavior, hal::AsyncSetResetBehavior > getCPBehavior() const
CPBehaviorEntry(u32 gateId, std::pair< hal::AsyncSetResetBehavior, hal::AsyncSetResetBehavior > cPBehavior)
QString getPythonCode() override
FFComponentEntry(u32 gateId, FFCompFunc type, BooleanFunction func)
QString getPythonCode() override
LatchComponentEntry(u32 gateId, LatchCompFunc type, BooleanFunction func)
static QString pyCodeStateCompNegState(u32 gateId)
static QString pyCodeLatchCompAsyncSetFunc(u32 gateId)
static QString pyCodeStateCompPosState(u32 gateId)
static QString pyCodeLatchCompAsyncResetFunc(u32 gateId)
static QString pyCodeLatchCompEnableFunc(u32 gateId)
static QString pyCodeLatchCompDataInFunc(u32 gateId)
static QString pyCodeGateBooleanFunction(u32 gateId, QString booleanFunctionName)
static QString pyCodeFFCompSetResetBehav(u32 gateId)
static QString pyCodeFFCompAsyncSetFunc(u32 gateId)
static QString pyCodeFFCompAsyncResetFunc(u32 gateId)
static QString pyCodeFFCompNextStateFunc(u32 gateId)
static QString pyCodeFFCompClockFunc(u32 gateId)
static QString pyCodeLatchCompSetResetBehav(u32 gateId)
StateComponentEntry(u32 gateId, StateCompType type, QString stateVal)
QString getPythonCode() override
void layoutAboutToBeChanged(const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
void layoutChanged(const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
QObject * parent() const const
QString fromStdString(const std::string &str)