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-eiger
Commits
fa98454a
Commit
fa98454a
authored
Jan 30, 2020
by
Alejandro Homs Puron
Committed by
Alejandro Homs Puron
Jan 30, 2020
Browse files
Wait for data retrieval to finish at the end of acquisition
* Rename Acq Callback/Finished to Trigger
parent
46ac67dc
Pipeline
#20479
failed with stages
in 1 minute and 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/EigerCamera.h
View file @
fa98454a
...
...
@@ -163,17 +163,19 @@ class LIBEIGER Camera : public HwMaxImageSizeCallbackGen, public EventCallbackGe
friend
class
MultiParamRequest
;
enum
InternalStatus
{
IDLE
,
RUNNING
,
ERROR
};
class
Acq
Callback
;
friend
class
Acq
Callback
;
class
Trigger
Callback
;
friend
class
Trigger
Callback
;
class
InitCallback
;
friend
class
InitCallback
;
void
_synchronize
();
/// Used during plug-in initialization
void
_
acquisition
_finished
(
bool
);
void
_
trigger
_finished
(
bool
);
void
_initialization_finished
(
bool
ok
);
void
_updateImageSize
();
bool
isAcquisitionFinished
();
template
<
typename
T
>
struct
Cache
{
...
...
src/EigerCamera.cpp
View file @
fa98454a
...
...
@@ -172,14 +172,14 @@ private:
/*----------------------------------------------------------------------------
Callback class
----------------------------------------------------------------------------*/
class
Camera
::
Acq
Callback
:
public
CurlLoop
::
FutureRequest
::
Callback
class
Camera
::
Trigger
Callback
:
public
CurlLoop
::
FutureRequest
::
Callback
{
public:
Acq
Callback
(
Camera
&
cam
)
:
m_cam
(
cam
)
{}
Trigger
Callback
(
Camera
&
cam
)
:
m_cam
(
cam
)
{}
void
status_changed
(
CurlLoop
::
FutureRequest
::
Status
status
)
{
m_cam
.
_
acquisition
_finished
(
status
==
CurlLoop
::
FutureRequest
::
OK
);
m_cam
.
_
trigger
_finished
(
status
==
CurlLoop
::
FutureRequest
::
OK
);
}
private:
Camera
&
m_cam
;
...
...
@@ -402,11 +402,12 @@ void Camera::startAcq()
if
(
m_trig_mode
==
IntTrig
||
m_trig_mode
==
IntTrigMult
)
{
DEB_TRACE
()
<<
"Trigger start"
;
CommandReq
trigger
=
m_requests
->
get_command
(
Requests
::
TRIGGER
);
m_trigger_state
=
RUNNING
;
lock
.
unlock
();
std
::
shared_ptr
<
CurlLoop
::
FutureRequest
::
Callback
>
cbk
(
new
Acq
Callback
(
*
this
));
std
::
shared_ptr
<
CurlLoop
::
FutureRequest
::
Callback
>
cbk
(
new
Trigger
Callback
(
*
this
));
trigger
->
register_callback
(
cbk
);
}
...
...
@@ -852,25 +853,37 @@ void Camera::_updateImageSize()
}
/*----------------------------------------------------------------------------
This method is called when the
acquisition
is finished
This method is called when the
trigger
is finished
----------------------------------------------------------------------------*/
void
Camera
::
_
acquisition
_finished
(
bool
ok
)
void
Camera
::
_
trigger
_finished
(
bool
ok
)
{
DEB_MEMBER_FUNCT
();
DEB_PARAM
()
<<
DEB_VAR1
(
ok
);
std
::
string
error_msg
;
//First we will disarm
if
(
ok
&&
((
m_trig_mode
!=
IntTrigMult
)
||
(
m_image_number
==
m_nb_frames
)))
CommandReq
disarm
=
m_requests
->
get_command
(
Requests
::
DISARM
);
DEB_TRACE
()
<<
"Trigger end"
;
if
(
!
ok
)
DEB_ERROR
()
<<
"Error in trigger command"
;
AutoMutex
lock
(
m_cond
.
mutex
());
m_trigger_state
=
ok
?
IDLE
:
ERROR
;
if
(
!
error_msg
.
empty
())
DEB_ERROR
()
<<
error_msg
;
lock
.
unlock
();
// Disarm at acq end
if
(
isAcquisitionFinished
())
CommandReq
disarm
=
m_requests
->
get_command
(
Requests
::
DISARM
);
}
bool
Camera
::
isAcquisitionFinished
()
{
DEB_MEMBER_FUNCT
();
AutoMutex
lock
(
m_cond
.
mutex
());
DEB_PARAM
()
<<
DEB_VAR3
(
m_trigger_state
,
m_trigger_state
,
m_image_number
);
bool
finished
=
((
m_trigger_state
==
IDLE
)
&&
((
m_trig_mode
!=
IntTrigMult
)
||
(
m_image_number
==
m_nb_frames
)));
DEB_RETURN
()
<<
DEB_VAR1
(
finished
);
return
finished
;
}
//-----------------------------------------------------------------------------
/// Returns the API generation of the detector
...
...
src/EigerInterface.cpp
View file @
fa98454a
...
...
@@ -145,7 +145,9 @@ void Interface::getStatus(StatusType& status)
{
case
Camera
::
Ready
:
{
if
(
!
m_stream
->
isRunning
())
if
(
!
m_cam
.
isAcquisitionFinished
())
// missing frames in IntTrigMult
status
.
set
(
HwInterface
::
StatusType
::
Ready
);
else
if
(
m_saving
->
isActive
())
{
SavingCtrlObj
::
Status
saving_status
=
m_saving
->
getStatus
();
switch
(
saving_status
)
...
...
@@ -158,6 +160,8 @@ void Interface::getStatus(StatusType& status)
status
.
set
(
HwInterface
::
StatusType
::
Fault
);
break
;
}
}
else
if
(
m_stream
->
isRunning
())
status
.
set
(
HwInterface
::
StatusType
::
Readout
);
else
status
.
set
(
HwInterface
::
StatusType
::
Ready
);
}
...
...
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