Board index FlightGear Support Installation Mac

Command line arguments with 3.4 launcher?

Installing FlightGear, scenery, aircraft etc. on Mac.

Command line arguments with 3.4 launcher?

Postby someguy » Fri Mar 06, 2015 10:55 pm

I'm coming back to FG after a hiatus...my new 27" iMac with NVIDIA GeForce GTX 775M 2048 MB graphics yields good frame rates under virtually all situations, and flying is fun again. Thorsten, your ALS shaders rock! However, while the new Mac launcher does it given jobs well, it offers no access to command line arguments.

Is it possible to write --prop statements, etc., to preferences.xml? I tried searching the wiki, but failed to find what I need. Anti-aliasing and fuel-freeze would be good to start with.
User avatar
someguy
 
Posts: 1653
Joined: Tue Nov 25, 2008 5:54 am
Location: USA
Version: 2016.2.1
OS: Mac OS X 10.11

Re: Command line arguments with 3.4 launcher?

Postby Hooray » Sat Mar 07, 2015 2:43 am

I cannot say anything about the new Mac/Qt launcher.
However, regarding your other option: yes, of course, any --prop: argument can be just as well added to preferences.xml
For that, you only need to understand how properties are mapped to XML space and vice versa:
Code: Select all
<sim>
 <foo n="0">teddy</foo>
 <foo n=1">tiger</foo>
</sim>


these can be expressed using --prop:/sim/foo[0]=teddy and --prop:/sim/foo[1]=tiger

for additional details, please check the property tree/XML docs for details (e.g. see the wiki)

Feel free to copy my posting to the wiki if you need think the docs are insufficient currently.

PS: You should however not edit $FG_ROOT/preferences.xml - which should be considered readonly, instead, use $FG_HOME, which will be treated as an overlay (on top of $FG_ROOT/preferences.xml).

The latter is going to be increasingly important with future releases, because fgdata and fg as a whole are becoming more modular, and data dependencies are going to be increasingly formalized accordingly
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Command line arguments with 3.4 launcher?

Postby someguy » Sat Mar 07, 2015 5:09 am

Thanks. Unfortunately, I still don't understand how to translate "--enable-fuel-freeze" or "--prop:sim/freeze/fuel" into xml, and I have no idea where to find $FG_HOME/preferences.xml.
User avatar
someguy
 
Posts: 1653
Joined: Tue Nov 25, 2008 5:54 am
Location: USA
Version: 2016.2.1
OS: Mac OS X 10.11

Re: Command line arguments with 3.4 launcher?

Postby Hooray » Sat Mar 07, 2015 5:30 am

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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Command line arguments with 3.4 launcher?

Postby VicMar » Sat Mar 07, 2015 9:02 am

Hi Someguy,

I've already informed via the dev list about the need to have access to input command line statements. I hope it will be included shortly.

Vic
Time flies like an arrow
Fruit flies like a banana
User avatar
VicMar
 
Posts: 2058
Joined: Sun Apr 06, 2008 5:53 pm
Location: Lancing. UK (EGKA)
Callsign: VicMar
Version: 2018.3.1
OS: OS X 10.12.6

Re: Command line arguments with 3.4 launcher?

Postby F-JJTH » Sat Mar 07, 2015 9:14 am

This feature has been implemented 12 days ago: https://gitorious.org/fg/flightgear/com ... 0845cfc2db

You just need to wait for FG 3.6 release to get this feature.

Regards,
Clément
User avatar
F-JJTH
 
Posts: 697
Joined: Fri Sep 09, 2011 11:02 am

Re: Command line arguments with 3.4 launcher?

Postby someguy » Sat Mar 07, 2015 1:55 pm

Meanwhile, perhaps someone else can tell me explicitly how to do it, or point me toward a wiki page that is actually helpful. The pages listed above don't seem to cover my example. I did learn what $FG_HOME is, though one of those pages has an obsolete reference to ~/.fgfs.

Hooray, I appreciate that you're trying to help, but the chasm between your level of knowledge and mine is apparently unbridgeable. That pretty much describes the wiki in general--it is undoubtedly a good reference for programmers who already know the lingo, but there's no obvious starting point for the rest of us, and the search feature is hopeless.
User avatar
someguy
 
Posts: 1653
Joined: Tue Nov 25, 2008 5:54 am
Location: USA
Version: 2016.2.1
OS: Mac OS X 10.11

Re: Command line arguments with 3.4 launcher?

