Jump to content

Sign in to follow this  
Guest mattreamy

Autobrake Display

Recommended Posts

Guest mattreamy

Okay, I'm relatively new to gauge coding, but I've been working pretty steadily on the things I'm doing for a couple of weeks. I've come across a problem with the autobrake value.I'm working on an electronic checklist. It's supposed to be that if the switch is set to RTO or OFF, the function is not completed. I've been messing with this all sorts of different ways, and I've been stumped for two days on this problem.FLOAT64 FSAPI autobrake_set_cb(PELEMENT_STRING pelement){ lookup_var(&autobrake); FLOAT64 val=pelement->source_var[0].var_value.n; val=!val; wsprintf(pelement->string, "AUTOBRAKE SET"); FLOAT64 val_autobrake = autobrake.var_value.n; //14 { if(val_autobrake == 0 && val_autobrake == 1) { pelement->fg_color = RGB(255,255,255); wsprintf(pelement->string, "AUTOBRAKE SET"); } else { pelement->fg_color = RGB(0,255,0); wsprintf(pelement->string, "AUTOBRAKE SET "); } } return 0;}I've tried various ways of making that work, up to and including separate commands for each setting of the AB switch. I'm ready to shotgun my computer!Any suggestions would be appreciated. (Be kind, I'm new to this! :) )

Share this post


Link to post
Share on other sites

if(val_autobrake == 0 && val_autobrake == 1)What's wrong with the above? How will val_autobrake ever be both on and off at the same time... ;)

Share this post


Link to post
Share on other sites
Guest mattreamy

Bill:It also doesn't work if it's:if(val_autobrake != 0 && val_autobrake != 1) orif(val_autobrake != 0 && val_autobrake != 1) orif(val_autobrake > 1) orif(val_autobrake == 2 || val_autobrake == 3 || val_autobrake == 4, val_autobrake == 5) orJust about any combination. I know this is simple (I have some VB experience, so I'm familiar with program flow conrol...) ARGH is a common expression here lately, usually followed by a stream of vintage Marine Corps profanity. I've been working on this for about 2 days straight now.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...