diff --git a/DG_PY_FOFBTool/DG_PY_FOFBTool.py b/DG_PY_FOFBTool/DG_PY_FOFBTool.py index cd8d2c85c0f40a37eab2835fce014a756687ccf8..d7c8669fadd89ce352199281fb90b3e1ce6ceacb 100644 --- a/DG_PY_FOFBTool/DG_PY_FOFBTool.py +++ b/DG_PY_FOFBTool/DG_PY_FOFBTool.py @@ -27,6 +27,7 @@ import FofbTool.Operation import FofbTool.Configuration import logging import multiprocessing +import numpy as np #----- PROTECTED REGION END -----# // DG_PY_FOFBTool.additionnal_import @@ -66,6 +67,14 @@ class DG_PY_FOFBTool(Device): - Type:'DevString' tangopath_centralnode - Type:'DevString' + k1_x + - Type:'DevVarLongArray' + k2_x + - Type:'DevVarLongArray' + k1_y + - Type:'DevVarLongArray' + k2_y + - Type:'DevVarLongArray' """ # PROTECTED REGION ID(DG_PY_FOFBTool.class_variable) ENABLED START # @@ -139,6 +148,26 @@ class DG_PY_FOFBTool(Device): mandatory=True ) + k1_x = device_property( + dtype='DevVarLongArray', + mandatory=True + ) + + k2_x = device_property( + dtype='DevVarLongArray', + mandatory=True + ) + + k1_y = device_property( + dtype='DevVarLongArray', + mandatory=True + ) + + k2_y = device_property( + dtype='DevVarLongArray', + mandatory=True + ) + # ---------- # Attributes # ---------- @@ -262,6 +291,15 @@ class DG_PY_FOFBTool(Device): self.error_stream("Failed to configure CCN on {}".format(cn)) s=FofbTool.Configuration.centralnode_configure_ccn(self.tangopath_centralnode, self.ccn_nbpm, self.ccn_npsc) + success = success and s + if not s: + self.error_stream("Failed to configure CCN on {}".format(self.tangopath_centralnode)) + + numbpm = int(np.sum(self.ccn_nbpm)) + self.debug_stream("Summed {} bpm for corrector".format(numbpm)) + FofbTool.Configuration.centralnode_configure_corr(self.tangopath_centralnode, + numbpm, [int(p) for p in self.corr_pscid.split()], + self.k1_x, self.k1_y, self.k2_x, self.k2_y) if success: self.d_status["configure"]="Configure: success" diff --git a/DG_PY_FOFBTool/DG_PY_FOFBTool.xmi b/DG_PY_FOFBTool/DG_PY_FOFBTool.xmi index 5705fe6c633d6250280a1e8b99419018859bd8dd..2336c58dc2e77b21acfe03da7071f4459826460b 100644 --- a/DG_PY_FOFBTool/DG_PY_FOFBTool.xmi +++ b/DG_PY_FOFBTool/DG_PY_FOFBTool.xmi @@ -45,6 +45,22 @@ <type xsi:type="pogoDsl:StringType"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> </deviceProperties> + <deviceProperties name="k1_x" mandatory="true" description=""> + <type xsi:type="pogoDsl:IntVectorType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="k2_x" mandatory="true" description=""> + <type xsi:type="pogoDsl:IntVectorType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="k1_y" mandatory="true" description=""> + <type xsi:type="pogoDsl:IntVectorType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="k2_y" mandatory="true" description=""> + <type xsi:type="pogoDsl:IntVectorType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> <commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0"> <argin description="none"> <type xsi:type="pogoDsl:VoidType"/>