Clean up battery.{h,cpp} header includes

pull/595/head
jackun 3 years ago
parent 866fd8bc24
commit c79e01830d
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -1,9 +1,9 @@
#include <stdio.h>
#include "battery.h"
#include <filesystem.h>
#include <spdlog/spdlog.h>
#include <filesystem.h>
#include "battery.h"
namespace fs = ghc::filesystem;
using namespace std;
void BatteryStats::numBattery() {
int batteryCount = 0;
@ -22,12 +22,11 @@ void BatteryStats::numBattery() {
batt_check = true;
}
void BatteryStats::update() {
if (!batt_check) {
numBattery();
if (batt_count == 0) {
SPDLOG_ERROR("No battery found");
SPDLOG_INFO("No battery found");
}
}
@ -59,7 +58,6 @@ float BatteryStats::getPercent()
if(std::getline(input2, line)) {
charge_f += (stof(line) / 1000000);
}
}
else if (fs::exists(energy_now)) {
@ -72,7 +70,6 @@ float BatteryStats::getPercent()
if(std::getline(input2, line)) {
charge_f += (stof(line) / 1000000);
}
}
else {

@ -1,10 +1,5 @@
#pragma once
#include "overlay.h"
#include "overlay_params.h"
#include <logging.h>
#include <vector>
#include <unordered_map>
#include <filesystem.h>
#include <string>
class BatteryStats{
public:
@ -12,11 +7,11 @@ class BatteryStats{
void update();
float getPower();
float getPercent();
string battPath[2];
std::string battPath[2];
float current_watt = 0;
float current_percent = 0;
string current_status="";
string state [2];
std::string current_status;
std::string state [2];
int batt_count=0;
bool batt_check = false;

Loading…
Cancel
Save