# common directories to put headerfiles
inc_builddir=$(top_builddir)/include/salome
+MODULE_NAME=@MODULE_NAME@
+
@SET_MAKE@
SHELL=/bin/sh
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@
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
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
+
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
########################################################################
# 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
########################################################################
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"
#
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
corba=make_$ORB
CORBA=adm_local/unix/$corba
-echo
-echo ---------------------------------------------
-echo testing openGL
-echo ---------------------------------------------
-echo
-
-CHECK_OPENGL
-
echo
echo ---------------------------------------------
echo testing QT
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 ---------------------------------------------
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 ---------------------------------------------
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
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
-<!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"> </p>\r
-\r
-<p class=TODO>To set filtering parameters:</p>\r
-\r
-<p class="whs4"> </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"> </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"> </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"> </p>
+
+<p class=TODO>To set filtering parameters:</p>
+
+<p class="whs4"> </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"> </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"> </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>
--- /dev/null
+<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
*/
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.
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.
*/
/*! 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 );
+
} ;
</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>
char *NULLSTRING = "" ;
char *FACTORYSERVER = "localhost/FactoryServer" ;
+char *FACTORYSERVERPY = "localhost/FactoryServerPy" ;
GraphBase::Base::Base() {
_prof_debug = NULL ;
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;
break;
}
case CORBA::tk_long: {
- long l;
+ CORBA::Long l;
anAny >>= l;
*_fdebug << " " << l << "(tk_long)" << endl ;
break;
return *_fdebug ;
}
+/*
string DataStreamTypeToString( const SALOME_ModuleCatalog::DataStreamType aDataStreamType ) {
string aIdlType ;
switch ( aDataStreamType ) {
}
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 ;
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 : {
return f;
}
-
+*/
extern char *NULLSTRING ;
extern char *FACTORYSERVER ;
+extern char *FACTORYSERVERPY ;
inline char * my_strdup( const char * s ) {
if (s == NULL) return NULL;
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 ,
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 );
} ;
-ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamType &);
+//ostream & operator<< (ostream &,const SALOME_ModuleCatalog::DataStreamType &);
#endif
#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 ,
_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 ) ;
// 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 ;
}
_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 ] ;
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()
}
GraphBase::ComputingNode::~ComputingNode() {
- cdebug << "GraphBase::ComputingNode::~ComputingNode " << this
+ cdebug << "GraphBase::ComputingNode::~ComputingNode " << this
<< " Name() "<< Name() << " _Comment "
<< (void *) _Comment << " " << _Comment << " " << endl ;
}
SUPERV::SDate GraphBase::ComputingNode::FirstCreation () const {
// cdebug << "GraphBase::ComputingNode::FirstCreation "
-// << " Name '" << Name() << "' " << _FirstCreation << " "
+// << " Name '" << Name() << "' " << _FirstCreation << " "
// << _LastModification << endl ;
return _FirstCreation;
}
bool GraphBase::ComputingNode::EditorRelease(const char * c){
if ( _EditorRelease && _EditorRelease != NULLSTRING )
- delete _EditorRelease;
+ delete [] _EditorRelease;
_EditorRelease = my_strdup(c);
return true ;
}
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 ) {
<< " " << 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() ) ;
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() ) ;
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 ) {
aDataStreamPort = (GraphBase::InDataStreamPort * ) GraphBase::PortsOfNode::AddInPort( _ORB , NamePtr() ,
Kind() ,
InputParameterName ,
- DataStreamTypeToString( InputParameterType ).c_str() ,
+ InputParameterType ,
aKindOfPort ,
index ,
_Graph_prof_debug ,
}
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 ,
<< 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 ;
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) ;
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) ;
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") ;
}
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 ;
}
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() ) {
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() << " , '"
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++ ) {
}
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 ;
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 << " )"
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 ;
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 << " )"
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++ ) {
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 ;
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 << " )"
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 {
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 {
// cdebug_out << "operator<< GraphEditor::Date" << endl;
return fOut;
}
-
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 ) ;
}
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
}
#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
}
// else {
// cdebug << "InitialValues ERROR (other) " << Type << endl ;
-// InitialValue <<= (long ) 0 ;
+// InitialValue <<= (CORBA::Long ) 0 ;
// }
_InitialValue = new CORBA::Any( InitialValue ) ;
_Value = &_InitialValue ;
#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)" ;
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" ) ) {
#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
}
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
*_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() ;
#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 ;
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() ;
}
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
}
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" ) ) {
#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
//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 ;
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: {
// 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 ;
const CORBA::Any * theValue = *_Value ;
switch (theValue->type()->kind()) {
case CORBA::tk_string:
- char * t;
+ const char * t;
*theValue >>= t;
f << t << " (string)" ;
break;
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 ;
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 ;
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() ;
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 ) ;
}
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() &&
}
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
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" ) )
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) " ;
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 ;
<< ToServiceParameterName << "' , Any " ;
switch (aValue.type()->kind()) {
case CORBA::tk_string:
- char * t;
+ const char * t;
aValue >>= t;
cdebug << t << " (string) " ;
break;
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) " ;
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) " ;
// 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 ] ,
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 ] ) ;
}
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() ;
}
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() ;
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 ;
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 ;
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
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
// 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:
bool InLineServices() ;
bool Sort( int & SubStreamGraphsNumber ) ;
+ bool ValidGOTO() ; // mkr : PAL12575
bool ValidLoops() const ;
bool ValidSwitchs() const ;
bool ComputingNodes() const ;
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();
+ }
+
};
};
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() << ") --> "
using namespace std;
#include "DataFlowBase_PortsOfNode.hxx"
-#define PortsOfNodeTrace 1
+#define PortsOfNodeTrace 0
GraphBase::PortsOfNode::PortsOfNode() :
GraphBase::Service::Service( SALOME_ModuleCatalog::Service() ) {
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)" );
#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
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;
}
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)" );
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
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;
}
aPythonFunction[ ll ] = fieldvalue[depth].c_str() ;
}
else {
- aPythonFunction[ ll ] = NULLSTRING ;
+ aPythonFunction[ ll ] = CORBA::String_var("") ;
}
if ( ll ) {
aNode.theListOfPythonFunctions.resize( l ) ;
# 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@
#include "DataFlowBase_Base.hxx"
+#include CORBA_CLIENT_HEADER(SALOME_Component)
+
+
+
int _ArgC ;
char ** _ArgV ;
long SubStreamGraphsNumber() ;
void Executor(GraphExecutor::DataFlow * DataFlowExecutor ) ;
- GraphExecutor::DataFlow * GraphEditor::DataFlow::Executor() const ;
+ GraphExecutor::DataFlow * Executor() const ;
};
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() ) {
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 ;
}
StreamGraph()->SubStreamGraphsNumber( SubStreamGraphsNumber ) ;
Graph()->InLineServices() ;
-
+
// if ( kLoopSwitch ) {
if ( !Graph()->ValidLoops() ) {
cdebug << "Editor::OutNode::Executable This DataFlow have not valid Loops(ValidLoops)." << endl ;
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" ) ;
break ;
}
case CORBA::tk_double: {
- double d;
+ CORBA::Double d;
aLink.aLinkValue >>= d;
// f << Tabs << " <value>" << d << "</value>" << endl ;
QDomElement value = Graph.createElement( "value" ) ;
break ;
}
case CORBA::tk_long: {
- long l;
+ CORBA::Long l;
aLink.aLinkValue >>= l;
// f << Tabs << " <value>" << l << "</value>" << endl ;
QDomElement value = Graph.createElement( "value" ) ;
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" ) ;
<< ".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 ;
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 ;
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 ,
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)
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 "
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
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() ;
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() ;
#if DynInvokeTrace
switch ( Type ) {
case CORBA::tk_string : {
- char * t ;
+ const char * t ;
data >>= t ;
cdebug << "ArgIn" << i << " : " << ArgName << " Value " << t << " (string)"
<< endl ;
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 ;
#if DynInvokeTrace
switch ( Type ) {
case CORBA::tk_string : {
- char * t ;
+ cont char * t ;
data >>= t ;
cdebug << "ArgOut" << i << " : " << ArgName << " Value " << t << " (string)" << endl ;
break ;
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 ;
#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 ?
}
}
+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 :
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 {
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()
}
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 ;
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 ) {
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 ) {
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 ) {
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;
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 ) {
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 ) {
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 ;
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 ;
}
}
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() ;
_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 ;
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 ;
delete [] msg ;
pthread_exit( msg ) ;
}
+ _OutNode->setRunFuncThread( T ) ; // mkr : IPAL14711
#if ActionsTrace
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name()
<< " executeAction has created thread " << T << endl ;
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 ;
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
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() << " )"
#endif
}
else {
- cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+ cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+ << k << " "
<< anInPort->PortName() << " have NO OutPort ERROR " << endl ;
return 0 ;
}
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 ) {
}
#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() ) {
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() << " "
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 ) {
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 );
}
//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 ;
}
#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 ;
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 ;
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 ) ;
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 ;
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++ ) {
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 ) ;
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)" ;
// 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 ) ;
}
#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 " << " = "
#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 ;
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 ) ;
}
#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 ) ;
}
#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 ) ;
}
#endif
break;
case CORBA::tk_double:
- double d;
+ CORBA::Double d;
D.Value >>= d;
#if InParametersSetTrace
cdebug << d << " (double)" << endl ;
// 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 ) ;
}
#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 ) ;
}
// 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 ) ;
}
#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 ) ;
}
#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 ) ;
}
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" ) ) {
#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 {
#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;
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;
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 ;
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 ;
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 ;
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 ;
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 ;
break;
}
case CORBA::tk_double: {
- double d;
+ CORBA::Double d;
D.Value >>= d;
#if OutParametersSetTrace
cdebug << ThreadNo() << " " << d << "(double)" << endl ;
#if OutParametersSetTrace
cdebug << " Gate " ;
#endif
- long l = 1;
+ CORBA::Long l = 1;
OutParametersList[i].Value <<= l;
anOutPort->SetValue( OutParametersList[i].Value );
}
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()
<< _OutNode->Graph()->CoupledNodeName() << " , "
<< anOutPort->ChangeInPorts( j )->PortName() << " , value )" << endl ;
#endif
-
+#endif
}
else {
GraphBase::ComputingNode * ToNode = _OutNode->Graph()->GetChangeGraphNode( ToNodeName ) ;
#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;
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;
<< aGateOutPort->PortName() << " " << aGateOutPort->Kind() << " WITH DefaultPort"
<< endl ;
#endif
- long l = 1;
+ CORBA::Long l = 1;
OutParametersList[0].Value <<= l ;
aGateOutPort->SetValue( OutParametersList[0].Value ) ;
}
<< 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 ) ;
}
#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 ;
_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 ) ) {
_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 ) ;
_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 ) ;
_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 ) ;
}
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
}
}
*/
+ //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 ;
// 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
// 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() ;
}
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 ) ) {
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() ;
}
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 ;
list< GraphExecutor::NodeEvent > _Events ;
list< GraphExecutor::AutomatonState > _States ;
+ pthread_t _run_func_thread ;
+
bool Valid() ;
void UnValid() ;
bool Executable() ;
const char *FromParameterName ) ;
const long CpuUsed() ;
const long CpuUsed( const char *aNodeName ) ;
+
+ void setRunFuncThread( pthread_t theThread ) { _run_func_thread = theThread; } ; // mkr : IPAL14711
};
};
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 ) ;
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" ;
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" ;
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 ;
return Result ;
}
-#define PyDynInvokeTrace 1
+#define PyDynInvokeTrace 0
bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
const char *method ,
ServicesAnyData * InParametersList , int nInParams ,
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 ;
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 ) ;
break ;
}
case CORBA::tk_short : {
- short s ;
+ CORBA::Short s ;
data >>= s ;
PyObject * ArgValue = Py_BuildValue( "h" , s ) ;
PyTuple_SetItem( ArgsList , i , ArgValue ) ;
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 ;
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 ) ;
break ;
}
case CORBA::tk_double : {
- double d ;
+ CORBA::Double d ;
data >>= d ;
PyObject * ArgValue = Py_BuildValue( "d" , d ) ;
PyTuple_SetItem( ArgsList , i , ArgValue ) ;
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"
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 : {
if ( Result == NULL ) {
cdebug_out << "GraphExecutor::InNode::PyDynInvoke Node " << Name() << " " << method << " Error Result == NULL"
<< endl ;
+ PyErr_Print();
RetVal = false ;
}
else {
else {
ArgValue = Result ;
}
- if ( !PyString_Check( ArgValue ) ) {
+ if ( !ArgValue || !PyString_Check( ArgValue ) ) {
cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (string)" << endl ;
RetVal = false ;
}
}
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 ;
}
else {
ArgValue = Result ;
}
- if ( !PyInt_Check( ArgValue ) ) {
+ if ( !ArgValue || !PyInt_Check( ArgValue ) ) {
cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (boolean)" << endl ;
RetVal = false ;
}
}
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 ;
}
//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 ;
}
}
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 ;
}
else {
ArgValue = Result ;
}
- if ( !PyInt_Check( ArgValue ) ) {
+ if ( !ArgValue || !PyInt_Check( ArgValue ) ) {
cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (short)" << endl ;
RetVal = false ;
}
}
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 ) ;
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 {
}
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 ;
}
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 ;
}
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 ) ;
}
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 ;
}
}
else {
+ PyErr_Print();
cdebug_out << "GraphExecutor::InNode::PyDynInvoke Error ResultIor == NULL Node "
<< Name() << " method " << method << " " << endl ;
RetVal = false ;
Py_DECREF( ArgsList ) ;
}
+ fflush(stdout);
+ fflush(stderr);
+
#if 0
{
int i ;
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)
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)
@COMMENCE@
-SUBDIRS = GraphBase GraphEditor GraphExecutor Supervision SUPERVGUI
+SUBDIRS = GraphBase GraphEditor GraphExecutor Supervision
+ifeq (@WITHIHM@,yes)
+ SUBDIRS+= SUPERVGUI
+endif
+
@MODULE@
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 );
}
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();
+ }
}
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 <--
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() );
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 );
//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()));
}
}
}
// 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) {
}
}
-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;
}
- }
+ }
}
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
void SUPERVGUI_BrowseNodeDlg::onSelectionChanged()
{
if ( myActiveField ) {
-
+
SALOME_ListIO aList;
aList.Clear();
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 );
}
}
{
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 );
}
}
ihmList->removeRef(ihmNode); \
ihmNode->merge(); \
ihmNode = getNode(aCNodeEnd); \
- ihmList->removeRef(ihmNode); \
- ihmNode->merge(); \
+ if (ihmNode) { \
+ ihmList->removeRef(ihmNode); \
+ ihmNode->merge(); \
+ } \
} \
}
*/
void SUPERVGUI_Canvas::merge() {
if (SUPERV_isNull(myMain->getDataflow())) return;
-
+
SUPERVGUI_CanvasNode* ihmNode;
QObjectList* ihmList = queryList("SUPERVGUI_CanvasNode");
SUPERV_Nodes nodes = myMain->getDataflow()->Nodes();
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) {
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(); \
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();
#include "SUPERVGUI_CanvasControlNode.h"
#include "SUPERVGUI_CanvasControlNodePrs.h"
#include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUPERVGUI_CanvasLink.h"
#include "SUPERVGUI_Clipboard.h"
#include "SUPERVGUI_Main.h"
#include "SUPERVGUI.h"
//=====================================================================
// Compute node
//=====================================================================
-SUPERVGUI_CanvasComputeNode::SUPERVGUI_CanvasComputeNode( SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
- SUPERVGUI_CanvasNode( mgr, theParent, theMain, theNode)
+SUPERVGUI_CanvasComputeNode::SUPERVGUI_CanvasComputeNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+ SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode)
{
Trace("SUPERVGUI_CanvasComputeNode::SUPERVGUI_CanvasComputeNode");
}
+SUPERVGUI_CanvasComputeNode* SUPERVGUI_CanvasComputeNode::Create
+ (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
+{
+ SUPERVGUI_CanvasComputeNode* aRet = new SUPERVGUI_CanvasComputeNode (mgr, theParent, theMain, theNode);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
QPopupMenu* SUPERVGUI_CanvasComputeNode::getPopupMenu(QWidget* theParent)
{
QPopupMenu* popup = SUPERVGUI_CanvasNode::getPopupMenu(theParent);
//=====================================================================
// Start control node
//=====================================================================
-SUPERVGUI_CanvasStartNode::SUPERVGUI_CanvasStartNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+SUPERVGUI_CanvasStartNode::SUPERVGUI_CanvasStartNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
SUPERVGUI_CanvasNode( mgr, theParent, theMain, theNode),
myCoupled(0)
{
Trace("SUPERVGUI_CanvasStartNode::SUPERVGUI_CanvasStartNode");
}
+SUPERVGUI_CanvasStartNode* SUPERVGUI_CanvasStartNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
+{
+ SUPERVGUI_CanvasStartNode* aRet = new SUPERVGUI_CanvasStartNode (mgr, theParent, theMain, theNode);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasStartNode::createPrs() const
{
- return new SUPERVGUI_CanvasStartNodePrs( resMgr(), getMain()->getCanvas(),
+ return new SUPERVGUI_CanvasStartNodePrs (resMgr(), getMain()->getCanvas(),
(SUPERVGUI_CanvasStartNode*)this);
}
if (myCoupled)
delete myCoupled;
+ emit objectCreatedDeleted(); // jfa : NPAL15529
+
delete this;
aCanvas->update();
//=====================================================================
// End control node
//=====================================================================
-SUPERVGUI_CanvasEndNode::SUPERVGUI_CanvasEndNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode, SUPERVGUI_CanvasStartNode* theStart):
+SUPERVGUI_CanvasEndNode::SUPERVGUI_CanvasEndNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
+ SUPERVGUI_CanvasStartNode* theStart):
SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode),
myCoupled(theStart)
{
myCoupled->setCoupled(this);
}
+SUPERVGUI_CanvasEndNode* SUPERVGUI_CanvasEndNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
+ SUPERVGUI_CanvasStartNode* theStart)
+{
+ SUPERVGUI_CanvasEndNode* aRet = new SUPERVGUI_CanvasEndNode (mgr, theParent, theMain, theNode, theStart);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasEndNode::createPrs() const
{
return new SUPERVGUI_CanvasEndNodePrs( resMgr(), getMain()->getCanvas(),
//=====================================================================
// Goto control node
//=====================================================================
-SUPERVGUI_CanvasGotoNode::SUPERVGUI_CanvasGotoNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+SUPERVGUI_CanvasGotoNode::SUPERVGUI_CanvasGotoNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode)
{
Trace("SUPERVGUI_CanvasGotoNode::SUPERVGUI_CanvasGotoNode");
}
+SUPERVGUI_CanvasGotoNode* SUPERVGUI_CanvasGotoNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
+{
+ SUPERVGUI_CanvasGotoNode* aRet = new SUPERVGUI_CanvasGotoNode (mgr, theParent, theMain, theNode);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasGotoNode::createPrs() const
{
return new SUPERVGUI_CanvasGotoNodePrs( resMgr(), getMain()->getCanvas(),
if (aDlg->exec()) {
QString aNodeName = aDlg->getName();
if (!aNodeName.isEmpty()) { //implement additional check from GUI side for bug PAL7007
+ // mkr : here we should re/create (if it is not yet exists) a presentation for new
+ // Goto(OutGate)->CoupledNode(InGate) link, which will be created in SetCoupled method
+
+ // check if GoTo node have coupled node
+ SUPERV_INode aCoupledNode = getGotoNode()->Coupled();
+ if ( !SUPERV_isNull(aCoupledNode) )
+ { // we got old coupled node
+ SUPERV_Port anInGatePort = aCoupledNode->GetInPort("InGate");
+ SUPERV_Link anOldLinkEngine = anInGatePort->Link();
+ if ( !SUPERV_isNull(anOldLinkEngine) )
+ { // we got old link engine
+ SUPERVGUI_CanvasLink* anOldLinkPrs = getMain()->getCanvas()->getLink(anOldLinkEngine);
+ if ( anOldLinkPrs )
+ { // delete old link presentation
+ delete anOldLinkPrs;
+ anOldLinkPrs = 0;
+ }
+ }
+ }
+
getGotoNode()->SetCoupled(aNodeName.latin1());
+
+ aCoupledNode = SUPERV::INode::_narrow(getMain()->getDataflow()->Node(aNodeName.latin1()));
+ if ( !SUPERV_isNull(aCoupledNode) )
+ { // we got new coupled node
+ SUPERV_Port anInGatePort = aCoupledNode->GetInPort("InGate");
+ SUPERV_Link aLinkEngine = anInGatePort->Link();
+ if ( !SUPERV_isNull(aLinkEngine) )
+ { // we got new link engine
+ if ( !getMain()->getCanvas()->getLink(aLinkEngine) )
+ { // there is no presentation for such link engine => create it
+ SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(getMain()->getCanvas(), getMain(), aLinkEngine);
+ aLink->show();
+ }
+ }
+ }
+
getMain()->getCanvas()->sync();
}
}
//=====================================================================
// Macro node
//=====================================================================
-SUPERVGUI_CanvasMacroNode::SUPERVGUI_CanvasMacroNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+SUPERVGUI_CanvasMacroNode::SUPERVGUI_CanvasMacroNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
SUPERVGUI_CanvasComputeNode(mgr, theParent, theMain, theNode)
{
Trace("SUPERVGUI_CanvasMacroNode::SUPERVGUI_CanvasMacroNode");
}
+SUPERVGUI_CanvasMacroNode* SUPERVGUI_CanvasMacroNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
+{
+ SUPERVGUI_CanvasMacroNode* aRet = new SUPERVGUI_CanvasMacroNode (mgr, theParent, theMain, theNode);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasMacroNode::createPrs() const
{
return new SUPERVGUI_CanvasMacroNodePrs( resMgr(), getMain()->getCanvas(),
//=====================================================================
// Cell node: node for table view
//=====================================================================
-SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode(SUIT_ResourceMgr* mgr, QObject* theParent,
- SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode):
+SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode, true)
{
Trace("SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode");
myIsControl = true;
}
+SUPERVGUI_CanvasCellNode* SUPERVGUI_CanvasCellNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
+{
+ SUPERVGUI_CanvasCellNode* aRet = new SUPERVGUI_CanvasCellNode (mgr, theParent, theMain, theNode);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
SUPERVGUI_CanvasCellNode::~SUPERVGUI_CanvasCellNode()
{
}
return aPrs;
}
-SUPERVGUI_CanvasCellEndNode::SUPERVGUI_CanvasCellEndNode( SUIT_ResourceMgr* mgr, QObject* theParent,
- SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode,
+SUPERVGUI_CanvasCellEndNode::SUPERVGUI_CanvasCellEndNode (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
SUPERVGUI_CanvasCellNode* theStart):
SUPERVGUI_CanvasCellNode(mgr, theParent, theMain, theNode)
{
//set end cell for start cell as pair
myPairCell->setPairCell(dynamic_cast<SUPERVGUI_CanvasCellNode*>(this));
}
+
+SUPERVGUI_CanvasCellEndNode* SUPERVGUI_CanvasCellEndNode::Create (SUIT_ResourceMgr* mgr, QObject* theParent,
+ SUPERVGUI_Main* theMain,
+ SUPERV_CNode theNode,
+ SUPERVGUI_CanvasCellNode* theStart)
+{
+ SUPERVGUI_CanvasCellEndNode* aRet =
+ new SUPERVGUI_CanvasCellEndNode (mgr, theParent, theMain, theNode, theStart);
+ emit aRet->objectCreatedDeleted();
+ return aRet;
+}
+
/*
bool SUPERVGUI_CanvasCellEndNode::setNodeName(QString theName)
{
return SUPERVGUI_CanvasNode::setNodeName(theName);
}
*/
+
//-----------------------------------------------------------
//*************** Select Inline node dialog******************
// Taken from SUPERVGUI_ControlNode.cxx without change
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);
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:
virtual void pastePort();
protected:
+ SUPERVGUI_CanvasStartNode (SUIT_ResourceMgr*, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+
virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
protected slots:
void setCoupled(SUPERVGUI_CanvasEndNode* theEnd) { myCoupled = theEnd; }
SUPERVGUI_CanvasEndNode* myCoupled;
-
};
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; }
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;
-
};
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);
void linkToNode();
protected:
+ SUPERVGUI_CanvasGotoNode (SUIT_ResourceMgr*, QObject* theParent,
+ SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+
virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
};
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()
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:
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:
// 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)
#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),
// mkr : PAL8237
connect(this, SIGNAL(objectCreatedDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
- emit objectCreatedDeleted();
}
SUPERVGUI_CanvasNode::~SUPERVGUI_CanvasNode()
//glNode->update();
//getGLContext()->insertObject( glNode, true /*false*/ );
//
-
return new SUPERVGUI_CanvasNodePrs( myMgr, myMain->getCanvas(), (SUPERVGUI_CanvasNode*)this);
}
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
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; }
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);
#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),
//***********************************************************
// 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");
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()));
//***********************************************************
// 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");
// QToolTip for title and label for SUPERVGUI_CanvasNode
SUPERVGUI_ToolTip* aTT = new SUPERVGUI_ToolTip(this);
- aTT->maybeTip(p);
+ aTT->maybeTip(theEvent->pos());
busy = false;
}
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;
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); \
} \
} \
}
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();
//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();
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;
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();
}
}
}
}
}
}
- SUPERVGUI_Main::setModifiedFlag();
+ //SUPERVGUI_Main::setModifiedFlag();
}
}
}
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 {
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 {
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();
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();
/**
* 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();
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();
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();
if ( !myThread->running() )
aSupMod->updateObjBrowser();
+
+ aSupMod->getApp()->updateActions();
}
else {
MESSAGE( "ERROR: failed to find or create dataflow SObject" );
{
// 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 ) ||
// 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()?
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") );
#include "SUPERVGUI_ManagePortsDlg.h"
#include "SUPERVGUI_CanvasNode.h"
+#include "SUPERVGUI_CanvasNodePrs.h"
#include "SUPERVGUI_CanvasPort.h"
#include "SUPERVGUI_CanvasControlNode.h"
#include "SUPERVGUI_CanvasLink.h"
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
anUpOutputBtn->setEnabled( false );
aDownOutputBtn->setEnabled( false );
}
-
+
+ // NPAL15537: initialization moved here from showEvent()
+ init( myNode );
}
/**
}
// mkr : PAL8060
-void SUPERVGUI_ManagePortsDlg::createLinkEngine( SUPERV::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);
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();
}
/**
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
*/
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() );
}
}
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 )
* 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 );
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();
+ }
}
void itemDeselect(QListBoxItem* item, const QPoint& point); // mkr: PAL12448
protected:
- virtual void showEvent( QShowEvent* theEvent );
void addPort( QListBox* );
void removePort( QListBox* );
void moveUp( QListBox* );
aBaseLayoutV->setSpacing(10);
QHBoxLayout* aBaseLayout = new QHBoxLayout(aCorbaPane); //!!
+ aBaseLayout->setMargin(5);
+ aBaseLayout->setSpacing(10);
components = new QListView(aCorbaPane);
components->addColumn(tr("COL_COMPONENTS"));
components->setColumnAlignment(3, AlignLeft);
components->setSelectionMode(QListView::Extended);
components->setRootIsDecorated(true);
+
// aBaseLayout->addWidget(components);
aBaseLayoutV->addWidget(components); //!!
//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);
}
-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() {
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);
}
}
}
-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;
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) {
}
}
+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();
-//*****************************************************
+//*****************************************************/
// Pane for Python script editing
-//*****************************************************
+//*****************************************************/
SUPERVGUI_PythonEditPane::SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation, int& theX, int& theY )
: myIsWithLibrary( isNodeCreation ),
QFrame( theParent ),
// 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();
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 ] == ':' ) {
}
}
+/*!
+ 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();
+}
private slots:
void tabChanged(QWidget *);
void addComputeNode();
- void addFactoryNode();
+ void addFactoryNodeDef();
+ void addFactoryNodeCust();
void addInlineNode();
void addMacroNode();
void typeNodeSelected(int theRow);
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
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"
msgid "TIT_ADDFNODE"
msgstr "Add Node"
+msgid "TIT_ADDFNODE_CUST"
+msgstr "Add Node and Customize Parameters"
+
msgid "BTN_FACTORYNODE"
msgstr "Factory"
msgstr "Display Dataflow"
msgid "MEN_POP_DISPLAY"
-msgstr "Display"
+msgstr "Show"
msgid "STB_POP_DISPLAY"
msgstr "Display Dataflow"
#include "StreamPort_Impl.hxx"
-char *FACTORYSERVERPY = "localhost/FactoryServerPy" ;
-
CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
PortableServer::POA_ptr poa ,
PortableServer::ObjectId * contId ,
// 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 ;
}
// 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() ) ) ) {
( !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" ) ;
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() ,
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 ,
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 ) ;
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();
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() ) ;
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() ) ;
}
}
}
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() ) ;
}
}
}
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() ) ;
}
}
}
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() ) ;
}
}
}
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() ) ;
}
}
}
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)
}
}
}
}
}
+/**
+ * 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 "";
+}
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 ) ;
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 ) ;
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 );
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() ) {
}
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() ;
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 ) ;
} ;
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
# 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
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 )
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 ):
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 ) ) {
myGraph->SetObjRef( SUPERV::Graph::_duplicate( iobject ) ) ;
}
myGraph->ReadOnly() ;
+ myGraph->DataFlowEditor()->Graph()->ClearMapOfComponentNameContainer() ; // mkr : PAL13947
endService( "SuperV_Impl::GraphE" );
return SUPERV::Graph::_duplicate(iobject) ;
}
myStreamGraph->SetObjRef( SUPERV::StreamGraph::_duplicate( iobject ) ) ;
}
myStreamGraph->ReadOnly() ;
+ myStreamGraph->DataFlowEditor()->Graph()->ClearMapOfComponentNameContainer() ; // mkr : PAL13947
endService( "SuperV_Impl::StreamGraphE" );
return SUPERV::StreamGraph::_duplicate(iobject) ;
}
}
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 ;
}
#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() {
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 )
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 ):