| 1 | // kln89_page_*.[ch]xx - this file is one of the "pages" that |
| 2 | // are used in the KLN89 GPS unit simulation. |
| 3 | // |
| 4 | // Written by David Luff, started 2005. |
| 5 | // |
| 6 | // Copyright (C) 2005 - David C Luff - daveluff AT ntlworld.com |
| 7 | // |
| 8 | // This program is free software; you can redistribute it and/or |
| 9 | // modify it under the terms of the GNU General Public License as |
| 10 | // published by the Free Software Foundation; either version 2 of the |
| 11 | // License, or (at your option) any later version. |
| 12 | // |
| 13 | // This program is distributed in the hope that it will be useful, but |
| 14 | // WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | // General Public License for more details. |
| 17 | // |
| 18 | // You should have received a copy of the GNU General Public License |
| 19 | // along with this program; if not, write to the Free Software |
| 20 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 21 | // |
| 22 | // $Id$ |
| 23 | |
| 24 | #ifdef HAVE_CONFIG_H |
| 25 | # include "config.h" |
| 26 | #endif |
| 27 | |
| 28 | #include "kln89_page_usr.hxx" |
| 29 | |
| 30 | KLN89UsrPage::KLN89UsrPage(KLN89* parent) |
| 31 | : KLN89Page(parent) { |
| 32 | _nSubPages = 4; |
| 33 | _subPage = 0; |
| 34 | _name = "USR"; |
| 35 | } |
| 36 | |
| 37 | KLN89UsrPage::~KLN89UsrPage() { |
| 38 | } |
| 39 | |
| 40 | void KLN89UsrPage::Update(double dt) { |
| 41 | // bool actPage = (_kln89->_activePage->GetName() == "ACT" ? true : false); |
| 42 | bool crsr = (_kln89->_mode == KLN89_MODE_CRSR); |
| 43 | bool blink = _kln89->_blink; |
| 44 | |
| 45 | if(_subPage == 0) { |
| 46 | // Hardwire no-waypoint output for now |
| 47 | _kln89->DrawText("0", 2, 1, 3); |
| 48 | _kln89->DrawText("USR at:", 2, 7, 3); |
| 49 | if(!(crsr && _uLinePos == 6 && blink)) _kln89->DrawText("User Pos L/L?", 2, 1, 2); |
| 50 | if(!(crsr && _uLinePos == 7 && blink)) _kln89->DrawText("User Pos R/D?", 2, 1, 1); |
| 51 | if(!(crsr && _uLinePos == 8 && blink)) _kln89->DrawText("Present Pos?", 2, 1, 0); |
| 52 | } |
| 53 | |
| 54 | KLN89Page::Update(dt); |
| 55 | } |