Postby Hooray » Sat Mar 07, 2015 5:21 pm

tell us exactly what you are missing/don't understand so that we can provide the missing info and hopefully update the wiki docs accordingly.
I don't disagree that FG involves quite a steep learning curve, and many of us have been involved in FG matters for years - which is probably why some things may appear more obvious to us than they really are - but rather than doing 1:1 Q&A on the forum, I'd prefer to get specific feedback and then update the wiki accordingly.
I think I've been involved in creating/maintaining all 3 wiki articles, which is why I am really interested in learning about any deficiencies - especially coming from fellow contributors who've been around for over half a decade meanwhile ...

Regarding your example, I did try to explain to you how XML nodes are mapped to --prop: arguments and vice versa.
And I do think that the wiki docs are pretty comprehensive - even though it may admittedly be difficult to spot the relevant stuff for your particular use-case.
But that is why I provided a concrete example, and even added it to the wiki.

Like I said, I am quite willing to help with improving our docs - but I would expect most people to understand how PropertyList-XML files work and how the mapping between XML and property tree space works in terms of turning an XML tree into a property tree and vice versa - and that has nothing to do with coding/programming.



PS: AFAIU, ~/.fgfs should not be obsolete at all, or what are you referring to ?
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Command line arguments with 3.4 launcher?

Postby someguy » Sat Mar 07, 2015 7:03 pm

Hooray wrote in Sat Mar 07, 2015 5:21 pm:tell us exactly what you are missing/don't understand so that we can provide the missing info and hopefully update the wiki docs accordingly.
...
PS: AFAIU, ~/.fgfs should not be obsolete at all, or what are you referring to ?


I can't relate your "foo" example to --enable-fuel-freeze or --prop:sim/freeze/fuel=true. It seems like a case of square peg/round hole--the syntax is too different.

There hasn't been a ~/.fgfs directory on Mac for several years. The other articles cite the correct user directory, but when I move custom statements from preferences.xml into a new preferences.xml there, FG seems to ignore it. Do I need to add an include reference to the original file?

Believe me, I would love to get out from under re-customizing various prefs files with every new release, as well as from moving aircraft from the old app into a new app.
User avatar
someguy
 
Posts: 1653
Joined: Tue Nov 25, 2008 5:54 am
Location: USA
Version: 2016.2.1
OS: Mac OS X 10.11

Re: Command line arguments with 3.4 launcher?

Postby wkitty42 » Sat Mar 07, 2015 7:15 pm

someguy wrote in Sat Mar 07, 2015 1:55 pm:Meanwhile, perhaps someone else can tell me explicitly how to do it, or point me toward a wiki page that is actually helpful. The pages listed above don't seem to cover my example. I did learn what $FG_HOME is, though one of those pages has an obsolete reference to ~/.fgfs.

what do you mean "obsolete"?? that is the directory that 3.4.0 and 3.5.0 both use on my linux system... perhaps some clarifications needs to be made for the three supported OSes?
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5695
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Command line arguments with 3.4 launcher?

Postby Hooray » Sat Mar 07, 2015 7:25 pm

The 3 wiki links I posted should clarify all of your questions, specifically:

1) $FG_HOME is OS dependent, you should see a separate path for Mac OSX there
2) the "foo example" is actually pretty self-explanatory - "foo" is the property node, so in XML space it looks like this: <key>value</key>, with "key" being named "foo" in that case and an optional/implicit index. Nested hierarchies will need to be written nested in XML, too:

/sim/rendering/draw-otw

is:
Code: Select all
<sim>
 <rendering>
   <draw-otw></draw-otw>
 </rendering>
</sim>


But really, all of this is explained in great detail in the property tree docs, which are fairly accessible, and have obviously been written by non-coders, given the great deal of metaphors used there.
Have you actually read the property tree intro at all ? I mean, it's one thing to say that the wiki search doesn't work too well - but it is a completely different thing not to read the exact articles that are covering all your questions. So is this is really a matter of clarity, i.e. have you actually read those articles ?
If you don't understand the corresponding property tree/XML concepts, I would suggest not to touch preferences.xml at all.

Regarding your other question, the wiki articles I posted also cover the details of using custom preferences via the --config parameter

In addition, there are at least 3 README files in $FG_ROOT/Docs providing a layman intro into XML and the property tree, which is how most of learnt about those concepts years ago - so, if in doubt, I'd suggest to actually read some of those docs :wink:
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Command line arguments with 3.4 launcher?

Postby wkitty42 » Sat Mar 07, 2015 7:32 pm

