Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

What am I doing worng ?

Featured Replies

I am trying to make a pitch indicator for an attitude indicator. Thats what I call it anyway, not sure if it is correct, just in case it is not called that and you lot do not know what I am talking about, working example the cessna attitude indicator click up and indicator goes up, click down and the indicator goes down. How's that for an explaination :-lol.Now for the relevant bits of code.SINT32 pitch_indicator_position = 0; FLOAT64 FSAPI pitch_position_cb( PELEMENT_MOVING_IMAGE pelement ){ return pitch_indicator_position;}MAKE_MOVING( pitch_indicator, PITCH_INDICATOR, bank_pointer_plist, attitude_fail, IMAGE_USE_TRANSPARENCY | IMAGE_USE_ERASE | BIT7, 0, 0,0, MODULE_VAR_NONE, NULL, 0, 0, MODULE_VAR_NONE, pitch_position_cb, 0, 5)PELEMENT_HEADER pitch_indicator_plist[] = {&pitch_indicator.header, NULL};BOOL FSAPI pitch_position_increase( PPIXPOINT relative_point, FLAGS32 mouse_flags ){ if (pitch_indicator_position != 5) pitch_indicator_position ++; return FALSE;}BOOL FSAPI pitch_position_decrease( PPIXPOINT relative_point, FLAGS32 mouse_flags ){ if (pitch_indicator_position != 0) pitch_indicator_position --; return FALSE;}MOUSE_CHILD_FUNCT( 89, 164, 36, 86, CURSOR_DOWNARROW, MOUSE_LEFTSINGLE, pitch_position_decrease)MOUSE_CHILD_FUNCT( 126, 164, 36, 86, CURSOR_UPARROW, MOUSE_LEFTSINGLE, pitch_position_increase)Everything shows up, but when you click for the indicator to go up, nothing happens. This is the first time I have done anything which needs more than two positions, really thought I had it worked out too :(

Tried this with MAKE_NEEDLE and it works, So the problem must be with the callback for the MAKE_MOVING.Can anyone point me in the right direction, before I pull any more hair out ?

  • Author
  • Moderator

Try using a SLIDER instead. It doesn't require a mask...Also, you haven't declared a float variable for the callback to use, so you aren't able to pass your control variable to it... ;)The following code works fine in my Electric Stby Attitude Indicator:FLOAT64 FSAPI EATD_AttBar( PELEMENT_SLIDER pelement){ FLOAT64 rwordY = pelement->source_var_y.var_value.n ; rwordY = attitude_electric_bar ; return rwordY ;}MAKE_SLIDER(EATD_Slider6,EATD_Rec8,&EATD_ElementList4,NULL, IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY | BIT7,0,69,118, MODULE_VAR_NONE,NULL, MODULE_VAR_NONE,EATD_AttBar,-8)PELEMENT_HEADER EATD_ElementList5[] = { &EATD_Slider6.header, NULL};// Mouse CallbacksBOOL FSAPI EATD_mouse_cb0( PPIXPOINT relative_point, FLAGS32 mouse_flags){ if ( attitude_electric_bar > -3 ) { attitude_electric_bar = attitude_electric_bar - 0.25 ; } (GaugePlaySound)("soundESEPclick.wav","",0) ; return FALSE;}BOOL FSAPI EATD_mouse_cb1( PPIXPOINT relative_point, FLAGS32 mouse_flags){ if ( attitude_electric_bar < 3 ) { attitude_electric_bar = attitude_electric_bar + 0.25 ; } (GaugePlaySound)("soundESEPclick.wav","",0) ; return FALSE;}

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Slight problem with using a MAKE_SLIDER, I need a mask. I thought I had sorted it earlier, realised I had not made a dummy callback for the X direction, but that still does not work. I going to try MAKE_SPRITE later, see if I have better luck with that.

  • Author
  • Moderator

>Slight problem with using a MAKE_SLIDER, I need a mask.Why do you need a mask?

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Need a mask to stop the stalk of the pitch indicator showing above the gauge bezel... wait a minute. Don't need a mask I could use a another bitmap with the bottom of the gauge bezel above the MAKE_SLIDER then the stalk would not show above the gauge bezel. It is official I am a fool :-) I will let you know how I get on.

Sorted. Changed the MAKE_MOVING to MAKE_SLIDER, kept everything else the same and it works. Thanks for the help Bill.:-beerchug

  • Author
  • Moderator

>Sorted. Changed the MAKE_MOVING to MAKE_SLIDER, kept>everything else the same and it works. >>Thanks for the help Bill.>>:-beerchugNo problem. Sometimes it helps to sort out the priorities of display......in fact, I frequently will not add the "bezel" (or anything that must "be on top") until until a final MAKE_STATIC element.BTW, just for the record, there is a default variable and associated key_events for this particular part... ;)ATTITUDE_BARS_POSITIONKEY_ATTITUDE_BARS_POSITION_INCKEY_ATTITUDE_BARS_POSITION_DECHowever, it's good to develop an alternative so that we can have independent control over the attitude calibration bars on multiple ADIs... ;)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.