Jump to content
Sign in to follow this  
Guest ridgell

Landing light gauge

Recommended Posts

Hi:Has any one made an gauge in XML, like the one that Tinmouse has for the landing lights?I mean that the inboard light swith toggles the landing lights, and the outboard landing light toggles the tailhook, and if the landing light were not on, that also toggles them on?If not what should i take in consideration to try to make it, I am totally new on gauge programing.Thanks a lot for your helpHelio Alberto Regalado Moreira

Share this post


Link to post
Share on other sites

Hi:This is what I came up to now, whit the little i could get, my point by far is to toggle both landing lights and tailhook:(A:Light landing,bool)(g:Tail,bool)(A:Light landing,bool) == 0 (A:TAILHOOK_POSITION,bool) == 0(A:Light landing,bool) == 1 (A:TAILHOOK POSITION,bool) == 1(g:Tail,bool) ! (>g:Tail,bool)This code has not worked.So how should i type the (A:Light landing,bool) == 1 (A:TAILHOOK POSITION,bool) == 1 (in this case to turn on both things?Thanks a lot.Helio Alberto Regalado Moreira

Share this post


Link to post
Share on other sites
Guest ridgell

(A:Light landing,bool) == 1 (A:TAILHOOK POSITION,bool) == 1xml uses RPN logic so; (A:light landing,bool) 1 ==with the operator 'equal' coming after the object.your code is reading light landing, as in a comparison, bool is asking if the value is '1' which would be followed by if{ bla bla} if the bool returned a 1. if you want to fix a value you need to use 0 (>K:LANDING_LIGHTS_TOGGLE) since it is a toggle you can use any number ahead of the > because the event is fixed in FS9 to a 1 or a 0. ( a toggle ) what ever the number the state of the toggle will switch if it is 0 it will become 1 if it is 0 it will become 1.to insure you only toggle when it is in the off state, you would arrange things like this.(A:light landing, bool) 0 == if{ 0 (>K:LANDING_LIGHTS_TOGGLE) } is it equal to zero? if it is zero toggle the lights.the zero after the if{ is arbitrary any number will have the same effect on a toggle variable. non toggle variables would load the number you choose. conversly;if you want to turn it off, if it is on; (A:light landing, bool) if{ 0 (>K:LANDING_LIGHTS_TOGGLE) }K VARIABLES usually do not need a parameter like L variables. to fix a value in a variable it is more proper to use1 (>L:variable name, enum) or number. have you down loaded the SDK ? THE SOFTWARE DEVELOPEMENT KIT. it provides you with the built in variable names and parameters, and is really step one in your learning process. next read the top most post in this forum. it has been anchored here for prosperity and has examples of most of the routines you will need to master xml gauge making. take heart at some point this gibberish will start to make sense, and you are on your way. though i made lots of working gauges with out having any understanding how the code worked, that came later, i just copy and pasted snipets from working gauges rearranging them to suit my needs. hope this helped...did not want to see a new gauge maker's post go unanswered. if i missed the point, ask again or wait till a smarter member answers your question.

Share this post


Link to post
Share on other sites

> > > (g:Tail,bool)> > (A:Light landing,bool) == 0>(A:TAILHOOK_POSITION,bool) == 0> > > (A:Light landing,bool) == 1 (A:TAILHOOK>POSITION,bool) == 1> > > > > > > (g:Tail,bool) ! (>g:Tail,bool)> >>>This code has not worked.>So how should i type the (A:Light landing,bool) == 1>(A:TAILHOOK POSITION,bool) == 1 (in this case to turn>on both things?>>Thanks a lot.>>Helio Alberto Regalado Moreira> I'm a little uncertain of what it is exactly that you wish to do. In any case, the statement...(A:Light landing,bool) == 1 (A:TAILHOOK POSITION,bool) == 1... does nothing but put the states of the relational tests on the stack if you reverse the == and the 1(A:Light landing,bool) 1 == (A:TAILHOOK POSITION,bool) 1 == -need a logical operation here-To use the above tests of the variables to do something you need toadd a logical operation "or" || or "and" && , and then you can usethe result of the test in a statement or something like: if{1 (>K:LANDING_LIGHTS_ON)}els{1 (>K:LANDING_LIGHTS_OFF)}To turn on the landing lights and extend the tailhook you need something like this: 1 (>K:LANDING_LIGHTS_ON) 1 (>K:TOGGLE_TAIL_HOOK_HANDLE) These are KEY events...they transfer the value (1) to the event variable. There is also a landing lights off KEY event: 1 (>K:LANDING_LIGHTS_OFF) I think the "1" could also be "0" in the case of KEY events and the result is the same, the named event is triggered. You need to first ascertain the states of the landing lights and tailhook by testing (A:TAILHOOK_POSITION,enum) and (A:LANDING_LIGHTS,enum) A value of 1 indicates extended for the hook and on for the lights. You might make the logic easier if you have seperate switches for extending the lights ( tailhook ) and turning them on. Also, to keep track of states, you might use a Local variable instead of a g:var . You name the L var to reflect it's use. 1 (>L:LIGHTS EXTENDED,bool) sets the variable to the true state. Hope I haven't confused you too much here :) Paul


Wide-5.jpg

Share this post


Link to post
Share on other sites

OkiThen what I will try to make is to first make a single gauge, that togles landing lights, and the second gauge that toggles the tailhook, a 3rd gauge that toggles booth.So for thatIf I use G:VAR1 to get the 0 or 1 value, and that value ask this:If G:VAR1 == 1:Ask if Landing Light are: On: extend tailhook Off: turn on Landing Light and extend tailhookIf G:VAR1 == 0:retract tailhook (becose landing linght have their own shitc to toogle them off -invoard landing lights)For this case, what will be the If sentences for makeing this, whit this code the rest (I hope) I think will be easy.Thank a lot for your help.Helio Alberto Regalado Moreira

Share this post


Link to post
Share on other sites
Guest ridgell

you need to write your code in RPN ( REVERSE POLISH NOTATION ) like what is used in the old HP calculators.(G:Var1) 1 ==the operator comes AFTER the object.this is true for all XML calculations.TO DIVIDE IS; (G:Var) 2 / multiply is; (G:Var) 2 * etc.write out what you are trying to do in words, and ill post you the code habla espanol? escriba en espa

Share this post


Link to post
Share on other sites

After reading the SDK, and finally undertand the post above this was the code that resulted, It has an error, becose it does not work, I think it is on the "if" parts, the part that I less understand, more becose in this case I have to use sub-if secuences (the inner lights works, outer lights dont work).My logic for the "if" section is the one I tell above.If you want I will try to upload the code that I have up to now for you to check.Thanks a lot!!!Despues de leer el SDK, y entender un tanto mas lo escrito arriva, este fue el codigo que logre hacer, tiene un error, que creo que esta en las secciones de "If" (la parte que menos entiendo) mas sobre todo porque tengo usar IF concatenados, en este codigo, las innter lights (las que prenden solos las luces de aterrizaje) funciona, la otra parte las de outter lights no funciona.Sigo usando la misma logica que escribi arriba.Si quieren puedo cargar los archivos con el codigo a un server para que lo puedan ver.Muchas Gracias!!!Helio Alberto Regalado Moreira(A:TAILHOOK POSITION,bool) 0 ==(A:Light landing,bool)(A:Light landing,bool) 1 ==(A:TAILHOOK POSITION,bool)(G:Tail,bool) 1 == if{ (A:Light landing,bool) 1 == if{ (1 (>K:TOGGLE_TAIL_HOOK_HANDLE)} els { (1 (>K:LANDING_LIGHTS_ON) 1 (>K:TOGGLE_TAIL_HOOK_HANDLE)}}(G:Tail,bool) 0 == (A:TAILHOOK POSITION,bool) 1 == if { (1 (>K:TOGGLE_TAIL_HOOK_HANDLE)}(G:Tail,bool) ! (>G:Tail,bool)

Share this post


Link to post
Share on other sites

These are the last mod's I've made for the code, still whitout make it work, I think the mistake is here, any Ideas?(G:Tail,bool) 1 == if{ (A:Light landing,bool) 1 == if{ 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)} els { 0 (>K:LANDING_LIGHTS_TOGGLE) 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)}}(G:Tail,bool) 0 == (A:TAILHOOK POSITION,bool) 1 == if { 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)}(A:Light landing,bool) 0 == (A:TAILHOOK POSITION,bool) 1 == if { 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)}The entire code is:(A:TAILHOOK POSITION,bool) 0 ==(A:Light landing,bool)(A:Light landing,bool) 1 ==(A:TAILHOOK POSITION,bool)(G:Tail,bool) 1 == if{ (A:Light landing,bool) 1 == if{ 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)} els { 0 (>K:LANDING_LIGHTS_TOGGLE) 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)}}(G:Tail,bool) 0 == (A:TAILHOOK POSITION,bool) 1 == if { 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)}(A:Light landing,bool) 0 == (A:TAILHOOK POSITION,bool) 1 == if { 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)}(G:Tail,bool) ! (>G:Tail,bool)

