39 using namespace YACS::ENGINE;
48 Proc::Proc(
const std::string& name):
Bloc(name),_edition(false),_compoinstctr(0)
74 std::map<std::string, TypeCode *>::iterator pt;
76 ((*pt).second)->decrRef();
81 std::map<std::string, Logger*>::const_iterator lt;
89 os <<
"node [ style=\"filled\" ];\n" ;
90 os <<
"compound=true;";
91 os <<
"states [label=< <TABLE> <TR> <TD BGCOLOR=\"pink\" > Ready</TD> <TD BGCOLOR=\"magenta\" > Toload</TD> </TR> <TR> <TD BGCOLOR=\"magenta\" > Loaded</TD> <TD BGCOLOR=\"purple\" > Toactivate</TD> </TR> <TR> <TD BGCOLOR=\"blue\" > Activated</TD> <TD BGCOLOR=\"green\" > Done</TD> </TR> <TR> <TD BGCOLOR=\"red\" > Error</TD> <TD BGCOLOR=\"orange\" > Failed</TD> </TR> <TR> <TD BGCOLOR=\"grey\" > Disabled</TD> <TD BGCOLOR=\"white\" > Pause</TD> </TR> </TABLE>> \n shape = plaintext \n style = invis \n ];\n";
108 else if(kind==
"string")
112 else if(kind==
"bool")
133 std::list<TypeCodeObjref *> ltc)
181 std::stringstream msg;
182 msg <<
"Type " << name <<
" does not exist" ;
183 msg <<
" (" <<__FILE__ <<
":" << __LINE__ <<
")";
213 cerr <<
"Unknown node id " << numId << endl;
223 std::string progress =
"0";
226 cerr <<
"Unknown node id " << numId << endl;
229 progress = node->getProgress();
238 int progressPercent = 0;
239 for(list<ProgressWeight>::const_iterator iter=weightList.begin();iter!=weightList.end();iter++)
241 weightDone += (*iter).weightDone;
242 weightTotal += (*iter).weightTotal;
245 progressPercent = int(
float(weightDone) /
float(weightTotal) * 100);
246 return progressPercent;
253 cerr <<
"Unknown node id " << numId << endl;
254 return "<state>unknown</state>";
260 msg <<
"<id>" << numId <<
"</id>";
266 DEBTRACE(
"Proc::getInPortValue " << nodeNumId <<
" " << portName);
270 msg <<
"<value><error>unknown node id: " << nodeNumId <<
"</error></value>";
282 msg <<
"<value><error>" << ex.
what() <<
"</error></value>";
289 DEBTRACE(
"Proc::setInPortValue " << nodeName <<
" " << portName <<
" " << value);
300 double val = atof(value.c_str());
306 int val = atoi(value.c_str());
311 inputPort->
edInit(value.c_str());
315 if((!value.compare(
"False")) || (!value.compare(
"false")))
317 else if ((!value.compare(
"True")) || (!value.compare(
"true")))
321 int val = atoi(value.c_str());
335 msg <<
"<value><error>" << ex.
what() <<
"</error></value>";
342 DEBTRACE(
"Proc::getOutPortValue " << nodeNumId <<
" " << portName);
346 msg <<
"<value><error>unknown node id: " << nodeNumId <<
"</error></value>";
358 msg <<
"<value><error>" << ex.
what() <<
"</error></value>";
365 DEBTRACE(
"Proc::getNodeErrorDetails " << nodeNumId);
369 msg <<
"Unknown node id " << nodeNumId;
378 DEBTRACE(
"Proc::getNodeErrorReport " << nodeNumId);
382 msg <<
"Unknown node id " << nodeNumId;
391 DEBTRACE(
"Proc::getNodeContainerLog " << nodeNumId);
395 msg <<
"Unknown node id " << nodeNumId;
405 int len = nodes.size();
407 for( list<YACS::ENGINE::Node *>::const_iterator iter = nodes.begin();
408 iter != nodes.end(); iter++)
410 numids.push_back((*iter)->getNumId());
419 int len = nodes.size();
421 for( list<YACS::ENGINE::Node *>::const_iterator iter = nodes.begin();
422 iter != nodes.end(); iter++)
426 ids.push_back(
"_root_");
433 LoggerMap::const_iterator it =
_loggers.find(name);
441 logger =
new Logger(name);
449 DEBTRACE(
"Proc::setEdition: " << edition);
493 std::map<std::string, Container*>::const_iterator it;
495 ((*it).second)->decrRef();
539 std::string instname;
545 std::ostringstream buffer;
547 instname=componame+
"_"+buffer.str();
623 std::map<std::string, Container*> myContainerMap;
624 std::map<std::string, ComponentInstance*> myComponentInstanceMap;
627 for(vector<Container *>::const_iterator iterCt=conts.begin();iterCt!=conts.end();iterCt++)
632 if(myContainerMap.find(tmp->
getName())!=myContainerMap.end())
634 std::ostringstream oss; oss <<
"Proc::updateContainersAndComponents : more than one container instance with name \"" << tmp->
getName() <<
"\" !";
637 myContainerMap[tmp->
getName()]=tmp;
641 for(vector<ComponentInstance *>::iterator iterCp=comps.begin();iterCp!=comps.end();iterCp++)
646 if(myComponentInstanceMap.find(tmp2->
getCompoName())!=myComponentInstanceMap.end())
648 std::ostringstream oss; oss <<
"Proc::updateContainersAndComponents : more than one component instance with name \"" << tmp2->
getCompoName() <<
"\" !";