myPOcount = 0;
SUPERV_Ports ports = myNode->Ports();
int n = ports->length();
-
+
for (int i=0; i<n; i++) {
if (ports[i]->IsInput()) {
- if (ports[i]->IsGate())
- myGatesLayout->addWidget(new SUPERVGUI_PortIn(myGatesBox, myMain, ports[i]),
- 0, 0);
- else {
- myPortLayout->addWidget(new SUPERVGUI_PortIn(myValuesBox, myMain, ports[i]),
- myPIcount, 0);
- myPIcount++;
+ if (getComputingNode()->IsEndSwitch()) {
+ if (ports[i]->IsGate())
+ myGatesLayout->addWidget(new SUPERVGUI_PortInESNode(myGatesBox, myMain, ports[i]),
+ 0, 0);
+ else {
+ myPortLayout->addWidget(new SUPERVGUI_PortInESNode(myValuesBox, myMain, ports[i]),
+ myPIcount, 0);
+ myPIcount++;
+ }
+ } else {
+ if (ports[i]->IsGate())
+ myGatesLayout->addWidget(new SUPERVGUI_PortIn(myGatesBox, myMain, ports[i]),
+ 0, 0);
+ else {
+ myPortLayout->addWidget(new SUPERVGUI_PortIn(myValuesBox, myMain, ports[i]),
+ myPIcount, 0);
+ myPIcount++;
+ }
}
} else {
if (ports[i]->IsGate())
}
}
}
+
}
* If toCheckExisting = true the existing of links will be checked before creation
*/
void SUPERVGUI_GraphNode::updateLinksPrs(bool toCheckExisting) {
+
SUPERVGUI_Graph* aGraph= myMain->getGraph();
- SUPERVGUI_PortIn* pi;
- QObjectList* ihmList = queryList("SUPERVGUI_PortIn");
- QObjectListIt i(*ihmList);
- while ((pi=(SUPERVGUI_PortIn*)i.current()) != 0) {
- ++i;
- if (pi->getPort()->IsLinked()) {
- SUPERV_Link aLink = pi->getPort()->Link();
- if (toCheckExisting) {
- if (aGraph->isLinkPrsExists(aLink))
- continue;
- }
- aGraph->createLinkPrs(aLink);
- }
- }
- delete ihmList;
-
//Find PortInESNode
SUPERVGUI_PortInESNode* piES;
QObjectList* ihmListES = queryList("SUPERVGUI_PortInESNode");
QObjectListIt iES(*ihmListES);
- while ((piES=(SUPERVGUI_PortInESNode*)iES.current()) != 0) {
- ++iES;
- if (piES->getPort()->IsLinked()) {
- SUPERV_Links aLinks = piES->getPort()->Links();
- for (int j=0; j<aLinks->length(); j++) {
+ if (iES.count()) {
+ while ((piES=(SUPERVGUI_PortInESNode*)iES.current()) != 0) {
+ ++iES;
+ if (piES->getPort()->IsLinked()) {
+ SUPERV_Links aLinks = piES->getPort()->Links();
+ for (int j=0; j<aLinks->length(); j++) {
+ if (toCheckExisting) {
+ if (aGraph->isLinkPrsExists(aLinks[j]))
+ continue;
+ }
+ aGraph->createLinkPrs(aLinks[j]);
+ }
+ }
+ }
+ }
+ else {
+ SUPERVGUI_PortIn* pi;
+ QObjectList* ihmList = queryList("SUPERVGUI_PortIn");
+ QObjectListIt i(*ihmList);
+ while ((pi=(SUPERVGUI_PortIn*)i.current()) != 0) {
+ ++i;
+ if (pi->getPort()->IsLinked()) {
+ SUPERV_Link aLink = pi->getPort()->Link();
if (toCheckExisting) {
- if (aGraph->isLinkPrsExists(aLinks[j]))
+ if (aGraph->isLinkPrsExists(aLink))
continue;
}
- aGraph->createLinkPrs(aLinks[j]);
+ aGraph->createLinkPrs(aLink);
}
}
+ delete ihmList;
}
+
delete ihmListES;
}
thePort->deleteLinks();
thePort->getPort()->destroy();
+
thePort->close(true);
+
updatePorts();
updateShape();
}
QObjectListIt aLI(*aShownPortsList);
SUPERVGUI_Port* aVisPort;
+
while ((aVisPort=(SUPERVGUI_Port*)aLI.current()) != 0) {
++aLI;
QString aNameVisible(aVisPort->getPort()->Name());