Re: [Flightgear-devel] Loading an XML file using EasyXML

2004-08-20 Thread Jon S Berndt
On Fri, 20 Aug 2004 22:01:43 +0200
 "Frederic Bouvier" <[EMAIL PROTECTED]> wrote:
I think Jon wants to preserve the current JSBsim syntax and not use
the property syntax.
-Fred
Well, perhaps. The thing is, certain items that would be parsed from 
the configuration file, such as landing gear, aero coefficients, 
engines, and flight control components, are _instantiated_ when they 
are read from the config file. The parsing process does not simply 
read property values and assign them. The configuration of the 
specific simulation is formed. Also, the interest is in allowing each 
class to extract its own values from the config file. That makes it a 
little trickier.

Jon
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Loading an XML file using EasyXML

2004-08-20 Thread Frederic Bouvier
Erik Hofman wrote:

> Jon S Berndt wrote:
>
> > So, my question is: What is the philosophy behind loading various
> > classes with their own data from the config file using EasyXML
callbacks?
>
> You could store the data into a property tree and let every subsystem
> scan it's own directory. This tree could be detached from the main tree
> and could be removed safely after initialization is done.

I think Jon wants to preserve the current JSBsim syntax and not use
the property syntax.
However Jon, you can have a look at the readProperties functions here
http://www.simgear.org/doxygen/props__io_8hxx.html that will show you
a non trivial use of readXML to retrieve the property tree.

-Fred



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Loading an XML file using EasyXML

2004-08-20 Thread Jon S Berndt
On Fri, 20 Aug 2004 21:40:28 +0200
 Mathias Fröhlich <[EMAIL PROTECTED]> wrote:
On Freitag, 20. August 2004 21:10, Jon S Berndt wrote:

But also an aircraft is built like such a tree. The top node is the 
Some aircraft are even built OUT OF trees. ;-)
aircraft itself. This one has a flightcontrolsystem, some object 
containing the aerodynamic properties of the aircraft, a list of engines,
a list of undercarriage elements and so on.
Erik's approach might work. I will have to "play" with the parsing to 
see different approaches, and how they might work.

Thanks,
Jon
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Loading an XML file using EasyXML

2004-08-20 Thread Mathias Fröhlich
On Freitag, 20. August 2004 21:10, Jon S Berndt wrote:
> So, my question is: What is the philosophy behind loading various
> classes with their own data from the config file using EasyXML
> callbacks?

This kind of xml parsers is designed to build a 'tree' of objects representing 
the data stored in the 'tree' of the xml file.

Thus this kind of parsers fit very well for the property /tree/ example Erik 
mentioned.

But also an aircraft is built like such a tree. The top node is the aircraft 
itself. This one has a flightcontrolsystem, some object containing the 
aerodynamic properties of the aircraft, a list of engines, a list of 
undercarriage elements and so on.

   Greetings

   Mathias

-- 
Mathias Fröhlich, email: [EMAIL PROTECTED]

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Loading an XML file using EasyXML

2004-08-20 Thread Erik Hofman
Jon S Berndt wrote:
So, my question is: What is the philosophy behind loading various 
classes with their own data from the config file using EasyXML callbacks?
You could store the data into a property tree and let every subsystem 
scan it's own directory. This tree could be detached from the main tree 
and could be removed safely after initialization is done.

Erik
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Loading an XML file using EasyXML

2004-08-20 Thread Jon S Berndt
On Fri, 20 Aug 2004 20:55:18 +0200
 Mathias Fröhlich <[EMAIL PROTECTED]> wrote:
On Freitag, 20. August 2004 18:48, Jon S Berndt wrote:
Can someone tell me what the process is once a file has been opened
and is being parsed by EasyXML? What do the callbacks do ... what is
the standard procedure for reading in the attibutes and elements and
data?
See:
http://www.simgear.org/doxygen/easyxml_8hxx.html
It is a quite neat implementation.
And I think that using integrating this provides is a good chance to 
seperate configuration data from state data.
Yes, I've seen that page. I've written (now) two applications that use 
the EasyXML class, and it is a very nice (and Easy) class to use. With 
the plotting application, it was not too difficult to use it (even if 
I did so incorrectly). There was one class that was subclassed from 
XMLVisitor, and it included all the plotting parameters I needed.

However, in the case of JSBSim, there are now several classes that 
read in data from the configuration file (FGFDMExec does the initial 
read, and hands off the config file handle to other classes to let 
them read in their own data). The Aerodynamics, MassBalance, Aircraft, 
Output, etc. classes currently all read in their own data from the 
configuration file.

Today, I have written a class that parses JSBSim format config files. 
Within the callbacks I simply echo the information read from the 
files. Currently, FGXMLParser (the name of the potential new class to 
replace FGConfigFile) can parse the config file, but then the question 
is: what do I do, now. Remember, currently in JSBSim each file reads 
in its own data as the config file class encounters the relevant 
sections in the config file. With FGXMLParser we have callbacks - this 
is philosophically different from FGConfig File.

So, my question is: What is the philosophy behind loading various 
classes with their own data from the config file using EasyXML 
callbacks?

Jon
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Loading an XML file using EasyXML

2004-08-20 Thread Mathias Fröhlich
On Freitag, 20. August 2004 18:48, Jon S Berndt wrote:
> Can someone tell me what the process is once a file has been opened
> and is being parsed by EasyXML? What do the callbacks do ... what is
> the standard procedure for reading in the attibutes and elements and
> data?
See:

http://www.simgear.org/doxygen/easyxml_8hxx.html

It is a quite neat implementation.

And I think that using integrating this provides is a good chance to seperate 
configuration data from state data.

   Greetings

   Mathias

-- 
Mathias Fröhlich, email: [EMAIL PROTECTED]

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d