Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VISCA Over IP
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
Container registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amalio Coron
VISCA Over IP
Commits
9955333e
Commit
9955333e
authored
6 years ago
by
Pierre Minssen
Browse files
Options
Downloads
Patches
Plain Diff
Update cam_poo.py
parent
7aa6b9ee
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cam_poo.py
+39
-3
39 additions, 3 deletions
cam_poo.py
with
39 additions
and
3 deletions
cam_poo.py
+
39
−
3
View file @
9955333e
...
...
@@ -15,7 +15,7 @@ class Camera:
# nouvelle coordonnée réelle après itération
return
[
payloadtype
,
payload
]
def
payload2message
(
self
,
payloadL
:
list
)
->
hex
def
payload2message
(
self
,
payloadL
:
list
)
->
string
#
hex
payloadtype
=
payload
[
0
]
payload
=
payloadL
[
1
]
payloadlenght
=
"
0F
"
# a coder
...
...
@@ -24,3 +24,39 @@ class Camera:
message
=
header
+
payload
return
message
def
send
(
self
,
message
:
string
):
->
bool
sock
.
sendto
(
bytes
.
fromhex
(
message
.
replace
(
'
'
,
''
)),(
UDP_IP
,
UDP_PORT
))
self
.
seq_num
+=
1
#ballec de l'hexa pour l'instant
print
(
"
fait
"
+
seq_num
)
return
True
def
zqsd2payload
(
self
,
x
:
string
)
->
string
#hex
payload
=
"
FF
"
#message d'erreur à refaire
if
(
command
==
'
d
'
):
# payload = "81 01 06 03 VV WW 0Y 0Y 0Y 0Y 00 00 00 00 FF YYYY de DE00 à 2200 center 0000
payload
=
"
81 01 06 03 09 09 00 01 02 02 00 00 00 00 FF
"
if
(
command
==
'
q
'
):
payload
=
"
81 01 06 03 09 09 0F 0E 0D 0E 00 00 00 00 FF
"
if
(
command
==
'
z
'
):
payload
=
"
81 01 06 03 09 09 0F 0E 0D 0E 00 00 00 00 FF
"
#nonfonctionnel
if
(
command
==
'
s
'
):
payload
=
"
81 01 06 03 09 09 0F 0E 0D 0E 00 00 00 00 FF
"
#nonfonctionnel
payloadtype
=
"
01 00
"
return
[
payloadtype
,
payload
]
def
zoom2payload
(
self
,
n
:
int
)
->
string
#hex #faire une version zoom + / zoom -
if
(
n
==
0
):
payload
=
"
81 01 04 47 00 00 00 00 FF
"
if
(
n
==
2
):
payload
=
"
81 01 04 47 01 06 0A 01 FF
"
return
[
payloadtype
,
payload
]
def
focus
(
self
,
b
:
bool
)
->
string
#hex #focus2payload(0) = autofocus
if
bool
:
payload
=
"
81 01 04 38 02 FF
"
#autofocus
else
:
payload
=
"
81 01 04 38 03 FF
"
payloadtype
=
"
01 00
"
return
[
payloadtype
,
payload
]
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