Board index FlightGear Development Nasal

save/resume in Nasal (follow-up)

Nasal is the scripting language of FlightGear.

save/resume in Nasal (follow-up)

Postby Hooray » Sat May 14, 2016 12:21 pm

Referring to: https://sourceforge.net/p/flightgear/ma ... /35087249/
Thorsten wrote:I'd like to share a bit of technology I found extremely helpful in testing
orbital targeting and guidance for the Shuttle which I believe might
potentially be helpful for other aircraft maintainers as well. The problem
is that a complete 2-burn orbital maneuver typically takes from 45-90
minutes, and even with 8 times time compression, flying into the start
state for the test, then doing the test is lengthy.

To help, I've added a save/resume function to the Shuttle code (which
Richard just committed to FGAddon for the Barcelona release) which writes
key parameters (the full motion state, DAP settings, tank loadout, main
system config, thermal state,... ) into a property buffer and restores
them on command.

https://sourceforge.net/p/flightgear/fg ... l/save.nas

Just FYI: That idea/approach isn't entirely new - see mfranz's original ac_state.nas script, he wrote that in fact 10+ years ago, and it's still available: http://members.aon.at/mfranz/flightgear/ac_state.nas

Obviously, it has a different scope - but you may still want to take a look at it, because it itself serializes the properties using the savexml fgcommand - note that there also is a separate io.write_properties() API that can be used for this sort of thing. As can be seen, that can help make the script shorter, while also localizing functionality, i.e. you don't necessarily need to annotate dozens of properties using the userarchive attribute.

But even regardless of that, Melchior used to write/maintain most of the Nasal code we are still using today, so he is/was very familiar with Nasal and its fg specific APIs.
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

Return to Nasal

Who is online

Users browsing this forum: No registered users and 3 guests