Commit 4a3715eb authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

Perform initial acquisition to setup FEBs before setting HighVoltage

parent 22487ce6
Pipeline #23352 failed with stages
in 4 minutes and 12 seconds
......@@ -1317,6 +1317,7 @@ void Eiger::setHighVoltage(int hvolt)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(hvolt);
DEB_ALWAYS() << "Setting high voltage (" << DEB_VAR1(hvolt) << ") ...";
m_det->setHighVoltage(hvolt);
}
......
......@@ -113,6 +113,9 @@ class SlsDetector(PyTango.Device_4Impl):
self.init_list_attr()
self.init_dac_adc_attr()
if self.initial_acq_params:
self.perform_initial_acq(self.initial_acq_params)
self.proc_finished = self.cam.getProcessingFinishedEvent()
self.proc_finished.registerStatusCallback(_SlsDetectorControl)
......@@ -182,6 +185,21 @@ class SlsDetector(PyTango.Device_4Impl):
attr_data = PyTango.AttrData.from_dict(attr_data_dict)
self.add_attribute(attr_data)
@Core.DEB_MEMBER_FUNCT
def perform_initial_acq(self, params):
deb.Always("Performing initial setup acquisition: %s ..." % params)
ct = _SlsDetectorControl
acq = ct.acquisition()
for x in params.split(','):
n, v = x.split('=')
attr_name = 'set' + ''.join([i.title() for i in n.split('_')])
eval('acq.%s(%s)' % (attr_name, v))
ct.prepareAcq()
ct.startAcq()
while ct.getStatus().AcquisitionStatus != Core.AcqReady:
time.sleep(0.1)
deb.Always("Done!")
@Core.DEB_MEMBER_FUNCT
def getAttrStringValueList(self, attr_name):
return get_attr_string_value_list(self, attr_name)
......@@ -495,6 +513,10 @@ class SlsDetectorClass(PyTango.DeviceClass):
'full_config_fname':
[PyTango.DevString,
"In case of partial configuration, path to the full config file",[]],
'initial_acq_params':
[PyTango.DevString,
"Initial acquisition parameters: "
"acq_expo_time=0.01,acq_nb_frames=10,...", ""],
'high_voltage':
[PyTango.DevShort,
"Initial detector high voltage (V) "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment