Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
I3csstatus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
I3csstatus
Commits
f13e8423
Commit
f13e8423
authored
2 years ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
Typo: reaming -> remaining
parent
a15184e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Module.cs
+5
-5
5 additions, 5 deletions
Module.cs
with
5 additions
and
5 deletions
Module.cs
+
5
−
5
View file @
f13e8423
...
@@ -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} {re
a
ming}"
;
format
=
section
.
Optional
(
"format"
)?.
AsString
()
??
"{status} {derivation} {percent} {rem
ain
ing}"
;
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
?
re
a
mingTime_s
=
null
;
long
?
rem
ain
ingTime_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
)
re
a
mingTime_s
=
(
long
)((
energyFull
-
energyNow
)/
derivationEnergy
/
1000
);
rem
ain
ingTime_s
=
(
long
)((
energyFull
-
energyNow
)/
derivationEnergy
/
1000
);
if
(
derivationEnergy
<
0
)
if
(
derivationEnergy
<
0
)
re
a
mingTime_s
=
(
long
)((
energyNow
)/-
derivationEnergy
/
1000
);
rem
ain
ingTime_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
==
"re
a
ming"
)
return
re
a
mingTime_s
==
null
?
""
:
TimeShow
.
Show
(
re
a
mingTime_s
.
Value
);
if
(
x
==
"rem
ain
ing"
)
return
rem
ain
ingTime_s
==
null
?
""
:
TimeShow
.
Show
(
rem
ain
ingTime_s
.
Value
);
return
"UNDEF"
;
return
"UNDEF"
;
}).
Trim
();
}).
Trim
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment