PDA

View Full Version : A few questions regarding inputs



daautry
09-11-2007, 12:34 AM
Panels SDK list 'token variables' as read only. It states that to attempt to write values to these could produce crashes or "incompatability with future versions".

What kind of results has anyone here experienced with attempting to write values to these, in particular to the boolean valued ones??

I want to control the turbocharger failed toggle if possible.

The FSX SDK contains a listing of all the tokens as used by both C and XML, and indicates which are "settable"

RECIP ENG TURBOCHARGER FAILED:index Turbo failed state Bool Y

This indicates that it is indeed possible to set the bool state of the variable (see the "Y"?"

daautry
09-11-2007, 10:47 PM
Guess I should have specified fs2004. . . . I want to load FSX but I'm worried that I should upgrade some hardware first.

Thanks, I haven't even thought (duh) to look into the FSX variables. It only makes since to go that route if I'm going to put in long nights that irritate my wife!!

n4gix
09-12-2007, 02:31 PM
I only pointed to the FSX SDK's list because it's the only place the "settable" variables are indicated.

The same A:variables are "settable" in FS9 as they are in FSX. It was simply never mentioned! ;)

In every case though, the "template syntax" is the same:

nnn (>A:VariableName,units)

daautry
09-12-2007, 11:47 PM
Thanks Bill,

BTW, I noticed your PC specs. How is this working with FSX??? Particularly with complex panels.

For a little more info on my 'project'. I'm interested in getting a more realistic model for the classic propliners. The panels that I've seen have all used the WEP function to simulate the supercharges with code to fool the WEP function into reseting it's time and therefore creating an 'endless' amount of boost. However the DC6 in particular used both WEP and superchargers.

Now for the next question for those here with (much) more knowledge than I:

I know that you can set gain and MP boost in the cfg file for the WEP boost, . . . Is there also a way to specify turbocharger (supercharger) boost values? Possible using the % wastegate variable??? (Not my biggest concern, just an added feature for more realistic engine performance)

Seeing from what Bill has said, since the turbocharger can have a failed state leads me to investigate whether or not I can have this set to a 'failed' state on startup, then toggle this back to a working state when needed at higher altitude (in effect, working like a supercharger).

If this is possible, it should then allow the WEP setting to be used in the correct manner for take-off and landings.

I've found a few references to the WEP not being able to be toggled easily in FS, therefore a few programmers have designed some C code (including Doug Dawsons work for Tom's Cal Classic panels) that enables this. However, this is again being used to simulate superchargers.

More thoughts on this while I continue picking apart failure coding???

daautry
09-13-2007, 02:31 AM
Don't think this works, at least not in xml. Here's the code I used to try and test it:

<Gauge Name="TEST 1" Version="1.0">
<Element>
<Select>
<Value>(L:TEST_1,bool)</Value>
<Case Value="0">
<Image Name="WATER_OFF.bmp"></Image>
</Case>
<Case Value="1">
<Image Name="WATER_ON.bmp"></Image>
</Case>
</Select>
</Element>
<Mouse>
<Tooltip>ENGINE 1 WATER/METHANOL INJECTION SWITCH</Tooltip>
<Cursor Type="Hand"></Cursor>
<Click>02 (&gt;L:km_xml_sound_id, number) (L:TEST_1, bool) ! (&gt;L:TEST_1, bool) (A:RECIP_ENGINE1_TURBOCHARGER_FAILED, bool) ! (&gt;A:RECIP_ENGINE1_TURBOCHARGER_FAILED, bool)</Click>
</Mouse>
<copyright>just a test</copyright>
</Gauge>

n4gix
09-13-2007, 01:29 PM
The prototype is:

nnn (>A:VariableName,units)

where 'nnn' is the input you are sending to the variable.

Mind you, this is all "theory" for me at this juncture, since I'm only reporting what Susan Ashlock (Lead Gauge Programmer, ACES) has stated. I've never actually tried it myself, never having had the need. ;)

taguilo
09-13-2007, 06:06 PM
Hi,

AVars (A:VariableName,units) are READ ONLY. You can't assign a value to any of them. So, if you write nnn (>A:VariableName,units) what you're doing in fact is extracting nnn from the stack, and nothing more.

A bit of detail for Bill: AVars only have a GetPropertyValue() function in their defining class.

Tom

daautry
09-13-2007, 09:39 PM
Tom,

That's the way I understood it (token, or Avars) too. But it was worth a try. I have to admit that I did that with thoughts of "if it was that easy, then it would have already been done".

Why would FS include Avars (especially failure ones) that can't be manipulated. Especially ones that even the simulator code itself doesn't (seem to) ever toggle?? That's both weird and a great shame. Values like 'OIL LOSS %', 'WASTEGATE POS', 'ENGINE DAMAGE %' etc would really allow our realism in operation to come alive.

In light of that it may not be possible yet to include added boost by both supercharger and meth/water injection.

It should be possible however to include a failure state that would set when throttles are above a certain percent without dummy injection switches being properly set. I'm going to lay the controllable boost to rest on move on that.

I wonder now if any code can effect CHT from dummy injection switch state?? More digging here.

Thanks all

BTW, if you happen to read this Doug I'd love to gleen some of the extensive knowledge you've already learned about this FS limitation.

taguilo
09-14-2007, 09:38 AM
>Tom,
>
>That's the way I understood it (token, or Avars) too. But it
>was worth a try. I have to admit that I did that with
>thoughts of "if it was that easy, then it would have
>already been done".

I'm of the ones that think it is ALWAYS worth a try :-)
I've done many tests with XML code and usually found "easy" issues that were mostly misconcepted, or completely ignored by the current pundits.

>
>Why would FS include Avars (especially failure ones) that
>can't be manipulated. Especially ones that even the simulator
>code itself doesn't (seem to) ever toggle?? That's both weird
>and a great shame. Values like 'OIL LOSS %', 'WASTEGATE POS',
>'ENGINE DAMAGE %' etc would really allow our realism in
>operation to come alive.

Those Aircraft/Sim Vars indicated as "Settables" in FSX SDK can be manipulated through Simconnect functions, but NOT by any XML code.
The only way to generate events in XML that interact/update aircraft data is trough the Events callers (>K:EVENT_NN).
Also the FAILURES system in FS is very primitive, to say something elegant. Therefore, you can't rely on this if you plan to add failures to your aircraft, it should be completely managed by custom code (Turbocharge included)


>In light of that it may not be possible yet to include added
>boost by both supercharger and meth/water injection.
>
>It should be possible however to include a failure state that
>would set when throttles are above a certain percent without
>dummy injection switches being properly set. I'm going to lay
>the controllable boost to rest on move on that.

>I wonder now if any code can effect CHT from dummy injection
>switch state?? More digging here.
>

As stated above, with proper XML code you can simulate ANY kind of failure, its a matter of knowledge and imagination :-)


Tom

n4gix
09-14-2007, 03:35 PM
>Hi,
>
>AVars (A:VariableName,units) are READ ONLY. You can't assign a
>value to any of them. So, if you write nnn
>(>A:VariableName,units) what you're doing in fact is
>extracting nnn from the stack, and nothing more.
>
>A bit of detail for Bill: AVars only have a GetPropertyValue()
>function in their defining class.

Did you miss the disclaimer?

"Mind you, this is all "theory" for me at this juncture, since I'm only reporting what Susan Ashlock (Lead Gauge Programmer, ACES) has stated. I've never actually tried it myself, never having had the need."

Susan stated that it's possible; ergo, either she's full of fecal matter, or else I've simply not gotten enough detail from her regarding how it can be done... ;)

Have you ever tried treating them as though they were simply K:events?

taguilo
09-14-2007, 04:15 PM
>
>Did you miss the disclaimer?
>
>"Mind you, this is all "theory" for me at this
>juncture, since I'm only reporting what Susan Ashlock (Lead
>Gauge Programmer, ACES) has stated. I've never actually tried
>it myself, never having had the need."

And where did she state that? I haven't found anything about in her blog.

>
>Susan stated that it's possible; ergo, either she's full of
>fecal matter, or else I've simply not gotten enough detail
>from her regarding how it can be done... ;)

Don't listen to Susan, listen to me :-): you can't assign values to AVars within pure XML code gauges. Period. However I guess it could be done using a Simconnect (C++) interface.

>
>Have you ever tried treating them as though they were simply
>K:events?

Bill, I believe you might assume that I've made HUNDRETHS of tests with XML code and structures since FS9 was born.

Anyway, with the arrival of FSX SDK, I've started to understand how XML code is parsed by the panel system. It's a matter of class properties and other related stuff. But heck, I'm an XML guy doing my first steps in C, but YOU are the C++ expert...:D


Tom

daautry
09-14-2007, 07:06 PM
CAN'T we ALL just GET ALONG!!!!:P

I obviously need to learn more about simconnect. It could be the answer to manipulating CHT, oil temp, etc. due to misconfiguration too.

n4gix
09-15-2007, 12:58 PM
>And where did she state that? I haven't found anything about
>in her blog.

She stated that to me during a casual conversation we had while I was in Redmond attending the first DevCon two years ago, as well as some followup email.

I've just checked my email archives and find I must have purged them at some point... :+