Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393
Commits
c094bd70
Commit
c094bd70
authored
Feb 07, 2018
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git@git.elphel.com:Elphel/x393.git
parents
e8678ccd
d7ad5f88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
imgsrv.py
py393/imgsrv.py
+10
-10
No files found.
py393/imgsrv.py
View file @
c094bd70
#!/usr/bin/python
#!/usr/bin/
env
python
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
'''
'''
# Copyright (C) 2015, Elphel.inc.
# Copyright (C) 2015, Elphel.inc.
#
#
# This program is free software: you can redistribute it and/or modify
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# the Free Software Foundation, either version 3 of the License, or
...
@@ -95,11 +95,11 @@ if ((not acquisition_parameters["bayer"] is None) and
...
@@ -95,11 +95,11 @@ if ((not acquisition_parameters["bayer"] is None) and
ibayer
^=
1
ibayer
^=
1
if
int
(
acquisition_parameters
[
"flip_y"
]):
if
int
(
acquisition_parameters
[
"flip_y"
]):
ibayer
^=
2
ibayer
^=
2
acquisition_parameters
[
"bayer"
]
=
str
(
ibayer
)
acquisition_parameters
[
"bayer"
]
=
str
(
ibayer
)
#restart compressor
#restart compressor
communicate
(
PORT
,
"compressor_control all 1 None None None None None"
)
communicate
(
PORT
,
"compressor_control all 1 None None None None None"
)
cmd_str
=
"jpeg_acquire_write
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s"
%
(
cmd_str
=
"jpeg_acquire_write
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s"
%
(
str
(
acquisition_parameters
[
"file_path"
]),
str
(
acquisition_parameters
[
"file_path"
]),
str
(
acquisition_parameters
[
"channel"
]),
str
(
acquisition_parameters
[
"channel"
]),
...
@@ -117,7 +117,7 @@ cmd_str = "jpeg_acquire_write %s %s %s %s %s %s %s %s %s %s %s %s %s"%(
...
@@ -117,7 +117,7 @@ cmd_str = "jpeg_acquire_write %s %s %s %s %s %s %s %s %s %s %s %s %s"%(
gains_exp_changed
=
False
gains_exp_changed
=
False
geometry_changed
=
False
geometry_changed
=
False
#change gains/exposure if needed
#change gains/exposure if needed
if
((
not
acquisition_parameters
[
"gain_r"
]
is
None
)
or
if
((
not
acquisition_parameters
[
"gain_r"
]
is
None
)
or
(
not
acquisition_parameters
[
"gain_gr"
]
is
None
)
or
(
not
acquisition_parameters
[
"gain_gr"
]
is
None
)
or
(
not
acquisition_parameters
[
"gain_gb"
]
is
None
)
or
(
not
acquisition_parameters
[
"gain_gb"
]
is
None
)
or
(
not
acquisition_parameters
[
"gain_b"
]
is
None
)
or
(
not
acquisition_parameters
[
"gain_b"
]
is
None
)
or
...
@@ -134,7 +134,7 @@ if ((not acquisition_parameters["gain_r"] is None) or
...
@@ -134,7 +134,7 @@ if ((not acquisition_parameters["gain_r"] is None) or
communicate
(
PORT
,
gstr
)
communicate
(
PORT
,
gstr
)
#change flips if needed
#change flips if needed
if
((
not
acquisition_parameters
[
"flip_x"
]
is
None
)
or
if
((
not
acquisition_parameters
[
"flip_x"
]
is
None
)
or
(
not
acquisition_parameters
[
"flip_yr"
]
is
None
)):
(
not
acquisition_parameters
[
"flip_yr"
]
is
None
)):
geometry_changed
=
True
geometry_changed
=
True
fstr
=
"set_sensor_flipXY
%
s
%
s
%
s
%
s"
%
(
fstr
=
"set_sensor_flipXY
%
s
%
s
%
s
%
s"
%
(
...
@@ -143,7 +143,7 @@ if ((not acquisition_parameters["flip_x"] is None) or
...
@@ -143,7 +143,7 @@ if ((not acquisition_parameters["flip_x"] is None) or
str
(
acquisition_parameters
[
"flip_y"
]),
str
(
acquisition_parameters
[
"flip_y"
]),
str
(
acquisition_parameters
[
"verbose"
]))
str
(
acquisition_parameters
[
"verbose"
]))
communicate
(
PORT
,
fstr
)
communicate
(
PORT
,
fstr
)
#How many bad/non modified frames are to be skipped (just a guess)
#How many bad/non modified frames are to be skipped (just a guess)
skip_frames
=
0
skip_frames
=
0
if
geometry_changed
:
if
geometry_changed
:
skip_frames
=
2
skip_frames
=
2
...
@@ -153,10 +153,10 @@ if (str(acquisition_parameters["channel"])[0].upper() == 'A'):
...
@@ -153,10 +153,10 @@ if (str(acquisition_parameters["channel"])[0].upper() == 'A'):
channel_mask
=
0x0f
channel_mask
=
0x0f
else
:
else
:
channel_mask
=
1
<<
int
(
acquisition_parameters
[
"channel"
])
channel_mask
=
1
<<
int
(
acquisition_parameters
[
"channel"
])
skip_str
=
"skip_frame
%
d"
%
(
channel_mask
)
skip_str
=
"skip_frame
%
d"
%
(
channel_mask
)
for
i
in
range
(
skip_frames
):
for
i
in
range
(
skip_frames
):
communicate
(
PORT
,
skip_str
)
communicate
(
PORT
,
skip_str
)
# Now - get that image
# Now - get that image
reply
=
communicate
(
PORT
,
cmd_str
)
reply
=
communicate
(
PORT
,
cmd_str
)
if
(
acquisition_parameters
[
"cmode"
]
==
"5"
):
if
(
acquisition_parameters
[
"cmode"
]
==
"5"
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment