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-pilatus
Commits
7b57ad8a
Commit
7b57ad8a
authored
May 22, 2017
by
Sebastien Petitdemange
Committed by
Operator for ID31
Mar 26, 2018
Browse files
new command resetHighVoltage for Cdte detector.
This command power cycle module and High Voltage.
parent
a6a2578e
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/PilatusCamera.h
View file @
7b57ad8a
...
...
@@ -52,6 +52,7 @@ public:
SETTING_ROI
,
KILL_ACQUISITION
,
RUNNING
,
RESET_HIGH_VOLTAGE
,
ANYCMD
};
...
...
@@ -132,8 +133,13 @@ public:
bool
hasRoiCapability
()
const
;
void
setRoi
(
const
std
::
string
&
);
bool
hasHighVoltageReset
();
void
resetHighVoltage
(
double
sleeptime
=
-
1.
);
private:
static
const
double
TIME_OUT
=
10.
;
enum
HIGH_VOLTAGE
{
NOT_INITIALIZED
,
HAS_HIGH_VOLTAGE
,
DONT_HAVE_HIGH_VOLTAGE
};
const
std
::
string
&
errorMessage
()
const
;
void
softReset
();
...
...
@@ -187,6 +193,7 @@ private:
int
m_major_version
;
int
m_minor_version
;
int
m_patch_version
;
HIGH_VOLTAGE
m_cmd_high_voltage_reset
;
};
}
}
...
...
src/PilatusCamera.cpp
View file @
7b57ad8a
...
...
@@ -116,7 +116,8 @@ Camera::Camera(const char *host,int port)
m_has_cmd_roi
(
true
),
m_major_version
(
-
1
),
m_minor_version
(
-
1
),
m_patch_version
(
-
1
)
m_patch_version
(
-
1
),
m_cmd_high_voltage_reset
(
NOT_INITIALIZED
)
{
DEB_CONSTRUCTOR
();
m_server_ip
=
host
;
...
...
@@ -604,6 +605,13 @@ void Camera::_run()
m_has_cmd_roi
=
false
;
_resync
();
}
else
if
(
msg
.
find
(
"Unrecognized command: resetmodulepower"
)
!=
std
::
string
::
npos
)
{
m_cmd_high_voltage_reset
=
DONT_HAVE_HIGH_VOLTAGE
;
m_state
=
Camera
::
STANDBY
;
m_cond
.
broadcast
();
}
else
{
DEB_TRACE
()
<<
"-- ERROR"
;
...
...
@@ -1186,5 +1194,58 @@ void Camera::setRoi(const std::string& roi_pattern)
<<
DEB_VAR2
(
roi_pattern
,
m_error_message
);
}
}
/*-----------------------------------------------------
High voltage reset command (Cdte)
------------------------------------------------------*/
bool
Camera
::
hasHighVoltageReset
()
{
DEB_MEMBER_FUNCT
();
//-----------------------------------------------------
AutoMutex
lock
(
m_cond
.
mutex
());
if
(
m_pilatus3_threshold_mode
)
{
if
(
m_cmd_high_voltage_reset
==
NOT_INITIALIZED
)
{
try
{
AutoMutexUnlock
unlock
(
lock
);
resetHighVoltage
();
}
catch
(...)
{}
}
return
m_cmd_high_voltage_reset
==
HAS_HIGH_VOLTAGE
;
}
else
return
false
;
}
void
Camera
::
resetHighVoltage
(
double
sleep_time
)
{
DEB_MEMBER_FUNCT
();
AutoMutex
lock
(
m_cond
.
mutex
());
if
(
m_cmd_high_voltage_reset
==
DONT_HAVE_HIGH_VOLTAGE
)
THROW_HW_ERROR
(
Error
)
<<
"This detector doesn't have a "
<<
"command to reset high voltage"
;
std
::
stringstream
msg
;
msg
<<
"resetmodulepower"
;
if
(
sleep_time
>
0.
)
msg
<<
" "
<<
sleep_time
;
m_state
=
Camera
::
RESET_HIGH_VOLTAGE
;
while
(
m_state
==
Camera
::
RESET_HIGH_VOLTAGE
)
m_cond
.
wait
(
TIME_OUT
+
sleep_time
<
0.
?
0.
:
sleep_time
);
if
(
m_cmd_high_voltage_reset
==
DONT_HAVE_HIGH_VOLTAGE
)
THROW_HW_ERROR
(
Error
)
<<
"This detector doesn't have a "
<<
"command to reset high voltage"
;
else
{
/** Refresh the energy settings.
Has the chip supply voltage and HV are power cycle,
it lost the energy threshold.
*/
if
(
m_has_cmd_setenergy
)
send
(
"setenergy"
);
else
send
(
"setthreshold"
);
}
}
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