From 597cd196e42922569e04044f3db41c56ac2ec5e2 Mon Sep 17 00:00:00 2001 From: mkr Date: Tue, 14 Dec 2004 13:40:57 +0000 Subject: [PATCH] Inconsistencies between GUI and TUI in SUPERVISOR: 1) add the possibility to create of an InLine node without a Python function defined (empty, no code); 2) add the possibility to define Python functions in EndLoop and EndSwith nodes and to create Loop and Switch nodes with empty functions; 3) add the possibilyty to define a function without a body - in this case, if a function with the same name was already defined in another node, it's code (body) will be used (executed). --- src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx | 8 ++++---- src/SUPERVGUI/SUPERVGUI_Service.cxx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx index f211862..abc4462 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx @@ -161,18 +161,18 @@ QPopupMenu* SUPERVGUI_CanvasNode::getPopupMenu(QWidget* theParent) getNodeType() != SUPERV::EndSwitchNode) popup->insertItem(tr("MSG_CHANGE_INFO"), this, SLOT(changeInformation())); + popup->insertSeparator(); + popup->insertItem( tr( "MNU_EDIT_FUNC" ), this, SLOT(editFunction())); + if (myMain->isEditable() && getNodeType() != SUPERV::FactoryNode && getNodeType() != SUPERV::ComputingNode - && getNodeType() != SUPERV::EndLoopNode + && getNodeType() != SUPERV::EndLoopNode && getNodeType() != SUPERV::MacroNode) { QPopupMenu* addPortMenu = new QPopupMenu(theParent); addPortMenu->insertItem( tr( "MNU_INPUT" ), this, SLOT(addInputPort())); if (getNodeType() != SUPERV::LoopNode) addPortMenu->insertItem( tr( "MNU_OUTPUT" ), this, SLOT(addOutputPort())); - popup->insertSeparator(); - if ((getNodeType() != SUPERV::EndSwitchNode)) - popup->insertItem( tr( "MNU_EDIT_FUNC" ), this, SLOT(editFunction())); popup->insertItem( tr( "MNU_ADD_PORT" ), addPortMenu); popup->insertItem( tr( "MNU_MANAGE_PORTS" ), this, SLOT(managePorts())); } diff --git a/src/SUPERVGUI/SUPERVGUI_Service.cxx b/src/SUPERVGUI/SUPERVGUI_Service.cxx index 6213aa4..fe0c91f 100644 --- a/src/SUPERVGUI/SUPERVGUI_Service.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Service.cxx @@ -503,7 +503,7 @@ void SUPERVGUI_Service::addInlineNode() { int cx, cy; switch (aSel) { case 0: // Computation - if (myScriptPane->isDefined()) { + { SUPERV_INode aNode = aMain->getDataflow()->INode(myScriptPane->getFuncName().latin1(), (myScriptPane->getFunction()).in()); if (CORBA::is_nil(aNode)) { @@ -520,7 +520,7 @@ void SUPERVGUI_Service::addInlineNode() { break; case 1: // Switch - if (myScriptPane->isDefined()) { + { SUPERV_INode aEndNode; SUPERV_SNode aStartNode = aMain->getDataflow()->SNode(myScriptPane->getFuncName().latin1(), (myScriptPane->getFunction()).in(), -- 2.39.2