FSDeveloper Community

Go Back   FSDeveloper Community > Microsoft Flight Simulator development > Aircraft Design > Gauges

Gauges Use this forum for all your gauges related discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 06 May 2012, 11:21
FBVLV FBVLV is offline
  france
Join Date: Nov 2007
Posts: 59
Glide needle ON-OFF

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.

Code:
<PartInfo>
    <Name>00-NORD_needle_ILS1_Glide</Name>
    <AnimLength>238</AnimLength>
    <Animation>
      <Parameter>
        <Code>
	   (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 --> 
        </Code
       <Lag>300</Lag>
      </Parameter>
    </Animation>
   </PartInfo>
Thank for your help.
Reply With Quote
  #2  
Old 06 May 2012, 12:05
tedcook's Avatar
tedcook tedcook is offline
  unitedkingdom
Join Date: Nov 2009
Posts: 52
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
Reply With Quote
  #3  
Old 08 May 2012, 13:26
FBVLV FBVLV is offline
  france
Join Date: Nov 2007
Posts: 59
OK, but what is the appropriate Event ID ?

I'm unable to find it in the SDK.
Reply With Quote
  #4  
Old 08 May 2012, 17:34
n4gix n4gix is offline
  unitedstates
Location: Hammond, Indiana
Join Date: Sep 2006
Posts: 8,522
Quote:
Originally Posted by FBVLV View Post
OK, but what is the appropriate Event ID ?

I'm unable to find it in the SDK.
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 }
__________________
Bill Leaming
3d Modeler Max/GMax
C & XML Gauge Programmer
Eaglesoft Development Group
http://eaglesoftdg.com

Intel® Core™ i7-3770k 4.2GHz - Crucial 16GB DDR3 - Dual Radeon HD770 1GB DDR5 (Crossfire) - Eco II Watercooling - Win7 64bit
Intel® Core™ i7-2600k 3.4GHz - Crucial 4GB DDR3 - NVIDIA GeForce GTX550Ti 1GB - Win7 64bit
Intel® Core™ i7-860 2.8GHz - Crucial 8GB DDR3 - NVIDIA GeForce GTS240 1GB - Win8 64bit
NOTE: Unless explicitly stated otherwise, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
Reply With Quote
  #5  
Old 09 May 2012, 03:44
FBVLV FBVLV is offline
  france
Join Date: Nov 2007
Posts: 59
That works !

Fortunately you are there.

Thanks.
Reply With Quote
  #6  
Old 09 May 2012, 13:13
FBVLV FBVLV is offline
  france
Join Date: Nov 2007
Posts: 59
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.
Reply With Quote
  #7  
Old 10 May 2012, 11:34
n4gix n4gix is offline
  unitedstates
Location: Hammond, Indiana
Join Date: Sep 2006
Posts: 8,522
The conditional must be lower-case only!

OR - won't work!

or - will work!
__________________
Bill Leaming
3d Modeler Max/GMax
C & XML Gauge Programmer
Eaglesoft Development Group
http://eaglesoftdg.com

Intel® Core™ i7-3770k 4.2GHz - Crucial 16GB DDR3 - Dual Radeon HD770 1GB DDR5 (Crossfire) - Eco II Watercooling - Win7 64bit
Intel® Core™ i7-2600k 3.4GHz - Crucial 4GB DDR3 - NVIDIA GeForce GTX550Ti 1GB - Win7 64bit
Intel® Core™ i7-860 2.8GHz - Crucial 8GB DDR3 - NVIDIA GeForce GTS240 1GB - Win8 64bit
NOTE: Unless explicitly stated otherwise, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NAV2 Needle "Shift" code? lionheart Gauges 7 28 Oct 2011 02:01
[FSXA] Glide Slope Alert swift39 Sound 4 16 Oct 2011 13:43
[FS2004] Dual needle fuel gauge euroastar350 Gauges 2 23 May 2011 21:35
3D needle animation (FSX SDK) Xpand Modeling 8 22 Aug 2010 08:41
Module_var_none Needle Capn_Geoff Gauges 1 15 Mar 2009 14:06


All times are GMT -4. The time now is 04:27.

Kirsch designed by Andrew & Austin


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.