1 // SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : FNode_Impl.cxx
23 // Author : Jean Rahuel
32 //#include "utilities.h"
34 #include "FNode_Impl.hxx"
36 FNode_Impl::FNode_Impl() {
39 FNode_Impl::FNode_Impl( CORBA::ORB_ptr orb ,
40 PortableServer::POA_ptr poa ,
41 PortableServer::ObjectId * contId ,
42 const char * instanceName ,
43 const char * interfaceName ,
44 GraphEditor::DataFlow * aDataFlowEditor ,
45 const SALOME_ModuleCatalog::Service &NodeService ,
46 const char * NodeComponentName ,
47 const char * NodeInterfaceName ,
48 const char * NodeName ,
49 const SUPERV::KindOfNode NodeKindOfNode ,
51 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
52 CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , NodeService , NodeName , NodeKindOfNode , NULLSTRING , SUPERV::ListOfStrings() , isCimpl ) {
53 // MESSAGE( NodeName << " " );
54 beginService( "FNode_Impl::FNode_Impl" );
55 // cout << "FNode_Impl::FNode_Impl -->" << endl ;
57 _id = _poa->activate_object(_thisObj);
58 _Orb = CORBA::ORB::_duplicate(orb);
62 // DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
63 // NodeInterfaceName , NodeName ,
64 // NodeKindOfNode ) ) ;
65 DataFlowNode()->ComponentName( NodeComponentName ) ;
66 DataFlowNode()->InterfaceName( NodeInterfaceName ) ;
69 const char * aContainer = DataFlowEditor()->Graph()->RetrieveFromMapOfComponentNameContainer(NodeComponentName);
70 if ( aContainer ) // container for NodeComponentName component was found in the map
71 SetContainer( aContainer );
74 endService( "FNode_Impl::FNode_Impl" );
75 // cout << "<-- FNode_Impl::FNode_Impl" << endl ;
78 FNode_Impl::FNode_Impl( CORBA::ORB_ptr orb ,
79 PortableServer::POA_ptr poa ,
80 PortableServer::ObjectId * contId ,
81 const char * instanceName ,
82 const char * interfaceName ,
83 GraphEditor::DataFlow * aDataFlowEditor ,
84 GraphEditor::InNode * aDataFlowNode ) :
85 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
86 CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
87 MESSAGE( DataFlowNode()->Name() << " " );
88 beginService( "FNode_Impl::FNode_Impl" );
90 _id = _poa->activate_object(_thisObj);
91 _Orb = CORBA::ORB::_duplicate(orb);
95 endService( "FNode_Impl::FNode_Impl" );
98 FNode_Impl::~FNode_Impl() {
99 beginService( "FNode_Impl::~Node_Impl" );
100 endService( "FNode_Impl::~Node_Impl" );
103 void FNode_Impl::destroy() {
104 beginService( "FNode_Impl::Destroy" );
105 if ( DataFlowEditor()->IsEditing() ) {
107 _poa->deactivate_object(*_id) ;
108 // CORBA::release(_poa) ;
110 // _thisObj->_remove_ref();
113 MESSAGE("FNode_Impl::destroy ERROR ") ;
116 // endService( "FNode_Impl::Destroy" );
119 bool FNode_Impl::Delete() {
120 // beginService( "FNode_Impl::Delete" );
121 bool RetVal = false ;
122 if ( DataFlowEditor()->IsEditing() ) {
124 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
126 DataFlowEditor()->UnValid() ;
129 // endService( "FNode_Impl::Delete" );
133 char * FNode_Impl::GetComponentName() {
134 // beginService( "FNode_Impl::GetComponentName" );
135 char * RetVal = DataFlowNode()->ComponentName() ;
136 // endService( "FNode_Impl::GetComponentName" );
137 return CORBA::string_dup( RetVal );
139 bool FNode_Impl::SetComponentName( const char * aComponentName ) {
140 // beginService( "FNode_Impl::SetComponentName" );
141 bool RetVal = false ;
142 RetVal = DataFlowNode()->ComponentName( aComponentName ) ;
143 // endService( "FNode_Impl::SetComponentName" );
146 char * FNode_Impl::GetInterfaceName() {
147 // beginService( "FNode_Impl::GetInterfaceName" );
148 char * RetVal = DataFlowNode()->InterfaceName() ;
149 // endService( "FNode_Impl::GetInterfaceName" );
150 return CORBA::string_dup( RetVal );
152 bool FNode_Impl::SetInterfaceName( const char * anInterfaceName ) {
153 // beginService( "FNode_Impl::SetInterfaceName" );
154 bool RetVal = false ;
155 RetVal = DataFlowNode()->InterfaceName( anInterfaceName ) ;
156 // endService( "FNode_Impl::SetInterfaceName" );
159 char * FNode_Impl::GetContainer() {
160 // beginService( "FNode_Impl::GetContainer" );
161 char * RetVal = DataFlowNode()->Computer() ;
162 // endService( "FNode_Impl::GetContainer" );
163 return CORBA::string_dup( RetVal ) ;
165 bool FNode_Impl::SetContainer( const char * aDataFlowContainer ) {
166 // beginService( "FNode_Impl::SetContainer" );
167 bool RetVal = false ;
168 // GraphExecutor::DataFlow * _DataFlowExecutor = DataFlowEditor()->Executor() ;
169 // if ( DataFlowEditor()->IsEditing() ) {
170 RetVal = DataFlowNode()->Computer( aDataFlowContainer ) ;
172 // insert modified container into < ComponentName, Container > map
173 DataFlowEditor()->Graph()->InsertToMapOfComponentNameContainer( GetComponentName(), aDataFlowContainer ) ; // mkr : PAL13947
176 // else if ( _DataFlowExecutor && ( _DataFlowExecutor->IsSuspended() ||
177 // _DataFlowExecutor->IsSuspended( DataFlowNode()->Name() ) ) ) {
178 // if ( _DataFlowExecutor->Graph()->GetChangeGraphNode( DataFlowNode()->Name() ) ) {
179 // RetVal = ((GraphEditor::InNode * ) _DataFlowExecutor->Graph()->GetChangeGraphNode( DataFlowNode()->Name() )->GetInNode())->Computer( aDataFlowContainer ) ;
180 DataFlowEditor()->UnValid() ;
183 // endService( "FNode_Impl::SetContainer" );