Board index FlightGear Development

modifying xml values using nasal scripts

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

modifying xml values using nasal scripts

Postby datu » Fri May 03, 2019 11:29 am

HI, everyone, can anyone tell me whether I could modify XML values using nasal script continuously i,e(ever 10ms)
thankyou
datu
 
Posts: 14
Joined: Mon Apr 15, 2019 9:00 am

Re: modifying xml values using nasal scripts

Postby Johan G » Fri May 03, 2019 1:31 pm

Not sure if this is a meaningful answer, but if the XML defines values of properties in the property tree, then yes, the values of the properties can most likely be changed. However, Nasal can most likely not change the values shown in the XML files.

If the values are properties and if you want them updated continuously, you could also consider using property rules.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5448
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: modifying xml values using nasal scripts

Postby wlbragg » Fri May 03, 2019 6:54 pm

As Johan pointed out "modify XML values" is not really the correct terminology here, unless you actually trying to change XML tag pairs, which I doubt.
It sounds like your wondering if you can constantly change a property as the simulator is running using nasal. The answer is yes, that is how much of the systems in the aircraft and general simulation control is achieved. There are also, as Johan stated, a few other ways to do this that might be better suited to your needs. Can you be a little more specific as to what your wanting to do?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4754
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: modifying xml values using nasal scripts

Postby datu » Sat May 04, 2019 6:37 am

I want to modify position values and orientation values, and as mentioned above what are the other methods through which I can change the values of above-mentioned properties
thanks for your support could you please help me to go further in this process
datu
 
Posts: 14
Joined: Mon Apr 15, 2019 9:00 am

Re: modifying xml values using nasal scripts

Postby Johan G » Sat May 04, 2019 8:28 am

Do you want to read in position and orientation values from a file for visualization purposes (for example for reviewing data) or move around a model of an aircraft/ship/car etc. along a preplanned route? Or perhaps something else? This can all be done, but uses very different approaches.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5448
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: modifying xml values using nasal scripts

Postby Hooray » Sat May 04, 2019 11:53 am

it's certainly possible to modify an XML file, but it's definitely not what you want to be doing at 100 hz - thus, it really is a good idea to tell us about your concrete use-case/goals.

And that would be the case even outside FlightGear, but especially in the context of FlightGear and its main loop architecture.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: modifying xml values using nasal scripts

Postby datu » Sat May 04, 2019 12:38 pm

what i wanted to do is take input values like positional values and orientation values and represent them in visuals and if possible save them into a file like csv /dat files
datu
 
Posts: 14
Joined: Mon Apr 15, 2019 9:00 am

Re: modifying xml values using nasal scripts

Postby Johan G » Sat May 04, 2019 1:16 pm

Ah, is this related to you other topic, how to read data from afile in nasal scripting language?
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5448
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: modifying xml values using nasal scripts

Postby Hooray » Sat May 04, 2019 3:50 pm

datu wrote in Sat May 04, 2019 12:38 pm:what i wanted to do is take input values like positional values and orientation values and represent them in visuals and if possible save them into a file like csv /dat files


see rleibner's plotting addon, which is designed to help with that, and which could be easily extended to add missing bits like CSV support.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11317
Joined: Tue Mar 25, 2008 8:40 am

Re: modifying xml values using nasal scripts

Postby Alant » Sat May 04, 2019 7:42 pm

If you Google Flightgear visualiser you will find several examples of Flightgear doing this.
Alant
 
Posts: 875
Joined: Wed Jun 23, 2010 5:58 am
Location: Portugal
Callsign: Tarnish99
Version: from Git
OS: Windows 10


Return to Development

Who is online

Users browsing this forum: No registered users and 2 guests