77 lines
1.7 KiB
C++
77 lines
1.7 KiB
C++
/**
|
|
* @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"
|
|
|
|
MenuSysteminformation::MenuSysteminformation(Battery *mainBattery)
|
|
: MenuInformationSites(8), mainBattery{mainBattery}
|
|
{
|
|
this->noEqualLeft = true;
|
|
}
|
|
|
|
void MenuSysteminformation::printPage() const
|
|
{
|
|
String lineOne = "";
|
|
String lineTwo = "";
|
|
switch (this->getCurrentPage())
|
|
{
|
|
case 0:
|
|
lineOne = "Free Heap:";
|
|
lineTwo.concat(ESP.getFreeHeap());
|
|
break;
|
|
|
|
case 1:
|
|
lineOne = "Max alloc Heap:";
|
|
lineTwo.concat(ESP.getMaxAllocHeap());
|
|
break;
|
|
|
|
case 2:
|
|
lineOne = "Uptime in secs:";
|
|
lineTwo.concat((millis() / 1000));
|
|
break;
|
|
|
|
case 3:
|
|
lineOne = "Main battery:";
|
|
lineTwo = "";
|
|
lineTwo.concat(this->mainBattery->getBatteryPercent());
|
|
lineTwo.concat("% - V=");
|
|
lineTwo.concat(this->mainBattery->getBatteryVoltage());
|
|
break;
|
|
|
|
case 4:
|
|
lineOne = "Current WiFi";
|
|
lineTwo = "channel: ";
|
|
lineTwo.concat(Network::getCurrentChannel());
|
|
break;
|
|
|
|
case 5:
|
|
lineOne = "Software verion:";
|
|
lineTwo = VERSION;
|
|
break;
|
|
|
|
case 6:
|
|
lineOne = "Build timestamp:";
|
|
lineTwo = String(BUILD_TIMESTAMP).substring(0, 16);
|
|
break;
|
|
|
|
case 7:
|
|
lineOne = "Kleiax Rover by";
|
|
lineTwo = "Alexander Klein";
|
|
break;
|
|
|
|
default:
|
|
this->printDefault();
|
|
return;
|
|
}
|
|
|
|
this->print(lineOne, lineTwo);
|
|
}
|