#include "SUPERVGUI_CanvasControlNode.h"
#include "SUPERVGUI_CanvasControlNodePrs.h"
#include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUPERVGUI_CanvasLink.h"
#include "SUPERVGUI_Clipboard.h"
#include "SUPERVGUI_Main.h"
#include "SUPERVGUI.h"
if (aDlg->exec()) {
QString aNodeName = aDlg->getName();
if (!aNodeName.isEmpty()) { //implement additional check from GUI side for bug PAL7007
+ // mkr : here we should re/create (if it is not yet exists) a presentation for new
+ // Goto(OutGate)->CoupledNode(InGate) link, which will be created in SetCoupled method
+
+ // check if GoTo node have coupled node
+ SUPERV_INode aCoupledNode = getGotoNode()->Coupled();
+ if ( !SUPERV_isNull(aCoupledNode) )
+ { // we got old coupled node
+ SUPERV_Port anInGatePort = aCoupledNode->GetInPort("InGate");
+ SUPERV_Link anOldLinkEngine = anInGatePort->Link();
+ if ( !SUPERV_isNull(anOldLinkEngine) )
+ { // we got old link engine
+ SUPERVGUI_CanvasLink* anOldLinkPrs = getMain()->getCanvas()->getLink(anOldLinkEngine);
+ if ( anOldLinkPrs )
+ { // delete old link presentation
+ delete anOldLinkPrs;
+ anOldLinkPrs = 0;
+ }
+ }
+ }
+
getGotoNode()->SetCoupled(aNodeName.latin1());
+
+ aCoupledNode = SUPERV::INode::_narrow(getMain()->getDataflow()->Node(aNodeName.latin1()));
+ if ( !SUPERV_isNull(aCoupledNode) )
+ { // we got new coupled node
+ SUPERV_Port anInGatePort = aCoupledNode->GetInPort("InGate");
+ SUPERV_Link aLinkEngine = anInGatePort->Link();
+ if ( !SUPERV_isNull(aLinkEngine) )
+ { // we got new link engine
+ if ( !getMain()->getCanvas()->getLink(aLinkEngine) )
+ { // there is no presentation for such link engine => create it
+ SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(getMain()->getCanvas(), getMain(), aLinkEngine);
+ aLink->show();
+ }
+ }
+ }
+
getMain()->getCanvas()->sync();
}
}