Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Woazboat
flow3r firmware
Commits
b5e4f3d4
Commit
b5e4f3d4
authored
1 year ago
by
q3k
Browse files
Options
Downloads
Patches
Plain Diff
py: add battery voltage to debug overlay
parent
23f45596
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python_payload/st3m/run.py
+1
-0
1 addition, 0 deletions
python_payload/st3m/run.py
python_payload/st3m/ui/elements/overlays.py
+12
-0
12 additions, 0 deletions
python_payload/st3m/ui/elements/overlays.py
with
13 additions
and
0 deletions
python_payload/st3m/run.py
+
1
−
0
View file @
b5e4f3d4
...
...
@@ -75,6 +75,7 @@ def _make_compositor(reactor: Reactor, vm: ViewManager) -> overlays.Compositor:
# Configure debug overlay fragments.
debug
=
overlays
.
OverlayDebug
()
debug
.
add_fragment
(
overlays
.
DebugReactorStats
(
reactor
))
debug
.
add_fragment
(
overlays
.
DebugBattery
())
compositor
.
add_overlay
(
debug
)
debug_touch
=
overlays
.
OverlayCaptouch
()
...
...
This diff is collapsed.
Click to expand it.
python_payload/st3m/ui/elements/overlays.py
+
12
−
0
View file @
b5e4f3d4
...
...
@@ -10,6 +10,7 @@ from st3m import Responder, InputState, Reactor
from
st3m.goose
import
Dict
,
Enum
,
List
,
ABCBase
,
abstractmethod
,
Optional
from
st3m.utils
import
tau
from
st3m.ui.view
import
ViewManager
from
st3m.input
import
power
from
ctx
import
Context
import
math
...
...
@@ -122,6 +123,17 @@ class DebugReactorStats(DebugFragment):
return
"
"
.
join
(
res
)
class
DebugBattery
(
DebugFragment
):
"""
DebugFragment which provides the OverlayDebug with information about the
battery voltage.
"""
def
text
(
self
)
->
str
:
v
=
power
.
battery_voltage
return
f
"
bat:
{
v
:
.
2
f
}
V
"
class
OverlayDebug
(
Overlay
):
"""
Overlay which renders a text bar at the bottom of the screen with random
...
...
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