added menu for systeminformation
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @file menuSysteminformatio.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains an implementation of the class MenuSysteminformation
|
||||
* @version 0.1
|
||||
* @date 2022-12-27
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#include "menuSysteminformation.h"
|
||||
|
||||
void MenuSysteminformation::printPage() const {
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
switch (this->getCurrentPage()) {
|
||||
case 0:
|
||||
lineOne = "Free Heap:";
|
||||
lineTwo.concat(ESP.getFreeHeap());
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lineOne = "Uptime in secs:";
|
||||
lineTwo.concat((millis() / 1000));
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @file menuSysteminformation.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief Contains a class to print informations about the system
|
||||
* @version 0.1
|
||||
* @date 2022-12-27
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MENU_SYSTEMINFORMATION_H
|
||||
#define MENU_SYSTEMINFORMATION_H
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "menuInformationSites.h"
|
||||
|
||||
class MenuSysteminformation : public MenuInformationSites {
|
||||
public:
|
||||
MenuSysteminformation() : MenuInformationSites(5) {}
|
||||
|
||||
private:
|
||||
void printPage() const override;
|
||||
};
|
||||
|
||||
#endif // MENU_SYSTEMINFORMATION_H
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "SpecialMenus/PID/menuPidSettings.h"
|
||||
#include "SpecialMenus/GPS/menuGPS.h"
|
||||
#include "SpecialMenus/Akku/menuAkku.h"
|
||||
#include "SpecialMenus/Systeminformation/menuSysteminformation.h"
|
||||
|
||||
MoveControl moveController;
|
||||
DriveManager* driveManager;
|
||||
@@ -281,6 +282,7 @@ void makeMenu() {
|
||||
MenuTestMode* test_m = new MenuTestMode(driveManager);
|
||||
MenuGPS* gps_m = new MenuGPS(driveManager);
|
||||
MenuAkku* akku_m = new MenuAkku(mainBattery, gamepad);
|
||||
MenuSysteminformation* sys_m = new MenuSysteminformation();
|
||||
|
||||
// Set Menus on LCD
|
||||
main_m->setLcd(lcd);
|
||||
@@ -294,6 +296,7 @@ void makeMenu() {
|
||||
test_m->setLcd(lcd);
|
||||
gps_m->setLcd(lcd);
|
||||
akku_m->setLcd(lcd);
|
||||
sys_m->setLcd(lcd);
|
||||
|
||||
|
||||
// Entry for the main menu
|
||||
@@ -303,10 +306,12 @@ void makeMenu() {
|
||||
MenuAction* restart_e = new MenuAction("Restart", restart);
|
||||
MenuAction* akku_e = new MenuAction("Battery", akku_m);
|
||||
MenuAction* contr_e = new MenuAction("Remove PS3", disconnectController);
|
||||
MenuAction* sys_e = new MenuAction("Systeminfo", sys_m);
|
||||
main_m->addEntry(mode_e);
|
||||
main_m->addEntry(gps_e);
|
||||
main_m->addEntry(pid_e);
|
||||
main_m->addEntry(akku_e);
|
||||
main_m->addEntry(sys_e);
|
||||
main_m->addEntry(contr_e);
|
||||
main_m->addEntry(restart_e);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user