Skip to content
Snippets Groups Projects
Commit f13e8423 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Typo: reaming -> remaining

parent a15184e8
No related branches found
No related tags found
No related merge requests found
...@@ -563,7 +563,7 @@ class ModuleBattery: Module ...@@ -563,7 +563,7 @@ class ModuleBattery: Module
{ {
string instance = section.Optional("instance")?.AsString() ?? "BAT1"; string instance = section.Optional("instance")?.AsString() ?? "BAT1";
path = section.Optional("path")?.AsPath() ?? $"/sys/class/power_supply/{instance}/uevent"; path = section.Optional("path")?.AsPath() ?? $"/sys/class/power_supply/{instance}/uevent";
format = section.Optional("format")?.AsString() ?? "{status} {derivation} {percent} {reaming}"; format = section.Optional("format")?.AsString() ?? "{status} {derivation} {percent} {remaining}";
timeWindow_ms = section.Optional("time_window")?.AsMs() ?? 60000; timeWindow_ms = section.Optional("time_window")?.AsMs() ?? 60000;
shortFormat = section.Optional("short_format")?.AsString(); shortFormat = section.Optional("short_format")?.AsString();
} }
...@@ -584,7 +584,7 @@ class ModuleBattery: Module ...@@ -584,7 +584,7 @@ class ModuleBattery: Module
long? timeDelta_ms = null; long? timeDelta_ms = null;
int? energyDelta = null; int? energyDelta = null;
double? percentPerHour = null; double? percentPerHour = null;
long? reamingTime_s = null; long? remainingTime_s = null;
if(lastStatus != status) if(lastStatus != status)
history.Clear(); history.Clear();
...@@ -597,9 +597,9 @@ class ModuleBattery: Module ...@@ -597,9 +597,9 @@ class ModuleBattery: Module
var derivationEnergy = energyDelta/(double)timeDelta_ms; var derivationEnergy = energyDelta/(double)timeDelta_ms;
percentPerHour = derivationEnergy * 1000 * 60 * 60 / energyDesign * 100; percentPerHour = derivationEnergy * 1000 * 60 * 60 / energyDesign * 100;
if(derivationEnergy > 0) if(derivationEnergy > 0)
reamingTime_s = (long)((energyFull-energyNow)/derivationEnergy/1000); remainingTime_s = (long)((energyFull-energyNow)/derivationEnergy/1000);
if(derivationEnergy < 0) if(derivationEnergy < 0)
reamingTime_s = (long)((energyNow)/-derivationEnergy/1000); remainingTime_s = (long)((energyNow)/-derivationEnergy/1000);
} }
history.Enqueue(new HistoryElement(t, energyNow)); history.Enqueue(new HistoryElement(t, energyNow));
...@@ -613,7 +613,7 @@ class ModuleBattery: Module ...@@ -613,7 +613,7 @@ class ModuleBattery: Module
if(x == "status") return (status.Length > 3 ? status[0..3] : status); if(x == "status") return (status.Length > 3 ? status[0..3] : status);
if(x == "percent") return percent.ToString("N2"); if(x == "percent") return percent.ToString("N2");
if(x == "derivation") return percentPerHour?.ToString("N2") ?? ""; if(x == "derivation") return percentPerHour?.ToString("N2") ?? "";
if(x == "reaming") return reamingTime_s == null ?"": TimeShow.Show(reamingTime_s.Value); if(x == "remaining") return remainingTime_s == null ?"": TimeShow.Show(remainingTime_s.Value);
return "UNDEF"; return "UNDEF";
}).Trim(); }).Trim();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment