moved battery information in systeminformation
This commit is contained in:
@@ -11,6 +11,12 @@
|
||||
|
||||
#include "menuSysteminformation.h"
|
||||
|
||||
MenuSysteminformation::MenuSysteminformation(Battery* mainBattery, Ps3Controller* gamepad)
|
||||
: MenuInformationSites(5) {
|
||||
this->mainBattery = mainBattery;
|
||||
this->gamepad = gamepad;
|
||||
}
|
||||
|
||||
void MenuSysteminformation::printPage() const {
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
@@ -25,10 +31,34 @@ void MenuSysteminformation::printPage() const {
|
||||
lineTwo.concat((millis() / 1000));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lineOne = "Main battery:";
|
||||
lineTwo = "";
|
||||
lineTwo.concat(this->mainBattery->getBatteryPercent());
|
||||
lineTwo.concat("% V=");
|
||||
lineTwo.concat(this->mainBattery->getBatteryVoltage());
|
||||
break;
|
||||
|
||||
case 3:
|
||||
lineOne = "PS3 battery";
|
||||
lineTwo = "is ";
|
||||
MenuSysteminformation::ps3ToString(this->gamepad->data.status.battery);
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
}
|
||||
|
||||
String MenuSysteminformation::ps3ToString(uint8_t battery) {
|
||||
if( battery == ps3_status_battery_charging ) return "LOAD";
|
||||
else if( battery == ps3_status_battery_full ) return "FULL";
|
||||
else if( battery == ps3_status_battery_high ) return "HIGH";
|
||||
else if( battery == ps3_status_battery_low) return "LOW";
|
||||
else if( battery == ps3_status_battery_dying ) return "BAD";
|
||||
else if( battery == ps3_status_battery_shutdown ) return "OFF";
|
||||
else return "UNDEF";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user