![]() |
|
|||||||
| Register | Wiki | Downloads | FAQ | Members List | Social Groups | Calendar | Search | Today's Posts | Mark Forums Read |
| Gauges Use this forum for all your gauges related discussions |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
XML Code Help needed
Hi there,
I am working on a Caution Panel for a helicopter project and am stuck on some of the code... 1. Generator Lights are coded like this: <Element id="No.1 Generator OFF"> <FloatPosition>60.000,30.000</FloatPosition> <Visibility>(A:GENERAL ENG GENERATOR ACTIVE:1,bool) 0.5 > (A:PARTIAL PANEL ELECTRICAL,enum) ! and if{ 0 } els{ 1 }</Visibility> <SizeScale>1.400</SizeScale> <Image id="Caution_No1_Generator_ON.bmp" Name="Caution_No1_Generator_ON.bmp"> <Transparent>True</Transparent> </Image> </Element> Basically they work fine, but, they maintain lit when the battery is switched off.... 2. Hydraulic Pressure Lights are coded like this: <Element id="Aux Servo Press"> <FloatPosition>170.000,245.000</FloatPosition> <Visibility>(A:Engine HYDRAULIC PRESSURE,Pounds per square foot) 1008000 < (A:PARTIAL PANEL ELECTRICAL,enum) ! and if { 1 } els { 0 }</Visibility> <SizeScale>1.400</SizeScale> <Image id="Caution_Aux_Servo_Press_ON.bmp" Name="Caution_Aux_Servo_Press_ON.bmp"> <Transparent>True</Transparent> </Image> </Element> They aren't doing anything ![]() 3. Fuel Low Lights are coded like this: <Element id="FWD Fuel Low"> <FloatPosition>62.000,138.000</FloatPosition> <Visibility> (A:Fuel Tank Right Main Quantity,gallons) 40 < (A:PARTIAL PANEL ELECTRICAL,enum) ! and if { 0 } els{ 1 }</Visibility> <SizeScale>1.400</SizeScale> <Image id="Caution_Fwd_Fuel_Low_ON.bmp" Name="Caution_Fwd_Fuel_Low_ON.bmp"> <Transparent>True</Transparent> </Image> </Element> They also don't do nothing... Any help would be highly appreciated.
|
|
#2
|
||||
|
||||
|
The second two have a space between the 'if/else' and the '{'.
The first one you could possibly use; A:ELECTRICAL MASTER BATTERY,Bool instead of the partial panel variable. I've never used partial panels like that, I usually put them in the the failures section ... I feel a little test gauge coming on ... Last edited by chris; 10 Dec 2011 at 11:35. Reason: speeling |
|
#3
|
|||
|
|||
|
Hey Chris, thanks a lot, will try that out asap
|
|
#4
|
|||
|
|||
|
Ok, problems solved. Actually the usage of the "ELECTRICAL MASTER BATTERY" value made no difference, but while looking at that line of code again, I suddenly knew it...
Here's what I did: <Visibility>(A:GENERAL ENG GENERATOR ACTIVE:1,bool) 0.5 < (A:PARTIAL PANEL ELECTRICAL,enum) ! and if{ 1 } els{ 0 }</Visibility> |
|
#5
|
|||
|
|||
|
OK, here I am again. The Caution Panel still working as it is expected to do, I drilled new holes into my panel to fill them with lights. Unfortunately, they do display right on lamptest, the don't display on the set condition.
Anyone here to help me up that horse?1. Battery_Hot_Light This Light should be lit in case, that Battery is ON, respective Generator is ON and a certain amount of time has passed... Quote:
his is to be lit, when there ist something attached to either sling or hoist. Quote:
Here I want the light to work, when the "pickup mode" of sling/hoist is activated... Quote:
|
|
#6
|
|||
|
|||
|
Quote:
Also, it has been mentioned many times that even the programmers have stated that the only guaranteed value is 0 (zero). Because of rounding errors, frequently instead of 1 we might actually get 0.999999998, which of course would cause a check for 1 to fail. ![]() Best chance for success is to always check for zero or not-zero (A:GENERAL ENG GENERATOR ACTIVE:1,bool) 0 == (battery off) (A:GENERAL ENG GENERATOR ACTIVE:1,bool) 0 != (battery on)
__________________
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...
|
|
#7
|
|||
|
|||
|
Hey Bill,
thx for the reply. The funny thing is, my code, as false as it may be, works flawless... for whatever reason... |
|
#8
|
|||
|
|||
|
Quote:
It's just a very strange way of writing boolean logic!
__________________
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...
|
|
#9
|
|||
|
|||
|
Oh, eeeeeeeeeeeeh... true
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help with Animations | fsnewbie | Modeling | 17 | 10 Mar 2010 17:28 |
| Gauge code question | lionheart | Gauges | 1 | 12 Aug 2009 14:58 |
| Wonderfull error list | supercar1000 | FSX Planner | 4 | 06 Aug 2008 12:59 |
| ILS Altitude | Alan McGaughey | Airport Design Editor | 18 | 06 Aug 2008 04:49 |