Sign in to follow this  
Guest mattreamy

Autobrake Display

Recommended Posts

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
Help AVSIM continue to serve you!
Please donate today!

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

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

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