December 11, 200520 yr I am making a Gauge which shows the Flight plan and Navaids etc, and have been for the last month or so making bit maps, I now have the bit maps I need but am having problems with the HSI Range Switch. When I first load the gauge the switch for the HSI Range is not there but when I move the mouse pointer over the area and click the switch appears and set the range to 80, but will not switch to any other range. I always seem to have problems with the mouse click section and have been trying to work it out all day so now I am getting a bit mad with it, so if someone could help me I would be most greatful.This is the XML code I am using.(L:HSI RANGE, number)HSI Switch(L:HSI RANGE, number) 20 ==if { 10 (>L:HSI RANGE, number) } (L:HSI RANGE, number) 40 ==if { 20 (>L:HSI RANGE, number) } (L:HSI RANGE, number) 80 ==if { 40 (>L:HSI RANGE, number) } (L:HSI RANGE, number) 160 ==if { 80 (>L:HSI RANGE, number) } (L:HSI RANGE, number) 320==if { 160 (>L:HSI RANGE, number)}(L:HSI RANGE, number) 160 ==if { 320 (>L:HSI RANGE, number) } (L:HSI RANGE, number) 80 ==if { 160 (>L:HSI RANGE, number) } (L:HSI RANGE, number) 40 ==if { 80 (>L:HSI RANGE, number) } (L:HSI RANGE, number) 20 ==if { 40 (>L:HSI RANGE, number) } (L:HSI RANGE, number) 10==if { 20 (>L:HSI RANGE, number)}
December 11, 200520 yr Hi,The spaces between == if{ ?Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
December 12, 200520 yr Commercial Member Why not simplify it a little bit so it's a little easier to manage and more efficient as well. Jan is right about the =={if probably breaking it, but try this:HSI Switch(L:HSI RANGE, number) 0.5 * 10 max (>L:HSI RANGE, number)(L:HSI RANGE, number) 2 * 320 min (>L:HSI RANGE, number)Just set the initial somevalue (>L:HSI RANGE, number) when the gauge loads, and you're all set.--Jon Jon Blum Vertical Reality Simulations
December 12, 200520 yr Thanks Jan and Jon. If I have got this right then it should look like this:(L:HSI RANGE, number) 20 ==if{ 10 (>L:HSI RANGE, number) }Jon have tried yours and works ok, but does not show up in panel untill you click on it.Will try Jans and then I know 2 ways to do the mouse clicks.
December 12, 200520 yr Commercial Member >>Jon have tried yours and works ok, but does not show up in>>panel untill you click on it.Well you have to set the initial value when the gauge loads, otherwise it's going to be zero. In your gauge, before you do anything else, insert a startup block like so. You can use it to initialize variables like your HSI scale.(L:Startup, bool) ! if{ 20 (>L:HSI RANGE, number) 1 (>L:Startup, bool) } Jon Blum Vertical Reality Simulations
December 12, 200520 yr Realised what you meant about: Just set the initial somevalue (>L:HSI RANGE, number) whenthe gauge loads, and you're all set.Thanks for the reply anyway and thanks for the help.Thanks also Jan.
December 12, 200520 yr After Looking at the code, There is one thing I can not understand. Why 0.5 and 2.0 ???(L:HSI RANGE, number) 0.5 * 10 max (>L:HSIRANGE, number)Click>(L:HSI RANGE, number) 2 * 320 min (>L:HSIRANGE, number)
December 12, 200520 yr Commercial Member Because all your values were multiples of 2. 160 * 2 = 320, etc. I used 0.5 * instead of 2 / for reducing the scale because it's more efficient in terms of processing, but it's really insignificant particularly in a state-based role.I mean why have a bunch of if{ blocks if all the values are just half or double the previous value:)--Jon Jon Blum Vertical Reality Simulations
December 12, 200520 yr Jon I got this scrolling my ECAM pages 1 to 9 on a single button click. How can get it to reset to 1 after 9 and go round again, Is it possible? Paul Paul EGLD
December 12, 200520 yr I have now made a HSI Mode Switch. So all the value go up by one. This is the code :(L:HSI MODE, number)(L:Startup, bool) ! if{ 1 (>L:HSI MODE, number) 1 (>L:Startup, bool) }HSI Mode Switch(L:HSI MODE, number) 1 - 1 max (>L:HSI MODE, number)(L:HSI MODE, number) 1 + 6 max (>L:HSI MODE, number)Now what happens is when I UpArrow Click goes straight to 6 but when I DownArrow click it works as it should do goes from 6 to 1. Have tried * - / in the UpArrow click but with no success.
December 12, 200520 yr Hi Try (L:HSI MODE, number) 1 + 6 min (>L:HSI MODE,number)(L:HSI MODE, number) 1 - 1 max (>L:HSI MODE,number) Paul Paul EGLD
December 12, 200520 yr It now goes from 1 to 6, and then 6 to 1 like it should, but does not show up in the panel untill clicked on.
December 13, 200520 yr Hi,This is my working code for the HSI Switch:(L:HSI STARTUP,enum) 0 == if{ 4 (>L:hsi,enum) 1 (>L:HSI STARTUP,enum) } (L:hsi,enum)Plan --> Rose Ils(L:hsi,enum) 1 - 0 max (>L:hsi,enum)Rose Ils --> Plan(L:hsi,enum) 1 + 5 min (>L:hsi,enum)At startup always at position 4.May be it helps,Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
December 13, 200520 yr Hi,This should work:One single click, round from 1 to 9(LVar) d 9 != * 1 + (>LVar)Tom
Create an account or sign in to comment