#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"
//=====================================================================
// Compute node
//=====================================================================
-SUPERVGUI_CanvasComputeNode::SUPERVGUI_CanvasComputeNode( SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
- SUPERVGUI_CanvasNode( mgr, theParent, theMain, theNode)
+SUPERVGUI_CanvasComputeNode::SUPERVGUI_CanvasComputeNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+ SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode)
{
Trace("SUPERVGUI_CanvasComputeNode::SUPERVGUI_CanvasComputeNode");
}
+SUPERVGUI_CanvasComputeNode* SUPERVGUI_CanvasComputeNode::Create
+ (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
+{
+ SUPERVGUI_CanvasComputeNode* aRet = new SUPERVGUI_CanvasComputeNode (mgr, theParent, theMain, theNode);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
QPopupMenu* SUPERVGUI_CanvasComputeNode::getPopupMenu(QWidget* theParent)
{
QPopupMenu* popup = SUPERVGUI_CanvasNode::getPopupMenu(theParent);
//=====================================================================
// Start control node
//=====================================================================
-SUPERVGUI_CanvasStartNode::SUPERVGUI_CanvasStartNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+SUPERVGUI_CanvasStartNode::SUPERVGUI_CanvasStartNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
SUPERVGUI_CanvasNode( mgr, theParent, theMain, theNode),
myCoupled(0)
{
Trace("SUPERVGUI_CanvasStartNode::SUPERVGUI_CanvasStartNode");
}
+SUPERVGUI_CanvasStartNode* SUPERVGUI_CanvasStartNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
+{
+ SUPERVGUI_CanvasStartNode* aRet = new SUPERVGUI_CanvasStartNode (mgr, theParent, theMain, theNode);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasStartNode::createPrs() const
{
- return new SUPERVGUI_CanvasStartNodePrs( resMgr(), getMain()->getCanvas(),
+ return new SUPERVGUI_CanvasStartNodePrs (resMgr(), getMain()->getCanvas(),
(SUPERVGUI_CanvasStartNode*)this);
}
if (myCoupled)
delete myCoupled;
+ emit objectCreatedDeleted(); // jfa : NPAL15529
+
delete this;
aCanvas->update();
//=====================================================================
// End control node
//=====================================================================
-SUPERVGUI_CanvasEndNode::SUPERVGUI_CanvasEndNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode, SUPERVGUI_CanvasStartNode* theStart):
+SUPERVGUI_CanvasEndNode::SUPERVGUI_CanvasEndNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
+ SUPERVGUI_CanvasStartNode* theStart):
SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode),
myCoupled(theStart)
{
myCoupled->setCoupled(this);
}
+SUPERVGUI_CanvasEndNode* SUPERVGUI_CanvasEndNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
+ SUPERVGUI_CanvasStartNode* theStart)
+{
+ SUPERVGUI_CanvasEndNode* aRet = new SUPERVGUI_CanvasEndNode (mgr, theParent, theMain, theNode, theStart);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasEndNode::createPrs() const
{
return new SUPERVGUI_CanvasEndNodePrs( resMgr(), getMain()->getCanvas(),
//=====================================================================
// Goto control node
//=====================================================================
-SUPERVGUI_CanvasGotoNode::SUPERVGUI_CanvasGotoNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+SUPERVGUI_CanvasGotoNode::SUPERVGUI_CanvasGotoNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode)
{
Trace("SUPERVGUI_CanvasGotoNode::SUPERVGUI_CanvasGotoNode");
}
+SUPERVGUI_CanvasGotoNode* SUPERVGUI_CanvasGotoNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
+{
+ SUPERVGUI_CanvasGotoNode* aRet = new SUPERVGUI_CanvasGotoNode (mgr, theParent, theMain, theNode);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasGotoNode::createPrs() const
{
return new SUPERVGUI_CanvasGotoNodePrs( resMgr(), getMain()->getCanvas(),
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();
}
}
//=====================================================================
// Macro node
//=====================================================================
-SUPERVGUI_CanvasMacroNode::SUPERVGUI_CanvasMacroNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+SUPERVGUI_CanvasMacroNode::SUPERVGUI_CanvasMacroNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
SUPERVGUI_CanvasComputeNode(mgr, theParent, theMain, theNode)
{
Trace("SUPERVGUI_CanvasMacroNode::SUPERVGUI_CanvasMacroNode");
}
+SUPERVGUI_CanvasMacroNode* SUPERVGUI_CanvasMacroNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
+{
+ SUPERVGUI_CanvasMacroNode* aRet = new SUPERVGUI_CanvasMacroNode (mgr, theParent, theMain, theNode);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasMacroNode::createPrs() const
{
return new SUPERVGUI_CanvasMacroNodePrs( resMgr(), getMain()->getCanvas(),
//=====================================================================
// Cell node: node for table view
//=====================================================================
-SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode(SUIT_ResourceMgr* mgr, QObject* theParent,
- SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode):
+SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode, true)
{
Trace("SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode");
myIsControl = true;
}
+SUPERVGUI_CanvasCellNode* SUPERVGUI_CanvasCellNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
+{
+ SUPERVGUI_CanvasCellNode* aRet = new SUPERVGUI_CanvasCellNode (mgr, theParent, theMain, theNode);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
SUPERVGUI_CanvasCellNode::~SUPERVGUI_CanvasCellNode()
{
}
return aPrs;
}
-SUPERVGUI_CanvasCellEndNode::SUPERVGUI_CanvasCellEndNode( SUIT_ResourceMgr* mgr, QObject* theParent,
- SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode,
+SUPERVGUI_CanvasCellEndNode::SUPERVGUI_CanvasCellEndNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
SUPERVGUI_CanvasCellNode* theStart):
SUPERVGUI_CanvasCellNode(mgr, theParent, theMain, theNode)
{
//set end cell for start cell as pair
myPairCell->setPairCell(dynamic_cast<SUPERVGUI_CanvasCellNode*>(this));
}
+
+SUPERVGUI_CanvasCellEndNode* SUPERVGUI_CanvasCellEndNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain,
+ SUPERV_CNode theNode,
+ SUPERVGUI_CanvasCellNode* theStart)
+{
+ SUPERVGUI_CanvasCellEndNode* aRet =
+ new SUPERVGUI_CanvasCellEndNode (mgr, theParent, theMain, theNode, theStart);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
/*
bool SUPERVGUI_CanvasCellEndNode::setNodeName(QString theName)
{
return SUPERVGUI_CanvasNode::setNodeName(theName);
}
*/
+
//-----------------------------------------------------------
//*************** Select Inline node dialog******************
// Taken from SUPERVGUI_ControlNode.cxx without change