34 dummyStr += oss.
str();
45 sprintf(buff,
"%d", n);
46 dummyStr += std::string(buff);
52 sprintf(buff,
"%.2f", n);
53 dummyStr += std::string(buff);
59 dummyStr = std::string(sz);
64 dummyStr = std::string(sz);
80 sprintf(buff,
"%d", n);
81 dummyStr = std::string(buff);
87 std::cout<<sstr.
str();
106 warnings.emplace_back(szWarning);
111 warnings.push_back(str);
120 errors.emplace_back(szError);
125 errors.push_back(str);
133 if (errors.empty()) {
136 static std::string msg;
143 static std::string msgs;
146 msgs += std::string(err) +
" ";
152 if (warnings.empty()) {
155 static std::string msg;
156 msg = warnings.back();
162 static std::string msgs;
165 msgs += std::string(err) +
" ";
172 errors.clear(); warnings.clear();
176 return errors.size();
181 return warnings.size();
190" Legend [shape=none, margin=0, label=<"
191" <TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"4\" bgcolor=\"white\">"
193" <TD COLSPAN=\"2\"><B>Legend</B></TD>"
196" <TD align=\"left\">Application</TD>"
197" <TD CELLPADDING=\"4\">"
198" <TABLE BORDER=\"1\" CELLBORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">"
200" <TD BGCOLOR=\"darkseagreen\"> </TD>"
206" <TD align=\"left\">Module</TD>"
207" <TD CELLPADDING=\"4\">"
208" <TABLE BORDER=\"1\" CELLBORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">"
210" <TD BGCOLOR=\"lightslategrey\"> </TD>"
216" <TD align=\"left\">Res. Dependency</TD>"
217" <TD CELLPADDING=\"4\">"
218" <TABLE BORDER=\"1\" CELLBORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">"
220" <TD BGCOLOR=\"salmon\"> </TD>"
226" <TD align=\"left\">Res. Provider</TD>"
227" <TD CELLPADDING=\"4\">"
228" <TABLE BORDER=\"1\" CELLBORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">"
230" <TD BGCOLOR=\"indianred\"> </TD>"
236" <TD align=\"left\">Input data</TD>"
237" <TD CELLPADDING=\"4\">"
238" <TABLE BORDER=\"1\" CELLBORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">"
240" <TD BGCOLOR=\"lightgrey\"> </TD>"
246" <TD align=\"left\">Output data</TD>"
247" <TD CELLPADDING=\"4\">"
248" <TABLE BORDER=\"1\" CELLBORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">"
250" <TD BGCOLOR=\"wheat\"> </TD>"
312 if (!szFirst && !szSecond) {
315 if (!szFirst || !szSecond) {
319 std::string strFirst(szFirst);
320 std::string strSecond(szSecond);
321 transform(strFirst.begin(), strFirst.end(), strFirst.begin(),
322 (
int(*)(
int))toupper);
323 transform(strSecond.begin(), strSecond.end(), strSecond.begin(),
324 (
int(*)(
int))toupper);
325 if (strFirst == strSecond) {
333 std::string::size_type pos = str.find_last_not_of(
' ');
334 if(pos != std::string::npos)
337 pos = str.find_first_not_of(
' ');
338 if (pos != std::string::npos) {
342 str.erase(str.begin(), str.end());
350 dot.open(szFileName);
351 if (!dot.is_open()) {
355 dot<<
"digraph G {\n";
356 dot<<
"rankdir=LR\n;";
357 dot<<
"ranksep=0.0\n;";
358 dot<<
"nodesep=0.2\n;";
362 switch((*itr)->getType()) {
364 auto* mod = (
Module*)(*itr);
365 dot<<
"\""<<mod->getLabel()<<
"\"";
366 dot<<
" [label=\""<< mod->getName()<<
"\"";
367 dot<<
" shape=component, color=midnightblue, fillcolor=lightslategrey, peripheries=1, style=filled, penwidth=2];\n";
368 for(
int i=0; i<mod->sucCount(); i++)
370 Link l = mod->getLinkAt(i);
372 dot<<
"\""<<mod->getLabel()<<
"\" -> ";
373 dot<<
"\""<<in->getLabel()<<
"\"";
375 dot<<
" [label=\"\"];\n";
377 dot <<
" [label=\"\" style=dashed];\n";
385 dot<<
"\""<<in->getLabel()<<
"\"";
386 if(in->withPriority())
388 dot<<
" [color=red, fillcolor=lightgrey, peripheries=1, style=filled";
389 dot<<
" label=\""<< in->getName()<<
"\\n"<<in->getPort()<<
"\"];\n";
393 dot<<
" [color=black, fillcolor=lightgrey, peripheries=1, style=filled";
394 dot<<
" label=\""<< in->getName()<<
"\\n"<<in->getPort()<<
"\"];\n";
396 for(
int i=0; i<in->sucCount(); i++)
398 Link l = in->getLinkAt(i);
400 dot<<
"\""<<in->getLabel()<<
"\" -> ";
401 dot<<
"\""<<out->getLabel()<<
"\"";
403 dot<<
" [label=\""<<l.
weight()<<
"\"];\n";
405 dot <<
" [label=\"" << l.
weight() <<
"\" style=dashed];\n";
413 dot<<
"\""<<out->getLabel()<<
"\"";
414 dot<<
" [color=black, fillcolor=wheat, peripheries=1, style=filled";
415 dot<<
" label=\""<< out->getName()<<
"\\n"<<out->getPort()<<
"\"];\n";
416 for(
int i=0; i<out->sucCount(); i++)
418 Link l = out->getLinkAt(i);
420 dot<<
"\""<<out->getLabel()<<
"\" -> ";
421 dot<<
"\""<<mod->getLabel()<<
"\"";
422 dot<<
" [label=\"\" arrowhead=none];\n";
430 dot<<
"\""<<app->getLabel()<<
"\"";
431 dot<<
" [shape=folder, color=darkgreen, fillcolor=darkseagreen, peripheries=1, style=filled, penwidth=2";
432 dot<<
" label=\""<<app->getLabel()<<
"\""<<
"];\n";
433 for(
int i=0; i<app->sucCount(); i++)
435 Link l = app->getLinkAt(i);
437 dot<<
"\""<<app->getLabel()<<
"\" -> ";
438 dot<<
"\""<<mod->getLabel()<<
"\"";
440 dot<<
" [label=\"\"];\n";
442 dot <<
" [label=\"\" style=dashed];\n";
450 dot<<
"\""<<res->getLabel()<<
"\"";
452 dot<<
" [shape=rect, color=black, fillcolor=salmon, peripheries=1, style=filled ";
454 dot <<
" [shape=house, color=maroon, fillcolor=indianred, peripheries=1, style=filled, penwidth=2";
456 dot<<
" label=\""<<res->getName()<<
"\""<<
"];\n";
457 for(
int i=0; i<res->sucCount(); i++)
459 Link l = res->getLinkAt(i);
461 dot<<
"\""<<res->getLabel()<<
"\" -> ";
463 dot<<
" [label=\""<<l.
weight()<<
"\"];\n";
Singleton class ErrorLogger.
const char * getLastError()
const char * getFormatedErrorString()
void addError(const char *szError)
void addWarning(const char *szWarning)
static ErrorLogger * Instance()
Singleton class ErrorLogger.
const char * getLastWarning()
const char * getFormatedWarningString()
Link holding all the links of a node.
StrStream & operator=(const char *sz)
friend std::ostream & operator<<(std::ostream &os, StrStream &sstr)
bool compareString(const char *szFirst, const char *szSecond)
void trimString(std::string &str)
std::stringstream OSTRINGSTREAM
OS strToOS(const char *szOS)
bool exportDotGraph(Graph &graph, const char *szFileName)
enum yarp::manager::__OS OS
const std::string GRAPH_LEGEND
std::ostream & operator<<(std::ostream &os, StrStream &sstr)