]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Merging with V3_2_6pre4 V4_0 V4_0rc1 V4_0rc1_automake V4_0rc2
authorabd <abd@opencascade.com>
Thu, 19 Apr 2007 14:07:34 +0000 (14:07 +0000)
committerabd <abd@opencascade.com>
Thu, 19 Apr 2007 14:07:34 +0000 (14:07 +0000)
39 files changed:
adm_local/unix/make_commence.in
idl/SUPERV.idl
src/GraphBase/DataFlowBase_Base.cxx
src/GraphBase/DataFlowBase_Base.hxx
src/GraphBase/DataFlowBase_ComputingNode.cxx
src/GraphBase/DataFlowBase_Graph.cxx
src/GraphBase/DataFlowBase_Graph.hxx
src/GraphBase/DataFlowBase_OutPort.cxx
src/GraphBase/DataFlowBase_PortsOfNode.cxx
src/GraphBase/Makefile.in
src/GraphBase/SuperVisionBase_CheckOfUndefined.cxx
src/GraphEditor/DataFlowEditor_OutNode.cxx
src/GraphExecutor/DataFlowExecutor_DataFlow.cxx
src/GraphExecutor/DataFlowExecutor_DataFlow.hxx
src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx
src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx
src/GraphExecutor/DataFlowExecutor_InNode.cxx
src/GraphExecutor/DataFlowExecutor_InNode.hxx
src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx
src/GraphExecutor/DataFlowExecutor_OutNode.cxx
src/GraphExecutor/DataFlowExecutor_OutNode.hxx
src/SUPERVGUI/SUPERVGUI.cxx
src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx
src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx
src/SUPERVGUI/SUPERVGUI_CanvasLink.cxx
src/SUPERVGUI/SUPERVGUI_Main.cxx
src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx
src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.h
src/SUPERVGUI/SUPERVGUI_Service.cxx
src/SUPERVGUI/SUPERVGUI_Service.h
src/SUPERVGUI/SUPERV_msg_en.po
src/Supervision/CNode_Impl.cxx
src/Supervision/FNode_Impl.cxx
src/Supervision/GNode_Impl.cxx
src/Supervision/Graph_Impl.cxx
src/Supervision/Graph_Impl.hxx
src/Supervision/SUPERV_shared_modules.py
src/Supervision/SuperV_Impl.cxx
src/Supervision/Value_Impl.cxx

index bc5cc9ed900c8896b46cd5c30c456d8836ca1703..c3fdda2d6d133491d319c79c51edfb1249480869 100644 (file)
@@ -140,7 +140,7 @@ OMNIORB_LIBS        = @OMNIORB_LIBS@
 OMNIORB_CXXFLAGS    = @OMNIORB_CXXFLAGS@
 
 OMNIORB_IDL         = @OMNIORB_IDL@
-OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
+OMNIORB_IDLCXXFLAGS = -Wba @OMNIORB_IDLCXXFLAGS@
 OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl/salome -I$(KERNEL_ROOT_DIR)/idl/salome
 
 OMNIORB_IDL_CLN_H   = @OMNIORB_IDL_CLN_H@
index 959ddb7650456f694ee8d30f5893f16cacb6ba3b..a26a9105a517468b5ab074f5605d67226c558345 100644 (file)
@@ -990,7 +990,19 @@ This interface includes a set of methods used for management of the graphs in %S
     /*! Forces use of Editor's data model and destroy of Executor
      */
     void Editing();
-    
+
+    /*! Returns the default name of container for C component
+     */
+    string DefaultCContainerName();
+
+    /*! Returns the default name of container for Python component
+     */
+    string DefaultPythonContainerName();
+
+    /*! Returns the last container name associated with the ComponentName component
+     */
+    string ContainerNameForComponent( in string ComponentName );
+
   } ;
 
 
index 40c911bf269dc001db1129f415f265918ceb9794..ccebdd01869dc6abb8f5659a9d38b3e462bff36d 100644 (file)
@@ -34,6 +34,7 @@ char *SuperVision_Version = "3.0" ;
 char *NULLSTRING = "" ;
 
 char *FACTORYSERVER = "localhost/FactoryServer" ;
