int orientation = Parameters::West;
foreach(AbstractInterface *inter, refBlock->getInterfaces()){
-
+
+ /* NB: create InterfaceItem for every interfaces, even if they do not have a graphical representation
+ It will allow to save them in the XML project file and thus to create their equivalent
+ in the graph while the file is loaded.
+ */
InterfaceItem *item;
if(inter->getDirection() == AbstractInterface::Input){
orientation = Parameters::West;
orientation = Parameters::North;
}
item = new InterfaceItem(0.0 , orientation, (ConnectedInterface *)inter, this, params);
- interfaces.append(item);
- }
+ interfaces.append(item);
+ }
}
InterfaceItem* AbstractBoxItem::searchInterfaceByName(QString name) {
// others
+ virtual void interfaceRenamed() = 0;
void addInterface(InterfaceItem* i, bool resetPosition = false);
void removeInterface(InterfaceItem* i);
void resetInterfacesPosition();
return false;
}
+void BoxItem::interfaceRenamed() {
+ if (updateGeometry(InterfaceMove)) {
+ //cout << "must recompute group item geometry" << endl;
+ (getScene()->getGroupItem())->updateShape();
+ }
+}
+
void BoxItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
if(params->editState == Parameters::EditBlockMove) {
moveInterfaceTo(event->pos());
// recompute the geometry of the block
if (updateGeometry(InterfaceMove)) {
- cout << "must recompute group item geometry" << endl;
+ //cout << "must recompute group item geometry" << endl;
(getScene()->getGroupItem())->updateShape();
}
// update connection from/to the selected interface
if (selectedAction == removeAction) {
if(ifaceItem != NULL) {
- dispatcher->removeBlockInterface(ifaceItem);
+ dispatcher->removeFunctionalInterface(ifaceItem);
}
else {
dispatcher->removeBlock(this);
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
int dimY = dimensionStr.at(1).toInt(&ok);
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
-
+
ReferenceBlock *referenceMd5 = NULL;
ReferenceBlock *referenceXml = NULL;
ReferenceBlock *reference = NULL;
else {
reference = referenceMd5;
}
+
GroupBlock* parentGroupBlock = AB_TO_GRP(((GroupItem *)parentItem())->getRefBlock());
FunctionalBlock* functionalBlock = params->getGraph()->addFunctionalBlock(parentGroupBlock, reference);
/* NB: addFunctionalBlock creates all interfaces from the reference, which is annoying when
blockParam = functionalBlock->getParameterFromName(name);
if (blockParam == NULL) throw(Exception(PROJECTFILE_CORRUPTED));
blockParam->setValue(value);
- }
+ }
- // recreate all interface because of some may have a multiplicity>1 with several examplars
+ // recreate all (non-control) interfaces because of some may have a multiplicity>1 with several examplars
functionalBlock->removeAllInterfaces();
QDomNodeList interfaceNodes = funcElement.elementsByTagName("bif_iface");
// setting interfaces (user name, and for multiplicity>1 may be create some new ones)
if(refName == "none") throw(Exception(PROJECTFILE_CORRUPTED));
ReferenceInterface* refInter = AI_TO_REF(reference->getIfaceFromName(refName));
+ cout << "creating iface from reference named " << qPrintable(refName) << endl;
FunctionalInterface *functionalInterface = new FunctionalInterface(functionalBlock,refInter);
functionalInterface->setName(name);
functionalBlock->addInterface(functionalInterface);
+
+ // searching for control interface
+ QString ctlRefName = refName+"_ctl";
+ ReferenceInterface* ctlRefIface = AI_TO_REF(reference->getIfaceFromName(ctlRefName));
+
+ if (ctlRefIface != NULL) {
+ cout << "found a control iface:" << qPrintable(ctlRefName) << endl;
+ FunctionalInterface *ctlIface = new FunctionalInterface(functionalBlock,ctlRefIface);
+ if (! ctlIface->setAssociatedIface(functionalInterface)) {
+ throw(Exception(PROJECTFILE_CORRUPTED));
+ }
+ ctlIface->setName(name+"_ctl");
+ functionalBlock->addInterface(ctlIface);
+ }
}
+
// creating InterfaceItem
initInterfaces();
// setting them with saved values
writer.writeAttribute("ref_xml", ((FunctionalBlock*)refBlock)->getReferenceXmlFile());
writer.writeAttribute("ref_md5", ((FunctionalBlock*)refBlock)->getReferenceHashMd5());
writer.writeAttribute("name",refBlock->getName());
- QString attrPos = QString::number(pos().x()).append(",").append(QString::number(pos().y()));
+ QString attrPos = QString::number((int)(pos().x())).append(",").append(QString::number((int)(pos().y())));
writer.writeAttribute("position",attrPos);
QString attrDim = QString::number(getWidth()).append(",").append(QString::number(getHeight()));
writer.writeAttribute("dimension",attrDim);
bool isBoxItem();
// others
+ void interfaceRenamed();
void moveTo(QPointF dest);
void loadFunctional(QDomElement funcElement) throw(Exception);
void save(QXmlStreamWriter& writer);
setFlag(ItemSendsGeometryChanges);
setCursor(Qt::PointingHandCursor);
setZValue(0);
+
+ if (fromInterfaceItem->refInter->getPurpose() == AbstractInterface::Data) {
+ visible = true;
+ }
+ else {
+ visible = false;
+ }
setPath();
}
const QStyleOptionGraphicsItem *option,
QWidget *widget) {
+ if (!visible) return;
+
painter->setPen(Qt::blue);
if(selected){
painter->setPen(Qt::red);
QPainterPath shape() const;
void prepareChange();
-
+
+ // getters
inline GroupScene* getScene() { return (GroupScene*)(scene()); }
inline InterfaceItem* getToInterfaceItem(){ return toInterfaceItem; }
- inline void setToInterfaceItem(InterfaceItem *iface){ toInterfaceItem = iface; }
inline InterfaceItem* getFromInterfaceItem(){ return fromInterfaceItem; }
- inline void setFromInterfaceItem(InterfaceItem* iface){ fromInterfaceItem = iface; }
inline int getId(){ return id; }
+
+ // setters
+ inline void setToInterfaceItem(InterfaceItem *iface){ toInterfaceItem = iface; }
+ inline void setFromInterfaceItem(InterfaceItem* iface){ fromInterfaceItem = iface; }
inline void setId(int id){ this->id = id; }
- inline bool isSelected() { return selected; }
void setSelected(bool selected);
-
+ inline void setVisible(bool state) { visible = state; }
+
+ // testers
+ inline bool isSelected() { return selected; }
+
+ // others
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
/*!
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
private:
-
+ void computeEsse(int orientationFrom);
+ void computeStaircase(int orientationFrom);
+ void computeHookSmallEnd(int orientationFrom, int orientationTo);
+ void computeHookSmallStart(int orientationFrom, int orientationTo);
+ void computeOpenRect(int orientationFrom, int orientationTo);
+ void computeElle(int orientationFrom);
+ void computeCorner(int orientationFrom);
+
QPointF pointFrom;
QPointF pointTo;
QList<QPointF> interPoints;
bool selected;
int id;
int marginConn;
- void computeEsse(int orientationFrom);
- void computeStaircase(int orientationFrom);
- void computeHookSmallEnd(int orientationFrom, int orientationTo);
- void computeHookSmallStart(int orientationFrom, int orientationTo);
- void computeOpenRect(int orientationFrom, int orientationTo);
- void computeElle(int orientationFrom);
- void computeCorner(int orientationFrom);
+
+ bool visible;
friend QDataStream &operator << (QDataStream &out, ConnectionItem &c);
friend QDataStream &operator >> (QDataStream &in, ConnectionItem &c);
cout << "call to " << qPrintable(fctName) << endl;
#endif
- bool ok;
- QString text = QInputDialog::getText(NULL, "Rename an interface",
+ bool ok = false;
+ QString text = "";
+ while (!ok) {
+ text = QInputDialog::getText(NULL, "Rename an interface",
"New name:", QLineEdit::Normal,
item->refInter->getName(), &ok);
-
- /* CAUTION: when renaming an interface item, there are two cases :
- - it refers to a functional block interface (fbi): the fbi keeps its name
- and the new name is given to item
- - it refers to a group block interface (gbi) : both gbi and item store the new name
-
- */
- if(ok && !text.isEmpty() && text.length() < 30) {
- if (item->refInter->getOwner()->isGroupBlock()) {
- item->refInter->setName(text);
+
+ if (!ok) return;
+
+ if (text == item->refInter->getName()) return;
+
+ if( (text.isEmpty()) || (text.length() > 30)) {
+ QMessageBox::warning(NULL,"Error in given name",
+ "the interface name must be shorter than 30 characters, cannot be empty",
+ QMessageBox::Ok);
+ ok = false;
+ }
+ else {
+ AbstractInterface* iface = item->refInter->getOwner()->getIfaceFromName(text);
+ if (iface != NULL) {
+ QMessageBox::warning(NULL,"Error in given name",
+ "the name provided is similar to that of another interface",
+ QMessageBox::Ok);
+ ok = false;
+ }
}
}
- else {
- QMessageBox::warning(NULL,"Error in given name",
- "the interface name must be shorter than 30 characters and can't be empty!",
- QMessageBox::Ok);
- renameInterface(item);
+ item->refInter->setName(text);
+ AbstractInterface* assoIface = item->refInter->getAssociatedIface();
+ if (assoIface != NULL) {
+ assoIface->setName(text+"_ctl");
}
+ item->updateName(text);
+ item->getOwner()->interfaceRenamed();
}
void Dispatcher::duplicateBlock(BoxItem *item){
if(! refB->isFunctionalBlock()) return;
FunctionalInterface* iface = (FunctionalInterface*)refI;
- AbstractInterface *otherRef = iface->clone();
- if (otherRef == NULL) {
+ AbstractInterface *cloneIface = iface->clone();
+ if (cloneIface == NULL) {
QMessageBox::warning(NULL,"Error while cloning an interface","the interface cannot be cloned because its maximum multiplicity is reached", QMessageBox::Ok);
return;
}
- refB->addInterface(otherRef);
+ refB->addInterface(cloneIface);
- InterfaceItem *otherIface = new InterfaceItem(item->getPosition(),item->getOrientation(),(ConnectedInterface*)otherRef,item->getOwner(),params);
- item->getOwner()->addInterface(otherIface,true);
+ InterfaceItem *cloneIfaceItem = new InterfaceItem(item->getPosition(),item->getOrientation(),(ConnectedInterface*)cloneIface,item->getOwner(),params);
+ item->getOwner()->addInterface(cloneIfaceItem,true);
+
+ // creating control interface if needed
+ if (refI->getAssociatedIface() != NULL) {
+ QString ctlName = cloneIface->getName()+"_ctl";
+ ReferenceInterface* ctlIface = new ReferenceInterface(refB,ctlName,"boolean","1",cloneIface->getDirection(), AbstractInterface::Control, 1);
+ refB->addInterface(ctlIface);
+ if (! ctlIface->setAssociatedIface(cloneIface)) {
+ cerr << "Abnormal case while cloning an interface and creating its associated control interface" << endl;
+ }
+ }
}
GroupItem *parentItem = item->getOwner()->getScene()->getGroupItem();
// creating/adding the group interface in the graph model
- GroupInterface *groupInter = new GroupInterface(parentBlock,refInter->getName()+"_group",refInter->getDirection());
+ GroupInterface *groupInter = new GroupInterface(parentBlock,refInter->getName()+"_group",refInter->getDirection(),refInter->getPurpose());
groupInter->setType(refInter->getType());
groupInter->setWidth(refInter->getWidth());
groupInter->setPurpose(refInter->getPurpose());
#endif
}
-void Dispatcher::removeBlockInterface(InterfaceItem *item) {
+void Dispatcher::removeFunctionalInterface(InterfaceItem *item) {
static QString fctName = "Dispatcher::removeBlockInterface()";
#ifdef DEBUG_FCTNAME
cout << "call to " << qPrintable(fctName) << endl;
*/
void disconnectInterFromGroup(InterfaceItem* item);
/*!
- * \brief removeBlockInterface
+ * \brief removeFunctionalInterface
* \param item item is always owned by a BoxItem
*
* This method is called only when the user right clicks on an InterfaceItem (that belongs
- * to a BoxItem and has a multiplicity > 1) and chooses remove in the contextual menu.
+ * to a BoxItem that represents a functional block and has a multiplicity > 1) and chooses remove in the contextual menu.
* Thus, parameter item is always owned by a BoxItem
*/
- void removeBlockInterface(InterfaceItem* item);
+ void removeFunctionalInterface(InterfaceItem* item);
/*!
* \brief removeGroupInterface
* \param item item is always owned by a GroupItem
#include "FunctionalInterface.h"
#include "GroupBlock.h"
-GroupInterface::GroupInterface(AbstractBlock* _owner, const QString& _name, int _direction) throw(Exception) : ConnectedInterface(_owner,_name,"expression","",_direction,AbstractInterface::Data) {
+GroupInterface::GroupInterface(AbstractBlock* _owner, const QString& _name, int _direction, int _purpose) throw(Exception) : ConnectedInterface(_owner,_name,"expression","",_direction,_purpose) {
if (! _owner->isGroupBlock()) throw(Exception(BLOCK_INVALID_TYPE));
connectedFrom = NULL;
}
AbstractInterface *GroupInterface::clone() {
- GroupInterface *inter = new GroupInterface(owner,name,direction);
- inter->setWidth(width);
- inter->setDirection(direction);
- inter->setPurpose(purpose);
+ GroupInterface *inter = new GroupInterface(owner,name,direction, purpose);
+ inter->setWidth(width);
inter->connectFrom(NULL);
return inter;
class GroupInterface : public ConnectedInterface {
public :
- GroupInterface(AbstractBlock* _owner, const QString& _name, int _direction) throw (Exception);
+ GroupInterface(AbstractBlock* _owner, const QString& _name, int _direction, int _purpose) throw (Exception);
// getters
return false;
}
+void GroupItem::interfaceRenamed() {
+ updateGeometry(InterfaceMove);
+}
+
+
void GroupItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
if(params->editState == Parameters::EditGroupMove) {
double position = currentInterfaceNode.attribute("position","none").toDouble(&ok);
if(!ok) throw(Exception(PROJECTFILE_CORRUPTED));
- GroupInterface *groupInterface = new GroupInterface(groupBlock,name,direction);
+ GroupInterface *groupInterface = new GroupInterface(groupBlock,name,direction,AbstractInterface::Data);
InterfaceItem *interfaceItem = new InterfaceItem(position,orientation,groupInterface,this,params);
interfaceItem->setId(id);
if(parentItem != NULL){
attrUpperItem = QString::number(parentItem->getId());
}
- QString attrPos = QString::number(pos().x()).append(",").append(QString::number(pos().y()));
+ QString attrPos = QString::number((int)(pos().x())).append(",").append(QString::number((int)(pos().y())));
QString attrDim = QString::number(getWidth()).append(",").append(QString::number(getHeight()));
bool isGroupItem();
// others
+ void interfaceRenamed();
void updateShape();
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
void load(QDomElement groupElement) throw(Exception);
return refInter->getName();
}
+void InterfaceItem::updateName(QString name) {
+ QFontMetrics fmName(params->defaultIfaceFont);
+ nameWidth = fmName.width(refInter->getName());
+ nameHeight = fmName.height();
+ updatePosition();
+}
+
+
/* boundingRect() : give the bounding rect in the blockitem coord. system */
QRectF InterfaceItem::boundingRect() const {
}
-/* connectWith() :
- - modify all necessary attributes in the model to create a connection
- between current InterfaceItem and iface. Note that the source and destination
- are deduced from the direction (In, Out) and the type of the owner (funcitonal, group)
-
- CAUTION: No security checks are done. This method must be called only if canConnectWith has been called and returned true.
-
- NOTE : conditions so that this InterfaceItem can be connected with inter.
- (i.e. current one can connect to inter OR inter can connect to current)
-
- Here are all the possible combinations, depending on the type of the
- block/item and direction of the interface, which are :
- GI/GB : a GroupItem referencing a GroupBlock (single solution for GI)
- BI/FB : a BlockItem referencing a FunctionalBlock
- BI/GB : a BlockItem referencing a GroupBlock
-
- For GI/GB:
- - Input can connect with BI/FB or BI/GB Input
- - Output can connect with BI/FB or BI/GB Output
-
- For BI/FB:
- - Input can connect with:
- GI/GB Input
- BI/FB Output
- BI/GB Output
- - Output can connect with:
- GI/GB Output
- BI/FB Input
- BI/GB Input
-
- For BI/GB:
- - Input can connect with:
- GI/GB Input
- BI/FB Output
- BI/GB Output
- - Output can connect with:
- GI/GB Output
- BI/FB Input
- BI/GB Input
-
- And whatever the case an InOut can only connect with an InOut
- We note that:
- - the IG does not allow the connect a GI/GB interface to an
- interface of another GI/GB, thus the case is not considered above.
- - BI/FB and BI/GB are the same.
- - the cases where direction are the same only occur when
- the 2 items are of different type (GI and BI)
- - the cases where directions are different only occur when
- the 2 are of both BlockItem
-
-*/
-bool InterfaceItem::connectWith(InterfaceItem *iface) {
- ConnectedInterface* interThis = refInter; // the reference of this
- ConnectedInterface* interOther = iface->refInter; // the reference of the other
- ConnectedInterface* src = NULL, *dest = NULL;
-
- if(interThis->getDirection() == AbstractInterface::InOut && interOther->getDirection() == AbstractInterface::InOut){
- /* NOTE: InOut interfaces have both directions and thus are
- connected from inter1 to inter2 AND inter2 to inter1
- Another effect is that a InOut can be connected to/from a single
- InOut.
- */
- if((interThis->getConnectedFrom() == NULL) && (interOther->getConnectedFrom() == NULL)) {
-
- interOther->connectFrom(interThis);
- interOther->getConnectedTo().append(interThis);
- interThis->connectFrom(interOther);
- interThis->getConnectedTo().append(interOther);
-
- cout << "connecting 2 InOut"<< endl;
- return true;
- }
- return false;
- }
- else if (interThis->getDirection() == interOther->getDirection()) {
-
- // cannot connect GI to GI or 2 BI of the same direction.
- if ((getOwner()->isGroupItem()) && (iface->getOwner()->isGroupItem())) return false;
- if ((getOwner()->isBoxItem()) && (iface->getOwner()->isBoxItem())) return false;
-
- if (interThis->getDirection() == AbstractInterface::Input) { // both are inputs
- cout << "connecting GI to BI" << endl;
- if(getOwner()->isGroupItem()) {
- src = interThis;
- dest = interOther;
- }
- else {
- src = interOther;
- dest = interThis;
- }
- }
- else { // both are outputs
- cout << "connecting BO to GO" << endl;
- if(getOwner()->isGroupItem()){
- src = interOther;
- dest = interThis;
- }
- else {
- src = interThis;
- dest = interOther;
- }
- }
- }
- else {
- if ((getOwner()->isGroupItem()) || (iface->getOwner()->isGroupItem())) return false;
-
- cout << "connecting BO to BI" << endl;
- if(interOther->getDirection() == AbstractInterface::Output) {
- src = interOther;
- dest = interThis;
- }
- else {
- src = interThis;
- dest = interOther;
- }
- }
-
- if(dest != NULL && src != NULL){
- // cannot overrive existing connectionFrom
- if(dest->getConnectedFrom() == NULL) {
- dest->connectFrom(src);
- src->connectTo(dest);
- return true;
- }
- else {
- return false;
- }
- }
- return false;
-}
-
-void InterfaceItem::unconnectTo(InterfaceItem *iface)
-{
- if(iface->refInter->getConnectedFrom() == refInter){
- iface->refInter->connectFrom(NULL);
- }
- if(iface->refInter->getConnectedTo().contains(refInter)){
- cout << "abnormal case while removing iface conn from " << qPrintable(refInter->getName()) << " to " << qPrintable(iface->refInter->getName()) << endl;
- iface->refInter->removeConnectedTo(refInter);
- }
- if(refInter->getConnectedFrom() == iface->refInter) {
- cout << "abnormal case while removing iface conn from " << qPrintable(refInter->getName()) << " to " << qPrintable(iface->refInter->getName()) << endl;
- refInter->connectFrom(NULL);
- }
- if(refInter->getConnectedTo().contains(iface->refInter)){
- refInter->removeConnectedTo(iface->refInter);
- }
-}
-
-void InterfaceItem::updatePosition()
-{
+void InterfaceItem::updatePosition() {
if(orientation == Parameters::North || orientation == Parameters::South){
position = positionRatio * owner->getWidth();
} else {
// others
void addConnectionItem(ConnectionItem* item);
- void removeConnectionItem(ConnectionItem* item);
- bool canConnectWith(InterfaceItem* iface);
- bool connectWith(InterfaceItem* iface);
- void unconnectTo(InterfaceItem *iface);
+ void removeConnectionItem(ConnectionItem* item);
void updatePosition();
+ void updateName(QString name);
AbstractBoxItem* owner;
ConnectedInterface* refInter;
if (!inter->setAssociatedIface(dataIface)) {
throw (Exception(BLOCKFILE_CORRUPTED));
}
+ cout << "created a control input named " << qPrintable(inter->getName()) << endl;
inputs.append(inter);
}
QDomElement eltOutputs = eltInputs.nextSiblingElement("outputs");
if (!inter->setAssociatedIface(dataIface)) {
throw (Exception(BLOCKFILE_CORRUPTED));
}
+ cout << "created a control output named " << qPrintable(inter->getName()) << endl;
outputs.append(inter);
}
}
toWrite << b.inputs.size();
+ // firstly write control ifaces
for(int i=0; i<b.inputs.size(); i++){
ReferenceInterface *iface = (ReferenceInterface *)(b.inputs.at(i));
- toWrite << iface->getName();
- toWrite << iface->getWidth();
- toWrite << iface->getPurpose();
- toWrite << iface->getDirection();
- toWrite << iface->getMultiplicity();
+ if (iface->getPurpose() == AbstractInterface::Control) {
+ toWrite << iface->getName();
+ toWrite << iface->getWidth();
+ toWrite << iface->getPurpose();
+ toWrite << iface->getDirection();
+ toWrite << iface->getMultiplicity();
+ }
+ }
+ // secondly, write other ifaces
+ for(int i=0; i<b.inputs.size(); i++){
+ ReferenceInterface *iface = (ReferenceInterface *)(b.inputs.at(i));
+ if (iface->getPurpose() != AbstractInterface::Control) {
+ toWrite << iface->getName();
+ toWrite << iface->getWidth();
+ toWrite << iface->getPurpose();
+ toWrite << iface->getDirection();
+ toWrite << iface->getMultiplicity();
+ }
}
toWrite << b.outputs.size();
+ // firstly write control ifaces
for(int i=0; i<b.outputs.size(); i++){
ReferenceInterface *iface = (ReferenceInterface *)(b.outputs.at(i));
- toWrite << iface->getName();
- toWrite << iface->getWidth();
- toWrite << iface->getPurpose();
- toWrite << iface->getDirection();
- toWrite << iface->getMultiplicity();
+ if (iface->getPurpose() == AbstractInterface::Control) {
+ toWrite << iface->getName();
+ toWrite << iface->getWidth();
+ toWrite << iface->getPurpose();
+ toWrite << iface->getDirection();
+ toWrite << iface->getMultiplicity();
+ }
+ }
+ // secondly, write other ifaces
+ for(int i=0; i<b.outputs.size(); i++){
+ ReferenceInterface *iface = (ReferenceInterface *)(b.outputs.at(i));
+ if (iface->getPurpose() != AbstractInterface::Control) {
+ toWrite << iface->getName();
+ toWrite << iface->getWidth();
+ toWrite << iface->getPurpose();
+ toWrite << iface->getDirection();
+ toWrite << iface->getMultiplicity();
+ }
}
toWrite << b.bidirs.size();
for(int i=0; i<b.bidirs.size(); i++){
in >> txt;
iface->setWidth(txt);
in >> val;
- iface->setPurpose(val);
+ iface->setPurpose(val);
in >> val;
iface->setDirection(val);
in >> val;
iface->setMultiplicity(val);
b.inputs.append(iface);
+ if (iface->getPurpose() == AbstractInterface::Data) {
+ QString ctlRefName = iface->getName()+"_ctl";
+ ReferenceInterface* ctlRefIface = AI_TO_REF(b.getIfaceFromName(ctlRefName));
+ if (ctlRefIface != NULL) {
+ if (! ctlRefIface->setAssociatedIface(iface)) {
+ cerr << "Abnormal case while reading a reference block in library" << endl;
+ }
+ }
+ }
}
b.outputs.clear();
in >> txt;
iface->setWidth(txt);
in >> val;
- iface->setPurpose(val);
+ iface->setPurpose(val);
in >> val;
iface->setDirection(val);
in >> val;
iface->setMultiplicity(val);
b.outputs.append(iface);
+ if (iface->getPurpose() == AbstractInterface::Data) {
+ QString ctlRefName = iface->getName()+"_ctl";
+ ReferenceInterface* ctlRefIface = AI_TO_REF(b.getIfaceFromName(ctlRefName));
+ if (ctlRefIface != NULL) {
+ if (! ctlRefIface->setAssociatedIface(iface)) {
+ cerr << "Abnormal case while reading a reference block in library" << endl;
+ }
+ }
+ }
}
b.bidirs.clear();
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 3.2.1, 2017-05-05T14:29:41. -->
+<!-- Written by QtCreator 3.2.1, 2017-05-08T20:46:10. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
- <value type="QByteArray">{1d077e47-e3a1-47fd-8b12-4de650e39df5}</value>
+ <value type="QByteArray">{c8006d66-d34f-42be-ad10-d0207752286d}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{451ee8a3-56ff-4aba-8a8e-3da882cc142e}</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{2c9bf876-3476-44eb-8065-1f0844704dda}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
- <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/localhome/sdomas/Projet/Blast/code/blast</value>
+ <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/sdomas/Projet/Blast/code/blast</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="GenericProjectManager.GenericMakeStep.BuildTargets">
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<config>
- <categories nb="6">
+ <categories nb="9">
<category name="root" id="0" parent="-1"/>
<category name="math" id="1" parent="0"/>
<category name="trigonemetric" id="2" parent="1"/>
- <category name="multadd" id="3" parent="1"/>
- <category name="dsp" id="4" parent="0"/>
- <category name="user" id="5" parent="0"/>
+ <category name="arithmetics" id="3" parent="1"/>
+ <category name="filters" id="4" parent="0"/>
+ <category name="wishbone" id="5" parent="0"/>
+ <category name="sources" id="6" parent="0"/>
+ <category name="scopes" id="7" parent="0"/>
+ <category name="user" id="8" parent="0"/>
</categories>
<references nb="2" lib_file="/home/sdomas/Projet/Blast/code/blast/lib/references/references.bmf" >
<name>
block-1I1O
</name>
- <category ids="1,4" />
+ <category ids="8" />
<description>
<brief>
A testing block with 1 input, 1 output
<name>
block-2I2O
</name>
- <category ids="1,4" />
+ <category ids="8" />
<description>
<brief>
A testing block with 2 inputs, 2 outputs
<name>
block-2INO
</name>
- <category ids="1,4" />
+ <category ids="8" />
<description>
<brief>
A testing block with 2 inputs, N outputs
<name>
wishbone master for apf27
</name>
- <category ids="1,4" />
+ <category ids="5" />
<description>
<brief>
This block is the wishbone master of the design, connected to the i.MX of APF27
<name>\r
block average\r
</name>\r
- <category ids="1,4" /> \r
+ <category ids="4" /> \r
<description>\r
<brief>\r
This block does an average on 3 successives units, over a sequence of N inputs\r
<name>\r
block demultiplexer\r
</name>\r
- <category ids="1,4" /> \r
+ <category ids="1,5" /> \r
<description>\r
<brief>\r
This block demux an entry presented on FPGA pins over a variable number of outputs\r
<name>\r
block multiply/add\r
</name>\r
- <category ids="1,4" /> \r
+ <category ids="3" /> \r
<description>\r
<brief>\r
This block multiplies 2 input values, adding the result to a third one.\r
</xs:simpleType>
</xs:attribute>
- <xs:attribute name="value">
- <xs:simpleType>
- <xs:restriction base="xs:nonNegativeInteger">
- <xs:minInclusive value="0"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
+ <xs:attribute name="value" type="xs:string"/>
<xs:attribute name="from">
<xs:simpleType>