Jump to content
Sign in to follow this  

Recommended Posts

Gentlemen ,I definitively will not insist in doing this gauge , nothing goes right .thanks gurus .Alberto Kunzel

Share this post


Link to post
Share on other sites

Hi Jan ,In spite of to stop trying with this gauge I got a good XML editor and went ahead .So , yesterday I could have it working and got the following : 00017 0+ 0000017 ft is the altitude of the plane , which change with the change of the plane's altitude , the altitude in the original AP change when I click in this new gauge and that's it .No action or change happens in the VS neither in the new gauge nor in the original AP .Please some comments . The program is like you wrote and is above .Thanks and regards ,Alberto Kunzel

Share this post


Link to post
Share on other sites

Hi,What is 0+ 00 ?OK, give again the whole code.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Jan ,Here is the code .0+ 00 appears as I indicated in my previous email , that should be VS , I suppose .- - - %((A:indicated altitude,feet) 0 max)%!05.0f!- - %((A:vert speed,ft/min) 0 <)%{if}-%{else}+ %((AUTOPILOT_VERTICAL_HOLD_VAR,ft/min))%!04f!- - (A:AUTOPILOT ALTITUDE LOCK,bool) - - - - (A:AUTOPILOT MASTER,bool) - - - - - Decrease Alt(>K:AP_ALT_VAR_DEC)- Increase Alt(>K:AP_ALT_VAR_INC)- Decrease VS( A : Indicated Altitude, feet) 1000 > if { ( L: vert speed,number) 50 - -6000 max (L:vert speed,number)(L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH)}els{ (L:vert speed,number) 100 - -6000 max (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) }- Increase VS(A:Indicated Altitude, feet) 1000 >{ (L:vert speed,number) 50 + 6000 min (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) } els{ (L:vert speed,number) 100 + 6000 min (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) }- - RegardsAlberto Kunzel

Share this post


Link to post
Share on other sites

OK, again a lot of "spaces problem".I changed this one:%((A:vert speed,ft/min) 0 <)%{if}-%{else}+%{end} %((AUTOPILOT_VERTICAL_HOLD_VAR,ft/min))%!d!And the VS click:Decrease VS(A:Indicated Altitude,feet) 1000 < if{ (L:vert speed,number) 50 - -6000 max (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) } els{ (L:vert speed,number) 100 - -6000 max (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) } Increase VS(A:Indicated Altitude,feet) 1000 < if{ (L:vert speed,number) 50 + 6000 min (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) } els{ (L:vert speed,number) 100 + 6000 min (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) } Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi Jan,The gauge is working but still in steps of 100ft instead of 50ft .Any comments ?Thanks and regardsAlberto Kunzel

Share this post


Link to post
Share on other sites

Yes, this if statement:(A:Indicated Altitude,feet) 1000 < if{ "code to increment by 50" }else { "code to increment by 100" }The first condition to "increment by 50" will only work if the current altitude is less than 1000'!!!From the code, it would appear that you want it to increment by 50' if the aircraft is below 6000'...Change the code to reflect that:(A:Indicated Altitude,feet) 6000 < if{ Or, did you actually want 10,000'??? Most aircraft will climb through the first 1000' in mere seconds, so your "increment by 50'" will NEVER get executed!


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Hi Bill ,What I need is that the VS have increments and decrements of 50 ft in altitude below 1000 ft , as in real Boeing 737.RgdsAlberto Kunzel

Share this post


Link to post
Share on other sites

Hi Bill ,Sorry I did a big mistake since my first post .What I need is a gauging with the VS increments and decrements of 50 ft while the VS is below 1000ft/min . There is nothing concerning with the Altitude .May be now is easier.Thanks if you can help me.RegardsAlberto Kunzel

Share this post


Link to post
Share on other sites

Try:(L:vert speed,number) abs 1000 < if{ (L:vert speed,number) 50 - -1000 max (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) } els{ (L:vert speed,number) 100 - -6000 max (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) } (L:vert speed,number) abs 1000 < if{ (L:vert speed,number) 50 + 1000 min (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) } els{ (L:vert speed,number) 100 + 6000 min (>L:vert speed,number) (L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) } Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

>Hi Bill ,>>Sorry I did a big mistake since my first post .>>What I need is a gauging with the VS increments and decrements>of 50 ft while the VS is below 1000ft/min . There is nothing>concerning with the Altitude .>>May be now is easier.>>Thanks if you can help me.Yes, that certainly makes a LOT of difference! ;)I see Jan beat me to the punch already... but, at least my question caused you to correct the error, and explained WHY you were never going to see VS changing in 50 fpm steps... *:-* On re-reading the entire thread, I cannot help but note that Tom (taquillo) grasped what you had INTENDED in his first reply:*VS UP*(L:AP Vertical Speed,feet per minute) 50 + 6000 mind (>L:AP Vertical Speed,feet per minute)(>K:AP_VS_VAR_SET_ENGLISH)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Bill,Just for the record, this example shows an optimized version with the use of registers and bool maths, everything on the same stack's space,with lack of if/els jumps: (L:vert speed,number) s0 l0 1000 < s1 50 * l1 ! 100 * + + 6000 min d (>L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) (L:vert speed,number) s0 l0 1000 < s1 50 * l1 ! 100 * + - -6000 max d (>L:vert speed,number) (K:AP_VS_VAR_SET_ENGLISH) TomPD: My nick is "taguilo" (with a single l) but I understand that drinkink too much of Gmax and C++ makes you read it with "ll":-lol :-lol

Share this post


Link to post
Share on other sites

Tequila,This is a beautiful formula.Can you give a translation Tom?Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Jan,The basic idea is to take advantadge of autoexcluding boolean conditions."(L:vert speed,number) s0" ---> this is well known, value is saved to a register without remove. "l0 1000 < s1" ---> vert speed is compared to be lower than 1000, the result (0 or 1) is saved in another register without being removed from the stack as well." 50 *" ---> that logic result is then multiplied by 50, giving a value of 50 if it is true (1) or 0 if false (value >= 1000)"l1 ! 100 *" ---> Now, the saved bool result from the former comparison is negated (inverted) and multiplied by 100 to give a value of 100 if the original comparison (l0 1000 < ) is false, which means l0 MUST be 1000 >=, or 0 otherwise. "+ +" --> Here, both (50*bool) and (100*bool) are added to obtain a unique value to be added to or subtracted from the original vert speed val. Is is clear that the result can only be (vert speed var) plus/minus 50 or 100 Rest is well known.Indeed there is a flaw in the formula as is, but easy to correct: "l0 abs 1000 < s1" should be the proper comparison.Salud, chamaco! :-beerchug Tom

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