mxcubecore 1.392.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/BaseHardwareObjects.py +1 -1
- mxcubecore/Command/Epics.py +2 -2
- mxcubecore/Command/Pool.py +4 -4
- mxcubecore/Command/Sardana.py +7 -3
- mxcubecore/Command/Taco.py +2 -2
- mxcubecore/Command/Tango.py +2 -2
- mxcubecore/Command/Tine.py +1 -1
- mxcubecore/Command/exporter/ExporterClient.py +2 -2
- mxcubecore/Command/exporter/StandardClient.py +4 -3
- 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 +3 -3
- mxcubecore/HardwareObjects/BlissMotorWPositions.py +4 -7
- mxcubecore/HardwareObjects/Cats90.py +33 -43
- mxcubecore/HardwareObjects/CatsBessy.py +1 -1
- mxcubecore/HardwareObjects/CatsMaint.py +2 -2
- mxcubecore/HardwareObjects/CentringMath.py +5 -4
- mxcubecore/HardwareObjects/DESY/DigitalZoomMotor.py +4 -4
- mxcubecore/HardwareObjects/DESY/MjpgStreamVideo.py +2 -0
- mxcubecore/HardwareObjects/DESY/P11Collect.py +7 -7
- mxcubecore/HardwareObjects/DESY/P11EDNACharacterisation.py +14 -16
- mxcubecore/HardwareObjects/DESY/P11ISPyBClient.py +6 -10
- mxcubecore/HardwareObjects/DESY/P11NanoDiff.py +6 -4
- 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/EMBLBeamlineTest.py +2 -0
- mxcubecore/HardwareObjects/EMBL/EMBLDoorInterlock.py +1 -1
- mxcubecore/HardwareObjects/EMBL/EMBLEnergy.py +10 -18
- mxcubecore/HardwareObjects/EMBL/EMBLEnergyScan.py +10 -12
- 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 -2
- 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 -2
- mxcubecore/HardwareObjects/ESRF/ESRFEnergyScan.py +3 -3
- mxcubecore/HardwareObjects/ESRF/ESRFMetadataManagerClient.py +1 -1
- 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 +3 -3
- 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 -1
- 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 +21 -29
- mxcubecore/HardwareObjects/LNLS/LNLSDetDistMotor.py +7 -11
- mxcubecore/HardwareObjects/LNLS/LNLSEnergy.py +4 -6
- mxcubecore/HardwareObjects/LNLS/LNLSPilatusDet.py +55 -51
- 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 -1
- mxcubecore/HardwareObjects/MicrodiffInOut.py +1 -1
- mxcubecore/HardwareObjects/MicrodiffKappaMotor.py +3 -4
- mxcubecore/HardwareObjects/MiniDiff.py +35 -57
- mxcubecore/HardwareObjects/MotorWPositions.py +4 -2
- 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 -1
- 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 -1
- 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 -1
- mxcubecore/HardwareObjects/UserTypeISPyBLims.py +8 -8
- mxcubecore/HardwareObjects/XMLRPCServer.py +20 -22
- 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/AbstractMultiCollect.py +6 -6
- mxcubecore/HardwareObjects/abstract/AbstractNState.py +1 -1
- mxcubecore/HardwareObjects/abstract/AbstractProcedure.py +3 -4
- mxcubecore/HardwareObjects/abstract/AbstractSampleChanger.py +1 -1
- mxcubecore/HardwareObjects/abstract/AbstractVideoDevice.py +5 -5
- mxcubecore/HardwareObjects/abstract/AbstractXRFSpectrum.py +2 -0
- mxcubecore/HardwareObjects/abstract/ISPyBAbstractLims.py +11 -13
- mxcubecore/HardwareObjects/abstract/ISPyBDataAdapter.py +3 -3
- mxcubecore/HardwareObjects/abstract/sample_changer/Crims.py +8 -0
- mxcubecore/HardwareObjects/mockup/BeamlineTestMockup.py +12 -13
- 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/TaskUtils.py +2 -0
- mxcubecore/queue_entry/base_queue_entry.py +2 -2
- mxcubecore/queue_entry/energy_scan.py +1 -1
- mxcubecore/saferef.py +2 -1
- mxcubecore/utils/qt_import.py +8 -7
- {mxcubecore-1.392.0.dist-info → mxcubecore-1.394.0.dist-info}/METADATA +1 -1
- {mxcubecore-1.392.0.dist-info → mxcubecore-1.394.0.dist-info}/RECORD +195 -195
- {mxcubecore-1.392.0.dist-info → mxcubecore-1.394.0.dist-info}/COPYING +0 -0
- {mxcubecore-1.392.0.dist-info → mxcubecore-1.394.0.dist-info}/COPYING.LESSER +0 -0
- {mxcubecore-1.392.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,16 +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
|
+
|
|
123
|
+
self.log.exception("")
|
|
122
124
|
return False
|
|
123
125
|
|
|
124
126
|
target_threshold = energy / 2
|
|
125
127
|
if abs(self.get_threshold_energy() - target_threshold) < 0.0001:
|
|
126
128
|
return True
|
|
127
129
|
|
|
128
|
-
|
|
130
|
+
self.log.info("Setting Pilatus threshold...")
|
|
129
131
|
for i in range(3):
|
|
130
132
|
logging.getLogger("user_level_log").info("Setting Pilatus threshold...")
|
|
131
133
|
|
|
@@ -135,27 +137,25 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
135
137
|
time.sleep(2)
|
|
136
138
|
# Using epics because we need 'as_string' option
|
|
137
139
|
status = self.pv_status.get(as_string=True)
|
|
138
|
-
|
|
140
|
+
self.log.info("Pilatus status: %s" % status)
|
|
139
141
|
|
|
140
142
|
while status == "Setting threshold":
|
|
141
|
-
|
|
142
|
-
"Pilatus status: %s (this may take a minute)..." % status
|
|
143
|
-
)
|
|
143
|
+
self.log.info("Pilatus status: %s (this may take a minute)..." % status)
|
|
144
144
|
time.sleep(3)
|
|
145
145
|
status = self.pv_status.get(as_string=True)
|
|
146
146
|
|
|
147
147
|
self.threshold = self.get_threshold_energy()
|
|
148
|
-
|
|
148
|
+
self.log.info(
|
|
149
149
|
"Pilatus: current threshold is %s (target is %s)"
|
|
150
150
|
% (self.threshold, target_threshold)
|
|
151
151
|
)
|
|
152
152
|
if status == "Camserver returned OK" and self.threshold == target_threshold:
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
self.log.info("Pilatus status: %s" % status)
|
|
154
|
+
self.log.info("Pilatus threshold successfully set.")
|
|
155
155
|
return True
|
|
156
156
|
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
self.log.error("Pilatus status: %s" % status)
|
|
158
|
+
self.log.error(
|
|
159
159
|
"Error while setting Pilatus threshold. Please, check the detector."
|
|
160
160
|
)
|
|
161
161
|
return False
|
|
@@ -175,20 +175,22 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
175
175
|
try:
|
|
176
176
|
float(wavelength)
|
|
177
177
|
except Exception as e:
|
|
178
|
-
|
|
178
|
+
self.log.error(
|
|
179
179
|
"Error while setting Pilatus wavelength. Value must be float."
|
|
180
180
|
)
|
|
181
|
+
|
|
182
|
+
self.log.exception("")
|
|
181
183
|
return False
|
|
182
184
|
|
|
183
185
|
# if abs(self.wavelength - wavelength) < 0.0001:
|
|
184
|
-
#
|
|
186
|
+
# self.log.info(
|
|
185
187
|
# "Pilatus wavelength still okay."
|
|
186
188
|
# )
|
|
187
189
|
# return True
|
|
188
190
|
|
|
189
191
|
# As the set of Pilatus wavelength, det dist and beam xy is fast,
|
|
190
192
|
# there is no need to compare the target value with the current one.
|
|
191
|
-
|
|
193
|
+
self.log.info("Setting Pilatus wavelength...")
|
|
192
194
|
self.set_channel_value(self.DET_WAVELENGTH, wavelength)
|
|
193
195
|
time.sleep(0.6)
|
|
194
196
|
|
|
@@ -197,10 +199,10 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
197
199
|
print("WAVELENGHT GOT: " + str(self.wavelength))
|
|
198
200
|
|
|
199
201
|
if abs(self.wavelength - wavelength) < 0.0001:
|
|
200
|
-
|
|
202
|
+
self.log.info("Pilatus wavelength successfully set.")
|
|
201
203
|
return True
|
|
202
204
|
|
|
203
|
-
|
|
205
|
+
self.log.error(
|
|
204
206
|
"Error while setting Pilatus wavelength. Please, check the detector."
|
|
205
207
|
)
|
|
206
208
|
return False
|
|
@@ -220,28 +222,30 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
220
222
|
try:
|
|
221
223
|
float(det_distance)
|
|
222
224
|
except Exception as e:
|
|
223
|
-
|
|
225
|
+
self.log.error(
|
|
224
226
|
"Error while setting Pilatus det distance. Value must be float."
|
|
225
227
|
)
|
|
228
|
+
|
|
229
|
+
self.log.exception("")
|
|
226
230
|
return False
|
|
227
231
|
|
|
228
232
|
# if abs(self.det_distance - det_distance) < 0.001:
|
|
229
|
-
#
|
|
233
|
+
# self.log.info(
|
|
230
234
|
# "Pilatus det distance still okay."
|
|
231
235
|
# )
|
|
232
236
|
# return True
|
|
233
237
|
|
|
234
|
-
|
|
238
|
+
self.log.info("Setting Pilatus det distance...")
|
|
235
239
|
self.set_channel_value(self.DET_DETDIST, det_distance)
|
|
236
240
|
time.sleep(0.3)
|
|
237
241
|
|
|
238
242
|
self.det_distance = self.get_detector_distance()
|
|
239
243
|
|
|
240
244
|
if abs(self.det_distance - det_distance) < 0.001:
|
|
241
|
-
|
|
245
|
+
self.log.info("Pilatus det distance successfully set.")
|
|
242
246
|
return True
|
|
243
247
|
|
|
244
|
-
|
|
248
|
+
self.log.error(
|
|
245
249
|
"Error while setting Pilatus det distance. Please, check the detector."
|
|
246
250
|
)
|
|
247
251
|
return False
|
|
@@ -273,33 +277,33 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
273
277
|
* default_beam_x (value set on xml file)
|
|
274
278
|
"""
|
|
275
279
|
if from_user:
|
|
276
|
-
|
|
280
|
+
self.log.info("Getting beam X from user...")
|
|
277
281
|
beam_x = self.get_user_beam_x()
|
|
278
282
|
|
|
279
283
|
if beam_x is None:
|
|
280
284
|
if from_user:
|
|
281
|
-
|
|
285
|
+
self.log.error(
|
|
282
286
|
"Could not get user beam X. Setting default value (from xml)."
|
|
283
287
|
)
|
|
284
288
|
beam_x = self.default_beam_x
|
|
285
289
|
|
|
286
290
|
# if abs(self.beam_x - beam_x) == 0:
|
|
287
|
-
#
|
|
291
|
+
# self.log.info(
|
|
288
292
|
# "Pilatus beam X still okay."
|
|
289
293
|
# )
|
|
290
294
|
# return True
|
|
291
295
|
|
|
292
|
-
|
|
296
|
+
self.log.info("Setting Pilatus beam X to {}...".format(beam_x))
|
|
293
297
|
self.set_channel_value(self.DET_BEAM_X, beam_x)
|
|
294
298
|
time.sleep(1)
|
|
295
299
|
|
|
296
300
|
self.beam_x = self.get_beam_x()
|
|
297
301
|
|
|
298
302
|
if float(self.beam_x) == float(beam_x):
|
|
299
|
-
|
|
303
|
+
self.log.info("Pilatus det beam X successfully set.")
|
|
300
304
|
return True
|
|
301
305
|
|
|
302
|
-
|
|
306
|
+
self.log.error(
|
|
303
307
|
"Error while setting Pilatus beam X. Please, check the detector."
|
|
304
308
|
)
|
|
305
309
|
return False
|
|
@@ -331,33 +335,33 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
331
335
|
* default_beam_y (value set on xml file)
|
|
332
336
|
"""
|
|
333
337
|
if from_user:
|
|
334
|
-
|
|
338
|
+
self.log.info("Getting beam Y from user...")
|
|
335
339
|
beam_y = self.get_user_beam_y()
|
|
336
340
|
|
|
337
341
|
if beam_y is None:
|
|
338
342
|
if from_user:
|
|
339
|
-
|
|
343
|
+
self.log.error(
|
|
340
344
|
"Could not get user beam Y. Setting default value (from xml)."
|
|
341
345
|
)
|
|
342
346
|
beam_y = self.default_beam_y
|
|
343
347
|
|
|
344
348
|
# if abs(self.beam_y - beam_y) == 0:
|
|
345
|
-
#
|
|
349
|
+
# self.log.info(
|
|
346
350
|
# "Pilatus beam X still okay."
|
|
347
351
|
# )
|
|
348
352
|
# return True
|
|
349
353
|
|
|
350
|
-
|
|
354
|
+
self.log.info("Setting Pilatus beam Y to {}...".format(beam_y))
|
|
351
355
|
self.set_channel_value(self.DET_BEAM_Y, beam_y)
|
|
352
356
|
time.sleep(1)
|
|
353
357
|
|
|
354
358
|
self.beam_y = self.get_beam_y()
|
|
355
359
|
|
|
356
360
|
if float(self.beam_y) == float(beam_y):
|
|
357
|
-
|
|
361
|
+
self.log.info("Pilatus det beam Y successfully set.")
|
|
358
362
|
return True
|
|
359
363
|
|
|
360
|
-
|
|
364
|
+
self.log.error(
|
|
361
365
|
"Error while setting Pilatus beam Y. Please, check the detector."
|
|
362
366
|
)
|
|
363
367
|
return False
|
|
@@ -377,24 +381,24 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
377
381
|
try:
|
|
378
382
|
float(transmission)
|
|
379
383
|
except Exception as e:
|
|
380
|
-
|
|
384
|
+
self.log.error(
|
|
381
385
|
"Error while setting Pilatus transmission. Value must be float."
|
|
382
386
|
)
|
|
387
|
+
|
|
388
|
+
self.log.exception("")
|
|
383
389
|
return False
|
|
384
390
|
|
|
385
|
-
|
|
386
|
-
"Setting Pilatus transmission to {}...".format(transmission)
|
|
387
|
-
)
|
|
391
|
+
self.log.info("Setting Pilatus transmission to {}...".format(transmission))
|
|
388
392
|
self.set_channel_value(self.DET_TRANSMISSION, transmission)
|
|
389
393
|
time.sleep(0.3)
|
|
390
394
|
|
|
391
395
|
self.transmission = self.get_transmission()
|
|
392
396
|
|
|
393
397
|
if abs(self.transmission - transmission) < 0.0001:
|
|
394
|
-
|
|
398
|
+
self.log.info("Pilatus transmission successfully set.")
|
|
395
399
|
return True
|
|
396
400
|
|
|
397
|
-
|
|
401
|
+
self.log.error(
|
|
398
402
|
"Error while setting Pilatus transmission. Please, check the detector."
|
|
399
403
|
)
|
|
400
404
|
return False
|
|
@@ -414,24 +418,24 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
414
418
|
try:
|
|
415
419
|
float(start_angle)
|
|
416
420
|
except Exception as e:
|
|
417
|
-
|
|
421
|
+
self.log.error(
|
|
418
422
|
"Error while setting Pilatus start angle. Value must be float."
|
|
419
423
|
)
|
|
424
|
+
|
|
425
|
+
self.log.exception("")
|
|
420
426
|
return False
|
|
421
427
|
|
|
422
|
-
|
|
423
|
-
"Setting Pilatus start angle to {}...".format(start_angle)
|
|
424
|
-
)
|
|
428
|
+
self.log.info("Setting Pilatus start angle to {}...".format(start_angle))
|
|
425
429
|
self.set_channel_value(self.DET_START_ANGLE, start_angle)
|
|
426
430
|
time.sleep(3)
|
|
427
431
|
|
|
428
432
|
self.start_angle = self.get_start_angle()
|
|
429
433
|
|
|
430
434
|
if abs(self.start_angle - start_angle) < 0.0001:
|
|
431
|
-
|
|
435
|
+
self.log.info("Pilatus start angle successfully set.")
|
|
432
436
|
return True
|
|
433
437
|
|
|
434
|
-
|
|
438
|
+
self.log.error(
|
|
435
439
|
"Error while setting Pilatus start angle. Please, check the detector."
|
|
436
440
|
)
|
|
437
441
|
return False
|
|
@@ -451,24 +455,24 @@ class LNLSPilatusDet(AbstractDetector):
|
|
|
451
455
|
try:
|
|
452
456
|
float(angle_incr)
|
|
453
457
|
except Exception as e:
|
|
454
|
-
|
|
458
|
+
self.log.error(
|
|
455
459
|
"Error while setting Pilatus angle increment. Value must be float."
|
|
456
460
|
)
|
|
461
|
+
|
|
462
|
+
self.log.exception("")
|
|
457
463
|
return False
|
|
458
464
|
|
|
459
|
-
|
|
460
|
-
"Setting Pilatus angle increment to {}...".format(angle_incr)
|
|
461
|
-
)
|
|
465
|
+
self.log.info("Setting Pilatus angle increment to {}...".format(angle_incr))
|
|
462
466
|
self.set_channel_value(self.DET_ANGLE_INCR, angle_incr)
|
|
463
467
|
time.sleep(3)
|
|
464
468
|
|
|
465
469
|
self.angle_incr = self.get_angle_incr()
|
|
466
470
|
|
|
467
471
|
if abs(self.angle_incr - angle_incr) < 0.0001:
|
|
468
|
-
|
|
472
|
+
self.log.info("Pilatus angle increment successfully set.")
|
|
469
473
|
return True
|
|
470
474
|
|
|
471
|
-
|
|
475
|
+
self.log.error(
|
|
472
476
|
"Error while setting Pilatus angle increment. Please, check the detector."
|
|
473
477
|
)
|
|
474
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 ""
|