void Fidelity::Engine::SimulationXmlReader::readFSX()
{
	while(!atEnd()) {
		readNext();

		if(isEndElement()) {
			break;
		}

		// Evaluate child tags
		if(isStartElement()) {
			// We expect these children for the root tag
			if (name() == "description") {
				readDescription();
			}
			else if (name() == "globals") {
				readGlobals();
			}
			else if (name() == "engine") {
				readEngine();
			}
			else if (name() == "plugins") {
				readPlugins();
			}
			else if (name() == "setup") {
				readSetup();
			}
			else {
				unknownElement();
			}
		}
	}
}
Beispiel #2
0
void readSoftwareRadio(Element &headElem, RadioRepresentation& theRadio)
{
    //Check for illegal nodes here
    Iterator< Node > c;
    for ( c = c.begin(&headElem); c != c.end(); c++ )
    {
        if(c->Type() == TiXmlNode::ELEMENT)
        {
            string s = c->Value();
            if(s != "controller" && s != "engine" && s!= "link")
            {
                LOG(LFATAL) << "Illegal element in xml file: " << s;
                throw XmlParsingException("Illegal element in xml file: " + s);
            }
        }
    }

    //Parse all the controllers
    Iterator< Element > child("controller");
    for ( child = child.begin(&headElem); child != child.end(); child++ )
    {
        ControllerDescription con = readController(*child);
        theRadio.addControllerDescription(con);
    }

    //Parse all the engines
    Iterator< Element > child1("engine");
    for ( child1 = child1.begin(&headElem); child1 != child1.end(); child1++ )
    {
        EngineDescription eng = readEngine(*child1);
        theRadio.addEngineDescription(eng);
    }

    //Parse all the links
    Iterator< Element > child2("link");
    for ( child2 = child2.begin(&headElem); child2 != child2.end(); child2++ )
    {
        LinkDescription link = readLink(*child2);
        theRadio.addLinkDescription(link);
    }
}