Search the archive:
YaBB - Yet another Bulletin Board
 
   
 
Page Index Toggle Pages: 1
Send Topic Print
XML gauge-needle counter clockwise rotation? (Read 1259 times)
Nov 4th, 2007 at 7:22am

Sterk   Offline
Colonel

Posts: 316
*****
 
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 <rotate> command,forcing needle to rotate CCW?
 

...&&&&
IP Logged
 
Reply #1 - Nov 4th, 2007 at 12:15pm

Fr. Bill   Offline
Colonel
I used to have a life;
now I have GMax!
Hammond, IN

Gender: male
Posts: 962
*****
 
Simply invert your Non-linearity table. Done!

IOW, list from highest to lowest instead of lowest to highest...  Cool
 

Bill
... 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 NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
...
IP Logged
 
Reply #2 - Nov 4th, 2007 at 1:38pm

Sterk   Offline
Colonel

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

Thank you a lot!
 

...&&&&
IP Logged
 
Reply #3 - Nov 5th, 2007 at 2:25pm

Fr. Bill   Offline
Colonel
I used to have a life;
now I have GMax!
Hammond, IN

Gender: male
Posts: 962
*****
 
You are most welcome.  It is unfortunate that the very proliferation of web forums and news groups for flightsim development is actually the single greatest handicap for all of us...

...the answers to nearly any question one might ask are already out there => somewhere!

The problem is known as "Information Dillution."  Instead of being a great boon for us, it is in reality a great bane...  Undecided

That's one of the reasons why I dedicate at least three hours every day to reviewing > 30 sources of information, so I can hopefully keep up, and also - share the information between "groups" who likely don't even know of each other's existence...  Roll Eyes
 

Bill
... 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 NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
...
IP Logged
 
Reply #4 - Nov 6th, 2007 at 8:44pm

Sterk   Offline
Colonel

Posts: 316
*****
 
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:

...



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. Angry 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?
 

...&&&&
IP Logged
 
Reply #5 - Nov 7th, 2007 at 3:14pm

Fr. Bill   Offline
Colonel
I used to have a life;
now I have GMax!
Hammond, IN

Gender: male
Posts: 962
*****
 
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.  Cool

Nice job on that EICAS page!
 

Bill
... 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 NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
...
IP Logged
 
Reply #6 - Nov 7th, 2007 at 6:20pm

Sterk   Offline
Colonel

Posts: 316
*****
 
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:

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

<Gauge Name="ANTIICE_MASTER" Version="1.0">
     <Element>
           <Select>
                 <Value>(A:General eng1 anti ice position, 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 Event="ANTI_ICE_TOGGLE"/>
     </Mouse>
</Gauge>

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

Lamps:

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

<Gauge Name="ANTIICE_LAMPS" Version="1.0">
     <Element>
           <Visible>(A:General eng1 anti ice position, bool)</Visible>
           <Image Name="AntiIce_Lamps_ON.bmp" Bright="Yes"/>
     </Element>
</Gauge>

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

...&&&&
IP Logged
 
Reply #7 - Nov 11th, 2007 at 12:05pm

Fr. Bill   Offline
Colonel
I used to have a life;
now I have GMax!
Hammond, IN

Gender: male
Posts: 962
*****
 
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:
<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>

 

 

Bill
... 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 NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
...
IP Logged
 
Reply #8 - Nov 11th, 2007 at 7:53pm

Sterk   Offline
Colonel

Posts: 316
*****
 
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.
 

...&&&&
IP Logged
 
Reply #9 - Nov 11th, 2007 at 11:26pm

Fr. Bill   Offline
Colonel
I used to have a life;
now I have GMax!
Hammond, IN

Gender: male
Posts: 962
*****
 
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. Wink
 

Bill
... 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 NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
...
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print