Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima-camera-slsdetector
Commits
95d2d158
Commit
95d2d158
authored
Jul 25, 2018
by
Alejandro Homs Puron
Committed by
operator for beamline
Aug 09, 2018
Browse files
Interrupt waiting for last skipped frame 0.5 sec after stop requested
parent
c4d1420e
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/SlsDetectorCamera.h
View file @
95d2d158
...
...
@@ -291,6 +291,7 @@ private:
FrameType
m_det_nb_frames
;
FrameType
m_skip_frame_freq
;
SortedIntList
m_missing_last_skipped_frame
;
double
m_last_skipped_frame_timeout
;
double
m_exp_time
;
double
m_lat_time
;
double
m_frame_period
;
...
...
src/SlsDetectorCamera.cpp
View file @
95d2d158
...
...
@@ -297,6 +297,7 @@ Camera::Camera(string config_fname)
m_lima_nb_frames
(
1
),
m_det_nb_frames
(
1
),
m_skip_frame_freq
(
0
),
m_last_skipped_frame_timeout
(
0.5
),
m_lat_time
(
0
),
m_recv_nb_ports
(
0
),
m_pixel_depth
(
PixelDepth16
),
...
...
@@ -901,8 +902,29 @@ void Camera::waitLastSkippedFrame()
{
DEB_MEMBER_FUNCT
();
AutoMutex
l
=
lock
();
while
(
!
m_missing_last_skipped_frame
.
empty
())
m_cond
.
wait
();
bool
stopping
=
false
;
Timestamp
t0
;
SortedIntList
&
port_list
=
m_missing_last_skipped_frame
;
while
(
!
port_list
.
empty
())
{
double
timeout
=
-
1
;
if
(
!
stopping
&&
(
m_state
==
StopReq
))
{
DEB_TRACE
()
<<
"stop requested"
;
stopping
=
true
;
t0
=
Timestamp
::
now
();
}
if
(
stopping
)
{
double
elapsed
=
Timestamp
::
now
()
-
t0
;
timeout
=
m_last_skipped_frame_timeout
-
elapsed
;
if
(
timeout
<=
0
)
{
DEB_WARNING
()
<<
"Missing last skipped frame "
<<
elapsed
<<
" sec after stop: "
<<
"remaining port_list="
<<
PrettySortedList
(
port_list
);
break
;
}
}
m_cond
.
wait
(
timeout
);
}
}
void
Camera
::
processLastSkippedFrame
(
int
port_idx
)
...
...
@@ -912,8 +934,7 @@ void Camera::processLastSkippedFrame(int port_idx)
AutoMutex
l
=
lock
();
if
(
m_missing_last_skipped_frame
.
erase
(
port_idx
)
!=
1
)
DEB_ERROR
()
<<
"port "
<<
port_idx
<<
" already processed"
;
else
m_cond
.
broadcast
();
m_cond
.
broadcast
();
}
int
Camera
::
getFramesCaught
()
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment