1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FSXA Glide needle ON-OFF

Discussion in 'Gauges' started by FBVLV, 6/5/12.

  1. FBVLV

    FBVLV

    Joined:
    28/11/07
    Messages:
    61
    Country:
    france
    I want to control the glideslope needle with an ON-OFF switch.
    Without the switch, this code works correctly.:)

    Code:
    <PartInfo>
        <Name>00-NORD_needle_ILS1_Glide</Name>
        <AnimLength>238</AnimLength>
        <Animation>
          <Parameter>
            <Code>(A:NAV GSI:1, Number) 119 + </Code>
            <Lag>300</Lag>
          </Parameter>
        </Animation>
      </PartInfo>

    But if I change these lines, it no longer works.:confused:

    Code:
    <PartInfo>
        <Name>00-NORD_needle_ILS1_Glide</Name>
        <AnimLength>238</AnimLength>
        <Animation>
          <Parameter>
            <Code>
    	  [COLOR="Red"][B] (L:NORD_ILS1_ON-OFF,number) 0 == 	  
    	   if{ 119 (&gt;A:NAV GSI:1, Number) } <!-- needle deactivated -->
    	   els{ (A:NAV GSI:1, Number) 119 + } <!-- needle activated -->[/B][/COLOR] 
            </Code
           <Lag>300</Lag>
          </Parameter>
        </Animation>
       </PartInfo>
    Thank for your help.
  2. tedcook

    tedcook

    Joined:
    14/11/09
    Messages:
    72
    Country:
    unitedkingdom
    A: tokens are read only. You need to use the approprite K: token.

    Try this first:-

    Code:
    	   (L:NORD_ILS1_ON-OFF,number) 0 == 	  
    	   if{ 119 } <!-- needle deactivated -->
    	   els{ (A:NAV GSI:1, Number) 119 + } <!-- needle activated --> 
    Ted
  3. FBVLV

    FBVLV

    Joined:
    28/11/07
    Messages:
    61
    Country:
    france
    OK, but what is the appropriate Event ID ?

    I'm unable to find it in the SDK.
  4. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,266
    Country:
    unitedstates
    You won't find one because no such event exists!

    What he was commenting on is with regards this part of your script:

    Code:
    if{ 119 (&gt;A:NAV GSI:1, Number) }
    You wanted to shove 119 into an A:variable. That cannot be done as A:vars are "read only!"

    So, instead of doing the above (which cannot work), he suggests this that will work:

    Code:
    if{ 119 }
  5. FBVLV

    FBVLV

    Joined:
    28/11/07
    Messages:
    61
    Country:
    france
    That works !

    Fortunately you are there.

    Thanks.
  6. FBVLV

    FBVLV

    Joined:
    28/11/07
    Messages:
    61
    Country:
    france
    New problem:
    I want that several conditions are satisfied.
    If one isn't, the glide needle should be disabled.
    I thought I would succeed with this code. But only the last condition is working.

    Code:
    <PartInfo>
        <Name>00-NORD_needle_ILS1_Glide</Name>
        <AnimLength>238</AnimLength>
        <Animation>
          <Parameter>
            <Code>
    	(A:ELECTRICAL MASTER BATTERY,bool) 0 ==
    	(L:NORD_Nav1_ON-OFF,number) 0 == OR
    	(L:NORD_ILS1_ON-OFF,number) 0 == OR	  
    	if{ 119 } <!-- needle deactivated -->
    	els{ (A:NAV GSI:1, Number) 119 + } <!-- needle activated --> 
            </Code>
           <Lag>300</Lag>
          </Parameter>
        </Animation>
       </PartInfo>
    Thank for your help.
  7. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,266
    Country:
    unitedstates
    The conditional must be lower-case only!

    OR - won't work!

    or - will work!

Share This Page