[prev in list] [next in list] [prev in thread] [next in thread] 

List:       flightgear-devel
Subject:    Re: [Flightgear-devel] loading aircraft-data/foo.xml or not...
From:       James Turner <james () flightgear ! org>
Date:       2023-07-07 5:59:24
Message-ID: 1BC2A4AF-FCBA-4001-B75B-0A10F4F7E778 () flightgear ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On 3 Jul 2023, at 05:37, Wayne Bragg <killaccount@cox.net> wrote:
> 
> I think you could still do this without a core change by saving the new version \
> directly with the io.write_properties command to its own file. Then you could \
> always consider the persistent aircraft-version as the old version unless it \
> matches the io.write_properties saved version. All this would get you though is the \
> ability to tell it is the first time the new version was loaded, you still couldn't \
> clear the cache before it loaded which doesn't really help.

The aicraft-properties saving is a rather simple feature, as these problems \
demonstrate. For versioning or conditional loading, the simplest thing is indeed \
going to be some some Nasal based read_properties / write_properties: this would also \
let different instruments or systems have their own saved state if necessary.

However, extending the FGData/Nasal/aircraft.nas ‘data' saving code to handle a \
version tag looks to be pretty simple: just extend the class with some optional \
string or integer to distinguish the file path which is built. Or you could extend it \
further to allow an arbitrary file name suffix, so that an instrument could build up \
an aircraft.data saver that saves to

	$FG_HOME/aircraft-data/myaircraft-version22-g1000-settings.xml

(Right now the code can only save to $FG_HOME/aircraft-data/myaircraft.xml)

Kind regards,
James


[Attachment #5 (unknown)]

<html><head><meta http-equiv="content-type" content="text/html; \
charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: \
space; line-break: after-white-space;"><br><div><br><blockquote type="cite"><div>On 3 \
Jul 2023, at 05:37, Wayne Bragg &lt;killaccount@cox.net&gt; wrote:</div><br \
class="Apple-interchange-newline"><div><meta charset="UTF-8"><span \
style="caret-color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: \
14.666667px; font-style: normal; font-variant-caps: normal; font-weight: 400; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none; float: none; display: inline !important;">I think you could \
still do this without a core change by saving the new version directly with the \
io.write_properties command to its own file. Then you could always consider the \
persistent aircraft-version as the old version unless it matches the \
io.write_properties saved version. All this would get you though is the ability to \
tell it is the first time the new version was loaded, you still couldn't clear the \
cache before it loaded which doesn't really \
help.</span></div></blockquote></div><br><div>The aicraft-properties saving is a \
rather simple feature, as these problems demonstrate. For versioning or conditional \
loading, the simplest thing is indeed going to be some some Nasal based \
read_properties / write_properties: this would also let different instruments or \
systems have their own saved state if necessary.</div><div><br></div><div>However, \
extending the FGData/Nasal/aircraft.nas ‘data' saving code to handle a version tag \
looks to be pretty simple: just extend the class with some optional string or integer \
to distinguish the file path which is built. Or you could extend it further to allow \
an arbitrary file name suffix, so that an instrument could build up an aircraft.data \
saver that saves to</div><div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>$FG_HOME/aircraft-data/myaircraft-version22-g1000-settings.xml</div><div><br></div><div>(Right \
now the code can only save to \
$FG_HOME/aircraft-data/myaircraft.xml)</div><div><br></div><div>Kind \
regards,</div><div>James</div><div><br></div></body></html>





_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic