Jump to content
Sign in to follow this  
Guest bartels

Smoke Gauge

Recommended Posts

Guest harry3

Hi!I've a question about a smoke gauge:It must toggle the smoke on or off, depending on the fuel flow. If fuel flow is greater than 0, it should turn the smoke switch on, and otherwise, it should turn it off.When starting the engines, it turns the toggle on. That's ok. But then, if you have also a visible switch, where you can see the value of the (A:Smoke,bool), you see that the switch jumps from 1 to 0 and back, many times in one second. Why doesn't it just keep in 1 position???Then, when turning off the engines, the toggle sometimes keeps in 0, sometimes in 1 position. So, the smoke isn't always turned off. Why this???Regards,Harry :-) (A:ENG1 FUEL FLOW PPH,pounds per hour) 1 < (A:SMOKE,bool) 1 == && if{ 1 (>K:SMOKE_TOGGLE) } (A:ENG1 FUEL FLOW PPH,pounds per hour) 1 > (A:SMOKE,bool) 0 == && if{ 1 (>K:SMOKE_TOGGLE) }

Share this post


Link to post
Share on other sites
Guest bartels

I haven't tested for xml gauges, but in my experience the effect of any K: event doesn't take immediate effect to the A: variables, it takes time till the next drawing cycle. So if you work with any K:..._TOGGLE event try to use it only once in a gauge (better once in a panel!) or use a corresponding K:..._SET or ..._ON/ ..._OFF event if available.e.g.<Value>(A:ENG1 FUEL FLOW PPH,pounds per hour) 1 > (>K:SMOKE_SET)</Value>or<Value>(A:ENG1 FUEL FLOW PPH,pounds per hour) 1 > if{ 0 (>K:SMOKE_ON) } els{ 0 (>K:SMOKE_OFF) }</Value>Arne BartelsKEY_SMOKE_ON

Share this post


Link to post
Share on other sites
Guest harry3

Well, the gauge now works. (Source Code below!!!).But what I don't understand is why it doesn't work with a normal toggle!? If the FF is 0, then it just should switch the value from 1 to 0, and that's it. Not more. Why is it switching the whole time(with the old code), even if the I've told the FS2002 that it just should execute the K:Smoke if the last 2 values are true??? I've to make 4 gauges in this style(for JS Design), which should control an effect file. (NAV, Strobe, Smoke,.....)But not every FX has an ON/OFF toggle K Event! So, what should I do with TOGGLE_BEACON_LIGHTS for example? How can I tell the FS that it should just toggle to 1 with this variable??? (>K:TOGGLE_BEACON_LIGHTS)-->How to tell FS to switch to 1??? (>K:TOGGLE_BEACON_LIGHTS 1)-->won't work I think!!!Regards,Harri :-) (A:ENG1 FUEL FLOW PPH,pounds per hour) 0== if{ 1 (>K:SMOKE_ON) } els{ 0 (>K:SMOKE_OFF) }

Share this post


Link to post
Share on other sites
Guest bartels

In that case I'd try to use only one toggle in one gauge in the panel. Something like- check the condition- compare with the state of the A: variable- if it should be different, toggleArne Bartels

Share this post


Link to post
Share on other sites
Guest harry3

So, that means that I should make the same as in the first gauge, which didn't really work. Just that the OFF/ON part must be in 2 seperat gauges , and not everything in 1!? Well, I'll try this!Harry :-)

Share this post


Link to post
Share on other sites
Guest bartels

You can use ..._SET, ..._ON, .._OFF events in more then one gauge, because of the deterministic result, the associated A: variables aren't sensible to "race conditions". The .._TOGGLE events however should be used with great care and only in one gauge per panel for those "automatic" stuff.A bit like your first proposal:<Gauge Name="Smoke Switch" Version="1.0"> <Element> <Select> <Value> (A:ENG1 FUEL FLOW PPH,pounds per hour) 1 < (* assume FF is low *) (A:SMOKE ENABLE,bool) (* smoke is on *) == (* both conditions the same*) if{ 0 (>K:SMOKE_TOGGLE) } (*then you have to toggle *) (* FF high, smoke off => both conditions false => equal => toggle *) (* FF high, smoke on => cond1 false, cond2 true => not equal => no toggle*) (* FF low, smoke off => cond1 true, cond2 false => not equal => no toggle*) </Value> </Select> </Element></Gauge>Arne Bartels

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...