1 | /* |
---|
2 | * |
---|
3 | * [desc.] |
---|
4 | */ |
---|
5 | #include "Tools/Viewer/Parser/include/parser.h" |
---|
6 | using namespace morpheo::tools::viewer::bdd; |
---|
7 | namespace morpheo{ |
---|
8 | namespace tools{ |
---|
9 | namespace viewer{ |
---|
10 | namespace parser{ |
---|
11 | |
---|
12 | void Parse::parser_limitparam(QDomNode n){ |
---|
13 | while( !n.isNull() ) |
---|
14 | { |
---|
15 | QDomElement e = n.toElement(); |
---|
16 | if( !e.isNull() ) |
---|
17 | { |
---|
18 | |
---|
19 | if (e.tagName() == "parameter" ) |
---|
20 | { |
---|
21 | #ifdef DBUG_PARSE |
---|
22 | cout << "parameter" <<endl; |
---|
23 | cout << e.attribute("name","").toStdString() <<endl; |
---|
24 | #endif |
---|
25 | limit=new morpheo::tools::viewer::bdd::LimitParam\ |
---|
26 | (e.attribute("name","").toStdString(),\ |
---|
27 | e.attribute("min","").toInt(0,10),\ |
---|
28 | e.attribute("max","").toInt(0,10),\ |
---|
29 | e.attribute("step","").toStdString(),\ |
---|
30 | e.attribute("default","").toInt(0,10),\ |
---|
31 | e.attribute("level","").toInt(0,10)); |
---|
32 | |
---|
33 | //base->addLimitParam(limit); |
---|
34 | parser_limitparam(n.firstChild()); |
---|
35 | if( (n.nextSibling().toElement()).tagName()!= "group"){ |
---|
36 | base->addLimitParam(limit); |
---|
37 | delete limit; |
---|
38 | } |
---|
39 | } |
---|
40 | if (e.tagName() == "group" ) |
---|
41 | { |
---|
42 | |
---|
43 | limit->setGroup(e.attribute("name","").toStdString()); |
---|
44 | base->addLimitParam(limit); |
---|
45 | delete limit; |
---|
46 | |
---|
47 | } |
---|
48 | if (e.tagName() == "link" ) |
---|
49 | { |
---|
50 | |
---|
51 | base->addLinksrc(e.attribute("name","").toStdString(),\ |
---|
52 | e.attribute("src","").toStdString()); |
---|
53 | base->addLinkdest(e.attribute("name","").toStdString(),\ |
---|
54 | e.attribute("dest","").toStdString()); |
---|
55 | } |
---|
56 | |
---|
57 | } |
---|
58 | n = n.nextSibling(); //next channel |
---|
59 | |
---|
60 | } |
---|
61 | |
---|
62 | } |
---|
63 | |
---|
64 | };//end parser |
---|
65 | };//end viewer |
---|
66 | };//end tools |
---|
67 | };//end morpheo |
---|
68 | |
---|