27 #include "SALOME_NamingService.hxx"
28 #include "SALOMEDS.hh"
29 #include "SALOMEDS_Attributes.hh"
76 DEBTRACE(
"+++++++ StudyInNode::execute +++++++++++");
78 CORBA::Object_var obj=NS.Resolve(
"/myStudyManager");
79 if(CORBA::is_nil(obj))
85 SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(obj);
86 if(CORBA::is_nil(aStudyManager))
103 std::string value=p->
getProperty(
"DefaultStudyID");
105 studyid= atoi(value.c_str());
110 SALOMEDS::Study_var myStudy =aStudyManager->GetStudyByID(studyid);
111 if(CORBA::is_nil(myStudy))
113 std::stringstream msg;
114 msg <<
"Execution problem: no study with id " << studyid;
119 std::list<OutputPort *>::const_iterator iter;
133 DEBTRACE(
"+++++++ end StudyInNode::execute +++++++++++" );
138 DEBTRACE(
"StudyInNode::checkBasicConsistency");
141 std::string what =
"StudyNode ";
143 what +=
" only accepts OutputStudyPort, no InputPort";
144 throw Exception(what);
147 std::list<OutputPort *>::const_iterator iter;
153 std::string what(
"Output port: ");
154 what += (*iter)->getName();
155 what +=
" is not an OutputStudyPort. StudyNode ";
157 what +=
" only accepts OutputStudyPorts";
158 throw Exception(what);
161 std::string data = inp->
getData();
165 std::string what(
"OutputStudyPort: ");
166 what += (*iter)->getName();
167 what +=
" is not initialised";
168 throw Exception(what);
244 DEBTRACE(
"+++++++ StudyOutNode::execute +++++++++++");
246 CORBA::Object_var obj=NS.Resolve(
"/myStudyManager");
247 if(CORBA::is_nil(obj))
253 SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(obj);
254 if(CORBA::is_nil(aStudyManager))
271 std::string value=p->
getProperty(
"DefaultStudyID");
273 studyid= atoi(value.c_str());
277 SALOMEDS::Study_var myStudy =aStudyManager->GetStudyByID(studyid);
278 if(CORBA::is_nil(myStudy))
281 std::stringstream msg;
282 msg <<
"Study" << studyid;
283 myStudy=aStudyManager->NewStudy(msg.str().c_str());
284 if(CORBA::is_nil(myStudy))
286 _errorDetails=
"Execution problem: can not create new study " + msg.str();
292 SALOMEDS::StudyBuilder_var aBuilder =myStudy->NewBuilder() ;
293 if(CORBA::is_nil(aBuilder))
295 _errorDetails=
"Execution problem: can not create StudyBuilder";
299 SALOMEDS::GenericAttribute_var aGAttr;
300 SALOMEDS::SObject_var aSO ;
301 SALOMEDS::AttributeName_var anAttr ;
302 SALOMEDS::AttributeIOR_var iorAttr ;
304 std::list<InputPort *>::const_iterator iter;
314 aStudyManager->SaveAs(
_ref.c_str(),myStudy,
false);
316 DEBTRACE(
"+++++++ end StudyOutNode::execute +++++++++++" );
321 DEBTRACE(
"StudyOutNode::checkBasicConsistency");
324 std::string what =
"StudyNode ";
326 what +=
" only accepts InputStudyPort, no OutputPort";
327 throw Exception(what);
330 std::list<InputPort *>::const_iterator iter;
336 std::string what(
"Input port: ");
337 what += (*iter)->getName();
338 what +=
" is not an InputStudyPort. StudyNode ";
340 what +=
" only accepts InputStudyPorts";
341 throw Exception(what);
345 std::string data = inp->
getData();
349 std::string what(
"InputStudyPort: ");
350 what += (*iter)->getName();
351 what +=
" is not initialised";
352 throw Exception(what);