if (toErase) {
aDataPen.setColor(myGraph->viewport()->paletteBackgroundColor());
} else {
- if (strcmp(myEngine->InPort()->Name(), "InVoid")==0)
+ if ((strcmp(myEngine->InPort()->Name(), "InVoid")==0) ||
+ (myEngine->InPort()->Kind() == SUPERV::DataStreamParameter ))
aDataPen.setColor(CTRL_CLR);
else
aDataPen.setColor(DRAW_CLR);
if (toErase) {
aDataPen.setColor(myGraph->viewport()->paletteBackgroundColor());
} else {
- if (strcmp(myEngine->InPort()->Name(), "InVoid")==0)
+ if ((strcmp(myEngine->InPort()->Name(), "InVoid")==0)||
+ (myEngine->InPort()->Kind() == SUPERV::DataStreamParameter ))
aDataPen.setColor(CTRL_CLR);
else
aDataPen.setColor(DRAW_CLR);
bool SUPERVGUI_Link::isCreationComplete() {
bool aIsBoth = myPortIn && myPortOut;
if (myPortIn && myPortOut) {
+ // Check: is the same node?
SUPERV_Port aInPort = myPortIn->getPort();
QString aInNodeName(aInPort->Node()->Name());
SUPERV_Port aOutPort = myPortOut->getPort();
QString aOutNodeName(aOutPort->Node()->Name());
+
+ bool aCanCreate = true;
+ // Stream port can be connected only with stream port
+ if (myPortIn->getPort()->Kind() == SUPERV::DataStreamParameter)
+ aCanCreate = (myPortOut->getPort()->Kind() == SUPERV::DataStreamParameter);
+ else if (myPortOut->getPort()->Kind() == SUPERV::DataStreamParameter)
+ aCanCreate = (myPortIn->getPort()->Kind() == SUPERV::DataStreamParameter);
- return (aInNodeName != aOutNodeName);
+ return aCanCreate && (aInNodeName != aOutNodeName);
}
else if (myPortInES && myPortOut) {
SUPERV_Port aInPortES = myPortInES->getPort();
}
// Create engine
- if (!isESInputPort())
- myEngine = myGraph->getMain()->getDataflow()->
- Link(myPortOut->getPort(), myPortIn->getPort());
- else
+ if (!isESInputPort()) {
+ if (myStartPort->getPort()->Kind() == SUPERV::DataStreamParameter) {
+ SUPERVGUI_StreamPortOut* aOut = dynamic_cast<SUPERVGUI_StreamPortOut*>(myPortOut);
+ SUPERVGUI_StreamPortIn* aIn = dynamic_cast<SUPERVGUI_StreamPortIn*>(myPortIn);
+ myEngine = myGraph->getMain()->getDataflow()->
+ StreamLink(aOut->getStreamPort(), aIn->getStreamPort());
+ } else
+ myEngine = myGraph->getMain()->getDataflow()->
+ Link(myPortOut->getPort(), myPortIn->getPort());
+ } else
myEngine = myGraph->getMain()->getDataflow()->
Link(myPortOut->getPort(), myPortInES->getPort());
return;
}
if (theEvent->button() != Qt::LeftButton) {
+ SelectedLink = 0;
myHltPnt = -1;
return;
}