Share this post


Link to post
Share on other sites
Guest ridgell

i had trouble understanding youre intentions from looking at youre code. i looked at;"the inboard light swith toggles the landing lights, and the outboard landing light toggles the tailhook, and if the landing light were not on, that also toggles them on"i did not understand youre use of the . nor did i understand youre drawing arrangement of the inboard and out board lights.i cut the visible command, and re-arranged youre lights drawing section...if the result is unusable, please just write out what you want in words..not in code.here is what i interpreted your requirements to be;(A:Light landing,bool)(A:TAILHOOK POSITION,bool)(L:tail, bool) if{ O (>L:tail, enum) } (A:LIGHT LANDING, bool) 0 == if{ 0 (>K:LANDING_LIGHTS_TOGGLE) } 0 (>K:TOGGLE_TAIL_HOOK_HANDLE) 1 (>L:tail, enum)i changed the use of G:var to an L:var, you had assigned it a name other then Var1 etc. so i used an L:var, they are more flexable and i have not seen a named G:var before, so to be safe....i also deleted the gauge roll trim help id...????you can delete the comment sections, i added them to outline what i was doing. hope this helps, if i misunderstood, i will try again...im game as long as you are.

Share this post


Link to post
Share on other sites

Perhaps one of the only parts that work 90% correct are the visible part (they can work 100% correct if the logic works), and I use that method becose I have 3 bitmaps, one for all off, one for inboard lights on only, and the 3rd for all on.Tha idea in the vaule sections are this one:(G:Tail,bool) 1 == if{ (A:Light landing,bool) 1 == if{ 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)} els { 0 (>K:LANDING_LIGHTS_TOGGLE) 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)}}For this part in pseudocode will be like this:If G:Tail = 1 then: if Landing Light = 1 (on) then Toggle Tailhook (tailhook down as outboard lights) else (landing lights = 0 -off) Toggle Tailhook (set tailhook down as outboard lights) Toggle Landing Lights (to turn imboard lights on) end ifend ifFor the second value will be this:(G:Tail,bool) 0 == (A:TAILHOOK POSITION,bool) 1 == if { 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)}and the pseudocode:if G:Tail = 0 (outboard off) and Tailhook = 1 (down) then: Toggle Tailhook (set tailhook up)end ifthe 3rd value section (which is more a check for the tailhook (in case we click directly in the landing light area becose clik there means all off):(A:Light landing,bool) 0 == (A:TAILHOOK POSITION,bool) 1 == if { 0 (>K:TOGGLE_TAIL_HOOK_HANDLE)}Pseudocode:If Landing Lights = 1 (on) and Tailhook = 1 (down) then: Toggle Tailhook (set tailhook up)End ifI have attached the files of the proyect (my idea is that makeing this basic, I can do it or extend it to another type as Ariane Logic -which uses for outboard landing lights the "Concorde Extend or retract visof fully"-)Hope the explanation of why this was coded this way and hope you could find the way round.By the way, the false Help_Id where going to be changed in the future ;)Helio Alberto Regalado Moreira

Share this post


Link to post
Share on other sites
Guest ridgell

email me, steven@stormlords.com

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...