Check if battery status is full

mangoapp-fpslimit
Alessandro Toia 2 years ago
parent 17867f2a6d
commit 056f7b0e29

@ -104,7 +104,7 @@ float BatteryStats::getPower() {
state[i]=current_status; state[i]=current_status;
} }
if (state[i] == "Charging" || state[i] == "Unknown") { if (state[i] == "Charging" || state[i] == "Unknown" || state[i] == "Full") {
return 0; return 0;
} }
@ -171,7 +171,7 @@ float BatteryStats::getTimeRemaining(){
if (current_now_vec.size() > 25) if (current_now_vec.size() > 25)
current_now_vec.erase(current_now_vec.begin()); current_now_vec.erase(current_now_vec.begin());
} }
for(auto& current_now : current_now_vec){ for(auto& current_now : current_now_vec){
current += current_now; current += current_now;
} }

@ -722,7 +722,7 @@ void HudElements::battery(){
ImGui::SameLine(0,1.0f); ImGui::SameLine(0,1.0f);
ImGui::Text("%%"); ImGui::Text("%%");
} }
if (Battery_Stats.current_watt > 1.f) { if (Battery_Stats.current_watt != 0) {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width, "%.1f", Battery_Stats.current_watt); right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width, "%.1f", Battery_Stats.current_watt);
ImGui::SameLine(0,1.0f); ImGui::SameLine(0,1.0f);

Loading…
Cancel
Save