Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1. master mergefrom_BR_Dev_For_4_0_07Mar2008 mergefrom_BR_Dev_For_4_0_V411
authorjfa <jfa@opencascade.com>
Fri, 7 Mar 2008 07:47:14 +0000 (07:47 +0000)
committerjfa <jfa@opencascade.com>
Fri, 7 Mar 2008 07:47:14 +0000 (07:47 +0000)
70 files changed:
adm_local/unix/make_commence.in
build_configure
configure.in.base
doc/salome/gui/SUPERV/files/filtering_and_storing_output_messages.htm
doc/salome/gui/SUPERV/index.html [new file with mode: 0755]
doc/salome/tui/SUPERV/sources/bg_salome.gif [deleted file]
idl/SUPERV.idl
resources/SalomeApp.xml
src/GraphBase/DataFlowBase_Base.cxx
src/GraphBase/DataFlowBase_Base.hxx
src/GraphBase/DataFlowBase_ComputingNode.cxx
src/GraphBase/DataFlowBase_ComputingNode.hxx
src/GraphBase/DataFlowBase_DataPort.cxx
src/GraphBase/DataFlowBase_Graph.cxx
src/GraphBase/DataFlowBase_Graph.hxx
src/GraphBase/DataFlowBase_OutPort.cxx
src/GraphBase/DataFlowBase_PortsOfNode.cxx
src/GraphBase/DataFlowBase_XmlHandler.cxx
src/GraphBase/Makefile.in
src/GraphBase/SuperVisionBase_CheckOfUndefined.cxx
src/GraphEditor/DataFlowEditor_DataFlow.hxx
src/GraphEditor/DataFlowEditor_OutNode.cxx
src/GraphEditor/DataFlowEditor_OutNode.hxx
src/GraphEditor/Makefile.in
src/GraphExecutor/DataFlowExecutor_DataFlow.cxx
src/GraphExecutor/DataFlowExecutor_DataFlow.hxx
src/GraphExecutor/DataFlowExecutor_DynInvoke.cxx
src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx
src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx
src/GraphExecutor/DataFlowExecutor_InNode.cxx
src/GraphExecutor/DataFlowExecutor_InNode.hxx
src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx
src/GraphExecutor/DataFlowExecutor_OutNode.cxx
src/GraphExecutor/DataFlowExecutor_OutNode.hxx
src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx
src/GraphExecutor/Makefile.in
src/Makefile.in
src/SUPERVGUI/SUPERVGUI.cxx
src/SUPERVGUI/SUPERVGUI_ArrayView.cxx
src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx
src/SUPERVGUI/SUPERVGUI_Canvas.cxx
src/SUPERVGUI/SUPERVGUI_CanvasArray.cxx
src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx
src/SUPERVGUI/SUPERVGUI_CanvasControlNode.h
src/SUPERVGUI/SUPERVGUI_CanvasLink.cxx
src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx
src/SUPERVGUI/SUPERVGUI_CanvasNode.h
src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx
src/SUPERVGUI/SUPERVGUI_CanvasPort.cxx
src/SUPERVGUI/SUPERVGUI_CanvasView.cxx
src/SUPERVGUI/SUPERVGUI_Clipboard.cxx
src/SUPERVGUI/SUPERVGUI_Main.cxx
src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx
src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.h
src/SUPERVGUI/SUPERVGUI_Service.cxx
src/SUPERVGUI/SUPERVGUI_Service.h
src/SUPERVGUI/SUPERV_msg_en.po
src/Supervision/CNode_Impl.cxx
src/Supervision/FNode_Impl.cxx
src/Supervision/GNode_Impl.cxx
src/Supervision/Graph_Impl.cxx
src/Supervision/Graph_Impl.hxx
src/Supervision/INode_Impl.cxx
src/Supervision/INode_Impl.hxx
src/Supervision/Makefile.in
src/Supervision/SUPERV_shared_modules.py
src/Supervision/SuperV.py
src/Supervision/SuperV_Impl.cxx
src/Supervision/Value_Impl.cxx
src/Supervision/batchmode_SuperV.py

index 3e8f8b8f34959ad4aeb7620bae959090989a8026..d1a7049cb39e6b718430fb926dbc5beebffbb68d 100644 (file)
@@ -1,6 +1,8 @@
 # common directories to put headerfiles
 inc_builddir=$(top_builddir)/include/salome
 
+MODULE_NAME=@MODULE_NAME@
+
 @SET_MAKE@
 SHELL=/bin/sh
 
@@ -138,7 +140,7 @@ OMNIORB_LIBS        = @OMNIORB_LIBS@
 OMNIORB_CXXFLAGS    = @OMNIORB_CXXFLAGS@
 
 OMNIORB_IDL         = @OMNIORB_IDL@
-OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
+OMNIORB_IDLCXXFLAGS = -Wba @OMNIORB_IDLCXXFLAGS@
 OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome
 
 OMNIORB_IDL_CLN_H   = @OMNIORB_IDL_CLN_H@
@@ -223,7 +225,7 @@ idldir=${prefix}/idl/salome
 sharedpydir=@exec_prefix@/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
 incmakedir=${prefix}/salome_adm/unix
 
-docdir=${prefix}/doc/salome
+docdir=${prefix}/share/doc/salome
 
 #
 # begin of package rules
@@ -273,11 +275,21 @@ ac_cxx_partial_specialization.m4  python.m4                               \
 ac_cxx_typename.m4                check_pthreads.m4  check_cas.m4      \
 ac_cc_warnings.m4                 check_swig.m4 
 
+ifeq ($(SUPERV_WITH_GUI),yes)
 ACLOCAL_GUI = \
 check_vtk.m4                     check_opengl.m4    check_qt.m4       \
 check_GUI.m4                      check_corba_in_GUI.m4 
 
 $(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \
                           $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%)
-       cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \
-                                                                      -I @GUI_ROOT_DIR@/adm_local/unix/config_files
+       cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \
+                                                                  -I @GUI_ROOT_DIR@/adm_local/unix/config_files
+endif
+
+ifeq ($(SUPERV_WITH_GUI),no)
+$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \
+                          $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%)
+        cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_file
+s
+endif
+
index 95905061b6bdc51f4992545dad31cec230a47611..5de36b8af1a4f2de52e3179dc3dc629dcb6d1783 100755 (executable)
 ORIG_DIR=`pwd`
 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
 
+########################################################################
+# Check --with-kernel option
+
+SUPERV_WITH_GUI="yes"
+
+for option
+do
+  case $option in
+      -with-ihm | --with-ihm)
+          SUPERV_WITH_GUI="yes"
+          break;;
+      -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no)
+          SUPERV_WITH_GUI="no"
+          break;;
+  esac
+done
+
 ########################################################################
 # Test if the KERNEL_ROOT_DIR is set correctly
 
@@ -29,9 +46,11 @@ fi
 ########################################################################
 # Test if the GUI_ROOT_DIR is set correctly
 
-if test ! -d "${GUI_ROOT_DIR}"; then
+if test ${SUPERV_WITH_GUI} = yes; then
+  if test ! -d "${GUI_ROOT_DIR}"; then
     echo "failed : GUI_ROOT_DIR variable is not correct !"
     exit
+  fi
 fi
 
 ########################################################################
@@ -211,8 +230,15 @@ else
        echo -n "Creating 'configure' script ...  "
 fi
 
-aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-                                       -I ${GUI_ROOT_DIR}/adm_local/unix/config_files
+if test ${SUPERV_WITH_GUI} = yes; then
+  aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+                                         -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED \
+                                         -I ${GUI_ROOT_DIR}/adm_local/unix/config_files
+else
+  aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+                                         -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED
+fi
+
 if autoconf
 then
        echo "done"
index 056ea3974d97bdd03a3f5fc2582478963084ef72..b4e0be05d76c93ef34dc41c8c2dee27923af4ed8 100644 (file)
 #
 
 AC_INIT(src)
-AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files)
+AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED)
 AC_CANONICAL_HOST
 
 PACKAGE=salome
 AC_SUBST(PACKAGE)
 
-VERSION=3.2.0
-XVERSION=0x030200
+VERSION=4.1.1
+XVERSION=0x040101
 AC_SUBST(VERSION)
 AC_SUBST(XVERSION)
 
+# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
+MODULE_NAME=superv
+AC_SUBST(MODULE_NAME)
+
 dnl
 dnl Initialize source and build root directories
 dnl
@@ -200,14 +204,6 @@ AC_SUBST_FILE(CORBA)
 corba=make_$ORB
 CORBA=adm_local/unix/$corba
 
-echo
-echo ---------------------------------------------
-echo testing openGL
-echo ---------------------------------------------
-echo
-
-CHECK_OPENGL
-
 echo
 echo ---------------------------------------------
 echo testing QT
@@ -216,21 +212,41 @@ echo
 
 CHECK_QT
 
-echo
-echo ---------------------------------------------
-echo testing MSG2QM
-echo ---------------------------------------------
-echo
+dnl
+dnl ---------------------------------------------
+dnl testing WITHIHM
+dnl ---------------------------------------------
+dnl
 
-CHECK_MSG2QM
+CHECK_WITHIHM
 
-echo
-echo ---------------------------------------------
-echo testing VTK
-echo ---------------------------------------------
-echo
+if test "X$WITHIHM" = "Xyes"; then
+
+  echo
+  echo ---------------------------------------------
+  echo testing openGL
+  echo ---------------------------------------------
+  echo
+  
+  CHECK_OPENGL
 
-CHECK_VTK
+  echo
+  echo ---------------------------------------------
+  echo testing MSG2QM
+  echo ---------------------------------------------
+  echo
+
+  CHECK_MSG2QM
+
+  echo
+  echo ---------------------------------------------
+  echo testing VTK
+  echo ---------------------------------------------
+  echo
+
+  CHECK_VTK
+
+fi
 
 echo
 echo ---------------------------------------------
@@ -264,25 +280,28 @@ echo
 
 CHECK_HTML_GENERATORS
 
-echo
-echo
-echo ---------------------------------------------
-echo Testing GUI
-echo ---------------------------------------------
-echo
-
-CHECK_SALOME_GUI
-
-echo
-echo ---------------------------------------------
-echo Testing full GUI
-echo ---------------------------------------------
-echo
-
-CHECK_CORBA_IN_GUI
-if test "x${CORBA_IN_GUI}" != "xyes"; then
-  echo "failed : For configure SUPERV module necessary full GUI !"
-  exit
+if test "X$WITHIHM" = "Xyes"; then
+  echo
+  echo
+  echo ---------------------------------------------
+  echo Testing GUI
+  echo ---------------------------------------------
+  echo
+
+  CHECK_SALOME_GUI
+
+  echo
+  echo ---------------------------------------------
+  echo Testing full GUI
+  echo ---------------------------------------------
+  echo
+
+  CHECK_CORBA_IN_GUI
+  if test "x${CORBA_IN_GUI}" != "xyes"; then
+    echo "failed : For configure SUPERV module necessary full GUI !"
+    exit
+  fi
 fi
 
 echo ---------------------------------------------
@@ -299,7 +318,12 @@ echo ---------------------------------------------
 echo
 
 echo Configure
-variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok Kernel_ok"
+if test "X$WITHIHM" = "Xyes"; then
+  variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok Kernel_ok"
+fi
+if test "X$WITHIHM" = "Xno"; then
+  variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok qt_ok hdf5_ok omniORB_ok boost_ok occ_ok Kernel_ok"
+fi
 
 for var in $variables
 do
@@ -329,7 +353,7 @@ else
 fi
 
 # make other build directories
-for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl
+for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources/${MODULE_NAME} idl
 do
 #   if test ! -d $rep ; then
 #      eval mkdir $rep
index 5ae943a93e66466a1601de4571f03eff1aa134c5..531a70919c4150f15d17cb8491a8f113bffe3cc3 100755 (executable)
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">\r
-\r
-<html>\r
-\r
-<head>\r
-<title>Filtering and storing output messages</title>\r
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">\r
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">\r
-<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">\r
-<!--\r
-if (navigator.appName !="Netscape")\r
-{   document.write("<link rel='stylesheet' href='../default.css'>");}\r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-h1.whs1 { font-family:'Times New Roman' , serif; }\r
-img_whs2 { border:none; width:30px; height:30px; float:none; border-style:none; }\r
-p.whs3 { font-family:'Times New Roman' , serif; }\r
-p.whs4 { font-family:'Times New Roman' , serif; margin-left:0px; }\r
-p.whs5 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:normal; color:#000000; }\r
-p.whs6 { margin-left:80px; }\r
-img_whs7 { border:none; width:448px; height:274px; float:none; border-style:none; }\r
--->\r
-</style><script type="text/javascript" language="JavaScript">\r
-<!--\r
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))\r
-{\r
-  var strNSS = "<style type='text/css'>";\r
-  strNSS += "p.whs4 {margin-left:1pt; }";\r
-  strNSS +="</style>";\r
-  document.write(strNSS);\r
-}\r
-//-->\r
-</script>\r
-<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">\r
-<!--\r
-function reDo() {\r
-  if (innerWidth != origWidth || innerHeight != origHeight)\r
-     location.reload();\r
-}\r
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {\r
-       origWidth = innerWidth;\r
-       origHeight = innerHeight;\r
-       onresize = reDo;\r
-}\r
-onerror = null; \r
-//-->\r
-</script>\r
-<style type="text/css">\r
-<!--\r
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }\r
-p.WebHelpNavBar { text-align:right; }\r
--->\r
-</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>\r
-<script type="text/javascript" language="javascript" src="../whver.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>\r
-<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.gbWhTopic)\r
-{\r
-       if (window.setRelStartPage)\r
-       {\r
-       addTocInfo("SUPERVISOR module\nInitializing and executing graphs\nFiltering and logging output messages");\r
-addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");\r
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");\r
-\r
-       }\r
-\r
-\r
-       if (window.setRelStartPage)\r
-       {\r
-       setRelStartPage("../index.htm");\r
-\r
-               autoSync(1);\r
-               sendSyncInfo();\r
-               sendAveInfoOut();\r
-       }\r
-\r
-}\r
-else\r
-       if (window.gbIE4)\r
-               document.location.reload();\r
-//-->\r
-</script>\r
-</head>\r
-<body><script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(4);\r
-//-->\r
-</script>\r
-<h1 class="whs1">Filtering and logging \r
- output messages</h1>\r
-\r
-<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><img src="../i_blue.jpg" x-maintain-ratio="TRUE" width="30px" height="30px" border="0" class="img_whs2"></font></span>In <span style="font-weight: bold;"><B>Supervisor</B></span> \r
- you can filter and save in a definite text file all output messages produced \r
- by the component during execution of your graph:</p>\r
-\r
-<p class="whs3">&nbsp;</p>\r
-\r
-<p class=TODO>To set filtering parameters:</p>\r
-\r
-<p class="whs4">&nbsp;</p>\r
-\r
-<p class="whs5">Before execution of your graph right-click \r
- on the background of the Supervisor viewer window containing your graph \r
- and from the pop-up menu choose <span style="font-weight: bold;"><B>Filter \r
- Notification</B></span> option. The following dialog box will appear:</p>\r
-\r
-<p class="whs6">&nbsp;</p>\r
-\r
-<p class="whs6"><img src="../pics/filternotification1.png" x-maintain-ratio="TRUE" width="448px" height="274px" border="0" class="img_whs7"></p>\r
-\r
-<p class="whs5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>\r
-\r
-<p class="whs4">In \r
- this dialog box you can specify a file, where all output messages will \r
- be put, and choose the type of messages for logging by every node composing \r
- your graph.</p>\r
-\r
-<script type="text/javascript" language="javascript1.2">\r
-<!--\r
-if (window.writeIntopicBar)\r
-       writeIntopicBar(0);\r
-//-->\r
-</script>\r
-</body>\r
-</html>\r
+<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
+
+<html>
+
+<head>
+<title>Filtering and storing output messages</title>
+<meta http-equiv="content-type" content="text/html; charset=windows-1252">
+<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
+<link rel="stylesheet" href="../default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
+<!--
+if (navigator.appName !="Netscape")
+{   document.write("<link rel='stylesheet' href='../default.css'>");}
+//-->
+</script>
+<style type="text/css">
+<!--
+h1.whs1 { font-family:'Times New Roman' , serif; }
+img_whs2 { border:none; width:30px; height:30px; float:none; border-style:none; }
+p.whs3 { font-family:'Times New Roman' , serif; }
+p.whs4 { font-family:'Times New Roman' , serif; margin-left:0px; }
+p.whs5 { margin-left:36px; }
+p.whs6 { margin-left:80px; }
+img_whs7 { border:none; width:448px; height:274px; float:none; border-style:none; }
+p.whs8 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:normal; color:#000000; }
+-->
+</style><script type="text/javascript" language="JavaScript">
+<!--
+if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
+{
+  var strNSS = "<style type='text/css'>";
+  strNSS += "p.whs4 {margin-left:1pt; }";
+  strNSS +="</style>";
+  document.write(strNSS);
+}
+//-->
+</script>
+<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
+<!--
+function reDo() {
+  if (innerWidth != origWidth || innerHeight != origHeight)
+     location.reload();
+}
+if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
+       origWidth = innerWidth;
+       origHeight = innerHeight;
+       onresize = reDo;
+}
+onerror = null; 
+//-->
+</script>
+<style type="text/css">
+<!--
+div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
+p.WebHelpNavBar { text-align:right; }
+-->
+</style><script type="text/javascript" language="javascript1.2" src="../whmsg.js"></script>
+<script type="text/javascript" language="javascript" src="../whver.js"></script>
+<script type="text/javascript" language="javascript1.2" src="../whproxy.js"></script>
+<script type="text/javascript" language="javascript1.2" src="../whutils.js"></script>
+<script type="text/javascript" language="javascript1.2" src="../whtopic.js"></script>
+<script type="text/javascript" language="javascript1.2">
+<!--
+if (window.gbWhTopic)
+{
+       if (window.setRelStartPage)
+       {
+       addTocInfo("SUPERVISOR module\nInitializing and executing graphs\nFiltering and logging output messages");
+addButton("show",BTN_IMG,"Show","","","","",0,0,"../whd_show0.gif","../whd_show2.gif","../whd_show1.gif");
+addButton("hide",BTN_IMG,"Hide","","","","",0,0,"../whd_hide0.gif","../whd_hide2.gif","../whd_hide1.gif");
+
+       }
+
+
+       if (window.setRelStartPage)
+       {
+       setRelStartPage("../index.htm");
+
+               autoSync(1);
+               sendSyncInfo();
+               sendAveInfoOut();
+       }
+
+}
+else
+       if (window.gbIE4)
+               document.location.reload();
+//-->
+</script>
+</head>
+<body><script type="text/javascript" language="javascript1.2">
+<!--
+if (window.writeIntopicBar)
+       writeIntopicBar(4);
+//-->
+</script>
+<h1 class="whs1">Filtering and logging 
+ output messages</h1>
+
+<p><span style="font-size: 12pt;"><font size=3 style="font-size:12pt;"><img src="../i_blue.jpg" x-maintain-ratio="TRUE" width="30px" height="30px" border="0" class="img_whs2"></font></span>In <span style="font-weight: bold;"><B>Supervisor</B></span> 
+ you can filter and save in a definite text file all output messages produced 
+ by the component during the execution of your graph:</p>
+
+<p class="whs3">&nbsp;</p>
+
+<p class=TODO>To set filtering parameters:</p>
+
+<p class="whs4">&nbsp;</p>
+
+<p class="whs5">Before the execution of your graph right-click 
+ on the background of the Supervisor viewer window containing your graph 
+ and from the pop-up menu choose <span style="font-weight: bold;"><B>Filter 
+ Notification</B></span> option. The following dialog box will appear:</p>
+
+<p class="whs6">&nbsp;</p>
+
+<p class="whs6"><img src="../pics/filternotification1.png" x-maintain-ratio="TRUE" width="448px" height="274px" border="0" class="img_whs7"></p>
+
+<p class="whs8">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
+
+<p class="whs5">In this dialog box you can specify a file 
+ for all output messages sent by the component for notification purposes 
+ and choose the type of messages for logging by every node composing your 
+ graph.</p>
+
+<script type="text/javascript" language="javascript1.2">
+<!--
+if (window.writeIntopicBar)
+       writeIntopicBar(0);
+//-->
+</script>
+</body>
+</html>
diff --git a/doc/salome/gui/SUPERV/index.html b/doc/salome/gui/SUPERV/index.html
new file mode 100755 (executable)
index 0000000..d73632a
--- /dev/null
@@ -0,0 +1,180 @@
+<html>\r
+<head>\r
+<title>Supervisor Module Reference Manual</title>\r
+\r
+<meta name="generator" content="RoboHelp by eHelp Corporation   www.ehelp.com">\r
+<meta name="description" content="WebHelp 5.50">\r
+</head>\r
+<script language="javascript1.2" src="whutils.js"></script>\r
+<script language="javascript1.2" src="whmsg.js"></script>\r
+<script language="javascript" src="whver.js"></script>\r
+<script language="javascript1.2" src="whstub.js"></script><script language="javascript1.2" src="whstart.js"></script>\r
+<script language="javascript">\r
+<!--\r
+var strDefaultTopic = "about:blank";\r
+var nWebhelpNavPaneMode = 1;                   //1: DHTML 2:Applet 3:PureHTML 4:Noframeset\r
+var bNoApplet  = false;\r
+var strPaneDHTML  = "whd_nvp10.htm";           //whd_nvp10.htm  if tab enabled, whnframe.htm if tab disabled.\r
+var strPaneApplet = "whd_nvp20.htm";\r
+var strPaneList   = "whgdata/whnvp30.htm";\r
+\r
+var strHTML = "";\r
+var strPane = "";\r
+var nViewFrameType = -1;\r
+\r
+function CMRServer()\r
+{\r
+  this.m_cAgents = new Array;\r
+}\r
+var cMRServer = new CMRServer;\r
+\r
+//figure out which mode is the best\r
+if (!window.gAgent)\r
+{\r
+       // low end browser, we don't even try to determine it.\r
+       document.location = "whnjs.htm";\r
+}\r
+else\r
+{\r
+       if (!gbNav4&&!gbIE4&&!gbOpera7&&!gbSafari)\r
+               document.location = "whnjs.htm";\r
+       else if (gbNav4 && !gbNav6 && ((gnVerMinor <= 4.06)))\r
+               document.location = "whnjs.htm";\r
+       else if (gbMac && gbIE4 && !gbIE5)\r
+               document.location = "whnjs.htm";\r
+       //figure out which mode is the best\r
+       else \r
+       {\r
+               nViewFrameType=nWebhelpNavPaneMode;\r
+               if (nWebhelpNavPaneMode==1||nWebhelpNavPaneMode == 2)\r
+               {\r
+                       var gbDHTML=(nWebhelpNavPaneMode==1);\r
+                       if (gbNav4)                                                                             nViewFrameType = 2;\r
+                       if (gbNav4&&(gnVerMinor < 4.1))                                         nViewFrameType = 3;\r
+                       if (gbNav4&&(gnVerMinor == 4.6))                                        nViewFrameType = 3;\r
+                       if (gbIE4&&gbDHTML)                                                                     nViewFrameType = 1;\r
+                       if (gbIE4&&gbSunOS&&nWebhelpNavPaneMode==2)                     nViewFrameType = 3;\r
+                       if (gbNav6&&gbDHTML)                                                            nViewFrameType = 1;\r
+                       if (gbNav6&&!gbNav61&&nWebhelpNavPaneMode == 2)         nViewFrameType = 3;\r
+                       if (gbMac)                                                                                      nViewFrameType = 3;\r
+                       if (gbOpera7&&nViewFrameType == 2)                                      nViewFrameType = 3;\r
+                       if ((bNoApplet)&&(nViewFrameType == 2))                         nViewFrameType = 3;\r
+               }\r
+       }\r
+}\r
+\r
+if (nViewFrameType!=-1)\r
+{\r
+       var gbWindows = ((gAgent.indexOf("win") != -1) || (gAgent.indexOf("16bit") != -1));\r
+       //The colordepth of the 16 color on Windows is 1. \r
+       if ((gbWindows) && (gbNav4) && (window.screen) && (window.screen.colorDepth <= 4))\r
+       {\r
+          alert("WebHelp has detected that your display is set to 16 colors. For full WebHelp support, please set your display to use 256 or more colors.");\r
+          nViewFrameType = 3;\r
+       }\r
+\r
+       //figure out which one is navpane\r
+       if (nViewFrameType == 1)\r
+               strPane = strPaneDHTML;\r
+       else if (nViewFrameType == 2)\r
+               strPane = strPaneApplet;\r
+       else \r
+               strPane = strPaneList;\r
+\r
+       var oParam = new Object();\r
+       oParam.sTopic = "";\r
+       var oMsg = new whMessage(WH_MSG_GETDEFAULTTOPIC, window, 1, oParam);\r
+       if (SendMessage(oMsg) && oParam.sTopic != "")\r
+               strDefaultTopic =  oParam.sTopic;\r
+\r
+\r
+       if (nViewFrameType == 1)\r
+       {\r
+               //DHTML (iframe or xml based)\r
+               strHTML += "<frameset  id=\"whPfset\" cols=\"260,*\" frameborder=\"1\">";\r
+               strHTML += "<frame name=\"bsscleft\" title=\"navigation frame\" src=\"" + strPane + "\" scrolling=\"no\"></frame>";\r
+               strHTML += "<frame name=\"bsscright\" title=\"topic frame\" src=\"" + strDefaultTopic + "\" scrolling=\"auto\"></frame></frameset>";\r
+       }\r
+       else if (nViewFrameType == 2)\r
+       {\r
+               //applet (xml based)\r
+               strHTML += "<frameset  id=\"whPfset\" cols=\"260,*\" framespacing=\"0\" frameborder=\"0\" border=\"0\">";\r
+               strHTML += "<frame name=\"bsscleft\" title=\"navigation frame\" src=\"" + strPane+ "\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\"></frame>";\r
+               strHTML += "<frame name=\"bsscright\" title=\"topic frame\" src=\"" + strDefaultTopic + "\" scrolling=\"auto\"></frame></frameset>";\r
+       }\r
+       else if (nViewFrameType == 3)\r
+       {\r
+               //generic html (pure html based)\r
+               strHTML += "<frameset  id=\"whPfset\" cols=\"260,*\">";\r
+               strHTML += "<frame title=\"navigation frame\" src=\"" + strPane + "\" name=\"bsscleft\"  scrolling=\"no\"></frame>";\r
+               strHTML += "<frame title=\"topic frame\" src=\"" + strDefaultTopic + "\" name=\"bsscright\" scrolling=\"auto\"></frame>";\r
+               strHTML += "</frameset>";\r
+       } \r
+       else if (nViewFrameType == 4)\r
+       {\r
+               //no navipane at all\r
+               strHTML += "<frameset  id=\"whPfset\" border=\"0\" cols=\"100%,*\">";\r
+               strHTML += "<frame title=\"topic frame\" src=\"" + strDefaultTopic + "\" name=\"bsscright\" framespacing=\"0\" frameborder=\"0\" border=\"0\" scrolling=\"auto\">";\r
+               strHTML += "</frameset>";\r
+       }\r
+\r
+       document.write(strHTML);\r
+\r
+       RegisterListener2(window, WH_MSG_SHOWPANE);\r
+       RegisterListener2(window, WH_MSG_HIDEPANE);\r
+       RegisterListener2(window, WH_MSG_ISPANEVISIBLE);\r
+       window.onunload = window_unload;\r
+}\r
+\r
+function window_unload()\r
+{\r
+       UnRegisterListener2(window, WH_MSG_SHOWPANE);\r
+       UnRegisterListener2(window, WH_MSG_HIDEPANE);\r
+       UnRegisterListener2(window, WH_MSG_ISPANEVISIBLE);\r
+}\r
+\r
+\r
+function onSendMessage(oMsg)\r
+{\r
+       var nMsgId = oMsg.nMessageId;\r
+       if (nMsgId == WH_MSG_SHOWPANE)\r
+       {\r
+               getElement("whPfset").cols = "260,*";\r
+               var onMsg = new whMessage(WH_MSG_PANESTATUE, this, 1, "visible");\r
+               SendMessage(onMsg);\r
+               onMsg = new whMessage(WH_MSG_GETPANEINFO, this, 1, "");\r
+               if (SendMessage(onMsg))\r
+               {\r
+                       onMsg = new whMessage(WH_MSG_PANEINFO, this, 1, onMsg.oParam);\r
+                       SendMessage(onMsg);\r
+               }\r
+               return false;\r
+       }\r
+       else if (nMsgId == WH_MSG_HIDEPANE)\r
+       {\r
+               getElement("whPfset").cols = "0,*";\r
+               var onMsg = new whMessage(WH_MSG_PANESTATUE, this, 1, "invisible");\r
+               SendMessage(onMsg);\r
+               onMsg = new whMessage(WH_MSG_PANEINFO, this, 1, "");\r
+               SendMessage(onMsg);\r
+               return false;\r
+       }\r
+       else if (nMsgId == WH_MSG_ISPANEVISIBLE)\r
+       {\r
+               var n = parseInt(getElement("whPfset").cols);\r
+               if (n > 0)\r
+               {\r
+                       oMsg.oParam.bVisible = true;\r
+               }\r
+               return false;\r
+       }\r
+       return true;\r
+}\r
+//-->\r
+</script>\r
+<body>\r
+<noscript>\r
+       <p> It seems javascript is disabled in your browser, please enable it and reload again, or click <a href="whnjs.htm">here</a> to view without javascript</p>\r
+</noscript>\r
+</body>\r
+</html>\r
diff --git a/doc/salome/tui/SUPERV/sources/bg_salome.gif b/doc/salome/tui/SUPERV/sources/bg_salome.gif
deleted file mode 100755 (executable)
index 677b704..0000000
Binary files a/doc/salome/tui/SUPERV/sources/bg_salome.gif and /dev/null differ
index 959ddb7650456f694ee8d30f5893f16cacb6ba3b..48149407f50f18b92b2d01b512abd3fc1e47022c 100644 (file)
@@ -671,19 +671,21 @@ executed for performing calculations, as well as input and output parameters for
 */
     SUPERV::Port OutPort( in string aParameterName , in string aParameterType ) ;
 
-/*! Creates an Input DataStreamPort in an Inline node.
-\param aParameterName This value sets the name of the parameter which will be defined in this port.
-\param aParameterType This value sets the type of the parameter which will be defined in this port.
-*/
-    SUPERV::StreamPort InStreamPort( in string aParameterName , in SALOME_ModuleCatalog::DataStreamType aParameterType , in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
+    /*! Creates an Input DataStreamPort in an Inline node.
+      \param aParameterName This value sets the name of the parameter which will be defined in this port.
+      \param aParameterType This value sets the type of the parameter which will be defined in this port.
+    */
+    SUPERV::StreamPort InStreamPort (in string aParameterName, in string aParameterType,
+                                    in SALOME_ModuleCatalog::DataStreamDependency aDependency);
 
-/*! Creates an Output DataStreamPort in an Inline node.
-\param aParameterName This value sets the name of the parameter which will be defined in this port.
-\param aParameterType This value sets the type of the parameter which will be defined in this port.
-*/
-    SUPERV::StreamPort OutStreamPort( in string aParameterName , in SALOME_ModuleCatalog::DataStreamType aParameterType , in SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
+    /*! Creates an Output DataStreamPort in an Inline node.
+      \param aParameterName This value sets the name of the parameter which will be defined in this port.
+      \param aParameterType This value sets the type of the parameter which will be defined in this port.
+    */
+    SUPERV::StreamPort OutStreamPort (in string aParameterName, in string aParameterType,
+                                     in SALOME_ModuleCatalog::DataStreamDependency aDependency);
+  };
 
-  } ;
 /*! \brief %GNode class
 
 This class is necessary for management of GOTO/EndLoop/EndSwitch nodes in the dataflow.
@@ -784,7 +786,7 @@ This interface includes a set of methods used for management of the graphs in %S
     SUPERV::FNode FNode( in string aComponentName ,
                          in string anInterfaceName ,
                          in SALOME_ModuleCatalog::Service aService ,
-                        in boolean isCimpl ) ;
+                        in SALOME_ModuleCatalog::ImplType implType ) ;
 
     /*! Creates an InLine Node in a Graph.
     */
@@ -990,7 +992,19 @@ This interface includes a set of methods used for management of the graphs in %S
     /*! Forces use of Editor's data model and destroy of Executor
      */
     void Editing();
-    
+
+    /*! Returns the default name of container for C component
+     */
+    string DefaultCContainerName();
+
+    /*! Returns the default name of container for Python component
+     */
+    string DefaultPythonContainerName();
+
+    /*! Returns the last container name associated with the ComponentName component
+     */
+    string ContainerNameForComponent( in string ComponentName );
+
   } ;
 
 
index 4848fae44e9c81d86609d8aff584f6097d3c25e5..70797d440491a6c296359a74722646ed42633024 100644 (file)
@@ -6,6 +6,6 @@
   </section>
   <section name="resources">
     <!-- Module resources -->
-    <parameter name="SUPERV" value="${SUPERV_ROOT_DIR}/share/salome/resources"/>
+    <parameter name="SUPERV" value="${SUPERV_ROOT_DIR}/share/salome/resources/superv"/>
   </section>
 </document>
index dc0015511cec7e40b1b7fc98b6a08a8b33264ad0..2f750142f08d02e36c073c4002b890c563ccedc1 100644 (file)
@@ -34,6 +34,7 @@ char *SuperVision_Version = "3.0" ;
 char *NULLSTRING = "" ;
 
 char *FACTORYSERVER = "localhost/FactoryServer" ;
