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
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""ESRF SC3 Sample Changer Hardware Object"""
|
|
2
2
|
|
|
3
3
|
import functools
|
|
4
|
-
import logging
|
|
5
4
|
|
|
6
5
|
import SC3
|
|
7
6
|
|
|
@@ -40,7 +39,7 @@ class ESRFSC3(SC3.SC3):
|
|
|
40
39
|
try:
|
|
41
40
|
self.operationalFlagsChanged(chan)
|
|
42
41
|
except Exception:
|
|
43
|
-
|
|
42
|
+
self.log.exception(
|
|
44
43
|
"%s: error getting SC vs MD operational flags" % self.name()
|
|
45
44
|
)
|
|
46
45
|
|
|
@@ -53,7 +52,7 @@ class ESRFSC3(SC3.SC3):
|
|
|
53
52
|
|
|
54
53
|
def __getSample(self, sample_id, sample_location):
|
|
55
54
|
if sample_id and sample_location:
|
|
56
|
-
|
|
55
|
+
self.log.debug(
|
|
57
56
|
"%s: both sample barcode and location provided, discarding barcode...",
|
|
58
57
|
self.name(),
|
|
59
58
|
)
|
|
@@ -103,10 +102,10 @@ class ESRFSC3(SC3.SC3):
|
|
|
103
102
|
)
|
|
104
103
|
|
|
105
104
|
if loaded:
|
|
106
|
-
|
|
105
|
+
self.log.debug("%s: sample is loaded", self.name())
|
|
107
106
|
|
|
108
107
|
if self.prepareCentringAfterLoad and prepareCentring:
|
|
109
|
-
|
|
108
|
+
self.log.debug(
|
|
110
109
|
"%s: preparing minidiff for sample centring", self.name()
|
|
111
110
|
)
|
|
112
111
|
self.emit("stateChanged", SC3.SampleChangerState.Moving)
|
|
@@ -125,7 +124,7 @@ class ESRFSC3(SC3.SC3):
|
|
|
125
124
|
pass
|
|
126
125
|
|
|
127
126
|
def __load_sample(self, holderLength, sample_id, sample_location):
|
|
128
|
-
|
|
127
|
+
self.log.debug("%s: in load_sample", self.name())
|
|
129
128
|
|
|
130
129
|
sample = self.__getSample(sample_id, sample_location)
|
|
131
130
|
|
|
@@ -134,7 +133,7 @@ class ESRFSC3(SC3.SC3):
|
|
|
134
133
|
|
|
135
134
|
if not holderLength:
|
|
136
135
|
holderLength = 22
|
|
137
|
-
|
|
136
|
+
self.log.debug(
|
|
138
137
|
"%s: loading sample: using default holder length (%d mm)",
|
|
139
138
|
self.name(),
|
|
140
139
|
holderLength,
|
|
@@ -185,9 +184,7 @@ class ESRFSC3(SC3.SC3):
|
|
|
185
184
|
)
|
|
186
185
|
|
|
187
186
|
if unloaded:
|
|
188
|
-
|
|
189
|
-
"%s: sample has been unloaded", self.name()
|
|
190
|
-
)
|
|
187
|
+
self.log.debug("%s: sample has been unloaded", self.name())
|
|
191
188
|
|
|
192
189
|
self.emit("statusChanged", "Ready")
|
|
193
190
|
|
|
@@ -199,7 +196,7 @@ class ESRFSC3(SC3.SC3):
|
|
|
199
196
|
|
|
200
197
|
if not holderLength:
|
|
201
198
|
holderLength = 22
|
|
202
|
-
|
|
199
|
+
self.log.debug(
|
|
203
200
|
"%s: unloading sample: using default holder length (%d mm)",
|
|
204
201
|
self.name(),
|
|
205
202
|
holderLength,
|
|
@@ -236,9 +233,7 @@ class ESRFSC3(SC3.SC3):
|
|
|
236
233
|
try:
|
|
237
234
|
val = int(val)
|
|
238
235
|
except Exception:
|
|
239
|
-
|
|
240
|
-
"%s: error reading operational flags" % self.name()
|
|
241
|
-
)
|
|
236
|
+
self.log.exception("%s: error reading operational flags" % self.name())
|
|
242
237
|
return
|
|
243
238
|
|
|
244
239
|
old_sc_can_load = self.lastOperationalFlags & ESRFSC3.FLAG_SC_CAN_LOAD
|
|
@@ -274,9 +269,7 @@ class ESRFSC3(SC3.SC3):
|
|
|
274
269
|
try:
|
|
275
270
|
self.unlockMinidiffMotors()
|
|
276
271
|
except Exception:
|
|
277
|
-
|
|
278
|
-
"%s: error unlocking minidiff motors" % self.name()
|
|
279
|
-
)
|
|
272
|
+
self.log.exception("%s: error unlocking minidiff motors" % self.name())
|
|
280
273
|
return False
|
|
281
274
|
return True
|
|
282
275
|
|
|
@@ -285,7 +278,7 @@ class ESRFSC3(SC3.SC3):
|
|
|
285
278
|
try:
|
|
286
279
|
r=self._moveToLoadingPosition()
|
|
287
280
|
except:
|
|
288
|
-
|
|
281
|
+
self.log.exception("%s: error moving sample changer to loading position" % self.name())
|
|
289
282
|
return False
|
|
290
283
|
return True
|
|
291
284
|
"""
|
|
@@ -26,9 +26,7 @@ class ID29HutchTrigger(BaseHardwareObjects.HardwareObject):
|
|
|
26
26
|
self.device = PyTango.gevent.DeviceProxy(self.get_property("tangoname"))
|
|
27
27
|
except PyTango.DevFailed as traceback:
|
|
28
28
|
last_error = traceback[-1]
|
|
29
|
-
|
|
30
|
-
"%s: %s", str(self.name()), last_error["desc"]
|
|
31
|
-
)
|
|
29
|
+
self.log.error("%s: %s", str(self.name()), last_error["desc"])
|
|
32
30
|
self.device = None
|
|
33
31
|
|
|
34
32
|
self.pollingTask = None
|
|
@@ -43,7 +41,7 @@ class ID29HutchTrigger(BaseHardwareObjects.HardwareObject):
|
|
|
43
41
|
except Exception:
|
|
44
42
|
logging.getLogger().error("%s: cannot find PSS number", self.name())
|
|
45
43
|
|
|
46
|
-
|
|
44
|
+
self.log.exception("")
|
|
47
45
|
return
|
|
48
46
|
|
|
49
47
|
if self.device is not None:
|
|
@@ -22,7 +22,7 @@ class MD2MultiCollect(ESRFMultiCollect):
|
|
|
22
22
|
comment = HWR.beamline.sample_changer.get_crystal_id()
|
|
23
23
|
data_collect_parameters["comment"] = comment
|
|
24
24
|
except Exception:
|
|
25
|
-
|
|
25
|
+
self.log.exception("")
|
|
26
26
|
|
|
27
27
|
@task
|
|
28
28
|
def get_beam_size(self):
|
|
@@ -67,7 +67,7 @@ class MD2MultiCollect(ESRFMultiCollect):
|
|
|
67
67
|
try:
|
|
68
68
|
diffr.open_detector_cover()
|
|
69
69
|
except Exception:
|
|
70
|
-
|
|
70
|
+
self.log.exception("Could not open detector cover")
|
|
71
71
|
"""
|
|
72
72
|
try:
|
|
73
73
|
detcover = self.get_object_by_role("controller").detcover
|
|
@@ -75,7 +75,7 @@ class MD2MultiCollect(ESRFMultiCollect):
|
|
|
75
75
|
if detcover.state == "IN":
|
|
76
76
|
detcover.set_out(10)
|
|
77
77
|
except:
|
|
78
|
-
|
|
78
|
+
self.log.exception("Could not open detector cover")
|
|
79
79
|
"""
|
|
80
80
|
|
|
81
81
|
# send again the command as MD2 software only handles one
|
|
@@ -114,7 +114,7 @@ class MD2MultiCollect(ESRFMultiCollect):
|
|
|
114
114
|
|
|
115
115
|
if sequence_trigger:
|
|
116
116
|
msg = "Using LIMA sequnce trigger mode for Eiger"
|
|
117
|
-
|
|
117
|
+
self.log.info(msg)
|
|
118
118
|
mesh_total_nb_frames = self.mesh_num_lines
|
|
119
119
|
else:
|
|
120
120
|
mesh_total_nb_frames = self.mesh_total_nb_frames
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import json
|
|
2
|
-
import logging
|
|
3
2
|
import pathlib
|
|
4
3
|
|
|
5
4
|
from mxcubecore import HardwareRepository as HWR
|
|
@@ -18,7 +17,7 @@ class SSXICATLIMS(ICATLIMS):
|
|
|
18
17
|
pass
|
|
19
18
|
|
|
20
19
|
def finalize_data_collection(self, parameters):
|
|
21
|
-
|
|
20
|
+
self.log.info("Storing data to ICAT")
|
|
22
21
|
collection_parameters = parameters["collection_parameters"]
|
|
23
22
|
beamline_parameters = parameters["beamline_parameters"]
|
|
24
23
|
data_path = parameters["data_path"]
|
|
@@ -32,10 +31,14 @@ class SSXICATLIMS(ICATLIMS):
|
|
|
32
31
|
"MX_beamSizeAtSampleY": beamline_parameters.beam_size_y,
|
|
33
32
|
"MX_detectorDistance": beamline_parameters.detector_distance,
|
|
34
33
|
"MX_directory": data_path,
|
|
35
|
-
"MX_exposureTime":
|
|
34
|
+
"MX_exposureTime": (
|
|
35
|
+
collection_parameters.user_collection_parameters.exp_time
|
|
36
|
+
),
|
|
36
37
|
"MX_flux": extra_lims_values.flux_start,
|
|
37
38
|
"MX_fluxEnd": extra_lims_values.flux_end,
|
|
38
|
-
"MX_numberOfImages":
|
|
39
|
+
"MX_numberOfImages": (
|
|
40
|
+
collection_parameters.collection_parameters.num_images
|
|
41
|
+
),
|
|
39
42
|
"MX_resolution": beamline_parameters.resolution,
|
|
40
43
|
"MX_transmission": beamline_parameters.transmission,
|
|
41
44
|
"MX_xBeam": beamline_parameters.beam_x,
|
|
@@ -63,7 +66,7 @@ class SSXICATLIMS(ICATLIMS):
|
|
|
63
66
|
icat_metadata_path = pathlib.Path(data_path) / "metadata.json"
|
|
64
67
|
with open(icat_metadata_path, "w") as f:
|
|
65
68
|
f.write(json.dumps(data, indent=4))
|
|
66
|
-
|
|
69
|
+
self.log.info(f"Wrote {icat_metadata_path}")
|
|
67
70
|
|
|
68
71
|
except Exception as e:
|
|
69
|
-
|
|
72
|
+
self.log.exception("Failed uploading to ICAT (%s)", e)
|
|
@@ -97,12 +97,12 @@ class EdnaWorkflow(HardwareObject):
|
|
|
97
97
|
return self.command_failed
|
|
98
98
|
|
|
99
99
|
def set_command_failed(self, *args):
|
|
100
|
-
|
|
100
|
+
self.log.error("Workflow '%s' Tango command failed!", args[1])
|
|
101
101
|
self.command_failed = True
|
|
102
102
|
|
|
103
103
|
def state_changed(self, new_value):
|
|
104
104
|
new_value = str(new_value)
|
|
105
|
-
|
|
105
|
+
self.log.debug(f"{self.name}: state changed to {new_value}")
|
|
106
106
|
self.emit("stateChanged", (new_value,))
|
|
107
107
|
|
|
108
108
|
def workflow_end(self):
|
|
@@ -155,7 +155,7 @@ class EdnaWorkflow(HardwareObject):
|
|
|
155
155
|
|
|
156
156
|
def abort(self):
|
|
157
157
|
self.generateNewToken()
|
|
158
|
-
|
|
158
|
+
self.log.info("Aborting current workflow")
|
|
159
159
|
# If necessary unblock dialog
|
|
160
160
|
if not self.gevent_event.is_set():
|
|
161
161
|
self.gevent_event.set()
|
|
@@ -164,11 +164,11 @@ class EdnaWorkflow(HardwareObject):
|
|
|
164
164
|
abort_URL = (
|
|
165
165
|
f"http://{self.bes_host}:{self.bes_port}/ABORT/{self.bes_workflow_id}"
|
|
166
166
|
)
|
|
167
|
-
|
|
167
|
+
self.log.info("BES abort web service URL: %r", abort_URL)
|
|
168
168
|
response = requests.get(abort_URL)
|
|
169
169
|
if response.status_code == 200:
|
|
170
170
|
workflow_status = response.text
|
|
171
|
-
|
|
171
|
+
self.log.info(
|
|
172
172
|
"BES workflow id %s: %s", self.bes_workflow_id, workflow_status
|
|
173
173
|
)
|
|
174
174
|
self.state.value = "ON"
|
|
@@ -221,7 +221,7 @@ class EdnaWorkflow(HardwareObject):
|
|
|
221
221
|
|
|
222
222
|
xml_rpc_server = HWR.beamline.xml_rpc_server
|
|
223
223
|
if xml_rpc_server is None:
|
|
224
|
-
|
|
224
|
+
self.log.warning("No XMLRPCServer configured")
|
|
225
225
|
return
|
|
226
226
|
|
|
227
227
|
logging.info(
|
|
@@ -256,15 +256,13 @@ class EdnaWorkflow(HardwareObject):
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
start_URL = f"http://{self.bes_host}:{self.bes_port}/RUN/{self.workflow_name}"
|
|
259
|
-
|
|
259
|
+
self.log.info("BES start URL: %r", start_URL)
|
|
260
260
|
response = requests.post(start_URL, json=self.dict_parameters)
|
|
261
261
|
if response.status_code == 200:
|
|
262
262
|
self.state.value = "RUNNING"
|
|
263
263
|
request_id = response.text
|
|
264
|
-
|
|
265
|
-
"Workflow started, BES request id: %r", request_id
|
|
266
|
-
)
|
|
264
|
+
self.log.info("Workflow started, BES request id: %r", request_id)
|
|
267
265
|
self.bes_workflow_id = request_id
|
|
268
266
|
else:
|
|
269
|
-
|
|
267
|
+
self.log.error("Workflow didn't start!")
|
|
270
268
|
self.state.value = "ON"
|
|
@@ -36,22 +36,22 @@ class Energy(HardwareObject):
|
|
|
36
36
|
try:
|
|
37
37
|
self.energy_motor = self.get_object_by_role("energy")
|
|
38
38
|
except KeyError:
|
|
39
|
-
|
|
39
|
+
self.log.warning("Energy: error initializing energy motor")
|
|
40
40
|
|
|
41
41
|
try:
|
|
42
42
|
self.default_en = self.get_property("default_energy")
|
|
43
43
|
except KeyError:
|
|
44
|
-
|
|
44
|
+
self.log.warning("Energy: no default energy")
|
|
45
45
|
|
|
46
46
|
try:
|
|
47
47
|
self.tunable = self.get_property("tunable_energy")
|
|
48
48
|
except KeyError:
|
|
49
|
-
|
|
49
|
+
self.log.warning("Energy: will set to fixed energy")
|
|
50
50
|
|
|
51
51
|
try:
|
|
52
52
|
self.ctrl = self.get_object_by_role("controller")
|
|
53
53
|
except KeyError:
|
|
54
|
-
|
|
54
|
+
self.log.info("No controller used")
|
|
55
55
|
|
|
56
56
|
if self.energy_motor is not None:
|
|
57
57
|
self.energy_motor.connect("valueChanged", self.energyPositionChanged)
|
|
@@ -65,9 +65,7 @@ class Energy(HardwareObject):
|
|
|
65
65
|
try:
|
|
66
66
|
return self.energy_motor.get_value()
|
|
67
67
|
except Exception:
|
|
68
|
-
|
|
69
|
-
"EnergyHO: could not read current energy"
|
|
70
|
-
)
|
|
68
|
+
self.log.exception("EnergyHO: could not read current energy")
|
|
71
69
|
return None
|
|
72
70
|
return self.default_en
|
|
73
71
|
|
|
@@ -78,7 +76,7 @@ class Energy(HardwareObject):
|
|
|
78
76
|
return None
|
|
79
77
|
|
|
80
78
|
def get_limits(self):
|
|
81
|
-
|
|
79
|
+
self.log.debug("Get energy limits")
|
|
82
80
|
if not self.tunable:
|
|
83
81
|
energy = self.get_value()
|
|
84
82
|
return (energy, energy)
|
|
@@ -88,14 +86,12 @@ class Energy(HardwareObject):
|
|
|
88
86
|
self.en_lims = self.energy_motor.get_limits()
|
|
89
87
|
return self.en_lims
|
|
90
88
|
except Exception:
|
|
91
|
-
|
|
92
|
-
"EnergyHO: could not read energy motor limits"
|
|
93
|
-
)
|
|
89
|
+
self.log.exception("EnergyHO: could not read energy motor limits")
|
|
94
90
|
return None
|
|
95
91
|
return None
|
|
96
92
|
|
|
97
93
|
def get_wavelength_limits(self):
|
|
98
|
-
|
|
94
|
+
self.log.debug("Get wavelength limits")
|
|
99
95
|
if not self.tunable:
|
|
100
96
|
return None
|
|
101
97
|
self.en_lims = self.get_limits()
|
|
@@ -154,16 +150,16 @@ class Energy(HardwareObject):
|
|
|
154
150
|
self.emit("moveEnergyFinished", ())
|
|
155
151
|
|
|
156
152
|
def checkLimits(self, value):
|
|
157
|
-
|
|
153
|
+
self.log.debug("Checking the move limits")
|
|
158
154
|
if self.get_limits():
|
|
159
155
|
if value >= self.en_lims[0] and value <= self.en_lims[1]:
|
|
160
|
-
|
|
156
|
+
self.log.info("Limits ok")
|
|
161
157
|
return True
|
|
162
158
|
logging.getLogger("user_level_log").info("Requested value is out of limits")
|
|
163
159
|
return False
|
|
164
160
|
|
|
165
161
|
# def start_move_wavelength(self, value, wait=True):
|
|
166
|
-
#
|
|
162
|
+
# self.log.info("Moving wavelength to (%s)" % value)
|
|
167
163
|
# return self.startMoveEnergy(12.3984 / value, wait)
|
|
168
164
|
|
|
169
165
|
def cancelMoveEnergy(self):
|
|
@@ -35,7 +35,6 @@ differ from the default ones.
|
|
|
35
35
|
<use_global_state>False</use_global_state>
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
|
-
import logging
|
|
39
38
|
import math
|
|
40
39
|
import sys
|
|
41
40
|
|
|
@@ -194,7 +193,7 @@ class ExporterMotor(AbstractMotor):
|
|
|
194
193
|
_val = self.motor_position_chan.get_value()
|
|
195
194
|
|
|
196
195
|
if _val is None or math.isnan(_val):
|
|
197
|
-
|
|
196
|
+
self.log.debug("Value of %s is NaN" % self.actuator_name)
|
|
198
197
|
_val = self._nominal_value
|
|
199
198
|
|
|
200
199
|
self._nominal_value = _val
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import base64
|
|
2
|
-
import logging
|
|
3
2
|
import pickle
|
|
4
3
|
|
|
5
4
|
import gevent
|
|
@@ -320,7 +319,7 @@ class FlexHCD(SampleChanger):
|
|
|
320
319
|
if "on_gonio" in loading_state:
|
|
321
320
|
self._set_loaded_sample(sample)
|
|
322
321
|
with gevent.Timeout(60, RuntimeError(err_msg)):
|
|
323
|
-
|
|
322
|
+
self.log.info(err_msg)
|
|
324
323
|
while not self._execute_cmd_exporter(
|
|
325
324
|
"getRobotIsSafe", attribute=True
|
|
326
325
|
):
|
|
@@ -333,7 +332,7 @@ class FlexHCD(SampleChanger):
|
|
|
333
332
|
if "on_gonio" in loading_state:
|
|
334
333
|
self._set_loaded_sample(sample)
|
|
335
334
|
with gevent.Timeout(60, RuntimeError(err_msg)):
|
|
336
|
-
|
|
335
|
+
self.log.info(err_msg)
|
|
337
336
|
while (
|
|
338
337
|
not self._execute_cmd(
|
|
339
338
|
"get_robot_cache_variable", "data:dioRobotIsSafe"
|
|
@@ -344,9 +343,9 @@ class FlexHCD(SampleChanger):
|
|
|
344
343
|
return True
|
|
345
344
|
gevent.sleep(2)
|
|
346
345
|
|
|
347
|
-
|
|
346
|
+
self.log.info("unload load task done")
|
|
348
347
|
for msg in self.get_robot_exceptions():
|
|
349
|
-
|
|
348
|
+
self.log.error(msg)
|
|
350
349
|
|
|
351
350
|
return self._check_pin_on_gonio()
|
|
352
351
|
|
|
@@ -361,7 +360,7 @@ class FlexHCD(SampleChanger):
|
|
|
361
360
|
self._prepare_centring_task()
|
|
362
361
|
return True
|
|
363
362
|
else:
|
|
364
|
-
|
|
363
|
+
self.log.info("reset loaded sample")
|
|
365
364
|
self._reset_loaded_sample()
|
|
366
365
|
# if self.controller:
|
|
367
366
|
# self.controller.hutch_actions(release_interlock=True)
|
|
@@ -392,7 +391,7 @@ class FlexHCD(SampleChanger):
|
|
|
392
391
|
res = SampleChanger.load(self, sample)
|
|
393
392
|
finally:
|
|
394
393
|
for msg in self.get_robot_exceptions():
|
|
395
|
-
|
|
394
|
+
self.log.error(msg)
|
|
396
395
|
if res:
|
|
397
396
|
self.prepare_centring()
|
|
398
397
|
return res
|
|
@@ -425,7 +424,7 @@ class FlexHCD(SampleChanger):
|
|
|
425
424
|
SampleChanger.unload(self, sample)
|
|
426
425
|
finally:
|
|
427
426
|
for msg in self.get_robot_exceptions():
|
|
428
|
-
|
|
427
|
+
self.log.error(msg)
|
|
429
428
|
|
|
430
429
|
def get_gripper(self):
|
|
431
430
|
if self.exporter_addr:
|
|
@@ -3,7 +3,6 @@ FLEX HCD maintenance mockup.
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import ast
|
|
6
|
-
import logging
|
|
7
6
|
|
|
8
7
|
from mxcubecore.BaseHardwareObjects import HardwareObject
|
|
9
8
|
|
|
@@ -160,7 +159,7 @@ class FlexHCDMaintenance(HardwareObject):
|
|
|
160
159
|
try:
|
|
161
160
|
grippers = self._sc.get_available_grippers()
|
|
162
161
|
except Exception:
|
|
163
|
-
|
|
162
|
+
self.log.exception("")
|
|
164
163
|
else:
|
|
165
164
|
gripper_cmd_list = []
|
|
166
165
|
|