//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#include "kln89_symbols.hxx"
#include <iostream>
-#include <ATC/ATCProjection.hxx>
+#include <ATCDCL/ATCProjection.hxx>
+#include <Main/fg_props.hxx>
#include <simgear/math/point3d.hxx>
+#include "Airports/simple.hxx"
-SG_USING_STD(cout);
+using std::cout;
KLN89::KLN89(RenderArea2D* instrument)
: DCLGPS(instrument) {
void KLN89::CrsrPressed() {
_dispMsg = false;
- if(_activePage == _nrst_page) return; // CRSR cannot be switched off on nrst page.
+ // CRSR cannot be switched off on nrst page.
+ if(_activePage == _nrst_page) { return; }
+ // CRSR is always off when inner-knob is out on nav4 page.
+ if(_curPage == 6 && _activePage->GetSubPage() == 3 && fgGetBool("/instrumentation/kln89/scan-pull")) { return; }
if(_cleanUpPage >= 0) {
_pages[(unsigned int)_cleanUpPage]->CleanUp();
_cleanUpPage = -1;
} else {
_dir_page->SetId(_activeWaypoint.id);
}
- // } else if(_curPage == 6 && _nav_page->GetSubPage() == 3 && 0) {
+ } else if(_curPage == 6 && _activePage->GetSubPage() == 3 && fgGetBool("/instrumentation/kln89/scan-pull") && _activeFP->waypoints.size()) {
// NAV 4
- // TODO
- // The && 0 should be && outer knob is out.
+ _dir_page->SetId(((KLN89NavPage*)_activePage)->GetNav4WpId());
} else if(_curPage == 7 && _activePage->GetSubPage() == 0 && _mode == KLN89_MODE_CRSR) {
//cout << "Checking the fpl page!\n";
// FPL 0
} else {
_dir_page->SetId(_activeWaypoint.id);
}
- // This need to come after the bit before otherwise the FPL page clears it's current ID when it looses focus.
+ // This need to come after the bit before otherwise the FPL or NAV4 page clears their current ID when it looses focus.
_activePage->LooseFocus();
_activePage = _dir_page;
_mode = KLN89_MODE_CRSR;
// Annotation then gets drawn by Nav page, NOT this function.
if(_drawApt && draw_avs) {
- airport_list apt;
/*
bool have_apt = _overlays->FindArpByRegion(&apt, bottomLeft.lat(), bottomLeft.lon(), topRight.lat(), topRight.lon());
//cout << "Vors enclosed are: ";
// Draw an airport or waypoint label on the moving map
// Specify position by the map pixel co-ordinate of the left or right, bottom, of the *visible* portion of the label.
// The black background quad will automatically overlap this by 1 pixel.
-void KLN89::DrawLabel(string s, int x1, int y1, bool right_align) {
+void KLN89::DrawLabel(const string& s, int x1, int y1, bool right_align) {
MapToInstrument(x1, y1);
if(!right_align) {
for(unsigned int i=0; i<s.size(); ++i) {