Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
skyglow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kr69sugu
skyglow
Commits
86a04205
Commit
86a04205
authored
4 years ago
by
kr69sugu
Browse files
Options
Downloads
Patches
Plain Diff
add dmx_data_received listener and log error if none is received
parent
84dbf6a1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
skyglow.py
+10
-2
10 additions, 2 deletions
skyglow.py
with
10 additions
and
2 deletions
skyglow.py
+
10
−
2
View file @
86a04205
...
...
@@ -18,8 +18,9 @@ import sys
# # # # # # #
FAIL_DMX
=
3
FAIL_DMX_SEND
=
4
FAIL_LOG
=
5
FAIL_MOON
=
6
FAIL_DMX_RECEIVE
=
5
FAIL_LOG
=
6
FAIL_MOON
=
7
# either fullpath or just name (then logFile will be created in scriptdir)
# or fullpath containing '/'
...
...
@@ -31,6 +32,7 @@ moonDmx=0
#dmx setup
wrapper
=
None
UNIVERSE
=
10
dmxDataReceived
=
False
MAX_DMX_FRAME_SIZE
=
512
...
...
@@ -237,6 +239,8 @@ def dmxSent(status):
else
:
log
(
'
\t
'
+
str
(
moonLux
)
+
"
\t
"
+
str
(
moonDmx
)
+
"
\t
"
+
str
(
skyglow
))
def
dmxReceive
(
data
):
print
(
"
Dmx, data received:
"
+
data
)
def
main
(
args
=
""
):
...
...
@@ -285,10 +289,14 @@ def main(args=""):
client
=
wrapper
.
Client
()
# send 1 dmx frame with values for channels 1-3 for all ecounits
client
.
SendDmx
(
UNIVERSE
,
data
,
dmxSent
)
client
.
RegisterUniverse
(
UNIVERSE
,
client
.
REGISTER
,
dmxReceive
)
wrapper
.
Run
()
except
Exception
as
e
:
error
(
FAIL_DMX
,
e
)
if
not
dmxDataReceived
:
error
(
FAIL_DMX_RECEIVE
)
if
__name__
==
'
__main__
'
:
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