Hooray wrote in Sat Mar 07, 2015 5:21 pm:tell us exactly what you are missing/don't understand so that we can provide the missing info and hopefully update the wiki docs accordingly.
I don't disagree that FG involves quite a steep learning curve, and many of us have been involved in FG matters for years - which is probably why some things may appear more obvious to us than they really are - but rather than doing 1:1 Q&A on the forum, I'd prefer to get specific feedback and then update the wiki accordingly.
I think I've been involved in creating/maintaining all 3 wiki articles, which is why I am really interested in learning about any deficiencies - especially coming from fellow contributors who've been around for over half a decade meanwhile ...

here's an example... in the B1900D, all the click hotspots don't show up... mainly at night it is impossible to find the switches to turn on the battery to get some light going... i read through the wiki's couple of articles and they gave some example hotspot xml code but didn't really say where to put it... i attempted to put one in using some random x,y,h,w values hoping to see a hotspot show up floating somewhere where none was before... there just wasn't enough information in the articles to allow me to translate them to something i could put in the flightdeck.xml for the B1900D...

Hooray wrote in Sat Mar 07, 2015 5:21 pm:Regarding your example, I did try to explain to you how XML nodes are mapped to --prop: arguments and vice versa.
And I do think that the wiki docs are pretty comprehensive - even though it may admittedly be difficult to spot the relevant stuff for your particular use-case.
But that is why I provided a concrete example, and even added it to the wiki.

i, too, followed that conversation and tried to match it with several aircraft but was unable to do so... C172P, B210R, B1900D...

Hooray wrote in Sat Mar 07, 2015 5:21 pm:Like I said, I am quite willing to help with improving our docs - but I would expect most people to understand how PropertyList-XML files work and how the mapping between XML and property tree space works in terms of turning an XML tree into a property tree and vice versa - and that has nothing to do with coding/programming.

i've been coding for 30+ years and rarely mess with xml stuff other than maybe for web pages... it isn't as easy for one to find the light switch to brighten the process flow as it might seem ;)

Hooray wrote in Sat Mar 07, 2015 5:21 pm:PS: AFAIU, ~/.fgfs should not be obsolete at all, or what are you referring to ?

agreed... especially since it is the proper place in linux systems :D
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5695
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Command line arguments with 3.4 launcher?

Postby Hooray » Sat Mar 07, 2015 7:45 pm

well, thanks for those examples - but I don't quite see how those are relevant in the scope of the questions posed by the OP ?
equally, the property<->XML mapping I described isn't aircraft-specific, so I don't quite see how you are trying to "match this with different aircraft" - the underlying concepts are totally agnostic to the aircraft being used. The property tree is just a dump space for variables in a key/value format, serialization is implemented using XML in a verbose tag/node format. And the whole thing is extensively documented on the wiki, I mean via 5+ different articles - all listed in the "PropertyTree" navbar on the right.
So I am having a hard time understanding how all of those can be misleading - unless people decide simply not to read things, and ask redundant questions here.
And I don't even mention $FG_ROOT/Docs ...

I am getting the impression that people are having some pretty serious misconceptions about the property tree and how it relates to XML files - but there's so much info on all of this, that it shouldn't be too much to ask to really read this and ask informed questions afterwards !?

Equally, you don't need to understand XML - someone familiar with HTML/webpages, should also understand tags and attributes and how these represent a tree-hierarchy, and how the same tree can be expressed using forward slashes to separate nodes. I mean, there's a least a handful of analogies and metaphors in use to describe property tree concepts - including even a file system, so one of those should work for you ?

Honestly, I am a bit puzzled - first, a long-time contributor asking about the property tree and XML, and then, a veteran coder basically re-iterating the same questions.
Are our docs really that pathetic, I mean, have you guys even read those docs - or are you just hoping for someone to provide a short cut explanation !? :D
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Command line arguments with 3.4 launcher?

Postby wkitty42 » Sat Mar 07, 2015 8:35 pm

Hooray wrote in Sat Mar 07, 2015 7:45 pm:well, thanks for those examples - but I don't quite see how those are relevant in the scope of the questions posed by the OP ?

they are related in the general mashup of xml coding examples that just don't have enough meat for new folks to get a decent meal and be able to start making their own food ;)

Hooray wrote in Sat Mar 07, 2015 7:45 pm:equally, the property<->XML mapping I described isn't aircraft-specific, so I don't quite see how you are trying to "match this with different aircraft" - the underlying concepts are totally agnostic to the aircraft being used.

i was attempting to view your and the wiki examples in a generic way so as to try to find the real meat of the sandwich... it didn't work :?

Hooray wrote in Sat Mar 07, 2015 7:45 pm:The property tree is just a dump space for variables in a key/value format, serialization is implemented using XML in a verbose tag/node format. And the whole thing is extensively documented on the wiki, I mean via 5+ different articles - all listed in the "PropertyTree" navbar on the right.

i haven't seen that at all... i think that most folks are like myself and we tend to focus on what's in the article instead of fluff'n'stuff around the outside edges...

Hooray wrote in Sat Mar 07, 2015 7:45 pm:So I am having a hard time understanding how all of those can be misleading - unless people decide simply not to read things, and ask redundant questions here.

i was up yesterday for 36 hours... the majority of the time was figuring out how to cleanly create a new livery without holes in the craft... weird thing was that even a blanket fill of the entire png making it all the same color gave holes... all of this so as to have something to do because of being unable to update from git due to the takeover/acquisition which (i just found out) resulted in the git:// protocol being removed and one now has to use https:// to pull from the repos... i've been fighting that ever since the notice of acquisition came out... so with that said, and trying to get back to your comment, i, for one, do read everything... some of it is greek and other of it is latin, but i keep reading and trying to understand it... the main problem is that some parts are left out... i've been known to do that myself when writing the docs on the projects i've worked on over the years... it is easy to do when you know what is supposed to be... no fault of yours or the fg team...

Hooray wrote in Sat Mar 07, 2015 7:45 pm:And I don't even mention $FG_ROOT/Docs ...

haha... i've waded so far into there that the alligators are waiting for me... still some of the same as mentioned above...

Hooray wrote in Sat Mar 07, 2015 7:45 pm:I am getting the impression that people are having some pretty serious misconceptions about the property tree and how it relates to XML files - but there's so much info on all of this, that it shouldn't be too much to ask to really read this and ask informed questions afterwards !?

the problem is being able to understand it when reading the available docs and to then be able to correlate things and put it all together to make a nice meal... instead it comes out like a spaghetti sandwich with no bread :)

Hooray wrote in Sat Mar 07, 2015 7:45 pm:Equally, you don't need to understand XML - someone familiar with HTML/webpages, should also understand tags and attributes and how these represent a tree-hierarchy, and how the same tree can be expressed using forward slashes to separate nodes. I mean, there's a least a handful of analogies and metaphors in use to describe property tree concepts - including even a file system, so one of those should work for you ?

the first thing i ran into was the huge number of them...

Hooray wrote in Sat Mar 07, 2015 7:45 pm:Honestly, I am a bit puzzled - first, a long-time contributor asking about the property tree and XML, and then, a veteran coder basically re-iterating the same questions.
Are our docs really that pathetic, I mean, have you guys even read those docs - or are you just hoping for someone to provide a short cut explanation !? :D

for me, it isn't that they are pathetic... it is that some information is left out... in one of my other lives, i'm a member of a technical documentation team... others on that team just do not understand the need of using plain layman's terms and explaining the most basic of concepts... they don't understand this because they assume that only developers are going to be interested in the documents... what they forget is that the laymen users of the technology want to learn how it works to they try to read those same docs and they end up in the same position as the OP, myself and others who are trying to understand and are at least asking questions instead of giving up because it is too hard to understand...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5695
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Command line arguments with 3.4 launcher?

Postby Hooray » Sat Mar 07, 2015 8:44 pm

No offense intended or taken.

So to keep this constructive, and hopefully helpful for fellow coders: I was referring to this article (and the navbar on the right): http://wiki.flightgear.org/Property_tree

My suggestion would be to use the property browser to view the property tree: http://wiki.flightgear.org/Property_browser
Image

And then, using the Nasal console to dump certain sub-tress to the console using debug.dump(node): http://wiki.flightgear.org/Nasal_Console
Image

This can be pretty instrumental to see how properties relate to XML and vice versa.

There are really only 2-3 APIs you need to understand to work with the property tree from Nasal, i.e. setprop() and getprop(): http://wiki.flightgear.org/Nasal_library#getprop.28.29

To see how a tree is translated into XML, use io.write_properties() - and see io.read_properties() to do the opposite.

All that is assuming that you -apparently- belong to the camp of people who prefer "tinkering over reading" :D
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Next

Return to Mac

Who is online

Users browsing this forum: No registered users and 0 guests