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
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
flow3r
flow3r firmware
Commits
b12cd843
Commit
b12cd843
authored
1 year ago
by
q3k
Committed by
q3k
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
sim, ci: take a screenshot
parent
55086900
No related branches found
No related tags found
1 merge request
!49
sim, ci: take a screenshot
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+9
-0
9 additions, 0 deletions
.gitlab-ci.yml
sim/fakes/hardware.py
+15
-0
15 additions, 0 deletions
sim/fakes/hardware.py
sim/run.py
+5
-0
5 additions, 0 deletions
sim/run.py
with
29 additions
and
0 deletions
.gitlab-ci.yml
+
9
−
0
View file @
b12cd843
...
...
@@ -70,6 +70,15 @@ build-p6:
paths
:
[
'
build/flow3r.elf'
]
expire_in
:
5 hours
simulate
:
stage
:
build
script
:
-
python3 sim/run.py screenshot
artifacts
:
expose_as
:
'
Smulator
Screenshot'
paths
:
[
'
flow3r.png'
]
expire_in
:
5 hours
pages
:
stage
:
deploy
only
:
...
...
This diff is collapsed.
Click to expand it.
sim/fakes/hardware.py
+
15
−
0
View file @
b12cd843
...
...
@@ -2,6 +2,7 @@ import math
import
os
import
time
import
itertools
import
sys
import
pygame
...
...
@@ -15,6 +16,10 @@ bgpath = os.path.join(simpath, "background.png")
background
=
pygame
.
image
.
load
(
bgpath
)
SCREENSHOT
=
False
SCREENSHOT_DELAY
=
5
class
Input
:
"""
Input implements an input overlay (for petals or buttons) that can be
...
...
@@ -466,6 +471,16 @@ def display_update(subctx):
_sim
.
render_display
(
fb
)
_sim
.
render_gui_now
()
global
SCREENSHOT
global
SCREENSHOT_DELAY
if
SCREENSHOT
:
SCREENSHOT_DELAY
-=
1
if
SCREENSHOT_DELAY
<=
0
:
path
=
os
.
curdir
+
"
/flow3r.png
"
pygame
.
image
.
save
(
screen
,
path
)
print
(
"
Saved screenshot to
"
,
path
)
sys
.
exit
(
0
)
fbm
.
put
(
fbp
,
c
)
...
...
This diff is collapsed.
Click to expand it.
sim/run.py
+
5
−
0
View file @
b12cd843
...
...
@@ -107,4 +107,9 @@ def _stat(path):
os
.
stat
=
_stat
if
len
(
sys
.
argv
)
>=
2
and
sys
.
argv
[
1
]
==
"
screenshot
"
:
import
hardware
hardware
.
SCREENSHOT
=
True
import
main
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