simplify name/number handling
This commit is contained in:
parent
e63b8b3351
commit
fc98b57b15
2 changed files with 3 additions and 23 deletions
|
@ -36,27 +36,8 @@
|
|||
|
||||
|
||||
GSDI::GSDI(SGPropertyNode *node) :
|
||||
_name("gsdi"),
|
||||
_num(0)
|
||||
{
|
||||
for (int i = 0; i < node->nChildren(); ++i) {
|
||||
SGPropertyNode *child = node->getChild(i);
|
||||
string name = child->getName();
|
||||
|
||||
if (name == "name") {
|
||||
_name = child->getStringValue();
|
||||
} else if (name == "number") {
|
||||
_num = child->getIntValue();
|
||||
} else {
|
||||
SG_LOG(SG_INSTR, SG_WARN, "Error in gsdi config logic");
|
||||
if (_name.length())
|
||||
SG_LOG(SG_INSTR, SG_WARN, "Section = " << _name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GSDI::GSDI()
|
||||
_name(node->getStringValue("name", "gsdi")),
|
||||
_num(node->getIntValue("number", 0))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ class GSDI : public SGSubsystem
|
|||
{
|
||||
public:
|
||||
GSDI(SGPropertyNode *node);
|
||||
GSDI();
|
||||
virtual ~GSDI();
|
||||
|
||||
virtual void init();
|
||||
|
@ -53,7 +52,7 @@ public:
|
|||
|
||||
private:
|
||||
string _name;
|
||||
int _num;
|
||||
unsigned int _num;
|
||||
|
||||
SGPropertyNode_ptr _serviceableN;
|
||||
SGPropertyNode_ptr _headingN;
|
||||
|
|
Loading…
Add table
Reference in a new issue