19 #include <dynamic-graph/entity.h>
40 void PoolStorage::registerTask(
const std::string &entname,
TaskAbstract *ent) {
41 Tasks::iterator entkey = task.find(entname);
42 if (entkey != task.end())
45 "Another task already defined with the "
47 "Task name is <%s>.", entname.c_str());
49 sotDEBUG(10) <<
"Register task <" << entname <<
"> in the pool."
56 Tasks::iterator entPtr = task.find(
name);
57 if (entPtr == task.end()) {
59 "Unknown task.",
" (while calling <%s>)",
62 return *entPtr->second;
66 void PoolStorage::registerFeature(
const std::string &entname,
68 Features::iterator entkey = feature.find(entname);
69 if (entkey != feature.end())
72 "Another feature already defined with the"
74 "Feature name is <%s>.", entname.c_str());
76 sotDEBUG(10) <<
"Register feature <" << entname <<
"> in the pool."
78 feature[entname] = ent;
83 Features::iterator entPtr = feature.find(
name);
84 if (entPtr == feature.end()) {
86 "Unknown feature.",
" (while calling <%s>)",
89 return *entPtr->second;
93 size_t IdxPointFound = aFileName.rfind(
".");
94 std::string tmp1 = aFileName.substr(0, IdxPointFound);
95 size_t IdxSeparatorFound = aFileName.rfind(
"/");
96 std::string GenericName;
97 if (IdxSeparatorFound != std::string::npos)
98 GenericName = tmp1.substr(IdxSeparatorFound, tmp1.length());
105 struct tm ltimeformatted;
107 localtime_s(<imeformatted, <ime);
109 localtime_r(<ime, <imeformatted);
113 std::ofstream GraphFile;
114 GraphFile.open(aFileName.c_str(), std::ofstream::out);
115 GraphFile <<
"/* This graph has been automatically generated. " << std::endl;
116 GraphFile <<
" " << 1900 + ltimeformatted.tm_year
117 <<
" Month: " << 1 + ltimeformatted.tm_mon
118 <<
" Day: " << ltimeformatted.tm_mday
119 <<
" Time: " << ltimeformatted.tm_hour <<
":"
120 << ltimeformatted.tm_min;
121 GraphFile <<
" */" << std::endl;
122 GraphFile <<
"digraph " << GenericName <<
" { ";
123 GraphFile <<
"\t graph [ label=\"" << GenericName
124 <<
"\" bgcolor = white rankdir=LR ]" << std::endl
125 <<
"\t node [ fontcolor = black, color = black, "
126 "fillcolor = gold1, style=filled, shape=box ] ; "
128 GraphFile <<
"\tsubgraph cluster_Tasks { " << std::endl;
129 GraphFile <<
"\t\t color=blue; label=\"Tasks\";" << std::endl;
131 for (Tasks::iterator iter = task.begin(); iter != task.end(); iter++) {
133 GraphFile <<
"\t\t" << ent->
getName() <<
" [ label = \"" << ent->
getName()
134 <<
"\" ," << std::endl
135 <<
"\t\t fontcolor = black, color = black, "
136 "fillcolor = magenta, style=filled, shape=box ]"
140 GraphFile <<
"}" << std::endl;