Commit 9d31f0ac authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

Doc: update server & FW installation: load environment only once

parent c89e3f15
Pipeline #38254 failed with stages
in 7 minutes and 24 seconds
......@@ -29,6 +29,7 @@ is included:
::
lisgeiger1:~ % \
[ -n "${EIGER_MODULES}" ] || . ${EIGER_HOME}/eiger_setup.sh
EIGER_MODULE_TOP=$(echo ${EIGER_MODULES} | cut -f1 -d" ")
cat ~/.ssh/id_dsa.pub
echo
......@@ -295,7 +296,7 @@ as well as the kernel image:
::
lisgeiger1:~ % (
. ${EIGER_HOME}/eiger_setup.sh
[ -n "${EIGER_MODULES}" ] || . ${EIGER_HOME}/eiger_setup.sh
base_dir="${HOME}/eiger/log/${EIGER_DETECTOR}"
cd ${SLS_DETECTORS}/eiger/config
......
......@@ -79,6 +79,9 @@ public:
void setBufferCtrlObj(NumaSoftBufferCtrlObj *buffer_ctrl_obj)
{ m_buffer_ctrl_obj = buffer_ctrl_obj; }
void setModuleActive(int mod_idx, bool active);
void getModuleActive(int mod_idx, bool& active);
void clearAllBuffers();
void setPixelDepth(PixelDepth pixel_depth);
......
......@@ -40,6 +40,9 @@ public:
// void setBufferCtrlObj(NumaSoftBufferCtrlObj *buffer_ctrl_obj);
void setModuleActive(int mod_idx, bool active);
void getModuleActive(int mod_idx, bool& active /Out/);
void clearAllBuffers();
void setPixelDepth(SlsDetector::PixelDepth pixel_depth);
......
......@@ -732,6 +732,31 @@ void Camera::clearAllBuffers()
(*it)->clearAllBuffers();
}
void Camera::setModuleActive(int mod_idx, bool active)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR2(mod_idx, active);
if ((mod_idx < 0) || (mod_idx >= getNbDetModules()))
THROW_HW_ERROR(InvalidValue) << DEB_VAR1(mod_idx);
Positions pos = Idx2Pos(mod_idx);
EXC_CHECK(m_det->setActive(active, pos));
}
void Camera::getModuleActive(int mod_idx, bool& active)
{
DEB_MEMBER_FUNCT();
DEB_PARAM() << DEB_VAR1(mod_idx);
if ((mod_idx < 0) || (mod_idx >= getNbDetModules()))
THROW_HW_ERROR(InvalidValue) << DEB_VAR1(mod_idx);
Positions pos = Idx2Pos(mod_idx);
EXC_CHECK(active = m_det->getActive(pos).front());
DEB_RETURN() << DEB_VAR1(active);
}
void Camera::setPixelDepth(PixelDepth pixel_depth)
{
DEB_MEMBER_FUNCT();
......@@ -1058,7 +1083,7 @@ Camera::DetStatus Camera::getDetStatus()
{
DEB_MEMBER_FUNCT();
slsDetectorDefs::runStatus det_status;
const char *err_msg = "Detector status are different";;
const char *err_msg = "Detector status are different";
EXC_CHECK(det_status = m_det->getDetectorStatus().tsquash(err_msg));
DetStatus status = DetStatus(det_status);
DEB_RETURN() << DEB_VAR1(status);
......
......@@ -137,7 +137,7 @@ class SlsDetector(PyTango.Device_4Impl):
self.cam.setPixelDepthCPUAffinityMap(aff_map)
def init_list_attr(self):
nl = ['FullSpeed', 'HalfSpeed', 'QuarterSpeed', 'SuperSlowSpeed']
nl = ['FullSpeed', 'HalfSpeed', 'QuarterSpeed']
self.__ClockDiv = ConstListAttr(nl)
nl = ['NonParallel', 'Parallel']
......@@ -149,7 +149,7 @@ class SlsDetector(PyTango.Device_4Impl):
@Core.DEB_MEMBER_FUNCT
def init_dac_adc_attr(self):
nb_modules = self.cam.getNbDetSubModules()
nb_modules = self.cam.getNbDetModules()
name_list, idx_list, milli_volt_list = self.model.getDACInfo()
attr_name_list = map(lambda n: 'dac_' + n, name_list)
data_list = zip(idx_list, milli_volt_list)
......@@ -300,7 +300,7 @@ class SlsDetector(PyTango.Device_4Impl):
msg = 'Invalid %s: %s' % (attr_name, val_list)
elif nb_val == 1:
mod_idx_list = [-1]
elif nb_val == self.cam.getNbDetSubModules():
elif nb_val == self.cam.getNbDetModules():
mod_idx_list = range(nb_val)
else:
msg = 'Invalid %s length: %s' % (att_name, val_list)
......@@ -717,7 +717,7 @@ def get_control(config_fname, full_config_fname=None, apply_corrections=None,
_SlsDetectorCam = SlsDetectorHw.Camera(config_fname, det_id)
for i, n in enumerate(_SlsDetectorCam.getHostnameList()):
print('Enabling: %s (%d)' % (n, i))
_SlsDetectorCam.putCmd('activate 1', i)
_SlsDetectorCam.setModuleActive(i, True)
_SlsDetectorHwInter = SlsDetectorHw.Interface(_SlsDetectorCam)
if _SlsDetectorCam.getType() == SlsDetectorHw.EigerDet:
......@@ -762,5 +762,5 @@ def setup_partial_config(config_fname, full_config_fname):
for i, n in enumerate(full_hostname_list):
if n not in partial_hostname_list:
print('Disabling: %s (%d)' % (n, i))
cam.putCmd('activate 0', i)
cam.setModuleActive(i, False)
print('Partial config: Done!')
Supports Markdown
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