Release 1.01
Diff: Menu.cpp
- Revision:
- 5:9f4d4f8ffc00
- Parent:
- 4:7226c43320b5
- Child:
- 7:d8673bb9fb6f
diff -r 7226c43320b5 -r 9f4d4f8ffc00 Menu.cpp --- a/Menu.cpp Thu Sep 12 11:27:50 2019 +0000 +++ b/Menu.cpp Tue Sep 17 13:48:22 2019 +0000 @@ -1,15 +1,41 @@ +/************************************************************************** + * @file Menu.h + * @brief Base class for wrapping the interface with LCD Menu display + * @version: V1.0 + * @date: 9/17/2019 + + * + * @note + * Copyright (C) 2019 E3 Design. All rights reserved. + * + * @par + * E3 Designers LLC is supplying this software for use with Cortex-M3 LPC1768 + * processor based microcontroller for the ESCM 2000 Monitor and Display. + * * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR + * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + ******************************************************************************/ + #include "mbed.h" #include "Menu.h" #include "ESCMControlApp.h" +/******************************************************************************/ Menu* Menu::currentMenu = NULL; +/******************************************************************************/ Menu * Menu::getCurrentMenu () { return currentMenu; } +/******************************************************************************/ Menu * Menu::setCurrentMenu (Menu * value) { @@ -20,6 +46,7 @@ } +/******************************************************************************/ Menu::Menu(char *id) : menuID(id), parent(NULL),update_needed(1) { children.clear(); @@ -28,6 +55,7 @@ update_needed = 1; } +/******************************************************************************/ void Menu::add(Menu *submenu) { submenu->parent = this; @@ -35,17 +63,20 @@ } +/******************************************************************************/ void Menu::init() { update_needed=1; } +/******************************************************************************/ void Menu::select(void) { Menu::setCurrentMenu ( children[selectedMenu]) ; } +/******************************************************************************/ void Menu::back() { if (parent != NULL ) @@ -57,6 +88,8 @@ printf("ERROR: missing parent "); } } + +/******************************************************************************/ void Menu::DrawDisplay(LCD * lcd) { this->lcd = lcd; @@ -81,6 +114,7 @@ } +/******************************************************************************/ void Menu::display(LCD * lcd) { static int top = 1; @@ -140,6 +174,7 @@ } +/******************************************************************************/ void Menu::moveUp() { @@ -157,7 +192,7 @@ update_needed = 1; } - +/******************************************************************************/ void Menu::moveDown() { cursorLine++; @@ -175,31 +210,37 @@ } +/******************************************************************************/ void Menu::pressMode() { select(); } +/******************************************************************************/ void Menu::pressSet() { select(); } +/******************************************************************************/ void Menu::pressUp() { moveUp(); } +/******************************************************************************/ void Menu::pressDown() { moveDown(); } +/******************************************************************************/ void Menu::pressClear() { back(); } +/******************************************************************************/ void Menu::displayVersion (LCD * lcd) { @@ -207,9 +248,10 @@ lcd->locate(3,35); lcd->printf("v0.01"); } +/******************************************************************************/ void Menu::displayCurrentTime (LCD * lcd) { - + #if 1 time_t rawtime; struct tm * timeinfo; @@ -230,5 +272,6 @@ lcd->locate(1,33); lcd->printf("Addr=%02d",escmController.cur_address); - + #endif } +/******************************************************************************/