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 12:29 pm

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 10:00 am

Re: modifying xml values using nasal scripts

Postby Johan G » Fri May 03, 2019 2: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)
Some YouTube videos
Johan G
Moderator
 
Posts: 6625
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: modifying xml values using nasal scripts

Postby wlbragg » Fri May 03, 2019 7: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 and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7574
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: modifying xml values using nasal scripts

Postby datu » Sat May 04, 2019 7: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 10:00 am

Re: modifying xml values using nasal scripts

Postby Johan G » Sat May 04, 2019 9: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)
Some YouTube videos
Johan G
Moderator
 
Posts: 6625
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: modifying xml values using nasal scripts

Postby Hooray » Sat May 04, 2019 12:53 pm

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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: modifying xml values using nasal scripts

Postby datu » Sat May 04, 2019 1: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 10:00 am

Re: modifying xml values using nasal scripts

Postby Johan G » Sat May 04, 2019 2: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)
Some YouTube videos
Johan G
Moderator
 
Posts: 6625
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: modifying xml values using nasal scripts

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

datu wrote in Sat May 04, 2019 1: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: modifying xml values using nasal scripts

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

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


Return to Development

Who is online

Users browsing this forum: No registered users and 4 guests