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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
d6dc694d
Commit
d6dc694d
authored
2 years ago
by
iggy
Browse files
Options
Downloads
Patches
Plain Diff
debugging ctx crash
parent
6a811c0d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
python_payload/application.py
+2
-2
2 additions, 2 deletions
python_payload/application.py
python_payload/ui.py
+17
-2
17 additions, 2 deletions
python_payload/ui.py
with
19 additions
and
4 deletions
python_payload/application.py
+
2
−
2
View file @
d6dc694d
...
@@ -121,7 +121,7 @@ class Application():
...
@@ -121,7 +121,7 @@ class Application():
e
.
set_enabled
(
enabled
)
e
.
set_enabled
(
enabled
)
def
on_init
(
self
):
def
on_init
(
self
):
print
(
"
nothing
"
)
print
(
"
nothing
to init
"
)
pass
pass
def
on_foreground
(
self
):
def
on_foreground
(
self
):
...
@@ -137,7 +137,7 @@ class Application():
...
@@ -137,7 +137,7 @@ class Application():
pass
pass
def
main_foreground
(
self
):
def
main_foreground
(
self
):
print
(
"
nothing
"
)
#
print("nothing")
pass
pass
def
main_always
(
self
):
def
main_always
(
self
):
...
...
This diff is collapsed.
Click to expand it.
python_payload/ui.py
+
17
−
2
View file @
d6dc694d
...
@@ -4,6 +4,9 @@ import math
...
@@ -4,6 +4,9 @@ import math
import
time
import
time
from
math
import
sin
,
cos
,
pi
from
math
import
sin
,
cos
,
pi
import
micropython
import
gc
WIDTH
=
240
WIDTH
=
240
HEIGHT
=
240
HEIGHT
=
240
...
@@ -76,6 +79,7 @@ class Icon(UIElement):
...
@@ -76,6 +79,7 @@ class Icon(UIElement):
super
().
__init__
()
super
().
__init__
()
def
_draw
(
self
,
pos
):
def
_draw
(
self
,
pos
):
print
(
"
ui.Icon._draw()
"
)
x
=
int
(
pos
[
0
])
x
=
int
(
pos
[
0
])
y
=
int
(
pos
[
1
])
y
=
int
(
pos
[
1
])
...
@@ -89,6 +93,8 @@ class Icon(UIElement):
...
@@ -89,6 +93,8 @@ class Icon(UIElement):
y
-
hs
/
2
,
y
-
hs
/
2
,
hs
,
hs
,
hs
//
2
hs
,
hs
,
hs
//
2
).
fill
()
).
fill
()
print
(
"
arc
"
)
self
.
ctx
.
move_to
(
x
,
y
).
rgb
(
self
.
bg_r
,
self
.
bg_g
,
self
.
bg_b
).
arc
(
x
,
y
,
self
.
size
/
2
,
-
math
.
pi
,
math
.
pi
,
True
).
fill
()
self
.
ctx
.
move_to
(
x
,
y
).
rgb
(
self
.
bg_r
,
self
.
bg_g
,
self
.
bg_b
).
arc
(
x
,
y
,
self
.
size
/
2
,
-
math
.
pi
,
math
.
pi
,
True
).
fill
()
#self.ctx.move_to(x,y-self.size/2).rgb(self.bg_r,self.bg_g,self.bg_b).
#self.ctx.move_to(x,y-self.size/2).rgb(self.bg_r,self.bg_g,self.bg_b).
#.round_rectangle(
#.round_rectangle(
...
@@ -96,8 +102,17 @@ class Icon(UIElement):
...
@@ -96,8 +102,17 @@ class Icon(UIElement):
# y-self.size/2,
# y-self.size/2,
# self.size,self.size,self.size//2
# self.size,self.size,self.size//2
#).fill()
#).fill()
self
.
ctx
.
rgb
(
1
,
1
,
1
).
move_to
(
x
,
y
).
text
(
self
.
label
)
micropython
.
mem_info
()
gc
.
collect
()
print
(
self
.
label
)
self
.
ctx
.
rgb
(
1
,
1
,
1
).
move_to
(
x
,
y
)
micropython
.
mem_info
(
"
data
"
)
print
(
"
moved
"
)
print
(
"
crash here:
"
)
self
.
ctx
.
text
(
self
.
label
)
print
(
"
text
"
)
class
IconValue
(
Icon
):
class
IconValue
(
Icon
):
def
__init__
(
self
,
value
=
0
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
value
=
0
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
super
().
__init__
(
*
args
,
**
kwargs
)
...
...
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