Jump to content

Dcs-bios check state for if-function


outbaxx

Recommended Posts

Hi guys, I need some help.
 
The issue:
The AJS37 Viggen destination indicator show letters with different colors depending on in what state the mode selector is in.
But the output is the same, for example, in Nav-mode “M” is shown in white, and in Spa-mode “M” is shown in red, but both outputs are “M”.
 
So I need to see if the mode selector is in SPA and then set the color red in my display.
 
But I don’t know how to check that.
 
Anyone who knows?
 
Regards
F

Link to comment
Share on other sites

Change your documentation reference to advanced and look at the output for the master mode selector. You can check the output when you change position with this: 

 

void onMasterModeSelectChange(unsigned int newValue) {
    /* your code here */
}
DcsBios::IntegerBuffer masterModeSelectBuffer(0x4614, 0xe000, 13, onMasterModeSelectChange);

 

 


Edited by DeadMeat
Link to comment
Share on other sites

You beat me to it @DeadMeat XD

 

If you've not used this format before, outbaxx, you put in your code in the /*your code here*/  section, where you can output the right colour to your display using the library commands relevant to your display.  The variable 'newValue' is how DCS reports the state back to you.  See the documentation in DCS-BIOS to understand what is returned for each state (or do some experimentation with DCS and output the 'newValue' variable to either your screen or the serial monitor.


Edited by CorporalCarrot
Link to comment
Share on other sites

Change your documentation reference to advanced and look at the output for the master mode selector. You can check the output when you change position with this: 
 
void onMasterModeSelectChange(unsigned int newValue) {
    /* your code here */
}
DcsBios::IntegerBuffer masterModeSelectBuffer(0x4614, 0xe000, 13, onMasterModeSelectChange);
 
 

Of course, I can do that check there and set a value to an int/bool and use that in the other function, I’ve done similar in another sketch, but now I got stuck in another thought.
Thank Guys!!

Regards
F
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...