+char *FACTORYSERVERPY = "localhost/FactoryServerPy" ;
 
 GraphBase::Base::Base() {
   _prof_debug = NULL ;
@@ -66,14 +67,14 @@ char * GraphBase::Base::ObjectToString( CORBA::Object_ptr obj ) const {
   return _Orb->object_to_string( obj );
 }
 
-CORBA::Object_ptr GraphBase::Base::StringToObject( char * obj ) const {
+CORBA::Object_ptr GraphBase::Base::StringToObject( const char * obj ) const {
   return _Orb->string_to_object( obj );
 }
 
 ostream & GraphBase::Base::AnyValue( const CORBA::Any & anAny ) {
   switch (anAny.type()->kind()) {
     case CORBA::tk_string: {
-      char * t;
+      const char * t;
       anAny >>= t;
       *_fdebug << " " << t << " (tk_string)" << endl ;
       break;
@@ -97,7 +98,7 @@ ostream & GraphBase::Base::AnyValue( const CORBA::Any & anAny ) {
       break;
     }
     case CORBA::tk_long: {
-      long l;
+      CORBA::Long l;
       anAny >>= l;
       *_fdebug << " " << l << "(tk_long)" << endl ;
       break;
@@ -150,6 +151,7 @@ ostream & GraphBase::Base::AnyValue( const CORBA::Any & anAny ) {
   return *_fdebug ;
 }
 
+/*
 string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) {
   string aIdlType ;
   switch ( aDataStreamType ) {
@@ -210,6 +212,19 @@ SALOME_ModuleCatalog::DataStreamType StringToDataStreamType( const char * aIdlTy
   }
   return aDataStreamType ;
 }
+*/
+int StringToDataStreamType (const char * aIdlType)
+{
+  int aDataStreamType;
+  if      (!strcmp(aIdlType, "Unknown")) aDataStreamType = 0; //SALOME_ModuleCatalog::DATASTREAM_UNKNOWN
+  else if (!strcmp(aIdlType, "int"))     aDataStreamType = 1; //SALOME_ModuleCatalog::DATASTREAM_INTEGER
+  else if (!strcmp(aIdlType, "float"))   aDataStreamType = 2; //SALOME_ModuleCatalog::DATASTREAM_FLOAT
+  else if (!strcmp(aIdlType, "double"))  aDataStreamType = 3; //SALOME_ModuleCatalog::DATASTREAM_DOUBLE
+  else if (!strcmp(aIdlType, "string"))  aDataStreamType = 4; //SALOME_ModuleCatalog::DATASTREAM_STRING
+  else if (!strcmp(aIdlType, "bool"))    aDataStreamType = 5; //SALOME_ModuleCatalog::DATASTREAM_BOOLEAN
+  else                                   aDataStreamType = 0; //SALOME_ModuleCatalog::DATASTREAM_UNKNOWN
+  return aDataStreamType;
+}
 
 string KindOfDataStreamTraceToString( SUPERV::KindOfDataStreamTrace aDataStreamTrace ) {
   string aTrace ;
@@ -250,7 +265,24 @@ string DataStreamDependencyToString( const SALOME_ModuleCatalog::DataStreamDepen
   return aDependency;
 }
 
-string DataStreamToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) {
+string DataStreamToString (const char* aDataStreamType)
+{
+  string aStreamType ;
+  string type (aDataStreamType);
+
+  if      (type == "Unknown") aStreamType = "Unknown";
+  else if (type == "int")     aStreamType = "ENTIER";
+  else if (type == "float")   aStreamType = "REEL";
+  else if (type == "double")  aStreamType = "DOUBLE";
+  else if (type == "string")  aStreamType = "CHAINE";
+  else if (type == "bool")    aStreamType = "LOGIQUE";
+  else                        aStreamType = "?";
+
+  return aStreamType;
+}
+
+/*
+string DataStreamToString( const char* aDataStreamType ) {
   string aStreamType ;
   switch ( aDataStreamType ) {
   case SALOME_ModuleCatalog::DATASTREAM_UNKNOWN : {
@@ -312,4 +344,4 @@ ostream & operator<< (ostream & f ,const SALOME_ModuleCatalog::DataStreamType &
 
   return f;
 }
-
+*/
index 4dd042eef4ed65747d9b2ecb5b71fbd4a6388b7c..60cb36e660b913c567362d2f68eeb4de33bd6941 100644 (file)
@@ -55,6 +55,7 @@ extern char *SuperVision_Version ;
 extern char *NULLSTRING ;
 
 extern char *FACTORYSERVER ;
+extern char *FACTORYSERVERPY ;
 
 inline char * my_strdup( const char * s ) {
   if (s == NULL) return NULL;
@@ -82,14 +83,14 @@ inline char * my_strblkdup( const char * s ) {
   return t;
 }
 
-string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
-SALOME_ModuleCatalog::DataStreamType StringToDataStreamType( const char * aIdlType ) ;
+//string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
+int StringToDataStreamType( const char * aIdlType ) ;
 
 string KindOfDataStreamTraceToString( SUPERV::KindOfDataStreamTrace aDataStreamTrace ) ;
 
 string DataStreamDependencyToString( const SALOME_ModuleCatalog::DataStreamDependency aDataStreamDependency ) ;
 
-string DataStreamToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) ;
+string DataStreamToString( const char* aDataStreamType ) ;
 
 //enum StatusOfPort { NotConnected , PortConnected , PortAndDataConnected ,
 enum StatusOfPort { NotConnected , PortConnected ,
@@ -198,7 +199,7 @@ namespace GraphBase {
                      int * prof_debug , ofstream * fdebug ) ;
 
       char * ObjectToString( CORBA::Object_ptr obj ) const ;
-      CORBA::Object_ptr StringToObject(char * obj ) const ;
+      CORBA::Object_ptr StringToObject(const char * obj ) const ;
 
       ostream & AnyValue( const CORBA::Any & anAny );
 
@@ -221,6 +222,6 @@ namespace GraphBase {
 
 } ;
 
-ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamType &);
+//ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamType &);
 
 #endif
index 0439956c359220f51302d9196d71f39d5d9ace10..e77cb7538ea73b3c3e181e296d487913d848fd58 100644 (file)
@@ -31,6 +31,39 @@ using namespace std;
 #include "DataFlowBase_StreamGraph.hxx"
 //#include "DataFlowBase_LoopNode.hxx"
 
+// Screen single quotes
+static string protectQuotes (const string theText)
+{
+  string aRes (theText);
+  unsigned int pos;
+
+  // screen back slash
+  for (pos = 0; pos < aRes.size(); pos++) {
+    pos = aRes.find("\\", pos);
+    if (pos < 0 || pos > aRes.size()) break;
+
+    aRes.insert(pos, "\\");
+    pos++;
+
+    // screen symbol after back slash (except single quote, which will be processed below)
+    if (pos + 1 < aRes.size() && aRes[pos + 1] != '\'') {
+      aRes.insert(pos + 1, "\\");
+      pos += 2;
+    }
+  }
+
+  // screen single quote
+  for (pos = 0; pos < aRes.size(); pos++) {
+    pos = aRes.find("'", pos);
+    if (pos < 0 || pos > aRes.size()) break;
+
+    aRes.insert(pos, "\\");
+    pos++;
+  }
+
+  return aRes;
+}
+
 static void InitFields( //SUPERV::KindOfNode &_Kind ,
                         SUPERV::SDate      &_FirstCreation ,
                         SUPERV::SDate      &_LastModification ,
@@ -55,7 +88,7 @@ static void InitFields( //SUPERV::KindOfNode &_Kind ,
   _FirstCreation.Hour   = _LastModification.Hour   = Tm->tm_hour;
   _FirstCreation.Day    = _LastModification.Day    = Tm->tm_mday;
   _FirstCreation.Month  = _LastModification.Month  = Tm->tm_mon + 1;
-  _FirstCreation.Year   = _LastModification.Year   = Tm->tm_year + 1900; 
+  _FirstCreation.Year   = _LastModification.Year   = Tm->tm_year + 1900;
 
   _EditorRelease = new char[ strlen( SuperVision_Version ) + 1 ] ;
   strcpy( _EditorRelease , SuperVision_Version ) ;
@@ -151,7 +184,7 @@ GraphBase::ComputingNode::ComputingNode( CORBA::ORB_ptr ORB ,
 //    cout << "GraphBase::ComputingNode::ComputingNode NO SetDebug" << endl ;
 //  }
   DefPortsOfNode( ORB , SALOME_ModuleCatalog::Service() , NamePtr() , Kind() , Graph_prof_debug , Graph_fdebug ) ;
-  cdebug << "GraphBase::ComputingNode::ComputingNode "  << this 
+  cdebug << "GraphBase::ComputingNode::ComputingNode "  << this
          << " Name '" << Name() << "' "  << _FirstCreation
          << " "  << _LastModification << endl ;
 }
@@ -192,7 +225,7 @@ GraphBase::ComputingNode::ComputingNode( CORBA::ORB_ptr ORB ,
   _FirstCreation.Hour   = _LastModification.Hour   = Tm->tm_hour;
   _FirstCreation.Day    = _LastModification.Day    = Tm->tm_mday;
   _FirstCreation.Month  = _LastModification.Month  = Tm->tm_mon + 1;
-  _FirstCreation.Year   = _LastModification.Year   = Tm->tm_year + 1900; 
+  _FirstCreation.Year   = _LastModification.Year   = Tm->tm_year + 1900;
 
   if ( NodeEditorRelease != NULLSTRING ) {
     _EditorRelease = new char[ strlen( NodeEditorRelease ) + 1 ] ;
@@ -247,7 +280,7 @@ GraphBase::ComputingNode::ComputingNode( CORBA::ORB_ptr ORB ,
   
 
   DefPortsOfNode( ORB , aService , NamePtr() , Kind() , Graph_prof_debug , Graph_fdebug ) ;
-  cdebug << "GraphBase::ComputingNode::ComputingNode "  << this 
+  cdebug << "GraphBase::ComputingNode::ComputingNode "  << this
          << " Name '" << Name()
          << "' KindOfNode " << Kind()
          << " ServiceName '" << ServiceName() << "' In(" << ServiceInParameter().length()
@@ -257,7 +290,7 @@ GraphBase::ComputingNode::ComputingNode( CORBA::ORB_ptr ORB ,
 }
 
 GraphBase::ComputingNode::~ComputingNode() {
-  cdebug << "GraphBase::ComputingNode::~ComputingNode "  << this 
+  cdebug << "GraphBase::ComputingNode::~ComputingNode "  << this
          << " Name() "<< Name() << " _Comment "
          << (void *) _Comment << " "  << _Comment << " "  << endl ;
 }
@@ -276,7 +309,7 @@ GraphBase::ComputingNode::~ComputingNode() {
 
 SUPERV::SDate GraphBase::ComputingNode::FirstCreation () const {
 //  cdebug << "GraphBase::ComputingNode::FirstCreation "
-//         << " Name '" << Name() << "' "  << _FirstCreation << " "  
+//         << " Name '" << Name() << "' "  << _FirstCreation << " "
 //         << _LastModification << endl ;
   return _FirstCreation;
 }
@@ -295,7 +328,7 @@ void GraphBase::ComputingNode::LastModification(const SUPERV::SDate aDate ) {
 
 bool GraphBase::ComputingNode::EditorRelease(const char * c){
   if ( _EditorRelease && _EditorRelease != NULLSTRING )
-    delete _EditorRelease;
+    delete [] _EditorRelease;
   _EditorRelease = my_strdup(c);
   return true ;
 }
@@ -351,7 +384,7 @@ void GraphBase::ComputingNode::NodePort( const char * NodeName ,
 bool GraphBase::ComputingNode::IsLinked(const char * ToServiceParameterName, bool isInput ) {
   bool RetVal = false ;
   if ( isInput ) { // mkr : PAL8060
-    // we have to know the type of the port, because of input and output ports 
+    // we have to know the type of the port, because of input and output ports
     // belong to one node may have the same names
     const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
     if ( thePort ) {
@@ -421,8 +454,8 @@ void GraphBase::ComputingNode::SetMacroPorts( GraphBase::Graph * aGraph ) {
            << " " << anInPort->Kind() << endl ;
     GraphBase::InPort * aNewInPort ;
     if ( anInPort->IsDataStream() ) {
-      aNewInPort = AddInDataStreamPort( anInPort->PortName() , StringToDataStreamType( anInPort->PortType() ) ,
-                                        anInPort->Dependency() , anInPort->Kind() ) ;
+      aNewInPort = AddInDataStreamPort( anInPort->PortName(), anInPort->PortType(),
+                                        anInPort->Dependency(), anInPort->Kind() ) ;
     }
     else if ( anInPort->IsParam() || anInPort->IsInLine() ) {
       aNewInPort = AddInPort( anInPort->PortName() , anInPort->PortType() , anInPort->Kind() ) ;
@@ -433,8 +466,8 @@ void GraphBase::ComputingNode::SetMacroPorts( GraphBase::Graph * aGraph ) {
     cdebug << "SetMacroPorts Out" << i << " " << anOutPort->PortName() << " " << anOutPort->PortType()
            << " " << anOutPort->Kind() << endl ;
     if ( anOutPort->IsDataStream() ) {
-      AddOutDataStreamPort( anOutPort->PortName() , StringToDataStreamType( anOutPort->PortType() ) ,
-                            anOutPort->Dependency() , anOutPort->Kind() ) ;
+      AddOutDataStreamPort( anOutPort->PortName(), anOutPort->PortType(),
+                            anOutPort->Dependency(), anOutPort->Kind() ) ;
     }
     else if ( anOutPort->IsParam() || anOutPort->IsInLine() ) {
       AddOutPort( anOutPort->PortName() , anOutPort->PortType() , anOutPort->Kind() ) ;
@@ -848,8 +881,8 @@ void GraphBase::ComputingNode::DelOutDataStreamPort( const char * OutputParamete
   GraphBase::PortsOfNode::DelOutPort( OutputParameterName ) ;
 }
 
-GraphBase::InDataStreamPort * GraphBase::ComputingNode::AddInDataStreamPort( const char * InputParameterName ,
-                                                                             const SALOME_ModuleCatalog::DataStreamType InputParameterType ,
+GraphBase::InDataStreamPort * GraphBase::ComputingNode::AddInDataStreamPort( const char * InputParameterName,
+                                                                             const char * InputParameterType,
                                                                              const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
                                                                              const SUPERV::KindOfPort aKindOfPort ,
                                                                              int index ) {
@@ -858,7 +891,7 @@ GraphBase::InDataStreamPort * GraphBase::ComputingNode::AddInDataStreamPort( con
   aDataStreamPort = (GraphBase::InDataStreamPort * ) GraphBase::PortsOfNode::AddInPort( _ORB , NamePtr() ,
                                                                                         Kind() ,
                                                                                         InputParameterName ,
-                                                                                        DataStreamTypeToString( InputParameterType ).c_str() ,
+                                                                                        InputParameterType ,
                                                                                         aKindOfPort ,
                                                                                         index ,
                                                                                         _Graph_prof_debug ,
@@ -869,17 +902,17 @@ GraphBase::InDataStreamPort * GraphBase::ComputingNode::AddInDataStreamPort( con
   }
   return aDataStreamPort ;
 }
-GraphBase::OutDataStreamPort * GraphBase::ComputingNode::AddOutDataStreamPort( const char * OutputParameterName ,
-                                                                               const SALOME_ModuleCatalog::DataStreamType OutputParameterType ,
+GraphBase::OutDataStreamPort * GraphBase::ComputingNode::AddOutDataStreamPort( const char * OutputParameterName,
+                                                                               const char * OutputParameterType,
                                                                                const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
                                                                                const SUPERV::KindOfPort aKindOfPort ,
                                                                                int index ) {
 //  IncrDataStreamOutPorts() ;
   GraphBase::OutDataStreamPort * aDataStreamPort ;
-  aDataStreamPort = (GraphBase::OutDataStreamPort * ) GraphBase::PortsOfNode::AddOutPort( _ORB , NamePtr() ,
-                                                                                          Kind() ,
-                                                                                          OutputParameterName ,
-                                                                                          DataStreamTypeToString( OutputParameterType ).c_str() ,
+  aDataStreamPort = (GraphBase::OutDataStreamPort * ) GraphBase::PortsOfNode::AddOutPort( _ORB , NamePtr(),
+                                                                                          Kind(),
+                                                                                          OutputParameterName,
+                                                                                          OutputParameterType,
                                                                                           aKindOfPort ,
                                                                                           index ,
                                                                                           _Graph_prof_debug ,
@@ -940,7 +973,7 @@ bool GraphBase::ComputingNode::CheckEndLoop(GraphBase::LoopNode * aLoopNode ,
                << LinkedFromNodesSize() << " ERROR false" << endl;
     return false ;
   }
-// We have to check that all nodes linked from that node go to the beginning of LoopNode : 
+// We have to check that all nodes linked from that node go to the beginning of LoopNode :
   for ( i = 0 ; i < LinkedFromNodesSize() ; i++ ) {
     GraphBase::ComputingNode * aNode = (GraphBase::ComputingNode * ) LinkedFromNodes( i ) ;
     cdebug << i << ". " << Name() << " Linked from " << aNode->Name() << endl ;
@@ -1315,8 +1348,8 @@ bool GraphBase::ComputingNode::SaveXML( QDomDocument & Graph , QDomElement & inf
       DataStreamlist.appendChild(inParameter) ;
       QDomElement inParametertype = Graph.createElement("inParameter-type") ;
       QString aType ;
-      aType = aType.setNum( StringToDataStreamType( anInPort->PortType() ) ) ;
-      cdebug << "SaveXML " << anInPort->PortType() << " --> " << StringToDataStreamType( anInPort->PortType() )
+      aType = aType.setNum( StringToDataStreamType(anInPort->PortType()) ) ;
+      cdebug << "SaveXML " << anInPort->PortType() << " --> " << anInPort->PortType()
              << " " << aType << endl ;
       aField = Graph.createTextNode( aType ) ;
       inParameter.appendChild(inParametertype) ;
@@ -1375,8 +1408,8 @@ bool GraphBase::ComputingNode::SaveXML( QDomDocument & Graph , QDomElement & inf
       DataStreamlist.appendChild(outParameter) ;
       QDomElement outParametertype = Graph.createElement("outParameter-type") ;
       QString aType ;
-      aType = aType.setNum( StringToDataStreamType( anOutPort->PortType() ) ) ;
-      cdebug << "SaveXML " << anOutPort->PortType() << " --> " << StringToDataStreamType( anOutPort->PortType() )
+      aType = aType.setNum( StringToDataStreamType(anOutPort->PortType()) ) ;
+      cdebug << "SaveXML " << anOutPort->PortType() << " --> " << anOutPort->PortType()
              << " " << aType << endl ;
       aField = Graph.createTextNode( aType ) ;
       outParameter.appendChild(outParametertype) ;
@@ -1409,7 +1442,7 @@ bool GraphBase::ComputingNode::SaveXML( QDomDocument & Graph , QDomElement & inf
       cdebug << "SaveXML NumberOfValues " << ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() << endl ;
     }
   }
-//  f << Tabs << "</Parameter-list>" << endl ;    
+//  f << Tabs << "</Parameter-list>" << endl ;
 
 //  f << Tabs << "<PyFunction-list>" << endl ;
   QDomElement PyFunctionlist = Graph.createElement("PyFunction-list") ;
@@ -1574,15 +1607,15 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
     }
     f << "    " << Name() << "_ServiceinStreamParameter = []" << endl ;
     for ( i = 0 ; i < (int ) ServiceInStreamParameter().length() ; i++ ) {
-      f << "    " << Name() << "_ServiceinStreamParameter.append( SALOME_ModuleCatalog.ServicesDataStreamParameter( SALOME_ModuleCatalog."
-        << ServiceInStreamParameter()[i].Parametertype << " , '"
+      f << "    " << Name() << "_ServiceinStreamParameter.append( SALOME_ModuleCatalog.ServicesDataStreamParameter( '"
+        << ServiceInStreamParameter()[i].Parametertype << "' , '"
         << ServiceInStreamParameter()[i].Parametername << "' , SALOME_ModuleCatalog."
         << ServiceInStreamParameter()[i].Parameterdependency << " ) )" << endl ;
     }
     f << "    " << Name() << "_ServiceoutStreamParameter = []" << endl ;
     for ( i = 0 ; i < (int ) ServiceOutStreamParameter().length() ; i++ ) {
-      f << "    " << Name() << "_ServiceoutStreamParameter.append( SALOME_ModuleCatalog.ServicesDataStreamParameter( SALOME_ModuleCatalog."
-        << ServiceOutStreamParameter()[i].Parametertype << " , '"
+      f << "    " << Name() << "_ServiceoutStreamParameter.append( SALOME_ModuleCatalog.ServicesDataStreamParameter( '"
+        << ServiceOutStreamParameter()[i].Parametertype << "' , '"
         << ServiceOutStreamParameter()[i].Parametername << "' , SALOME_ModuleCatalog."
         << ServiceOutStreamParameter()[i].Parameterdependency << " ) )" << endl ;
     }
@@ -1612,7 +1645,7 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
     if ( PythonFunctions.size() ) {
       aPyFunc = *PythonFunctions[0] ;
       for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
-        f << "    " << "Py" << Name() << ".append( '" << aPyFunc[i] << "' )" << endl ;
+        f << "    " << "Py" << Name() << ".append( '" << protectQuotes(aPyFunc[i].in()) << "' )" << endl;
       }
     }
     if ( IsInLineNode() ) {
@@ -1652,12 +1685,15 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
         SUPERV::ListOfStrings aPyMore = *PythonFunctions[1] ;
         SUPERV::ListOfStrings aPyNext = *PythonFunctions[2] ;
         f << "    " << "PyMore" << Name() << " = []" << endl ;
+
         for ( i = 0 ; i < (int ) aPyMore.length() ; i++ ) {
-          f << "    " << "PyMore" << Name() << ".append( '" << aPyMore[i] << "' )" << endl ;
+          f << "    " << "PyMore" << Name() << ".append( '"
+            << protectQuotes(aPyMore[i].in()) << "' )" << endl;
         }
         f << "    " << "PyNext" << Name() << " = []" << endl ;
         for ( i = 0 ; i < (int ) aPyNext.length() ; i++ ) {
-          f << "    " << "PyNext" << Name() << ".append( '" << aPyNext[i] << "' )" << endl ;
+          f << "    " << "PyNext" << Name() << ".append( '"
+            << protectQuotes(aPyNext[i].in()) << "' )" << endl ;
         }
         f << "    " << Name() << "," << EndName << " = " << aGraphName << ".LNode( '"
           << FuncNames[0].c_str() << "' , Py" << Name() << " , '"
@@ -1672,8 +1708,8 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
         SUPERV::ListOfStrings aPyFunc = *aCoupledNode->PythonFunction() ;
         f << "    " << "Py" << aCoupledNode->Name() << " = []" << endl ;
         for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
-          f << "    " << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
-            << endl ;
+          f << "    " << "Py" << aCoupledNode->Name() << ".append( '"
+            << protectQuotes(aPyFunc[i].in()) << "' )" << endl;
         }
         f << "    " << EndName << ".SetPyFunction( '" << aCoupledNode->PyFuncName() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
         for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
@@ -1691,9 +1727,8 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
           }
           else if ( anInPort->IsDataStream() ) {
             f << "    " << "I" << Name() << anInPort->PortName() << " = " << Name()
-              << ".InStreamPort( '" << anInPort->PortName()
-              << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
-              << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
+              << ".InStreamPort( '" << anInPort->PortName() << "' , '" << anInPort->PortType()
+              << "' , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
             SUPERV::KindOfSchema        aKindOfSchema ;
             SUPERV::KindOfInterpolation aKindOfInterpolation ;
             SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
@@ -1717,8 +1752,8 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
           else if ( anOutPort->IsDataStream() ) {
             f << "    " << "O" << Name() << anOutPort->PortName() << " = " << Name()
               << ".OutStreamPort( '" << anOutPort->PortName()
-              << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
-              << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
+              << "' , '" << anOutPort->PortType()
+              << "' , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
             long aNumberOfValues ;
             aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
             f << "    " << "O" << Name() << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
@@ -1741,8 +1776,8 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
           else if ( anInPort->IsDataStream() ) {
             f << "    " << "I" << EndName << anInPort->PortName() << " = " << EndName
               << ".InStreamPort( '" << anInPort->PortName()
-              << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
-              << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
+              << "' , '" << anInPort->PortType()
+              << "' , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
             SUPERV::KindOfSchema        aKindOfSchema ;
             SUPERV::KindOfInterpolation aKindOfInterpolation ;
             SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
@@ -1762,8 +1797,8 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
           else if ( anOutPort->IsDataStream() ) {
             f << "    " << "O" << EndName << anOutPort->PortName() << " = " << EndName
               << ".OutStreamPort( '" << anOutPort->PortName()
-              << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
-              << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
+              << "' , '" << anOutPort->PortType()
+              << "' , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
             long aNumberOfValues ;
             aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
             f << "    " << "O" << EndName << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
@@ -1782,8 +1817,8 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
         SUPERV::ListOfStrings aPyFunc = *aCoupledNode->PythonFunction() ;
         f << "    " << "Py" << aCoupledNode->Name() << " = []" << endl ;
         for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
-          f << "    " << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
-            << endl ;
+          f << "    " << "Py" << aCoupledNode->Name() << ".append( '"
+            << protectQuotes(aPyFunc[i].in()) << "' )" << endl;
         }
         f << "    " << EndName << ".SetPyFunction( '" << aCoupledNode->PyFuncName() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
         for ( i = 0 ; i < aCoupledNode->GetNodeInPortsSize() ; i++ ) {
@@ -1803,8 +1838,8 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
           else if ( anInPort->IsDataStream() ) {
             f << "    " << "I" << EndName << anInPort->PortName() << " = " << EndName
               << ".InStreamPort( '" << anInPort->PortName()
-              << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anInPort->PortType() )
-              << " , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
+              << "' , '" << anInPort->PortType()
+              << "' , SALOME_ModuleCatalog." << anInPort->Dependency() << " )" << endl ;
             SUPERV::KindOfSchema        aKindOfSchema ;
             SUPERV::KindOfInterpolation aKindOfInterpolation ;
             SUPERV::KindOfExtrapolation aKindOfExtrapolation ;
@@ -1830,8 +1865,8 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
           else if ( anOutPort->IsDataStream() ) {
             f << "    " << "O" << EndName << anOutPort->PortName() << " = " << EndName
               << ".OutStreamPort( '" << anOutPort->PortName()
-              << "' , SALOME_ModuleCatalog." << StringToDataStreamType( anOutPort->PortType() )
-              << " , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
+              << "' , '" << anOutPort->PortType()
+              << "' , SALOME_ModuleCatalog." << anOutPort->Dependency() << " )" << endl ;
             long aNumberOfValues ;
             aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
             f << "    " << "O" << EndName << anOutPort->PortName() << ".SetNumberOfValues( " << aNumberOfValues << " )"
@@ -1932,8 +1967,8 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
         if ( anInPort->IsDataStream() ) {
           if ( IsOneOfInLineNodes() ) {
             f << "    " << "I" << Name() << anInPort->PortName() << " = "
-              << Name() << ".InStreamPort( '" << anInPort->PortName() << "' , SALOME_ModuleCatalog."
-              << StringToDataStreamType( anInPort->PortType() ) << " , SALOME_ModuleCatalog."
+              << Name() << ".InStreamPort( '" << anInPort->PortName() << "' , '"
+              << anInPort->PortType() << "' , SALOME_ModuleCatalog."
               << anInPort->Dependency() << " )" << endl ;
          }
           else {
@@ -1955,8 +1990,8 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName ,
         if ( anOutPort->IsDataStream() ) {
           if ( IsOneOfInLineNodes() ) {
             f << "    " << "O" << Name() << anOutPort->PortName() << " = "
-              << Name() << ".OutStreamPort( '" << anOutPort->PortName() << "' , SALOME_ModuleCatalog."
-              << StringToDataStreamType( anOutPort->PortType() ) << " , SALOME_ModuleCatalog."
+              << Name() << ".OutStreamPort( '" << anOutPort->PortName() << "' , '"
+              << anOutPort->PortType() << "' , SALOME_ModuleCatalog."
               << anOutPort->Dependency() << " )" << endl ;
          }
           else {
@@ -2041,4 +2076,3 @@ ostream & operator<< (ostream &fOut,const SUPERV::SDate &D) {
 //  cdebug_out << "operator<< GraphEditor::Date" << endl;
   return fOut;
 }
-
index bac84d5044137e39c0c27db22e364ac93fc8f92d..981989bd9eb5f4a44068ae89f6969d7e6b750e8c 100644 (file)
@@ -227,12 +227,12 @@ namespace GraphBase {
       void DelOutDataStreamPort( const char * OutputParameterName ) ;
 
       InDataStreamPort * AddInDataStreamPort( const char * InputParameterName ,
-                                              const SALOME_ModuleCatalog::DataStreamType InputParameterType ,
+                                              const char * InputParameterType ,
                                               const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
                                               const SUPERV::KindOfPort aKindOfPort ,
                                               int index = -1 ) ;
       OutDataStreamPort * AddOutDataStreamPort( const char * OutputParameterName ,
-                                                const SALOME_ModuleCatalog::DataStreamType OutputParameterType ,
+                                                const char * OutputParameterType ,
                                                 const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
                                                 const SUPERV::KindOfPort aKindOfPort ,
                                                 int index = -1 ) ;
index ae0f79fc732f940a6245a87c5eaa824229a8b5e2..7b0a17e17bf8e59305bfaca8c4c31681336a2a27 100644 (file)
@@ -71,31 +71,32 @@ void GraphBase::DataPort::InitialValues(CORBA::Any aValue ) {
   }
   else if ( !strcmp( Type , "boolean" ) ) {
     cdebug << "boolean" << endl ;
-    InitialValue <<= (long ) 0 ;
+    InitialValue <<= (CORBA::Long ) 0 ;
   }
   else if ( !strcmp( Type , "char" ) ) {
     cdebug << "char" << endl ;
-    InitialValue <<= (long ) 0 ;
+    InitialValue <<= (CORBA::Long ) 0 ;
   }
   else if ( !strcmp( Type , "short" ) ) {
     cdebug << "short" << endl ;
-    InitialValue <<= (long ) 0 ;
+    InitialValue <<= (CORBA::Long ) 0 ;
   }
   else if ( !strcmp( Type , "int" ) ) {
     cdebug << "long" << endl ;
-    InitialValue <<= (long ) 0 ;
+    InitialValue <<= (CORBA::Long ) 0 ;
   }
   else if ( !strcmp( Type , "long" ) ) {
     cdebug << "long" << endl ;
-    InitialValue <<= (long ) 0 ;
+    InitialValue <<= (CORBA::Long ) 0 ;
   }
   else if ( !strcmp( Type , "float" ) ) {
     cdebug << "float" << endl ;
 #ifdef REDHAT // mkr : debug for PAL12255
-    InitialValue <<= (double ) 0. ;
+    InitialValue <<= (float ) 0. ;
 #else     
-    double d = 0.;
-    InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR    double d = 0.;
+//JR    InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+    InitialValue <<= (CORBA::Float) 0. ;
 #endif
     
   }
@@ -104,8 +105,9 @@ void GraphBase::DataPort::InitialValues(CORBA::Any aValue ) {
 #ifdef REDHAT // mkr : debug for PAL12255
     InitialValue <<= (double ) 0. ;
 #else
-    double d = 0.;
-    InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR    double d = 0.;
+//JR    InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+    InitialValue <<= (CORBA::Double) 0. ;
 #endif
   }
   else { // Default
@@ -115,7 +117,7 @@ void GraphBase::DataPort::InitialValues(CORBA::Any aValue ) {
   }
 //  else {
 //    cdebug << "InitialValues ERROR (other) " << Type << endl ;
-//    InitialValue <<= (long ) 0 ;
+//    InitialValue <<= (CORBA::Long ) 0 ;
 //  }
   _InitialValue = new CORBA::Any( InitialValue ) ;
   _Value = &_InitialValue ;
@@ -149,7 +151,7 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
 #endif
   switch (aDataValue->type()->kind()) { // Input Value
   case CORBA::tk_string: { // Input string Value
-    char * t;
+    const char * t;
     *aDataValue >>= t;
 #if ValueTrace
     cdebug << t << " (string)" ;
@@ -165,12 +167,13 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
       CORBA::Any * theValue = new CORBA::Any() ;
       if ( !strcmp( Type , "boolean" ) || !strcmp( Type , "char" ) ||
            !strcmp( Type , "short" ) || !strcmp( Type , "int" ) || !strcmp( Type , "long" ) ) {
-        long l ;
-        sscanf( t , "%ld" , &l ) ;
+        long ll ;
+        sscanf( t , "%ld" , &ll ) ;
+        CORBA::Long l = ll ;
         *theValue <<= l ;
         *theValue >>= l;
 #if ValueTrace
-        cdebug << " --> Value( " << l << ") (long) kind " << theValue->type()->kind() ;
+        cdebug << " --> Value( " << l << ") (CORBA::Long) kind " << theValue->type()->kind() ;
 #endif
       }
       else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) {
@@ -179,7 +182,8 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
 #ifdef REDHAT // mkr : debug for PAL12255
        *theValue <<= d ;
 #else
-       theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR   theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+       *theValue <<= (CORBA::Double) d ;
 #endif
         *theValue >>= d ;
 #if ValueTrace
@@ -216,11 +220,11 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
     }
     break;
   }
-  case CORBA::tk_long: { // Input long Value
-    long l;
+  case CORBA::tk_long: { // Input CORBA::Long Value
+    CORBA::Long l;
     *aDataValue >>= l;
 #if ValueTrace
-    cdebug << "Value( " << l << ") (long)";
+    cdebug << "Value( " << l << ") (CORBA::Long)";
 #endif
     if ( !strcmp( Type , "boolean" ) || !strcmp( Type , "char" ) ||
          !strcmp( Type , "short" ) || !strcmp( Type , "int" ) || !strcmp( Type , "long" ) ) { // SuperVision Value
@@ -228,16 +232,17 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
       *_Value = aDataValue ;
       *_theValue >>= l;
 #if ValueTrace
-      cdebug << " == Value( " << l << ") (long)";
+      cdebug << " == Value( " << l << ") (CORBA::Long)";
 #endif
     }
     else {
       CORBA::Any * theValue = new CORBA::Any() ;
       if ( !strcmp( Type , "string" ) ) {
+       long ll = l;
         char t[40] ;
-        sprintf( t , "%ld" , l ) ;
+        sprintf( t , "%ld" , ll ) ;
         *theValue <<=  t ;
-        char *tt ;
+        const char *tt ;
         *theValue >>= tt ;
 #if ValueTrace
         cdebug << " --> Value( " << t << ") (string) kind " << theValue->type()->kind() ;
@@ -248,7 +253,8 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
 #ifdef REDHAT // mkr : debug for PAL12255
        *theValue <<= d ;
 #else
-       theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR   theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+       *theValue <<= (CORBA::Double) d ;
 #endif
         *theValue >>= d ;
 
@@ -305,7 +311,7 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
         char t[40] ;
         sprintf( t , "%lf" , d ) ;
         *theValue <<=  t ;
-        char *tt ;
+        const char *tt ;
         *theValue >>= tt ;
 #if ValueTrace
         cdebug << " --> Value( " << t << ") (string) kind " << theValue->type()->kind() ;
@@ -313,11 +319,11 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
       }
       else if ( !strcmp( Type , "boolean" ) || !strcmp( Type , "char" ) ||
                 !strcmp( Type , "short" ) || !strcmp( Type , "int" ) || !strcmp( Type , "long" ) ) {
-        long l = (long ) d ;
+        CORBA::Long l = (CORBA::Long ) d ;
         *theValue <<= l ;
         *theValue >>= l;
 #if ValueTrace
-        cdebug << " --> Value( " << l << ") (long) kind " << theValue->type()->kind() ;
+        cdebug << " --> Value( " << l << ") (CORBA::Long) kind " << theValue->type()->kind() ;
 #endif
       }
       else { // Default
@@ -384,11 +390,16 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
       }
       else if ( !strcmp( Type , "boolean" ) || !strcmp( Type , "char" ) ||
                 !strcmp( Type , "short" ) || !strcmp( Type , "int" ) || !strcmp( Type , "long" ) ) {
-        long l = (long ) obj ;
+#ifdef OMNI_LONG_IS_INT
+        long ll = (long ) obj ;
+        CORBA::Long l = (CORBA::Long ) ll ;
+#else
+        CORBA::Long l = (CORBA::Long ) obj ;
+#endif
         *theValue <<= l ;
         *theValue >>= l;
 #if ValueTrace
-        cdebug << " --> Value( " << l << ") (long) kind " << theValue->type()->kind() ;
+        cdebug << " --> Value( " << l << ") (CORBA::Long) kind " << theValue->type()->kind() ;
 #endif
       }
       else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) {
@@ -396,7 +407,8 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
 #ifdef REDHAT // mkr : debug for PAL12255
        *theValue <<= d ;
 #else
-       theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR   theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+       *theValue <<= (CORBA::Double) d ;
 #endif
         *theValue >>= d;
 #if ValueTrace
@@ -461,7 +473,7 @@ const CORBA::Any GraphBase::DataPort::Value() const {
 //JR 30.03.2005    switch ( theValue->type()->kind() ) {
     switch ( theValue.type()->kind() ) {
     case CORBA::tk_string: {
-      char * t;
+      const char * t;
 //JR 30.03.2005      *theValue >>= t;
       theValue >>= t;
 //      cdebug << "GraphBase::DataPort::Value() : " << t << " (string) " << endl ;
@@ -475,10 +487,10 @@ const CORBA::Any GraphBase::DataPort::Value() const {
       break;
     }
     case CORBA::tk_long: {
-      long l;
+      CORBA::Long l;
 //JR 30.03.2005      *theValue >>= l;
       theValue >>= l;
-//      cdebug << "GraphBase::DataPort::Value() : " << l << " (long) " << endl ;
+//      cdebug << "GraphBase::DataPort::Value() : " << l << " (CORBA::Long) " << endl ;
       break;
     }
     case CORBA::tk_objref: {
@@ -533,7 +545,7 @@ bool GraphBase::DataPort::BoolValue() const {
 //  cdebug << pthread_self() << " BoolValue() --> pthread_mutex_locked " << aMutexWait
 //         << endl ;
   if ( (*_Value)->type()->kind() == CORBA::tk_long ) {
-    long val ;
+    CORBA::Long val ;
     **_Value >>= val ;
     if ( val ) {
       RetVal = true ;
@@ -571,7 +583,7 @@ void GraphBase::DataPort::StringValue(ostream & f ) const {
     const CORBA::Any * theValue = *_Value ;
     switch (theValue->type()->kind()) {
     case CORBA::tk_string:
-      char * t;
+      const char * t;
       *theValue >>= t;
       f << t << " (string)" ;
       break;
@@ -581,9 +593,9 @@ void GraphBase::DataPort::StringValue(ostream & f ) const {
       f << d << " (double)" ;
       break;
     case CORBA::tk_long:
-      long l;
+      CORBA::Long l;
       *theValue >>= l;
-      f << l << " (long)" ;
+      f << l << " (CORBA::Long)" ;
       break;
     case CORBA::tk_objref:
       CORBA::Object_ptr ObjRef ;
index f364ab3167ba4071eff69d2caf3948d5bb0043cf..e5d072362bdf6226a420d73676706e049f8d0b2c 100644 (file)
@@ -241,9 +241,9 @@ GraphBase::ListOfSNodes * GraphBase::Graph::GetNodes() const {
           const GraphBase::InPort * anInPort ;
           anInPort = aCNode->GetNodeInPort( iostream ) ;
           if ( anInPort->IsDataStream() ) {
-            cdebug << "GraphBase::Graph::GetNodes In" << iostream << " " << aCNode->Name() << " " << anInPort->NodeName() << " " << anInPort->PortName()
-                   << endl ;
-            (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parametertype = StringToDataStreamType( anInPort->PortType() ) ;
+            cdebug << "GraphBase::Graph::GetNodes In" << iostream << " " << aCNode->Name()
+                   << " " << anInPort->NodeName() << " " << anInPort->PortName() << endl;
+            (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parametertype = CORBA::string_dup( anInPort->PortType() ) ;
             (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parametername = CORBA::string_dup( anInPort->PortName() ) ;
             (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parameterdependency = anInPort->Dependency() ;
             SUPERV::KindOfSchema        aKindOfSchema ;
@@ -278,7 +278,7 @@ GraphBase::ListOfSNodes * GraphBase::Graph::GetNodes() const {
           if ( anOutPort->IsDataStream() ) {
             cdebug << "GraphBase::Graph::GetNodes Out" << iostream << " " << aCNode->Name() << " " << anOutPort->NodeName() << " " << anOutPort->PortName() << " "
                    << endl ;
-            (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parametertype = StringToDataStreamType( anOutPort->PortType() ) ;
+            (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parametertype = CORBA::string_dup( anOutPort->PortType() ) ;
             (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parametername = CORBA::string_dup( anOutPort->PortName() ) ;
             (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parameterdependency = anOutPort->Dependency() ;
             long aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
@@ -1103,10 +1103,10 @@ bool GraphBase::Graph::AddLink( const char* FromNodeName ,
       CORBA::Any aValue ;
 //JR 29.09.2005 Debug for CEA : we do not do that for MacroNodes :
       if ( !fromNode->IsMacroNode() ) {
-        aValue <<= (long ) 1 ;
+        aValue <<= (CORBA::Long ) 1 ;
       }
       else {
-        aValue <<= (long ) 0 ;
+        aValue <<= (CORBA::Long ) 0 ;
       }
       fromPort->SetValue( aValue ) ;
     }
@@ -1188,6 +1188,9 @@ bool GraphBase::Graph::AddLink( GraphBase::ComputingNode *fromNode ,
       cdebug_out << "RemoveLink(AddLink) toPort->GetOutPort()->NodeName() RemoveLink Error." << endl ;
       return false ;
     }
+    if ( fromNode->IsGOTONode() && fromPort->IsGate() ) { // mkr : PAL12575
+      ((GraphBase::GOTONode * ) fromNode)->CoupledNode( (GraphBase::InLineNode * ) toNode ) ;
+    }
   }
 
   if ( !fromNode->IsDataFlowNode() && !fromNode->IsDataStreamNode() &&
@@ -1487,6 +1490,22 @@ bool GraphBase::Graph::RemoveLink( const char* FromNodeName ,
          }
           else {
             fromNode->RemoveLinkedNode( toNode ) ;
+           // mkr : PAL12575 -->
+           if ( fromNode->IsGOTONode() ) {
+             GraphBase::GOTONode * aGOTONode = (GraphBase::GOTONode * ) fromNode ;
+             if ( aGOTONode->CoupledNode() && strcmp( aGOTONode->CoupledNode()->Name(), toNode->Name() ) == 0 ) {
+               aGOTONode->CoupledNode(NULL);
+               aGOTONode->CoupledNodeName("");
+               
+               // set ExternConnected status for output data port of GoTo node
+               for ( int aPortId = 0 ; aPortId < fromNode->GetNodeOutPortsSize() ; aPortId++ ) {
+                 GraphBase::OutPort * anOutPort = fromNode->GetChangeNodeOutPort(aPortId) ;
+                 if ( anOutPort->IsNotConnected() && !anOutPort->IsGate() )
+                   anOutPort->PortStatus( ExternConnected ) ;
+               }
+             }
+           }
+           // mkr : PAL12575 <--
          }
         }
 //JR PAL7990 : a SwitchPort is an OutPort of a SwitchNode connected to a InGate Port
@@ -1579,7 +1598,7 @@ bool GraphBase::Graph::AddInputData( const char* ToNodeName ,
   bool isUnknown = false;
   switch (aValue.type()->kind()) {
     case CORBA::tk_string:
-      char * t;
+      const char * t;
       aValue >>= t;
       cdebug << t << " (string) " ;
       if ( !strcmp( t, "Unknown CORBA::Any Type" ) ) 
@@ -1592,9 +1611,9 @@ bool GraphBase::Graph::AddInputData( const char* ToNodeName ,
       cdebug << d << " (double) " ;
       break;
     case CORBA::tk_long:
-      long l;
+      CORBA::Long l;
       aValue >>= l;
-      cdebug << l << " (long) " ;
+      cdebug << l << " (CORBA::Long) " ;
       break;
     case CORBA::tk_objref:
       cdebug << "(object reference) " ;
@@ -1653,8 +1672,8 @@ bool GraphBase::Graph::AddInputData( const char* ToNodeName ,
   else {
     cdebug << "ERROR Node and/or Port not found : " << aNodeName << " " << aPortName << endl ;
   }
-  delete aNodeName ;
-  delete aPortName ;
+  delete [] aNodeName ;
+  delete [] aPortName ;
 
   cdebug_out << "GraphBase::Graph::AddInputData " << RetVal << endl;
   return RetVal ;
@@ -1669,7 +1688,7 @@ bool GraphBase::Graph::ChangeInputData( const char * ToNodeName ,
             << ToServiceParameterName << "' , Any " ;
   switch (aValue.type()->kind()) {
     case CORBA::tk_string:
-      char * t;
+      const char * t;
       aValue >>= t;
       cdebug << t << " (string) " ;
       break;
@@ -1679,9 +1698,9 @@ bool GraphBase::Graph::ChangeInputData( const char * ToNodeName ,
       cdebug << d << " (double) " ;
       break;
     case CORBA::tk_long:
-      long l;
+      CORBA::Long l;
       aValue >>= l;
-      cdebug << l << " (long) " ;
+      cdebug << l << " (CORBA::Long) " ;
       break;
     case CORBA::tk_objref:
       cdebug << "(object reference) " ;
@@ -1741,14 +1760,14 @@ bool GraphBase::Graph::AddInputData( const char* ToNodeName ,
       cdebug << t << " (string) " ;
       break;
     case CORBA::tk_double:
-      double d;
+      CORBA::Double d;
       theValue >>= d;
       cdebug << d << " (double) " ;
       break;
     case CORBA::tk_long:
-      long l;
+      CORBA::Long l;
       theValue >>= l;
-      cdebug << l << " (long) " ;
+      cdebug << l << " (CORBA::Long) " ;
       break;
     case CORBA::tk_objref:
       cdebug << "(object reference) " ;
@@ -2099,8 +2118,8 @@ bool GraphBase::Graph::CreateService() {
 //  DataService( _Orb , aService , InPortsKind , OutPortsKind , Graph_prof_debug() , Graph_fdebug() ) ;
   for ( i = 0 ; i < innbr ; i++ ) {
     if ( InPortsKind[ i ] == SUPERV::DataStreamParameter ) {
-      GraphBase::InDataStreamPort * anInPort = AddInDataStreamPort( aService.ServiceinParameter[ i ].Parametername ,
-                                                                    StringToDataStreamType( aService.ServiceinParameter[ i ].Parametertype ) ,
+      GraphBase::InDataStreamPort * anInPort = AddInDataStreamPort( aService.ServiceinParameter[ i ].Parametername,
+                                                                    aService.ServiceinParameter[ i ].Parametertype,
                                                                     InDataStreamDependency[ i ] ,
                                                                     SUPERV::DataStreamParameter ) ;
       anInPort->SetParams( InKindOfSchema[ i ] ,
@@ -2141,7 +2160,7 @@ bool GraphBase::Graph::CreateService() {
   for ( i = 0 ; i < outnbr ; i++ ) {
     if ( OutPortsKind[ i ] == SUPERV::DataStreamParameter ) {
       GraphBase::OutDataStreamPort * anOutPort = AddOutDataStreamPort( aService.ServiceoutParameter[ i ].Parametername ,
-                                                                       StringToDataStreamType( aService.ServiceoutParameter[ i ].Parametertype ) ,
+                                                                       aService.ServiceoutParameter[ i ].Parametertype ,
                                                                        OutDataStreamDependency[ i ] ,
                                                                        SUPERV::DataStreamParameter ) ;
       anOutPort->NumberOfValues( OutNumberOfValues[ i ] ) ;
@@ -2291,7 +2310,7 @@ bool GraphBase::Graph::InLineServices() {
        }
         else if ( aINode->GetChangeNodeInPort(j)->IsDataStream() ) {
           aService.ServiceinDataStreamParameter.length( InStreamService+1 ) ;
-          aService.ServiceinDataStreamParameter[InStreamService].Parametertype = StringToDataStreamType( aINode->GetChangeNodeInPort(j)->PortType() ) ;
+          aService.ServiceinDataStreamParameter[InStreamService].Parametertype = CORBA::string_dup( aINode->GetChangeNodeInPort(j)->PortType() ) ;
           aService.ServiceinDataStreamParameter[InStreamService].Parametername = CORBA::string_dup( aINode->GetChangeNodeInPort(j)->PortName() ) ;
           aService.ServiceinDataStreamParameter[InStreamService++].Parameterdependency = aINode->GetChangeNodeInPort(j)->Dependency() ;
           aINode->IncrDataStreamInPorts() ;
@@ -2334,7 +2353,7 @@ bool GraphBase::Graph::InLineServices() {
        }
         else if ( aINode->GetChangeNodeOutPort(j)->IsDataStream() ) {
           aService.ServiceoutDataStreamParameter.length( OutStreamService+1 ) ;
-          aService.ServiceoutDataStreamParameter[OutStreamService].Parametertype = StringToDataStreamType( aINode->GetChangeNodeOutPort(j)->PortType() ) ;
+          aService.ServiceoutDataStreamParameter[OutStreamService].Parametertype = CORBA::string_dup( aINode->GetChangeNodeOutPort(j)->PortType() ) ;
           aService.ServiceoutDataStreamParameter[OutStreamService].Parametername = CORBA::string_dup( aINode->GetChangeNodeOutPort(j)->PortName() ) ;
           aService.ServiceoutDataStreamParameter[OutStreamService++].Parameterdependency = aINode->GetChangeNodeOutPort(j)->Dependency() ;
           aINode->IncrDataStreamOutPorts() ;
@@ -2773,6 +2792,59 @@ bool GraphBase::Graph::Sort( int & SubStreamGraphsNumber ) {
   return true ;
 }
 
+// mkr : PAL12575
+bool GraphBase::Graph::ValidGOTO() {
+  cdebug_in << "GraphBase::Graph::ValidGOTO" << endl;
+  bool RetVal = true ;
+  int i, j ;
+  GraphBase::ComputingNode * aNode ;
+  for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
+    aNode = GraphNodes( i ) ;
+    if ( aNode->IsGOTONode() ) {
+      GraphBase::GOTONode * aGoToNode = (GraphBase::GOTONode * ) aNode ;
+      GraphBase::InLineNode * aCoupledNode ;
+      aCoupledNode = (GraphBase::InLineNode * ) aGoToNode->CoupledNode() ;
+      if ( aCoupledNode ) {
+       ostringstream ErrorMessage ;
+       // 1. Check the number of ports (the number of OutPorts of a GOTONode and of InPorts of its linked
+       //    InLine node must be the same)
+       if ( aNode->GetNodeOutPortsSize() != aCoupledNode->GetNodeInPortsSize() ) {
+         cdebug << "GraphBase::Graph::ValidGOTO : Different ports number!" << endl ;
+         ReSetMessages() ;
+         ErrorMessage << "Different ports number : the number of OutPorts of a " << aNode->Name()
+                      << " node (GoTo node) and of InPorts of its linked " << aCoupledNode->Name()
+                      << " node (InLine node) must be the same!\n" ;
+         SetMessages( ErrorMessage.str() ) ;
+         RetVal = false ;
+       }
+       // 2. Check ports names (the names of OutPorts of a GOTONode and of InPorts of its linked
+       //    InLine node must be the same)
+       else {
+         for ( j = 0 ; j < aNode->GetNodeOutPortsSize() ; j++ ) {
+           GraphBase::OutPort * aBusParamOutPort = aNode->GetChangeNodeOutPort( j ) ;
+           if ( !aBusParamOutPort->IsGate() ) {
+             GraphBase::InPort * aBusParamChangeInPort = NULL ;
+             aBusParamChangeInPort = aCoupledNode->GetChangeInPort( aBusParamOutPort->PortName() ) ;
+             if ( !aBusParamChangeInPort ) {
+               cdebug << "GraphBase::Graph::ValidGOTO : Different names of ports!" << endl ;
+               ReSetMessages() ;
+               ErrorMessage << "Different names of ports : there is no input port of " << aCoupledNode->Name()
+                            << " node (InLine node) coupled to " << aBusParamOutPort->PortName() 
+                            << " output port of a " << aNode->Name()
+                            << " node (GoTo node)\n" ;
+               SetMessages( ErrorMessage.str() ) ;
+               RetVal = false ;
+             }
+           }
+         }
+       }
+      }
+    }
+  }
+  cdebug_out << "GraphBase::Graph::ValidGOTO RetVal " << RetVal << endl;
+  return RetVal ;
+}
+
 bool GraphBase::Graph::ValidLoops() const {
   cdebug_in << "GraphBase::Graph::ValidLoops" << endl;
   bool RetVal = true ;
@@ -3020,7 +3092,7 @@ bool GraphBase::Graph::DataServerNodes() const {
         const GraphBase::OutPort * anOutPort = aNode->GetNodeOutPort(j) ;
 //JR Debug 06.06.2005 : if it is not a Gate !
 //        if ( anOutPort->IsNotConnected() ) {
-        if ( anOutPort->IsNotConnected() && !anOutPort->IsGate() ) {
+        if ( anOutPort->IsNotConnected() && !anOutPort->IsGate() && !aNode->IsGOTONode() ) { // mkr : PAL12575
           cdebug << "Graph::DataServerNodes Add[Stream]LinkedNode for OutPort "
                  << aNode->Name() << "( " << anOutPort->PortName() << " , "
                  << anOutPort->PortStatus() << " )" << endl ;
@@ -3183,8 +3255,8 @@ const CORBA::Any GraphBase::Graph::PortInData( const char* ToNodeName ,
     cdebug << "GraphBase::Graph::PortInData " << ToNodeName << " "
            << ToServiceParameterName << " ERROR no Node" << endl ;
   }
-  delete theNode ;
-  delete aPort ;
+  delete [] theNode ;
+  delete [] aPort ;
 #if TracePortInOutData
   cdebug_out << "GraphBase::Graph::PortInData " << endl ;
 #endif
@@ -3235,8 +3307,8 @@ const CORBA::Any GraphBase::Graph::PortOutData( const char* FromNodeName ,
     cdebug << "GraphBase::Graph::PortOutData " << FromNodeName << " "
            << FromServiceParameterName << " ERROR no Node" << endl ;
   }
-  delete theNode ;
-  delete aPort ;
+  delete [] theNode ;
+  delete [] aPort ;
 #if TracePortInOutData
   cdebug_out << "GraphBase::Graph::PortOutData " << endl ;
 #endif
index 0dab620b9021ee3945b5b62f4c298c59424ad123..a5a026cf92fbbcca6a7638cf755519a028f2952f 100644 (file)
@@ -90,12 +90,14 @@ namespace GraphBase {
 //      int                              _SubStreamGraphsSize ;
 //      vector<vector<ComputingNode *> > _SubStreamGraphs ;
 
-      string _Messages ;
+    string _Messages ;
 
-      bool AddLink( GraphBase::ComputingNode *fromNode ,
-                    GraphBase::OutPort *fromPort ,
-                    GraphBase::ComputingNode *toNode ,
-                    GraphBase::InPort *toPort ) ;
+    map< string, string > _MapOfComponentNameContainer ; // mkr : PAL13947
+    
+    bool AddLink( GraphBase::ComputingNode *fromNode ,
+                 GraphBase::OutPort *fromPort ,
+                 GraphBase::ComputingNode *toNode ,
+                 GraphBase::InPort *toPort ) ;
 
     public:
 
@@ -340,6 +342,7 @@ namespace GraphBase {
       bool InLineServices() ;
 
       bool Sort( int & SubStreamGraphsNumber ) ;
+      bool ValidGOTO() ; // mkr : PAL12575
       bool ValidLoops() const ;
       bool ValidSwitchs() const ;
       bool ComputingNodes() const ;
@@ -372,6 +375,28 @@ namespace GraphBase {
                            Engines::Container_var & myContainer ,
                            Engines::Component_var & objComponent ) ;
 
+    // mkr : PAL13947
+    void InsertToMapOfComponentNameContainer( const char * theComponentName, 
+                                             const char * theContainer) {
+      _MapOfComponentNameContainer[ theComponentName ] = theContainer ;
+    }
+
+    // mkr : PAL13947    
+    const char * RetrieveFromMapOfComponentNameContainer( const char * theComponentName ) {
+      if ( _MapOfComponentNameContainer.empty() 
+          ||
+          _MapOfComponentNameContainer.find(theComponentName) == _MapOfComponentNameContainer.end() )
+       return NULL ;
+      
+      return _MapOfComponentNameContainer[ theComponentName ].c_str() ;
+    }
+
+    // mkr : PAL13947
+    void ClearMapOfComponentNameContainer() {
+      if ( !_MapOfComponentNameContainer.empty() )
+       _MapOfComponentNameContainer.clear();
+    }
+
   };
   
 };
index 2f52c5adcceb37c89e3e0a19c40c4a0537340f6f..776bc747567201c6155de3c1e1fa0caa99c73dbc 100644 (file)
@@ -127,8 +127,9 @@ bool GraphBase::OutPort::RemoveInPort( GraphBase::InPort * toPort ) {
   int i ;
   int index = _MapOfInPorts[ toPort->NodePortName() ] ;
   if ( index <= 0 || index > _InPortsSize ) {
-    cdebug << "GraphBase::OutPort::RemoveInPort Error " << NodeName() << "( " << PortName()<< " ) --> "
-           << toPort->NodeName() << "( " << toPort->PortName() << " )" << endl ;
+//JR NPAL14110 09.02.2007 : Not an error with MacroNodes ...
+    //JRcdebug << "GraphBase::OutPort::RemoveInPort Error " << NodeName() << "( " << PortName()<< " ) --> "
+    //JR       << toPort->NodeName() << "( " << toPort->PortName() << " )" << endl ;
     return false ;
   }
   cdebug << "OutPort::RemoveInPort " << NodeName() << "(" << PortName() << ") --> "
index 3fa97562c1b424adcddf2b18459c5d2581ba908e..97a9b4256a8679370ee75cdbcf86fb2fa0a677c8 100644 (file)
@@ -29,7 +29,7 @@
 using namespace std;
 #include "DataFlowBase_PortsOfNode.hxx"
 
-#define PortsOfNodeTrace 1
+#define PortsOfNodeTrace 0
 
 GraphBase::PortsOfNode::PortsOfNode() :
   GraphBase::Service::Service( SALOME_ModuleCatalog::Service() ) {
index 13d8095d1504af60cbeb6bca9dd2a259bb124b75..3eccd79bb9f6bb4d69556db77903720f2131024c 100644 (file)
@@ -718,7 +718,7 @@ bool GraphBase::XmlHandler::endElement( const QString&,
             case CORBA::tk_string: {
 //Mandrake 10.1/Salome 3              aLink.aLinkValue <<= (char *) NULL ;
               aLink.aLinkValue <<= (char *) "" ;
-              char * t;
+              const char * t;
               aLink.aLinkValue >>= t;
 #if TRACE
               MESSAGE( t << " (string)" );
@@ -730,7 +730,8 @@ bool GraphBase::XmlHandler::endElement( const QString&,
 #ifdef REDHAT // mkr : debug for PAL12255
              aLink.aLinkValue <<= (double ) 0. ;
 #else
-             aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR         aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+             aLink.aLinkValue <<= (CORBA::Double) 0. ;
 #endif
               aLink.aLinkValue >>= d;
 #if TRACE
@@ -739,11 +740,11 @@ bool GraphBase::XmlHandler::endElement( const QString&,
               break;
            }
             case CORBA::tk_long: {
-              aLink.aLinkValue <<= (long ) 0 ;
-              long l;
+              aLink.aLinkValue <<= (CORBA::Long ) 0 ;
+              CORBA::Long l;
               aLink.aLinkValue >>= l;
 #if TRACE
-              MESSAGE( l << " (long)" );
+              MESSAGE( l << " (CORBA::Long)" );
 #endif
               break;
            }
@@ -777,7 +778,7 @@ bool GraphBase::XmlHandler::endElement( const QString&,
               switch ( aLink.aLinkValue.type()->kind() ) {
               case CORBA::tk_string: {
                 aLink.aLinkValue <<= fieldvalue[depth].c_str() ;
-                char * t;
+                const char * t;
                 aLink.aLinkValue >>= t;
 #if TRACE
                 MESSAGE( t << " (string)" );
@@ -791,8 +792,10 @@ bool GraphBase::XmlHandler::endElement( const QString&,
                aLink.aLinkValue <<= d;
                aLinkValue <<= d;
 #else
-               aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
-               aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR           aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR           aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+               aLink.aLinkValue <<= (CORBA::Double) d;
+               aLinkValue <<= (CORBA::Double) d;
 #endif         
                aLinkDoubleValue = new CORBA::Any( aLinkValue );
 #if TRACE
@@ -801,11 +804,12 @@ bool GraphBase::XmlHandler::endElement( const QString&,
                 break;
              }
               case CORBA::tk_long: {
-                long l;
-                sscanf( fieldvalue[depth].c_str() , "%ld" , &l ) ;
+                long ll;
+                sscanf( fieldvalue[depth].c_str() , "%ld" , &ll ) ;
+                CORBA::Long l = ll ;
                 aLink.aLinkValue <<= l;
 #if TRACE
-                MESSAGE( l << " (long)" );
+                MESSAGE( l << " (CORBA::Long)" );
 #endif
                 break;
              }
@@ -1135,7 +1139,7 @@ bool GraphBase::XmlHandler::endElement( const QString&,
               aPythonFunction[ ll ] = fieldvalue[depth].c_str() ;
            }
             else {
-              aPythonFunction[ ll ] = NULLSTRING ;
+              aPythonFunction[ ll ] = CORBA::String_var("") ;
            }
             if ( ll ) {
               aNode.theListOfPythonFunctions.resize( l ) ;
index 7e28c7f79fd342838aad7d908d1572ccf8bcf42b..ad9a63d845fbb978345df62a6f5a15a04388b767 100644 (file)
@@ -97,16 +97,20 @@ LIB_CLIENT_IDL = Logger.idl \
 # Executables targets
 BIN = SuperVisionBase_CheckOfUndefined
 BIN_SRC = 
-BIN_SERVER_IDL = 
+BIN_CLIENT_IDL = SALOME_Component.idl
 
-CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) \
-       $(KERNEL_CXXFLAGS)
+CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(KERNEL_CXXFLAGS)
 CXXFLAGS+= -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \
        $(KERNEL_CXXFLAGS)
+
+ifeq ($(OS),REDHAT)
+       CXXFLAGS+= -DREDHAT
+endif
+
 LDFLAGS+= $(SUPERV_LDFLAGS) $(CORBA_LIBS) -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace \
-       -lc $(PYTHON_LIBS) $(QT_MT_LIBS) $(OGL_LIBS) \
-       $(KERNEL_LDFLAGS)
-LDFLAGSFORBIN=$(LDFLAGS) -lSalomeContainer -lSalomeResourcesManager -lRegistry -lSalomeNotification -lSALOMEBasics
+       -lc $(PYTHON_LIBS) $(QT_MT_LIBS) $(KERNEL_LDFLAGS)
+LDFLAGSFORBIN= $(LDFLAGS) -lSalomeContainer -lSalomeResourcesManager -lRegistry -lSalomeNotification -lSALOMEBasics -lSalomeSuperVisionBase -lSalomeIDLKernel
+
 //LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS)
 
 @CONCLUDE@
index bf88ec67778a5dee850d1a374e76ecc30000dcba..3da252387b280832c234b9f0918763c4f0fcf0ae 100644 (file)
@@ -37,6 +37,10 @@ using namespace std;
 
 #include "DataFlowBase_Base.hxx"
 
+#include CORBA_CLIENT_HEADER(SALOME_Component)
+
+
+
 int _ArgC ;
 char ** _ArgV ;
 
index c267e77149ba73ee6441f539bd0514b581e2b1d1..f539783620189e0b76caa4409f76e31ead00549a 100644 (file)
@@ -233,7 +233,7 @@ namespace GraphEditor {
       long SubStreamGraphsNumber() ;
 
       void Executor(GraphExecutor::DataFlow * DataFlowExecutor ) ;
-      GraphExecutor::DataFlow * GraphEditor::DataFlow::Executor() const ;
+      GraphExecutor::DataFlow * Executor() const ;
 
   };
 
index 00e93299fd660fb8a86ec95008a018efa4619675..8e60fccc48552d39238eca0a69fa888cbba18770 100644 (file)
@@ -349,6 +349,10 @@ bool GraphEditor::OutNode::LoadNodes(map< string , int > & aMapOfNodes ,
                         aNode.theAuthor.c_str() , aNode.theContainer.c_str() ,
                         aNode.theComment.c_str() ,
                         aNode.theCoords.theX , aNode.theCoords.theY ) ;
+
+    // insert container into < ComponentName, Container > map for corresponding component
+    Graph()->InsertToMapOfComponentNameContainer( aNode.theComponentName.c_str(), aNode.theContainer.c_str() ) ; // mkr : PAL13947
+
     string * aNodetheName = new string( aNode.theName ) ;
     aMapOfNodes[ *aNodetheName ] = Graph()->GetGraphNodeIndex( anInNode->Name() ) ;
     if ( anInNode->IsOneOfInLineNodes() || anInNode->IsMacroNode() ) {
@@ -1015,6 +1019,11 @@ bool GraphEditor::OutNode::Valid() {
   Graph()->ComputingNodes() ;
 #endif
 
+  if ( !Graph()->ValidGOTO() ) { // mkr : PAL12575
+    cdebug << "Editor::OutNode::Valid This DataFlow have not valid GOTO(ValidGOTO)." << endl ;
+    RetVal = false ;
+  }
+
   if ( RetVal ) {
     _Valid = true ;
   }
@@ -1059,7 +1068,7 @@ bool GraphEditor::OutNode::Executable() {
     StreamGraph()->SubStreamGraphsNumber( SubStreamGraphsNumber ) ;
 
   Graph()->InLineServices() ;
-
+  
 //  if ( kLoopSwitch ) {
     if ( !Graph()->ValidLoops() ) {
       cdebug << "Editor::OutNode::Executable This DataFlow have not valid Loops(ValidLoops)." << endl ;
@@ -1191,7 +1200,7 @@ bool GraphEditor::OutNode::LinkSaveXML( QDomDocument & Graph , QDomElement & lin
     valuetype.appendChild( aField ) ;
     switch (aLink.aLinkValue.type()->kind()) {
       case CORBA::tk_string: {
-        char* retstr ;
+        const char* retstr ;
         aLink.aLinkValue >>= retstr;
 //        f << Tabs << "       <value>" << retstr << "</value>" << endl ;
         QDomElement value = Graph.createElement( "value" ) ;
@@ -1217,7 +1226,7 @@ bool GraphEditor::OutNode::LinkSaveXML( QDomDocument & Graph , QDomElement & lin
         break ;
       }
       case CORBA::tk_double: {
-        double d;
+        CORBA::Double d;
         aLink.aLinkValue >>= d;
 //        f << Tabs << "       <value>" << d << "</value>" << endl ;
         QDomElement value = Graph.createElement( "value" ) ;
@@ -1230,7 +1239,7 @@ bool GraphEditor::OutNode::LinkSaveXML( QDomDocument & Graph , QDomElement & lin
         break ;
       }
       case CORBA::tk_long: {
-        long l;
+        CORBA::Long l;
         aLink.aLinkValue >>= l;
 //        f << Tabs << "       <value>" << l << "</value>" << endl ;
         QDomElement value = Graph.createElement( "value" ) ;
@@ -1239,13 +1248,17 @@ bool GraphEditor::OutNode::LinkSaveXML( QDomDocument & Graph , QDomElement & lin
         aField = Graph.createTextNode( aKind ) ;
         datavalue.appendChild( value ) ;
         value.appendChild( aField ) ;
-//        MESSAGE( "ToString( long ) " << l );
+//        MESSAGE( "ToString( CORBA::Long ) " << l );
         break ;
       }
       case CORBA::tk_objref: {
         char* retstr ;
         CORBA::Object_ptr obj ;
-        aLink.aLinkValue >>= obj ;
+#if OMNIORB_VERSION >= 4
+        aLink.aLinkValue >>= (CORBA::Any::to_object)obj;
+#else
+       aLink.aLinkValue >>= obj;
+#endif 
         retstr = _Orb->object_to_string(obj );
 //        f << Tabs << "       <value>" << retstr << "</value>" << endl ;
         QDomElement value = Graph.createElement( "value" ) ;
@@ -1336,19 +1349,19 @@ bool GraphEditor::OutNode::LinkSavePY( ostream &f , const char * aGraphName ,
       << ".Input( " ;
     switch (aLink.aLinkValue.type()->kind()) {
       case CORBA::tk_string: {
-        char* retstr ;
+        const char* retstr ;
         aLink.aLinkValue >>= retstr;
         f << "'" << retstr << "'" ;
         break ;
       }
       case CORBA::tk_double: {
-        double d;
+        CORBA::Double d;
         aLink.aLinkValue >>= d;
         f << d ;
         break ;
       }
       case CORBA::tk_long: {
-        long l;
+        CORBA::Long l;
         aLink.aLinkValue >>= l;
         f << l ;
         break ;
@@ -1356,7 +1369,11 @@ bool GraphEditor::OutNode::LinkSavePY( ostream &f , const char * aGraphName ,
       case CORBA::tk_objref: {
         char* retstr ;
         CORBA::Object_ptr obj ;
-        aLink.aLinkValue >>= obj ;
+#if OMNIORB_VERSION >= 4
+        aLink.aLinkValue >>= (CORBA::Any::to_object)obj;
+#else
+       aLink.aLinkValue >>= obj;
+#endif 
         retstr = _Orb->object_to_string(obj );
         f << "'" << retstr << "'" ;
         break ;
index 156d6a3a261a9841ffae7f37e08766b9dcc86c8f..3dcc430340e45c873cbdf442a3040ff44bb25796 100644 (file)
@@ -62,14 +62,14 @@ namespace GraphEditor {
                       const GraphBase::ListOfSLinks &aDatas ) ;
 
 //      bool GraphEditor::OutNode::LinkSaveXML( ostream &f , char *Tabs ,
-      bool GraphEditor::OutNode::LinkSaveXML( QDomDocument & Graph , QDomElement & link ,
+      bool LinkSaveXML( QDomDocument & Graph , QDomElement & link ,
                                               GraphBase::SLink aLink ,
                                               bool wdata ) const ;
 //      bool SaveXML(ostream &f ) ;QDomDocument & Graph 
       bool SaveXML( ostream & f , QDomDocument & Graph ,
                     bool aSuperGraph , QDomElement & supergraph ) ;
 
-      bool GraphEditor::OutNode::LinkSavePY( ostream &f ,
+      bool LinkSavePY( ostream &f ,
                                              const char *aGraphName ,
                                              GraphBase::SLink aLink ,
                                              bool fromparam ,
index 341562f16f204e52f023e687b8b95161844eb215..87bfd0e84757c077a79ca908fa7d71b1eb88c5b5 100644 (file)
@@ -58,12 +58,11 @@ LIB_CLIENT_IDL = SALOME_ModuleCatalog.idl \
 BIN_SRC = 
 BIN_SERVER_IDL = 
 
-CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) \
-       $(KERNEL_CXXFLAGS)
+CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(KERNEL_CXXFLAGS)
 CXXFLAGS+= -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \
        $(KERNEL_CXXFLAGS)
 LDFLAGS+= -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lOpUtil -lSALOMELocalTrace \
-       -lc $(QT_MT_LIBS) $(OGL_LIBS) $(KERNEL_LDFLAGS)
+       -lc $(QT_MT_LIBS) $(KERNEL_LDFLAGS)
 #LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS)
 
 
index 25e0bdd912e7b0d1f37de61a2a352d21db869165..4552e07d21771cdd1a483eec219d40579f9ba7b8 100644 (file)
@@ -239,8 +239,8 @@ bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName ,
   for ( i = 0 ; i < anOutPort->InPortsSize() ; i++ ) {
     const char * ToNodeName = anOutPort->ChangeInPorts( i )->NodeName() ;
     const char * ToParameterName = anOutPort->ChangeInPorts( i )->PortName() ;
-    GraphBase::ComputingNode * aComputingNode = Graph()->GetChangeGraphNode( ToNodeName ) ;
     if ( strcmp( ToNodeName , Name() ) ) {
+      GraphBase::ComputingNode * aComputingNode = Graph()->GetChangeGraphNode( ToNodeName ) ;
       GraphExecutor::InNode * aLinkedNode = (GraphExecutor::InNode * ) aComputingNode->GetInNode() ;
       cdebug << pthread_self() << "/" << aLinkedNode->ThreadNo()
              << "GraphExecutor::DataFlow::OutputOfAny to Node "
@@ -293,8 +293,9 @@ bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName ,
                                                             anOutPort->Value() ) ;
     }
     else {
-      cdebug << "GraphExecutor::DataFlow::OutputOfAny to Graph " << ToNodeName
-             << "(" << ToParameterName << ") ignored" << endl ;
+      cdebug << pthread_self() << "GraphExecutor::DataFlow::OutputOfAny to Node "
+             << ToNodeName << "(" << ToParameterName << ") from MacroNode " << aNodeName
+             << ") ignored" << endl ;
     }
   }
   cdebug_out << pthread_self() << "/" << ThreadNo() << " GraphExecutor::DataFlow::OutputOfAny " << RetVal
@@ -302,6 +303,31 @@ bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName ,
   return RetVal ;
 }
 
+//JR NPAL14110 09.02.2007 : SetWaitingStates was missing in SubGraph of MacroNode !...
+bool GraphExecutor::DataFlow::SetWaitingStates( const char * ToServiceParameterName ) {
+  cdebug_in << pthread_self() << "/" << ThreadNo() << "GraphExecutor::DataFlow::SetWaitingStates( "
+            << ToServiceParameterName << " ) MacroGraph " << Name() << endl ;
+  bool RetVal = true ;
+  State( GraphExecutor::DataWaitingState ) ;
+  Done( false ) ;
+  GraphBase::OutPort * anOutPort ;
+  anOutPort = Graph()->GetChangeInDataNodePort( ToServiceParameterName ) ;
+  anOutPort->PortState(  SUPERV::WaitingState ) ;
+  anOutPort->PortDone( false ) ;
+  cdebug << pthread_self() << "GraphExecutor::DataFlow::SetWaitingStates " << Name()
+         << " " << State() << " " << ToServiceParameterName << " " << anOutPort->PortState()
+         << " Done : " << anOutPort->PortDone() << endl ;
+  if ( ! anOutPort->IsGate() ) {
+    GraphExecutor::InNode * anInNode = (GraphExecutor::InNode * ) Graph()->GetChangeGraphNode( anOutPort->InPorts( 0 )->NodeName() )->GetInNode() ;
+    cdebug << pthread_self() << "GraphExecutor::DataFlow::SetWaitingStates : "
+           << anInNode->Name() << "->SetWaitingStates( NULL ) for Port "
+           << anOutPort->InPorts( 0 )->PortName() << endl ;
+    anInNode->SetWaitingStates( NULL ) ;
+  }
+  cdebug_out << "GraphExecutor::DataFlow::SetWaitingStates() " << RetVal << endl;
+  return RetVal ;
+}
+
 bool GraphExecutor::DataFlow::Kill() {
   cdebug_in << "GraphExecutor::DataFlow::Kill()" << endl;
   bool RetVal = GraphExecutor::OutNode::Kill() ;
index caf4bf41e5d261da9dc5800ef2a436a7b5697f93..dc8038b0cacd2da6d74641eb89578ef7d65773fa 100644 (file)
@@ -70,13 +70,14 @@ namespace GraphExecutor {
       bool ChangeInputData( const char * ToNodeName ,
                             const char * ToParameterName ,
                             const CORBA::Any aValue = CORBA::Any() ) ;
+
       bool InputOfAny( const char * ToServiceParameterName ,
                        const CORBA::Any & aValue ,
                        const bool SomeDataReady = true ) ;
-
       bool OutputOfAny( const char * aNodeName ,
                         const char * ToServiceParameterName ,
                         const CORBA::Any & aValue ) ;
+      bool SetWaitingStates( const char * ToServiceParameterName ) ;
 
       bool IsValid() ;
       bool IsExecutable() ;
index 6580d656d51c82592156b591c67cb8b4ba52b403..b8ab049a0f80d394d3c8e9e038933a7ae36f6e2d 100644 (file)
@@ -65,7 +65,7 @@ void GraphExecutor::InNode::DynInvoke(Engines::Component_ptr objComponent ,
 #if DynInvokeTrace
     switch ( Type ) {
     case CORBA::tk_string : {
-      char * t ;
+      const char * t ;
       data >>= t ;
       cdebug << "ArgIn" << i << " : " << ArgName << " Value " << t << " (string)" 
              << endl ;
@@ -84,25 +84,25 @@ void GraphExecutor::InNode::DynInvoke(Engines::Component_ptr objComponent ,
       break ;
     }
     case CORBA::tk_short : {
-      short s ;
+      CORBA::Short s ;
       data >>= s ;
       cdebug << "ArgIn" << i << " : " << ArgName << " Value " << s << " (short)" << endl ;
       break ;
     }
     case CORBA::tk_long : {
-      long l ;
+      CORBA::Long l ;
       data >>= l ;
-      cdebug << "ArgIn" << i << " : " << ArgName << " Value " << l << " (long)" << endl ;
+      cdebug << "ArgIn" << i << " : " << ArgName << " Value " << l << " (CORBA::Long)" << endl ;
       break ;
     }
     case CORBA::tk_float : {
-      float f ;
+      CORBA::Float f ;
       data >>= f ;
       cdebug << "ArgIn" << i << " : " << ArgName << " Value " << f << " (float)" << endl ;
       break ;
     }
     case CORBA::tk_double : {
-      double d ;
+      CORBA::Double d ;
       data >>= d ;
       cdebug << "ArgIn" << i << " : " << ArgName << " Value " << d << " (double)" << endl ;
       break ;
@@ -135,7 +135,7 @@ void GraphExecutor::InNode::DynInvoke(Engines::Component_ptr objComponent ,
 #if DynInvokeTrace
     switch ( Type ) {
     case CORBA::tk_string : {
-      char * t ;
+      cont char * t ;
       data >>= t ;
       cdebug << "ArgOut" << i << " : " << ArgName << " Value " << t << " (string)" << endl ;
       break ;
@@ -153,25 +153,25 @@ void GraphExecutor::InNode::DynInvoke(Engines::Component_ptr objComponent ,
       break ;
     }
     case CORBA::tk_short : {
-      short s ;
+      CORBA::Short s ;
       data >>= s ;
       cdebug << "ArgOut" << i << " : " << ArgName << " Value " << s << " (short)" << endl ;
       break ;
     }
     case CORBA::tk_long : {
-      long l ;
+      CORBA::Long l ;
       data >>= l ;
-      cdebug << "ArgOut" << i << " : " << ArgName << " Value " << l << " (long)" << endl ;
+      cdebug << "ArgOut" << i << " : " << ArgName << " Value " << l << " (CORBA::Long)" << endl ;
       break ;
     }
     case CORBA::tk_float : {
-      float f ;
+      CORBA::Float f ;
       data >>= f ;
       cdebug << "ArgOut" << i << " : " << ArgName << " Value " << f << " (float)" << endl ;
       break ;
     }
     case CORBA::tk_double : {
-      double d ;
+      CORBA::Double d ;
       data >>= d ;
       cdebug << "ArgOut" << i << " : " << ArgName << " Value " << d << " (double)" << endl ;
       break ;
@@ -196,8 +196,12 @@ void GraphExecutor::InNode::DynInvoke(Engines::Component_ptr objComponent ,
 #endif
   }
 
-  req->invoke();
-
+  // IPAL9273, 9369, 9731 : replace blocking function invoke() with non blocking send_deferred()
+  // to provide the correct process of killing dataflow execution
+  req->send_deferred() ;
+  while( !req->poll_response() ) {}
+  req->get_response();
+  
   if( req->env()->exception() ) {
     req->env()->exception()->_raise() ;
     return ; // pas utile ?
index 8408f5c2ff6ad6dea988911311b4fd55a47695f9..36b70bfe190eeb64842f6426424f17fb56cc7840 100644 (file)
@@ -728,6 +728,13 @@ void GraphExecutor::FiniteStateMachine::JoinThread( pthread_t aThread ) {
   }
 }
 
+int GraphExecutor::FiniteStateMachine::ThreadsNumber() {
+  if( _ThreadList.begin() == _ThreadList.end() )
+    return 0;
+  else
+    return _ThreadList.size();
+}
+
 ostream & operator<< (ostream &f ,const GraphExecutor::AutomatonState & aState ) {
   switch (aState) {
   case GraphExecutor::UnKnownState :
index 40f2c06f427a4a9f090771ebf2b792d924a5e400..257c208dbd5631bc048830373356558ae414748f 100644 (file)
@@ -233,6 +233,8 @@ namespace GraphExecutor {
       void JoinThread() ;
       void JoinThread( pthread_t aThread ) ;
 
+      int ThreadsNumber() ; // mkr : IPAL14711
+
       const char * ControlStateName( const SUPERV::ControlState & aState ) const {
             return _ControlStateName[ aState ] ; } ;
       const char * StateName( const GraphExecutor::AutomatonState & aState ) const {
index 028a97034ffba4c5a5ac954e73f4dd5c34acddec..bd312f42f758ac346eb7bd066f2b287f95a446b2 100644 (file)
@@ -1394,8 +1394,8 @@ void GraphExecutor::InNode::InitialState()
       anOutPort->PortDone( true ) ;
 //JR 21.02.2005 Debug Memory leak :      CORBA::Any * anAny = new CORBA::Any() ;
       CORBA::Any anAny = CORBA::Any() ;
-//JR 21.02.2005 Debug Memory leak :      *anAny <<= (long ) 1 ;
-      anAny <<= (long ) 1 ;
+//JR 21.02.2005 Debug Memory leak :      *anAny <<= (CORBA::Long ) 1 ;
+      anAny <<= (CORBA::Long ) 1 ;
       anOutPort->SetValue( anAny ) ;
       _InitLoop = true ;
       cdebug << "InPort" << i << " " << anInPort->PortName() << " " << anInPort->PortStatus()
@@ -1521,6 +1521,7 @@ void GraphExecutor::InNode::InitialState()
 }
 
 bool GraphExecutor::InNode::InitPythonFunctions(bool WithErr ) {
+  //JR Look at DataFlowExecutor for the meaning of WithErr
   cdebug_in << "GraphExecutor::InNode::InitPythonFunctions " << Name() << " WithErr " << WithErr
             << " PyFuncRunned() " << PyFuncRunned() << endl;
   bool Err = false ;
@@ -1537,7 +1538,13 @@ bool GraphExecutor::InNode::InitPythonFunctions(bool WithErr ) {
         PyRunMethod = InitPyDynInvoke( InLineNode()->PyFuncName() ,
                                        InLineNode()->PythonFunction() ,
                                        OneErr ) ;
-        InLineNode()->PyRunMethod( PyRunMethod ) ;
+       // JR Debug : if we must have a python function and if we have not : error
+        if ( PyRunMethod ) {
+          InLineNode()->PyRunMethod( PyRunMethod ) ;
+       }
+        else if ( WithErr && strlen( InLineNode()->PyFuncName() ) ) {
+          OneErr = true ;
+       }
       }
       Err = Err || OneErr ;
       if ( OneErr && WithErr ) {
@@ -1554,7 +1561,13 @@ bool GraphExecutor::InNode::InitPythonFunctions(bool WithErr ) {
         PyMoreMethod = InitPyDynInvoke( LoopNode()->PyMoreName() ,
                                         LoopNode()->MorePythonFunction() ,
                                         OneErr ) ;
-        LoopNode()->PyMoreMethod( PyMoreMethod ) ;
+       // JR Debug : if we must have a python function and if we have not : error
+        if ( PyMoreMethod ) {
+          LoopNode()->PyMoreMethod( PyMoreMethod ) ;
+       }
+        else if ( WithErr && strlen( LoopNode()->PyMoreName() ) ) {
+          OneErr = true ;
+       }
       }
       Err = Err || OneErr ;
       if ( OneErr && WithErr ) {
@@ -1571,7 +1584,13 @@ bool GraphExecutor::InNode::InitPythonFunctions(bool WithErr ) {
         PyNextMethod = InitPyDynInvoke( LoopNode()->PyNextName() ,
                                         LoopNode()->NextPythonFunction() ,
                                         OneErr ) ;
-        LoopNode()->PyNextMethod( PyNextMethod ) ;
+       // JR Debug : if we must have a python function and if we have not : error
+        if ( PyNextMethod ) {
+          LoopNode()->PyNextMethod( PyNextMethod ) ;
+       }
+        else if ( WithErr && strlen( LoopNode()->PyNextName() ) ) {
+          OneErr = true ;
+       }
       }
       Err = Err || OneErr ;
       if ( OneErr && WithErr ) {
@@ -1580,6 +1599,10 @@ bool GraphExecutor::InNode::InitPythonFunctions(bool WithErr ) {
                                 string( Name() ) ;
         _OutNode->Graph()->SetMessages( anErrorMessage ) ;
       }
+      //JR Debug 12854
+      if ( Err ) {
+        PyFuncRunned( false ) ;
+      }
       cdebug << "GraphExecutor::InNode::InitPythonFunctions " << Name() << " PyRunMethod(Init) "
              << PyRunMethod << " PyMoreMethod " << PyMoreMethod << " PyNextMethod " << PyNextMethod
              << endl;
@@ -1593,7 +1616,13 @@ bool GraphExecutor::InNode::InitPythonFunctions(bool WithErr ) {
        PyRunMethod = InitPyDynInvoke( InLineNode()->PyFuncName() ,
                                        InLineNode()->PythonFunction() ,
                                        OneErr ) ;
-        InLineNode()->PyRunMethod( PyRunMethod ) ;
+       // JR Debug : if we must have a python function and if we have not : error
+        if ( PyRunMethod != NULL ) {
+          InLineNode()->PyRunMethod( PyRunMethod ) ;
+       }
+        else if ( WithErr && strlen( InLineNode()->PyFuncName() ) ) {
+          OneErr = true ;
+       }
       }
       Err = Err || OneErr ;
       if ( OneErr && WithErr ) {
@@ -1614,7 +1643,13 @@ bool GraphExecutor::InNode::InitPythonFunctions(bool WithErr ) {
         PyRunMethod = InitPyDynInvoke( InLineNode()->PyFuncName() ,
                                        InLineNode()->PythonFunction() ,
                                        OneErr ) ;
-        InLineNode()->PyRunMethod( PyRunMethod ) ;
+       // JR Debug : if we must have a python function and if we have not : error
+        if ( PyRunMethod != NULL ) {
+          InLineNode()->PyRunMethod( PyRunMethod ) ;
+       }
+        else if ( WithErr && strlen( InLineNode()->PyFuncName() ) ) {
+          OneErr = true ;
+       }
       }
       Err = Err || OneErr ;
       if ( OneErr && WithErr ) {
@@ -1626,10 +1661,11 @@ bool GraphExecutor::InNode::InitPythonFunctions(bool WithErr ) {
       cdebug << "GraphExecutor::InNode::InitPythonFunctions " << Name() << " PyRunMethod " << PyRunMethod << endl;
     }
   }
-  Err = WithErr && Err ;
+  //JR Look at DataFlowExecutor :
+  //  Err = WithErr && Err ;
   cdebug_out << "GraphExecutor::InNode::InitPythonFunctions " << Name() ;
-  if ( Err ) {
-    cdebug << " Error " << Err ;
+  if ( WithErr && Err ) {
+    cdebug << " Error " << WithErr && Err ;
   }
   cdebug << endl;
   return !Err ;
@@ -1653,10 +1689,18 @@ const long GraphExecutor::InNode::CpuUsed( bool tot ) {
         cpu = Component()->CpuUsed_impl() ;
       }
       catch ( ... ) {
-        cdebug << "CpuUsed " << Name() << " --> Component()->CpuUsed_impl() ERROR catched "
-               << endl ;
-        State( GraphExecutor::ErroredState ) ;
-        _OutNode->State( GraphExecutor::ErroredState ) ;
+        if ( _OutNode->IsDone() ) {
+          cdebug << "CpuUsed " << Name() << " --> Component()->CpuUsed_impl() WARNING catched Graph is done "
+                 << Automaton()->StateName( _OutNode->State() ) << endl ;
+        }
+        else {
+          cdebug << "CpuUsed " << Name() << " --> Component()->CpuUsed_impl() WARNING catched "
+                 << Automaton()->StateName( _OutNode->State() ) << endl ;
+//JR NPAL14110 09.02.2007 : If there is a shutdown of components ===> NodeState must not
+//                          be aborted ... ==> Commented :
+          //JRState( GraphExecutor::ErroredState ) ;
+          //JR_OutNode->State( GraphExecutor::ErroredState ) ;
+        }
         cpu = -1 ;
       }
     }
index 008c7287874c8d24d1f2e8953e7fb62118e4ec9f..7b10bc378b926e0c962a6d050f6ea86eb71886ac 100644 (file)
@@ -459,7 +459,7 @@ namespace GraphExecutor {
       bool PyDynInvoke( PyObject * MyPyRunMethod ,
                        const char *method , 
                        ServicesAnyData * inParams , int nInParams ,
-                       ServicesAnyData * inParams , int nOutParams ) ;
+                       ServicesAnyData * outParams, int nOutParams ) ;
 
       int Executing_SuspendAction() ;
       int SuspendedExecuting_ResumeAction() ;
index 980aa5062c74a3cd860d87b3bf01f35cbf7551b7..ea4f2387aad11691bfdca773d0192e53d701e0f3 100644 (file)
@@ -85,6 +85,9 @@ int GraphExecutor::InNode::SendEvent( const GraphExecutor::NodeEvent anEvent ) {
   _OldState = State() ;
   _NextState = Automaton()->NextState( _OldState , anEvent ) ;
   if ( _NextState == _OldState ) {
+    string anErrorMessage = string( "Automaton error for node " ) +
+                            string( Name() ) + " (SuperVision executor error)." ;
+    _OutNode->Graph()->SetMessages( anErrorMessage ) ;
     cdebug << pthread_self() << "/" << ThreadNo() << " " << Name()
            << " GraphExecutor::InNodeThreads::SendEvent SameStates ERROR _OldState/_NextState "
            << _OldState << " Event " << Automaton()->EventName( anEvent ) << endl ;
@@ -620,8 +623,8 @@ int GraphExecutor::InNode::executeAction() {
         char * msg = "Cannot pthread_create " ;
         perror( msg ) ;
         cdebug << ThreadNo() << " " << msg << " --> sleep(5)" << endl ;
-        cdebug << ThreadNo() << " PTHREAD_THREADS_MAX : "
-               << PTHREAD_THREADS_MAX << " pthread_create status : " ;
+       //        cdebug << ThreadNo() << " PTHREAD_THREADS_MAX : "
+        //       << PTHREAD_THREADS_MAX << " pthread_create status : " ;
         if ( pthread_sts == EAGAIN ) {
           cdebug << "EAGAIN(" << pthread_sts << ")" << endl ;
           cdebug << _OutNode->CreatedThreads() << " was created (and exited)" << endl ;
@@ -634,6 +637,7 @@ int GraphExecutor::InNode::executeAction() {
         delete [] msg ;
         pthread_exit( msg ) ;
       }
+      _OutNode->setRunFuncThread( T ) ; // mkr : IPAL14711
 #if ActionsTrace
       cdebug << pthread_self() << "/" << ThreadNo() << " " << Name()
              << " executeAction has created thread " << T << endl ;
@@ -888,7 +892,8 @@ int GraphExecutor::InNode::VoidAction() {
 int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
 #if SomeDataReadyActionTrace
   cdebug_in << pthread_self() << "/" << ThreadNo() << " " << Name()
-            << " DataWaiting_SomeDataReadyAction from " << DataFromNode() << endl;
+            << " DataWaiting_SomeDataReadyAction from " << DataFromNode()
+            << " " << GetNodeInPortsSize() << " Inport(s)" << endl;
 #endif
   unsigned int k;
   int InReady = 0 ;
@@ -979,7 +984,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
       anOutPort = anInPort->GetOutPort() ;
       if ( anOutPort ) {
 #if SomeDataReadyActionTrace
-        cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+        cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+               << k << " "
                << anInPort->PortName() << " already setted to OutPort " << anOutPort->NodeName()
                << "( " << anOutPort->PortName() << " )" << endl ;
 #endif
@@ -988,7 +994,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
         anOutPort = CoupledNode()->GetChangeOutPort( anInPort->PortName() ) ;
         if ( anOutPort ) {
 #if SomeDataReadyActionTrace
-          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+                 << k << " "
                  << anInPort->PortName() << " change of OutPort from "
                  << anInPort->GetOutPort()->NodeName() << "( " << anInPort->GetOutPort()->PortName()
                  << " ) to " << anOutPort->NodeName() << "( " << anOutPort->PortName() << " )"
@@ -996,7 +1003,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
 #endif
        }
         else {
-          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+                 << k << " "
                  << anInPort->PortName() << " have NO OutPort ERROR " << endl ;
           return 0 ;
        }
@@ -1007,7 +1015,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
       anOutPort = anInPort->GetOutPort() ;
     }
 #if SomeDataReadyActionTrace
-    cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+    cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+           << k << " "
            << anInPort->PortName() << " " << anInPort->PortState() << " "
            << anInPort->PortStatus() << " " << anInPort->Kind()  ;
     if ( anOutPort ) {
@@ -1044,6 +1053,21 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
        }
 #endif
         cdebug << endl ;
+#endif
+//JR 30.01.2007 : wrong debug for PAL12455
+#if 0
+        // mkr : PAL12455 -->
+        // MacroNode : give immediately the value to the corresponding graph
+        if ( IsMacroNode() ) {
+          GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ;
+          cdebug << "SomeDataReadyAction MacroNode " << aMacroGraph->Name() << " --> InputOfAny "
+                 << InReady << "/" << GetNodeInPortsSize() << " InPorts are Ready ( "
+                 << anInPort->PortName() << " ) ===> InputOfAny" << endl ;
+//        GraphMacroNode()->MacroObject()->InputOfAny( anInPort->PortName() , *anOutPort->Value() ) ;
+//JR 30.03.2005        aMacroGraph->InputOfAny( anInPort->PortName() , *anOutPort->Value() ) ;
+          aMacroGraph->InputOfAny( anInPort->PortName() , anOutPort->Value() ) ;
+        }
+        // mkr : PAL12455 <--
 #endif
       }
       else if ( IsLoopNode() && anInPort->IsDataConnected() ) {
@@ -1101,8 +1125,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
         InReady += 1 ;
 //JR 21.02.2005 Debug Memory leak :        CORBA::Any * anAny = new CORBA::Any() ;
         CORBA::Any anAny = CORBA::Any() ;
-//JR 21.02.2005 Debug Memory leak :        *anAny <<= (long ) 1 ;
-        anAny <<= (long ) 1 ;
+//JR 21.02.2005 Debug Memory leak :        *anAny <<= (CORBA::Long ) 1 ;
+        anAny <<= (CORBA::Long ) 1 ;
         _OutNode->Graph()->GetGraphNode( anOutPort->NodeName() )->GetChangeNodeOutGate()->SetValue( anAny ) ;
 #if SomeDataReadyActionTrace
         cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
@@ -1134,7 +1158,7 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
     else if ( anInPort->IsGate() ) {
 //JR 30.03.2005      const CORBA::Any * theValue = anOutPort->Value() ;
       const CORBA::Any theValue = anOutPort->Value() ;
-      long GateOpened ;
+      CORBA::Long GateOpened ;
 //JR 30.03.2005      (*theValue) >>= GateOpened ;
       theValue >>= GateOpened ;
       if ( GateOpened != 0 ) {
@@ -1228,10 +1252,32 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
     cdebug << pthread_self() << "/" << ThreadNo() << " Node " << Name() << " HasAllDataReady"
            << endl ;
 #endif
+//JR 30.01.2007 Right Debug PAL12455 --->
+//That must be done only for DataConnected ports and only once
+    if ( IsMacroNode() ) {
+      GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ;
+      for ( k = 0 ; k < (unsigned int ) GetNodeInPortsSize() ; k++ ) {
+        GraphBase::InPort * anInPort = GetChangeNodeInPort(k) ;
+        GraphBase::OutPort * anOutPort ;
+        anOutPort = anInPort->GetOutPort() ;
+        if ( anInPort->IsDataConnected() ) {
+          cdebug << "SomeDataReadyAction MacroNode " << aMacroGraph->Name()
+                 << " --> InputOfAny " << InReady << "/" << GetNodeInPortsSize()
+                 << " InPorts are Ready ( " << anInPort->PortName()
+                 << " ) ===> InputOfAny" << endl ;
+          aMacroGraph->InputOfAny( anInPort->PortName() , anOutPort->Value() ) ;
+        }
+      }
+    }
+// <--- JR 30.01.2007 Right Debug PAL12455
     HasAllDataReady( true ) ; // ==> Ready to execute
     res = 1 ;
   }
   else { // At least one Flag == 0 :
+#if SomeDataReadyActionTrace
+    cdebug << pthread_self() << "/" << ThreadNo() << " Node " << Name() << " HasNOTAllDataReady "
+           << InReady << "/" << GetNodeInPortsSize() << " DoAllDataReadyIf " << DoAllDataReadyIf << endl ;
+#endif
     HasAllDataReady( false ) ;
     res = SendEvent( GraphExecutor::NotAllDataReadyEvent );
   }
@@ -1780,7 +1826,7 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() {
 //JR 29.09.2005 Debug for CEA (examples/GraphMacroNodes1) :
 // Set of value of the OutGate of the corresponding MacroNode was missing
     CORBA::Any anAny = CORBA::Any() ;
-    anAny <<= (long ) 1 ;
+    anAny <<= (CORBA::Long ) 1 ;
     GraphMacroNode()->GraphEditor()->Executor()->OutputOfAny( Name() , "Gate" , anAny ) ;
 #if TraceDataReady_ExecuteAction
     cdebug << "DataReady_ExecuteAction OutputOfAny( " << Name() << " , Gate , 1 )" << endl ;
@@ -2310,7 +2356,7 @@ int GraphExecutor::InNode::Errored_ExecutingAction() {
 }
 
 #define SetWaitingStatesTrace 0
-// Set SUPERV::WaitingState to all InPorts 
+// Set SUPERV::WaitingState to all InPorts and Nodes
 void GraphExecutor::InNode::SetWaitingStates(GraphExecutor::InNode * EndNode ) {
   int i ;
   int j ;
@@ -2332,9 +2378,9 @@ void GraphExecutor::InNode::SetWaitingStates(GraphExecutor::InNode * EndNode ) {
       if ( anOutPort ) {
 //JR 21.02.2005 Debug Memory leak :        CORBA::Any * anAny = new CORBA::Any() ;
         CORBA::Any anAny = CORBA::Any() ;
-//        *anAny <<= (long ) 1 ;
-//JR 21.02.2005 Debug Memory leak :        *anAny <<= (long ) 0 ;
-        anAny <<= (long ) 0 ;
+//        *anAny <<= (CORBA::Long ) 1 ;
+//JR 21.02.2005 Debug Memory leak :        *anAny <<= (CORBA::Long ) 0 ;
+        anAny <<= (CORBA::Long ) 0 ;
         anOutPort->SetValue( anAny ) ;
         anInPort->PortState( SUPERV::WaitingState ) ;
 //        delete anAny ;
@@ -2357,6 +2403,17 @@ void GraphExecutor::InNode::SetWaitingStates(GraphExecutor::InNode * EndNode ) {
     cdebug << "               --> InPort " << Name() << "( " << anInPort->PortName() << " ) "
            << anInPort->PortStatus() << " " << anInPort->PortState() << endl ;
 #endif
+//JR NPAL14110 09.02.2007 : SetWaitingStates was missing in the corresponding SubGraph !...
+    if ( IsMacroNode() ) {
+      GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ;
+#if SetWaitingStatesTrace
+      cdebug << ThreadNo()
+             << " --> GraphExecutor::InNodeThreads::SetWaitingStates MacroNode " << Name()
+             << " ---> MacroGraph " << aMacroGraph->Name() << " Inport "
+             << anInPort->PortName() << endl;
+#endif
+      aMacroGraph->SetWaitingStates( anInPort->PortName() ) ;
+    }
   }
   for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
     GraphBase::OutPort * anOutPort = GetChangeNodeOutPort( i ) ;
@@ -2507,8 +2564,8 @@ int GraphExecutor::InNode::Successed_SuccessAction() {
       if ( anOutPort ) {
 //JR 21.02.2005 Debug Memory leak :        CORBA::Any * anAny = new CORBA::Any() ;
         CORBA::Any anAny = CORBA::Any() ;
-//JR 21.02.2005 Debug Memory leak :        *anAny <<= (long ) 1 ;
-        anAny <<= (long ) 1 ;
+//JR 21.02.2005 Debug Memory leak :        *anAny <<= (CORBA::Long ) 1 ;
+        anAny <<= (CORBA::Long ) 1 ;
         anOutPort->SetValue( anAny ) ;
         aLabelNode->GetChangeNodeInGate()->PortState( SUPERV::ReadyState ) ;
 //        delete anAny ;
@@ -2698,8 +2755,8 @@ int GraphExecutor::InNode::Successed_SuccessAction() {
             LoopOutPort->PortDone( true ) ;
 //JR 21.02.2005 Debug Memory leak :          CORBA::Any * anAny = new CORBA::Any() ; // InitLoop
             CORBA::Any anAny = CORBA::Any() ; // InitLoop
-//JR 21.02.2005 Debug Memory leak :          *anAny <<= (long ) 1 ;
-            anAny <<= (long ) 1 ;
+//JR 21.02.2005 Debug Memory leak :          *anAny <<= (CORBA::Long ) 1 ;
+            anAny <<= (CORBA::Long ) 1 ;
             LoopOutPort->SetValue( anAny ) ;
             int j ;
             for ( j = 0 ; j < toNode->GetNodeInPortsSize() ; j++ ) {
@@ -3193,14 +3250,15 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
       if ( anInPort->IsGate() ) {
 //JR 21.02.2005 Debug Memory leak :        CORBA::Any * anAny = new CORBA::Any() ;
         CORBA::Any anAny = CORBA::Any() ;
-//JR 21.02.2005 Debug Memory leak :        *anAny <<= (long ) 0 ;
-        anAny <<= (long ) 0 ;
+//JR 21.02.2005 Debug Memory leak :        *anAny <<= (CORBA::Long ) 0 ;
+        anAny <<= (CORBA::Long ) 0 ;
         theOutPort->SetValue( anAny ) ;
 //        delete anAny ;
       }
-      if ( !anInPort->IsDataStream() &&
+      if ( !anInPort->IsDataStream() 
+          && 
            !anInPort->IsDataConnected() ) {
-        anInPort->PortState( SUPERV::WaitingState ) ;
+          anInPort->PortState( SUPERV::WaitingState ) ;
       }
 //JR 18.02.2005 Debug Memory leak : delete does not destroy that string ...
 //      D.Name = CORBA::string_dup( anInPort->GetServicesParameter().Parametername ) ;
@@ -3219,7 +3277,7 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
       const char * Type = anInPort->GetServicesParameter().Parametertype ;
       switch ( D.Value.type()->kind() ) { // { string , long , double , objref }
       case CORBA::tk_string:
-        char * t;
+        const char * t;
         D.Value >>= t;
 #if InParametersSetTrace
         cdebug << t << " (string)" ;
@@ -3257,11 +3315,12 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 //          theOutPort->Value( D.Value ) ;
         }
         else if ( !strcmp( Type , "int" ) || !strcmp( Type , "long" ) ) {
-          long l ;
-          sscanf( t , "%ld" , &l ) ;
+          long ll ;
+          sscanf( t , "%ld" , &ll ) ;
+          CORBA::Long l = ll ;
           D.Value <<=  l ;
 #if InParametersSetTrace
-          cdebug << "string '" << t << " --> long " << l ;
+          cdebug << "string '" << t << " --> CORBA::Long " << l ;
 #endif
 //          theOutPort->Value( D.Value ) ;
         }
@@ -3272,7 +3331,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 #ifdef REDHAT // mkr : debug for PAL12255
           D.Value <<= f ;
 #else
-         D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+//JR     D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+          D.Value <<= (CORBA::Float) f ;
 #endif
 #if InParametersSetTrace
           cdebug << "string '" << t << "' --> " << setw(25) << setprecision(18) << d << " --> float " << " = "
@@ -3286,7 +3346,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 #ifdef REDHAT // mkr : debug for PAL12255
           D.Value <<= d ;
 #else
-         D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR     D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+          D.Value <<= (CORBA::Double) d ;
 #endif
 #if InParametersSetTrace
           cdebug << "string '" << t << " --> double " << setw(25) << setprecision(18) << d ;
@@ -3320,14 +3381,14 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
         theOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
         cdebug << endl ;
 #endif
-        long l;
+        CORBA::Long l;
         D.Value >>= l;
 #if InParametersSetTrace
-        cdebug << l << " (long)" << endl ;
+        cdebug << l << " (CORBA::Long)" << endl ;
 #endif
         if ( !strcmp( Type , "string" ) ) {
           char t[40] ;
-          sprintf( t , "%ld" , l ) ;
+          sprintf( t , "%ld" , (long)l ) ;
           D.Value <<= t ;
 //          theOutPort->Value( D.Value ) ;
         }
@@ -3357,7 +3418,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 #ifdef REDHAT // mkr : debug for PAL12255
           D.Value <<= f ;
 #else
-         D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+//JR     D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+          D.Value <<= (CORBA::Float) f ;
 #endif
 //          theOutPort->Value( D.Value ) ;
         }
@@ -3367,7 +3429,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 #ifdef REDHAT // mkr : debug for PAL12255
           D.Value <<= d ;
 #else
-          D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR      D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+          D.Value <<= (CORBA::Double) d ;
 #endif
 //          theOutPort->Value( D.Value ) ;
         }
@@ -3384,7 +3447,7 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 #endif
         break;
       case CORBA::tk_double:
-        double d;
+        CORBA::Double d;
         D.Value >>= d;
 #if InParametersSetTrace
         cdebug << d << " (double)" << endl ;
@@ -3414,8 +3477,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 //          theOutPort->Value( D.Value ) ;
         }
         else if ( !strcmp( Type , "int" ) || !strcmp( Type , "long" ) ) {
-          long l ;
-          l = (long ) d ;
+          CORBA::Long l ;
+          l = (CORBA::Long ) d ;
           D.Value <<= l ;
 //          theOutPort->Value( D.Value ) ;
         }
@@ -3425,7 +3488,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 #ifdef REDHAT // mkr : debug for PAL12255
           D.Value <<= f ;
 #else
-          D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+//JR      D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+          D.Value <<= (CORBA::Float) f ;
 #endif
 //          theOutPort->Value( D.Value ) ;
         }
@@ -3480,7 +3544,7 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 //          theOutPort->Value( D.Value ) ;
         }
         else if ( !strcmp( Type , "int" ) || !strcmp( Type , "long" ) ) {
-          long l = 0 ;
+          CORBA::Long l = 0 ;
           D.Value <<= l ;
 //          theOutPort->Value( D.Value ) ;
         }
@@ -3489,7 +3553,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 #ifdef REDHAT // mkr : debug for PAL12255
           D.Value <<= f ;
 #else
-          D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+//JR      D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+          D.Value <<= (CORBA::Float) f ;
 #endif
 //          theOutPort->Value( D.Value ) ;
         }
@@ -3498,7 +3563,8 @@ void GraphExecutor::InNode::InParametersSet( bool & Err ,
 #ifdef REDHAT // mkr : debug for PAL12255
           D.Value <<= d ;
 #else
-          D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR      D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+          D.Value <<= (CORBA::Double) d ;
 #endif
 //          theOutPort->Value( D.Value ) ;
         }
@@ -3583,14 +3649,15 @@ void GraphExecutor::InNode::InOutParametersSet( int nOutParams ,
       D.Value <<=  s ;
     }
     else if ( !strcmp( Type , "int" ) || !strcmp( Type , "long" ) ) {
-      D.Value <<= (long ) 0 ;
+      D.Value <<= (CORBA::Long ) 0 ;
     }
     else if ( !strcmp( Type , "float" ) ) {
       float f = 0 ;
 #ifdef REDHAT // mkr : debug for PAL12255
       D.Value <<= f ;
 #else
-      D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+//JR  D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+      D.Value <<= (CORBA::Float) f ;
 #endif
     }
     else if ( !strcmp( Type , "double" ) ) {
@@ -3598,7 +3665,8 @@ void GraphExecutor::InNode::InOutParametersSet( int nOutParams ,
 #ifdef REDHAT // mkr : debug for PAL12255
       D.Value <<= d ;
 #else
-      D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR  D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+      D.Value <<= (CORBA::Double) d ;
 #endif
     }
     else {
@@ -3607,7 +3675,7 @@ void GraphExecutor::InNode::InOutParametersSet( int nOutParams ,
 #if InParametersSetTrace
     switch (D.Value.type()->kind()) { // { string , long , double , objref }
     case CORBA::tk_string:
-      char * t;
+      const char * t;
       D.Value >>= t;
       cdebug << ThreadNo() << " " << t << "(string)" << endl ;
       break;
@@ -3622,22 +3690,22 @@ void GraphExecutor::InNode::InOutParametersSet( int nOutParams ,
       cdebug << ThreadNo() << " " << c << "(char)" << endl ;
       break;
     case CORBA::tk_short:
-      short s;
+      CORBA::Short s;
       D.Value >>= s;
       cdebug << ThreadNo() << " " << s << "(short)" << endl ;
       break;
     case CORBA::tk_long:
-      long l;
+      CORBA::Long l;
       D.Value >>= l;
-      cdebug << ThreadNo() << " " << l << "(long)" << endl ;
+      cdebug << ThreadNo() << " " << l << "(CORBA::Long)" << endl ;
       break;
     case CORBA::tk_float:
-      float f;
+      CORBA::Float f;
       D.Value >>= f;
       cdebug << ThreadNo() << " " << f << "(float)" << endl ;
       break;
     case CORBA::tk_double:
-      double d;
+      CORBA::Double d;
       D.Value >>= d;
       cdebug << ThreadNo() << " " << d << "(double)" << endl ;
       break;
@@ -3696,7 +3764,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
         ServicesAnyData D = OutParametersList[i] ;
         switch (D.Value.type()->kind()) { // { string , long , double , objref }
         case CORBA::tk_string: {
-          char * t;
+          const char * t;
           D.Value >>= t;
 #if OutParametersSetTrace
           cdebug << ThreadNo() << " " << t << "(string)" << endl ;
@@ -3706,7 +3774,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
         case CORBA::tk_boolean: {
           bool b ;
           D.Value >>= (CORBA::Any::to_boolean ) b;
-          long l = (long ) b ;
+          CORBA::Long l = (CORBA::Long ) b ;
           D.Value <<= l ;
 #if OutParametersSetTrace
           cdebug << ThreadNo() << " " << b << "(boolean)" << endl ;
@@ -3716,7 +3784,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
         case CORBA::tk_char: {
           unsigned char c ;
           D.Value >>= (CORBA::Any::to_char ) c;
-          long l = (long ) c ;
+          CORBA::Long l = (CORBA::Long ) c ;
           D.Value <<= l ;
 #if OutParametersSetTrace
           cdebug << ThreadNo() << " " << c << "(char)" << endl ;
@@ -3724,9 +3792,9 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
           break;
        }
         case CORBA::tk_short: {
-          short s;
+          CORBA::Short s;
           D.Value >>= s;
-          long l = (long ) s ;
+          CORBA::Long l = (CORBA::Long ) s ;
           D.Value <<= l ;
 #if OutParametersSetTrace
           cdebug << ThreadNo() << " " << s << "(short)" << endl ;
@@ -3734,21 +3802,22 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
           break;
        }
         case CORBA::tk_long: {
-          long l;
+          CORBA::Long l;
           D.Value >>= l;
 #if OutParametersSetTrace
-          cdebug << ThreadNo() << " " << l << "(long)" << endl ;
+          cdebug << ThreadNo() << " " << l << "(CORBA::Long)" << endl ;
 #endif
           break;
        }
         case CORBA::tk_float: {
-          float f;
+          CORBA::Float f;
           D.Value >>= f;
           double d = (double ) f ;
 #ifdef REDHAT // mkr : debug for PAL12255
           D.Value <<= d ;
 #else
-          D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR      D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+          D.Value <<= (CORBA::Double) d ;
 #endif
 #if OutParametersSetTrace
           cdebug << ThreadNo() << " " << f << "(float)" << endl ;
@@ -3756,7 +3825,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
           break;
        }
         case CORBA::tk_double: {
-          double d;
+          CORBA::Double d;
           D.Value >>= d;
 #if OutParametersSetTrace
           cdebug << ThreadNo() << " " << d << "(double)" << endl ;
@@ -3795,7 +3864,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
 #if OutParametersSetTrace
             cdebug << " Gate " ;
 #endif
-            long l = 1;
+            CORBA::Long l = 1;
             OutParametersList[i].Value <<= l;
             anOutPort->SetValue( OutParametersList[i].Value );
           }
@@ -3868,6 +3937,10 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
           const char * ToNodeName = anOutPort->ChangeInPorts( j )->NodeName() ;
           if ( !strcmp( ToNodeName , _OutNode->Name() ) &&
                _OutNode->Graph()->GraphMacroLevel() != 0 ) {
+//JR NPAL14110 09.02.2007 : That must be done only at the end of SubGraph because we may
+//                          have an output of the SubGraph in a Loop !...
+//                          So that code must be done in CheckAllDone
+#if 0
 #if OutParametersSetTrace
             cdebug << "OutParametersSet ToNodeName " << _OutNode->Name() << " CoupledNode "
                    << _OutNode->Graph()->CoupledNodeName() << _OutNode->Graph()->CoupledNode()
@@ -3883,7 +3956,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
                    << _OutNode->Graph()->CoupledNodeName() << " , "
                    << anOutPort->ChangeInPorts( j )->PortName() << " , value )" << endl ;
 #endif
-
+#endif
          }
           else {
            GraphBase::ComputingNode * ToNode = _OutNode->Graph()->GetChangeGraphNode( ToNodeName ) ;
@@ -3926,7 +3999,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
 #if OutParametersSetTrace
         switch ( anOutPort->Value().type()->kind() ) {
         case CORBA::tk_string:
-          char * t;
+          const char * t;
           (anOutPort->Value()) >>= t;
           cdebug << ThreadNo() << " Out" << i << " : " << t << "(string)" << endl ;
           break;
@@ -3941,22 +4014,22 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
           cdebug << ThreadNo() << " Out" << i << " : " << c << "(char)" << endl ;
           break;
         case CORBA::tk_short:
-          short s;
+          CORBA::Short s;
           (anOutPort->Value()) >>= s;
           cdebug << ThreadNo() << " Out" << i << " : " << s << "(short)" << endl ;
           break;
         case CORBA::tk_long:
-          long l;
+          CORBA::Long l;
           (anOutPort->Value()) >>= l;
-          cdebug << ThreadNo() << " Out" << i << " : " << l << "(long)" << endl ;
+          cdebug << ThreadNo() << " Out" << i << " : " << l << "(CORBA::Long)" << endl ;
           break;
         case CORBA::tk_float:
-          float f;
+          CORBA::Float f;
           (anOutPort->Value()) >>= f;
           cdebug << ThreadNo() << " Out" << i << " : " << f << "(float)" << endl ;
           break;
         case CORBA::tk_double:
-          double d;
+          CORBA::Double d;
           (anOutPort->Value()) >>= d;
           cdebug << ThreadNo() << " Out" << i << " : " << d << "(double)" << endl ;
           break;
@@ -4010,7 +4083,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
                  << aGateOutPort->PortName() << " " << aGateOutPort->Kind() << " WITH DefaultPort"
                  << endl ;
 #endif
-          long l = 1;
+          CORBA::Long l = 1;
           OutParametersList[0].Value <<= l ;
           aGateOutPort->SetValue( OutParametersList[0].Value ) ;
        }
@@ -4037,7 +4110,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
                << aGateOutPort->PortName() << " " << aGateOutPort->Kind() << " NO DefaultPort"
                << " OrSwitch " << OrSwitch << " DefaultSwitch " << DefaultSwitch << endl ;
 #endif
-        long l = 0;
+        CORBA::Long l = 0;
         OutParametersList[0].Value <<= l ;
         aGateOutPort->SetValue( OutParametersList[0].Value ) ;
       }
index fd8c1a177c3d0e3133f86c99e8a639c1308a4aed..55d1df53023bad3f10ca2cbbadbbdf49f5bda57a 100644 (file)
@@ -31,6 +31,7 @@ using namespace std;
 #include "DataFlowExecutor_OutNode.hxx"
 
 #include "DataFlowEditor_DataFlow.hxx"
+#include "DataFlowExecutor_DataFlow.hxx"
 
 // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL    
 //extern Engines_Container_i * _TheContainer ;
@@ -55,6 +56,7 @@ GraphExecutor::OutNode::OutNode() {
   _ControlState = SUPERV::VoidState ;
   _State = GraphExecutor::UnKnownState ;
   _PyInitialized = false ;
+  _run_func_thread = 0;
   pthread_mutex_init( &_MutexWait , NULL ) ;
   pthread_mutex_init( &_PyMutexWait , NULL ) ;
   if ( pthread_cond_init( &_EventWait , NULL ) ) {
@@ -96,6 +98,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
   _ControlState = SUPERV::VoidState ;
   _State = GraphExecutor::UnKnownState ;
   _PyInitialized = false ;
+  _run_func_thread = 0;
   _Orb = CORBA::ORB::_duplicate( ORB ) ;
   pthread_mutex_init( &_MutexWait , NULL ) ;
   pthread_mutex_init( &_PyMutexWait , NULL ) ;
@@ -159,6 +162,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
   _ControlState = SUPERV::VoidState ;
   _State = GraphExecutor::UnKnownState ;
   _PyInitialized = false ;
+  _run_func_thread = 0;
   _Orb = CORBA::ORB::_duplicate( ORB ) ;
   pthread_mutex_init( &_MutexWait , NULL ) ;
   pthread_mutex_init( &_PyMutexWait , NULL ) ;
@@ -519,6 +523,7 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
     _JustStarted = true ;
     RetVal = true ;
     int i ;
+    bool again = true ;
     for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
       GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->GraphNodes( i )->GetInNode() ;
       anInNode->OutNode( this ) ;
@@ -536,7 +541,12 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
       }
       anInNode->InitialState() ;
       if ( anInNode->IsOneOfInLineNodes() ) {
-        anInNode->InitPythonFunctions( false ) ;
+       //JR with Python2.3.4, we may get an error because of a normal previous error
+        bool sts = anInNode->InitPythonFunctions( false ) ;
+        if ( again && !sts ) {
+          sts = anInNode->InitPythonFunctions( false ) ;
+          again = false ;
+       }
       }
     }
 // One more time because inline nodes may share one definition of the same function
@@ -573,6 +583,9 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
       }
     }
     */
+    //JR Debug : if there was an error in initialisation of python functions,
+    //           we must not try to execute the graph.
+    if ( RetVal ) {
     if ( Graph()->GraphMacroLevel() != 0 ) {
       cdebug << "GraphExecutor::OutNode::Run Execution starting GraphExecutor::Action_DataOk_RunService Node "
              << Name() << " GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ;
@@ -700,6 +713,19 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
 //      Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
       RetVal = true ;
     }
+    //JR Debug
+    }
+    else {
+      State( GraphExecutor::ErroredState ) ;
+      Done( true ) ;
+      if ( IsDone() && Graph()->GraphMacroLevel() == 0 ) {
+        cdebug << " ==> theAutomaton->Executed() " << endl ;
+        theAutomaton->Executed() ;
+      }
+      else {
+        cdebug << " NO theAutomaton->Executed() " << endl ;
+      }
+    }
   }
   else {
 // PAL 8515
@@ -712,7 +738,7 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
 //              two graphs execution with two different python functions with the same name
 //              give aborted state for the second one
 //Example : GraphLoopSwitchOfSwitchNOTValid, GraphLoopSwitchs and GraphLoopSwitchsBranches
-    if ( IsDone() ) {
+    if ( IsDone() && Graph()->GraphMacroLevel() == 0 ) {
       cdebug << " ==> theAutomaton->Executed() " << endl ;
       theAutomaton->Executed() ;
     }
@@ -814,9 +840,33 @@ void GraphExecutor::OutNode::CheckAllDone() {
     MESSAGE("================================================================================") ;
     cdebug << "================================================================================" << endl ;
     cdebug << Name() << " IS DONE : " <<  theAutomaton->StateName( AutomatonState() ) << " EventQSize "
-             << EventQSize() << endl  ;
+            << EventQSize() << endl  ;
     cdebug << "================================================================================" << endl ;
 
+    if ( Graph()->GraphMacroLevel() != 0 ) {
+//JR NPAL14110 09.02.2007 : That must be done only at the end of SubGraph because we may
+//                          have an output of the SubGraph in a Loop !...
+//                          So that code must be done in CheckAllDone instead of OutParametersSet
+      cdebug << "CheckAllDone ToNodeName " << Name() << " CoupledNode "
+             << Graph()->CoupledNodeName() << Graph()->CoupledNode()
+             << endl ;
+      cdebug << "CheckAllDone GraphExecutor " << Graph()->CoupledNode()->GraphEditor()->Executor() << endl ;
+      const GraphBase::InPort * anInPort ;
+      GraphBase::OutPort * anOutPort ;
+      int i ;
+      for ( i = 0 ; i <  Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
+         anInPort = Graph()->GetNodeOutDataNodePort( i ) ;
+         if ( !anInPort->IsGate() ) {
+           anOutPort = anInPort->GetOutPort() ;
+           Graph()->CoupledNode()->GraphEditor()->Executor()->OutputOfAny( Graph()->CoupledNodeName() ,
+                                                                           anInPort->PortName() ,
+                                                                           anOutPort->Value() ) ;
+           cdebug << "CheckAllDone OutputOfAny( " << Graph()->CoupledNodeName() << " , "
+                  << anInPort->PortName() << " , value ) done" << endl ;
+         }
+      }
+    }
+
 //PAL8520
 //JR 23.02.2005, Debug : siftEvents() must be inside the pthread_mutex_lock
     if ( pthread_mutex_lock( &_MutexWait ) ) {
@@ -935,7 +985,8 @@ void GraphExecutor::OutNode::ExitThread( pthread_t ThreadNumber ) {
     cdebug << pthread_self() << " ExitThread( " << ThreadNumber << " ) " << _Threads
            << " running threads " << _SuspendedThreads << " suspended threads IsDone() "
            << IsDone() ;
-    if ( IsDone() ) {
+    _run_func_thread = 0 ; // mkr : IPAL14711
+    if ( IsDone() && Graph()->GraphMacroLevel() == 0 ) {
       cdebug << " ==> theAutomaton->Executed() " << endl ;
       theAutomaton->Executed() ;
     }
@@ -2122,6 +2173,11 @@ bool GraphExecutor::OutNode::DoneWait() {
     perror("pthread_mutex_lock _DoneWait") ;
     exit( 0 ) ;
   }
+  while ( _run_func_thread || theAutomaton->ThreadsNumber() ) {
+    // mkr : IPAL14711
+    // waiting for pthread_join in FiniteStateMachine
+  }
+  if ( Done() || IsKilled() ) Graph()->GraphEditor()->Editing(); // mkr : IPAL14572 : calling Editing() to indicate stop of execution
   cdebug_out << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Name()
              << " " << State() << " : " << aret << endl ;
   return aret ;
index 200d42b60120a3291512b1aa6150601e35eea23c..4a2a7da88744fcbf2bf39af1d147b503aa7f84e5 100644 (file)
@@ -70,6 +70,8 @@ namespace GraphExecutor {
       list< GraphExecutor::NodeEvent > _Events ;
       list< GraphExecutor::AutomatonState >   _States ;
 
+      pthread_t _run_func_thread ;
+
       bool Valid() ;
       void UnValid() ;
       bool Executable() ;
@@ -269,6 +271,8 @@ namespace GraphExecutor {
                                    const char *FromParameterName ) ;
       const long CpuUsed() ;
       const long CpuUsed( const char *aNodeName ) ;
+
+      void setRunFuncThread( pthread_t theThread ) { _run_func_thread = theThread; } ; // mkr : IPAL14711
   };
 };
 
index 9e5a35771b36918566e356d204008ba9fb6e15fe..fbb844039e11b407e5e1615867eaa533ddfc29be 100644 (file)
@@ -54,6 +54,15 @@ bool GraphExecutor::InNode::InitPython() {
     Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod ) ;
     // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL    
     //_OutNode->SuperVisionContainer()->ActivatePythonExecution( "InitPyRunMethod" , MethodPyRunMethod ) ;
+
+    // PAL10310: patch on omniORB
+    string aPyFunc;
+    aPyFunc = "import omnipatch\n" ;
+    if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
+      cdebug << ThreadNo() << " " << Name() << " PyRun_SimpleString ERROR " << endl << aPyFunc << endl ;
+      Automaton()->PyUnLock() ;
+      return false ;
+    }
   }
 //  PyObject * Dictionnary = PyModule_GetDict( Module ) ;
 //  InitPyDynInvokeError = PyErr_NewException( "InitPyDynInvokeError" , NULL , NULL ) ;
@@ -97,8 +106,9 @@ bool GraphExecutor::InNode::InitPython() {
     aPyFunc += "import sys\n" ;
     aPyFunc += "import CORBA\n" ;
     aPyFunc += "import omniORB\n" ;
+    aPyFunc += "orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
     aPyFunc += "def PyObjRef( IORObjStr ) :\n" ;
-    aPyFunc += "    orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
+    //    aPyFunc += "    orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
     aPyFunc += "    objref = orb.string_to_object( IORObjStr )\n" ;
     aPyFunc += "    return objref\n" ;
     aPyFunc += "InitPyRunMethod.RunMethod( PyObjRef )\n" ;
@@ -123,8 +133,9 @@ bool GraphExecutor::InNode::InitPython() {
     aPyFunc += "import sys\n" ;
     aPyFunc += "import CORBA\n" ;
     aPyFunc += "import omniORB\n" ;
+    aPyFunc += "orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
     aPyFunc += "def PyObjIor( ObjRef ) :\n" ;
-    aPyFunc += "    orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
+    //    aPyFunc += "    orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
     aPyFunc += "    objIor = orb.object_to_string( ObjRef )\n" ;
     aPyFunc += "    return objIor\n" ;
     aPyFunc += "InitPyRunMethod.RunMethod( PyObjIor )\n" ;
@@ -172,6 +183,19 @@ PyObject * GraphExecutor::InNode::InitPyDynInvoke( char * PyFuncName ,
   if ( strlen( PyFuncName ) ) {
     Automaton()->PyLock() ;
     thePyRunMethod = Automaton()->PyFunction( PyFuncName ) ;
+    
+    //thePyRunMethod = NULL; 
+    // asv 28.02.05 : VERY BAD fix of the following problem: after change of a function, 
+    // the changes are NOT taken into account by Automation - it returns PyObject of the OLD function.
+    // so here we force re-automating the PyObject EVERY TIME, regardless if the function has changed or not.
+    // Once again - it is a very bad solution, it fully discards the whole idea of automation,
+    // here is it done as a quick fix for a bug. 
+    // A better solution (to be implemented): store the PyObject NOT in Automation map, but in
+    // InLine node itself!  And if the method is changed - remove the PyObject and force to regenerate it.
+    // But this means that PyObject must be stored in Editor's data model.
+    // asv 01.03.05 : the fix is not needed, the described bug is not reproduced.  To investigate:
+    // WHERE PyObject is removed from Automation map on function change. 
+
     if ( (*aPythonFunction).length() ) {
       if ( thePyRunMethod == NULL ) {
        unsigned int i ;
@@ -239,7 +263,7 @@ extern "C" PyObject * PyRunMethod( PyObject * dummy , PyObject * Args ) {
   return Result ;
 }
 
-#define PyDynInvokeTrace 1
+#define PyDynInvokeTrace 0
 bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
                                         const char *method , 
                                         ServicesAnyData * InParametersList , int nInParams ,
@@ -275,9 +299,9 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
   PyObject * ArgsList = NULL ;
   PyObject * ArgValue = NULL ;
   PyObject * Result = NULL ;
-  PyObject * MyPyObjRefList = NULL ;
+  //PyObject * MyPyObjRefList = NULL ;
   PyObject * ResultObj = NULL ;
-  PyObject * MyPyObjIorList = NULL ;
+  //PyObject * MyPyObjIorList = NULL ;
   PyObject * ResultIor = NULL ;
 
   CORBA::Object_ptr ObjRef ;
@@ -296,7 +320,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
       sname = InParametersList[i].Name.c_str() ;
       switch ( data.type()->kind() ) {
       case CORBA::tk_string : {
-        char * t ;
+        const char * t ;
         data >>= t ;
         PyObject * ArgValue = Py_BuildValue( "s" , t ) ;
         PyTuple_SetItem( ArgsList , i , ArgValue ) ;
@@ -332,7 +356,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
         break ;
       }
       case CORBA::tk_short : {
-        short s ;
+        CORBA::Short s ;
         data >>= s ;
         PyObject * ArgValue = Py_BuildValue( "h" , s ) ;
         PyTuple_SetItem( ArgsList , i , ArgValue ) ;
@@ -344,9 +368,16 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
         break ;
       }
       case CORBA::tk_long : {
-        long l ;
+        CORBA::Long l ;
         data >>= l ;
-        PyObject * ArgValue = Py_BuildValue( "l" , l ) ;
+//      epa - Porting to 64-bit Linux:CORBA::Long is incorrectly treated as unsigned 
+//            integer by Py_BuildValue("l", val) in Python 2.4.1. Using Py_BuildValue("i",val) 
+//            seemsto help
+        PyObject * ArgValue = NULL;
+        if ( SIZEOF_LONG == 4 )
+           ArgValue = Py_BuildValue( "l" , l ) ;
+       else
+           ArgValue = Py_BuildValue( "i" , l ) ;
 #if PyDynInvokeTrace
         cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value " << l
                << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;
@@ -354,13 +385,13 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
         PyTuple_SetItem( ArgsList , i , ArgValue ) ;
 #if PyDynInvokeTrace
         cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value " << l
-               << " (long) ArgsList->ob_refcnt" << ArgsList->ob_refcnt << " ArgValue->ob_refcnt"
+               << " (CORBA::Long) ArgsList->ob_refcnt" << ArgsList->ob_refcnt << " ArgValue->ob_refcnt"
                << ArgValue->ob_refcnt << endl ;
 #endif
         break ;
       }
       case CORBA::tk_float : {
-        float f ;
+        CORBA::Float f ;
         data >>= f ;
         PyObject * ArgValue = Py_BuildValue( "f" , f ) ;
         PyTuple_SetItem( ArgsList , i , ArgValue ) ;
@@ -372,7 +403,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
         break ;
       }
       case CORBA::tk_double : {
-        double d ;
+        CORBA::Double d ;
         data >>= d ;
         PyObject * ArgValue = Py_BuildValue( "d" , d ) ;
         PyTuple_SetItem( ArgsList , i , ArgValue ) ;
@@ -384,27 +415,27 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
         break ;
       }
       case CORBA::tk_objref : {
-        MyPyObjRefList = PyTuple_New( 1 ) ;
-        PyObject * ObjValue ;
+        //MyPyObjRefList = PyTuple_New( 1 ) ;
+        //PyObject * ObjValue ;
 #if OMNIORB_VERSION >= 4
         data >>= (CORBA::Any::to_object ) ObjRef ;
 #else
         data >>= ObjRef ;
 #endif
         IORObjRef = ObjectToString( ObjRef ) ;
-        ObjValue = Py_BuildValue( "s" , IORObjRef ) ;
-        PyTuple_SetItem( MyPyObjRefList , 0 , ObjValue ) ;
+        //ObjValue = Py_BuildValue( "s" , IORObjRef ) ;
+        //PyTuple_SetItem( MyPyObjRefList , 0 , ObjValue ) ;
 #if PyDynInvokeTrace
-        cdebug << "ArgIn" << i << " : " << sname << " " << method << " " << " Value " << IORObjRef << " (objref) "
-               << MyPyObjRef->ob_refcnt << "/" << MyPyObjRefList->ob_refcnt << endl ;
+        cdebug << "ArgIn" << i << " : " << sname << " " << method << " " << " Value " << IORObjRef << " (objref) "<< endl ;
+       //             << MyPyObjRef->ob_refcnt << "/" << MyPyObjRefList->ob_refcnt << endl ;
 #endif
 //        ResultObj = PyEval_CallObject( MyPyObjRef , MyPyObjRefList ) ;
-        ResultObj = PyEvalCallObject( "PyObjRef" , MyPyObjRef , MyPyObjRefList ) ;
+         //ResultObj = PyEvalCallObject( "PyObjRef" , MyPyObjRef , MyPyObjRefList ) ;
 #if PyDynInvokeTrace
-        cdebug << "ObjValue->ob_refcnt" << ObjValue->ob_refcnt << endl ;
+         //cdebug << "ObjValue->ob_refcnt" << ObjValue->ob_refcnt << endl ;
 #endif
-        ArgValue = Py_BuildValue( "O" , ResultObj ) ;
-        PyTuple_SetItem( ArgsList , i , ArgValue ) ;
+         //ArgValue = Py_BuildValue( "O" , ResultObj ) ;
+         //PyTuple_SetItem( ArgsList , i , ArgValue ) ;
 #if PyDynInvokeTrace
        if ( ArgValue )
          cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value  (objref) ArgsList->ob_refcnt"
@@ -412,22 +443,33 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
        else
          cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value  (objref) ArgsList->ob_refcnt"
                 << ArgsList->ob_refcnt << " ArgValue is NULL" << endl ;
-        cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ;
-#endif
-        Py_DECREF( MyPyObjRefList ) ;
-        if ( CORBA::is_nil( ObjRef ) ) {
-          ResultObj = NULL ;
-        }
-        else {
-#if PyDynInvokeTrace
-         if ( ResultObj )
-           cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ;
-         else
-           cdebug << "ResultObj is NULL" << endl ;
-#endif
-         if ( ResultObj )
-           Py_DECREF( ResultObj ) ;
-        }
+        //cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ;
+#endif
+       ResultObj = PyObject_CallFunction( MyPyObjRef , "s",IORObjRef ) ;
+       if(ResultObj == NULL){
+         PyErr_Print();
+         ResultObj=Py_None;
+          Py_INCREF(ResultObj) ;
+       }
+        PyTuple_SetItem( ArgsList , i , ResultObj ) ;
+        cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value  (objref) ArgsList->ob_refcnt"
+              << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ResultObj->ob_refcnt << endl ;
+//       << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;
+        //cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ;
+        //Py_DECREF( MyPyObjRefList ) ;
+        //if ( CORBA::is_nil( ObjRef ) ) {
+        //  ResultObj = NULL ;
+        //}
+        //else {
+       //#if PyDynInvokeTrace
+       //if ( ResultObj )
+       //cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ;
+       //else
+       //cdebug << "ResultObj is NULL" << endl ;
+       //#endif
+       //if ( ResultObj )
+       //Py_DECREF( ResultObj ) ;
+        //}
         break ;
       }
       default : {
@@ -446,6 +488,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
     if ( Result == NULL ) {
       cdebug_out << "GraphExecutor::InNode::PyDynInvoke Node " << Name() << " " << method << " Error Result == NULL"
                  << endl ;
+      PyErr_Print();
       RetVal = false ;
     }
     else {
@@ -462,7 +505,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
           else {
             ArgValue = Result ;
          }
-          if ( !PyString_Check( ArgValue ) ) {
+          if ( !ArgValue || !PyString_Check( ArgValue ) ) {
             cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (string)" << endl ;
             RetVal = false ;
          }
@@ -471,9 +514,10 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
          }
           data <<= t ;
 #if PyDynInvokeTrace
-          cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << t << " (string)"
-                 << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
-                 << ArgValue->ob_refcnt << endl ;
+         if ( ArgValue )
+           cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << t << " (string)"
+                  << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+                  << ArgValue->ob_refcnt << endl ;
 #endif
           break ;
         }
@@ -486,7 +530,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
           else {
             ArgValue = Result ;
          }
-          if ( !PyInt_Check( ArgValue ) ) {
+          if ( !ArgValue || !PyInt_Check( ArgValue ) ) {
             cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (boolean)" << endl ;
             RetVal = false ;
          }
@@ -495,9 +539,10 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
          }
           data <<= (CORBA::Any::from_boolean ) b ;
 #if PyDynInvokeTrace
-          cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << b << " (boolean)"
-                 << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
-                 << ArgValue->ob_refcnt << endl ;
+         if ( ArgValue )
+           cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << b << " (boolean)"
+                  << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+                  << ArgValue->ob_refcnt << endl ;
 #endif
           break ;
         }
@@ -513,7 +558,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
 //JR 04.04.2005 Debug          if ( !PyInt_Check( ArgValue ) ) {
 //Difficult to understand that behavior ... Python char type is a string of length 1 !
 //                                          or type is int ...
-          if ( !PyString_Check( ArgValue ) && !PyInt_Check( ArgValue ) ) {
+          if ( !ArgValue || !PyString_Check( ArgValue ) && !PyInt_Check( ArgValue ) ) {
             cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (char)" << endl ;
             RetVal = false ;
          }
@@ -522,9 +567,10 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
          }
           data <<= (CORBA::Any::from_char ) c ;
 #if PyDynInvokeTrace
-          cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << c << " (char)"
-                 << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
-                 << ArgValue->ob_refcnt << endl ;
+         if ( ArgValue )
+           cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << c << " (char)"
+                  << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+                  << ArgValue->ob_refcnt << endl ;
 #endif
           break ;
         }
@@ -537,7 +583,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
           else {
             ArgValue = Result ;
          }
-          if ( !PyInt_Check( ArgValue ) ) {
+          if ( !ArgValue || !PyInt_Check( ArgValue ) ) {
             cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (short)" << endl ;
             RetVal = false ;
          }
@@ -546,14 +592,15 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
          }
           data <<= s ;
 #if PyDynInvokeTrace
-          cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << s << " (short)"
-                 << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
-                 << ArgValue->ob_refcnt << endl ;
+         if ( ArgValue )
+           cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << s << " (short)"
+                  << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+                  << ArgValue->ob_refcnt << endl ;
 #endif
           break ;
         }
         case CORBA::tk_long : {
-          long l = 0 ;
+          CORBA::Long l = 0 ;
           PyObject * ArgValue ;
           if ( PyTuple_Check( Result ) ) {
             ArgValue = PyTuple_GetItem( Result , i ) ;
@@ -561,10 +608,10 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
           else {
             ArgValue = Result ;
          }
-          if ( PyLong_Check( ArgValue ) ) {
+          if ( ArgValue && PyLong_Check( ArgValue ) ) {
             l = PyLong_AsLong( ArgValue ) ;
          }
-          else if ( PyInt_Check( ArgValue ) ) {
+          else if ( ArgValue && PyInt_Check( ArgValue ) ) {
             l = PyInt_AsLong( ArgValue ) ;
          }
           else {
@@ -573,9 +620,10 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
          }
           data <<= l ;
 #if PyDynInvokeTrace
-          cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << l << " (long)"
-                 << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
-                 << ArgValue->ob_refcnt << endl ;
+         if ( ArgValue )
+           cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << l << " (CORBA::Long)"
+                  << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+                  << ArgValue->ob_refcnt << endl ;
 #endif
           break ;
         }
@@ -588,35 +636,43 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
           else {
             ArgValue = Result ;
          }
-          if ( !PyFloat_Check( ArgValue ) ) {
-           // mkr : bug PAL12454
-           if ( PyLong_Check( ArgValue ) ) {
-             cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (long)" << endl ;
-             long l = PyLong_AsLong( ArgValue );
-             f = (float) l;
-           }
-           else if ( PyInt_Check( ArgValue ) ) {
-             cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (int)" << endl ;
-             long l = PyInt_AsLong( ArgValue );
-             f = (float) l;
+         if ( ArgValue ) {
+           if ( !PyFloat_Check( ArgValue ) ) {
+             // mkr : bug PAL12454
+             if ( PyLong_Check( ArgValue ) ) {
+               cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (CORBA::Long)" << endl ;
+               CORBA::Long l = PyLong_AsLong( ArgValue );
+               f = (float) l;
+             }
+             else if ( PyInt_Check( ArgValue ) ) {
+               cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (int)" << endl ;
+               CORBA::Long l = PyInt_AsLong( ArgValue );
+               f = (float) l;
+             }
+             else {
+               cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
+               RetVal = false ;
+             }
            }
            else {
-             cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
-             RetVal = false ;
+             f = PyFloat_AsDouble( ArgValue ) ;
            }
          }
-          else {
-            f = PyFloat_AsDouble( ArgValue ) ;
+         else {
+           cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
+           RetVal = false ;
          }
 #ifdef REDHAT // mkr : debug for PAL12255
           data <<= f ;
 #else
-         data.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+//JR     data.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+          data <<= (CORBA::Float) f ;
 #endif
 #if PyDynInvokeTrace
-          cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << f << " (float)"
-                 << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
-                 << ArgValue->ob_refcnt << endl ;
+         if ( ArgValue )
+           cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << f << " (float)"
+                  << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+                  << ArgValue->ob_refcnt << endl ;
 #endif
           break ;
         }
@@ -629,41 +685,49 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
           else {
             ArgValue = Result ;
          }
-          if ( !PyFloat_Check( ArgValue ) ) {
-           // mkr : bug PAL12454
-           if ( PyLong_Check( ArgValue ) ) {
-             cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (long)" << endl ;
-             long l = PyLong_AsLong( ArgValue );
-             d = (double) l;
-           }
-           else if ( PyInt_Check( ArgValue ) ) {
-             cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (int)" << endl ;
-             long l = PyInt_AsLong( ArgValue );
-             d = (double) l;
+         if ( ArgValue ) {
+           if ( !PyFloat_Check( ArgValue ) ) {
+             // mkr : bug PAL12454
+             if ( PyLong_Check( ArgValue ) ) {
+               cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (CORBA::Long)" << endl ;
+               CORBA::Long l = PyLong_AsLong( ArgValue );
+               d = (double) l;
+             }
+             else if ( PyInt_Check( ArgValue ) ) {
+               cdebug << "ArgOut" << i << " : " << sname << " " << method << " OK (int)" << endl ;
+               CORBA::Long l = PyInt_AsLong( ArgValue );
+               d = (double) l;
+             }
+             else {
+               cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
+               RetVal = false ;
+             }
            }
            else {
-             cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
-             RetVal = false ;
+             d = PyFloat_AsDouble( ArgValue ) ;
            }
          }
-          else {
-            d = PyFloat_AsDouble( ArgValue ) ;
+         else {
+           cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (float)" << endl ;
+           RetVal = false ;
          }
 #ifdef REDHAT // mkr : debug for PAL12255
           data <<= d ;
 #else
-         data.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+//JR     data.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+          data <<= (CORBA::Double) d ;
 #endif
 #if PyDynInvokeTrace
-          cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << d << " (double)"
-                 << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
-                 << ArgValue->ob_refcnt << endl ;
+         if ( ArgValue )
+           cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << d << " (double)"
+                  << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
+                  << ArgValue->ob_refcnt << endl ;
 #endif
           break ;
         }
         case CORBA::tk_objref : {
           PyObject * ObjIor ;
-          MyPyObjIorList = PyTuple_New( 1 ) ;
+          //MyPyObjIorList = PyTuple_New( 1 ) ;
           if ( PyTuple_Check( Result ) ) {
             ObjIor = PyTuple_GetItem( Result , i ) ;
          }
@@ -671,25 +735,28 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
             ObjIor = Result ;
          }
 #if PyDynInvokeTrace
-          cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << "(object reference) "
-                 << " Result->ob_refcnt" << Result->ob_refcnt << " ObjIor->ob_refcnt"
-                 << ObjIor->ob_refcnt << endl ;
+         if ( ObjIor )
+           cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << "(object reference) "
+                  << " Result->ob_refcnt" << Result->ob_refcnt << " ObjIor->ob_refcnt"
+                  << ObjIor->ob_refcnt << endl ;
 #endif
-          Py_INCREF( ObjIor ) ;
+          //Py_INCREF( ObjIor ) ;
 //          PyObject_Print( ObjIor , stdout , 0 ) ;
-          PyTuple_SetItem( MyPyObjIorList , 0 , ObjIor ) ;
+          //PyTuple_SetItem( MyPyObjIorList , 0 , ObjIor ) ;
 //          ResultIor = PyEval_CallObject( MyPyObjIor , MyPyObjIorList ) ;
-          ResultIor = PyEvalCallObject( "PyObjIor" , MyPyObjIor , MyPyObjIorList ) ;
+          //ResultIor = PyEvalCallObject( "PyObjIor" , MyPyObjIor , MyPyObjIorList ) ;
+         ResultIor = PyObject_CallFunction( MyPyObjIor , "O",ObjIor ) ;
 #if PyDynInvokeTrace
-          cdebug << "ObjIor->ob_refcnt " << ObjIor->ob_refcnt-1 << endl ;
+         if ( ObjIor )
+           cdebug << "ObjIor->ob_refcnt " << ObjIor->ob_refcnt-1 << endl ;
 #endif
-          Py_DECREF( ObjIor ) ;
+          //Py_DECREF( ObjIor ) ;
 #if PyDynInvokeTrace
-          cdebug << "MyPyObjIorList->ob_refcnt " << MyPyObjIorList->ob_refcnt-1 << endl ;
+          //cdebug << "MyPyObjIorList->ob_refcnt " << MyPyObjIorList->ob_refcnt-1 << endl ;
 #endif
-          Py_DECREF( MyPyObjIorList ) ;
+          //Py_DECREF( MyPyObjIorList ) ;
 #if PyDynInvokeTrace
-          cdebug << "MyPyObjIor->ob_refcnt " << MyPyObjIor->ob_refcnt << endl ;
+          //cdebug << "MyPyObjIor->ob_refcnt " << MyPyObjIor->ob_refcnt << endl ;
 #endif
           if ( ResultIor ) {
             char * IOR = NULL ;
@@ -756,6 +823,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
            }
          }
           else {
+           PyErr_Print();
             cdebug_out << "GraphExecutor::InNode::PyDynInvoke Error ResultIor == NULL Node "
                        << Name() << " method " << method << " " << endl ;
             RetVal = false ;
@@ -823,6 +891,9 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
     Py_DECREF( ArgsList ) ;
   }
 
+  fflush(stdout);
+  fflush(stderr);
+
 #if 0
   {
     int i ;
index 1d5776561719ccbc2d928c6864a8c43d31cd0a67..81151cb65e242e71d842ced837347a13b887f976 100644 (file)
@@ -63,8 +63,7 @@ LIB_CLIENT_IDL = SALOME_ModuleCatalog.idl \
 BIN_SRC = 
 BIN_SERVER_IDL = 
 
-CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) \
-       $(KERNEL_CXXFLAGS)
+CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(OCC_INCLUDES) $(KERNEL_CXXFLAGS)
 CXXFLAGS+= -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \
        $(KERNEL_CXXFLAGS)
 
@@ -73,8 +72,7 @@ ifeq ($(OS),REDHAT)
 endif
 
 LDFLAGS+= -export-dynamic -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lSalomeSuperVisionEditor -lOpUtil -lSALOMELocalTrace\
-       -lc $(QT_MT_LIBS) $(OGL_LIBS) \
-       $(KERNEL_LDFLAGS)
+       -lc $(QT_MT_LIBS) $(KERNEL_LDFLAGS)
 #LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS)
 
 
index d31285fe16a2317f137db9169b868519944adfda..f600625a710dbf7ab67853c58c8d63dfb0228c0f 100644 (file)
@@ -31,6 +31,10 @@ VPATH=.:@srcdir@
 
 @COMMENCE@
 
-SUBDIRS = GraphBase GraphEditor GraphExecutor Supervision SUPERVGUI
+SUBDIRS = GraphBase GraphEditor GraphExecutor Supervision
+ifeq (@WITHIHM@,yes)
+  SUBDIRS+= SUPERVGUI
+endif
+
 
 @MODULE@
index feb934f71f4218f105f270e5016ea833a46cfbb8..aced7fee3dae189f5d4a204c08d1993f7f734417 100644 (file)
@@ -164,9 +164,9 @@ void SUPERVGUI::initialize( CAM_Application* app )
   createSupervAction( 309, "ADDNODE"       , "ICO_ADDNODE" );
   createSupervAction( 310, "STEPBYSTEP"    , "ICO_STEPBYSTEP" );
 
-  createSupervAction( 311, "POP_RENAME" );
+  createSupervAction( 311, "POP_RENAME", "", Key_F2 );
   createSupervAction( 312, "POP_DISPLAY" );
-  createSupervAction( 313, "POP_DELETE" );
+  createSupervAction( 313, "POP_DELETE", "", Key_Delete );
 
   // ----- create menu -----------------
   int fileId = createMenu( tr( "MEN_FILE" ), -1, -1 );
@@ -455,65 +455,76 @@ void SUPERVGUI::setMain( SUIT_ViewWindow* w) {
 }
 
 void SUPERVGUI::displayDataflow() {
-    Trace("SUPERVGUI::displayDataflow");
-    OB_Browser* aBrowser = (( SalomeApp_Application* )application())->objectBrowser();
-    SUPERV_Graph aDataFlow;
-    QString aIORName;
-
-    OB_ListItem* item = (OB_ListItem*)(aBrowser->listView()->currentItem());
-    _PTR(SObject) aObj
-      ( (( SalomeApp_Study* )(application()->activeStudy()))->studyDS()->FindObjectID(item->text(2).latin1()) );
-    _PTR(GenericAttribute) anAttr;
-    if (aObj->FindAttribute(anAttr, "AttributeIOR")) {
-      _PTR(AttributeIOR) anIOR ( anAttr );
-      aIORName = QString(anIOR->Value().c_str());
-      if (isContains(study, aIORName)) {
-        if (QMessageBox::warning(application()->desktop(), tr("WARNING"),
-                                 tr("MSG_GRAPH_DISPLAYED").arg(""),
-                                 QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
-          return;
-      }
-      //aDataFlow = engine->getStreamGraph(anIOR->Value().c_str());
-      aDataFlow = engine->getGraph(anIOR->Value().c_str());
-      if (SUPERV_isNull(aDataFlow)) {
-        QMessageBox::warning(0, tr("ERROR"), tr("MSG_ACCESS_BAD_IOR"));
+  Trace("SUPERVGUI::displayDataflow");
+
+  OB_Browser* aBrowser = getApp()->objectBrowser();
+  OB_ListItem* item = (OB_ListItem*)(aBrowser->listView()->currentItem());
+
+  SalomeApp_Study* anAppStudy = (SalomeApp_Study*)(getApp()->activeStudy());
+  _PTR(SObject) aObj (anAppStudy->studyDS()->FindObjectID(item->text(2).latin1()));
+
+  SUPERV_Graph aDataFlow;
+  QString aIORName;
+
+  _PTR(GenericAttribute) anAttr;
+  if (aObj->FindAttribute(anAttr, "AttributeIOR")) {
+    _PTR(AttributeIOR) anIOR ( anAttr );
+    aIORName = QString(anIOR->Value().c_str());
+    if (isContains(study, aIORName)) {
+      if (QMessageBox::warning(application()->desktop(), tr("WARNING"),
+                               tr("MSG_GRAPH_DISPLAYED").arg(""),
+                               QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
         return;
-      }
-      /* ASV: 20.10.04: fix for 6896
-      if (aDataFlow->IsStreamGraph()) {
-        SUPERV_StreamGraph aDataFlowStream = aDataFlow->ToStreamGraph();
-        if (SUPERV_isNull(aDataFlowStream)) {
-          QMessageBox::warning(0, tr("ERROR"), tr("MSG_ACCESS_BAD_IOR"));
-          return;
-        }
-        aDataFlow = aDataFlowStream;
-      }
-      */
     }
 
-    SUPERVGraph_ViewFrame* aViewFrame;
-    if ( !myInitialViewFrame ) {
-      // first case : create a ViewFrame object
-      aViewFrame = dynamic_cast<SUPERVGraph_ViewFrame*>( createGraph() );
-    }
-    else {
-      // second case : get empty initial view frame as new ViewFrame object
-      aViewFrame = myInitialViewFrame;
-      // mkr : PAL8237 : remove first "gag" Main from children
-      // srn: commented as it cases on application exit "X Windows error"
-      //aViewFrame->removeChild( aViewFrame->queryList("SUPERVGUI_Main")->first() );
+    //SUPERV_Graph aDataFlow = engine->getStreamGraph(anIOR->Value().c_str());
+    aDataFlow = engine->getGraph(anIOR->Value().c_str());
+    if (SUPERV_isNull(aDataFlow)) {
+      QMessageBox::warning(0, tr("ERROR"), tr("MSG_ACCESS_BAD_IOR"));
+      return;
     }
 
-    if( aViewFrame ) {
-      main = new SUPERVGUI_Main( aViewFrame, application()->desktop(), aDataFlow );
-      registerGraph( aIORName, main );
-      aViewFrame->show();
+    /* ASV: 20.10.04: fix for 6896
+    if (aDataFlow->IsStreamGraph()) {
+      SUPERV_StreamGraph aDataFlowStream = aDataFlow->ToStreamGraph();
+      if (SUPERV_isNull(aDataFlowStream)) {
+        QMessageBox::warning(0, tr("ERROR"), tr("MSG_ACCESS_BAD_IOR"));
+        return;
+      }
+      aDataFlow = aDataFlowStream;
     }
+    */
+  }
 
-    if ( myInitialViewFrame ) {
-      myInitialViewFrame = 0;
-      myIVFBackgroundColor = QColor();
-    }
+  SUPERVGraph_ViewFrame* aViewFrame;
+  if ( !myInitialViewFrame ) {
+    // first case : create a ViewFrame object
+    aViewFrame = dynamic_cast<SUPERVGraph_ViewFrame*>( createGraph() );
+  }
+  else {
+    // second case : get empty initial view frame as new ViewFrame object
+    aViewFrame = myInitialViewFrame;
+    // mkr : IPAL12991 -->
+    SUPERVGraph_View* view = myInitialViewFrame->getViewWidget();
+    if (view)
+      unregisterGraph(dynamic_cast<SUPERVGUI_Main*>(view));
+    // mkr : IPAL12991 <--
+    // mkr : PAL8237 : remove first "gag" Main from children
+    // srn: commented as it cases on application exit "X Windows error"
+    //aViewFrame->removeChild( aViewFrame->queryList("SUPERVGUI_Main")->first() );
+    delete view;
+  }
+
+  if ( aViewFrame ) {
+    main = new SUPERVGUI_Main( aViewFrame, application()->desktop(), aDataFlow );
+    registerGraph( aIORName, main );
+    aViewFrame->show();
+  }
+
+  if ( myInitialViewFrame ) {
+    myInitialViewFrame = 0;
+    myIVFBackgroundColor = QColor();
+  }
 }
 
 
@@ -562,8 +573,12 @@ void SUPERVGUI::renameDataflow() {
                 if ( !SUPERV_isNull(aStreamDataFlow) )
                   aStreamDataFlow->SetName( nm.latin1() );
               }
-              else
+              else {
                 aDataFlow->SetName( nm.latin1() );
+              }
+
+              // update "Save" icon and menu state, if dataflow is published
+              SUPERVGUI_Main::setModifiedFlag();  
             }
           }
          // mkr : PAL7037 <--
@@ -707,6 +722,13 @@ bool SUPERVGUI::createDataflow( const NEW_DF_MODE mode, bool theInitialDF ) {
   else {
     // 2. get empty initial view frame as new ViewFrame object
     aViewFrame = myInitialViewFrame;
+    // mkr : IPAL12991 -->
+    if ( myInitialViewFrame ) {
+      SUPERVGraph_View* view = myInitialViewFrame->getViewWidget();
+      if (view)
+       unregisterGraph(dynamic_cast<SUPERVGUI_Main*>(view));
+    }
+    // mkr : IPAL12991 <--
     // mkr : PAL8237 : remove first "gag" Main from children
     // srn: commented as it cases on application exit "X Windows error"
     //aViewFrame->removeChild( aViewFrame->queryList("SUPERVGUI_Main")->first() );
@@ -904,7 +926,7 @@ void SUPERVGUI::deleteObject() {
   if (QMessageBox::warning(application()->desktop(),
                            tr("WARNING"),
                            tr("MSG_ASK_DELETE"),
-                           QMessageBox::No, QMessageBox::Yes) != QMessageBox::Yes)
+                           QMessageBox::Yes, QMessageBox::No) != QMessageBox::Yes)
     return;
 
   SALOME_ListIteratorOfListIO It( aList );
@@ -1039,12 +1061,8 @@ void SUPERVGUI::fillInterfaceNameMap() {
       //get component
       SALOME_ModuleCatalog::Acomponent_ptr aComponent = (*aModuleCatalog)->GetComponent(aCompList[ind1]);
       if ( aComponent != NULL ) {
-        //get interface list
-        SALOME_ModuleCatalog::ListOfInterfaces_var anIntList = aComponent->GetInterfaceList();
-        for (int ind2 = 0; ind2 < anIntList->length(); ind2++) {
-          const char* anIntName = anIntList[ind2];
-          myInterfaceNameMap.insert(QString(anIntName), QString(aComponent->componentname()));
-        }
+       // mkr : PAL13135
+       myInterfaceNameMap.insert(QString(aComponent->componentusername()), QString(aComponent->componentname()));
       }
     }
   }
index 9b15978c01617f84f502ac871733650b3209bd6d..da2af8a0ffc6f42d7303051a9f0bff4fa40796ec 100644 (file)
@@ -193,8 +193,7 @@ void SUPERVGUI_ArrayView::contentsMouseMoveEvent(QMouseEvent* theEvent) {
 
   // QToolTip for title and label for SUPERVGUI_CanvasCellNode
   SUPERVGUI_ToolTip* aTT = new SUPERVGUI_ToolTip(this);
-  QPoint aPoint1 = inverseWorldMatrix().map(theEvent->pos());
-  aTT->maybeTip(aPoint1);
+  aTT->maybeTip(theEvent->pos());
 }
 
 void SUPERVGUI_ArrayView::contentsMouseReleaseEvent(QMouseEvent* theEvent) {
@@ -205,67 +204,133 @@ void SUPERVGUI_ArrayView::contentsMouseReleaseEvent(QMouseEvent* theEvent) {
   }
 }
 
-void SUPERVGUI_ToolTip::maybeTip(const QPoint& theP) {
-  // compute collision rectangle
-  QRect aSel(theP.x()-MARGIN, theP.y()-MARGIN, 1+2*MARGIN, 1+2*MARGIN);
+void SUPERVGUI_ToolTip::maybeTip(const QPoint& thePos) {
+  // mkr : 23.11.2006 - PAL13957 - modifications for correct tooltips displaying after scroll or zoom
+  QPoint theP = ((QCanvasView*)parentWidget())->inverseWorldMatrix().map(thePos);
+
+  int avX, avY;
+  ((QCanvasView*)parentWidget())->contentsToViewport(theP.x(), theP.y(), avX, avY);
+  QPoint avP(avX, avY);
 
-  QCanvasItemList l = ((QCanvasView*)parentWidget())->canvas()->collisions(aSel);
-  for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
+  QWMatrix aWM = ((QCanvasView*)parentWidget())->worldMatrix();
+  
+  // compute collision rectangle for nodes, ports
+  QRect aNodeSel(theP.x()-MARGIN, theP.y()-MARGIN, 1+2*MARGIN, 1+2*MARGIN);
+
+  QCanvasItemList lN = ((QCanvasView*)parentWidget())->canvas()->collisions(aNodeSel);
+  for (QCanvasItemList::Iterator it = lN.begin(); it != lN.end(); ++it)
+  {
     // tooltip for node
-    if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Node) {
+    if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Node)
+    {
       SUPERVGUI_CanvasNodePrs* aNodePrs = (SUPERVGUI_CanvasNodePrs*) (*it);
       QObject* anObj = aNodePrs->getObject(theP);
-      if (anObj->inherits("SUPERVGUI_CanvasNode")) {
-       
+      if (anObj->inherits("SUPERVGUI_CanvasNode"))
+      {
        QRect aTitleRect = aNodePrs->getTitleRect();
        QRect aLabelRect = aNodePrs->getLabelRect();
        QRect aStatusRect = aNodePrs->getStatusRect();
 
        if (aTitleRect.bottom()+1 == aLabelRect.top() &&
-           aLabelRect.bottom()+1 == aStatusRect.top()) {
-         QRect aTipRect(aTitleRect.left(), aTitleRect.top(), aTitleRect.width(),
-                        aTitleRect.height() + aLabelRect.height() + aStatusRect.height());
-         tip(aTipRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
+           aLabelRect.bottom()+1 == aStatusRect.top())
+       {
+         ((QCanvasView*)parentWidget())->contentsToViewport((int)(aTitleRect.left()*aWM.m11()), 
+                                                            (int)(aTitleRect.top()*aWM.m22()), 
+                                                            avX, avY);
+         QRect avTipRect(avX, avY,
+                         (int)(aTitleRect.width()*aWM.m11()),
+                         (int)((aTitleRect.height() + aLabelRect.height() + aStatusRect.height())*aWM.m22()));
+         tip(avTipRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
          return;
        }
 
-       if (aTitleRect.contains(theP, true)) {
-         tip(aTitleRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
+       if (aTitleRect.contains(theP, true))
+       {
+         ((QCanvasView*)parentWidget())->contentsToViewport((int)(aTitleRect.left()*aWM.m11()), 
+                                                            (int)(aTitleRect.top()*aWM.m22()), 
+                                                            avX, avY);
+         QRect avTipRect(avX, avY, 
+                         (int)(aTitleRect.width()*aWM.m11()), (int)(aTitleRect.height()*aWM.m22()));
+         tip(avTipRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
          return;
        }
 
-       if (aLabelRect.contains(theP, true)) {
-         tip(aLabelRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
+       if (aLabelRect.contains(theP, true))
+       {
+         ((QCanvasView*)parentWidget())->contentsToViewport((int)(aLabelRect.left()*aWM.m11()), 
+                                                            (int)(aLabelRect.top()*aWM.m22()), 
+                                                            avX, avY);
+         QRect avTipRect(avX, avY, 
+                         (int)(aLabelRect.width()*aWM.m11()), (int)(aLabelRect.height()*aWM.m22()));
+         tip(avTipRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
          return;
        }
 
-       if (aStatusRect.contains(theP, true)) {
-         tip(aStatusRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
+       if (aStatusRect.contains(theP, true))
+       {
+         ((QCanvasView*)parentWidget())->contentsToViewport((int)(aStatusRect.left()*aWM.m11()), 
+                                                            (int)(aStatusRect.top()*aWM.m22()), 
+                                                            avX, avY);
+         QRect avTipRect(avX, avY, 
+                         (int)(aStatusRect.width()*aWM.m11()), (int)(aStatusRect.height()*aWM.m22()));
+         tip(avTipRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
          return;
        }
        
       }
       // tooltip for nodes' port
-      if (anObj->inherits("SUPERVGUI_CanvasPort")) {
+      if (anObj->inherits("SUPERVGUI_CanvasPort"))
+      {
        SUPERVGUI_CanvasPort* aPort = (SUPERVGUI_CanvasPort*)anObj;
-       tip(aPort->getPrs()->getPortRect(), 
-           aPort->getEngine()->Type() + QString(" ") + aPort->getPrs()->getText());
+       QRect aPortRect = aPort->getPrs()->getPortRect();
+       ((QCanvasView*)parentWidget())->contentsToViewport((int)(aPortRect.left()*aWM.m11()), 
+                                                          (int)(aPortRect.top()*aWM.m22()), 
+                                                          avX, avY);
+       QRect avTipRect(avX, avY, 
+                       (int)(aPortRect.width()*aWM.m11()), (int)(aPortRect.height()*aWM.m22()));
+       tip(avTipRect, aPort->getEngine()->Type() + QString(" ") + aPort->getPrs()->getText());
        return;
       }
     }
+  }
+
+  // compute collision rectangle for links
+  QRect aLinkSel((int)( theP.x() + (theP.x()-avP.x())/aWM.m11() ) - MARGIN, 
+                (int)( theP.y() + (theP.y()-avP.y())/aWM.m22() ) - MARGIN, 
+                1+2*MARGIN, 1+2*MARGIN);
+
+  QCanvasItemList lL = ((QCanvasView*)parentWidget())->canvas()->collisions(aLinkSel);
+  for (QCanvasItemList::Iterator it = lL.begin(); it != lL.end(); ++it)
+  {
     // tootip for links' point
-    if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_LinkPoint) {
-       SUPERVGUI_CanvasPointPrs* aPrs = (SUPERVGUI_CanvasPointPrs*) (*it);
-       if (aPrs->getLink()->getMain()->getViewType() == CANVAS)
-         tip(aSel, aPrs->getLink()->getToolTipText());
-       return;
+    if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_LinkPoint)
+    {
+      SUPERVGUI_CanvasPointPrs* aPrs = (SUPERVGUI_CanvasPointPrs*) (*it);
+      if (aPrs->getLink()->getMain()->getViewType() == CANVAS)
+      {
+       ((QCanvasView*)parentWidget())->contentsToViewport((int)(aLinkSel.left()*aWM.m11()), 
+                                                          (int)(aLinkSel.top()*aWM.m22()), 
+                                                          avX, avY);
+       QRect avTipRect(avX, avY, 
+                       (int)(aLinkSel.width()*aWM.m11()), (int)(aLinkSel.height()*aWM.m22()));
+       tip(avTipRect, aPrs->getLink()->getToolTipText());
+      }
+      return;
     }
     // tooltip for links' edge
-    if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_LinkEdge) {
-       SUPERVGUI_CanvasEdgePrs* aPrs = (SUPERVGUI_CanvasEdgePrs*) (*it);
-       if (aPrs->getLink()->getMain()->getViewType() == CANVAS)
-         tip(aSel, aPrs->getLink()->getToolTipText());
-       return;
+    if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_LinkEdge)
+    {
+      SUPERVGUI_CanvasEdgePrs* aPrs = (SUPERVGUI_CanvasEdgePrs*) (*it);
+      if (aPrs->getLink()->getMain()->getViewType() == CANVAS)
+      {
+       ((QCanvasView*)parentWidget())->contentsToViewport((int)(aLinkSel.left()*aWM.m11()), 
+                                                          (int)(aLinkSel.top()*aWM.m22()), 
+                                                          avX, avY);
+       QRect avTipRect(avX, avY, 
+                       (int)(aLinkSel.width()*aWM.m11()), (int)(aLinkSel.height()*aWM.m22()));
+       tip(avTipRect, aPrs->getLink()->getToolTipText());
+      }
+      return;
     }
-  }
+  }  
 }
index a50fe23ce2ccaa3568f0d2040d6df841eb5005a4..5969c3923b921e34d07ed94b90a48f5ceaa9bc18 100644 (file)
@@ -302,7 +302,88 @@ void SUPERVGUI_BrowseNodeDlg::onFieldActivated()
   myActiveField = (aField->isEditable())? aField : 0;
 }
 
+namespace {
+
+  QString getIORfromIO (const Handle(SALOME_InteractiveObject)& theIO,
+                        SUPERVGUI * theModule)
+  {
+    QString ior ("");
+    if (!theIO->hasEntry()) return ior;
+
+    SalomeApp_Study* anAppStudy = dynamic_cast<SalomeApp_Study*>(theModule->getActiveStudy());
+    _PTR(SObject) aSObj (anAppStudy->studyDS()->FindObjectID(theIO->getEntry()));
+
+    _PTR(GenericAttribute) anAttr;
+    if (aSObj->FindAttribute(anAttr, "AttributeIOR")) {
+      _PTR(AttributeIOR) anIOR (anAttr);
+      ior = anIOR->Value().c_str();
+      return ior;
+    }
 
+    // old code, it is useless, because <aSSObj->GetObject()> here will be NULL
+    // (because it is retrieved from <aSSObj> by stored IOR)
+    /*
+      SALOMEDS_Study* aSStudy = dynamic_cast<SALOMEDS_Study*>( aSObj->GetStudy().get() );
+      SALOMEDS_SObject* aSSObj = dynamic_cast<SALOMEDS_SObject*>( aSObj.get() );
+      if ( aSStudy && aSSObj )
+      ior = aSStudy->ConvertObjectToIOR( aSSObj->GetObject() ).c_str();
+    //*/
+
+    // new code
+
+    // default value: null IOR (IOR:01000000010000000000...)
+    SalomeApp_Application* anApp = theModule->getApp();
+    CORBA::Object_var aNullObj;
+    ior = anApp->orb()->object_to_string(aNullObj);
+
+    // try to load a component data from an opened (presumably) study
+    _PTR(SComponent) aSComp = aSObj->GetFatherComponent();
+    std::string aCompIOR;
+    if (!aSComp->ComponentIOR(aCompIOR)) {
+      std::string aCompDataType = aSComp->ComponentDataType();
+
+      // obtain a driver by a component data type
+      // like it is done in SALOMEDS_DriverFactory_i::GetDriverByType
+      SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_nil();
+      SALOME_LifeCycleCORBA * LCC = anApp->lcc();
+      try {
+        CORBA::Object_var
+          anEngineObj = LCC->FindOrLoad_Component("FactoryServer", aCompDataType.c_str());
+        if (CORBA::is_nil(anEngineObj))
+          anEngineObj = LCC->FindOrLoad_Component("FactoryServerPy", aCompDataType.c_str());
+
+        if (!CORBA::is_nil(anEngineObj))
+          anEngine = SALOMEDS::Driver::_narrow(anEngineObj);
+      }
+      catch (...) {
+      }
+
+      if (!CORBA::is_nil(anEngine)) {
+        // try to load
+        _PTR(StudyBuilder) aStudyBuilder = aSObj->GetStudy()->NewBuilder();
+        bool isOk = true;
+        try {
+          CORBA::String_var aDriverIOR = anApp->orb()->object_to_string(anEngine);
+          aStudyBuilder->LoadWith(aSComp, aDriverIOR.in());
+        }
+        catch (...) {
+          isOk = false;
+        }
+
+        if (isOk) {
+          // now try to obtain the IOR once again (after successfull component data loading)
+          if (aSObj->FindAttribute( anAttr, "AttributeIOR" )) {
+            _PTR(AttributeIOR) anIOR ( anAttr );
+            ior = anIOR->Value().c_str();
+          }
+        }
+      } // if (!CORBA::is_nil(anEngine))
+    } // if (!aSComp->ComponentIOR(aCompIOR))
+
+    return ior;
+  }
+
+} // no name namespace
 
 /**
  * Slot, called when selection is changed
@@ -310,7 +391,7 @@ void SUPERVGUI_BrowseNodeDlg::onFieldActivated()
 void SUPERVGUI_BrowseNodeDlg::onSelectionChanged()
 {
   if ( myActiveField ) {
-    
+
     SALOME_ListIO aList;
     aList.Clear();
 
@@ -320,28 +401,13 @@ void SUPERVGUI_BrowseNodeDlg::onSelectionChanged()
       return;
     }
 
-    (( SalomeApp_Application* )(aSupMod->getActiveStudy()->application()))
-      ->selectionMgr()->selectedObjects( aList );
-    
-    if( aList.Extent() == 1 ) {
+    SalomeApp_Application* anApp = aSupMod->getApp();
+    anApp->selectionMgr()->selectedObjects( aList );
+
+    if ( aList.Extent() == 1 ) {
       Handle( SALOME_InteractiveObject ) anIO = aList.First();
       if ( anIO->hasEntry() ) {
-       _PTR(SObject) aObj ( dynamic_cast<SalomeApp_Study*>( aSupMod->getActiveStudy() )->
-                            studyDS()->FindObjectID( anIO->getEntry() ) );
-         
-       _PTR(GenericAttribute) anAttr;
-       QString ior("");
-         
-       if (aObj->FindAttribute( anAttr, "AttributeIOR" ) ) {
-         _PTR(AttributeIOR) anIOR ( anAttr );
-         ior = anIOR->Value().c_str();
-       }
-       else {
-         SALOMEDS_Study* aSStudy = dynamic_cast<SALOMEDS_Study*>( aObj->GetStudy().get() );
-         SALOMEDS_SObject* aSSObj = dynamic_cast<SALOMEDS_SObject*>( aObj.get() );
-         if ( aSStudy && aSSObj )
-           ior = aSStudy->ConvertObjectToIOR( aSSObj->GetObject() ).c_str();
-       }
+        QString ior = ::getIORfromIO(anIO, aSupMod);
        myActiveField->setData( ior );
       }
     }
@@ -476,35 +542,20 @@ void SUPERVGUI_GetValueDlg::onSelectionChanged()
 {
   SALOME_ListIO aList;
   aList.Clear();
-  
+
   SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
   if ( !aSupMod ) {
     MESSAGE("NULL Supervision module!");
     return;
   }
-  
-  (( SalomeApp_Application* )(aSupMod->getActiveStudy()->application()))
-    ->selectionMgr()->selectedObjects( aList );
-  
-  if( aList.Extent() == 1 ) {
+
+  SalomeApp_Application* anApp = aSupMod->getApp();
+  anApp->selectionMgr()->selectedObjects( aList );
+
+  if ( aList.Extent() == 1 ) {
     Handle( SALOME_InteractiveObject ) anIO = aList.First();
     if ( anIO->hasEntry() ) {
-      _PTR(SObject) aObj ( dynamic_cast<SalomeApp_Study*>( aSupMod->getActiveStudy() )->
-                          studyDS()->FindObjectID( anIO->getEntry() ) );
-       
-      _PTR(GenericAttribute) anAttr;
-      QString ior("");
-       
-      if (aObj->FindAttribute( anAttr, "AttributeIOR" ) ) {
-       _PTR(AttributeIOR) anIOR ( anAttr );
-       ior = anIOR->Value().c_str();
-      }
-      else {
-       SALOMEDS_Study* aSStudy = dynamic_cast<SALOMEDS_Study*>( aObj->GetStudy().get() );
-       SALOMEDS_SObject* aSSObj = dynamic_cast<SALOMEDS_SObject*>( aObj.get() );
-       if ( aSStudy && aSSObj )
-         ior = aSStudy->ConvertObjectToIOR( aSSObj->GetObject() ).c_str();
-      }
+      QString ior = ::getIORfromIO(anIO, aSupMod);
       myField->setData( ior );
     }
   }
index b3070b1b8bc698baaf33a007e0257b6903da2748..ddb63f95836d6498f538ec2a40a4d9c4fe678a79 100644 (file)
        ihmList->removeRef(ihmNode); \
        ihmNode->merge(); \
         ihmNode = getNode(aCNodeEnd); \
-       ihmList->removeRef(ihmNode); \
-       ihmNode->merge(); \
+        if (ihmNode) { \
+         ihmList->removeRef(ihmNode); \
+         ihmNode->merge(); \
+        } \
       } \
     }
 
@@ -206,7 +208,7 @@ void SUPERVGUI_Canvas::sync() {
  */
 void SUPERVGUI_Canvas::merge() {
   if (SUPERV_isNull(myMain->getDataflow())) return;
-      
+
   SUPERVGUI_CanvasNode* ihmNode;
   QObjectList* ihmList = queryList("SUPERVGUI_CanvasNode");
   SUPERV_Nodes nodes = myMain->getDataflow()->Nodes();
@@ -228,6 +230,43 @@ void SUPERVGUI_Canvas::merge() {
 
   UPDATECONTROLNODES(LNodes);    
   UPDATECONTROLNODES(SNodes);
+  /*
+  n = nodes->LNodes.length();
+  for (int i=0; i<n; i++) {
+    SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->LNodes[i]);
+    SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->LNodes[i]->Coupled());
+    ihmNode = getNode(aCNode);
+    SUPERVGUI_CanvasNode* ihmNodeEnd = getNode(aCNodeEnd);
+    if (ihmNode == NULL) {
+      myMain->addControlNode(aCNode, aCNodeEnd, false);
+    } else {
+      if (ihmNodeEnd) {
+        ihmNode->move(aCNode->X(), aCNode->Y());
+        ihmList->removeRef(ihmNode);
+        ihmNode->merge();
+        ihmNode = getNode(aCNodeEnd);
+        ihmList->removeRef(ihmNode);
+        ihmNode->merge();
+      }
+    }
+  }
+  n = nodes->SNodes.length();
+  for (int i=0; i<n; i++) {
+    SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->SNodes[i]);
+    SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->SNodes[i]->Coupled());
+    ihmNode = getNode(aCNode);
+    if (ihmNode == NULL) {
+      myMain->addControlNode(aCNode, aCNodeEnd, false);
+    } else {
+      ihmNode->move(aCNode->X(), aCNode->Y());
+      ihmList->removeRef(ihmNode);
+      ihmNode->merge();
+      ihmNode = getNode(aCNodeEnd);
+      ihmList->removeRef(ihmNode);
+      ihmNode->merge();
+    }
+  }
+  //*/
 
   QObjectListIt it(*ihmList);
   while ((ihmNode=(SUPERVGUI_CanvasNode*)it.current()) != 0) {
index 0e7dbb7967c8d5971071b864fb95a0b4cc7133c4..bbd3ffc70421f15ad1b3d31e67bd8013eb3d8930 100644 (file)
@@ -45,7 +45,7 @@
       else x += (CELL_WIDTH  + CELL_SPACE); \
       cell = getCellNode(aCNode); \
       if (cell == NULL) { \
-        SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode(myMgr, this, myMain, aCNode); \
+        SUPERVGUI_CanvasCellNode* aNode = SUPERVGUI_CanvasCellNode::Create(myMgr, this, myMain, aCNode); \
         aNode->move(x, y); \
         aNode->show(); \
         aNode->sync(); \
       SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->NodesName[co]->Coupled()); \
       cell = getCellNode(aCNode); \
       if (cell == NULL) { \
-        SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode( myMgr, this, myMain, aCNode); \
+        SUPERVGUI_CanvasCellNode* aNode = SUPERVGUI_CanvasCellNode::Create(myMgr, this, myMain, aCNode); \
         aNode->move(x, y); \
         aNode->show(); \
         aNode->sync(); \
         y += (CELL_HEIGHT + CELL_SPACE); \
-        SUPERVGUI_CanvasCellNode* aNodeEnd = new SUPERVGUI_CanvasCellEndNode( myMgr, this, myMain, aCNodeEnd, aNode); \
+        SUPERVGUI_CanvasCellNode* aNodeEnd = SUPERVGUI_CanvasCellEndNode::Create(myMgr, this, myMain, aCNodeEnd, aNode); \
         aNodeEnd->move(x, y); \
         aNodeEnd->show(); \
         aNodeEnd->sync(); \
@@ -283,7 +283,7 @@ SUPERVGUI_CanvasCellNode* SUPERVGUI_CanvasArray::getCellNode(SUPERV::CNode_ptr t
 
 SUPERVGUI_CanvasCellNode* SUPERVGUI_CanvasArray::addNode(SUPERV_CNode node) {
   Trace("SUPERVGUI_CanvasArray::addNode");
-  SUPERVGUI_CanvasCellNode* n = new SUPERVGUI_CanvasCellNode( myMgr, this, myMain, node);
+  SUPERVGUI_CanvasCellNode* n = SUPERVGUI_CanvasCellNode::Create(myMgr, this, myMain, node);
   n->move(nodeX, nodeY);
   n->show();
   update();
index 5d9c498d3513f3fac2fde17fa4063d040f2f9565..4bfd92425dc7645ed594e33e1ef03f09816289c0 100644 (file)
@@ -26,6 +26,7 @@
 #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);
@@ -67,16 +78,25 @@ QPopupMenu* SUPERVGUI_CanvasComputeNode::getPopupMenu(QWidget* 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_CanvasStartNodePrsresMgr(), getMain()->getCanvas(), 
+  return new SUPERVGUI_CanvasStartNodePrs (resMgr(), getMain()->getCanvas(), 
                                           (SUPERVGUI_CanvasStartNode*)this);
 }
 
@@ -135,6 +155,8 @@ void SUPERVGUI_CanvasStartNode::remove()
   if (myCoupled) 
     delete myCoupled;
 
+  emit objectCreatedDeleted(); // jfa : NPAL15529
+
   delete this;
 
   aCanvas->update();
@@ -176,8 +198,9 @@ void SUPERVGUI_CanvasStartNode::pastePort()
 //=====================================================================
 // 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)
 {
@@ -185,6 +208,15 @@ SUPERVGUI_CanvasEndNode::SUPERVGUI_CanvasEndNode(SUIT_ResourceMgr* mgr, QObject*
   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(), 
@@ -213,12 +245,21 @@ QPopupMenu* SUPERVGUI_CanvasEndNode::getPopupMenu(QWidget* theParent)
 //=====================================================================
 // 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(), 
@@ -244,7 +285,43 @@ void SUPERVGUI_CanvasGotoNode::linkToNode() {
   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();
     }
   }
@@ -254,12 +331,21 @@ void SUPERVGUI_CanvasGotoNode::linkToNode() {
 //=====================================================================
 // 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(), 
@@ -344,9 +430,8 @@ void SUPERVGUI_CanvasMacroNode::remove()
 //=====================================================================
 // 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");
@@ -363,6 +448,14 @@ SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode(SUIT_ResourceMgr* mgr, QObjec
     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()
 {
 }
@@ -428,9 +521,8 @@ SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasCellNode::createPrs() const
   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)
 {
@@ -439,12 +531,25 @@ SUPERVGUI_CanvasCellEndNode::SUPERVGUI_CanvasCellEndNode( SUIT_ResourceMgr* mgr,
   //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
index 8f6767f1cb0bff359bcd8393c3ea2cfe4d09fb19..ddb250ea79430b09ab59c27854886d34acd6f91b 100644 (file)
@@ -35,17 +35,23 @@ class SUPERVGUI_CanvasComputeNode : public SUPERVGUI_CanvasNode {
   Q_OBJECT
 
   public:
-    SUPERVGUI_CanvasComputeNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+    static SUPERVGUI_CanvasComputeNode* Create (SUIT_ResourceMgr*, QObject* theParent,
+                                               SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
     virtual ~SUPERVGUI_CanvasComputeNode() {}
 
     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
+
+  protected:
+    SUPERVGUI_CanvasComputeNode (SUIT_ResourceMgr*, QObject* theParent,
+                                SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
 };
 
 class SUPERVGUI_CanvasMacroNode : public SUPERVGUI_CanvasComputeNode {
   Q_OBJECT
 
   public:
-    SUPERVGUI_CanvasMacroNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+    static SUPERVGUI_CanvasMacroNode* Create (SUIT_ResourceMgr*, QObject* theParent,
+                                             SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
     virtual ~SUPERVGUI_CanvasMacroNode() {}
 
     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
@@ -56,22 +62,27 @@ class SUPERVGUI_CanvasMacroNode : public SUPERVGUI_CanvasComputeNode {
     void exportDataflow();
 
   protected:
+    SUPERVGUI_CanvasMacroNode (SUIT_ResourceMgr*, QObject* theParent,
+                              SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+
     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
 };
 
 
 class SUPERVGUI_CanvasEndNode;
-class SUPERVGUI_CanvasStartNode : public SUPERVGUI_CanvasNode {
+class SUPERVGUI_CanvasStartNode : public SUPERVGUI_CanvasNode
+{
   Q_OBJECT
 
   public:
-    SUPERVGUI_CanvasStartNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+    static SUPERVGUI_CanvasStartNode* Create (SUIT_ResourceMgr*, QObject* theParent,
+                                             SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
     virtual ~SUPERVGUI_CanvasStartNode() {}
 
     virtual bool setNodeName(QString aName);
 
     SUPERVGUI_CanvasEndNode* getCoupled() const { return myCoupled; }
-    
+
     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
 
   public slots:
@@ -83,6 +94,9 @@ class SUPERVGUI_CanvasStartNode : public SUPERVGUI_CanvasNode {
     virtual void pastePort();
 
   protected:
+    SUPERVGUI_CanvasStartNode (SUIT_ResourceMgr*, QObject* theParent,
+                              SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+
     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
 
   protected slots:
@@ -93,7 +107,6 @@ class SUPERVGUI_CanvasStartNode : public SUPERVGUI_CanvasNode {
     void setCoupled(SUPERVGUI_CanvasEndNode* theEnd) { myCoupled = theEnd; }
 
     SUPERVGUI_CanvasEndNode* myCoupled;
-
 };
 
 
@@ -101,8 +114,9 @@ class SUPERVGUI_CanvasEndNode : public SUPERVGUI_CanvasNode {
   Q_OBJECT
 
   public:
-    SUPERVGUI_CanvasEndNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
-                            SUPERVGUI_CanvasStartNode* theStart);
+    static SUPERVGUI_CanvasEndNode* Create (SUIT_ResourceMgr*, QObject* theParent,
+                                           SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
+                                           SUPERVGUI_CanvasStartNode* theStart);
     virtual ~SUPERVGUI_CanvasEndNode() {}
 
     SUPERVGUI_CanvasStartNode* getCoupled() const { return myCoupled; }
@@ -114,11 +128,14 @@ class SUPERVGUI_CanvasEndNode : public SUPERVGUI_CanvasNode {
     virtual void addInputPort();*/
 
   protected:
+    SUPERVGUI_CanvasEndNode (SUIT_ResourceMgr*, QObject* theParent,
+                            SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
+                            SUPERVGUI_CanvasStartNode* theStart);
+
     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
 
   private:
     SUPERVGUI_CanvasStartNode* myCoupled;
-
 };
 
 
@@ -126,7 +143,8 @@ class SUPERVGUI_CanvasGotoNode : public SUPERVGUI_CanvasNode {
   Q_OBJECT
 
   public:
-    SUPERVGUI_CanvasGotoNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+    static SUPERVGUI_CanvasGotoNode* Create (SUIT_ResourceMgr*, QObject* theParent,
+                                            SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
     virtual ~SUPERVGUI_CanvasGotoNode() {}
 
     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
@@ -135,6 +153,9 @@ class SUPERVGUI_CanvasGotoNode : public SUPERVGUI_CanvasNode {
     void linkToNode();
 
   protected:
+    SUPERVGUI_CanvasGotoNode (SUIT_ResourceMgr*, QObject* theParent,
+                             SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+
     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
 };
 
@@ -142,9 +163,9 @@ class SUPERVGUI_CanvasCellNode : public SUPERVGUI_CanvasNode {
   Q_OBJECT
 
   public:
-    SUPERVGUI_CanvasCellNode( SUIT_ResourceMgr*, QObject* theParent, 
-                             SUPERVGUI_Main* theMain, 
-                             SUPERV_CNode theNode);
+    static SUPERVGUI_CanvasCellNode* Create (SUIT_ResourceMgr*, QObject* theParent, 
+                                            SUPERVGUI_Main* theMain, 
+                                            SUPERV_CNode theNode);
     virtual ~SUPERVGUI_CanvasCellNode();
 
     // asv : 26.01.05 : everything moved to CanvasNode::getPopupMenu()
@@ -153,12 +174,16 @@ class SUPERVGUI_CanvasCellNode : public SUPERVGUI_CanvasNode {
     void setPairCell(SUPERVGUI_CanvasCellNode* thePairCell);
     SUPERVGUI_CanvasCellNode* getPairCell();
 
-     virtual void sync();
+    virtual void sync();
 
-     // asv : 26.01.05 : decided to remove all "edition" operations on nodes in Table view
-     //virtual bool setNodeName(QString aName);
+    // asv : 26.01.05 : decided to remove all "edition" operations on nodes in Table view
+    //virtual bool setNodeName(QString aName);
 
   protected:
+    SUPERVGUI_CanvasCellNode (SUIT_ResourceMgr*, QObject* theParent, 
+                             SUPERVGUI_Main* theMain, 
+                             SUPERV_CNode theNode);
+
     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
 
  protected:
@@ -167,26 +192,31 @@ class SUPERVGUI_CanvasCellNode : public SUPERVGUI_CanvasNode {
  private:
     bool        myIsControl;
     bool        myIsStart;
-
 };
 
-class SUPERVGUI_CanvasCellEndNode: public SUPERVGUI_CanvasCellNode {
+class SUPERVGUI_CanvasCellEndNode : public SUPERVGUI_CanvasCellNode {
  
   public:
-    SUPERVGUI_CanvasCellEndNode( SUIT_ResourceMgr*, QObject* theParent, 
+    static SUPERVGUI_CanvasCellEndNode* Create (SUIT_ResourceMgr*, QObject* theParent, 
+                                               SUPERVGUI_Main* theMain, 
+                                               SUPERV_CNode theNode, 
+                                               SUPERVGUI_CanvasCellNode* theStart);
+    virtual ~SUPERVGUI_CanvasCellEndNode() {}
+
+    // asv : 26.01.05 : decided to remove all "edition" operations on nodes in Table view
+    //virtual bool setNodeName(QString theName);
+
+  protected:
+    SUPERVGUI_CanvasCellEndNode (SUIT_ResourceMgr*, QObject* theParent, 
                                 SUPERVGUI_Main* theMain, 
                                 SUPERV_CNode theNode, 
                                 SUPERVGUI_CanvasCellNode* theStart);
-    virtual ~SUPERVGUI_CanvasCellEndNode() {}
-
-     // asv : 26.01.05 : decided to remove all "edition" operations on nodes in Table view
-     //virtual bool setNodeName(QString theName);
 };
 
-/** 
+/**
  * Taken from SUPERVGUI_ControlNode.h without change
  */
-class SUPERVGUI_SelectInlineDlg public QDialog {
+class SUPERVGUI_SelectInlineDlg : public QDialog {
   Q_OBJECT
 
  public:
index 70a1e3826177ac2069ffe8aa2cf4cadb4b4e874f..3c957e645eca7c9ef4ed595fd7cfd22230cb0ca1 100644 (file)
@@ -401,7 +401,8 @@ bool SUPERVGUI_CanvasLinkBuilder::canCreateEngine(SUPERVGUI_CanvasPort* thePort)
 
     // asv : 15.12.04 : NOT allow to connect Gate-to-InLine --> it does not make sence!
     // Out Gate port can be connected only to In Gate port 
-    if ( aOutKind == SUPERV::GateParameter && aInKind != SUPERV::GateParameter )
+    // mkr : NPAL14823 : Out Gate port can be connected to Inline port too
+    if ( aOutKind == SUPERV::GateParameter && aInKind != SUPERV::GateParameter && aInKind != SUPERV::InLineParameter )
       return false;
 
     // In Gate can be connected to (receive links from) Gate port and InLine ports (important for Switch nodes)
index 54774c8530e5a3fb3ee3d6157b8b2a5d72b8d3fc..a13b244c24ec6b3e6cee94ade658dc03aff7467a 100644 (file)
@@ -41,7 +41,8 @@
 #include <qinputdialog.h>
 
 
-SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode( SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell):
+SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode( SUIT_ResourceMgr* mgr, QObject* theParent,
+                                            SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell):
     QObject(theParent),
     myMain(theMain),
     myNode(theNode),
@@ -96,7 +97,6 @@ SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode( SUIT_ResourceMgr* mgr, QObject* theP
 
   // mkr : PAL8237
   connect(this, SIGNAL(objectCreatedDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
-  emit objectCreatedDeleted();
 }
 
 SUPERVGUI_CanvasNode::~SUPERVGUI_CanvasNode()
@@ -132,7 +132,6 @@ SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasNode::createPrs() const
   //glNode->update();
   //getGLContext()->insertObject( glNode, true /*false*/ );
   //
-  
   return new SUPERVGUI_CanvasNodePrs( myMgr, myMain->getCanvas(), (SUPERVGUI_CanvasNode*)this);
 }
 
index 6124d3dbbe9783a194e3b0885c8981ff5ba3e449..3560a8de341350e48a830ad1039039467187f782 100644 (file)
@@ -41,7 +41,6 @@ class SUPERVGUI_CanvasNode : public QObject {
   Q_OBJECT
 
   public:
-    SUPERVGUI_CanvasNode( SUIT_ResourceMgr*, QObject*, SUPERVGUI_Main*, SUPERV_CNode theNode, bool theIsCell=false);
     virtual ~SUPERVGUI_CanvasNode();
 
     // done to ignore port update when node is removed
@@ -124,6 +123,9 @@ class SUPERVGUI_CanvasNode : public QObject {
     void exportToLib();
   
   protected:
+    SUPERVGUI_CanvasNode (SUIT_ResourceMgr*, QObject*, SUPERVGUI_Main*,
+                         SUPERV_CNode theNode, bool theIsCell=false);
+
     // redefined by most of CanvasNode successors
     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
     SUIT_ResourceMgr* resMgr() const { return myMgr; }
index 9fc76b755234145b1a8019c7ea6aeb3d6a775322..c5d107df1af309255346fb8becba5789ed54c315 100644 (file)
@@ -777,7 +777,10 @@ void SUPERVGUI_CanvasNodePrs::setState(SUPERV::GraphState theState)
     break;
   }
 
-  long sec = myNode->getEngine()->CpuUsed();
+  long sec = 0;
+  // IPAL9273, 9369, 9731
+  if ( theState != SUPERV_Kill && myNode->getMain()->getDataflow()->State() != SUPERV_Kill )
+    sec = myNode->getEngine()->CpuUsed();
   char hms[9];
   long s = sec/3600;
   hms[0]=(char)(((s/10)%10)+48);
index c8c6b5a131ee013a9aea1de19cb501dba9d3c3a1..e7db50f26a12c9e6bf2c0ac6bacf7d5601839c3a 100644 (file)
@@ -34,7 +34,8 @@
 
 #include "SalomeApp_Study.h"
 
-SUPERVGUI_CanvasPort::SUPERVGUI_CanvasPort(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort):
+SUPERVGUI_CanvasPort::SUPERVGUI_CanvasPort (QObject* theParent, SUPERVGUI_Main* theMain,
+                                            SUPERV::Port_ptr thePort):
     QObject(theParent),
     myMain(theMain),
     myPrs(0),
@@ -211,7 +212,8 @@ void SUPERVGUI_CanvasPort::copy()
 //***********************************************************
 // Input Port
 //***********************************************************
-SUPERVGUI_CanvasPortIn::SUPERVGUI_CanvasPortIn(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort):
+SUPERVGUI_CanvasPortIn::SUPERVGUI_CanvasPortIn (QObject* theParent, SUPERVGUI_Main* theMain,
+                                                SUPERV::Port_ptr thePort):
   SUPERVGUI_CanvasPort(theParent, theMain, thePort)
 {
   Trace("SUPERVGUI_CanvasPortIn::SUPERVGUI_CanvasPortIn");
@@ -226,7 +228,9 @@ SUPERVGUI_CanvasPortIn::~SUPERVGUI_CanvasPortIn()
 QPopupMenu* SUPERVGUI_CanvasPortIn::getPopupMenu(QWidget* theParent) 
 {
   QPopupMenu* popup = SUPERVGUI_CanvasPort::getPopupMenu(theParent);
-  bool editable = getEngine()->IsInput() && !getEngine()->IsLinked() && !getMain()->getDataflow()->IsExecuting();
+  bool editable = (getEngine()->IsInput() &&
+                   !getEngine()->IsLinked() &&
+                   !getMain()->getDataflow()->IsExecuting());
 
   if (!getEngine()->IsGate() && editable)
     popup->insertItem(tr("MSG_SETVALUE"), this, SLOT(setInput()));
@@ -271,7 +275,8 @@ bool SUPERVGUI_CanvasPortIn::eventFilter(QObject* o, QEvent* e)
 //***********************************************************
 // Output Port
 //***********************************************************
-SUPERVGUI_CanvasPortOut::SUPERVGUI_CanvasPortOut(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV::Port_ptr thePort):
+SUPERVGUI_CanvasPortOut::SUPERVGUI_CanvasPortOut (QObject* theParent, SUPERVGUI_Main* theMain,
+                                                  SUPERV::Port_ptr thePort):
   SUPERVGUI_CanvasPort(theParent, theMain, thePort)
 {
   Trace("SUPERVGUI_CanvasPortOut::SUPERVGUI_CanvasPortOut");
index 48dcf44a5994e04b4ddd9d4d56bb628f0a35ca81..a77154438b7c599646cdff77ed2d7b651b6ead69 100644 (file)
@@ -459,7 +459,7 @@ void SUPERVGUI_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent)
 
   // QToolTip for title and label for SUPERVGUI_CanvasNode
   SUPERVGUI_ToolTip* aTT = new SUPERVGUI_ToolTip(this);
-  aTT->maybeTip(p);
+  aTT->maybeTip(theEvent->pos());
 
   busy = false;
 }
index 0be9d3f8b769812a26f447a8d6eed5c15f765e3d..41b33d8619c8241323d8f119f0cc6e5640bee822 100644 (file)
@@ -157,10 +157,13 @@ void SUPERVGUI_Clipboard::pasteNode() {
 
     case SUPERV::FactoryNode : 
       {
-       SUPERV::FNode_var aFNode = dataflow->FNode( SUPERV::FNode::_narrow(aNode)->GetComponentName(),
-                                                   SUPERV::FNode::_narrow(aNode)->GetInterfaceName(),
-                                                   *SUPERV::FNode::_narrow(aNode)->Service(),
-                                                   SUPERV::FNode::_narrow(aNode)->IsCimpl()); // mkr : PAL11273
+        SUPERV::FNode_var aNodeFNode = SUPERV::FNode::_narrow(aNode);
+        SALOME_ModuleCatalog::ImplType anImplType = SALOME_ModuleCatalog::SO;
+        if (!aNodeFNode->IsCimpl()) anImplType = SALOME_ModuleCatalog::PY;
+       SUPERV::FNode_var aFNode = dataflow->FNode(aNodeFNode->GetComponentName(),
+                                                   aNodeFNode->GetInterfaceName(),
+                                                   *aNodeFNode->Service(),
+                                                   anImplType); // mkr : PAL11273
        if (CORBA::is_nil(aFNode)) {
          QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
          return;
index b6fd64f03bf55ee02a517600a4d85dd58396553b..c0dd3ea434f4a7108a5fcac8b5992b326cd95bcd 100644 (file)
@@ -74,7 +74,7 @@ using namespace boost;
         SUPERV::Port_ptr aPort = aPortList[p].in(); \
         if ( !aPort->IsInput() && !aPort->IsGate() ) { \
           bool aInStudy = dynamic_cast<SUPERVGUI_CanvasPortOut*>( aMain->getCanvas()->getPort(aPort) )->isInStudy(); \
-          dynamic_cast<SUPERVGUI_CanvasPortOut*>( getCanvas()->getPort( getDataflow()->Node(aCNode->Name())->Port(aPort->Name()) ) )->setStudyState(aInStudy); \
+          dynamic_cast<SUPERVGUI_CanvasPortOut*>( getCanvas()->getPort( getDataflow()->Node(aCNode->Name())->GetOutPort(aPort->Name()) ) )->setStudyState(aInStudy); \
         } \
       } \
     }
@@ -163,13 +163,13 @@ void SUPERVGUI_Main::init(SUIT_Desktop* theDesktop) {
   SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( study->application() );
 
   objectBrowser = app->objectBrowser();
-    
+
   myArray = new SUPERVGUI_CanvasArray( this, resMgr() );
   myArrayView = new SUPERVGUI_ArrayView( myArray, this );
 
   myCanvas = new SUPERVGUI_Canvas( this, resMgr() );
   myCanvasView = new SUPERVGUI_CanvasView(myCanvas, this);
-  
+
   message = app->logWindow();
   notification = new NOTIFICATION_Consumer();
 
@@ -350,6 +350,11 @@ void SUPERVGUI_Main::sync() {
   //if ( aSupMod ) aSupMod->updateObjBrowser();
   //else MESSAGE("NULL Supervision module!");
 
+  // update "Save" icon and menu state, if dataflow is published
+  _PTR(Study) aStudy = ((SalomeApp_Study*)study)->studyDS();
+  _PTR(SObject)  aSO = aStudy->FindObjectIOR(dataflow->getIOR());
+  if (aSO) SUPERVGUI_Main::setModifiedFlag();  
+
   if (myCurrentView == CANVASTABLE) {
     myArray->sync();
     myArray->update();
@@ -597,7 +602,7 @@ void SUPERVGUI_Main::onShowToolbar()
 void SUPERVGUI_Main::onObjectCreatedDeleted()
 {
   if ( study ) {
-    if ( STD_Application* app = dynamic_cast<STD_Application*>( study->application() ) ) {
+    if ( LightApp_Application* app = dynamic_cast<LightApp_Application*>( study->application() ) ) {
       ViewManagerList aVMList;
       app->viewManagers( SUPERVGraph_Viewer::Type(), aVMList );
       SUIT_ViewManager* aVM;
@@ -608,16 +613,20 @@ void SUPERVGUI_Main::onObjectCreatedDeleted()
          QObjectList* aMainList = aVW->queryList("SUPERVGUI_Main");
          if ( aMainList->count() == 1 ) {
            SUPERVGUI_Main* aMain = dynamic_cast<SUPERVGUI_Main*>( aMainList->first() );
-           if ( aMain )
-             if ( !CORBA::is_nil( aMain->getDataflow() )
-                  &&
-                  !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows
-                  && 
-                  aMain != this ) // not equal mains
+           if ( aMain ) {
+             if (aMain != this &&
+                  !CORBA::is_nil(aMain->getDataflow()) &&
+                  !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR())) // equal dataflows
                aMain->getCanvas()->merge();
+            }
          }
        }
       }
+
+      // update "Save" icon and menu state, if dataflow is published
+      //_PTR(Study) aStudy = ((SalomeApp_Study*)study)->studyDS();
+      //_PTR(SObject)  aSO = aStudy->FindObjectIOR(dataflow->getIOR());
+      //if (aSO) SUPERVGUI_Main::setModifiedFlag();  
     }
   }
 }
@@ -649,7 +658,7 @@ void SUPERVGUI_Main::onPutInStudy( QString* theNodePortName )
          }
        }
       }
-      SUPERVGUI_Main::setModifiedFlag();  
+      //SUPERVGUI_Main::setModifiedFlag();
     }
   }
 }
@@ -728,9 +737,11 @@ void SUPERVGUI_Main::run( const bool andSuspend ) {
       myRunTime = QDateTime::currentDateTime();
       const bool result = andSuspend ? dataflow->Start() : dataflow->Run();
       if ( !result ) {
-       QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_BADEXECUTE"));
+       // PAL12902
+       QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_BADEXECUTE") + QString(" : ") + QString(dataflow->Messages()));
        if ( dataflow->State() == SUPERV::ErrorState ) {
-         kill();
+         // PAL12902
+         if ( !dataflow->IsEditing() ) kill();
        }
       } 
       else {
@@ -754,7 +765,9 @@ void SUPERVGUI_Main::kill() {
     QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_NOTRUNNING"));
   } 
   else if (dataflow->Kill()) {
-    getMessage()->putMessage( tr("MSG_GRAPH_KILLED") );
+    // IPAL9273, 9369, 9731 : to avoid two equal messages about killing dataflow
+    //                        execution in the Message Console
+    //getMessage()->putMessage( tr("MSG_GRAPH_KILLED") );
     sync();
   } 
   else {
@@ -837,7 +850,7 @@ void SUPERVGUI_Main::addComputeNode(SUPERV_CNode theNode) {
   case CANVAS:
   case CONTROLFLOW: 
     {
-      SUPERVGUI_CanvasNode* aNode = new SUPERVGUI_CanvasComputeNode( resMgr(), myCanvas, this, theNode);
+      SUPERVGUI_CanvasNode* aNode = SUPERVGUI_CanvasComputeNode::Create(resMgr(), myCanvas, this, theNode);
       aNode->move(theNode->X(), theNode->Y());
       if (myCurrentView == CONTROLFLOW) aNode->hideAll();
       aNode->show();
@@ -859,7 +872,7 @@ void SUPERVGUI_Main::addGOTONode(SUPERV_CNode theNode) {
   case CANVAS:
   case CONTROLFLOW: 
     {
-      SUPERVGUI_CanvasNode* aNode = new SUPERVGUI_CanvasGotoNode( resMgr(), myCanvas, this, theNode);
+      SUPERVGUI_CanvasNode* aNode = SUPERVGUI_CanvasGotoNode::Create(resMgr(), myCanvas, this, theNode);
       aNode->move(theNode->X(), theNode->Y());
       if (myCurrentView == CONTROLFLOW) aNode->hideAll();
       aNode->show();
@@ -872,7 +885,8 @@ void SUPERVGUI_Main::addGOTONode(SUPERV_CNode theNode) {
 /**
  * Add Control node
  */
-void SUPERVGUI_Main::addControlNode(SUPERV_CNode theStartNode, SUPERV_CNode theEndNode, bool Update) {
+void SUPERVGUI_Main::addControlNode(SUPERV_CNode theStartNode, SUPERV_CNode theEndNode, bool Update)
+{
   switch (myCurrentView) {
   case CANVASTABLE:
     myArray->destroy();
@@ -881,11 +895,13 @@ void SUPERVGUI_Main::addControlNode(SUPERV_CNode theStartNode, SUPERV_CNode theE
   case CANVAS:
   case CONTROLFLOW: 
     {
-      SUPERVGUI_CanvasStartNode* aStartNode = new SUPERVGUI_CanvasStartNode( resMgr(), myCanvas, this, theStartNode);
+      SUPERVGUI_CanvasStartNode* aStartNode =
+        SUPERVGUI_CanvasStartNode::Create(resMgr(), myCanvas, this, theStartNode);
       aStartNode->move(theStartNode->X(), theStartNode->Y());
       if (myCurrentView == CONTROLFLOW) aStartNode->hideAll();
 
-      SUPERVGUI_CanvasEndNode* aEndNode = new SUPERVGUI_CanvasEndNode( resMgr(), myCanvas, this, theEndNode, aStartNode);
+      SUPERVGUI_CanvasEndNode* aEndNode =
+        SUPERVGUI_CanvasEndNode::Create(resMgr(), myCanvas, this, theEndNode, aStartNode);
       aEndNode->move(theEndNode->X(), theEndNode->Y());
       if (myCurrentView == CONTROLFLOW) aEndNode->hideAll();
 
@@ -910,7 +926,7 @@ void SUPERVGUI_Main::addMacroNode(SUPERV_CNode theNode) {
   case CANVAS:
   case CONTROLFLOW: 
     {
-      SUPERVGUI_CanvasNode* aNode = new SUPERVGUI_CanvasMacroNode( resMgr(), myCanvas, this, theNode);
+      SUPERVGUI_CanvasNode* aNode = SUPERVGUI_CanvasMacroNode::Create(resMgr(), myCanvas, this, theNode);
       aNode->move(theNode->X(), theNode->Y());
       if (myCurrentView == CONTROLFLOW) aNode->hideAll();
       aNode->show();
@@ -1119,6 +1135,8 @@ void SUPERVGUI_Main::addDataflowToStudy() {
 
     if ( !myThread->running() )
       aSupMod->updateObjBrowser();
+
+    aSupMod->getApp()->updateActions();  
   }
   else {
     MESSAGE( "ERROR: failed to find or create dataflow SObject" );
@@ -1590,6 +1608,7 @@ void SUPERVGUI_Thread::main_thread_run(SUPERV_CNode& aNode, SUPERV::GraphEvent&
 {
     // in case node "said" something during changing state through notification mechanism - output it
     myMain->syncNotification();
+    myMain->sync(); // mkr : NPAL14881
     
     // "kill" or undefined event came
     if (( aEvent == SUPERV::UndefinedEvent && aState == SUPERV::UndefinedState ) ||
@@ -1614,6 +1633,7 @@ void SUPERVGUI_Thread::main_thread_run(SUPERV_CNode& aNode, SUPERV::GraphEvent&
 
     // execution is finished.  just set a "finished" message(s)
     if ( !myIsActive ) {
+      QString aMess;
       switch ( myMain->getDataflow()->State() ) {
       case SUPERV_Editing :     
        myMain->getMessage()->putMessage( myMain->getDataflow()->IsReadOnly()? 
@@ -1627,6 +1647,14 @@ void SUPERVGUI_Thread::main_thread_run(SUPERV_CNode& aNode, SUPERV::GraphEvent&
        break;  
       case SUPERV_Error :
        myMain->getMessage()->putMessage( tr("MSG_GRAPH_ABORTED") );
+       // PAL12866 -->
+       aMess = QString(myMain->getDataflow()->Messages());
+       if ( !aMess.isEmpty() ) {
+        myMain->getMessage()->putMessage( tr("MSG_DF_BADEXECUTE") + QString(" : ") + aMess );
+        QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), 
+                             tr("MSG_DF_BADEXECUTE") + QString(" : ") + aMess);
+       }
+       // PAL12866 <--
        break;  
       case SUPERV_Kill:
        myMain->getMessage()->putMessage( tr("MSG_GRAPH_KILLED") );
index 9e195eca1952e5adf51f7d88f141932187690043..8437548c3f1b77701675ce290ad5fc5cd6c99472 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "SUPERVGUI_ManagePortsDlg.h"
 #include "SUPERVGUI_CanvasNode.h"
+#include "SUPERVGUI_CanvasNodePrs.h"
 #include "SUPERVGUI_CanvasPort.h"
 #include "SUPERVGUI_CanvasControlNode.h"
 #include "SUPERVGUI_CanvasLink.h"
@@ -289,9 +290,11 @@ void SUPERVGUI_ManagePortsDlg::init()
   connect( myTypeCombo, SIGNAL(activated(const QString&)), this, SLOT(typeChanged(const QString&)));
 
   // mkr: PAL12448
-  connect( myInList,SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)), this, SLOT(itemDeselect(QListBoxItem*, const QPoint&)));
-  connect( myOutList,SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)), this, SLOT(itemDeselect(QListBoxItem*, const QPoint&)));
-  
+  connect( myInList,  SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)),
+           this, SLOT(itemDeselect(QListBoxItem*, const QPoint&)));
+  connect( myOutList, SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)),
+           this, SLOT(itemDeselect(QListBoxItem*, const QPoint&)));
+
   myNode->getMain()->lockedGraph( true );
 
   // asv : 11.01.05 : if a node is a loop node, then only INPUT ports can be added/removed
@@ -302,7 +305,9 @@ void SUPERVGUI_ManagePortsDlg::init()
     anUpOutputBtn->setEnabled( false );
     aDownOutputBtn->setEnabled( false );
   }
-    
+
+  // NPAL15537: initialization moved here from showEvent()
+  init( myNode );
 }
 
 /**
@@ -312,9 +317,9 @@ SUPERVGUI_ManagePortsDlg::~SUPERVGUI_ManagePortsDlg() {
 }
 
 // mkr : PAL8060
-void SUPERVGUI_ManagePortsDlg::createLinkEngineSUPERV::Port_ptr thePort, 
-                                                QValueList< QPair< QString,QString > >& theOwnList, 
-                                                QValueList< QPair< QString,QString > >& theCorrespList ) {
+void SUPERVGUI_ManagePortsDlg::createLinkEngine (SUPERV::Port_ptr thePort, 
+                                                 QValueList< QPair< QString,QString > >& theOwnList, 
+                                                 QValueList< QPair< QString,QString > >& theCorrespList) {
   // pair <NodeName, PortName> for the given port
   QPair<QString, QString> anOwnPair(QString(thePort->Node()->Name()), QString(thePort->Name()));
   int aNum = theOwnList.contains(anOwnPair);
@@ -325,192 +330,130 @@ void SUPERVGUI_ManagePortsDlg::createLinkEngine( SUPERV::Port_ptr thePort,
     theOwnList.remove(theOwnList.at(anId));
     theCorrespList.remove(theCorrespList.at(anId));
     
-    SUPERV_Port aCorrespPort = myNode->getMain()->getDataflow()->Node(aCorrespPair.first)->Port(aCorrespPair.second);
+    SUPERV_Port aCorrespPort =
+      myNode->getMain()->getDataflow()->Node(aCorrespPair.first)->Port(aCorrespPair.second);
     SUPERV_Link aLinkEngine;
     if ( thePort->IsInput() )
       aLinkEngine = myNode->getMain()->getDataflow()->Link(aCorrespPort, thePort);
     else
       aLinkEngine = myNode->getMain()->getDataflow()->Link(thePort, aCorrespPort);
-    SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(myNode->getMain()->getCanvas(), myNode->getMain(), aLinkEngine);
+    SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(myNode->getMain()->getCanvas(),
+                                                           myNode->getMain(), aLinkEngine);
     aLink->show();
-    
+
     aNum--;
-  }  
+  }
 }
 
 /** 
  * Set the ports as entered by user (order, name/type, etc.) and close the dialog
  */
-void SUPERVGUI_ManagePortsDlg::accept() {
+void SUPERVGUI_ManagePortsDlg::accept()
+{
   myNode->getMain()->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag 
+
   // 1. set the ports to Engine's CNode
   SUPERV_INode aINode = myNode->getInlineNode();
   if ( !SUPERV_isNull( aINode ) ) {
     int i; 
     const bool isLoop = ( myNode->getNodeType() == SUPERV::LoopNode );
 
-    // 1.1 delete all ports (delete CanvasPorts, they delete SUPERV_Ports) 
+    // 1.1 form a list of ports to be removed
     QObjectList* oldPorts = myNode->queryList("SUPERVGUI_CanvasPort");
-    QObjectListIt it( *oldPorts ); // iterate over the old ports
-    QObject *obj;
 
     // asv : 11.01.05 : fix for a bug: for Loop node, removal of an Input Port
-    // automatically removes the corresponding Output Port.  So for Loops the
+    // automatically removes the corresponding Output Port. So for Loops the
     // oldPorts list should be filtered to include only Input Ports.
     // But I'll filter Gate-s as well..
-    bool isAnyLinked = false; // check if any port from old ports is linked
-    // map PortName <-> (PortType, PortInputValue) for non linked input ports, which have input
-    QMap< QString, QPair< QString,QString > > InNameInput;
     QObjectList portsToRemove;
-    while ( (obj = it.current()) != 0 ) {
-      ++it;
+    QObject *obj;
+    QObjectListIt it ( *oldPorts ); // iterate over the old ports
+    for (; (obj = it.current()) != 0; ++it) {
       SUPERV::Port_var aPort = ((SUPERVGUI_CanvasPort*)obj)->getEngine();
-      if ( !aPort->IsGate() && ( !isLoop || aPort->IsInput() ) ) {
-       portsToRemove.append( obj );
+      if ( !aPort->IsGate() ) {
+        if ( !isLoop || aPort->IsInput() ) {
+          portsToRemove.append( obj );
+        }
       }
-      // check if port has a link (output porst of Loop node are also checked)
-      if ( !aPort->IsGate() && aPort->IsLinked() && !isAnyLinked)
-       isAnyLinked = true;
-      // check if input port has an input value
-      if ( !aPort->IsGate() && aPort->IsInput() && aPort->HasInput() )
-       InNameInput.insert( QString(aPort->Name()), 
-                           QPair<QString, QString>(QString(aPort->Type()),QString(aPort->ToString())) );
     }
     delete oldPorts; // delete the list, not the objects
 
-    // mkr : PAL8060 -->
-    QString aNodeName = myNode->getEngine()->Name();
-    QValueList< QPair< QString,QString > > InPortsL, OutPortsL;
-    if ( isAnyLinked ) {
-      // if myNode has linked port(s), create two lists of In/Out ports (InPortsL, OutPortsL) to identify all links for myNode
-      QObjectList* list = myNode->getMain()->getCanvas()->queryList("SUPERVGUI_CanvasLink");
-      QObjectListIt listit( *list );
-      QObject *listobj;
-      while ( (listobj = listit.current()) != 0 ) {
-       ++listit;
-       SUPERV::Link_var aLink = ((SUPERVGUI_CanvasLink*)listobj)->getEngine();
-       if ( aNodeName.compare(aLink->InPort()->Node()->Name()) == 0
-            ||
-            aNodeName.compare(aLink->OutPort()->Node()->Name()) == 0 ) {
-         QPair<QString, QString> InPair(QString(aLink->InPort()->Node()->Name()), QString(aLink->InPort()->Name()));
-         QPair<QString, QString> OutPair(QString(aLink->OutPort()->Node()->Name()), QString(aLink->OutPort()->Name()));
-         InPortsL.append(InPair);
-         OutPortsL.append(OutPair);
-       }
-
-       if ( isLoop ) {
-         // put into In/Out lists all links for corresponding EndLoop node
-         QString aCoupledNodeName = ((SUPERVGUI_CanvasStartNode*)myNode)->getCoupled()->getEngine()->Name();
-         if ( aCoupledNodeName.compare(aLink->InPort()->Node()->Name()) == 0
-              ||
-              aCoupledNodeName.compare(aLink->OutPort()->Node()->Name()) == 0 ) {
-           QPair<QString, QString> InPair(QString(aLink->InPort()->Node()->Name()), QString(aLink->InPort()->Name()));
-           QPair<QString, QString> OutPair(QString(aLink->OutPort()->Node()->Name()), QString(aLink->OutPort()->Name()));
-           InPortsL.append(InPair);
-           OutPortsL.append(OutPair);
-         } 
-       }
-      }
-    }
-    // mkr : PAL8060 <--
-    
-    // portsToRemove list contains:
-    // for Loop node: all INPUT ports except Gates
-    // for other Inline: all INPUT and OUTPUT ports except Gates
-    it = QObjectListIt( portsToRemove );
-    while ( (obj = it.current()) != 0 ) {
-      ++it;
-      ((SUPERVGUI_CanvasPort*)obj)->remove();
-    }
-
     // 1.2 create new ports in INode and CanvasPort in myNode
+    //     or just reorder existing ports
     PortListItem* item;
-    SUPERV_Port aPort;
-    for ( i = 0; i < myInList->count(); i++ ) {
+    for (i = 0; i < myInList->count(); i++) {
       item = (PortListItem*)myInList->item( i );
-      aPort = aINode->InPort( item->PortName.latin1(), item->PortType.latin1() );
-      if ( InNameInput.contains( item->PortName ) 
-          && 
-          item->PortType.compare(InNameInput[item->PortName].first) == 0 ) {
-       // i.e. aPort is input and had a value (not linked!)
-       // if ports' name and type didn't change and ports had an input value => set this value again
-       SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
-       if ( aSupMod )
-         aPort->Input( aSupMod->getEngine()->StringValue( InNameInput[item->PortName].second ) );
-       myNode->createPort( aPort.in() );
+      // try existing ports
+      bool isExisting = false;
+      QObjectListIt itRem (portsToRemove);
+      QObject *objRem;
+      for (; (objRem = itRem.current()) != 0 && !isExisting; ++itRem) {
+        SUPERV::Port_var aPort = ((SUPERVGUI_CanvasPort*)objRem)->getEngine();
+        if (item->PortName.compare(aPort->Name()) == 0 &&
+            item->PortType.compare(aPort->Type()) == 0) {
+          // ports reordering
+          myNode->removeChild(objRem);
+          myNode->insertChild(objRem);
+          portsToRemove.remove(objRem);
+          isExisting = true;
+        }
       }
-      else {
-       myNode->createPort( aPort.in() );
-       // mkr : PAL8060
-       if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() )
-         // create links for those input ports, which had links earlier
-         createLinkEngine( aPort, InPortsL, OutPortsL );
+      if (!isExisting) {
+        // create a new port
+        SUPERV::Port_var aPort = aINode->InPort( item->PortName.latin1(), item->PortType.latin1() );
+        myNode->createPort( aPort.in() );
       }
     }
-    
-    if ( isLoop ) {
+
+    // 1.3 create/reorder Out-ports
+    if (isLoop) {
       // asv : 11.01.05 : for Loop nodes do the same as in SUPERVGUI_CanvasStartNode::addInputPort()
       SUPERVGUI_CanvasStartNode* aStartLoopNode = (SUPERVGUI_CanvasStartNode*)myNode;
       aStartLoopNode->merge();
       aStartLoopNode->getCoupled()->merge();
-     
-      // mkr : PAL8060 -->
-      if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() ) {
-
-       // 1) create old links for output ports of Loop node
-       QObjectList* aPortsOut = aStartLoopNode->queryList("SUPERVGUI_CanvasPortOut");
-       QObjectListIt aPorstOutit( *aPortsOut );
-       QObject *listobj;
-       while ( (listobj = aPorstOutit.current()) != 0 ) {
-         ++aPorstOutit;
-       
-         SUPERV::Port_var aPortOut = ((SUPERVGUI_CanvasPort*)listobj)->getEngine();
-         createLinkEngine( aPortOut, OutPortsL, InPortsL );
-       }
-
-       // 2) create old links for input ports of EndLoop node
-       QObjectList* aPortsIn = aStartLoopNode->getCoupled()->queryList("SUPERVGUI_CanvasPortIn");
-       QObjectListIt aPorstInit( *aPortsIn );
-       while ( (listobj = aPorstInit.current()) != 0 ) {
-         ++aPorstInit;
-       
-         SUPERV::Port_var aPortIn = ((SUPERVGUI_CanvasPort*)listobj)->getEngine();
-         createLinkEngine( aPortIn, InPortsL, OutPortsL );
-       }
-
-       // 3) create old links for output ports of EndLoop node
-       aPortsOut = aStartLoopNode->getCoupled()->queryList("SUPERVGUI_CanvasPortOut");
-       aPorstOutit = QObjectListIt( *aPortsOut );
-       while ( (listobj = aPorstOutit.current()) != 0 ) {
-         ++aPorstOutit;
-       
-         SUPERV::Port_var aPortOut = ((SUPERVGUI_CanvasPort*)listobj)->getEngine();
-         createLinkEngine( aPortOut, OutPortsL, InPortsL );
-       }
+    }
+    else {
+      // for non-loop nodes manage out-ports in the same way as in-ports
+      for (i = 0; i < myOutList->count(); i++) {
+        item = (PortListItem*)myOutList->item( i );
+        // try existing ports
+        bool isExisting = false;
+        QObjectListIt itRem (portsToRemove);
+        QObject *objRem;
+        for (; (objRem = itRem.current()) != 0 && !isExisting; ++itRem) {
+          SUPERV::Port_var aPort = ((SUPERVGUI_CanvasPort*)objRem)->getEngine();
+          if (item->PortName.compare(aPort->Name()) == 0 &&
+              item->PortType.compare(aPort->Type()) == 0) {
+            // ports reordering
+            myNode->removeChild(objRem);
+            myNode->insertChild(objRem);
+            portsToRemove.remove(objRem);
+            isExisting = true;
+          }
+        }
+        if (!isExisting) {
+          // create a new port
+          SUPERV::Port_var aPort = aINode->OutPort(item->PortName.latin1(), item->PortType.latin1());
+          myNode->createPort(aPort.in());
+        }
       }
-      // mkr : PAL8060 <--
     }
 
-    // creating Out-ports, except LoopNode-s
-    for ( i = 0; i < myOutList->count() && !isLoop; i++ ) {
-      item = (PortListItem*)myOutList->item( i );
-      aPort = aINode->OutPort( item->PortName.latin1(), item->PortType.latin1() );
-      myNode->createPort( aPort.in() );
-
-      // mkr : PAL8060
-      if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() )
-       // create links for those output ports, which had links earlier
-       createLinkEngine( aPort, OutPortsL, InPortsL );
-    }  
+    // 1.4 remove disappeared ports
+    QObjectListIt itRem ( portsToRemove );
+    QObject *objRem;
+    for (; (objRem = itRem.current()) != 0; ++itRem) {
+      ((SUPERVGUI_CanvasPort*)objRem)->remove();
+    }
 
     // 2. update the node's presentation
+    myNode->getPrs()->updatePorts();
     myNode->getMain()->getCanvas()->update();
   }
-  
+
   // 3. close the dialog
   myNode->getMain()->lockedGraph( false );
   QDialog::accept();
-  close();
 }
 
 /** 
@@ -522,14 +465,6 @@ void SUPERVGUI_ManagePortsDlg::reject() {
   close();
 }
 
-/**
- * Update current values on show event
- */
-void SUPERVGUI_ManagePortsDlg::showEvent( QShowEvent* theEvent ) {
-  init( myNode );
-  QDialog::showEvent( theEvent );
-}
-
 /**
  * Initialize In/Out tables with values from the given node
  */
@@ -555,12 +490,12 @@ void SUPERVGUI_ManagePortsDlg::init( const SUPERVGUI_CanvasNode* theNode ) {
     if ( aPorts[i]->IsGate() )
       continue;
     if ( aPorts[i]->IsInput()
-        &&
-        !myInList->findItem( QString( "%1 (%2)" ).arg( aPorts[i]->Name() ).arg( aPorts[i]->Type() ) ) ) // mkr : PAL11332
+         &&
+         !myInList->findItem( QString( "%1 (%2)" ).arg( aPorts[i]->Name() ).arg( aPorts[i]->Type() ) ) ) // mkr : PAL11332
       new PortListItem( myInList, aPorts[i]->Name(), aPorts[i]->Type() );
     if ( !aPorts[i]->IsInput()
-        &&
-        !myOutList->findItem( QString( "%1 (%2)" ).arg( aPorts[i]->Name() ).arg( aPorts[i]->Type() ) ) ) // mkr : PAL11332 
+         &&
+         !myOutList->findItem( QString( "%1 (%2)" ).arg( aPorts[i]->Name() ).arg( aPorts[i]->Type() ) ) ) // mkr : PAL11332 
       new PortListItem( myOutList, aPorts[i]->Name(), aPorts[i]->Type() );
   }
 }
@@ -573,8 +508,8 @@ void SUPERVGUI_ManagePortsDlg::addPort( QListBox* theLB ) {
     bool found = false; // check if already exists -- and don't allow if yes
     for ( int i = 0; i < theLB->count(); i++ ) {
       if ( ((PortListItem*)theLB->item(i))->PortName == name ) {
-       found = true;
-       break;
+        found = true;
+        break;
       }
     }
     if ( found )
@@ -652,6 +587,19 @@ bool isEditingItem( const QListBoxItem* item, const QListBox* theLB ) {
  * the last selected by user item in myInList or myOutList (myLastItem)
  */
 void SUPERVGUI_ManagePortsDlg::nameChanged( const QString& name ) {
+  // mkr: IPAL12512
+  if ( isEditingItem( myLastItem, myInList ) && myInList->findItem( QString( "%1 (%2)" ).arg( name ).arg( ((PortListItem*)myLastItem)->PortType ))
+       ||
+       isEditingItem( myLastItem, myOutList ) && myOutList->findItem( QString( "%1 (%2)" ).arg( name ).arg( ((PortListItem*)myLastItem)->PortType ))) {
+    disconnect( myNameEdt, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
+    
+    myNameEdt->setText( ((PortListItem*)myLastItem)->PortName );
+    
+    connect( myNameEdt, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
+    QMessageBox::warning( this, tr("ERROR"), tr("MSG_PORT_EXIST") );
+    return;
+  }
+  
   if ( isEditingItem( myLastItem, myInList ) || isEditingItem( myLastItem, myOutList ) ) {
     ((PortListItem*)myLastItem)->PortName = name;
     //myLastItem->listBox()->repaint( true );
@@ -761,9 +709,12 @@ SUPERVGUI_PortParamsDlg::SUPERVGUI_PortParamsDlg(const QStringList& thePortsName
 void SUPERVGUI_PortParamsDlg::clickOnOk()
 {
   if (getName().isEmpty() || getType().isEmpty())
-    QMessageBox::warning( SUIT_Session::session()->activeApplication()->desktop(), tr( "ERROR" ), tr( "MSG_CANT_CREATE_PORT" ) );
+    QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(),
+                         tr("ERROR"), tr("MSG_CANT_CREATE_PORT"));
   else if (myPortsNames.contains(getName()))
     QMessageBox::warning( this, tr("ERROR"), tr("MSG_PORT_EXIST") ); // mkr : IPAL10386
-  else  
+  else {
     accept();
+    close();
+  }
 }
index ac6cd16ab2a780caff52386260fa194a35dd12a3..c603b936123cf76b66dbcbb5cf4a62431448b2d3 100644 (file)
@@ -81,7 +81,6 @@ protected slots:
   void itemDeselect(QListBoxItem* item, const QPoint& point); // mkr: PAL12448
 
 protected:
-  virtual void showEvent( QShowEvent* theEvent );
   void addPort( QListBox* );
   void removePort( QListBox* );
   void moveUp( QListBox* );
index 7a42fb6676a961e60fe8b6c667ae3256ad938d12..9d9c9d27d673c1f7401c3e4f1f88b1571ab627a3 100644 (file)
@@ -117,6 +117,8 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
   aBaseLayoutV->setSpacing(10);
 
   QHBoxLayout* aBaseLayout = new QHBoxLayout(aCorbaPane); //!!
+  aBaseLayout->setMargin(5);
+  aBaseLayout->setSpacing(10);
  
   components = new QListView(aCorbaPane);
   components->addColumn(tr("COL_COMPONENTS"));
@@ -127,6 +129,7 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
   components->setColumnAlignment(3, AlignLeft);
   components->setSelectionMode(QListView::Extended);
   components->setRootIsDecorated(true);
+
 //  aBaseLayout->addWidget(components);
   aBaseLayoutV->addWidget(components); //!!
 
@@ -137,11 +140,16 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
 //NRI   connect(aComputeCBtn, SIGNAL(clicked()), this, SLOT(addComputeNode())); //!!
 //NRI   aComputeCBtn->setDefault(false); 
 
-  QPushButton* aComputeBtn = new QPushButton(tr("TIT_ADDFNODE"), aCorbaPane);
-  connect(aComputeBtn, SIGNAL(clicked()), this, SLOT(addFactoryNode()));
-  aComputeBtn->setDefault(true); 
+  QPushButton* aComputeBtnDef = new QPushButton(tr("TIT_ADDFNODE"), aCorbaPane);
+  connect(aComputeBtnDef, SIGNAL(clicked()), this, SLOT(addFactoryNodeDef()));
+  aComputeBtnDef->setDefault(true); 
+
+  QPushButton* aComputeBtnCust = new QPushButton(tr("TIT_ADDFNODE_CUST"), aCorbaPane);
+  connect(aComputeBtnCust, SIGNAL(clicked()), this, SLOT(addFactoryNodeCust()));
+  aComputeBtnCust->setDefault(true); 
 
-  aBaseLayout->addWidget(aComputeBtn);
+  aBaseLayout->addWidget(aComputeBtnDef);
+  aBaseLayout->addWidget(aComputeBtnCust);
   //NRI  aBaseLayout->addWidget(aComputeCBtn); //!!
 
   aBaseLayoutV->insertLayout(-1, aBaseLayout);
@@ -255,22 +263,22 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
 }
 
 
-char* getDataStreamParameterName(int aType)
+char* getDataStreamParameterName(const char * aType)
 {
-  switch(aType) {
-  case 1:
+  QString type (aType);
+
+  if (aType == "int") // 1
     return "integer";
-  case 2:
+  if (aType == "float") // 2
     return "float";
-  case 3:
+  if (aType == "double") // 3
     return "double";
-  case 4:
+  if (aType == "string") // 4
     return "string";
-  case 6:
+  if (aType == "bool") // 6 ??
     return "boolean";
-  default:
-    return "unknown";
-  }
+
+  return "unknown";
 }
 
 void SUPERVGUI_Service::initialise() {
@@ -328,10 +336,11 @@ void SUPERVGUI_Service::initialise() {
 
        long nbStreamPortsOut = Service->ServiceoutDataStreamParameter.length();
        for (int m=0; m<nbStreamPortsOut; m++) {
-         SALOME_ModuleCatalog::ServicesDataStreamParameter* PortOut = &(Service->ServiceoutDataStreamParameter[m]);
+         SALOME_ModuleCatalog::ServicesDataStreamParameter* PortOut =
+            &(Service->ServiceoutDataStreamParameter[m]);
          QListViewItem* myPortOutItem = 
            new QListViewItem(myServiceItem, (char*)PortOut->Parametername, 
-                             getDataStreamParameterName(PortOut->Parametertype), "DataStream Out");
+                              getDataStreamParameterName(PortOut->Parametertype), "DataStream Out");
          myPortOutItem->setSelectable(false);
        }
        
@@ -420,7 +429,7 @@ void SUPERVGUI_Service::addComputeNode() {
   }
 }
 
-void SUPERVGUI_Service::addFactoryNode() {
+void SUPERVGUI_Service::addFactoryNodeDef() {
   SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop();
   CAM_Application* anApp = ( CAM_Application* )(SUIT_Session::session()->activeApplication());
   if ( !anApp ) return;
@@ -452,8 +461,10 @@ void SUPERVGUI_Service::addFactoryNode() {
          const char* service   = item->text(0).latin1();
          const char* interface = item->parent()->text(0).latin1();
          //const char* component = anApp->moduleName(item->parent()->parent()->text(0).latin1());
-         if ( aSupMod->getInterfaceNameMap().contains(item->parent()->text(0)) ) {
-           const char* component = aSupMod->getInterfaceNameMap().find(item->parent()->text(0)).data();
+         // mkr : PAL13135 -->
+         if ( aSupMod->getInterfaceNameMap().contains(item->parent()->parent()->text(0)) ) {
+           const char* component = aSupMod->getInterfaceNameMap().find(item->parent()->parent()->text(0)).data();
+           // mkr : PAL13135 <--
 
            SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
            if (myComponent==NULL) {
@@ -490,6 +501,115 @@ void SUPERVGUI_Service::addFactoryNode() {
   }
 }
 
+void SUPERVGUI_Service::addFactoryNodeCust() {
+  SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop();
+  CAM_Application* anApp = ( CAM_Application* )(SUIT_Session::session()->activeApplication());
+  if ( !anApp ) return;
+
+  SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+  if ( !aSupMod ) {
+    MESSAGE("NULL Supervision module!");
+    return;
+  }
+
+  SUPERVGUI_Main* aMain = aSupMod->getMain();
+  if (aMain==0) {
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
+  } else if (!aMain->isEditable()) {
+    QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));     
+  } else {
+    CORBA::Object_ptr obj  = naming->Resolve("/Kernel/ModulCatalog");
+    SALOME_ModuleCatalog::ModuleCatalog_var* aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var;
+    *aModuleCatalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
+    if (CORBA::is_nil(*aModuleCatalog)) {
+      QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
+    } else {
+      QListViewItem*        item;
+      bool                  b = false;
+      
+      QListViewItemIterator iSel(components);
+      int count = 0;
+      for (; iSel.current(); ++iSel) { // check : how many objects are selected (single or multi)
+       item = iSel.current();
+       if (item->isSelected()) count++;
+       if ( count > 1) break;
+      }
+          
+      QListViewItemIterator i(components);
+      QString anAuthor, aContainer, aComment;
+      bool DoneSetting = false;
+      int aRes = 0;
+      for (; i.current(); ++i) {
+       item = i.current();
+       if (item->isSelected()) {
+         const char* service   = item->text(0).latin1();
+         const char* interface = item->parent()->text(0).latin1();
+         //const char* component = anApp->moduleName(item->parent()->parent()->text(0).latin1());
+         // mkr : PAL13135 -->
+         if ( aSupMod->getInterfaceNameMap().contains(item->parent()->parent()->text(0)) ) {
+           const char* component = aSupMod->getInterfaceNameMap().find(item->parent()->parent()->text(0)).data();
+           // mkr : PAL13135 <--
+
+           SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
+           if (myComponent==NULL) {
+             QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
+           } 
+           else {
+             const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
+             SUPERV_CNode aNode;
+             if ( myService->TypeOfNode == 0 ) { // ComputeNode
+               aNode = aMain->getDataflow()->CNode(*myService);
+               if (CORBA::is_nil( aNode ) ) {
+                 QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));        
+                 return;
+               }
+             } 
+             else { // Factory Node
+
+               SUPERVGUI_CustomSettings* aCSDialog = 0;
+               if ( count > 1 && !DoneSetting) { // multi selection
+                 DoneSetting = true;
+                 aCSDialog = new SUPERVGUI_CustomSettings(item, true, myComponent->implementation_type());
+               }
+               else if ( count == 1 ) // single selection
+                 aCSDialog = new SUPERVGUI_CustomSettings(item, false, myComponent->implementation_type());
+               
+               if ( aCSDialog ) {
+                 aRes = aCSDialog->exec();
+                 if (aRes) {
+                   anAuthor = aCSDialog->Author();
+                   aContainer = aCSDialog->Container();
+                   aComment = aCSDialog->Comment();
+                 }
+                 delete aCSDialog;
+               }
+               
+               aNode = aMain->getDataflow()->FNode(component, interface, *myService, myComponent->implementation_type()); // mkr : PAL11273
+               if ( CORBA::is_nil( aNode ) ) {
+                 QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));        
+                 return;
+               }
+
+               if (aRes) {
+                 aNode->SetAuthor(anAuthor.latin1());
+                 SUPERV::FNode::_narrow(aNode)->SetContainer(aContainer.latin1());
+                 aNode->SetComment(aComment.latin1());
+               }
+               
+             }
+             SUPERV::INode_var aDummyEndNode;
+             addNode( aNode, aDummyEndNode, myX, myY );
+             b = true;
+           }
+         }
+       }
+      }
+      if ( !b ) {
+       QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD"));
+      }
+    }
+  }
+}
 
 void SUPERVGUI_Service::addInlineNode() {
   SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
@@ -704,9 +824,9 @@ void SUPERVGUI_Service::tabChanged(QWidget* theWidget) {
 
 
 
-//*****************************************************
+//*****************************************************/
 //  Pane for Python script editing
-//*****************************************************
+//*****************************************************/
 SUPERVGUI_PythonEditPane::SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation, int& theX, int& theY ) 
   : myIsWithLibrary( isNodeCreation ), 
     QFrame( theParent ),
@@ -877,8 +997,10 @@ SUPERV_Strings SUPERVGUI_PythonEditPane::getFunction() {
     // it's user's responsibility to enter correct Python code, we don't do anything with it.
     // if (..) -- initial, while(..) -- my improvement, but also commented out -- needless.
     //if (!aLine.right(1).compare(" ")) // replaced with the line below -- loop
-    //while (aLine.at(aLine.length()-1).isSpace()) // remove trailing spaces
-    //  aLine = aLine.remove(aLine.length()-1,1);
+    // uncommented by mkr to fix bugs IPAL12363, IPAL12885 -->
+    while (aLine.at(aLine.length()-1).isSpace()) // remove trailing spaces
+      aLine = aLine.remove(aLine.length()-1,1);
+    // <--
     aStrings[i] = CORBA::string_dup(aLine.latin1());
   }
   return aStrings._retn();
@@ -918,7 +1040,7 @@ void SUPERVGUI_PythonEditPane::autoIndentLine() {
       i = -1;
       while ( line[++i].isSpace() ) // append all isSpace() characters at beginning of line to spacesStr
        spacesStr += line[i];
-      
+
       // if ':' was found -- add more spaces to spacesStr
       line = line.stripWhiteSpace();
       if ( line[ line.length()-1 ] == ':' ) {
@@ -1057,3 +1179,166 @@ void SUPERVGUI_Service::addNode( SUPERV::CNode_var theNode, SUPERV::INode_var th
   }
 }
 
+/*!
+  Constructor
+*/
+SUPERVGUI_CustomSettings::SUPERVGUI_CustomSettings(QListViewItem* theItem,
+                                                  bool isMultiSel,
+                                                  bool isCimpl)
+     : QDialog( SUIT_Session::session()->activeApplication()->desktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) 
+{
+  Trace("SUPERVGUI_CustomSettings::SUPERVGUI_CustomSettings");
+
+  SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+  if ( !aSupMod ) {
+    MESSAGE("NULL Supervision module!");
+    return;
+  }
+
+  SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop();
+
+  setSizeGripEnabled( true );
+
+  QGridLayout* TopLayout = new QGridLayout( this );
+  TopLayout->setSpacing( 6 );
+  TopLayout->setMargin( 11 );
+    
+  QGroupBox* TopGroup = new QGroupBox( this, "TopGroup" );
+  TopGroup->setColumnLayout(0, Qt::Vertical );
+  TopGroup->layout()->setSpacing( 0 );
+  TopGroup->layout()->setMargin( 0 );
+  QGridLayout* TopGroupLayout = new QGridLayout( TopGroup->layout() );
+  TopGroupLayout->setAlignment( Qt::AlignTop );
+  TopGroupLayout->setSpacing( 6 );
+  TopGroupLayout->setMargin( 11 );
+
+  QLabel* authL = new QLabel( tr( "AUTHOR_LBL" ), TopGroup); 
+  authV = new QLineEdit( TopGroup );
+  authV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  authV->setMinimumSize( 200, 0 );
+  authV->setText( "" );
+
+  contL = new QLabel( tr( "CONTAINER_LBL" ), TopGroup ); 
+  contV = new QLineEdit( TopGroup );
+  contV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  contV->setMinimumSize( 200, 0 );
+  
+  QLabel* commL = new QLabel( tr( "COMMENT_LBL" ), TopGroup); 
+  commV = new QMultiLineEdit( TopGroup );
+  commV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+  commV->setMinimumSize( 200, 100 );
+
+  if ( !aSupMod->getInterfaceNameMap().contains(theItem->parent()->parent()->text(0)) ) {
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD"));
+    return;
+  }
+  const char* component = aSupMod->getInterfaceNameMap().find(theItem->parent()->parent()->text(0)).data();
+
+  QString aNodeDefComment;
+  if ( !isMultiSel ) {
+    // 1) set caption
+    const char* service = theItem->text(0).latin1();
+    aNodeDefComment = QString(service) + QString(tr("COMMENT_FROM")) + QString(component);
+    setCaption( tr( "TLT_CUSTOMPARAMETERS_SINGLE" ) + aNodeDefComment );
+  }
+  else {
+    // 1) set caption
+    aNodeDefComment = QString("Factory Node");
+    setCaption( tr( "TLT_CUSTOMPARAMETERS_MULTI" ) );
+  }
+  
+  // 2) set Container
+  SUPERVGUI_Main* aMain = aSupMod->getMain();
+  if (aMain==0) {
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
+    return;
+  }
+  const char* aContainer = aMain->getDataflow()->ContainerNameForComponent(component);
+  if ( aContainer && strlen(aContainer) > 0 )
+    contV->setText( QString(aContainer) );
+  else if ( isCimpl ) // C++ implementation
+    contV->setText( QString(aMain->getDataflow()->DefaultCContainerName()) );
+  else // Python implementation
+    contV->setText( QString(aMain->getDataflow()->DefaultPythonContainerName()) );
+
+  // 3) set comment
+  commV->setText( aNodeDefComment );
+
+  TopGroupLayout->addWidget( authL, 1, 0 );
+  TopGroupLayout->addWidget( authV, 1, 1 );
+  TopGroupLayout->addWidget( contL, 2, 0 );
+  TopGroupLayout->addWidget( contV, 2, 1 );
+  TopGroupLayout->addWidget( commL, 7, 0 );
+  TopGroupLayout->addMultiCellWidget( commV, 7, 8, 1, 1 );
+  TopGroupLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::Expanding  ), 8, 0 );
+  TopGroupLayout->setColStretch( 1, 5 );
+
+  QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
+  GroupButtons->setColumnLayout(0, Qt::Vertical );
+  GroupButtons->layout()->setSpacing( 0 );
+  GroupButtons->layout()->setMargin( 0 );
+  QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
+  GroupButtonsLayout->setAlignment( Qt::AlignTop );
+  GroupButtonsLayout->setSpacing( 6 );
+  GroupButtonsLayout->setMargin( 11 );
+
+  QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
+  connect( okB,     SIGNAL( clicked() ), this, SLOT( okButton() ) );
+  QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
+  connect( cancelB, SIGNAL( clicked() ), this, SLOT( koButton() ) );
+
+  GroupButtonsLayout->addWidget( okB, 0, 0 );
+  GroupButtonsLayout->addItem  ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
+  GroupButtonsLayout->addWidget( cancelB, 0, 2 );
+
+  TopLayout->addWidget( TopGroup,     0, 0 );
+  TopLayout->addWidget( GroupButtons, 1, 0 );
+  TopLayout->setRowStretch( 0, 1 );
+  TopLayout->setRowStretch( 1, 0 );
+
+  resize(370,200);
+}
+
+/*!
+  Destructor
+*/
+SUPERVGUI_CustomSettings::~SUPERVGUI_CustomSettings() {
+  Trace("SUPERVGUI_CustomSettings::~SUPERVGUI_CustomSettings");
+}
+
+/*!
+  Get author
+*/
+QString SUPERVGUI_CustomSettings::Author() {
+  return authV->text();
+}
+
+/*!
+  Get container
+*/
+QString SUPERVGUI_CustomSettings::Container() {
+  return contV->text();
+}
+
+/*!
+  Get comment
+*/
+QString SUPERVGUI_CustomSettings::Comment() {
+  return commV->text();
+}
+
+/*!
+  <OK> button slot
+*/
+void SUPERVGUI_CustomSettings::okButton() {
+  Trace("SUPERVGUI_CustomSettings::okButton");
+  accept();
+}
+
+/*!
+  <Cancel> button slot
+*/
+void SUPERVGUI_CustomSettings::koButton() {
+  Trace("SUPERVGUI_CustomSettings::koButton");
+  reject();
+}
index 6fb1f56e41f5fe793b50e5e7a2889279eaae4337..f28da4ce52a247935ba6cb6858c0171c16758fa4 100644 (file)
@@ -115,7 +115,8 @@ private:
 private slots:
     void tabChanged(QWidget *);
     void addComputeNode();
-    void addFactoryNode();
+    void addFactoryNodeDef();
+    void addFactoryNodeCust();
     void addInlineNode();
     void addMacroNode();
     void typeNodeSelected(int theRow);
@@ -210,4 +211,28 @@ private:
   SUPERVGUI_PythonEditPane* myNextPane;
 };
 
+class SUPERVGUI_CustomSettings: public QDialog {
+  Q_OBJECT
+
+  public:
+    SUPERVGUI_CustomSettings(QListViewItem* theItem, bool isMultiSel, bool isCimpl);
+    virtual ~SUPERVGUI_CustomSettings();
+
+    QString Author();
+    QString Container();
+    QString Comment();
+
+  private slots:
+    void okButton();
+    void koButton();
+
+  private:
+
+    QLineEdit*      authV;
+    QLineEdit*      contV;
+    QLabel*         contL;
+
+    QMultiLineEdit* commV;
+};
+
 #endif
index 45a1d25d7e2b6558736455e8d5d82cb5ea40a0b4..0c7e9f2bb9f95d96787a4e4d66a32da6f98090d1 100644 (file)
@@ -495,6 +495,12 @@ msgstr "Rename Dataflow"
 msgid "TLT_INFORMATIONS"
 msgstr "Informations"
 
+msgid "TLT_CUSTOMPARAMETERS_SINGLE"
+msgstr "Set Custom Parameters for "
+
+msgid "TLT_CUSTOMPARAMETERS_MULTI"
+msgstr "Set Custom Parameters for a selected nodes"
+
 msgid "TLT_DSGRAPHPARAMS"
 msgstr "Data Stream Graph Parameters"
 
@@ -633,6 +639,9 @@ msgstr "Add Compute Node"
 msgid "TIT_ADDFNODE"
 msgstr "Add Node"
 
+msgid "TIT_ADDFNODE_CUST"
+msgstr "Add Node and Customize Parameters"
+
 msgid "BTN_FACTORYNODE"
 msgstr "Factory"
 
@@ -929,7 +938,7 @@ msgid "TOP_POP_DISPLAY"
 msgstr "Display Dataflow"
 
 msgid "MEN_POP_DISPLAY"
-msgstr "Display"
+msgstr "Show"
 
 msgid "STB_POP_DISPLAY"
 msgstr "Display Dataflow"
index 3b2addf9c9309fed1bae4bf31df8f7d7eb1419d8..6933b275ed99863ebf8b615a34baf5c6d5c3e579 100644 (file)
@@ -37,8 +37,6 @@ using namespace std;
 
 #include "StreamPort_Impl.hxx"
 
-char *FACTORYSERVERPY = "localhost/FactoryServerPy" ;
-
 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
                        PortableServer::POA_ptr poa ,
                        PortableServer::ObjectId * contId , 
index a7a801aa13fdbc785b13f3494d3e825bc43a0f7f..b136c7faacb079cac747aee5f9f03ae54eb1a6e6 100644 (file)
@@ -64,6 +64,13 @@ FNode_Impl::FNode_Impl( CORBA::ORB_ptr orb ,
 //                                           NodeKindOfNode ) ) ;
   DataFlowNode()->ComponentName( NodeComponentName ) ;
   DataFlowNode()->InterfaceName( NodeInterfaceName ) ;
+
+  // mkr : PAL13947 -->
+  const char * aContainer = DataFlowEditor()->Graph()->RetrieveFromMapOfComponentNameContainer(NodeComponentName);
+  if ( aContainer ) // container for NodeComponentName component was found in the map
+    SetContainer( aContainer );
+  // mkr : PAL13947 <--
+
   endService( "FNode_Impl::FNode_Impl" );  
 //  cout << "<-- FNode_Impl::FNode_Impl" << endl ;
 }
@@ -161,6 +168,10 @@ bool FNode_Impl::SetContainer( const char * aDataFlowContainer ) {
 //  GraphExecutor::DataFlow * _DataFlowExecutor = DataFlowEditor()->Executor() ;
 //  if ( DataFlowEditor()->IsEditing() ) {
     RetVal = DataFlowNode()->Computer( aDataFlowContainer ) ;
+
+    // insert modified container into < ComponentName, Container > map
+    DataFlowEditor()->Graph()->InsertToMapOfComponentNameContainer( GetComponentName(), aDataFlowContainer ) ; // mkr : PAL13947
+
 //  }
 //  else if ( _DataFlowExecutor && ( _DataFlowExecutor->IsSuspended() ||
 //            _DataFlowExecutor->IsSuspended( DataFlowNode()->Name() ) ) ) {
index 89228a591aaa5939d988116f4919393faff38612..bc12026c729cf8bef3bbfbe3d22237167579eb41 100644 (file)
@@ -247,7 +247,8 @@ bool GNode_Impl::SetCoupled( const char * anInLineNode )
        ( !IsGOTO() && ( IsLoop() || IsSwitch() || IsEndLoop() || IsEndSwitch() ) ) ) {
     DataFlowNode()->CoupledNode( CoupledINode ) ;
     if ( CoupledINode && IsSwitch() ) {
-      DataFlowEditor()->AddLink( Name() , "Default" ,CoupledINode->Name() , "Default" ) ;
+//JR NPAL14793 05.02.2007 : do not add that link
+//      DataFlowEditor()->AddLink( Name() , "Default" ,CoupledINode->Name() , "Default" ) ;
     }
     else if ( CoupledINode && ( IsLoop() || IsEndLoop() ) ) {
       DataFlowEditor()->AddLink( Name() , "DoLoop" , CoupledINode->Name() , "DoLoop" ) ;
index 7564fd6402447b8bda97ee9c3762154e22be09c2..bbc0feca64336ecf870de88d2193f2b0efb15b24 100644 (file)
@@ -401,9 +401,20 @@ SUPERV::CNode_ptr Graph_Impl::CNode( const SALOME_ModuleCatalog::Service &NodeSe
 SUPERV::FNode_ptr Graph_Impl::FNode( const char * NodeComponentName ,
                                      const char * NodeInterfaceName ,
                                      const SALOME_ModuleCatalog::Service &NodeService ,
-                                    bool isCimpl ) {
+                                    const SALOME_ModuleCatalog::ImplType ImplType ) {
   beginService( "Graph_Impl::FNode" );
   SUPERV::FNode_var iobject = SUPERV::FNode::_nil() ;
+  bool isCimpl = true;
+  switch (ImplType)
+  {
+  case SALOME_ModuleCatalog::PY:
+    isCimpl = false;
+    break;
+  case SALOME_ModuleCatalog::SO:
+  case SALOME_ModuleCatalog::EXE:
+  default:
+    ;
+  }
   if ( DataFlowEditor()->IsEditing() && !DataFlowEditor()->IsReadOnly() && !IsMacro() ) {
     FNode_Impl * myNode = new FNode_Impl( _Orb , _Poa , _ContId ,
                                           instanceName() , interfaceName() ,
@@ -516,12 +527,12 @@ SUPERV::LNode_ptr Graph_Impl::LNode( const char * InitName ,
       SALOME_ModuleCatalog::Service aVoidService = SALOME_ModuleCatalog::Service() ;
       char * anEndName ;
       if ( strlen( InitName ) ) {
-        anEndName = new char( 3 + strlen( InitName ) + 1 ) ;
+        anEndName = new char[ 3 + strlen( InitName ) + 1 ];
         strcpy( anEndName , "End" ) ;
         strcat( anEndName , InitName ) ;
       }
       else {
-        anEndName = new char( 3 + strlen( "Loop" ) + 1 ) ;
+        anEndName = new char[ 3 + strlen( "Loop" ) + 1 ];
         strcpy( anEndName , "EndLoop" ) ;
       }
       ELNode_Impl * myEndNode = new ELNode_Impl( _Orb , _Poa , _ContId ,
@@ -589,10 +600,11 @@ SUPERV::SNode_ptr Graph_Impl::SNode( const char * FuncName ,
       myEndNode->SetObjRef( SUPERV::ESNode::_duplicate( iendobject ) ) ;
       myNode->SetCoupled( myEndNode->BaseNode()->Name() ) ;
       myEndNode->SetCoupled( myNode->BaseNode()->Name() ) ;
-      if ( !Link( myNode->Port( "Default" ) , myEndNode->Port( "Default" ) ) ) {
-        iobject = SUPERV::SNode::_nil() ;
-        iendobject = SUPERV::ESNode::_nil() ;
-      }
+//JR NPAL14793 05.02.2007 : do not add that link
+//      if ( !Link( myNode->Port( "Default" ) , myEndNode->Port( "Default" ) ) ) {
+//        iobject = SUPERV::SNode::_nil() ;
+//        iendobject = SUPERV::ESNode::_nil() ;
+//      }
     }
   }
   anEndOfSwitch = SUPERV::ESNode::_duplicate( iendobject ) ;
@@ -812,6 +824,7 @@ SUPERV::Graph_var Graph_Impl::LoadDataFlows( GraphExecutor::DataFlow * aDataFlow
          GraphExecutor::DataFlow * aMacroGraphExecutor ;
          CreateExecutor( _Orb , instanceName() , aMacroGraphName , SUPERV::DataStreamGraph ,
                        dbgfile , &aMacroGraphExecutor );
+          theAutomaton->Executed() ; // Decrement _GraphExecutingNumber for MacroSubGraph
 
        // set GraphMacroLevel for Executor's graph
          GraphBase::Graph* aMacroGraphExe = aMacroGraphExecutor->Graph();
@@ -2187,10 +2200,12 @@ bool Graph_Impl::Merge(const SUPERV::Graph_ptr aGraph , map< string , int > & aM
     if ( RetVal ) {
       for ( i = 0 ; i < (int ) aGraphNodes->FNodes.length() ; i++ ) {
         SUPERV::FNode_var aNode = (aGraphNodes->FNodes)[ i ] ;
+        SALOME_ModuleCatalog::ImplType implType = SALOME_ModuleCatalog::SO;
+        if (!aNode->IsCimpl()) implType = SALOME_ModuleCatalog::PY;
         SUPERV::FNode_ptr myNode = FNode( aNode->GetComponentName() ,
                                           aNode->GetInterfaceName() ,
                                           *(aNode->Service()) ,
-                                         aNode->IsCimpl() ) ; // mkr : PAL11273
+                                         implType ) ; // mkr : PAL11273
         if ( !CORBA::is_nil( myNode ) ) {
           myNode->SetName( aNode->Name() ) ;
           myNode->SetAuthor( aNode->Author() ) ;
@@ -2245,10 +2260,10 @@ bool Graph_Impl::Merge(const SUPERV::Graph_ptr aGraph , map< string , int > & aM
             SUPERV::ListOfStreamPorts myStreamPorts = *(aNode->StreamPorts()) ;
             for ( j = 0 ; j < (int ) myStreamPorts.length() ; j++ ) {
               if ( myStreamPorts[ j ]->IsInput() ) {
-                aPort = myNode->InStreamPort( myStreamPorts[ j ]->Name() , StringToDataStreamType( myStreamPorts[ j ]->Type() ) , myStreamPorts[ j ]->Dependency() ) ;
+                aPort = myNode->InStreamPort( myStreamPorts[ j ]->Name(), myStreamPorts[ j ]->Type(), myStreamPorts[ j ]->Dependency() ) ;
              }
               else {
-                aPort = myNode->OutStreamPort( myStreamPorts[ j ]->Name() , StringToDataStreamType( myStreamPorts[ j ]->Type() ) , myStreamPorts[ j ]->Dependency() ) ;
+                aPort = myNode->OutStreamPort( myStreamPorts[ j ]->Name(), myStreamPorts[ j ]->Type(), myStreamPorts[ j ]->Dependency() ) ;
              }
            }
          }
@@ -2287,10 +2302,10 @@ bool Graph_Impl::Merge(const SUPERV::Graph_ptr aGraph , map< string , int > & aM
             SUPERV::ListOfStreamPorts myStreamPorts = *(aNode->StreamPorts()) ;
             for ( j = 0 ; j < (int ) myStreamPorts.length() ; j++ ) {
               if ( myStreamPorts[ j ]->IsInput() ) {
-                aPort = myNode->InStreamPort( myStreamPorts[ j ]->Name() , StringToDataStreamType( myStreamPorts[ j ]->Type() ) , myStreamPorts[ j ]->Dependency() ) ;
+                aPort = myNode->InStreamPort( myStreamPorts[ j ]->Name(), myStreamPorts[ j ]->Type(), myStreamPorts[ j ]->Dependency() ) ;
              }
               else {
-                aPort = myNode->OutStreamPort( myStreamPorts[ j ]->Name() , StringToDataStreamType( myStreamPorts[ j ]->Type() ) , myStreamPorts[ j ]->Dependency() ) ;
+                aPort = myNode->OutStreamPort( myStreamPorts[ j ]->Name(), myStreamPorts[ j ]->Type(), myStreamPorts[ j ]->Dependency() ) ;
              }
            }
          }
@@ -2336,10 +2351,10 @@ bool Graph_Impl::Merge(const SUPERV::Graph_ptr aGraph , map< string , int > & aM
             SUPERV::ListOfStreamPorts myStreamPorts = *(aNode->StreamPorts()) ;
             for ( j = 0 ; j < (int ) myStreamPorts.length() ; j++ ) {
               if ( myStreamPorts[ j ]->IsInput() ) {
-                aPort = myNode->InStreamPort( myStreamPorts[ j ]->Name() , StringToDataStreamType( myStreamPorts[ j ]->Type() ) , myStreamPorts[ j ]->Dependency() ) ;
+                aPort = myNode->InStreamPort( myStreamPorts[ j ]->Name(), myStreamPorts[ j ]->Type(), myStreamPorts[ j ]->Dependency() ) ;
              }
               else {
-                aPort = myNode->OutStreamPort( myStreamPorts[ j ]->Name() , StringToDataStreamType( myStreamPorts[ j ]->Type() ) , myStreamPorts[ j ]->Dependency() ) ;
+                aPort = myNode->OutStreamPort( myStreamPorts[ j ]->Name(), myStreamPorts[ j ]->Type(), myStreamPorts[ j ]->Dependency() ) ;
              }
            }
          }
@@ -2355,10 +2370,10 @@ bool Graph_Impl::Merge(const SUPERV::Graph_ptr aGraph , map< string , int > & aM
             SUPERV::ListOfStreamPorts myStreamLoopPorts = *(myEndOfLoop->StreamPorts()) ;
             for ( j = 0 ; j < (int ) myStreamLoopPorts.length() ; j++ ) {
               if ( myStreamLoopPorts[ j ]->IsInput() ) {
-                aPort = myNode->InStreamPort( myStreamLoopPorts[ j ]->Name() , StringToDataStreamType( myStreamLoopPorts[ j ]->Type() ) , myStreamLoopPorts[ j ]->Dependency() ) ;
+                aPort = myNode->InStreamPort( myStreamLoopPorts[ j ]->Name(), myStreamLoopPorts[ j ]->Type(), myStreamLoopPorts[ j ]->Dependency() ) ;
              }
               else {
-                aPort = myNode->OutStreamPort( myStreamLoopPorts[ j ]->Name() , StringToDataStreamType( myStreamLoopPorts[ j ]->Type() ) , myStreamLoopPorts[ j ]->Dependency() ) ;
+                aPort = myNode->OutStreamPort( myStreamLoopPorts[ j ]->Name(), myStreamLoopPorts[ j ]->Type(), myStreamLoopPorts[ j ]->Dependency() ) ;
              }
            }
          }
@@ -2399,10 +2414,10 @@ bool Graph_Impl::Merge(const SUPERV::Graph_ptr aGraph , map< string , int > & aM
             SUPERV::ListOfStreamPorts myStreamPorts = *(aNode->StreamPorts()) ;
             for ( j = 0 ; j < (int ) myStreamPorts.length() ; j++ ) {
               if ( myStreamPorts[ j ]->IsInput() ) {
-                aPort = myNode->InStreamPort( myStreamPorts[ j ]->Name() , StringToDataStreamType( myStreamPorts[ j ]->Type() ) , myStreamPorts[ j ]->Dependency() ) ;
+                aPort = myNode->InStreamPort( myStreamPorts[ j ]->Name(), myStreamPorts[ j ]->Type(), myStreamPorts[ j ]->Dependency() ) ;
              }
               else {
-                aPort = myNode->OutStreamPort( myStreamPorts[ j ]->Name() , StringToDataStreamType( myStreamPorts[ j ]->Type() ) , myStreamPorts[ j ]->Dependency() ) ;
+                aPort = myNode->OutStreamPort( myStreamPorts[ j ]->Name(), myStreamPorts[ j ]->Type(), myStreamPorts[ j ]->Dependency() ) ;
              }
            }
          }
@@ -2428,10 +2443,10 @@ bool Graph_Impl::Merge(const SUPERV::Graph_ptr aGraph , map< string , int > & aM
             SUPERV::ListOfStreamPorts myStreamSwitchPorts = *(myEndOfSwitch->StreamPorts()) ;
             for ( j = 0 ; j < (int ) myStreamSwitchPorts.length() ; j++ ) {
               if ( myStreamSwitchPorts[ j ]->IsInput() ) {
-                aPort = anEndOfSwitch->InStreamPort( myStreamSwitchPorts[ j ]->Name() , StringToDataStreamType( myStreamSwitchPorts[ j ]->Type() ) , myStreamSwitchPorts[ j ]->Dependency() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
+                aPort = anEndOfSwitch->InStreamPort( myStreamSwitchPorts[ j ]->Name(), myStreamSwitchPorts[ j ]->Type(), myStreamSwitchPorts[ j ]->Dependency() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
              }
               else {
-                aPort = anEndOfSwitch->OutStreamPort( myStreamSwitchPorts[ j ]->Name() , StringToDataStreamType( myStreamSwitchPorts[ j ]->Type() ) , myStreamSwitchPorts[ j ]->Dependency() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
+                aPort = anEndOfSwitch->OutStreamPort( myStreamSwitchPorts[ j ]->Name(), myStreamSwitchPorts[ j ]->Type(), myStreamSwitchPorts[ j ]->Dependency() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
              }
            }
          }
@@ -2552,3 +2567,27 @@ void Graph_Impl::Editing() {
   }
 }
 
+/**
+ * Returns the default name of container for C component
+ */
+char* Graph_Impl::DefaultCContainerName() {
+  return ( CORBA::string_dup( FACTORYSERVER ) );
+}
+
+/**
+ * Returns the default name of container for Python component
+ */
+char* Graph_Impl::DefaultPythonContainerName() {
+  return ( CORBA::string_dup( FACTORYSERVERPY ) );
+}
+
+/*! 
+ * Returns the last container name associated with theComponentName component
+ */ 
+char* Graph_Impl::ContainerNameForComponent( const char * theComponentName ) {
+  const char* aContainer = DataFlowEditor()->Graph()->RetrieveFromMapOfComponentNameContainer(theComponentName);
+  if ( aContainer )
+    return my_strdup(aContainer);
+  else
+    return "";
+}
index cf49d196e9df60305427bf40ce5d03149fa905e6..1be15cd64afe738acfcc552bce33067b13f56b28 100644 (file)
@@ -115,7 +115,7 @@ class Graph_Impl : public POA_SUPERV::Graph ,
                           const char * NodeComponentName ,
                           const char * InterfaceName ,
                           const SALOME_ModuleCatalog::Service &NodeService ,
-                         bool isCimpl ) ; // mkr : PAL11273 : C++ implementation by default
+                         const SALOME_ModuleCatalog::ImplType ImplType ) ; // mkr : PAL11273 : C++ implementation by default
     virtual SUPERV::INode_ptr INode(
                           const char * FuncName ,
                           const SUPERV::ListOfStrings & PythonFunction ) ;
@@ -158,7 +158,7 @@ class Graph_Impl : public POA_SUPERV::Graph ,
     virtual SUPERV::Link_ptr Link( SUPERV::Port_ptr OutPort ,
                                    SUPERV::Port_ptr InPort ) ;
 
-    virtual SUPERV::ListOfNodes_var Graph_Impl::SetNode( SUPERV::ListOfNodes_var RetVal ,
+    virtual SUPERV::ListOfNodes_var SetNode( SUPERV::ListOfNodes_var RetVal ,
                                                          GraphBase::ComputingNode * aNode ) ;
     virtual SUPERV::ListOfNodes * Nodes() ;
     virtual void SetNodeObjRef( GraphEditor::InNode * anInNode ) ;
@@ -212,6 +212,10 @@ class Graph_Impl : public POA_SUPERV::Graph ,
     virtual SUPERV::StreamGraph_ptr ToStreamGraph() ;
 
     virtual void Editing(); // Destroy Executor and use only Editor and its data model
+  
+    virtual char* DefaultCContainerName() ;
+    virtual char* DefaultPythonContainerName() ;
+    virtual char* ContainerNameForComponent( const char * theComponentName) ;
 
 private:
     bool run( const bool andSuspend = false ); // Run() calls run( false ), Start() calls run( true );
index a4c5a8b1a6b5e3a99094a942f6a2c592bc2bc7bf..f9af025aac71ca640e9e56fd730be31e6f851c4f 100644 (file)
@@ -283,8 +283,8 @@ SUPERV::Port_ptr INode_Impl::OutPort( const char *aParameterName ,
   return SUPERV::Port::_duplicate( Outobject );
 }
 
-SUPERV::StreamPort_ptr INode_Impl::InStreamPort( const char *aParameterName ,
-                                                 const SALOME_ModuleCatalog::DataStreamType aParameterType ,
+SUPERV::StreamPort_ptr INode_Impl::InStreamPort( const char * aParameterName ,
+                                                 const char * aParameterType ,
                                                  const SALOME_ModuleCatalog::DataStreamDependency aDependency ) {
   SUPERV::StreamPort_ptr Inobject = SUPERV::StreamPort::_nil() ;
   if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
@@ -338,7 +338,7 @@ SUPERV::StreamPort_ptr INode_Impl::InStreamPort( const char *aParameterName ,
 }
 
 SUPERV::StreamPort_ptr INode_Impl::OutStreamPort( const char * aParameterName ,
-                                                  const SALOME_ModuleCatalog::DataStreamType aParameterType ,
+                                                  const char * aParameterType ,
                                                   const SALOME_ModuleCatalog::DataStreamDependency aDependency ) {
   StreamPort_Impl * myOutStreamPort = NULL ;
   SUPERV::StreamPort_ptr Outobject = SUPERV::StreamPort::_nil() ;
index 1691195dd494496b9cddc9a96ca01b288dc56e14..3c12220a3c27009ddba8fef0b0ebe89f7ecaf5b0 100644 (file)
@@ -101,10 +101,10 @@ class INode_Impl : public CNode_Impl ,
                                       const char * aParameterType ) ;
 
     virtual SUPERV::StreamPort_ptr InStreamPort( const char * aParameterName ,
-                                                 const SALOME_ModuleCatalog::DataStreamType aParameterType ,
+                                                 const char * aParameterType ,
                                                  const SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
     virtual SUPERV::StreamPort_ptr OutStreamPort( const char * aParameterName ,
-                                                  const SALOME_ModuleCatalog::DataStreamType aParameterType ,
+                                                  const char * aParameterType ,
                                                   const SALOME_ModuleCatalog::DataStreamDependency aDependency ) ;
 
 } ;
index a60c80edf96bb0cf96653e185e012be3036abd7d..bace1d5ab5222a4543e317e92e73eb5a35823cb6 100755 (executable)
@@ -88,14 +88,14 @@ BIN = SuperV_Server_omniORB4 \
 BIN_SRC = 
 BIN_SERVER_IDL = 
 
-CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) $(BOOST_CPPFLAGS)\
+CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(OCC_INCLUDES) $(BOOST_CPPFLAGS)\
        $(KERNEL_CXXFLAGS)
 CXXFLAGS += -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \
        $(KERNEL_CXXFLAGS) $(SUPERV_LDFLAGS)
 LDFLAGS+= -lSalomeSuperVisionEditor -lSalomeSuperVisionExecutor -lSalomeSuperVisionBase \
        -lSalomeContainer -lSalomeNotification -lSalomeNS -lSalomeLifeCycleCORBA \
        -lOpUtil -lRegistry -lTOOLSDS -lSALOMELocalTrace \
-       $(QT_MT_LIBS) $(KERNEL_LDFLAGS)
+       $(QT_MT_LIBS) $(KERNEL_LDFLAGS) $(CAS_KERNEL)
 #LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS)
 
 LDFLAGSFORBIN += $(LDFLAGS) $(KERNEL_LDFLAGS) -lSalomeResourcesManager -lSALOMEBasics
index 88fcfc3de8b8e6dbfd800c03cdcf512bee932d03..8a2d3c330db7a44ff151862b2ee27a5293292a85 100644 (file)
@@ -25,7 +25,9 @@
 # see salome_shared_modules.py
 # (avoids incomplete import at run time)
 
-print "============== import SUPERV ======================="
+from launchConfigureParser import verbose
+
+if verbose(): print "============== import SUPERV ======================="
 
 import SUPERV
 
index f82a7404f6957485acf96439d1b0289ea35ff536..5a7aed0714c88d117577ec477a4ecca7243a4955 100644 (file)
@@ -833,7 +833,7 @@ class Graph(GNode):
         aService = NodeComponent.GetService( anInterface , aService )
         #if SuperVision.Swig :
             #aService = Service_Swig( aService )
-        aNode = self.G.FNode( aComponent , anInterface , aService, 1 )
+        aNode = self.G.FNode( aComponent , anInterface , aService, SALOME_ModuleCatalog.SO )
         if aNode != None :
             aNode.isCimpl = 1
             myNode = FNode( aNode , self.G.Verbose )
@@ -935,6 +935,8 @@ class Graph(GNode):
         if self.G.Verbose :
             print ErrMsg
         return aLink
+    def Messages( self ):
+        return self.G.Messages()
     def Import( self , anXmlFileName ):
         return self.G.Import( anXmlFileName )
     def Export( self , anXmlFileName ):
index 541ec6ba2f8d8eab58a35b393f5f49fcbf765112..510d76c3b5f2b6aa14d5fa66c542497691041722 100644 (file)
@@ -104,7 +104,7 @@ Engines::TMPFile * SuperV_Impl::DumpPython( CORBA::Object_ptr theStudy ,
   string aStringGraph ;
   string aStringRebuildData ;
   aStringGraph =
-    "### This file is generated by SALOME automatically by dump python funcitonality\n"
+    "### This file is generated by SALOME automatically by dump python functionality\n"
       "### of Supervisor component\n\n";
   aStringRebuildData = "def RebuildData( theStudy ) :\n" ;
   if ( CORBA::is_nil( aStudy ) ) {
@@ -835,6 +835,7 @@ SUPERV::Graph_ptr SuperV_Impl::GraphE(const char * aGraphName ) {
     myGraph->SetObjRef( SUPERV::Graph::_duplicate( iobject ) ) ;
   }
   myGraph->ReadOnly() ;
+  myGraph->DataFlowEditor()->Graph()->ClearMapOfComponentNameContainer() ; // mkr : PAL13947
   endService( "SuperV_Impl::GraphE" );
   return SUPERV::Graph::_duplicate(iobject) ;
 }
@@ -884,6 +885,7 @@ SUPERV::StreamGraph_ptr SuperV_Impl::StreamGraphE(const char * aGraphName ) {
     myStreamGraph->SetObjRef( SUPERV::StreamGraph::_duplicate( iobject ) ) ;
   }
   myStreamGraph->ReadOnly() ;
+  myStreamGraph->DataFlowEditor()->Graph()->ClearMapOfComponentNameContainer() ; // mkr : PAL13947
   endService( "SuperV_Impl::StreamGraphE" );
   return SUPERV::StreamGraph::_duplicate(iobject) ;
 }
index 54be21582134de9c7b6dfdff949b720b1df74fa3..4e7675e0289ada90a3a246251e8f9b6c804b91c5 100644 (file)
@@ -265,30 +265,33 @@ char * Value_Impl::ToString() {
   }
   ostringstream astr ;
   const char * retstr ;
+  string RetStr;
   int startstr = 0 ;
   switch (anAny.type()->kind()) {
     case CORBA::tk_string: {
       anAny >>= retstr;
+      RetStr = string(retstr);
 //      MESSAGE( "ToString( string ) '" << retstr << "'" );
       break ;
     }
     case CORBA::tk_long: {
-      long l;
+      CORBA::Long l;
       anAny >>= l;
       astr << l << ends ;
-      retstr = astr.str().c_str() ;
-//      MESSAGE( "ToString( long ) '" << l << " " << retstr << "'" );
+      RetStr = astr.str() ;
+//      MESSAGE( "ToString( CORBA::Long ) '" << l << " " << retstr << "'" );
       break ;
     }
     case CORBA::tk_double: {
       double d;
       anAny >>= d;
       astr << setw(25) << setprecision(18) << d << ends ;
-      retstr = astr.str().c_str() ;
+      RetStr = astr.str();
       int i = 0 ;
-      while ( i < (int ) strlen( retstr ) && retstr[ i++ ] == ' ' ) {
+      while ( i < (int ) RetStr.length() && RetStr.at(i++) == ' ' ) {
         startstr = i ;
       }
+      RetStr = RetStr.substr(startstr) ;
 //      MESSAGE( "ToString( double ) '" << d << "' '" << retstr << "' '" << &retstr[ startstr ] << "'");
       break ;
     }
@@ -300,22 +303,22 @@ char * Value_Impl::ToString() {
 #else
         anAny >>= obj ;
 #endif
-        retstr = _Orb->object_to_string( obj );
+       RetStr = _Orb->object_to_string( obj );
 //        MESSAGE( "ToString( object ) '" << retstr << "'" );
       }
       catch ( ... ) {
-        retstr = "object_to_string catched " ;
+       RetStr = "object_to_string catched " ;
       }
       break ;
     }
     default: {
-      retstr = "Unknown CORBA::Any Type" ;
+      RetStr = "Unknown CORBA::Any Type" ;
 //      MESSAGE( retstr );
       break ;
     }
   }
 //  endService( "Value_Impl::ToString" );
-  return CORBA::string_dup( &retstr[ startstr ] ) ;
+  return CORBA::string_dup( RetStr.c_str() ) ;
 }
 
 bool Value_Impl::IsIOR() {
index 1aefbc1dd694c8fcf9315ee168090a8a8ba56332..ffa73f634eba56d24fbd21eaeb6549909daf93ef 100644 (file)
@@ -850,7 +850,7 @@ class Graph(GNode):
         aService = NodeComponent.GetService( anInterface , aService )
         #if SuperVision.Swig :
             #aService = Service_Swig( aService )
-        aNode = self.G.FNode( aComponent , anInterface , aService, 1 )
+        aNode = self.G.FNode( aComponent , anInterface , aService, SALOME_ModuleCatalog.SO )
         if aNode != None :
             aNode.isCimpl = 1
             myNode = FNode( aNode , self.G.Verbose )
@@ -1024,6 +1024,8 @@ class Graph(GNode):
         if self.G.Verbose :
             print ErrMsg
         return aLink
+    def Messages( self ):
+        return self.G.Messages()
     def Import( self , anXmlFileName ):
         return self.G.Import( anXmlFileName )
     def Export( self , anXmlFileName ):