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,5 +1,3 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
|
|
3
1
|
from mxcubecore.HardwareObjects import SpecMotor
|
|
4
2
|
|
|
5
3
|
|
|
@@ -12,9 +10,7 @@ class SpecMotorWPositions(SpecMotor.SpecMotor):
|
|
|
12
10
|
try:
|
|
13
11
|
positions = self["positions"]
|
|
14
12
|
except Exception:
|
|
15
|
-
|
|
16
|
-
"%s does not define positions.", str(self.name())
|
|
17
|
-
)
|
|
13
|
+
self.log.error("%s does not define positions.", str(self.name()))
|
|
18
14
|
else:
|
|
19
15
|
for definedPosition in positions:
|
|
20
16
|
positionUsername = definedPosition.get_property("username")
|
|
@@ -22,7 +18,7 @@ class SpecMotorWPositions(SpecMotor.SpecMotor):
|
|
|
22
18
|
try:
|
|
23
19
|
offset = float(definedPosition.get_property("offset"))
|
|
24
20
|
except Exception:
|
|
25
|
-
|
|
21
|
+
self.log.warning(
|
|
26
22
|
"%s, ignoring position %s: invalid offset.",
|
|
27
23
|
str(self.name()),
|
|
28
24
|
positionUsername,
|
|
@@ -59,7 +55,7 @@ class SpecMotorWPositions(SpecMotor.SpecMotor):
|
|
|
59
55
|
SpecMotor.SpecMotor.motorMoveDone.__func__(self, channelValue)
|
|
60
56
|
|
|
61
57
|
pos = self.get_value()
|
|
62
|
-
|
|
58
|
+
self.log.debug("current pos=%s", pos)
|
|
63
59
|
|
|
64
60
|
for positionName in self.predefinedPositions:
|
|
65
61
|
if (
|
|
@@ -78,7 +74,7 @@ class SpecMotorWPositions(SpecMotor.SpecMotor):
|
|
|
78
74
|
try:
|
|
79
75
|
self.move(self.predefinedPositions[positionName])
|
|
80
76
|
except Exception:
|
|
81
|
-
|
|
77
|
+
self.log.exception(
|
|
82
78
|
"Cannot move motor %s: invalid position name.", str(self.username)
|
|
83
79
|
)
|
|
84
80
|
|
|
@@ -101,4 +97,4 @@ class SpecMotorWPositions(SpecMotor.SpecMotor):
|
|
|
101
97
|
self.predefinedPositions[str(positionName)] = float(positionOffset)
|
|
102
98
|
self.sortPredefinedPositionsList()
|
|
103
99
|
except Exception:
|
|
104
|
-
|
|
100
|
+
self.log.exception("Cannot set new predefined position")
|
|
@@ -12,8 +12,6 @@ template:
|
|
|
12
12
|
</object>
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
import logging
|
|
16
|
-
|
|
17
15
|
from mxcubecore.HardwareObjects import SpecMotor
|
|
18
16
|
|
|
19
17
|
|
|
@@ -71,7 +69,7 @@ class SpecMotorWSpecPositions(SpecMotor.SpecMotor):
|
|
|
71
69
|
try:
|
|
72
70
|
self.move(self.predefinedPositions[positionName])
|
|
73
71
|
except Exception:
|
|
74
|
-
|
|
72
|
+
self.log.exception(
|
|
75
73
|
"Cannot move motor %s: invalid position name.", str(self.username)
|
|
76
74
|
)
|
|
77
75
|
|
|
@@ -90,4 +88,4 @@ class SpecMotorWSpecPositions(SpecMotor.SpecMotor):
|
|
|
90
88
|
try:
|
|
91
89
|
self.execute_command("setNewPosition", positionName, positionOffset)
|
|
92
90
|
except AttributeError:
|
|
93
|
-
|
|
91
|
+
self.log.exception("Cannot set new predefined position")
|
|
@@ -6,8 +6,6 @@ template:
|
|
|
6
6
|
</procedure>
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
import logging
|
|
10
|
-
|
|
11
9
|
from mxcubecore.BaseHardwareObjects import HardwareObject
|
|
12
10
|
|
|
13
11
|
try:
|
|
@@ -54,7 +52,7 @@ class SpecShell(HardwareObject):
|
|
|
54
52
|
)
|
|
55
53
|
except AttributeError:
|
|
56
54
|
self.specConnection = None
|
|
57
|
-
|
|
55
|
+
self.log.error("SpecShell: you must specify a spec version")
|
|
58
56
|
else:
|
|
59
57
|
self.specOutput.connectToSpec(
|
|
60
58
|
"output/tty",
|
|
@@ -155,7 +153,7 @@ class SpecShell(HardwareObject):
|
|
|
155
153
|
try:
|
|
156
154
|
buf_list = buf.split()
|
|
157
155
|
except Exception:
|
|
158
|
-
|
|
156
|
+
self.log.exception("")
|
|
159
157
|
else:
|
|
160
158
|
i = 0
|
|
161
159
|
while i < len(buf_list):
|
|
@@ -163,20 +161,20 @@ class SpecShell(HardwareObject):
|
|
|
163
161
|
try:
|
|
164
162
|
cmd_aux = buf_list[i + 1]
|
|
165
163
|
except Exception:
|
|
166
|
-
|
|
164
|
+
self.log.exception("")
|
|
167
165
|
else:
|
|
168
166
|
try:
|
|
169
167
|
left_par = cmd_aux[0]
|
|
170
168
|
right_par = cmd_aux[-1]
|
|
171
169
|
midle_num = cmd_aux[1:-1]
|
|
172
170
|
except Exception:
|
|
173
|
-
|
|
171
|
+
self.log.exception("")
|
|
174
172
|
else:
|
|
175
173
|
if left_par == "(" and right_par == ")":
|
|
176
174
|
try:
|
|
177
175
|
int(midle_num)
|
|
178
176
|
except Exception:
|
|
179
|
-
|
|
177
|
+
self.log.exception("")
|
|
180
178
|
else:
|
|
181
179
|
commands_list.append(cmd_name.lstrip("*"))
|
|
182
180
|
i += 2
|
|
@@ -222,7 +220,7 @@ class SpecShell(HardwareObject):
|
|
|
222
220
|
try:
|
|
223
221
|
self.specShellCommand.abort()
|
|
224
222
|
except SpecClient.SpecClientError.SpecClientError as diag:
|
|
225
|
-
|
|
223
|
+
self.log.exception("")
|
|
226
224
|
|
|
227
225
|
def outputReceived(self, output):
|
|
228
226
|
if self.lsdefRunning:
|
|
@@ -250,7 +248,7 @@ class SpecShell(HardwareObject):
|
|
|
250
248
|
else:
|
|
251
249
|
cmds.append(cmd.method)
|
|
252
250
|
except Exception:
|
|
253
|
-
|
|
251
|
+
self.log.exception("")
|
|
254
252
|
return cmds
|
|
255
253
|
|
|
256
254
|
def getAllCommands(self):
|
|
@@ -6,8 +6,6 @@ template:
|
|
|
6
6
|
</procedure>
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
import logging
|
|
10
|
-
|
|
11
9
|
from mxcubecore.BaseHardwareObjects import Procedure
|
|
12
10
|
|
|
13
11
|
try:
|
|
@@ -28,7 +26,7 @@ class SpecState(Procedure):
|
|
|
28
26
|
)
|
|
29
27
|
except AttributeError:
|
|
30
28
|
self.specConnection = None
|
|
31
|
-
|
|
29
|
+
self.log.error("SpecState: you must specify a spec version")
|
|
32
30
|
else:
|
|
33
31
|
SpecClient.SpecEventsDispatcher.connect(
|
|
34
32
|
self.specConnection, "connected", self.specConnected
|
|
@@ -63,7 +61,7 @@ class SpecState(Procedure):
|
|
|
63
61
|
try:
|
|
64
62
|
cmd = self.get_command_object("SpecStateMacro")
|
|
65
63
|
except KeyError:
|
|
66
|
-
|
|
64
|
+
self.log.exception("")
|
|
67
65
|
else:
|
|
68
66
|
if cmd is not None:
|
|
69
67
|
cmd.disconnect_signal("commandReady", self.commandReady)
|
|
@@ -97,15 +95,15 @@ class SpecState(Procedure):
|
|
|
97
95
|
|
|
98
96
|
def emitSpecState(self, entering):
|
|
99
97
|
if entering == self.lastState:
|
|
100
|
-
#
|
|
98
|
+
# self.log.debug('SpecState: %s already in %s' % (wwself.specversion,entering))
|
|
101
99
|
return
|
|
102
100
|
|
|
103
101
|
if self.lastState != "Unknown" and self.lastState != entering:
|
|
104
|
-
#
|
|
102
|
+
# self.log.debug('SpecState: %s from %s to %s ' % (self.specversion,self.lastState,entering))
|
|
105
103
|
signal_name = "specState%s" % self.lastState
|
|
106
104
|
self.emit(signal_name, (False, self.specversion))
|
|
107
105
|
# else:
|
|
108
|
-
#
|
|
106
|
+
# self.log.debug('SpecState: %s entering %s' % (self.specversion,entering))
|
|
109
107
|
|
|
110
108
|
self.lastState = entering
|
|
111
109
|
signal_name = "specState%s" % entering
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
# You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
# along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.
|
|
19
19
|
|
|
20
|
-
import logging
|
|
21
20
|
import time
|
|
22
21
|
from datetime import datetime
|
|
23
22
|
|
|
@@ -71,12 +70,12 @@ class StateMachine(HardwareObject):
|
|
|
71
70
|
|
|
72
71
|
for transition in self.transition_list:
|
|
73
72
|
if not self.get_state_by_name(transition["source"]):
|
|
74
|
-
|
|
73
|
+
self.log.error(
|
|
75
74
|
"Transition %s " % str(transition)
|
|
76
75
|
+ "has a none existing source state: %s" % transition["source"]
|
|
77
76
|
)
|
|
78
77
|
if not self.get_state_by_name(transition["dest"]):
|
|
79
|
-
|
|
78
|
+
self.log.error(
|
|
80
79
|
"Transition %s " % str(transition)
|
|
81
80
|
+ "has a none existing destination state: %s" % transition["dest"]
|
|
82
81
|
)
|
|
@@ -90,19 +89,19 @@ class StateMachine(HardwareObject):
|
|
|
90
89
|
|
|
91
90
|
for condition_name in transition["conditions_true"]:
|
|
92
91
|
if not self.get_condition_by_name(condition_name):
|
|
93
|
-
|
|
92
|
+
self.log.error(
|
|
94
93
|
"Transition %s " % str(transition)
|
|
95
94
|
+ "has a none existing condition: %s" % condition_name
|
|
96
95
|
)
|
|
97
96
|
for condition_name in transition["conditions_false"]:
|
|
98
97
|
if not self.get_condition_by_name(condition_name):
|
|
99
|
-
|
|
98
|
+
self.log.error(
|
|
100
99
|
"Transition %s " % str(transition)
|
|
101
100
|
+ "has a none existing condition: %s" % condition_name
|
|
102
101
|
)
|
|
103
102
|
for condition_name in transition["conditions_false_or"]:
|
|
104
103
|
if not self.get_condition_by_name(condition_name):
|
|
105
|
-
|
|
104
|
+
self.log.error(
|
|
106
105
|
"Transition %s " % str(transition)
|
|
107
106
|
+ "has a none existing condition: %s" % condition_name
|
|
108
107
|
)
|
|
@@ -112,7 +111,7 @@ class StateMachine(HardwareObject):
|
|
|
112
111
|
self.bl_setup_hwobj = self.get_object_by_role("beamline_setup")
|
|
113
112
|
for hwobj_name in dir(self.bl_setup_hwobj):
|
|
114
113
|
if hwobj_name.endswith("hwobj"):
|
|
115
|
-
#
|
|
114
|
+
# self.log.debug(\
|
|
116
115
|
# "StateMachine: Attaching hwobj: %s " % hwobj_name)
|
|
117
116
|
self.connect(
|
|
118
117
|
getattr(self.bl_setup_hwobj, hwobj_name),
|
|
@@ -136,7 +135,7 @@ class StateMachine(HardwareObject):
|
|
|
136
135
|
|
|
137
136
|
condition = self.get_condition_by_name(condition_name)
|
|
138
137
|
if condition:
|
|
139
|
-
#
|
|
138
|
+
# self.log.debug(\
|
|
140
139
|
# "StateMachine: condition '%s' changed to '%s'" \
|
|
141
140
|
# % (condition_name, value))
|
|
142
141
|
|
|
@@ -145,7 +144,7 @@ class StateMachine(HardwareObject):
|
|
|
145
144
|
self.emit("conditionChanged", self.condition_list)
|
|
146
145
|
self.update_fsm_state()
|
|
147
146
|
else:
|
|
148
|
-
|
|
147
|
+
self.log.debug(
|
|
149
148
|
"StateMachine: condition '%s' not in the condition list"
|
|
150
149
|
% condition_name
|
|
151
150
|
)
|
|
@@ -199,7 +198,7 @@ class StateMachine(HardwareObject):
|
|
|
199
198
|
}
|
|
200
199
|
self.history_state_list.append(history_state_item)
|
|
201
200
|
self.previous_state = self.current_state
|
|
202
|
-
|
|
201
|
+
self.log.debug(
|
|
203
202
|
"StateMachine: current state " + "changed to : %s" % self.current_state
|
|
204
203
|
)
|
|
205
204
|
self.emit("stateChanged", self.history_state_list)
|
|
@@ -14,7 +14,6 @@ Example configuration:
|
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
16
|
import atexit
|
|
17
|
-
import logging
|
|
18
17
|
import os
|
|
19
18
|
import signal
|
|
20
19
|
import subprocess
|
|
@@ -76,7 +75,7 @@ class TangoLimaMpegVideo(TangoLimaVideo):
|
|
|
76
75
|
return video_sizes
|
|
77
76
|
|
|
78
77
|
def clean_up(self) -> None:
|
|
79
|
-
|
|
78
|
+
self.log.info("Shutting down video_stream...")
|
|
80
79
|
os.kill(self._video_stream_process.pid, signal.SIGTERM)
|
|
81
80
|
|
|
82
81
|
def start_video_stream_process(self) -> None:
|
|
@@ -117,7 +116,7 @@ class TangoLimaMpegVideo(TangoLimaVideo):
|
|
|
117
116
|
for p in ps:
|
|
118
117
|
p.kill()
|
|
119
118
|
except psutil.NoSuchProcess:
|
|
120
|
-
|
|
119
|
+
self.log.exception("")
|
|
121
120
|
|
|
122
121
|
self._video_stream_process = None
|
|
123
122
|
|
|
@@ -14,7 +14,6 @@ If video mode is not specified, BAYER_RG16 is used by default.
|
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
16
|
import io
|
|
17
|
-
import logging
|
|
18
17
|
import struct
|
|
19
18
|
import time
|
|
20
19
|
|
|
@@ -78,7 +77,7 @@ class TangoLimaVideo(BaseHardwareObjects.HardwareObject):
|
|
|
78
77
|
self.device.ping()
|
|
79
78
|
except PyTango.DevFailed as traceback:
|
|
80
79
|
last_error = traceback[-1]
|
|
81
|
-
|
|
80
|
+
self.log.error("%s: %s", str(self.name()), last_error.desc)
|
|
82
81
|
|
|
83
82
|
self.device = BaseHardwareObjects.Null()
|
|
84
83
|
else:
|
|
@@ -88,7 +87,7 @@ class TangoLimaVideo(BaseHardwareObjects.HardwareObject):
|
|
|
88
87
|
self._sleep_time = float(self.get_property("interval")) / 1000.0
|
|
89
88
|
|
|
90
89
|
if self.get_property("control_video", "True"):
|
|
91
|
-
|
|
90
|
+
self.log.info("MXCuBE controlling video")
|
|
92
91
|
|
|
93
92
|
if self.device.video_live:
|
|
94
93
|
self.device.video_live = False
|
|
@@ -98,7 +97,7 @@ class TangoLimaVideo(BaseHardwareObjects.HardwareObject):
|
|
|
98
97
|
|
|
99
98
|
self.device.video_live = True
|
|
100
99
|
else:
|
|
101
|
-
|
|
100
|
+
self.log.info("MXCuBE NOT controlling video")
|
|
102
101
|
|
|
103
102
|
self.update_state(BaseHardwareObjects.HardwareObjectState.READY)
|
|
104
103
|
|
|
@@ -29,8 +29,6 @@ Example xml_ configuration:
|
|
|
29
29
|
</object>
|
|
30
30
|
"""
|
|
31
31
|
|
|
32
|
-
import logging
|
|
33
|
-
|
|
34
32
|
from mxcubecore.HardwareObjects.abstract.AbstractMachineInfo import AbstractMachineInfo
|
|
35
33
|
|
|
36
34
|
__copyright__ = """ Copyright © by the MXCuBE collaboration """
|
|
@@ -82,7 +80,7 @@ class TangoMachineInfo(AbstractMachineInfo):
|
|
|
82
80
|
try:
|
|
83
81
|
self._mach_info_dict.update({name: getattr(self, name).get_value()})
|
|
84
82
|
except Exception as err:
|
|
85
|
-
|
|
83
|
+
self.log.exception(err)
|
|
86
84
|
|
|
87
85
|
return self._mach_info_dict.copy()
|
|
88
86
|
|
|
@@ -20,8 +20,6 @@
|
|
|
20
20
|
TangoMotor class defines motor in the Tango control system (used and tested in DESY/P11
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
-
import logging
|
|
24
|
-
|
|
25
23
|
import gevent
|
|
26
24
|
|
|
27
25
|
from mxcubecore.HardwareObjects.abstract.AbstractMotor import AbstractMotor
|
|
@@ -108,7 +106,7 @@ class TangoMotor(AbstractMotor):
|
|
|
108
106
|
if self.get_property("default_limits"):
|
|
109
107
|
self.update_limits(eval(self.get_property("default_limits")))
|
|
110
108
|
except Exception:
|
|
111
|
-
|
|
109
|
+
self.log.exception("")
|
|
112
110
|
|
|
113
111
|
self.cmd_stop = self.get_command_object("stopAxis")
|
|
114
112
|
if self.cmd_stop is None:
|
|
@@ -90,14 +90,12 @@ class UserTypeISPyBLims(ISPyBAbstractLIMS):
|
|
|
90
90
|
|
|
91
91
|
# Authentication
|
|
92
92
|
if self.authServerType == "ldap":
|
|
93
|
-
|
|
94
|
-
"Starting LDAP authentication %s" % login_name
|
|
95
|
-
)
|
|
93
|
+
self.log.debug("Starting LDAP authentication %s" % login_name)
|
|
96
94
|
self.login_ok = self.ldap_login(login_name, psd, ldap_connection)
|
|
97
95
|
msg = loginID
|
|
98
|
-
|
|
96
|
+
self.log.debug("User %s logged in LDAP" % login_name)
|
|
99
97
|
elif self.authServerType == "ispyb":
|
|
100
|
-
|
|
98
|
+
self.log.debug("ISPyB login")
|
|
101
99
|
self.login_ok, msg = self.ispyb_login(login_name, psd)
|
|
102
100
|
else:
|
|
103
101
|
raise Exception("Authentication server type is not defined")
|
|
@@ -105,7 +103,7 @@ class UserTypeISPyBLims(ISPyBAbstractLIMS):
|
|
|
105
103
|
if not self.login_ok:
|
|
106
104
|
msg = "%s." % msg.capitalize()
|
|
107
105
|
# refuse Login
|
|
108
|
-
|
|
106
|
+
self.log.error("ISPyB login not ok")
|
|
109
107
|
raise Exception("Error lims authentication")
|
|
110
108
|
|
|
111
109
|
# login succeed, get proposal and sessions
|
|
@@ -185,7 +183,7 @@ class UserTypeISPyBLims(ISPyBAbstractLIMS):
|
|
|
185
183
|
session.endDate, "%Y-%m-%d %H:%M:%S"
|
|
186
184
|
)
|
|
187
185
|
except Exception:
|
|
188
|
-
|
|
186
|
+
self.log.exception("")
|
|
189
187
|
sessions.append(utf_encode(asdict(session)))
|
|
190
188
|
|
|
191
189
|
except WebFault as e:
|
|
@@ -281,7 +279,7 @@ class UserTypeISPyBLims(ISPyBAbstractLIMS):
|
|
|
281
279
|
session.endDate, "%Y-%m-%d %H:%M:%S"
|
|
282
280
|
)
|
|
283
281
|
except Exception:
|
|
284
|
-
|
|
282
|
+
self.log.exception("")
|
|
285
283
|
|
|
286
284
|
sessions.append(utf_encode(asdict(session)))
|
|
287
285
|
|
|
@@ -292,7 +290,7 @@ class UserTypeISPyBLims(ISPyBAbstractLIMS):
|
|
|
292
290
|
except URLError:
|
|
293
291
|
logging.getLogger("ispyb_client").warning(_CONNECTION_ERROR_MSG)
|
|
294
292
|
|
|
295
|
-
|
|
293
|
+
self.log.exception("")
|
|
296
294
|
return empty_dict
|
|
297
295
|
|
|
298
296
|
logging.getLogger("ispyb_client").info(str(sessions))
|
|
@@ -80,7 +80,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
80
80
|
try:
|
|
81
81
|
self.open()
|
|
82
82
|
except Exception:
|
|
83
|
-
|
|
83
|
+
self.log.exception("Can't start XML-RPC server")
|
|
84
84
|
|
|
85
85
|
def close(self):
|
|
86
86
|
try:
|
|
@@ -88,7 +88,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
88
88
|
self._server.server_close()
|
|
89
89
|
del self._server
|
|
90
90
|
except AttributeError:
|
|
91
|
-
|
|
91
|
+
self.log.exception("")
|
|
92
92
|
|
|
93
93
|
def open(self):
|
|
94
94
|
# The value of the member self.port is set in the xml configuration
|
|
@@ -110,7 +110,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
110
110
|
)
|
|
111
111
|
|
|
112
112
|
msg = "XML-RPC server listening on: %s:%s" % (self.host, self.port)
|
|
113
|
-
|
|
113
|
+
self.log.info(msg)
|
|
114
114
|
|
|
115
115
|
self.connect(
|
|
116
116
|
HWR.beamline.gphl_workflow,
|
|
@@ -187,7 +187,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
187
187
|
try:
|
|
188
188
|
cryoshutter_hwobj.getCommandObject("anneal")(time)
|
|
189
189
|
except Exception as ex:
|
|
190
|
-
|
|
190
|
+
self.log.exception(str(ex))
|
|
191
191
|
raise
|
|
192
192
|
return True
|
|
193
193
|
|
|
@@ -216,7 +216,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
216
216
|
self.emit("add_to_queue", (task, None, set_on))
|
|
217
217
|
|
|
218
218
|
except Exception as ex:
|
|
219
|
-
|
|
219
|
+
self.log.exception(str(ex))
|
|
220
220
|
raise
|
|
221
221
|
return True
|
|
222
222
|
|
|
@@ -230,7 +230,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
230
230
|
try:
|
|
231
231
|
self.emit("start_queue")
|
|
232
232
|
except Exception as ex:
|
|
233
|
-
|
|
233
|
+
self.log.exception(str(ex))
|
|
234
234
|
raise
|
|
235
235
|
return True
|
|
236
236
|
|
|
@@ -279,7 +279,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
279
279
|
try:
|
|
280
280
|
node_id = HWR.beamline.queue_model.add_child_at_id(parent_id, child)
|
|
281
281
|
except Exception as ex:
|
|
282
|
-
|
|
282
|
+
self.log.exception(str(ex))
|
|
283
283
|
raise
|
|
284
284
|
return node_id
|
|
285
285
|
|
|
@@ -291,7 +291,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
291
291
|
try:
|
|
292
292
|
node = HWR.beamline.queue_model.get_node(node_id)
|
|
293
293
|
except Exception as ex:
|
|
294
|
-
|
|
294
|
+
self.log.exception(str(ex))
|
|
295
295
|
raise
|
|
296
296
|
return node
|
|
297
297
|
|
|
@@ -312,7 +312,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
312
312
|
)
|
|
313
313
|
|
|
314
314
|
except Exception as ex:
|
|
315
|
-
|
|
315
|
+
self.log.exception(str(ex))
|
|
316
316
|
raise
|
|
317
317
|
return True
|
|
318
318
|
|
|
@@ -329,7 +329,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
329
329
|
model = HWR.beamline.queue_model.get_node(node_id)
|
|
330
330
|
model.lims_id = lims_id
|
|
331
331
|
except Exception as ex:
|
|
332
|
-
|
|
332
|
+
self.log.exception(str(ex))
|
|
333
333
|
raise
|
|
334
334
|
else:
|
|
335
335
|
return True
|
|
@@ -342,7 +342,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
342
342
|
try:
|
|
343
343
|
return HWR.beamline.queue_manager.is_executing(node_id)
|
|
344
344
|
except Exception as ex:
|
|
345
|
-
|
|
345
|
+
self.log.exception(str(ex))
|
|
346
346
|
raise
|
|
347
347
|
|
|
348
348
|
def queue_status(self):
|
|
@@ -415,7 +415,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
415
415
|
ho = self._getattr_from_path(HWR, path)
|
|
416
416
|
value = ho.get_value()
|
|
417
417
|
except:
|
|
418
|
-
|
|
418
|
+
self.log.exception("Could no get %s " % str(path))
|
|
419
419
|
|
|
420
420
|
return value
|
|
421
421
|
|
|
@@ -443,13 +443,11 @@ class XMLRPCServer(HardwareObject):
|
|
|
443
443
|
|
|
444
444
|
def save_twelve_snapshots_script(self, path):
|
|
445
445
|
path = path[14:] # NBNB: Temporary fix, to be addressed in calling code
|
|
446
|
-
|
|
447
|
-
"Taking 6 snapshots to be saved in %s " % str(path)
|
|
448
|
-
)
|
|
446
|
+
self.log.info("Taking 6 snapshots to be saved in %s " % str(path))
|
|
449
447
|
HWR.beamline.diffractometer.run_script("Take6Snapshots, " + path)
|
|
450
448
|
|
|
451
449
|
def save_multiple_snapshots(self, path_list, show_scale=False):
|
|
452
|
-
|
|
450
|
+
self.log.info("Taking snapshot %s " % str(path_list))
|
|
453
451
|
|
|
454
452
|
try:
|
|
455
453
|
for angle, path in path_list:
|
|
@@ -459,11 +457,11 @@ class XMLRPCServer(HardwareObject):
|
|
|
459
457
|
HWR.beamline.diffractometer.wait_ready()
|
|
460
458
|
self.save_snapshot(path, show_scale, handle_light=False)
|
|
461
459
|
except Exception as ex:
|
|
462
|
-
|
|
460
|
+
self.log.exception("Could not take snapshot %s " % str(ex))
|
|
463
461
|
|
|
464
462
|
def save_snapshot(self, imgpath, showScale=False, handle_light=True):
|
|
465
463
|
res = True
|
|
466
|
-
|
|
464
|
+
self.log.info("Taking snapshot %s " % str(imgpath))
|
|
467
465
|
|
|
468
466
|
try:
|
|
469
467
|
if showScale:
|
|
@@ -471,7 +469,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
471
469
|
else:
|
|
472
470
|
HWR.beamline.sample_view.save_snapshot(imgpath, overlay=False, bw=False)
|
|
473
471
|
except Exception as ex:
|
|
474
|
-
|
|
472
|
+
self.log.exception("Could not take snapshot %s " % str(ex))
|
|
475
473
|
res = False
|
|
476
474
|
finally:
|
|
477
475
|
pass
|
|
@@ -482,7 +480,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
482
480
|
"""
|
|
483
481
|
Saves the current position as a centered position.
|
|
484
482
|
"""
|
|
485
|
-
|
|
483
|
+
self.log.debug("Saving position via XMLRPC")
|
|
486
484
|
HWR.beamline.diffractometer.save_current_position()
|
|
487
485
|
return True
|
|
488
486
|
|
|
@@ -629,7 +627,7 @@ class XMLRPCServer(HardwareObject):
|
|
|
629
627
|
"""
|
|
630
628
|
Sets the level of the back light
|
|
631
629
|
"""
|
|
632
|
-
|
|
630
|
+
self.log.info("Setting backlight level to %s" % level)
|
|
633
631
|
HWR.beamline.diffractometer.setBackLightLevel(level)
|
|
634
632
|
|
|
635
633
|
def get_back_light_level(self):
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
|
|
23
23
|
from __future__ import annotations
|
|
24
24
|
|
|
25
|
-
import logging
|
|
26
25
|
from warnings import warn
|
|
27
26
|
|
|
28
27
|
from mxcubecore.BaseHardwareObjects import HardwareObject
|
|
@@ -57,12 +56,12 @@ class AbstractAperture(HardwareObject):
|
|
|
57
56
|
try:
|
|
58
57
|
self._diameter_size_list = eval(self.get_property("diameter_size_list"))
|
|
59
58
|
except Exception:
|
|
60
|
-
|
|
59
|
+
self.log.error("Aperture: no diameter size list defined")
|
|
61
60
|
|
|
62
61
|
try:
|
|
63
62
|
self._position_list = eval(self.get_property("position_list"))
|
|
64
63
|
except Exception:
|
|
65
|
-
|
|
64
|
+
self.log.error("Aperture: no position list defined")
|
|
66
65
|
|
|
67
66
|
def get_diameter_size_list(self) -> list[float]:
|
|
68
67
|
"""Get list of diameter sizes.
|
|
@@ -102,7 +101,7 @@ class AbstractAperture(HardwareObject):
|
|
|
102
101
|
self._diameter_size_list[self._current_diameter_index] / 1000.0,
|
|
103
102
|
)
|
|
104
103
|
else:
|
|
105
|
-
|
|
104
|
+
self.log.warning(
|
|
106
105
|
"Aperture: Diameter index %d is not valid" % diameter_index
|
|
107
106
|
)
|
|
108
107
|
|
|
@@ -123,9 +122,7 @@ class AbstractAperture(HardwareObject):
|
|
|
123
122
|
if diameter_size in self._diameter_size_list:
|
|
124
123
|
self.set_diameter_index(self._diameter_size_list.index(diameter_size))
|
|
125
124
|
else:
|
|
126
|
-
|
|
127
|
-
"Aperture: Selected diameter is not in the diameter list"
|
|
128
|
-
)
|
|
125
|
+
self.log.warning("Aperture: Selected diameter is not in the diameter list")
|
|
129
126
|
|
|
130
127
|
def get_position_name(self) -> str:
|
|
131
128
|
"""Get current position name.
|
|
@@ -152,7 +149,7 @@ class AbstractAperture(HardwareObject):
|
|
|
152
149
|
self._current_position_name = position_name
|
|
153
150
|
self.emit("valueChanged", self._current_position_name)
|
|
154
151
|
else:
|
|
155
|
-
|
|
152
|
+
self.log.warning(
|
|
156
153
|
"Aperture: Position %s is not in the position list" % position_name
|
|
157
154
|
)
|
|
158
155
|
|
|
@@ -166,9 +163,7 @@ class AbstractAperture(HardwareObject):
|
|
|
166
163
|
self._current_position_name = self._position_list[position_index]
|
|
167
164
|
self.emit("valueChanged", self._current_position_name)
|
|
168
165
|
else:
|
|
169
|
-
|
|
170
|
-
"Aperture: Selected position is not in the position list"
|
|
171
|
-
)
|
|
166
|
+
self.log.warning("Aperture: Selected position is not in the position list")
|
|
172
167
|
|
|
173
168
|
def set_in(self):
|
|
174
169
|
"""Set aperture in the beam."""
|