+char *FACTORYSERVERPY = "localhost/FactoryServerPy" ;
 
 GraphBase::Base::Base() {
   _prof_debug = NULL ;
index d96337730f4ebbd7ba33331f5b86666751a25203..3c2ede8beeeb02265c980affdad5c3f8655b5376 100644 (file)
@@ -55,6 +55,7 @@ extern char *SuperVision_Version ;
 extern char *NULLSTRING ;
 
 extern char *FACTORYSERVER ;
+extern char *FACTORYSERVERPY ;
 
 inline char * my_strdup( const char * s ) {
   if (s == NULL) return NULL;
index 0439956c359220f51302d9196d71f39d5d9ace10..264719f47584dbd8ab1287948d167fae212950a7 100644 (file)
@@ -295,7 +295,7 @@ void GraphBase::ComputingNode::LastModification(const SUPERV::SDate aDate ) {
 
 bool GraphBase::ComputingNode::EditorRelease(const char * c){
   if ( _EditorRelease && _EditorRelease != NULLSTRING )
-    delete _EditorRelease;
+    delete [] _EditorRelease;
   _EditorRelease = my_strdup(c);
   return true ;
 }
index 6c4998227fb9084d1f3b3ff9e41464b26b0956ea..7535084b5b538215f0a0894ecf4777588c98ff1d 100644 (file)
@@ -1188,6 +1188,9 @@ bool GraphBase::Graph::AddLink( GraphBase::ComputingNode *fromNode ,
       cdebug_out << "RemoveLink(AddLink) toPort->GetOutPort()->NodeName() RemoveLink Error." << endl ;
       return false ;
     }
+    if ( fromNode->IsGOTONode() && fromPort->IsGate() ) { // mkr : PAL12575
+      ((GraphBase::GOTONode * ) fromNode)->CoupledNode( (GraphBase::InLineNode * ) toNode ) ;
+    }
   }
 
   if ( !fromNode->IsDataFlowNode() && !fromNode->IsDataStreamNode() &&
@@ -1487,6 +1490,22 @@ bool GraphBase::Graph::RemoveLink( const char* FromNodeName ,
          }
           else {
             fromNode->RemoveLinkedNode( toNode ) ;
+           // mkr : PAL12575 -->
+           if ( fromNode->IsGOTONode() ) {
+             GraphBase::GOTONode * aGOTONode = (GraphBase::GOTONode * ) fromNode ;
+             if ( aGOTONode->CoupledNode() && strcmp( aGOTONode->CoupledNode()->Name(), toNode->Name() ) == 0 ) {
+               aGOTONode->CoupledNode(NULL);
+               aGOTONode->CoupledNodeName("");
+               
+               // set ExternConnected status for output data port of GoTo node
+               for ( int aPortId = 0 ; aPortId < fromNode->GetNodeOutPortsSize() ; aPortId++ ) {
+                 GraphBase::OutPort * anOutPort = fromNode->GetChangeNodeOutPort(aPortId) ;
+                 if ( anOutPort->IsNotConnected() && !anOutPort->IsGate() )
+                   anOutPort->PortStatus( ExternConnected ) ;
+               }
+             }
+           }
+           // mkr : PAL12575 <--
          }
         }
 //JR PAL7990 : a SwitchPort is an OutPort of a SwitchNode connected to a InGate Port
@@ -1653,8 +1672,8 @@ bool GraphBase::Graph::AddInputData( const char* ToNodeName ,
   else {
     cdebug << "ERROR Node and/or Port not found : " << aNodeName << " " << aPortName << endl ;
   }
-  delete aNodeName ;
-  delete aPortName ;
+  delete [] aNodeName ;
+  delete [] aPortName ;
 
   cdebug_out << "GraphBase::Graph::AddInputData " << RetVal << endl;
   return RetVal ;
@@ -2773,6 +2792,59 @@ bool GraphBase::Graph::Sort( int & SubStreamGraphsNumber ) {
   return true ;
 }
 
+// mkr : PAL12575
+bool GraphBase::Graph::ValidGOTO() {
+  cdebug_in << "GraphBase::Graph::ValidGOTO" << endl;
+  bool RetVal = true ;
+  int i, j ;
+  GraphBase::ComputingNode * aNode ;
+  for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
+    aNode = GraphNodes( i ) ;
+    if ( aNode->IsGOTONode() ) {
+      GraphBase::GOTONode * aGoToNode = (GraphBase::GOTONode * ) aNode ;
+      GraphBase::InLineNode * aCoupledNode ;
+      aCoupledNode = (GraphBase::InLineNode * ) aGoToNode->CoupledNode() ;
+      if ( aCoupledNode ) {
+       ostringstream ErrorMessage ;
+       // 1. Check the number of ports (the number of OutPorts of a GOTONode and of InPorts of its linked
+       //    InLine node must be the same)
+       if ( aNode->GetNodeOutPortsSize() != aCoupledNode->GetNodeInPortsSize() ) {
+         cdebug << "GraphBase::Graph::ValidGOTO : Different ports number!" << endl ;
+         ReSetMessages() ;
+         ErrorMessage << "Different ports number : the number of OutPorts of a " << aNode->Name()
+                      << " node (GoTo node) and of InPorts of its linked " << aCoupledNode->Name()
+                      << " node (InLine node) must be the same!\n" ;
+         SetMessages( ErrorMessage.str() ) ;
+         RetVal = false ;
+       }
+       // 2. Check ports names (the names of OutPorts of a GOTONode and of InPorts of its linked
+       //    InLine node must be the same)
+       else {
+         for ( j = 0 ; j < aNode->GetNodeOutPortsSize() ; j++ ) {
+           GraphBase::OutPort * aBusParamOutPort = aNode->GetChangeNodeOutPort( j ) ;
+           if ( !aBusParamOutPort->IsGate() ) {
+             GraphBase::InPort * aBusParamChangeInPort = NULL ;
+             aBusParamChangeInPort = aCoupledNode->GetChangeInPort( aBusParamOutPort->PortName() ) ;
+             if ( !aBusParamChangeInPort ) {
+               cdebug << "GraphBase::Graph::ValidGOTO : Different names of ports!" << endl ;
+               ReSetMessages() ;
+               ErrorMessage << "Different names of ports : there is no input port of " << aCoupledNode->Name()
+                            << " node (InLine node) coupled to " << aBusParamOutPort->PortName() 
+                            << " output port of a " << aNode->Name()
+                            << " node (GoTo node)\n" ;
+               SetMessages( ErrorMessage.str() ) ;
+               RetVal = false ;
+             }
+           }
+         }
+       }
+      }
+    }
+  }
+  cdebug_out << "GraphBase::Graph::ValidGOTO RetVal " << RetVal << endl;
+  return RetVal ;
+}
+
 bool GraphBase::Graph::ValidLoops() const {
   cdebug_in << "GraphBase::Graph::ValidLoops" << endl;
   bool RetVal = true ;
@@ -3020,7 +3092,7 @@ bool GraphBase::Graph::DataServerNodes() const {
         const GraphBase::OutPort * anOutPort = aNode->GetNodeOutPort(j) ;
 //JR Debug 06.06.2005 : if it is not a Gate !
 //        if ( anOutPort->IsNotConnected() ) {
-        if ( anOutPort->IsNotConnected() && !anOutPort->IsGate() ) {
+        if ( anOutPort->IsNotConnected() && !anOutPort->IsGate() && !aNode->IsGOTONode() ) { // mkr : PAL12575
           cdebug << "Graph::DataServerNodes Add[Stream]LinkedNode for OutPort "
                  << aNode->Name() << "( " << anOutPort->PortName() << " , "
                  << anOutPort->PortStatus() << " )" << endl ;
@@ -3183,8 +3255,8 @@ const CORBA::Any GraphBase::Graph::PortInData( const char* ToNodeName ,
     cdebug << "GraphBase::Graph::PortInData " << ToNodeName << " "
            << ToServiceParameterName << " ERROR no Node" << endl ;
   }
-  delete theNode ;
-  delete aPort ;
+  delete [] theNode ;
+  delete [] aPort ;
 #if TracePortInOutData
   cdebug_out << "GraphBase::Graph::PortInData " << endl ;
 #endif
@@ -3235,8 +3307,8 @@ const CORBA::Any GraphBase::Graph::PortOutData( const char* FromNodeName ,
     cdebug << "GraphBase::Graph::PortOutData " << FromNodeName << " "
            << FromServiceParameterName << " ERROR no Node" << endl ;
   }
-  delete theNode ;
-  delete aPort ;
+  delete [] theNode ;
+  delete [] aPort ;
 #if TracePortInOutData
   cdebug_out << "GraphBase::Graph::PortOutData " << endl ;
 #endif
index 0dab620b9021ee3945b5b62f4c298c59424ad123..a5a026cf92fbbcca6a7638cf755519a028f2952f 100644 (file)
@@ -90,12 +90,14 @@ namespace GraphBase {
 //      int                              _SubStreamGraphsSize ;
 //      vector<vector<ComputingNode *> > _SubStreamGraphs ;
 
-      string _Messages ;
+    string _Messages ;
 
-      bool AddLink( GraphBase::ComputingNode *fromNode ,
-                    GraphBase::OutPort *fromPort ,
-                    GraphBase::ComputingNode *toNode ,
-                    GraphBase::InPort *toPort ) ;
+    map< string, string > _MapOfComponentNameContainer ; // mkr : PAL13947
+    
+    bool AddLink( GraphBase::ComputingNode *fromNode ,
+                 GraphBase::OutPort *fromPort ,
+                 GraphBase::ComputingNode *toNode ,
+                 GraphBase::InPort *toPort ) ;
 
     public:
 
@@ -340,6 +342,7 @@ namespace GraphBase {
       bool InLineServices() ;
 
       bool Sort( int & SubStreamGraphsNumber ) ;
+      bool ValidGOTO() ; // mkr : PAL12575
       bool ValidLoops() const ;
       bool ValidSwitchs() const ;
       bool ComputingNodes() const ;
@@ -372,6 +375,28 @@ namespace GraphBase {
                            Engines::Container_var & myContainer ,
                            Engines::Component_var & objComponent ) ;
 
+    // mkr : PAL13947
+    void InsertToMapOfComponentNameContainer( const char * theComponentName, 
+                                             const char * theContainer) {
+      _MapOfComponentNameContainer[ theComponentName ] = theContainer ;
+    }
+
+    // mkr : PAL13947    
+    const char * RetrieveFromMapOfComponentNameContainer( const char * theComponentName ) {
+      if ( _MapOfComponentNameContainer.empty() 
+          ||
+          _MapOfComponentNameContainer.find(theComponentName) == _MapOfComponentNameContainer.end() )
+       return NULL ;
+      
+      return _MapOfComponentNameContainer[ theComponentName ].c_str() ;
+    }
+
+    // mkr : PAL13947
+    void ClearMapOfComponentNameContainer() {
+      if ( !_MapOfComponentNameContainer.empty() )
+       _MapOfComponentNameContainer.clear();
+    }
+
   };
   
 };
index 2f52c5adcceb37c89e3e0a19c40c4a0537340f6f..776bc747567201c6155de3c1e1fa0caa99c73dbc 100644 (file)
@@ -127,8 +127,9 @@ bool GraphBase::OutPort::RemoveInPort( GraphBase::InPort * toPort ) {
   int i ;
   int index = _MapOfInPorts[ toPort->NodePortName() ] ;
   if ( index <= 0 || index > _InPortsSize ) {
-    cdebug << "GraphBase::OutPort::RemoveInPort Error " << NodeName() << "( " << PortName()<< " ) --> "
-           << toPort->NodeName() << "( " << toPort->PortName() << " )" << endl ;
+//JR NPAL14110 09.02.2007 : Not an error with MacroNodes ...
+    //JRcdebug << "GraphBase::OutPort::RemoveInPort Error " << NodeName() << "( " << PortName()<< " ) --> "
+    //JR       << toPort->NodeName() << "( " << toPort->PortName() << " )" << endl ;
     return false ;
   }
   cdebug << "OutPort::RemoveInPort " << NodeName() << "(" << PortName() << ") --> "
index 3fa97562c1b424adcddf2b18459c5d2581ba908e..97a9b4256a8679370ee75cdbcf86fb2fa0a677c8 100644 (file)
@@ -29,7 +29,7 @@
 using namespace std;
 #include "DataFlowBase_PortsOfNode.hxx"
 
-#define PortsOfNodeTrace 1
+#define PortsOfNodeTrace 0
 
 GraphBase::PortsOfNode::PortsOfNode() :
   GraphBase::Service::Service( SALOME_ModuleCatalog::Service() ) {
index 13d38b015aaf9c4fc5a2915449e8ccc0b8d420c6..ad9a63d845fbb978345df62a6f5a15a04388b767 100644 (file)
@@ -97,7 +97,7 @@ LIB_CLIENT_IDL = Logger.idl \
 # Executables targets
 BIN = SuperVisionBase_CheckOfUndefined
 BIN_SRC = 
-BIN_SERVER_IDL = 
+BIN_CLIENT_IDL = SALOME_Component.idl
 
 CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(KERNEL_CXXFLAGS)
 CXXFLAGS+= -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \
@@ -109,7 +109,8 @@ endif
 
 LDFLAGS+= $(SUPERV_LDFLAGS) $(CORBA_LIBS) -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace \
        -lc $(PYTHON_LIBS) $(QT_MT_LIBS) $(KERNEL_LDFLAGS)
-LDFLAGSFORBIN=$(LDFLAGS) -lSalomeContainer -lSalomeResourcesManager -lRegistry -lSalomeNotification -lSALOMEBasics
+LDFLAGSFORBIN= $(LDFLAGS) -lSalomeContainer -lSalomeResourcesManager -lRegistry -lSalomeNotification -lSALOMEBasics -lSalomeSuperVisionBase -lSalomeIDLKernel
+
 //LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS)
 
 @CONCLUDE@
index bf88ec67778a5dee850d1a374e76ecc30000dcba..3da252387b280832c234b9f0918763c4f0fcf0ae 100644 (file)
@@ -37,6 +37,10 @@ using namespace std;
 
 #include "DataFlowBase_Base.hxx"
 
+#include CORBA_CLIENT_HEADER(SALOME_Component)
+
+
+
 int _ArgC ;
 char ** _ArgV ;
 
index a088e758f233d3fce648d1846fdc41a639e56391..8e60fccc48552d39238eca0a69fa888cbba18770 100644 (file)
@@ -349,6 +349,10 @@ bool GraphEditor::OutNode::LoadNodes(map< string , int > & aMapOfNodes ,
                         aNode.theAuthor.c_str() , aNode.theContainer.c_str() ,
                         aNode.theComment.c_str() ,
                         aNode.theCoords.theX , aNode.theCoords.theY ) ;
+
+    // insert container into < ComponentName, Container > map for corresponding component
+    Graph()->InsertToMapOfComponentNameContainer( aNode.theComponentName.c_str(), aNode.theContainer.c_str() ) ; // mkr : PAL13947
+
     string * aNodetheName = new string( aNode.theName ) ;
     aMapOfNodes[ *aNodetheName ] = Graph()->GetGraphNodeIndex( anInNode->Name() ) ;
     if ( anInNode->IsOneOfInLineNodes() || anInNode->IsMacroNode() ) {
@@ -1015,6 +1019,11 @@ bool GraphEditor::OutNode::Valid() {
   Graph()->ComputingNodes() ;
 #endif
 
+  if ( !Graph()->ValidGOTO() ) { // mkr : PAL12575
+    cdebug << "Editor::OutNode::Valid This DataFlow have not valid GOTO(ValidGOTO)." << endl ;
+    RetVal = false ;
+  }
+
   if ( RetVal ) {
     _Valid = true ;
   }
@@ -1059,7 +1068,7 @@ bool GraphEditor::OutNode::Executable() {
     StreamGraph()->SubStreamGraphsNumber( SubStreamGraphsNumber ) ;
 
   Graph()->InLineServices() ;
-
+  
 //  if ( kLoopSwitch ) {
     if ( !Graph()->ValidLoops() ) {
       cdebug << "Editor::OutNode::Executable This DataFlow have not valid Loops(ValidLoops)." << endl ;
index 25e0bdd912e7b0d1f37de61a2a352d21db869165..4552e07d21771cdd1a483eec219d40579f9ba7b8 100644 (file)
@@ -239,8 +239,8 @@ bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName ,
   for ( i = 0 ; i < anOutPort->InPortsSize() ; i++ ) {
     const char * ToNodeName = anOutPort->ChangeInPorts( i )->NodeName() ;
     const char * ToParameterName = anOutPort->ChangeInPorts( i )->PortName() ;
-    GraphBase::ComputingNode * aComputingNode = Graph()->GetChangeGraphNode( ToNodeName ) ;
     if ( strcmp( ToNodeName , Name() ) ) {
+      GraphBase::ComputingNode * aComputingNode = Graph()->GetChangeGraphNode( ToNodeName ) ;
       GraphExecutor::InNode * aLinkedNode = (GraphExecutor::InNode * ) aComputingNode->GetInNode() ;
       cdebug << pthread_self() << "/" << aLinkedNode->ThreadNo()
              << "GraphExecutor::DataFlow::OutputOfAny to Node "
@@ -293,8 +293,9 @@ bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName ,
                                                             anOutPort->Value() ) ;
     }
     else {
-      cdebug << "GraphExecutor::DataFlow::OutputOfAny to Graph " << ToNodeName
-             << "(" << ToParameterName << ") ignored" << endl ;
+      cdebug << pthread_self() << "GraphExecutor::DataFlow::OutputOfAny to Node "
+             << ToNodeName << "(" << ToParameterName << ") from MacroNode " << aNodeName
+             << ") ignored" << endl ;
     }
   }
   cdebug_out << pthread_self() << "/" << ThreadNo() << " GraphExecutor::DataFlow::OutputOfAny " << RetVal
@@ -302,6 +303,31 @@ bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName ,
   return RetVal ;
 }
 
+//JR NPAL14110 09.02.2007 : SetWaitingStates was missing in SubGraph of MacroNode !...
+bool GraphExecutor::DataFlow::SetWaitingStates( const char * ToServiceParameterName ) {
+  cdebug_in << pthread_self() << "/" << ThreadNo() << "GraphExecutor::DataFlow::SetWaitingStates( "
+            << ToServiceParameterName << " ) MacroGraph " << Name() << endl ;
+  bool RetVal = true ;
+  State( GraphExecutor::DataWaitingState ) ;
+  Done( false ) ;
+  GraphBase::OutPort * anOutPort ;
+  anOutPort = Graph()->GetChangeInDataNodePort( ToServiceParameterName ) ;
+  anOutPort->PortState(  SUPERV::WaitingState ) ;
+  anOutPort->PortDone( false ) ;
+  cdebug << pthread_self() << "GraphExecutor::DataFlow::SetWaitingStates " << Name()
+         << " " << State() << " " << ToServiceParameterName << " " << anOutPort->PortState()
+         << " Done : " << anOutPort->PortDone() << endl ;
+  if ( ! anOutPort->IsGate() ) {
+    GraphExecutor::InNode * anInNode = (GraphExecutor::InNode * ) Graph()->GetChangeGraphNode( anOutPort->InPorts( 0 )->NodeName() )->GetInNode() ;
+    cdebug << pthread_self() << "GraphExecutor::DataFlow::SetWaitingStates : "
+           << anInNode->Name() << "->SetWaitingStates( NULL ) for Port "
+           << anOutPort->InPorts( 0 )->PortName() << endl ;
+    anInNode->SetWaitingStates( NULL ) ;
+  }
+  cdebug_out << "GraphExecutor::DataFlow::SetWaitingStates() " << RetVal << endl;
+  return RetVal ;
+}
+
 bool GraphExecutor::DataFlow::Kill() {
   cdebug_in << "GraphExecutor::DataFlow::Kill()" << endl;
   bool RetVal = GraphExecutor::OutNode::Kill() ;
index caf4bf41e5d261da9dc5800ef2a436a7b5697f93..dc8038b0cacd2da6d74641eb89578ef7d65773fa 100644 (file)
@@ -70,13 +70,14 @@ namespace GraphExecutor {
       bool ChangeInputData( const char * ToNodeName ,
                             const char * ToParameterName ,
                             const CORBA::Any aValue = CORBA::Any() ) ;
+
       bool InputOfAny( const char * ToServiceParameterName ,
                        const CORBA::Any & aValue ,
                        const bool SomeDataReady = true ) ;
-
       bool OutputOfAny( const char * aNodeName ,
                         const char * ToServiceParameterName ,
                         const CORBA::Any & aValue ) ;
+      bool SetWaitingStates( const char * ToServiceParameterName ) ;
 
       bool IsValid() ;
       bool IsExecutable() ;
index 8408f5c2ff6ad6dea988911311b4fd55a47695f9..36b70bfe190eeb64842f6426424f17fb56cc7840 100644 (file)
@@ -728,6 +728,13 @@ void GraphExecutor::FiniteStateMachine::JoinThread( pthread_t aThread ) {
   }
 }
 
+int GraphExecutor::FiniteStateMachine::ThreadsNumber() {
+  if( _ThreadList.begin() == _ThreadList.end() )
+    return 0;
+  else
+    return _ThreadList.size();
+}
+
 ostream & operator<< (ostream &f ,const GraphExecutor::AutomatonState & aState ) {
   switch (aState) {
   case GraphExecutor::UnKnownState :
index 40f2c06f427a4a9f090771ebf2b792d924a5e400..257c208dbd5631bc048830373356558ae414748f 100644 (file)
@@ -233,6 +233,8 @@ namespace GraphExecutor {
       void JoinThread() ;
       void JoinThread( pthread_t aThread ) ;
 
+      int ThreadsNumber() ; // mkr : IPAL14711
+
       const char * ControlStateName( const SUPERV::ControlState & aState ) const {
             return _ControlStateName[ aState ] ; } ;
       const char * StateName( const GraphExecutor::AutomatonState & aState ) const {
index ac7428102830ca0a42e424e079d6db0c6e728fcf..bd312f42f758ac346eb7bd066f2b287f95a446b2 100644 (file)
@@ -1689,10 +1689,18 @@ const long GraphExecutor::InNode::CpuUsed( bool tot ) {
         cpu = Component()->CpuUsed_impl() ;
       }
       catch ( ... ) {
-        cdebug << "CpuUsed " << Name() << " --> Component()->CpuUsed_impl() ERROR catched "
-               << endl ;
-        State( GraphExecutor::ErroredState ) ;
-        _OutNode->State( GraphExecutor::ErroredState ) ;
+        if ( _OutNode->IsDone() ) {
+          cdebug << "CpuUsed " << Name() << " --> Component()->CpuUsed_impl() WARNING catched Graph is done "
+                 << Automaton()->StateName( _OutNode->State() ) << endl ;
+        }
+        else {
+          cdebug << "CpuUsed " << Name() << " --> Component()->CpuUsed_impl() WARNING catched "
+                 << Automaton()->StateName( _OutNode->State() ) << endl ;
+//JR NPAL14110 09.02.2007 : If there is a shutdown of components ===> NodeState must not
+//                          be aborted ... ==> Commented :
+          //JRState( GraphExecutor::ErroredState ) ;
+          //JR_OutNode->State( GraphExecutor::ErroredState ) ;
+        }
         cpu = -1 ;
       }
     }
index 008c7287874c8d24d1f2e8953e7fb62118e4ec9f..7b10bc378b926e0c962a6d050f6ea86eb71886ac 100644 (file)
@@ -459,7 +459,7 @@ namespace GraphExecutor {
       bool PyDynInvoke( PyObject * MyPyRunMethod ,
                        const char *method , 
                        ServicesAnyData * inParams , int nInParams ,
-                       ServicesAnyData * inParams , int nOutParams ) ;
+                       ServicesAnyData * outParams, int nOutParams ) ;
 
       int Executing_SuspendAction() ;
       int SuspendedExecuting_ResumeAction() ;
index 10bccd26fc443af0446a298c3051f53824e57a77..ea4f2387aad11691bfdca773d0192e53d701e0f3 100644 (file)
@@ -85,6 +85,9 @@ int GraphExecutor::InNode::SendEvent( const GraphExecutor::NodeEvent anEvent ) {
   _OldState = State() ;
   _NextState = Automaton()->NextState( _OldState , anEvent ) ;
   if ( _NextState == _OldState ) {
+    string anErrorMessage = string( "Automaton error for node " ) +
+                            string( Name() ) + " (SuperVision executor error)." ;
+    _OutNode->Graph()->SetMessages( anErrorMessage ) ;
     cdebug << pthread_self() << "/" << ThreadNo() << " " << Name()
            << " GraphExecutor::InNodeThreads::SendEvent SameStates ERROR _OldState/_NextState "
            << _OldState << " Event " << Automaton()->EventName( anEvent ) << endl ;
@@ -634,6 +637,7 @@ int GraphExecutor::InNode::executeAction() {
         delete [] msg ;
         pthread_exit( msg ) ;
       }
+      _OutNode->setRunFuncThread( T ) ; // mkr : IPAL14711
 #if ActionsTrace
       cdebug << pthread_self() << "/" << ThreadNo() << " " << Name()
              << " executeAction has created thread " << T << endl ;
@@ -888,7 +892,8 @@ int GraphExecutor::InNode::VoidAction() {
 int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
 #if SomeDataReadyActionTrace
   cdebug_in << pthread_self() << "/" << ThreadNo() << " " << Name()
-            << " DataWaiting_SomeDataReadyAction from " << DataFromNode() << endl;
+            << " DataWaiting_SomeDataReadyAction from " << DataFromNode()
+            << " " << GetNodeInPortsSize() << " Inport(s)" << endl;
 #endif
   unsigned int k;
   int InReady = 0 ;
@@ -979,7 +984,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
       anOutPort = anInPort->GetOutPort() ;
       if ( anOutPort ) {
 #if SomeDataReadyActionTrace
-        cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+        cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+               << k << " "
                << anInPort->PortName() << " already setted to OutPort " << anOutPort->NodeName()
                << "( " << anOutPort->PortName() << " )" << endl ;
 #endif
@@ -988,7 +994,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
         anOutPort = CoupledNode()->GetChangeOutPort( anInPort->PortName() ) ;
         if ( anOutPort ) {
 #if SomeDataReadyActionTrace
-          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+                 << k << " "
                  << anInPort->PortName() << " change of OutPort from "
                  << anInPort->GetOutPort()->NodeName() << "( " << anInPort->GetOutPort()->PortName()
                  << " ) to " << anOutPort->NodeName() << "( " << anOutPort->PortName() << " )"
@@ -996,7 +1003,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
 #endif
        }
         else {
-          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+                 << k << " "
                  << anInPort->PortName() << " have NO OutPort ERROR " << endl ;
           return 0 ;
        }
@@ -1007,7 +1015,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
       anOutPort = anInPort->GetOutPort() ;
     }
 #if SomeDataReadyActionTrace
-    cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+    cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+           << k << " "
            << anInPort->PortName() << " " << anInPort->PortState() << " "
            << anInPort->PortStatus() << " " << anInPort->Kind()  ;
     if ( anOutPort ) {
@@ -1045,6 +1054,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
 #endif
         cdebug << endl ;
 #endif
+//JR 30.01.2007 : wrong debug for PAL12455
+#if 0
         // mkr : PAL12455 -->
         // MacroNode : give immediately the value to the corresponding graph
         if ( IsMacroNode() ) {
@@ -1057,6 +1068,7 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
           aMacroGraph->InputOfAny( anInPort->PortName() , anOutPort->Value() ) ;
         }
         // mkr : PAL12455 <--
+#endif
       }
       else if ( IsLoopNode() && anInPort->IsDataConnected() ) {
         anInPort->PortState( SUPERV::ReadyState ) ;
@@ -1240,10 +1252,32 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
     cdebug << pthread_self() << "/" << ThreadNo() << " Node " << Name() << " HasAllDataReady"
            << endl ;
 #endif
+//JR 30.01.2007 Right Debug PAL12455 --->
+//That must be done only for DataConnected ports and only once
+    if ( IsMacroNode() ) {
+      GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ;
+      for ( k = 0 ; k < (unsigned int ) GetNodeInPortsSize() ; k++ ) {
+        GraphBase::InPort * anInPort = GetChangeNodeInPort(k) ;
+        GraphBase::OutPort * anOutPort ;
+        anOutPort = anInPort->GetOutPort() ;
+        if ( anInPort->IsDataConnected() ) {
+          cdebug << "SomeDataReadyAction MacroNode " << aMacroGraph->Name()
+                 << " --> InputOfAny " << InReady << "/" << GetNodeInPortsSize()
+                 << " InPorts are Ready ( " << anInPort->PortName()
+                 << " ) ===> InputOfAny" << endl ;
+          aMacroGraph->InputOfAny( anInPort->PortName() , anOutPort->Value() ) ;
+        }
+      }
+    }
+// <--- JR 30.01.2007 Right Debug PAL12455
     HasAllDataReady( true ) ; // ==> Ready to execute
     res = 1 ;
   }
   else { // At least one Flag == 0 :
+#if SomeDataReadyActionTrace
+    cdebug << pthread_self() << "/" << ThreadNo() << " Node " << Name() << " HasNOTAllDataReady "
+           << InReady << "/" << GetNodeInPortsSize() << " DoAllDataReadyIf " << DoAllDataReadyIf << endl ;
+#endif
     HasAllDataReady( false ) ;
     res = SendEvent( GraphExecutor::NotAllDataReadyEvent );
   }
@@ -2322,7 +2356,7 @@ int GraphExecutor::InNode::Errored_ExecutingAction() {
 }
 
 #define SetWaitingStatesTrace 0
-// Set SUPERV::WaitingState to all InPorts 
+// Set SUPERV::WaitingState to all InPorts and Nodes
 void GraphExecutor::InNode::SetWaitingStates(GraphExecutor::InNode * EndNode ) {
   int i ;
   int j ;
@@ -2369,6 +2403,17 @@ void GraphExecutor::InNode::SetWaitingStates(GraphExecutor::InNode * EndNode ) {
     cdebug << "               --> InPort " << Name() << "( " << anInPort->PortName() << " ) "
            << anInPort->PortStatus() << " " << anInPort->PortState() << endl ;
 #endif
+//JR NPAL14110 09.02.2007 : SetWaitingStates was missing in the corresponding SubGraph !...
+    if ( IsMacroNode() ) {
+      GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ;
+#if SetWaitingStatesTrace
+      cdebug << ThreadNo()
+             << " --> GraphExecutor::InNodeThreads::SetWaitingStates MacroNode " << Name()
+             << " ---> MacroGraph " << aMacroGraph->Name() << " Inport "
+             << anInPort->PortName() << endl;
+#endif
+      aMacroGraph->SetWaitingStates( anInPort->PortName() ) ;
+    }
   }
   for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
     GraphBase::OutPort * anOutPort = GetChangeNodeOutPort( i ) ;
@@ -3892,6 +3937,10 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
           const char * ToNodeName = anOutPort->ChangeInPorts( j )->NodeName() ;
           if ( !strcmp( ToNodeName , _OutNode->Name() ) &&
                _OutNode->Graph()->GraphMacroLevel() != 0 ) {
+//JR NPAL14110 09.02.2007 : That must be done only at the end of SubGraph because we may
+//                          have an output of the SubGraph in a Loop !...
+//                          So that code must be done in CheckAllDone
+#if 0
 #if OutParametersSetTrace
             cdebug << "OutParametersSet ToNodeName " << _OutNode->Name() << " CoupledNode "
                    << _OutNode->Graph()->CoupledNodeName() << _OutNode->Graph()->CoupledNode()
@@ -3907,7 +3956,7 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err ,
                    << _OutNode->Graph()->CoupledNodeName() << " , "
                    << anOutPort->ChangeInPorts( j )->PortName() << " , value )" << endl ;
 #endif
-
+#endif
          }
           else {
            GraphBase::ComputingNode * ToNode = _OutNode->Graph()->GetChangeGraphNode( ToNodeName ) ;
index ef342d0572bed16b99fdb15078a9d58cd181759a..55d1df53023bad3f10ca2cbbadbbdf49f5bda57a 100644 (file)
@@ -31,6 +31,7 @@ using namespace std;
 #include "DataFlowExecutor_OutNode.hxx"
 
 #include "DataFlowEditor_DataFlow.hxx"
+#include "DataFlowExecutor_DataFlow.hxx"
 
 // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL    
 //extern Engines_Container_i * _TheContainer ;
@@ -55,6 +56,7 @@ GraphExecutor::OutNode::OutNode() {
   _ControlState = SUPERV::VoidState ;
   _State = GraphExecutor::UnKnownState ;
   _PyInitialized = false ;
+  _run_func_thread = 0;
   pthread_mutex_init( &_MutexWait , NULL ) ;
   pthread_mutex_init( &_PyMutexWait , NULL ) ;
   if ( pthread_cond_init( &_EventWait , NULL ) ) {
@@ -96,6 +98,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
   _ControlState = SUPERV::VoidState ;
   _State = GraphExecutor::UnKnownState ;
   _PyInitialized = false ;
+  _run_func_thread = 0;
   _Orb = CORBA::ORB::_duplicate( ORB ) ;
   pthread_mutex_init( &_MutexWait , NULL ) ;
   pthread_mutex_init( &_PyMutexWait , NULL ) ;
@@ -159,6 +162,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB,
   _ControlState = SUPERV::VoidState ;
   _State = GraphExecutor::UnKnownState ;
   _PyInitialized = false ;
+  _run_func_thread = 0;
   _Orb = CORBA::ORB::_duplicate( ORB ) ;
   pthread_mutex_init( &_MutexWait , NULL ) ;
   pthread_mutex_init( &_PyMutexWait , NULL ) ;
@@ -714,7 +718,7 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
     else {
       State( GraphExecutor::ErroredState ) ;
       Done( true ) ;
-      if ( IsDone() ) {
+      if ( IsDone() && Graph()->GraphMacroLevel() == 0 ) {
         cdebug << " ==> theAutomaton->Executed() " << endl ;
         theAutomaton->Executed() ;
       }
@@ -734,7 +738,7 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
 //              two graphs execution with two different python functions with the same name
 //              give aborted state for the second one
 //Example : GraphLoopSwitchOfSwitchNOTValid, GraphLoopSwitchs and GraphLoopSwitchsBranches
-    if ( IsDone() ) {
+    if ( IsDone() && Graph()->GraphMacroLevel() == 0 ) {
       cdebug << " ==> theAutomaton->Executed() " << endl ;
       theAutomaton->Executed() ;
     }
@@ -836,9 +840,33 @@ void GraphExecutor::OutNode::CheckAllDone() {
     MESSAGE("================================================================================") ;
     cdebug << "================================================================================" << endl ;
     cdebug << Name() << " IS DONE : " <<  theAutomaton->StateName( AutomatonState() ) << " EventQSize "
-             << EventQSize() << endl  ;
+            << EventQSize() << endl  ;
     cdebug << "================================================================================" << endl ;
 
+    if ( Graph()->GraphMacroLevel() != 0 ) {
+//JR NPAL14110 09.02.2007 : That must be done only at the end of SubGraph because we may
+//                          have an output of the SubGraph in a Loop !...
+//                          So that code must be done in CheckAllDone instead of OutParametersSet
+      cdebug << "CheckAllDone ToNodeName " << Name() << " CoupledNode "
+             << Graph()->CoupledNodeName() << Graph()->CoupledNode()
+             << endl ;
+      cdebug << "CheckAllDone GraphExecutor " << Graph()->CoupledNode()->GraphEditor()->Executor() << endl ;
+      const GraphBase::InPort * anInPort ;
+      GraphBase::OutPort * anOutPort ;
+      int i ;
+      for ( i = 0 ; i <  Graph()->GetNodeOutDataNodePortsSize() ; i++ ) {
+         anInPort = Graph()->GetNodeOutDataNodePort( i ) ;
+         if ( !anInPort->IsGate() ) {
+           anOutPort = anInPort->GetOutPort() ;
+           Graph()->CoupledNode()->GraphEditor()->Executor()->OutputOfAny( Graph()->CoupledNodeName() ,
+                                                                           anInPort->PortName() ,
+                                                                           anOutPort->Value() ) ;
+           cdebug << "CheckAllDone OutputOfAny( " << Graph()->CoupledNodeName() << " , "
+                  << anInPort->PortName() << " , value ) done" << endl ;
+         }
+      }
+    }
+
 //PAL8520
 //JR 23.02.2005, Debug : siftEvents() must be inside the pthread_mutex_lock
     if ( pthread_mutex_lock( &_MutexWait ) ) {
@@ -957,7 +985,8 @@ void GraphExecutor::OutNode::ExitThread( pthread_t ThreadNumber ) {
     cdebug << pthread_self() << " ExitThread( " << ThreadNumber << " ) " << _Threads
            << " running threads " << _SuspendedThreads << " suspended threads IsDone() "
            << IsDone() ;
-    if ( IsDone() ) {
+    _run_func_thread = 0 ; // mkr : IPAL14711
+    if ( IsDone() && Graph()->GraphMacroLevel() == 0 ) {
       cdebug << " ==> theAutomaton->Executed() " << endl ;
       theAutomaton->Executed() ;
     }
@@ -2144,6 +2173,11 @@ bool GraphExecutor::OutNode::DoneWait() {
     perror("pthread_mutex_lock _DoneWait") ;
     exit( 0 ) ;
   }
+  while ( _run_func_thread || theAutomaton->ThreadsNumber() ) {
+    // mkr : IPAL14711
+    // waiting for pthread_join in FiniteStateMachine
+  }
+  if ( Done() || IsKilled() ) Graph()->GraphEditor()->Editing(); // mkr : IPAL14572 : calling Editing() to indicate stop of execution
   cdebug_out << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Name()
              << " " << State() << " : " << aret << endl ;
   return aret ;
index 200d42b60120a3291512b1aa6150601e35eea23c..4a2a7da88744fcbf2bf39af1d147b503aa7f84e5 100644 (file)
@@ -70,6 +70,8 @@ namespace GraphExecutor {
       list< GraphExecutor::NodeEvent > _Events ;
       list< GraphExecutor::AutomatonState >   _States ;
 
+      pthread_t _run_func_thread ;
+
       bool Valid() ;
       void UnValid() ;
       bool Executable() ;
@@ -269,6 +271,8 @@ namespace GraphExecutor {
                                    const char *FromParameterName ) ;
       const long CpuUsed() ;
       const long CpuUsed( const char *aNodeName ) ;
+
+      void setRunFuncThread( pthread_t theThread ) { _run_func_thread = theThread; } ; // mkr : IPAL14711
   };
 };
 
index c3c5764072b0335e22d7ff318767ac68ebb56ba3..f80b931a468a5bd136a0c030870aa74686d6a18d 100644 (file)
@@ -916,7 +916,7 @@ void SUPERVGUI::deleteObject() {
   if (QMessageBox::warning(application()->desktop(),
                            tr("WARNING"),
                            tr("MSG_ASK_DELETE"),
-                           QMessageBox::No, QMessageBox::Yes) != QMessageBox::Yes)
+                           QMessageBox::Yes, QMessageBox::No) != QMessageBox::Yes)
     return;
 
   SALOME_ListIteratorOfListIO It( aList );
index a50fe23ce2ccaa3568f0d2040d6df841eb5005a4..5969c3923b921e34d07ed94b90a48f5ceaa9bc18 100644 (file)
@@ -302,7 +302,88 @@ void SUPERVGUI_BrowseNodeDlg::onFieldActivated()
   myActiveField = (aField->isEditable())? aField : 0;
 }
 
+namespace {
+
+  QString getIORfromIO (const Handle(SALOME_InteractiveObject)& theIO,
+                        SUPERVGUI * theModule)
+  {
+    QString ior ("");
+    if (!theIO->hasEntry()) return ior;
+
+    SalomeApp_Study* anAppStudy = dynamic_cast<SalomeApp_Study*>(theModule->getActiveStudy());
+    _PTR(SObject) aSObj (anAppStudy->studyDS()->FindObjectID(theIO->getEntry()));
+
+    _PTR(GenericAttribute) anAttr;
+    if (aSObj->FindAttribute(anAttr, "AttributeIOR")) {
+      _PTR(AttributeIOR) anIOR (anAttr);
+      ior = anIOR->Value().c_str();
+      return ior;
+    }
 
+    // old code, it is useless, because <aSSObj->GetObject()> here will be NULL
+    // (because it is retrieved from <aSSObj> by stored IOR)
+    /*
+      SALOMEDS_Study* aSStudy = dynamic_cast<SALOMEDS_Study*>( aSObj->GetStudy().get() );
+      SALOMEDS_SObject* aSSObj = dynamic_cast<SALOMEDS_SObject*>( aSObj.get() );
+      if ( aSStudy && aSSObj )
+      ior = aSStudy->ConvertObjectToIOR( aSSObj->GetObject() ).c_str();
+    //*/
+
+    // new code
+
+    // default value: null IOR (IOR:01000000010000000000...)
+    SalomeApp_Application* anApp = theModule->getApp();
+    CORBA::Object_var aNullObj;
+    ior = anApp->orb()->object_to_string(aNullObj);
+
+    // try to load a component data from an opened (presumably) study
+    _PTR(SComponent) aSComp = aSObj->GetFatherComponent();
+    std::string aCompIOR;
+    if (!aSComp->ComponentIOR(aCompIOR)) {
+      std::string aCompDataType = aSComp->ComponentDataType();
+
+      // obtain a driver by a component data type
+      // like it is done in SALOMEDS_DriverFactory_i::GetDriverByType
+      SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_nil();
+      SALOME_LifeCycleCORBA * LCC = anApp->lcc();
+      try {
+        CORBA::Object_var
+          anEngineObj = LCC->FindOrLoad_Component("FactoryServer", aCompDataType.c_str());
+        if (CORBA::is_nil(anEngineObj))
+          anEngineObj = LCC->FindOrLoad_Component("FactoryServerPy", aCompDataType.c_str());
+
+        if (!CORBA::is_nil(anEngineObj))
+          anEngine = SALOMEDS::Driver::_narrow(anEngineObj);
+      }
+      catch (...) {
+      }
+
+      if (!CORBA::is_nil(anEngine)) {
+        // try to load
+        _PTR(StudyBuilder) aStudyBuilder = aSObj->GetStudy()->NewBuilder();
+        bool isOk = true;
+        try {
+          CORBA::String_var aDriverIOR = anApp->orb()->object_to_string(anEngine);
+          aStudyBuilder->LoadWith(aSComp, aDriverIOR.in());
+        }
+        catch (...) {
+          isOk = false;
+        }
+
+        if (isOk) {
+          // now try to obtain the IOR once again (after successfull component data loading)
+          if (aSObj->FindAttribute( anAttr, "AttributeIOR" )) {
+            _PTR(AttributeIOR) anIOR ( anAttr );
+            ior = anIOR->Value().c_str();
+          }
+        }
+      } // if (!CORBA::is_nil(anEngine))
+    } // if (!aSComp->ComponentIOR(aCompIOR))
+
+    return ior;
+  }
+
+} // no name namespace
 
 /**
  * Slot, called when selection is changed
@@ -310,7 +391,7 @@ void SUPERVGUI_BrowseNodeDlg::onFieldActivated()
 void SUPERVGUI_BrowseNodeDlg::onSelectionChanged()
 {
   if ( myActiveField ) {
-    
+
     SALOME_ListIO aList;
     aList.Clear();
 
@@ -320,28 +401,13 @@ void SUPERVGUI_BrowseNodeDlg::onSelectionChanged()
       return;
     }
 
-    (( SalomeApp_Application* )(aSupMod->getActiveStudy()->application()))
-      ->selectionMgr()->selectedObjects( aList );
-    
-    if( aList.Extent() == 1 ) {
+    SalomeApp_Application* anApp = aSupMod->getApp();
+    anApp->selectionMgr()->selectedObjects( aList );
+
+    if ( aList.Extent() == 1 ) {
       Handle( SALOME_InteractiveObject ) anIO = aList.First();
       if ( anIO->hasEntry() ) {
-       _PTR(SObject) aObj ( dynamic_cast<SalomeApp_Study*>( aSupMod->getActiveStudy() )->
-                            studyDS()->FindObjectID( anIO->getEntry() ) );
-         
-       _PTR(GenericAttribute) anAttr;
-       QString ior("");
-         
-       if (aObj->FindAttribute( anAttr, "AttributeIOR" ) ) {
-         _PTR(AttributeIOR) anIOR ( anAttr );
-         ior = anIOR->Value().c_str();
-       }
-       else {
-         SALOMEDS_Study* aSStudy = dynamic_cast<SALOMEDS_Study*>( aObj->GetStudy().get() );
-         SALOMEDS_SObject* aSSObj = dynamic_cast<SALOMEDS_SObject*>( aObj.get() );
-         if ( aSStudy && aSSObj )
-           ior = aSStudy->ConvertObjectToIOR( aSSObj->GetObject() ).c_str();
-       }
+        QString ior = ::getIORfromIO(anIO, aSupMod);
        myActiveField->setData( ior );
       }
     }
@@ -476,35 +542,20 @@ void SUPERVGUI_GetValueDlg::onSelectionChanged()
 {
   SALOME_ListIO aList;
   aList.Clear();
-  
+
   SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
   if ( !aSupMod ) {
     MESSAGE("NULL Supervision module!");
     return;
   }
-  
-  (( SalomeApp_Application* )(aSupMod->getActiveStudy()->application()))
-    ->selectionMgr()->selectedObjects( aList );
-  
-  if( aList.Extent() == 1 ) {
+
+  SalomeApp_Application* anApp = aSupMod->getApp();
+  anApp->selectionMgr()->selectedObjects( aList );
+
+  if ( aList.Extent() == 1 ) {
     Handle( SALOME_InteractiveObject ) anIO = aList.First();
     if ( anIO->hasEntry() ) {
-      _PTR(SObject) aObj ( dynamic_cast<SalomeApp_Study*>( aSupMod->getActiveStudy() )->
-                          studyDS()->FindObjectID( anIO->getEntry() ) );
-       
-      _PTR(GenericAttribute) anAttr;
-      QString ior("");
-       
-      if (aObj->FindAttribute( anAttr, "AttributeIOR" ) ) {
-       _PTR(AttributeIOR) anIOR ( anAttr );
-       ior = anIOR->Value().c_str();
-      }
-      else {
-       SALOMEDS_Study* aSStudy = dynamic_cast<SALOMEDS_Study*>( aObj->GetStudy().get() );
-       SALOMEDS_SObject* aSSObj = dynamic_cast<SALOMEDS_SObject*>( aObj.get() );
-       if ( aSStudy && aSSObj )
-         ior = aSStudy->ConvertObjectToIOR( aSSObj->GetObject() ).c_str();
-      }
+      QString ior = ::getIORfromIO(anIO, aSupMod);
       myField->setData( ior );
     }
   }
index 5d9c498d3513f3fac2fde17fa4063d040f2f9565..71bd607f5d65f2735c1e68ee1ef989f9e41a898c 100644 (file)
@@ -26,6 +26,7 @@
 #include "SUPERVGUI_CanvasControlNode.h"
 #include "SUPERVGUI_CanvasControlNodePrs.h"
 #include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUPERVGUI_CanvasLink.h"
 #include "SUPERVGUI_Clipboard.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI.h"
@@ -244,7 +245,43 @@ void SUPERVGUI_CanvasGotoNode::linkToNode() {
   if (aDlg->exec()) {
     QString aNodeName = aDlg->getName();
     if (!aNodeName.isEmpty()) { //implement additional check from GUI side for bug PAL7007
+      // mkr : here we should re/create (if it is not yet exists) a presentation for new
+      //       Goto(OutGate)->CoupledNode(InGate) link, which will be created in SetCoupled method
+
+      // check if GoTo node have coupled node
+      SUPERV_INode aCoupledNode = getGotoNode()->Coupled();
+      if ( !SUPERV_isNull(aCoupledNode) )
+      { // we got old coupled node
+       SUPERV_Port anInGatePort = aCoupledNode->GetInPort("InGate");
+       SUPERV_Link anOldLinkEngine = anInGatePort->Link();
+       if ( !SUPERV_isNull(anOldLinkEngine) )
+       { // we got old link engine
+         SUPERVGUI_CanvasLink* anOldLinkPrs = getMain()->getCanvas()->getLink(anOldLinkEngine);
+         if ( anOldLinkPrs )
+         { // delete old link presentation
+           delete anOldLinkPrs;
+           anOldLinkPrs = 0;
+         }
+       }
+      }
+
       getGotoNode()->SetCoupled(aNodeName.latin1());
+
+      aCoupledNode = SUPERV::INode::_narrow(getMain()->getDataflow()->Node(aNodeName.latin1()));
+      if ( !SUPERV_isNull(aCoupledNode) )
+      { // we got new coupled node
+       SUPERV_Port anInGatePort = aCoupledNode->GetInPort("InGate");
+       SUPERV_Link aLinkEngine = anInGatePort->Link();
+       if ( !SUPERV_isNull(aLinkEngine) )
+       { // we got new link engine
+         if ( !getMain()->getCanvas()->getLink(aLinkEngine) )
+         { // there is no presentation for such link engine => create it
+           SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(getMain()->getCanvas(), getMain(), aLinkEngine);
+           aLink->show();
+         }
+       }
+      }
+
       getMain()->getCanvas()->sync();
     }
   }
index 70a1e3826177ac2069ffe8aa2cf4cadb4b4e874f..3c957e645eca7c9ef4ed595fd7cfd22230cb0ca1 100644 (file)
@@ -401,7 +401,8 @@ bool SUPERVGUI_CanvasLinkBuilder::canCreateEngine(SUPERVGUI_CanvasPort* thePort)
 
     // asv : 15.12.04 : NOT allow to connect Gate-to-InLine --> it does not make sence!
     // Out Gate port can be connected only to In Gate port 
-    if ( aOutKind == SUPERV::GateParameter && aInKind != SUPERV::GateParameter )
+    // mkr : NPAL14823 : Out Gate port can be connected to Inline port too
+    if ( aOutKind == SUPERV::GateParameter && aInKind != SUPERV::GateParameter && aInKind != SUPERV::InLineParameter )
       return false;
 
     // In Gate can be connected to (receive links from) Gate port and InLine ports (important for Switch nodes)
index deb10c225b75f7c71673565ef46322a0fa32e286..9daf3ae8062a2865c0ca4215a9cee71f0ec697ca 100644 (file)
@@ -74,7 +74,7 @@ using namespace boost;
         SUPERV::Port_ptr aPort = aPortList[p].in(); \
         if ( !aPort->IsInput() && !aPort->IsGate() ) { \
           bool aInStudy = dynamic_cast<SUPERVGUI_CanvasPortOut*>( aMain->getCanvas()->getPort(aPort) )->isInStudy(); \
-          dynamic_cast<SUPERVGUI_CanvasPortOut*>( getCanvas()->getPort( getDataflow()->Node(aCNode->Name())->Port(aPort->Name()) ) )->setStudyState(aInStudy); \
+          dynamic_cast<SUPERVGUI_CanvasPortOut*>( getCanvas()->getPort( getDataflow()->Node(aCNode->Name())->GetOutPort(aPort->Name()) ) )->setStudyState(aInStudy); \
         } \
       } \
     }
@@ -1594,6 +1594,7 @@ void SUPERVGUI_Thread::main_thread_run(SUPERV_CNode& aNode, SUPERV::GraphEvent&
 {
     // in case node "said" something during changing state through notification mechanism - output it
     myMain->syncNotification();
+    myMain->sync(); // mkr : NPAL14881
     
     // "kill" or undefined event came
     if (( aEvent == SUPERV::UndefinedEvent && aState == SUPERV::UndefinedState ) ||
index c11d116732d3258e6fd43457daf21e5daa812c33..401925330d29a7a5605ff61f4c8e3a7bc95252bd 100644 (file)
@@ -289,9 +289,11 @@ void SUPERVGUI_ManagePortsDlg::init()
   connect( myTypeCombo, SIGNAL(activated(const QString&)), this, SLOT(typeChanged(const QString&)));
 
   // mkr: PAL12448
-  connect( myInList,SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)), this, SLOT(itemDeselect(QListBoxItem*, const QPoint&)));
-  connect( myOutList,SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)), this, SLOT(itemDeselect(QListBoxItem*, const QPoint&)));
-  
+  connect( myInList,  SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)),
+           this, SLOT(itemDeselect(QListBoxItem*, const QPoint&)));
+  connect( myOutList, SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)),
+           this, SLOT(itemDeselect(QListBoxItem*, const QPoint&)));
+
   myNode->getMain()->lockedGraph( true );
 
   // asv : 11.01.05 : if a node is a loop node, then only INPUT ports can be added/removed
@@ -302,7 +304,9 @@ void SUPERVGUI_ManagePortsDlg::init()
     anUpOutputBtn->setEnabled( false );
     aDownOutputBtn->setEnabled( false );
   }
-    
+
+  // NPAL15537: initialization moved here from showEvent()
+  init( myNode );
 }
 
 /**
@@ -392,8 +396,10 @@ void SUPERVGUI_ManagePortsDlg::accept() {
        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()));
+         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);
        }
@@ -404,8 +410,10 @@ void SUPERVGUI_ManagePortsDlg::accept() {
          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()));
+           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);
          } 
@@ -522,14 +530,6 @@ void SUPERVGUI_ManagePortsDlg::reject() {
   close();
 }
 
-/**
- * Update current values on show event
- */
-void SUPERVGUI_ManagePortsDlg::showEvent( QShowEvent* theEvent ) {
-  init( myNode );
-  QDialog::showEvent( theEvent );
-}
-
 /**
  * Initialize In/Out tables with values from the given node
  */
index ac6cd16ab2a780caff52386260fa194a35dd12a3..c603b936123cf76b66dbcbb5cf4a62431448b2d3 100644 (file)
@@ -81,7 +81,6 @@ protected slots:
   void itemDeselect(QListBoxItem* item, const QPoint& point); // mkr: PAL12448
 
 protected:
-  virtual void showEvent( QShowEvent* theEvent );
   void addPort( QListBox* );
   void removePort( QListBox* );
   void moveUp( QListBox* );
index 2bdc79a3a1ca7327356732c6530bf12b8beb6b76..10b50937f3c28d2ed54de172885c027835cbe5cf 100644 (file)
@@ -117,6 +117,8 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
   aBaseLayoutV->setSpacing(10);
 
   QHBoxLayout* aBaseLayout = new QHBoxLayout(aCorbaPane); //!!
+  aBaseLayout->setMargin(5);
+  aBaseLayout->setSpacing(10);
  
   components = new QListView(aCorbaPane);
   components->addColumn(tr("COL_COMPONENTS"));
@@ -127,6 +129,7 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
   components->setColumnAlignment(3, AlignLeft);
   components->setSelectionMode(QListView::Extended);
   components->setRootIsDecorated(true);
+
 //  aBaseLayout->addWidget(components);
   aBaseLayoutV->addWidget(components); //!!
 
@@ -137,11 +140,16 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
 //NRI   connect(aComputeCBtn, SIGNAL(clicked()), this, SLOT(addComputeNode())); //!!
 //NRI   aComputeCBtn->setDefault(false); 
 
-  QPushButton* aComputeBtn = new QPushButton(tr("TIT_ADDFNODE"), aCorbaPane);
-  connect(aComputeBtn, SIGNAL(clicked()), this, SLOT(addFactoryNode()));
-  aComputeBtn->setDefault(true); 
+  QPushButton* aComputeBtnDef = new QPushButton(tr("TIT_ADDFNODE"), aCorbaPane);
+  connect(aComputeBtnDef, SIGNAL(clicked()), this, SLOT(addFactoryNodeDef()));
+  aComputeBtnDef->setDefault(true); 
+
+  QPushButton* aComputeBtnCust = new QPushButton(tr("TIT_ADDFNODE_CUST"), aCorbaPane);
+  connect(aComputeBtnCust, SIGNAL(clicked()), this, SLOT(addFactoryNodeCust()));
+  aComputeBtnCust->setDefault(true); 
 
-  aBaseLayout->addWidget(aComputeBtn);
+  aBaseLayout->addWidget(aComputeBtnDef);
+  aBaseLayout->addWidget(aComputeBtnCust);
   //NRI  aBaseLayout->addWidget(aComputeCBtn); //!!
 
   aBaseLayoutV->insertLayout(-1, aBaseLayout);
@@ -420,7 +428,7 @@ void SUPERVGUI_Service::addComputeNode() {
   }
 }
 
-void SUPERVGUI_Service::addFactoryNode() {
+void SUPERVGUI_Service::addFactoryNodeDef() {
   SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop();
   CAM_Application* anApp = ( CAM_Application* )(SUIT_Session::session()->activeApplication());
   if ( !anApp ) return;
@@ -492,6 +500,115 @@ void SUPERVGUI_Service::addFactoryNode() {
   }
 }
 
+void SUPERVGUI_Service::addFactoryNodeCust() {
+  SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop();
+  CAM_Application* anApp = ( CAM_Application* )(SUIT_Session::session()->activeApplication());
+  if ( !anApp ) return;
+
+  SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+  if ( !aSupMod ) {
+    MESSAGE("NULL Supervision module!");
+    return;
+  }
+
+  SUPERVGUI_Main* aMain = aSupMod->getMain();
+  if (aMain==0) {
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
+  } else if (!aMain->isEditable()) {
+    QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));     
+  } else {
+    CORBA::Object_ptr obj  = naming->Resolve("/Kernel/ModulCatalog");
+    SALOME_ModuleCatalog::ModuleCatalog_var* aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var;
+    *aModuleCatalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(obj);
+    if (CORBA::is_nil(*aModuleCatalog)) {
+      QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
+    } else {
+      QListViewItem*        item;
+      bool                  b = false;
+      
+      QListViewItemIterator iSel(components);
+      int count = 0;
+      for (; iSel.current(); ++iSel) { // check : how many objects are selected (single or multi)
+       item = iSel.current();
+       if (item->isSelected()) count++;
+       if ( count > 1) break;
+      }
+          
+      QListViewItemIterator i(components);
+      QString anAuthor, aContainer, aComment;
+      bool DoneSetting = false;
+      int aRes = 0;
+      for (; i.current(); ++i) {
+       item = i.current();
+       if (item->isSelected()) {
+         const char* service   = item->text(0).latin1();
+         const char* interface = item->parent()->text(0).latin1();
+         //const char* component = anApp->moduleName(item->parent()->parent()->text(0).latin1());
+         // mkr : PAL13135 -->
+         if ( aSupMod->getInterfaceNameMap().contains(item->parent()->parent()->text(0)) ) {
+           const char* component = aSupMod->getInterfaceNameMap().find(item->parent()->parent()->text(0)).data();
+           // mkr : PAL13135 <--
+
+           SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
+           if (myComponent==NULL) {
+             QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
+           } 
+           else {
+             const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
+             SUPERV_CNode aNode;
+             if ( myService->TypeOfNode == 0 ) { // ComputeNode
+               aNode = aMain->getDataflow()->CNode(*myService);
+               if (CORBA::is_nil( aNode ) ) {
+                 QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));        
+                 return;
+               }
+             } 
+             else { // Factory Node
+
+               SUPERVGUI_CustomSettings* aCSDialog = 0;
+               if ( count > 1 && !DoneSetting) { // multi selection
+                 DoneSetting = true;
+                 aCSDialog = new SUPERVGUI_CustomSettings(item, true, myComponent->implementation_type());
+               }
+               else if ( count == 1 ) // single selection
+                 aCSDialog = new SUPERVGUI_CustomSettings(item, false, myComponent->implementation_type());
+               
+               if ( aCSDialog ) {
+                 aRes = aCSDialog->exec();
+                 if (aRes) {
+                   anAuthor = aCSDialog->Author();
+                   aContainer = aCSDialog->Container();
+                   aComment = aCSDialog->Comment();
+                 }
+                 delete aCSDialog;
+               }
+               
+               aNode = aMain->getDataflow()->FNode(component, interface, *myService, myComponent->implementation_type()); // mkr : PAL11273
+               if ( CORBA::is_nil( aNode ) ) {
+                 QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));        
+                 return;
+               }
+
+               if (aRes) {
+                 aNode->SetAuthor(anAuthor.latin1());
+                 SUPERV::FNode::_narrow(aNode)->SetContainer(aContainer.latin1());
+                 aNode->SetComment(aComment.latin1());
+               }
+               
+             }
+             SUPERV::INode_var aDummyEndNode;
+             addNode( aNode, aDummyEndNode, myX, myY );
+             b = true;
+           }
+         }
+       }
+      }
+      if ( !b ) {
+       QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD"));
+      }
+    }
+  }
+}
 
 void SUPERVGUI_Service::addInlineNode() {
   SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
@@ -1061,3 +1178,166 @@ void SUPERVGUI_Service::addNode( SUPERV::CNode_var theNode, SUPERV::INode_var th
   }
 }
 
+/*!
+  Constructor
+*/
+SUPERVGUI_CustomSettings::SUPERVGUI_CustomSettings(QListViewItem* theItem,
+                                                  bool isMultiSel,
+                                                  bool isCimpl)
+     : QDialog( SUIT_Session::session()->activeApplication()->desktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) 
+{
+  Trace("SUPERVGUI_CustomSettings::SUPERVGUI_CustomSettings");
+
+  SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+  if ( !aSupMod ) {
+    MESSAGE("NULL Supervision module!");
+    return;
+  }
+
+  SUIT_Desktop* aDesktop = SUIT_Session::session()->activeApplication()->desktop();
+
+  setSizeGripEnabled( true );
+
+  QGridLayout* TopLayout = new QGridLayout( this );
+  TopLayout->setSpacing( 6 );
+  TopLayout->setMargin( 11 );
+    
+  QGroupBox* TopGroup = new QGroupBox( this, "TopGroup" );
+  TopGroup->setColumnLayout(0, Qt::Vertical );
+  TopGroup->layout()->setSpacing( 0 );
+  TopGroup->layout()->setMargin( 0 );
+  QGridLayout* TopGroupLayout = new QGridLayout( TopGroup->layout() );
+  TopGroupLayout->setAlignment( Qt::AlignTop );
+  TopGroupLayout->setSpacing( 6 );
+  TopGroupLayout->setMargin( 11 );
+
+  QLabel* authL = new QLabel( tr( "AUTHOR_LBL" ), TopGroup); 
+  authV = new QLineEdit( TopGroup );
+  authV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  authV->setMinimumSize( 200, 0 );
+  authV->setText( "" );
+
+  contL = new QLabel( tr( "CONTAINER_LBL" ), TopGroup ); 
+  contV = new QLineEdit( TopGroup );
+  contV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  contV->setMinimumSize( 200, 0 );
+  
+  QLabel* commL = new QLabel( tr( "COMMENT_LBL" ), TopGroup); 
+  commV = new QMultiLineEdit( TopGroup );
+  commV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+  commV->setMinimumSize( 200, 100 );
+
+  if ( !aSupMod->getInterfaceNameMap().contains(theItem->parent()->parent()->text(0)) ) {
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD"));
+    return;
+  }
+  const char* component = aSupMod->getInterfaceNameMap().find(theItem->parent()->parent()->text(0)).data();
+
+  QString aNodeDefComment;
+  if ( !isMultiSel ) {
+    // 1) set caption
+    const char* service = theItem->text(0).latin1();
+    aNodeDefComment = QString(service) + QString(tr("COMMENT_FROM")) + QString(component);
+    setCaption( tr( "TLT_CUSTOMPARAMETERS_SINGLE" ) + aNodeDefComment );
+  }
+  else {
+    // 1) set caption
+    aNodeDefComment = QString("Factory Node");
+    setCaption( tr( "TLT_CUSTOMPARAMETERS_MULTI" ) );
+  }
+  
+  // 2) set Container
+  SUPERVGUI_Main* aMain = aSupMod->getMain();
+  if (aMain==0) {
+    QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
+    return;
+  }
+  const char* aContainer = aMain->getDataflow()->ContainerNameForComponent(component);
+  if ( aContainer && strlen(aContainer) > 0 )
+    contV->setText( QString(aContainer) );
+  else if ( isCimpl ) // C++ implementation
+    contV->setText( QString(aMain->getDataflow()->DefaultCContainerName()) );
+  else // Python implementation
+    contV->setText( QString(aMain->getDataflow()->DefaultPythonContainerName()) );
+
+  // 3) set comment
+  commV->setText( aNodeDefComment );
+
+  TopGroupLayout->addWidget( authL, 1, 0 );
+  TopGroupLayout->addWidget( authV, 1, 1 );
+  TopGroupLayout->addWidget( contL, 2, 0 );
+  TopGroupLayout->addWidget( contV, 2, 1 );
+  TopGroupLayout->addWidget( commL, 7, 0 );
+  TopGroupLayout->addMultiCellWidget( commV, 7, 8, 1, 1 );
+  TopGroupLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::Expanding  ), 8, 0 );
+  TopGroupLayout->setColStretch( 1, 5 );
+
+  QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
+  GroupButtons->setColumnLayout(0, Qt::Vertical );
+  GroupButtons->layout()->setSpacing( 0 );
+  GroupButtons->layout()->setMargin( 0 );
+  QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
+  GroupButtonsLayout->setAlignment( Qt::AlignTop );
+  GroupButtonsLayout->setSpacing( 6 );
+  GroupButtonsLayout->setMargin( 11 );
+
+  QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
+  connect( okB,     SIGNAL( clicked() ), this, SLOT( okButton() ) );
+  QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
+  connect( cancelB, SIGNAL( clicked() ), this, SLOT( koButton() ) );
+
+  GroupButtonsLayout->addWidget( okB, 0, 0 );
+  GroupButtonsLayout->addItem  ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
+  GroupButtonsLayout->addWidget( cancelB, 0, 2 );
+
+  TopLayout->addWidget( TopGroup,     0, 0 );
+  TopLayout->addWidget( GroupButtons, 1, 0 );
+  TopLayout->setRowStretch( 0, 1 );
+  TopLayout->setRowStretch( 1, 0 );
+
+  resize(370,200);
+}
+
+/*!
+  Destructor
+*/
+SUPERVGUI_CustomSettings::~SUPERVGUI_CustomSettings() {
+  Trace("SUPERVGUI_CustomSettings::~SUPERVGUI_CustomSettings");
+}
+
+/*!
+  Get author
+*/
+QString SUPERVGUI_CustomSettings::Author() {
+  return authV->text();
+}
+
+/*!
+  Get container
+*/
+QString SUPERVGUI_CustomSettings::Container() {
+  return contV->text();
+}
+
+/*!
+  Get comment
+*/
+QString SUPERVGUI_CustomSettings::Comment() {
+  return commV->text();
+}
+
+/*!
+  <OK> button slot
+*/
+void SUPERVGUI_CustomSettings::okButton() {
+  Trace("SUPERVGUI_CustomSettings::okButton");
+  accept();
+}
+
+/*!
+  <Cancel> button slot
+*/
+void SUPERVGUI_CustomSettings::koButton() {
+  Trace("SUPERVGUI_CustomSettings::koButton");
+  reject();
+}
index 6fb1f56e41f5fe793b50e5e7a2889279eaae4337..f28da4ce52a247935ba6cb6858c0171c16758fa4 100644 (file)
@@ -115,7 +115,8 @@ private:
 private slots:
     void tabChanged(QWidget *);
     void addComputeNode();
-    void addFactoryNode();
+    void addFactoryNodeDef();
+    void addFactoryNodeCust();
     void addInlineNode();
     void addMacroNode();
     void typeNodeSelected(int theRow);
@@ -210,4 +211,28 @@ private:
   SUPERVGUI_PythonEditPane* myNextPane;
 };
 
+class SUPERVGUI_CustomSettings: public QDialog {
+  Q_OBJECT
+
+  public:
+    SUPERVGUI_CustomSettings(QListViewItem* theItem, bool isMultiSel, bool isCimpl);
+    virtual ~SUPERVGUI_CustomSettings();
+
+    QString Author();
+    QString Container();
+    QString Comment();
+
+  private slots:
+    void okButton();
+    void koButton();
+
+  private:
+
+    QLineEdit*      authV;
+    QLineEdit*      contV;
+    QLabel*         contL;
+
+    QMultiLineEdit* commV;
+};
+
 #endif
index 45a1d25d7e2b6558736455e8d5d82cb5ea40a0b4..e4a7523550c0c67b56306e73a01963b30e2a5dc8 100644 (file)
@@ -495,6 +495,12 @@ msgstr "Rename Dataflow"
 msgid "TLT_INFORMATIONS"
 msgstr "Informations"
 
+msgid "TLT_CUSTOMPARAMETERS_SINGLE"
+msgstr "Set Custom Parameters for "
+
+msgid "TLT_CUSTOMPARAMETERS_MULTI"
+msgstr "Set Custom Parameters for a selected nodes"
+
 msgid "TLT_DSGRAPHPARAMS"
 msgstr "Data Stream Graph Parameters"
 
@@ -633,6 +639,9 @@ msgstr "Add Compute Node"
 msgid "TIT_ADDFNODE"
 msgstr "Add Node"
 
+msgid "TIT_ADDFNODE_CUST"
+msgstr "Add Node and Customize Parameters"
+
 msgid "BTN_FACTORYNODE"
 msgstr "Factory"
 
index 3b2addf9c9309fed1bae4bf31df8f7d7eb1419d8..6933b275ed99863ebf8b615a34baf5c6d5c3e579 100644 (file)
@@ -37,8 +37,6 @@ using namespace std;
 
 #include "StreamPort_Impl.hxx"
 
-char *FACTORYSERVERPY = "localhost/FactoryServerPy" ;
-
 CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
                        PortableServer::POA_ptr poa ,
                        PortableServer::ObjectId * contId , 
index a7a801aa13fdbc785b13f3494d3e825bc43a0f7f..b136c7faacb079cac747aee5f9f03ae54eb1a6e6 100644 (file)
@@ -64,6 +64,13 @@ FNode_Impl::FNode_Impl( CORBA::ORB_ptr orb ,
 //                                           NodeKindOfNode ) ) ;
   DataFlowNode()->ComponentName( NodeComponentName ) ;
   DataFlowNode()->InterfaceName( NodeInterfaceName ) ;
+
+  // mkr : PAL13947 -->
+  const char * aContainer = DataFlowEditor()->Graph()->RetrieveFromMapOfComponentNameContainer(NodeComponentName);
+  if ( aContainer ) // container for NodeComponentName component was found in the map
+    SetContainer( aContainer );
+  // mkr : PAL13947 <--
+
   endService( "FNode_Impl::FNode_Impl" );  
 //  cout << "<-- FNode_Impl::FNode_Impl" << endl ;
 }
@@ -161,6 +168,10 @@ bool FNode_Impl::SetContainer( const char * aDataFlowContainer ) {
 //  GraphExecutor::DataFlow * _DataFlowExecutor = DataFlowEditor()->Executor() ;
 //  if ( DataFlowEditor()->IsEditing() ) {
     RetVal = DataFlowNode()->Computer( aDataFlowContainer ) ;
+
+    // insert modified container into < ComponentName, Container > map
+    DataFlowEditor()->Graph()->InsertToMapOfComponentNameContainer( GetComponentName(), aDataFlowContainer ) ; // mkr : PAL13947
+
 //  }
 //  else if ( _DataFlowExecutor && ( _DataFlowExecutor->IsSuspended() ||
 //            _DataFlowExecutor->IsSuspended( DataFlowNode()->Name() ) ) ) {
index 89228a591aaa5939d988116f4919393faff38612..bc12026c729cf8bef3bbfbe3d22237167579eb41 100644 (file)
@@ -247,7 +247,8 @@ bool GNode_Impl::SetCoupled( const char * anInLineNode )
        ( !IsGOTO() && ( IsLoop() || IsSwitch() || IsEndLoop() || IsEndSwitch() ) ) ) {
     DataFlowNode()->CoupledNode( CoupledINode ) ;
     if ( CoupledINode && IsSwitch() ) {
-      DataFlowEditor()->AddLink( Name() , "Default" ,CoupledINode->Name() , "Default" ) ;
+//JR NPAL14793 05.02.2007 : do not add that link
+//      DataFlowEditor()->AddLink( Name() , "Default" ,CoupledINode->Name() , "Default" ) ;
     }
     else if ( CoupledINode && ( IsLoop() || IsEndLoop() ) ) {
       DataFlowEditor()->AddLink( Name() , "DoLoop" , CoupledINode->Name() , "DoLoop" ) ;
index 7564fd6402447b8bda97ee9c3762154e22be09c2..c0d7cf7eba9fb4f38584174ec399cd1528952b94 100644 (file)
@@ -589,10 +589,11 @@ SUPERV::SNode_ptr Graph_Impl::SNode( const char * FuncName ,
       myEndNode->SetObjRef( SUPERV::ESNode::_duplicate( iendobject ) ) ;
       myNode->SetCoupled( myEndNode->BaseNode()->Name() ) ;
       myEndNode->SetCoupled( myNode->BaseNode()->Name() ) ;
-      if ( !Link( myNode->Port( "Default" ) , myEndNode->Port( "Default" ) ) ) {
-        iobject = SUPERV::SNode::_nil() ;
-        iendobject = SUPERV::ESNode::_nil() ;
-      }
+//JR NPAL14793 05.02.2007 : do not add that link
+//      if ( !Link( myNode->Port( "Default" ) , myEndNode->Port( "Default" ) ) ) {
+//        iobject = SUPERV::SNode::_nil() ;
+//        iendobject = SUPERV::ESNode::_nil() ;
+//      }
     }
   }
   anEndOfSwitch = SUPERV::ESNode::_duplicate( iendobject ) ;
@@ -812,6 +813,7 @@ SUPERV::Graph_var Graph_Impl::LoadDataFlows( GraphExecutor::DataFlow * aDataFlow
          GraphExecutor::DataFlow * aMacroGraphExecutor ;
          CreateExecutor( _Orb , instanceName() , aMacroGraphName , SUPERV::DataStreamGraph ,
                        dbgfile , &aMacroGraphExecutor );
+          theAutomaton->Executed() ; // Decrement _GraphExecutingNumber for MacroSubGraph
 
        // set GraphMacroLevel for Executor's graph
          GraphBase::Graph* aMacroGraphExe = aMacroGraphExecutor->Graph();
@@ -2552,3 +2554,27 @@ void Graph_Impl::Editing() {
   }
 }
 
+/**
+ * Returns the default name of container for C component
+ */
+char* Graph_Impl::DefaultCContainerName() {
+  return ( CORBA::string_dup( FACTORYSERVER ) );
+}
+
+/**
+ * Returns the default name of container for Python component
+ */
+char* Graph_Impl::DefaultPythonContainerName() {
+  return ( CORBA::string_dup( FACTORYSERVERPY ) );
+}
+
+/*! 
+ * Returns the last container name associated with theComponentName component
+ */ 
+char* Graph_Impl::ContainerNameForComponent( const char * theComponentName ) {
+  const char* aContainer = DataFlowEditor()->Graph()->RetrieveFromMapOfComponentNameContainer(theComponentName);
+  if ( aContainer )
+    return my_strdup(aContainer);
+  else
+    return "";
+}
index 699fee05fb21f7e5b84c0157d640eedbc4973c4b..a6dffe743ae2778111cf75d4205a6fa170c26ec8 100644 (file)
@@ -212,6 +212,10 @@ class Graph_Impl : public POA_SUPERV::Graph ,
     virtual SUPERV::StreamGraph_ptr ToStreamGraph() ;
 
     virtual void Editing(); // Destroy Executor and use only Editor and its data model
+  
+    virtual char* DefaultCContainerName() ;
+    virtual char* DefaultPythonContainerName() ;
+    virtual char* ContainerNameForComponent( const char * theComponentName) ;
 
 private:
     bool run( const bool andSuspend = false ); // Run() calls run( false ), Start() calls run( true );
index 88fcfc3de8b8e6dbfd800c03cdcf512bee932d03..8a2d3c330db7a44ff151862b2ee27a5293292a85 100644 (file)
@@ -25,7 +25,9 @@
 # see salome_shared_modules.py
 # (avoids incomplete import at run time)
 
-print "============== import SUPERV ======================="
+from launchConfigureParser import verbose
+
+if verbose(): print "============== import SUPERV ======================="
 
 import SUPERV
 
index 4fd4fd19c15075de335957c7d69f4a0948451e58..510d76c3b5f2b6aa14d5fa66c542497691041722 100644 (file)
@@ -835,6 +835,7 @@ SUPERV::Graph_ptr SuperV_Impl::GraphE(const char * aGraphName ) {
     myGraph->SetObjRef( SUPERV::Graph::_duplicate( iobject ) ) ;
   }
   myGraph->ReadOnly() ;
+  myGraph->DataFlowEditor()->Graph()->ClearMapOfComponentNameContainer() ; // mkr : PAL13947
   endService( "SuperV_Impl::GraphE" );
   return SUPERV::Graph::_duplicate(iobject) ;
 }
@@ -884,6 +885,7 @@ SUPERV::StreamGraph_ptr SuperV_Impl::StreamGraphE(const char * aGraphName ) {
     myStreamGraph->SetObjRef( SUPERV::StreamGraph::_duplicate( iobject ) ) ;
   }
   myStreamGraph->ReadOnly() ;
+  myStreamGraph->DataFlowEditor()->Graph()->ClearMapOfComponentNameContainer() ; // mkr : PAL13947
   endService( "SuperV_Impl::StreamGraphE" );
   return SUPERV::StreamGraph::_duplicate(iobject) ;
 }
index 162c93289d2cd8d9f511406926713ab5e44c3381..4e7675e0289ada90a3a246251e8f9b6c804b91c5 100644 (file)
@@ -265,10 +265,12 @@ char * Value_Impl::ToString() {
   }
   ostringstream astr ;
   const char * retstr ;
+  string RetStr;
   int startstr = 0 ;
   switch (anAny.type()->kind()) {
     case CORBA::tk_string: {
       anAny >>= retstr;
+      RetStr = string(retstr);
 //      MESSAGE( "ToString( string ) '" << retstr << "'" );
       break ;
     }
@@ -276,7 +278,7 @@ char * Value_Impl::ToString() {
       CORBA::Long l;
       anAny >>= l;
       astr << l << ends ;
-      retstr = astr.str().c_str() ;
+      RetStr = astr.str() ;
 //      MESSAGE( "ToString( CORBA::Long ) '" << l << " " << retstr << "'" );
       break ;
     }
@@ -284,11 +286,12 @@ char * Value_Impl::ToString() {
       double d;
       anAny >>= d;
       astr << setw(25) << setprecision(18) << d << ends ;
-      retstr = astr.str().c_str() ;
+      RetStr = astr.str();
       int i = 0 ;
-      while ( i < (int ) strlen( retstr ) && retstr[ i++ ] == ' ' ) {
+      while ( i < (int ) RetStr.length() && RetStr.at(i++) == ' ' ) {
         startstr = i ;
       }
+      RetStr = RetStr.substr(startstr) ;
 //      MESSAGE( "ToString( double ) '" << d << "' '" << retstr << "' '" << &retstr[ startstr ] << "'");
       break ;
     }
@@ -300,22 +303,22 @@ char * Value_Impl::ToString() {
 #else
         anAny >>= obj ;
 #endif
-        retstr = _Orb->object_to_string( obj );
+       RetStr = _Orb->object_to_string( obj );
 //        MESSAGE( "ToString( object ) '" << retstr << "'" );
       }
       catch ( ... ) {
-        retstr = "object_to_string catched " ;
+       RetStr = "object_to_string catched " ;
       }
       break ;
     }
     default: {
-      retstr = "Unknown CORBA::Any Type" ;
+      RetStr = "Unknown CORBA::Any Type" ;
 //      MESSAGE( retstr );
       break ;
     }
   }
 //  endService( "Value_Impl::ToString" );
-  return CORBA::string_dup( &retstr[ startstr ] ) ;
+  return CORBA::string_dup( RetStr.c_str() ) ;
 }
 
 bool Value_Impl::IsIOR() {