mxcubecore 1.393.0__py3-none-any.whl → 1.394.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mxcubecore might be problematic. Click here for more details.
- mxcubecore/HardwareObjects/ALBA/ALBAAutoProcessing.py +4 -7
- mxcubecore/HardwareObjects/ALBA/ALBABackLight.py +6 -7
- mxcubecore/HardwareObjects/ALBA/ALBABeamInfo.py +2 -4
- mxcubecore/HardwareObjects/ALBA/ALBACats.py +19 -25
- mxcubecore/HardwareObjects/ALBA/ALBAClusterJob.py +10 -11
- mxcubecore/HardwareObjects/ALBA/ALBACollect.py +49 -71
- mxcubecore/HardwareObjects/ALBA/ALBADataAnalysis.py +26 -31
- mxcubecore/HardwareObjects/ALBA/ALBAEnergy.py +1 -5
- mxcubecore/HardwareObjects/ALBA/ALBAEpsActuator.py +1 -1
- mxcubecore/HardwareObjects/ALBA/ALBAFastShutter.py +1 -1
- mxcubecore/HardwareObjects/ALBA/ALBAFlux.py +2 -6
- mxcubecore/HardwareObjects/ALBA/ALBAFrontLight.py +5 -9
- mxcubecore/HardwareObjects/ALBA/ALBAISPyBClient.py +4 -4
- mxcubecore/HardwareObjects/ALBA/ALBAMiniDiff.py +20 -27
- mxcubecore/HardwareObjects/ALBA/ALBAPilatus.py +12 -15
- mxcubecore/HardwareObjects/ALBA/ALBASession.py +1 -4
- mxcubecore/HardwareObjects/ALBA/ALBAZoomMotor.py +10 -14
- mxcubecore/HardwareObjects/ALBA/ALBAZoomMotorAutoBrightness.py +7 -11
- mxcubecore/HardwareObjects/ALBA/XalocMiniDiff.py +7 -8
- mxcubecore/HardwareObjects/BeamInfo.py +4 -6
- mxcubecore/HardwareObjects/Beamline.py +6 -7
- mxcubecore/HardwareObjects/BeamlineActions.py +3 -7
- mxcubecore/HardwareObjects/BlissHutchTrigger.py +2 -4
- mxcubecore/HardwareObjects/BlissMotorWPositions.py +4 -7
- mxcubecore/HardwareObjects/Cats90.py +33 -43
- mxcubecore/HardwareObjects/CatsBessy.py +1 -2
- mxcubecore/HardwareObjects/CatsMaint.py +2 -2
- mxcubecore/HardwareObjects/CentringMath.py +5 -4
- mxcubecore/HardwareObjects/DESY/DigitalZoomMotor.py +3 -5
- mxcubecore/HardwareObjects/DESY/MjpgStreamVideo.py +1 -3
- mxcubecore/HardwareObjects/DESY/P11Collect.py +6 -8
- mxcubecore/HardwareObjects/DESY/P11EDNACharacterisation.py +14 -16
- mxcubecore/HardwareObjects/DESY/P11ISPyBClient.py +6 -10
- mxcubecore/HardwareObjects/DESY/P11NanoDiff.py +5 -5
- mxcubecore/HardwareObjects/DataPublisher.py +2 -3
- mxcubecore/HardwareObjects/EDNACharacterisation.py +2 -4
- mxcubecore/HardwareObjects/EMBL/EMBLBeam.py +3 -3
- mxcubecore/HardwareObjects/EMBL/EMBLBeamCentering.py +2 -4
- mxcubecore/HardwareObjects/EMBL/EMBLBeamFocusing.py +3 -3
- mxcubecore/HardwareObjects/EMBL/EMBLDoorInterlock.py +1 -1
- mxcubecore/HardwareObjects/EMBL/EMBLEnergy.py +10 -18
- mxcubecore/HardwareObjects/EMBL/EMBLEnergyScan.py +9 -13
- mxcubecore/HardwareObjects/EMBL/EMBLFlux.py +10 -12
- mxcubecore/HardwareObjects/EMBL/EMBLMachineInfo.py +2 -2
- mxcubecore/HardwareObjects/EMBL/EMBLMiniDiff.py +18 -18
- mxcubecore/HardwareObjects/EMBL/EMBLMotorsGroup.py +6 -9
- mxcubecore/HardwareObjects/EMBL/EMBLOnlineProcessing.py +6 -6
- mxcubecore/HardwareObjects/EMBL/EMBLPPUControl.py +1 -1
- mxcubecore/HardwareObjects/EMBL/EMBLSSXChip.py +1 -4
- mxcubecore/HardwareObjects/EMBL/EMBLSlitBox.py +1 -3
- mxcubecore/HardwareObjects/EMBL/EMBLTableMotor.py +2 -3
- mxcubecore/HardwareObjects/EMBL/EMBLXRFSpectrum.py +4 -4
- mxcubecore/HardwareObjects/EMBL/EMBLXrayImaging.py +1 -1
- mxcubecore/HardwareObjects/EMBL/TINEMotor.py +2 -4
- mxcubecore/HardwareObjects/EMBLFlexHCD.py +5 -5
- mxcubecore/HardwareObjects/EMBLFlexHarvester.py +2 -2
- mxcubecore/HardwareObjects/ESRF/ESRFBeam.py +3 -5
- mxcubecore/HardwareObjects/ESRF/ESRFBeamInfo.py +1 -5
- mxcubecore/HardwareObjects/ESRF/ESRFBeamlineActions.py +2 -3
- mxcubecore/HardwareObjects/ESRF/ESRFEnergyScan.py +3 -3
- mxcubecore/HardwareObjects/ESRF/ESRFMultiCollect.py +7 -7
- mxcubecore/HardwareObjects/ESRF/ESRFPhotonFlux.py +2 -8
- mxcubecore/HardwareObjects/ESRF/ESRFSC3.py +11 -18
- mxcubecore/HardwareObjects/ESRF/ID29HutchTrigger.py +2 -4
- mxcubecore/HardwareObjects/ESRF/MD2MultiCollect.py +4 -4
- mxcubecore/HardwareObjects/ESRF/SSXICATLIMS.py +9 -6
- mxcubecore/HardwareObjects/EdnaWorkflow.py +9 -11
- mxcubecore/HardwareObjects/Energy.py +11 -15
- mxcubecore/HardwareObjects/ExporterMotor.py +1 -2
- mxcubecore/HardwareObjects/FlexHCD.py +7 -8
- mxcubecore/HardwareObjects/FlexHCDMaintenance.py +1 -2
- mxcubecore/HardwareObjects/GenericDiffractometer.py +26 -46
- mxcubecore/HardwareObjects/Gphl/CollectEmulator.py +6 -7
- mxcubecore/HardwareObjects/Gphl/GphlQueueEntry.py +2 -2
- mxcubecore/HardwareObjects/Gphl/GphlWorkflow.py +29 -43
- mxcubecore/HardwareObjects/Gphl/GphlWorkflowConnection.py +25 -35
- mxcubecore/HardwareObjects/ICATLIMS.py +17 -13
- mxcubecore/HardwareObjects/LNLS/EPICSMotor.py +1 -4
- mxcubecore/HardwareObjects/LNLS/LNLSAperture.py +2 -5
- mxcubecore/HardwareObjects/LNLS/LNLSCamera.py +14 -16
- mxcubecore/HardwareObjects/LNLS/LNLSCollect.py +20 -30
- mxcubecore/HardwareObjects/LNLS/LNLSDetDistMotor.py +7 -11
- mxcubecore/HardwareObjects/LNLS/LNLSEnergy.py +4 -6
- mxcubecore/HardwareObjects/LNLS/LNLSPilatusDet.py +49 -57
- mxcubecore/HardwareObjects/LNLS/LNLSTransmission.py +4 -7
- mxcubecore/HardwareObjects/LdapAuthenticator.py +11 -15
- mxcubecore/HardwareObjects/Lima2Detector.py +1 -1
- mxcubecore/HardwareObjects/LimaEigerDetector.py +1 -1
- mxcubecore/HardwareObjects/LimaPilatusDetector.py +1 -4
- mxcubecore/HardwareObjects/MAXIV/MAXIVAutoProcessing.py +3 -5
- mxcubecore/HardwareObjects/MD3UP.py +1 -2
- mxcubecore/HardwareObjects/MachCurrent.py +5 -5
- mxcubecore/HardwareObjects/Marvin.py +23 -35
- mxcubecore/HardwareObjects/Microdiff.py +6 -8
- mxcubecore/HardwareObjects/MicrodiffActuator.py +1 -1
- mxcubecore/HardwareObjects/MicrodiffBeamstop.py +1 -3
- mxcubecore/HardwareObjects/MicrodiffInOut.py +1 -1
- mxcubecore/HardwareObjects/MicrodiffKappaMotor.py +3 -4
- mxcubecore/HardwareObjects/MiniDiff.py +35 -57
- mxcubecore/HardwareObjects/MotorWPositions.py +3 -3
- mxcubecore/HardwareObjects/PlateManipulator.py +2 -2
- mxcubecore/HardwareObjects/ProposalTypeISPyBLims.py +8 -16
- mxcubecore/HardwareObjects/PyISPyBClient.py +8 -5
- mxcubecore/HardwareObjects/QtGraphicsLib.py +2 -2
- mxcubecore/HardwareObjects/QtGraphicsManager.py +13 -19
- mxcubecore/HardwareObjects/QtInstanceServer.py +27 -55
- mxcubecore/HardwareObjects/QtLimaVideo.py +1 -5
- mxcubecore/HardwareObjects/QueueManager.py +7 -9
- mxcubecore/HardwareObjects/QueueModel.py +6 -8
- mxcubecore/HardwareObjects/RedisClient.py +12 -16
- mxcubecore/HardwareObjects/SC3.py +1 -2
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Attenuator.py +1 -3
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1BeamInfo.py +1 -1
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1CatsMaint.py +3 -4
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Collect.py +11 -11
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Cryotong.py +8 -18
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Energy.py +6 -7
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1EnergyScan.py +21 -31
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Environment.py +1 -1
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1MiniDiff.py +11 -21
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Pilatus.py +9 -9
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Pss.py +1 -2
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1Resolution.py +1 -5
- mxcubecore/HardwareObjects/SOLEIL/PX1/PX1TangoLight.py +3 -8
- mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Attenuator.py +9 -13
- mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Collect.py +1 -1
- mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Diffractometer.py +22 -22
- mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Energy.py +4 -6
- mxcubecore/HardwareObjects/SOLEIL/PX2/PX2Guillotine.py +2 -2
- mxcubecore/HardwareObjects/SOLEIL/SOLEILCatsMaint.py +6 -8
- mxcubecore/HardwareObjects/SOLEIL/SOLEILEnergyScan.py +44 -56
- mxcubecore/HardwareObjects/SOLEIL/SOLEILGuillotine.py +2 -2
- mxcubecore/HardwareObjects/SOLEIL/SOLEILISPyBClient.py +10 -10
- mxcubecore/HardwareObjects/SOLEIL/SOLEILMachineInfo.py +4 -8
- mxcubecore/HardwareObjects/SOLEIL/SOLEILPss.py +3 -4
- mxcubecore/HardwareObjects/SOLEIL/SOLEILRuche.py +1 -1
- mxcubecore/HardwareObjects/SOLEIL/TangoDCMotor.py +10 -16
- mxcubecore/HardwareObjects/SardanaMotor.py +4 -5
- mxcubecore/HardwareObjects/Session.py +1 -2
- mxcubecore/HardwareObjects/SpecMotorWPositions.py +5 -9
- mxcubecore/HardwareObjects/SpecMotorWSpecPositions.py +2 -4
- mxcubecore/HardwareObjects/SpecShell.py +7 -9
- mxcubecore/HardwareObjects/SpecState.py +5 -7
- mxcubecore/HardwareObjects/StateMachine.py +9 -10
- mxcubecore/HardwareObjects/TangoLimaMpegVideo.py +2 -3
- mxcubecore/HardwareObjects/TangoLimaVideo.py +3 -4
- mxcubecore/HardwareObjects/TangoMachineInfo.py +1 -3
- mxcubecore/HardwareObjects/TangoMotor.py +1 -3
- mxcubecore/HardwareObjects/UserTypeISPyBLims.py +7 -9
- mxcubecore/HardwareObjects/XMLRPCServer.py +19 -21
- mxcubecore/HardwareObjects/abstract/AbstractAperture.py +6 -11
- mxcubecore/HardwareObjects/abstract/AbstractCollect.py +6 -16
- mxcubecore/HardwareObjects/abstract/AbstractDetector.py +2 -7
- mxcubecore/HardwareObjects/abstract/AbstractEnergyScan.py +1 -1
- mxcubecore/HardwareObjects/abstract/AbstractLims.py +3 -4
- mxcubecore/HardwareObjects/abstract/AbstractNState.py +1 -2
- mxcubecore/HardwareObjects/abstract/AbstractProcedure.py +3 -4
- mxcubecore/HardwareObjects/abstract/AbstractSampleChanger.py +1 -1
- mxcubecore/HardwareObjects/abstract/AbstractVideoDevice.py +4 -4
- mxcubecore/HardwareObjects/abstract/AbstractXRFSpectrum.py +1 -1
- mxcubecore/HardwareObjects/abstract/ISPyBAbstractLims.py +11 -13
- mxcubecore/HardwareObjects/mockup/BeamlineTestMockup.py +11 -14
- mxcubecore/HardwareObjects/mockup/EnergyScanMockup.py +10 -11
- mxcubecore/HardwareObjects/mockup/ISPyBClientMockup.py +6 -6
- mxcubecore/HardwareObjects/mockup/ISPyBRestClientMockup.py +1 -1
- mxcubecore/HardwareObjects/mockup/LimaDetectorMockup.py +1 -2
- mxcubecore/HardwareObjects/mockup/MDCameraMockup.py +5 -6
- mxcubecore/HardwareObjects/mockup/MicrodiffInOutMockup.py +1 -1
- mxcubecore/HardwareObjects/mockup/MultiCollectMockup.py +1 -1
- mxcubecore/HardwareObjects/mockup/ShapeHistoryMockup.py +1 -2
- mxcubecore/HardwareObjects/mockup/XRFMockup.py +3 -6
- {mxcubecore-1.393.0.dist-info → mxcubecore-1.394.0.dist-info}/METADATA +1 -1
- {mxcubecore-1.393.0.dist-info → mxcubecore-1.394.0.dist-info}/RECORD +176 -176
- {mxcubecore-1.393.0.dist-info → mxcubecore-1.394.0.dist-info}/COPYING +0 -0
- {mxcubecore-1.393.0.dist-info → mxcubecore-1.394.0.dist-info}/COPYING.LESSER +0 -0
- {mxcubecore-1.393.0.dist-info → mxcubecore-1.394.0.dist-info}/WHEEL +0 -0
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
|
|
20
20
|
"""LNLS Energy"""
|
|
21
21
|
|
|
22
|
-
import logging
|
|
23
|
-
|
|
24
22
|
from mxcubecore.HardwareObjects.abstract.AbstractEnergy import AbstractEnergy
|
|
25
23
|
from mxcubecore.HardwareObjects.LNLS.EPICSActuator import EPICSActuator
|
|
26
24
|
|
|
@@ -46,7 +44,7 @@ class LNLSEnergy(EPICSActuator, AbstractEnergy):
|
|
|
46
44
|
value = super().get_value()
|
|
47
45
|
# Nominal value stores last energy value with valid threshold energy
|
|
48
46
|
# if abs(self._nominal_value - value) < 0.001:
|
|
49
|
-
#
|
|
47
|
+
# self.log.info("Pilatus threshold is still okay.")
|
|
50
48
|
# return value
|
|
51
49
|
|
|
52
50
|
threshold_ok = self.check_threshold_energy(value)
|
|
@@ -60,7 +58,7 @@ class LNLSEnergy(EPICSActuator, AbstractEnergy):
|
|
|
60
58
|
def check_threshold_energy(self, energy):
|
|
61
59
|
"""Returns whether detector threshold energy is valid or not."""
|
|
62
60
|
|
|
63
|
-
#
|
|
61
|
+
# self.log.info(
|
|
64
62
|
# "Checking Pilatus threshold. Please wait..."
|
|
65
63
|
# )
|
|
66
64
|
# for i in range(3):
|
|
@@ -70,13 +68,13 @@ class LNLSEnergy(EPICSActuator, AbstractEnergy):
|
|
|
70
68
|
threshold_ok = self.detector.set_threshold_energy(energy)
|
|
71
69
|
|
|
72
70
|
if threshold_ok:
|
|
73
|
-
|
|
71
|
+
self.log.info("Pilatus threshold is okay.")
|
|
74
72
|
# logging.getLogger("user_level_log").info(
|
|
75
73
|
# "Pilatus threshold is okay."
|
|
76
74
|
# )
|
|
77
75
|
return True
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
self.log.error("Pilatus threshold is not okay.")
|
|
80
78
|
# logging.getLogger("user_level_log").error(
|
|
81
79
|
# "Pilatus threshold is not okay."
|
|
82
80
|
# )
|
|
@@ -116,18 +116,18 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
116
116
|
try:
|
|
117
117
|
float(energy)
|
|
118
118
|
except Exception as e:
|
|
119
|
-
|
|
119
|
+
self.log.error(
|
|
120
120
|
"Error while setting Pilatus threshold. Value must be float."
|
|
121
121
|
)
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
self.log.exception("")
|
|
124
124
|
return False
|
|
125
125
|
|
|
126
126
|
target_threshold = energy / 2
|
|
127
127
|
if abs(self.get_threshold_energy() - target_threshold) < 0.0001:
|
|
128
128
|
return True
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
self.log.info("Setting Pilatus threshold...")
|
|
131
131
|
for i in range(3):
|
|
132
132
|
logging.getLogger("user_level_log").info("Setting Pilatus threshold...")
|
|
133
133
|
|
|
@@ -137,27 +137,25 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
137
137
|
time.sleep(2)
|
|
138
138
|
# Using epics because we need 'as_string' option
|
|
139
139
|
status = self.pv_status.get(as_string=True)
|
|
140
|
-
|
|
140
|
+
self.log.info("Pilatus status: %s" % status)
|
|
141
141
|
|
|
142
142
|
while status == "Setting threshold":
|
|
143
|
-
|
|
144
|
-
"Pilatus status: %s (this may take a minute)..." % status
|
|
145
|
-
)
|
|
143
|
+
self.log.info("Pilatus status: %s (this may take a minute)..." % status)
|
|
146
144
|
time.sleep(3)
|
|
147
145
|
status = self.pv_status.get(as_string=True)
|
|
148
146
|
|
|
149
147
|
self.threshold = self.get_threshold_energy()
|
|
150
|
-
|
|
148
|
+
self.log.info(
|
|
151
149
|
"Pilatus: current threshold is %s (target is %s)"
|
|
152
150
|
% (self.threshold, target_threshold)
|
|
153
151
|
)
|
|
154
152
|
if status == "Camserver returned OK" and self.threshold == target_threshold:
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
self.log.info("Pilatus status: %s" % status)
|
|
154
|
+
self.log.info("Pilatus threshold successfully set.")
|
|
157
155
|
return True
|
|
158
156
|
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
self.log.error("Pilatus status: %s" % status)
|
|
158
|
+
self.log.error(
|
|
161
159
|
"Error while setting Pilatus threshold. Please, check the detector."
|
|
162
160
|
)
|
|
163
161
|
return False
|
|
@@ -177,22 +175,22 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
177
175
|
try:
|
|
178
176
|
float(wavelength)
|
|
179
177
|
except Exception as e:
|
|
180
|
-
|
|
178
|
+
self.log.error(
|
|
181
179
|
"Error while setting Pilatus wavelength. Value must be float."
|
|
182
180
|
)
|
|
183
181
|
|
|
184
|
-
|
|
182
|
+
self.log.exception("")
|
|
185
183
|
return False
|
|
186
184
|
|
|
187
185
|
# if abs(self.wavelength - wavelength) < 0.0001:
|
|
188
|
-
#
|
|
186
|
+
# self.log.info(
|
|
189
187
|
# "Pilatus wavelength still okay."
|
|
190
188
|
# )
|
|
191
189
|
# return True
|
|
192
190
|
|
|
193
191
|
# As the set of Pilatus wavelength, det dist and beam xy is fast,
|
|
194
192
|
# there is no need to compare the target value with the current one.
|
|
195
|
-
|
|
193
|
+
self.log.info("Setting Pilatus wavelength...")
|
|
196
194
|
self.set_channel_value(self.DET_WAVELENGTH, wavelength)
|
|
197
195
|
time.sleep(0.6)
|
|
198
196
|
|
|
@@ -201,10 +199,10 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
201
199
|
print("WAVELENGHT GOT: " + str(self.wavelength))
|
|
202
200
|
|
|
203
201
|
if abs(self.wavelength - wavelength) < 0.0001:
|
|
204
|
-
|
|
202
|
+
self.log.info("Pilatus wavelength successfully set.")
|
|
205
203
|
return True
|
|
206
204
|
|
|
207
|
-
|
|
205
|
+
self.log.error(
|
|
208
206
|
"Error while setting Pilatus wavelength. Please, check the detector."
|
|
209
207
|
)
|
|
210
208
|
return False
|
|
@@ -224,30 +222,30 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
224
222
|
try:
|
|
225
223
|
float(det_distance)
|
|
226
224
|
except Exception as e:
|
|
227
|
-
|
|
225
|
+
self.log.error(
|
|
228
226
|
"Error while setting Pilatus det distance. Value must be float."
|
|
229
227
|
)
|
|
230
228
|
|
|
231
|
-
|
|
229
|
+
self.log.exception("")
|
|
232
230
|
return False
|
|
233
231
|
|
|
234
232
|
# if abs(self.det_distance - det_distance) < 0.001:
|
|
235
|
-
#
|
|
233
|
+
# self.log.info(
|
|
236
234
|
# "Pilatus det distance still okay."
|
|
237
235
|
# )
|
|
238
236
|
# return True
|
|
239
237
|
|
|
240
|
-
|
|
238
|
+
self.log.info("Setting Pilatus det distance...")
|
|
241
239
|
self.set_channel_value(self.DET_DETDIST, det_distance)
|
|
242
240
|
time.sleep(0.3)
|
|
243
241
|
|
|
244
242
|
self.det_distance = self.get_detector_distance()
|
|
245
243
|
|
|
246
244
|
if abs(self.det_distance - det_distance) < 0.001:
|
|
247
|
-
|
|
245
|
+
self.log.info("Pilatus det distance successfully set.")
|
|
248
246
|
return True
|
|
249
247
|
|
|
250
|
-
|
|
248
|
+
self.log.error(
|
|
251
249
|
"Error while setting Pilatus det distance. Please, check the detector."
|
|
252
250
|
)
|
|
253
251
|
return False
|
|
@@ -279,33 +277,33 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
279
277
|
* default_beam_x (value set on xml file)
|
|
280
278
|
"""
|
|
281
279
|
if from_user:
|
|
282
|
-
|
|
280
|
+
self.log.info("Getting beam X from user...")
|
|
283
281
|
beam_x = self.get_user_beam_x()
|
|
284
282
|
|
|
285
283
|
if beam_x is None:
|
|
286
284
|
if from_user:
|
|
287
|
-
|
|
285
|
+
self.log.error(
|
|
288
286
|
"Could not get user beam X. Setting default value (from xml)."
|
|
289
287
|
)
|
|
290
288
|
beam_x = self.default_beam_x
|
|
291
289
|
|
|
292
290
|
# if abs(self.beam_x - beam_x) == 0:
|
|
293
|
-
#
|
|
291
|
+
# self.log.info(
|
|
294
292
|
# "Pilatus beam X still okay."
|
|
295
293
|
# )
|
|
296
294
|
# return True
|
|
297
295
|
|
|
298
|
-
|
|
296
|
+
self.log.info("Setting Pilatus beam X to {}...".format(beam_x))
|
|
299
297
|
self.set_channel_value(self.DET_BEAM_X, beam_x)
|
|
300
298
|
time.sleep(1)
|
|
301
299
|
|
|
302
300
|
self.beam_x = self.get_beam_x()
|
|
303
301
|
|
|
304
302
|
if float(self.beam_x) == float(beam_x):
|
|
305
|
-
|
|
303
|
+
self.log.info("Pilatus det beam X successfully set.")
|
|
306
304
|
return True
|
|
307
305
|
|
|
308
|
-
|
|
306
|
+
self.log.error(
|
|
309
307
|
"Error while setting Pilatus beam X. Please, check the detector."
|
|
310
308
|
)
|
|
311
309
|
return False
|
|
@@ -337,33 +335,33 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
337
335
|
* default_beam_y (value set on xml file)
|
|
338
336
|
"""
|
|
339
337
|
if from_user:
|
|
340
|
-
|
|
338
|
+
self.log.info("Getting beam Y from user...")
|
|
341
339
|
beam_y = self.get_user_beam_y()
|
|
342
340
|
|
|
343
341
|
if beam_y is None:
|
|
344
342
|
if from_user:
|
|
345
|
-
|
|
343
|
+
self.log.error(
|
|
346
344
|
"Could not get user beam Y. Setting default value (from xml)."
|
|
347
345
|
)
|
|
348
346
|
beam_y = self.default_beam_y
|
|
349
347
|
|
|
350
348
|
# if abs(self.beam_y - beam_y) == 0:
|
|
351
|
-
#
|
|
349
|
+
# self.log.info(
|
|
352
350
|
# "Pilatus beam X still okay."
|
|
353
351
|
# )
|
|
354
352
|
# return True
|
|
355
353
|
|
|
356
|
-
|
|
354
|
+
self.log.info("Setting Pilatus beam Y to {}...".format(beam_y))
|
|
357
355
|
self.set_channel_value(self.DET_BEAM_Y, beam_y)
|
|
358
356
|
time.sleep(1)
|
|
359
357
|
|
|
360
358
|
self.beam_y = self.get_beam_y()
|
|
361
359
|
|
|
362
360
|
if float(self.beam_y) == float(beam_y):
|
|
363
|
-
|
|
361
|
+
self.log.info("Pilatus det beam Y successfully set.")
|
|
364
362
|
return True
|
|
365
363
|
|
|
366
|
-
|
|
364
|
+
self.log.error(
|
|
367
365
|
"Error while setting Pilatus beam Y. Please, check the detector."
|
|
368
366
|
)
|
|
369
367
|
return False
|
|
@@ -383,26 +381,24 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
383
381
|
try:
|
|
384
382
|
float(transmission)
|
|
385
383
|
except Exception as e:
|
|
386
|
-
|
|
384
|
+
self.log.error(
|
|
387
385
|
"Error while setting Pilatus transmission. Value must be float."
|
|
388
386
|
)
|
|
389
387
|
|
|
390
|
-
|
|
388
|
+
self.log.exception("")
|
|
391
389
|
return False
|
|
392
390
|
|
|
393
|
-
|
|
394
|
-
"Setting Pilatus transmission to {}...".format(transmission)
|
|
395
|
-
)
|
|
391
|
+
self.log.info("Setting Pilatus transmission to {}...".format(transmission))
|
|
396
392
|
self.set_channel_value(self.DET_TRANSMISSION, transmission)
|
|
397
393
|
time.sleep(0.3)
|
|
398
394
|
|
|
399
395
|
self.transmission = self.get_transmission()
|
|
400
396
|
|
|
401
397
|
if abs(self.transmission - transmission) < 0.0001:
|
|
402
|
-
|
|
398
|
+
self.log.info("Pilatus transmission successfully set.")
|
|
403
399
|
return True
|
|
404
400
|
|
|
405
|
-
|
|
401
|
+
self.log.error(
|
|
406
402
|
"Error while setting Pilatus transmission. Please, check the detector."
|
|
407
403
|
)
|
|
408
404
|
return False
|
|
@@ -422,26 +418,24 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
422
418
|
try:
|
|
423
419
|
float(start_angle)
|
|
424
420
|
except Exception as e:
|
|
425
|
-
|
|
421
|
+
self.log.error(
|
|
426
422
|
"Error while setting Pilatus start angle. Value must be float."
|
|
427
423
|
)
|
|
428
424
|
|
|
429
|
-
|
|
425
|
+
self.log.exception("")
|
|
430
426
|
return False
|
|
431
427
|
|
|
432
|
-
|
|
433
|
-
"Setting Pilatus start angle to {}...".format(start_angle)
|
|
434
|
-
)
|
|
428
|
+
self.log.info("Setting Pilatus start angle to {}...".format(start_angle))
|
|
435
429
|
self.set_channel_value(self.DET_START_ANGLE, start_angle)
|
|
436
430
|
time.sleep(3)
|
|
437
431
|
|
|
438
432
|
self.start_angle = self.get_start_angle()
|
|
439
433
|
|
|
440
434
|
if abs(self.start_angle - start_angle) < 0.0001:
|
|
441
|
-
|
|
435
|
+
self.log.info("Pilatus start angle successfully set.")
|
|
442
436
|
return True
|
|
443
437
|
|
|
444
|
-
|
|
438
|
+
self.log.error(
|
|
445
439
|
"Error while setting Pilatus start angle. Please, check the detector."
|
|
446
440
|
)
|
|
447
441
|
return False
|
|
@@ -461,26 +455,24 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
461
455
|
try:
|
|
462
456
|
float(angle_incr)
|
|
463
457
|
except Exception as e:
|
|
464
|
-
|
|
458
|
+
self.log.error(
|
|
465
459
|
"Error while setting Pilatus angle increment. Value must be float."
|
|
466
460
|
)
|
|
467
461
|
|
|
468
|
-
|
|
462
|
+
self.log.exception("")
|
|
469
463
|
return False
|
|
470
464
|
|
|
471
|
-
|
|
472
|
-
"Setting Pilatus angle increment to {}...".format(angle_incr)
|
|
473
|
-
)
|
|
465
|
+
self.log.info("Setting Pilatus angle increment to {}...".format(angle_incr))
|
|
474
466
|
self.set_channel_value(self.DET_ANGLE_INCR, angle_incr)
|
|
475
467
|
time.sleep(3)
|
|
476
468
|
|
|
477
469
|
self.angle_incr = self.get_angle_incr()
|
|
478
470
|
|
|
479
471
|
if abs(self.angle_incr - angle_incr) < 0.0001:
|
|
480
|
-
|
|
472
|
+
self.log.info("Pilatus angle increment successfully set.")
|
|
481
473
|
return True
|
|
482
474
|
|
|
483
|
-
|
|
475
|
+
self.log.error(
|
|
484
476
|
"Error while setting Pilatus angle increment. Please, check the detector."
|
|
485
477
|
)
|
|
486
478
|
return False
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
# You should have received a copy of the GNU General Lesser Public License
|
|
19
19
|
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
|
|
21
|
-
import logging
|
|
22
21
|
|
|
23
22
|
from mxcubecore import HardwareRepository as HWR
|
|
24
23
|
from mxcubecore.HardwareObjects.abstract.AbstractTransmission import (
|
|
@@ -64,7 +63,7 @@ class LNLSTransmission(EPICSActuator, AbstractTransmission):
|
|
|
64
63
|
_, actual_transmission, filter_setup = get_transmission(energy_val, value)
|
|
65
64
|
actual_transmission = round(actual_transmission * 100, 2)
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
self.log.info(
|
|
68
67
|
"Requested transmission: %s. Closest possible value: %s"
|
|
69
68
|
% (str(value), str(actual_transmission))
|
|
70
69
|
)
|
|
@@ -72,14 +71,12 @@ class LNLSTransmission(EPICSActuator, AbstractTransmission):
|
|
|
72
71
|
# status 0 is ok, status 1 is failure
|
|
73
72
|
foil_status = set_foils(filter_setup)
|
|
74
73
|
except Exception as e:
|
|
75
|
-
|
|
76
|
-
"Error while setting transmission: %s" % str(e)
|
|
77
|
-
)
|
|
74
|
+
self.log.error("Error while setting transmission: %s" % str(e))
|
|
78
75
|
else:
|
|
79
76
|
if foil_status == 0:
|
|
80
|
-
|
|
77
|
+
self.log.info("Transmission is successfully set!")
|
|
81
78
|
return
|
|
82
|
-
|
|
79
|
+
self.log.error(
|
|
83
80
|
"Error: transmission could not be set (returned status %s)."
|
|
84
81
|
% foil_status
|
|
85
82
|
)
|
|
@@ -4,8 +4,6 @@ This module serves to connect to and Ldap server.
|
|
|
4
4
|
It works in principle for ESRF, Soleil Proxima and MAXIV beamlines
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
import logging
|
|
8
|
-
|
|
9
7
|
import ldap
|
|
10
8
|
|
|
11
9
|
from mxcubecore.HardwareObjects.abstract.AbstractAuthenticator import (
|
|
@@ -42,17 +40,15 @@ class LdapAuthenticator(AbstractAuthenticator):
|
|
|
42
40
|
domain = self.get_property("ldapdomain")
|
|
43
41
|
|
|
44
42
|
if ldaphost is None:
|
|
45
|
-
|
|
46
|
-
"LdapAuthenticator: you must specify the LDAP hostname"
|
|
47
|
-
)
|
|
43
|
+
self.log.error("LdapAuthenticator: you must specify the LDAP hostname")
|
|
48
44
|
else:
|
|
49
45
|
if ldapport is None:
|
|
50
|
-
|
|
46
|
+
self.log.debug(
|
|
51
47
|
"LdapAuthenticator: connecting to LDAP server %s", ldaphost
|
|
52
48
|
)
|
|
53
49
|
self._ldapConnection = ldap.initialize("ldap://" + ldaphost)
|
|
54
50
|
else:
|
|
55
|
-
|
|
51
|
+
self.log.debug(
|
|
56
52
|
"LdapAuthenticator: connecting to LDAP server %s:%s",
|
|
57
53
|
ldaphost,
|
|
58
54
|
ldapport,
|
|
@@ -61,7 +57,7 @@ class LdapAuthenticator(AbstractAuthenticator):
|
|
|
61
57
|
"ldap://%s:%s" % (ldaphost, int(ldapport))
|
|
62
58
|
)
|
|
63
59
|
|
|
64
|
-
|
|
60
|
+
self.log.debug(
|
|
65
61
|
"LdapAuthenticator: got connection %s" % str(self._ldapConnection)
|
|
66
62
|
)
|
|
67
63
|
|
|
@@ -73,7 +69,7 @@ class LdapAuthenticator(AbstractAuthenticator):
|
|
|
73
69
|
domstr += "%sdc=%s" % (comma, part)
|
|
74
70
|
comma = ","
|
|
75
71
|
self.domstr = domstr
|
|
76
|
-
|
|
72
|
+
self.log.debug(
|
|
77
73
|
"LdapAuthenticator: got connection %s" % str(self._ldapConnection)
|
|
78
74
|
)
|
|
79
75
|
else:
|
|
@@ -88,12 +84,12 @@ class LdapAuthenticator(AbstractAuthenticator):
|
|
|
88
84
|
ldaphost = self.get_property("ldaphost")
|
|
89
85
|
ldapport = self.get_property("ldapport")
|
|
90
86
|
if ldapport is None:
|
|
91
|
-
|
|
87
|
+
self.log.debug(
|
|
92
88
|
"LdapAuthenticator: reconnecting to LDAP server %s", ldaphost
|
|
93
89
|
)
|
|
94
90
|
self._connect()
|
|
95
91
|
else:
|
|
96
|
-
|
|
92
|
+
self.log.debug(
|
|
97
93
|
"LdapAuthenticator: reconnecting to LDAP server %s:%s",
|
|
98
94
|
ldaphost,
|
|
99
95
|
ldapport,
|
|
@@ -109,7 +105,7 @@ class LdapAuthenticator(AbstractAuthenticator):
|
|
|
109
105
|
|
|
110
106
|
self._reconnect()
|
|
111
107
|
|
|
112
|
-
|
|
108
|
+
self.log.info("LdapAuthenticator: %s" % msg)
|
|
113
109
|
|
|
114
110
|
return False
|
|
115
111
|
|
|
@@ -129,7 +125,7 @@ class LdapAuthenticator(AbstractAuthenticator):
|
|
|
129
125
|
if self._ldapConnection is None:
|
|
130
126
|
return self._cleanup(msg="no LDAP server configured")
|
|
131
127
|
|
|
132
|
-
|
|
128
|
+
self.log.debug(
|
|
133
129
|
"LdapAuthenticator: searching for %s / %s" % (username, self.domstr)
|
|
134
130
|
)
|
|
135
131
|
try:
|
|
@@ -158,14 +154,14 @@ class LdapAuthenticator(AbstractAuthenticator):
|
|
|
158
154
|
if password == "":
|
|
159
155
|
return self._cleanup(msg="invalid password for %s" % username)
|
|
160
156
|
|
|
161
|
-
|
|
157
|
+
self.log.debug("LdapAuthenticator: validating %s" % username)
|
|
162
158
|
|
|
163
159
|
try:
|
|
164
160
|
bind_str = "uid=%s, ou=%s, %s" % (username, self.ldapou, self.domstr)
|
|
165
161
|
except AttributeError:
|
|
166
162
|
bind_str = "uid=%s,%s" % (username, self.domstr)
|
|
167
163
|
|
|
168
|
-
|
|
164
|
+
self.log.debug("LdapAuthenticator: binding to %s" % bind_str)
|
|
169
165
|
handle = self._ldapConnection.simple_bind(bind_str, password)
|
|
170
166
|
|
|
171
167
|
try:
|
|
@@ -15,7 +15,7 @@ from mxcubecore.BaseHardwareObjects import HardwareObjectState
|
|
|
15
15
|
from mxcubecore.CommandContainer import ConnectionError
|
|
16
16
|
from mxcubecore.HardwareObjects.abstract.AbstractDetector import AbstractDetector
|
|
17
17
|
|
|
18
|
-
_logger =
|
|
18
|
+
_logger = self.log
|
|
19
19
|
|
|
20
20
|
_logger_det = logging.getLogger("lima2.client.detector")
|
|
21
21
|
_logger_smx = logging.getLogger("lima2.client.smx")
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
import os
|
|
3
2
|
import subprocess
|
|
4
3
|
import time
|
|
@@ -112,9 +111,7 @@ class LimaPilatusDetector(AbstractDetector):
|
|
|
112
111
|
|
|
113
112
|
except ConnectionError:
|
|
114
113
|
self.update_state(HardwareObjectState.FAULT)
|
|
115
|
-
|
|
116
|
-
"Could not connect to detector %s" % lima_device
|
|
117
|
-
)
|
|
114
|
+
self.log.error("Could not connect to detector %s" % lima_device)
|
|
118
115
|
self._emit_status()
|
|
119
116
|
|
|
120
117
|
def has_shutterless(self):
|
|
@@ -132,20 +132,18 @@ class MAXIVAutoProcessing(HardwareObject):
|
|
|
132
132
|
)
|
|
133
133
|
will_execute = True
|
|
134
134
|
if will_execute:
|
|
135
|
-
|
|
136
|
-
"[MAXIVAutoprocessing] Executing module: %s" % module
|
|
137
|
-
)
|
|
135
|
+
self.log.info("[MAXIVAutoprocessing] Executing module: %s" % module)
|
|
138
136
|
try:
|
|
139
137
|
mod.parse_and_execute()
|
|
140
138
|
except Exception as ex:
|
|
141
|
-
|
|
139
|
+
self.log.error(
|
|
142
140
|
"[MAXIVAutoprocessing] Module %s execution error." % module
|
|
143
141
|
)
|
|
144
142
|
print(module, ex)
|
|
145
143
|
|
|
146
144
|
def autoproc_done(self, current_autoproc):
|
|
147
145
|
self.current_autoproc_procedure = None
|
|
148
|
-
|
|
146
|
+
self.log.info("Autoprocessing executed.")
|
|
149
147
|
|
|
150
148
|
def create_autoproc_input(self, event, params):
|
|
151
149
|
WAIT_XDS_TIMEOUT = 20
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
import math
|
|
3
2
|
import time
|
|
4
3
|
|
|
@@ -423,4 +422,4 @@ class MD3UP(Microdiff.Microdiff):
|
|
|
423
422
|
self.centringPhiz.set_value(phiz)
|
|
424
423
|
except Exception:
|
|
425
424
|
msg = "MiniDiff: could not center to beam, aborting"
|
|
426
|
-
|
|
425
|
+
self.log.exception(msg)
|
|
@@ -51,7 +51,7 @@ class MachCurrent(AbstractMachineInfo):
|
|
|
51
51
|
curr.connect_signal("update", self.value_changed)
|
|
52
52
|
self.update_state(self.STATES.READY)
|
|
53
53
|
except Exception as err:
|
|
54
|
-
|
|
54
|
+
self.log.exception(err)
|
|
55
55
|
|
|
56
56
|
def value_changed(self, value):
|
|
57
57
|
"""Get information from the control software, emit valueChanged"""
|
|
@@ -64,7 +64,7 @@ class MachCurrent(AbstractMachineInfo):
|
|
|
64
64
|
|
|
65
65
|
refill = self.get_channel_object("RefillCountdown").get_value()
|
|
66
66
|
except Exception as err:
|
|
67
|
-
|
|
67
|
+
self.log.exception(err)
|
|
68
68
|
opmsg, fillmode, value, refill = ("", "", -1, -1)
|
|
69
69
|
|
|
70
70
|
if opmsg and opmsg != self.opmsg:
|
|
@@ -80,19 +80,19 @@ class MachCurrent(AbstractMachineInfo):
|
|
|
80
80
|
try:
|
|
81
81
|
return self.get_channel_object("Current").get_value()
|
|
82
82
|
except Exception as err:
|
|
83
|
-
|
|
83
|
+
self.log.exception(err)
|
|
84
84
|
return -1
|
|
85
85
|
|
|
86
86
|
def get_message(self) -> str:
|
|
87
87
|
try:
|
|
88
88
|
return self.get_channel_object("OperatorMsg").get_value()
|
|
89
89
|
except Exception as err:
|
|
90
|
-
|
|
90
|
+
self.log.exception(err)
|
|
91
91
|
return ""
|
|
92
92
|
|
|
93
93
|
def get_fill_mode(self) -> str:
|
|
94
94
|
try:
|
|
95
95
|
return self.get_channel_object("FillingMode").get_value()
|
|
96
96
|
except Exception as err:
|
|
97
|
-
|
|
97
|
+
self.log.exception(err)
|
|
98
98
|
return ""
|