December 21, 200322 yr Hi Guys. I've been hacking at this code all day. From reading lots of prior posts, I came up with the following code. It is meant to display a wafer switch with 3 options (GPS,Nav1,Nav2). When you click on either of the three click regions, it changes the bitmap to represent which of the three regions you clicked on. Simultaneously, it will write either 0,1,2 to the Linked Variable L:NavMode, which I will use later in other gauges.Right now when I click on the bitmap regions, nothing happens in changing the bitmap, and I suspect in updating the variable. Any ideas? I've read the forum a great deal without any answers. Thanks. Cylon(>L:NavMode, enum)0 (%gt, L:NavMode, enum)1 (%gt, L:NavMode, enum)2 (%gt, L:NavMode, enum)
December 21, 200322 yr Hi,Did you try:0 (>L:NavMode, enum)etc.?You used >, instead of >Jan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
December 21, 200322 yr (>L:NavMode, enum)0 (>L:NavMode, enum)1 (>L:NavMode, enum)2 (>L:NavMode, enum)From the above code, I did attempt to change the assignment using ">" instead of "%gt". I got %gt from another post I saw on this forum. The above code didn't work though. It's still not cycling through the bitmaps depending on which hotspot I click.BTW, I'm not entirely sure how everything works in this implementation of XML. I've done C, C++, and lots of VB programming and it seems like there's alot of unexplained stuff. For example, what is the "enum" data type? From my previous experience, I know that certain functions require certain datatypes. But I have no idea what datatypes are returned by certain functions. For example, what range does the RPM variable return? Are they integers only? Also, I'm not sure how the RPN functions deal with the various datatypes. Are the math operators overloaded to handle all datatypes? Sorry for the long post, but I'm really confused on how to do simple things in XML.Cylon
December 21, 200322 yr Hi,In the "Value Section" you use:(>L:NavMode, enum)That must be:(L:NavMode, enum)Btw. Watch the "spaces" between arguments:Must be: In 2004 you don't need ImageSizes="64,65,0,0" anymore, doesn't work.Bitmaps need the correct dimensions in relation to each other.Jan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
December 22, 200322 yr Thanks for your help Jan. I got it working. For others to see... here's the code that made it work.(L:NavMode, enum) 0 ==(L:NavMode, enum) 1 ==(L:NavMode, enum) 2 ==%((L:NavMode, enum))%!1d! 0 (>L:NavMode, enum) 1 (>L:NavMode, enum) 2 (>L:NavMode, enum)
January 21, 200422 yr Author Commercial Member I know this is an old post, but I'm having a similar problem with my project.What I'm trying to do is assign values to TWO variables within one click event, like so: 1 (>G:Var1, number) 2 (>G:Var2, number) I then want to use the second variable for this:(G:Var2, number) 2 (>G:Var1, number) Can a select/case clause not be nested in a click event?Also, I'm finding it extremely difficult to figure out how to assign a value to initialize a variable. It's always got to be conditional, and I can't find any examples. How would I go about simply putting a value into a variable -- one time -- when the gauge loads?Thanks much in advance, and pls somebody respond as I'm at my wit's end!Jon Jon Blum Vertical Reality Simulations
January 21, 200422 yr Hi,Try to use only:(G:Var1) and (>G:Var1) etc. no arguments.eg:(G:Var1) 0 == if{ 1 (>G:Var1) } els{ 0 (>G:Var1) }or (G:Var2) ! (>G:Var2) You can have as many events in the click section as you want.To show "18" somewhere (?) make an element:(G:Var1) 1 ==......18For a value:(G:Var1) 1 == if{ 1 (G:Var2) } els{ 0 (G:Var2) }or:(G:Var2) 18 > if{ 1 (>G:Var1) }To load a condition in a variable take a L:Var or (G:Var)eg:(A:Indicated Altitude,feet) (>G:Var1)or(A:Indicated Airspeed,knots) (>L:Speed,number)Or something.Hope it helps Jan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
January 22, 200422 yr Author Commercial Member Thanks so much, Jan. This will be very helpful:)--Jon Jon Blum Vertical Reality Simulations
Create an account or sign in to comment