XML gauge-needle counter clockwise rotation?

FSSC, Airport 2.*, CfgEdit, etc. Get to grips with designing Scenery & Panels here!

XML gauge-needle counter clockwise rotation?

Postby Sterk » Sun Nov 04, 2007 7:22 am

Iam trying to create oil pressure indicator,using XML.
Pretty simple task-but the only problem that values should grow from 0 to 100 PSI in counter clockwise directon-and I cant get the needle to rotate this direction-it always rotates clockwise.For example if value changes from 50 to 70 PSI-needle rotates full circles several times,making every circle few degrees less then previous one  gradually reaching the target mark.
Is there any attribute of command,forcing needle to rotate CCW?
Image
User avatar
Sterk
1st Lieutenant
1st Lieutenant
 
Posts: 316
Joined: Sun Oct 12, 2003 11:12 am

Re: XML gauge-needle counter clockwise rotation?

Postby Fr. Bill » Sun Nov 04, 2007 12:15 pm

Simply invert your Non-linearity table. Done!

IOW, list from highest to lowest instead of lowest to highest...  8-)
BillImage Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4GB DDR2 Crucial PC6400-800 GB SATA-ATI Radeon HD2400 Pro 256MB DX10 [i
Fr. Bill
Captain
Captain
 
Posts: 961
Joined: Sun Apr 27, 2003 1:31 pm
Location: Hammond, IN

Re: XML gauge-needle counter clockwise rotation?

Postby Sterk » Sun Nov 04, 2007 1:38 pm

OMG!
I tried all kinds of tricks with long expressions,inverting values etc., except the simpliest and most obvious one!

Thank you a lot!
Image
User avatar
Sterk
1st Lieutenant
1st Lieutenant
 
Posts: 316
Joined: Sun Oct 12, 2003 11:12 am

Re: XML gauge-needle counter clockwise rotation?

Postby Fr. Bill » Mon Nov 05, 2007 2:25 pm

You are most welcome.
Last edited by Fr. Bill on Mon Nov 05, 2007 2:27 pm, edited 1 time in total.
BillImage Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4GB DDR2 Crucial PC6400-800 GB SATA-ATI Radeon HD2400 Pro 256MB DX10 [i
Fr. Bill
Captain
Captain
 
Posts: 961
Joined: Sun Apr 27, 2003 1:31 pm
Location: Hammond, IN

Re: XML gauge-needle counter clockwise rotation?

Postby Sterk » Tue Nov 06, 2007 8:44 pm

Yes,you are right.
But solution was so obviuos that nobody might find it even worth mention or discussion.May be...
Thank you again.With your help I finally finished pretty complicated gauge for the beginner like me-EICAS:

Image



And if you dont mind I ask one more question about XML.
One stupid XML problem is driving me crazy-very simple and classic task:
There is a switch,wich jumps from on to off position.Near the switch there is a simple indicator(lamp),wich supposed to indicate that switch state.
Both gauges uses the same variable to change their state.Very simple.And actually works-I click switch-lamp goes on-one more click-lamp goes off.
The problem is that switch doesnt jump when I click it. >:( But as I remove the lamp from panel-switch jumps.Two gauges cannot use the same variable as a source?
Thats the XML limitation?Or as in first case I dont see the most obvious?
Image
User avatar
Sterk
1st Lieutenant
1st Lieutenant
 
Posts: 316
Joined: Sun Oct 12, 2003 11:12 am

Re: XML gauge-needle counter clockwise rotation?

Postby Fr. Bill » Wed Nov 07, 2007 3:14 pm

No, that is not your problem. I'd have to see that section of XML script code to find the problem.  You can use the same variable to drive as many things as you like.  8-)

Nice job on that EICAS page!
BillImage Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4GB DDR2 Crucial PC6400-800 GB SATA-ATI Radeon HD2400 Pro 256MB DX10 [i
Fr. Bill
Captain
Captain
 
Posts: 961
Joined: Sun Apr 27, 2003 1:31 pm
Location: Hammond, IN

Re: XML gauge-needle counter clockwise rotation?

Postby Sterk » Wed Nov 07, 2007 6:20 pm

Here is the code.Very simple.

As I said-gauges actually work-lamps go on/off and I can see key event feedback on EICAS(power drop etc.,)
But switch jumps only once from off to on position and stays there,ignoring mouse clicks.I mean "OFF" bitmap stops showing up.
As I remove lamps gauge from panel-all works properly.

Something strange and funny:Switch off lamps off.Click on switch-lamps on,switch on.One more click-lamps off switch stays on.Shift+L twice to toggle all aircarft lights-switch returns to off!What is this?

Switch:

----------------------------------------------------------------------------------------------------


     
           
     

     
           
           
     



---------------------------------------------------------------------------------------------------------------

Lamps:

---------------------------------------------------------------------------------------------------------------


     
           (A:General eng1 anti ice position, bool)
           
     



--------------------------------------------------------------------------------------------------------------
Image
User avatar
Sterk
1st Lieutenant
1st Lieutenant
 
Posts: 316
Joined: Sun Oct 12, 2003 11:12 am

Re: XML gauge-needle counter clockwise rotation?

Postby Fr. Bill » Sun Nov 11, 2007 12:05 pm

You can solve the problem by simply defining a custom L:var for the switch. I suspect the problem is deeper into the FS core, but at least this will work reliably:

Code: Select all
<Gauge Name="ANTIICE_MASTER" Version="1.0">
     <Element>
           <Select>
                 <Value>(L:AntiIceSwitch, bool)</Value>
                 <Case Value="0">
                       <Image Name="AntiIce_Switch_OFF.bmp"/>
                 </Case>
                 <Case Value="1">
                       <Image Name="AntiIce_Switch_ON.bmp"/>
                 </Case>
           </Select>
     </Element>
     <Mouse>
           <Cursor Type="Hand"/>
           <Click>
                  (>K:ANTI_ICE_TOGGLE)
                  (L:AntiIceSwitch,bool) ! (>L:AntiIceSwitch,bool)
           </Click>
     </Mouse>
</Gauge>

BillImage Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4GB DDR2 Crucial PC6400-800 GB SATA-ATI Radeon HD2400 Pro 256MB DX10 [i
Fr. Bill
Captain
Captain
 
Posts: 961
Joined: Sun Apr 27, 2003 1:31 pm
Location: Hammond, IN

Re: XML gauge-needle counter clockwise rotation?

Postby Sterk » Sun Nov 11, 2007 7:53 pm

Thank you for trying to help,but problem is not in code,because I tried to use L variable too.Just 10 minutes ago I finally solved the problem.
It was overlapping gauge bitmaps.I had no idea that gauge bitmaps must not overlap even if it is transparent in this area,otherwise the lower gauge bitmap(wich loaded first) stops refreshing,FS considers it's invisible and stops refreshing the bitmap,although it does visible through upper gauge transparent area.Ah...
This time it was not so obvious and required some thinking and trying.
Image
User avatar
Sterk
1st Lieutenant
1st Lieutenant
 
Posts: 316
Joined: Sun Oct 12, 2003 11:12 am

Re: XML gauge-needle counter clockwise rotation?

Postby Fr. Bill » Sun Nov 11, 2007 11:26 pm

Ah! I'm glad you found the problem.  Maybe I've just been lucky, but I've never run across that problem before. Of course, I've always been somewhat anal retentive about cropping and clipping artwork. ;)
BillImage Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4GB DDR2 Crucial PC6400-800 GB SATA-ATI Radeon HD2400 Pro 256MB DX10 [i
Fr. Bill
Captain
Captain
 
Posts: 961
Joined: Sun Apr 27, 2003 1:31 pm
Location: Hammond, IN


Return to Scenery & Panel Design

Who is online

Users browsing this forum: No registered users and 568 guests