1
0
Fork 0

KLN89: Allow user to set default first char of waypoint as per real life unit.

This commit is contained in:
Dave Luff 2010-12-06 22:50:37 +00:00
parent 59a22860ff
commit e6aea6dcde
4 changed files with 27 additions and 2 deletions

View file

@ -228,6 +228,7 @@ KLN89::KLN89(RenderArea2D* instrument)
_suaAlertEnabled = false;
_altAlertEnabled = false;
_minDisplayBrightness = 4;
_defaultFirstChar = 'A';
// Mega-hack - hardwire airport town and state names for the FG base area since we don't have any data for these at the moment
// TODO - do this better one day!

View file

@ -302,6 +302,7 @@ private:
bool _suaAlertEnabled; // Alert user to potential SUA entry
bool _altAlertEnabled; // Alert user to min safe alt violation
int _minDisplayBrightness; // Minimum display brightness in low light.
char _defaultFirstChar; // Default first waypoint character.
};
#endif // _KLN89_HXX

View file

@ -1013,7 +1013,11 @@ void KLN89FplPage::Knob2Left1() {
} else if(appWp) {
ShowScratchpadMessage("Invald", " Add ");
} else {
if((_wLinePos + 1) > _entWpStr.size()) {
if(!_entWpStr.size()) {
_entWpStr += _kln89->DecChar(_kln89->_defaultFirstChar, false, true);
} else if((_wLinePos + 1) > _entWpStr.size()) {
// I don't think we can ever reach this state since I think it only ever applies to the
// first char and gets caught by the line above, but it can stay for now just in case.
_entWpStr += '9';
} else {
_entWpStr[_wLinePos] = _kln89->DecChar(_entWpStr[_wLinePos], (_wLinePos == 0 ? false : true));
@ -1093,7 +1097,11 @@ void KLN89FplPage::Knob2Right1() {
} else if(appWp) {
ShowScratchpadMessage("Invald", " Add ");
} else {
if((_wLinePos + 1) > _entWpStr.size()) {
if(!_entWpStr.size()) {
_entWpStr += _kln89->_defaultFirstChar;
} else if((_wLinePos + 1) > _entWpStr.size()) {
// I don't think we can ever reach this state since I think it only ever applies to the
// first char and gets caught by the line above, but it can stay for now just in case.
_entWpStr += 'A';
} else {
_entWpStr[_wLinePos] = _kln89->IncChar(_entWpStr[_wLinePos], (_wLinePos == 0 ? false : true));

View file

@ -76,6 +76,14 @@ void KLN89SetPage::Update(double dt) {
_kln89->DrawText("Character of", 2, 1, 2);
_kln89->DrawText("Wpt identifier", 2, 0, 1);
_kln89->DrawText("Entry:", 2, 3, 0);
if(_kln89->_mode == KLN89_MODE_CRSR && _uLinePos == 1) {
if(!_kln89->_blink) {
_kln89->DrawChar(_kln89->_defaultFirstChar, 2, 10, 0);
}
_kln89->Underline(2, 10, 0, 1);
} else {
_kln89->DrawChar(_kln89->_defaultFirstChar, 2, 10, 0);
}
break;
case 6:
_kln89->DrawText("NEAREST APT", 2, 1, 3);
@ -203,6 +211,7 @@ void KLN89SetPage::CrsrPressed() {
_maxULinePos = 1;
break;
case 5:
_maxULinePos = 1;
break;
case 6:
_maxULinePos = 2;
@ -241,6 +250,9 @@ void KLN89SetPage::Knob2Left1() {
}
break;
case 5:
if(_uLinePos == 1) {
_kln89->_defaultFirstChar = _kln89->DecChar(_kln89->_defaultFirstChar, false, true);
}
break;
case 6:
break;
@ -287,6 +299,9 @@ void KLN89SetPage::Knob2Right1() {
}
break;
case 5:
if(_uLinePos == 1) {
_kln89->_defaultFirstChar = _kln89->IncChar(_kln89->_defaultFirstChar, false, true);
}
break;
case 6:
break;