X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/43fd94117de66d533ef9e58b2de85daa244da309..6e2b3026c6a496e81642c373796bd39dad33d2a6:/ReferenceInterface.cpp?ds=sidebyside diff --git a/ReferenceInterface.cpp b/ReferenceInterface.cpp index faa51e8..8936952 100644 --- a/ReferenceInterface.cpp +++ b/ReferenceInterface.cpp @@ -7,16 +7,25 @@ ReferenceInterface::ReferenceInterface(AbstractBlock* _owner) throw(Exception) } ReferenceInterface::ReferenceInterface(AbstractBlock* _owner, - const QString& _name, const QString&_type, - const QString& _width, + const QString& _name, int _direction, int _purpose, + const QString& _type, + const QString& _width, + int _endianess, int _multiplicity) -throw (Exception) : AbstractInterface(_owner, _name, _type, _width, _direction, _purpose) { +throw (Exception) : AbstractInterface(_owner, _name, _direction, _purpose, _type, _width) { if (_owner->isReferenceBlock()) throw(Exception(BLOCK_INVALID_TYPE)); multiplicity = _multiplicity; + + if (purpose == Control) { + // override some attributes with forced values + type = Boolean; + width = "1"; + multiplicity = 1; + } if (direction == InOut) { multiplicity = 1; } @@ -42,9 +51,9 @@ int ReferenceInterface::translatePurpose(const QString& txt) { else if (txt == "reset") { return Reset; } - if (txt == "wb") { + else if (txt == "wb") { return Wishbone; - } + } return Data; }