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
|
@@ -173,7 +173,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
173
173
|
|
|
174
174
|
def open_connection(self):
|
|
175
175
|
if self._gateway is None:
|
|
176
|
-
|
|
176
|
+
self.log.debug("Opening GΦL connection")
|
|
177
177
|
else:
|
|
178
178
|
return
|
|
179
179
|
|
|
@@ -195,7 +195,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
195
195
|
if val is not None:
|
|
196
196
|
java_parameters["port"] = val
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
self.log.debug(
|
|
199
199
|
"Opening GΦL connection: %s ",
|
|
200
200
|
(", ".join("%s:%s" % tt0 for tt0 in sorted(params.items()))),
|
|
201
201
|
)
|
|
@@ -211,7 +211,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
211
211
|
# the workflow is invoked remotely through ssh.
|
|
212
212
|
|
|
213
213
|
if self.get_state() == self.STATES.UNKNOWN:
|
|
214
|
-
|
|
214
|
+
self.log.warning(
|
|
215
215
|
"GphlWorkflowConnection not correctly initialised - check for errors"
|
|
216
216
|
)
|
|
217
217
|
|
|
@@ -324,16 +324,14 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
324
324
|
os.makedirs(wdir)
|
|
325
325
|
except:
|
|
326
326
|
# No need to raise error - program will fail downstream
|
|
327
|
-
|
|
328
|
-
"Could not create GΦL working directory: %s", wdir
|
|
329
|
-
)
|
|
327
|
+
self.log.error("Could not create GΦL working directory: %s", wdir)
|
|
330
328
|
|
|
331
329
|
for ss0 in command_list:
|
|
332
330
|
ss0 = ss0.rsplit("=", maxsplit=1)[-1]
|
|
333
331
|
if ss0.startswith("/") and "*" not in ss0 and not os.path.exists(ss0):
|
|
334
|
-
|
|
332
|
+
self.log.warning("File does not exist : %s", ss0)
|
|
335
333
|
|
|
336
|
-
|
|
334
|
+
self.log.info("GΦL execute :\n%s", " ".join(command_list))
|
|
337
335
|
|
|
338
336
|
# Get environmental variables
|
|
339
337
|
envs = os.environ.copy()
|
|
@@ -360,9 +358,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
360
358
|
if runworkflow_opts:
|
|
361
359
|
envs["RUNWORKFLOW_OPTS"] = " ".join(runworkflow_opts)
|
|
362
360
|
|
|
363
|
-
|
|
364
|
-
"Executing GΦL workflow, in environment %s", envs
|
|
365
|
-
)
|
|
361
|
+
self.log.debug("Executing GΦL workflow, in environment %s", envs)
|
|
366
362
|
try:
|
|
367
363
|
self._running_process = subprocess.Popen(command_list, env=envs)
|
|
368
364
|
except Exception:
|
|
@@ -373,7 +369,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
373
369
|
logging.getLogger("py4j.clientserver").setLevel(logging.WARNING)
|
|
374
370
|
self.update_state(self.STATES.READY)
|
|
375
371
|
|
|
376
|
-
|
|
372
|
+
self.log.debug(
|
|
377
373
|
"GΦL workflow pid, returncode : %s, %s"
|
|
378
374
|
% (self._running_process.pid, self._running_process.returncode)
|
|
379
375
|
)
|
|
@@ -383,7 +379,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
383
379
|
# No workflow to abort
|
|
384
380
|
return
|
|
385
381
|
|
|
386
|
-
|
|
382
|
+
self.log.debug("GΦL workflow ended")
|
|
387
383
|
self.update_state(self.STATES.OFF)
|
|
388
384
|
if self._await_result is not None:
|
|
389
385
|
# We are awaiting an answer - give an abort
|
|
@@ -410,13 +406,13 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
410
406
|
if xx0.poll() is None:
|
|
411
407
|
xx0.kill()
|
|
412
408
|
except:
|
|
413
|
-
|
|
409
|
+
self.log.info(
|
|
414
410
|
"Exception while terminating external workflow process %s", xx0
|
|
415
411
|
)
|
|
416
|
-
|
|
412
|
+
self.log.info("Error was:", exc_info=True)
|
|
417
413
|
|
|
418
414
|
def close_connection(self):
|
|
419
|
-
|
|
415
|
+
self.log.debug("GΦL Close connection ")
|
|
420
416
|
xx0 = self._gateway
|
|
421
417
|
self._gateway = None
|
|
422
418
|
if xx0 is not None:
|
|
@@ -428,14 +424,12 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
428
424
|
# xx0.shutdown(raise_exception=True)
|
|
429
425
|
xx0.shutdown()
|
|
430
426
|
except Exception:
|
|
431
|
-
|
|
432
|
-
"Exception during py4j gateway shutdown. Ignored"
|
|
433
|
-
)
|
|
427
|
+
self.log.debug("Exception during py4j gateway shutdown. Ignored")
|
|
434
428
|
|
|
435
429
|
def abort_workflow(self, message=None):
|
|
436
430
|
"""Abort workflow - may be called from controller in any state"""
|
|
437
431
|
|
|
438
|
-
|
|
432
|
+
self.log.info("Aborting workflow: %s", message)
|
|
439
433
|
logging.getLogger("user_level_log").info("Aborting workflow ...")
|
|
440
434
|
if self._await_result is not None:
|
|
441
435
|
# Workflow waiting for answer - send abort
|
|
@@ -461,9 +455,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
461
455
|
correlation_id = xx0.correlation_id
|
|
462
456
|
|
|
463
457
|
if not payload:
|
|
464
|
-
|
|
465
|
-
"GΦL Empty or unparsable information message. Ignored"
|
|
466
|
-
)
|
|
458
|
+
self.log.warning("GΦL Empty or unparsable information message. Ignored")
|
|
467
459
|
elif self.workflow_queue is not None:
|
|
468
460
|
# Could happen if we have ended the workflow
|
|
469
461
|
self.workflow_queue.put_nowait(
|
|
@@ -500,10 +492,10 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
500
492
|
"co.gphl.beamline.v2_unstable.domain_types.AbsorptionEdge",
|
|
501
493
|
):
|
|
502
494
|
java_gateway.java_import(self._gateway.jvm, qualified_class_name)
|
|
503
|
-
|
|
495
|
+
self.log.warning(
|
|
504
496
|
"Importing required unqualified class names from the JVM explicitly"
|
|
505
497
|
)
|
|
506
|
-
|
|
498
|
+
self.log.warning(
|
|
507
499
|
"Please consider upgrading the GPhL workflow application"
|
|
508
500
|
)
|
|
509
501
|
|
|
@@ -520,7 +512,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
520
512
|
self._enactment_id = xx0.enactment_id
|
|
521
513
|
|
|
522
514
|
elif not payload:
|
|
523
|
-
|
|
515
|
+
self.log.error(
|
|
524
516
|
"GΦL message lacks payload - sending 'Abort' to external workflow"
|
|
525
517
|
)
|
|
526
518
|
return self._response_to_server(
|
|
@@ -533,7 +525,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
533
525
|
self.workflow_queue.put_nowait(
|
|
534
526
|
(message_type, payload, correlation_id, None)
|
|
535
527
|
)
|
|
536
|
-
|
|
528
|
+
self.log.debug("Subprocess start/stop - return None")
|
|
537
529
|
return None
|
|
538
530
|
|
|
539
531
|
elif message_type in (
|
|
@@ -576,7 +568,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
576
568
|
)
|
|
577
569
|
self.workflow_ended()
|
|
578
570
|
else:
|
|
579
|
-
|
|
571
|
+
self.log.debug(
|
|
580
572
|
"GΦL - response=%s messageId=%s"
|
|
581
573
|
% (result.__class__.__name__, correlation_id)
|
|
582
574
|
)
|
|
@@ -589,13 +581,11 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
589
581
|
(message_type, payload, correlation_id, None)
|
|
590
582
|
)
|
|
591
583
|
self.workflow_ended()
|
|
592
|
-
|
|
584
|
+
self.log.debug("Aborting - return None")
|
|
593
585
|
return None
|
|
594
586
|
|
|
595
587
|
else:
|
|
596
|
-
|
|
597
|
-
"GΦL Unknown message type: %s - aborting", message_type
|
|
598
|
-
)
|
|
588
|
+
self.log.error("GΦL Unknown message type: %s - aborting", message_type)
|
|
599
589
|
return self._response_to_server(
|
|
600
590
|
GphlMessages.BeamlineAbort(), correlation_id
|
|
601
591
|
)
|
|
@@ -621,7 +611,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
621
611
|
payload = py4j_message.getPayload()
|
|
622
612
|
|
|
623
613
|
else:
|
|
624
|
-
|
|
614
|
+
self.log.debug(
|
|
625
615
|
"GPhL incoming: message=%s, jobId=%s, messageId=%s"
|
|
626
616
|
% (message_type, enactment_id, correlation_id)
|
|
627
617
|
)
|
|
@@ -631,7 +621,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
631
621
|
# determine converter function
|
|
632
622
|
converter = getattr(self, converterName)
|
|
633
623
|
except AttributeError:
|
|
634
|
-
|
|
624
|
+
self.log.error(
|
|
635
625
|
"GΦL Message type %s not recognised (no %s function)"
|
|
636
626
|
% (message_type, converterName)
|
|
637
627
|
)
|
|
@@ -641,7 +631,7 @@ class GphlWorkflowConnection(HardwareObject):
|
|
|
641
631
|
# Convert to Python objects
|
|
642
632
|
payload = converter(py4j_message.getPayload())
|
|
643
633
|
except NotImplementedError:
|
|
644
|
-
|
|
634
|
+
self.log.error(
|
|
645
635
|
"Processing of GΦL message %s not implemented", message_type
|
|
646
636
|
)
|
|
647
637
|
payload = None
|
|
@@ -750,8 +750,12 @@ class ICATLIMS(AbstractLims):
|
|
|
750
750
|
key_mapping = {
|
|
751
751
|
"detector_px": "InstrumentDetector01_beam_center_x",
|
|
752
752
|
"detector_py": "InstrumentDetector01_beam_center_y",
|
|
753
|
-
"beam_divergence_vertical":
|
|
754
|
-
|
|
753
|
+
"beam_divergence_vertical": (
|
|
754
|
+
"InstrumentBeam_vertical_incident_beam_divergence"
|
|
755
|
+
),
|
|
756
|
+
"beam_divergence_horizontal": (
|
|
757
|
+
"InstrumentBeam_horizontal_incident_beam_divergence"
|
|
758
|
+
),
|
|
755
759
|
"polarisation": "InstrumentBeam_final_polarization",
|
|
756
760
|
"detector_model": "InstrumentDetector01_model",
|
|
757
761
|
"detector_manufacturer": "InstrumentDetector01_manufacturer",
|
|
@@ -810,14 +814,14 @@ class ICATLIMS(AbstractLims):
|
|
|
810
814
|
"""
|
|
811
815
|
sample_id = datacollection_dict.get("blSampleId")
|
|
812
816
|
msg = f"SampleId is: {sample_id}"
|
|
813
|
-
|
|
817
|
+
self.log.debug(msg)
|
|
814
818
|
try:
|
|
815
819
|
sample = HWR.beamline.lims.find_sample_by_sample_id(sample_id)
|
|
816
820
|
sample_name = sample.get("sampleName")
|
|
817
821
|
except (AttributeError, TypeError):
|
|
818
822
|
sample_name = "unknown"
|
|
819
823
|
msg = f"Sample {sample_id} not found"
|
|
820
|
-
|
|
824
|
+
self.log.debug(msg)
|
|
821
825
|
|
|
822
826
|
start_time = datacollection_dict.get("collection_start_time", "")
|
|
823
827
|
end_time = datetime.now(ZoneInfo("Europe/Paris")).isoformat()
|
|
@@ -829,7 +833,7 @@ class ICATLIMS(AbstractLims):
|
|
|
829
833
|
)
|
|
830
834
|
start_time = dt_aware.isoformat(timespec="microseconds")
|
|
831
835
|
except (ValueError, TypeError):
|
|
832
|
-
|
|
836
|
+
self.log.exception("Cannot parse start time")
|
|
833
837
|
else:
|
|
834
838
|
start_time = datetime.now(ZoneInfo("Europe/Paris")).isoformat()
|
|
835
839
|
|
|
@@ -875,9 +879,9 @@ class ICATLIMS(AbstractLims):
|
|
|
875
879
|
beamline = self._get_scheduled_beamline()
|
|
876
880
|
msg = f"Dataset Beamline={beamline} "
|
|
877
881
|
msg += f"Current Beamline={HWR.beamline.session.beamline_name}"
|
|
878
|
-
|
|
882
|
+
self.log.info(msg)
|
|
879
883
|
except Exception:
|
|
880
|
-
|
|
884
|
+
self.log.exception(
|
|
881
885
|
"Failed to get _get_scheduled_beamline",
|
|
882
886
|
)
|
|
883
887
|
_session = HWR.beamline.session
|
|
@@ -896,7 +900,7 @@ class ICATLIMS(AbstractLims):
|
|
|
896
900
|
start_time = dt_aware.isoformat(timespec="microseconds")
|
|
897
901
|
metadata.update({"startDate": start_time})
|
|
898
902
|
except (ValueError, TypeError):
|
|
899
|
-
|
|
903
|
+
self.log.exception("Cannot parse start time")
|
|
900
904
|
|
|
901
905
|
if end_time:
|
|
902
906
|
try:
|
|
@@ -906,7 +910,7 @@ class ICATLIMS(AbstractLims):
|
|
|
906
910
|
end_time = dt_aware.isoformat(timespec="microseconds")
|
|
907
911
|
metadata.update({"endDate": end_time})
|
|
908
912
|
except (ValueError, TypeError):
|
|
909
|
-
|
|
913
|
+
self.log.exception("Cannot parse start time")
|
|
910
914
|
|
|
911
915
|
metadata.update(
|
|
912
916
|
{
|
|
@@ -951,9 +955,9 @@ class ICATLIMS(AbstractLims):
|
|
|
951
955
|
beamline = self._get_scheduled_beamline()
|
|
952
956
|
msg = f"Dataset Beamline={beamline} "
|
|
953
957
|
msg += f"Current Beamline={HWR.beamline.session.beamline_name}"
|
|
954
|
-
|
|
958
|
+
self.log.info(msg)
|
|
955
959
|
except Exception:
|
|
956
|
-
|
|
960
|
+
self.log.exception(
|
|
957
961
|
"Failed to get _get_scheduled_beamline",
|
|
958
962
|
)
|
|
959
963
|
_session = HWR.beamline.session
|
|
@@ -972,7 +976,7 @@ class ICATLIMS(AbstractLims):
|
|
|
972
976
|
start_time = dt_aware.isoformat(timespec="microseconds")
|
|
973
977
|
metadata.update({"startDate": start_time})
|
|
974
978
|
except (ValueError, TypeError):
|
|
975
|
-
|
|
979
|
+
self.log.exception("Cannot parse start time")
|
|
976
980
|
|
|
977
981
|
if end_time:
|
|
978
982
|
try:
|
|
@@ -982,7 +986,7 @@ class ICATLIMS(AbstractLims):
|
|
|
982
986
|
end_time = dt_aware.isoformat(timespec="microseconds")
|
|
983
987
|
metadata.update({"endDate": end_time})
|
|
984
988
|
except (ValueError, TypeError):
|
|
985
|
-
|
|
989
|
+
self.log.exception("Cannot parse end time")
|
|
986
990
|
|
|
987
991
|
metadata.update(
|
|
988
992
|
{
|
|
@@ -20,7 +20,6 @@ Example of xml file:
|
|
|
20
20
|
</object>
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
|
-
import logging
|
|
24
23
|
import time
|
|
25
24
|
|
|
26
25
|
import gevent
|
|
@@ -87,9 +86,7 @@ class EPICSMotor(EPICSActuator, AbstractMotor):
|
|
|
87
86
|
# Treat infinite limits
|
|
88
87
|
self._nominal_limits = (None, None)
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
"Motor %s limits: %s" % (self.motor_name, self._nominal_limits)
|
|
92
|
-
)
|
|
89
|
+
self.log.info("Motor %s limits: %s" % (self.motor_name, self._nominal_limits))
|
|
93
90
|
return self._nominal_limits
|
|
94
91
|
|
|
95
92
|
def get_velocity(self):
|
|
@@ -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
|
|
|
22
21
|
from mxcubecore.HardwareObjects.abstract.AbstractAperture import AbstractAperture
|
|
23
22
|
|
|
@@ -37,7 +36,7 @@ class LNLSAperture(AbstractAperture):
|
|
|
37
36
|
self._diameter_size_list = eval(self.getProperty("diameter_size_list"))
|
|
38
37
|
except BaseException:
|
|
39
38
|
self._diameter_size_list = DEFAULT_DIAMETER_SIZE_LIST
|
|
40
|
-
|
|
39
|
+
self.log.error(
|
|
41
40
|
"Aperture: no diameter size list defined, using default list"
|
|
42
41
|
)
|
|
43
42
|
|
|
@@ -45,9 +44,7 @@ class LNLSAperture(AbstractAperture):
|
|
|
45
44
|
self._position_list = eval(self.getProperty("position_list"))
|
|
46
45
|
except BaseException:
|
|
47
46
|
self._position_list = DEFAULT_POSITION_LIST
|
|
48
|
-
|
|
49
|
-
"Aperture: no position list defined, using default list"
|
|
50
|
-
)
|
|
47
|
+
self.log.error("Aperture: no position list defined, using default list")
|
|
51
48
|
|
|
52
49
|
self.set_position_index(0)
|
|
53
50
|
self.set_diameter_index(1) # 100um as default
|
|
@@ -69,21 +69,21 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
69
69
|
self.array_size = self.read_array_size()
|
|
70
70
|
|
|
71
71
|
def poll(self):
|
|
72
|
-
|
|
72
|
+
self.log.debug("LNLS Camera image acquiring has started.")
|
|
73
73
|
self.imageGenerator(self.delay)
|
|
74
74
|
|
|
75
75
|
def imageGenerator(self, delay):
|
|
76
76
|
while self.liveState:
|
|
77
77
|
self.getCameraImage()
|
|
78
78
|
gevent.sleep(delay)
|
|
79
|
-
|
|
79
|
+
self.log.debug("LNLS Camera image acquiring has stopped.")
|
|
80
80
|
|
|
81
81
|
def getCameraImage(self):
|
|
82
82
|
# Get the image from uEye camera IOC
|
|
83
83
|
self.imgArray = self.get_channel_value(CAMERA_DATA)
|
|
84
84
|
if self.imgArray is None:
|
|
85
85
|
if self._print_cam_error_null:
|
|
86
|
-
|
|
86
|
+
self.log.error(
|
|
87
87
|
"%s - Error: null camera image!" % (self.__class__.__name__)
|
|
88
88
|
)
|
|
89
89
|
self._print_cam_sucess = True
|
|
@@ -97,7 +97,7 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
97
97
|
# PS: This check possibly can be removed and the treatment can be
|
|
98
98
|
# moved into the except scope.
|
|
99
99
|
if self._print_cam_error_size:
|
|
100
|
-
|
|
100
|
+
self.log.error(
|
|
101
101
|
"%s - Error in array lenght! Expected %d, but got %d."
|
|
102
102
|
% (self.__class__.__name__, self.array_size, len(self.imgArray))
|
|
103
103
|
)
|
|
@@ -129,12 +129,10 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
129
129
|
img_bin_str = f.getvalue()
|
|
130
130
|
# Sent image to gui
|
|
131
131
|
self.emit("imageReceived", img_bin_str, self.height, self.width)
|
|
132
|
-
#
|
|
132
|
+
# self.log.debug('Got camera image: ' + \
|
|
133
133
|
# str(img_bin_str[0:10]))
|
|
134
134
|
if self._print_cam_sucess:
|
|
135
|
-
|
|
136
|
-
"LNLSCamera is emitting images! Cam routine is ok."
|
|
137
|
-
)
|
|
135
|
+
self.log.info("LNLSCamera is emitting images! Cam routine is ok.")
|
|
138
136
|
self._print_cam_sucess = False
|
|
139
137
|
self._print_cam_error_null = True
|
|
140
138
|
self._print_cam_error_size = True
|
|
@@ -142,7 +140,7 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
142
140
|
return 0
|
|
143
141
|
except:
|
|
144
142
|
if self._print_cam_error_format:
|
|
145
|
-
|
|
143
|
+
self.log.error("Error while formatting camera image")
|
|
146
144
|
self._print_cam_sucess = True
|
|
147
145
|
self._print_cam_error_null = True
|
|
148
146
|
self._print_cam_error_size = True
|
|
@@ -158,7 +156,7 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
158
156
|
except:
|
|
159
157
|
print("Error on getting camera pixel size.")
|
|
160
158
|
finally:
|
|
161
|
-
|
|
159
|
+
self.log.info("LNLSCamera pixel size is %d." % (pixel_size))
|
|
162
160
|
return pixel_size
|
|
163
161
|
|
|
164
162
|
def read_width(self):
|
|
@@ -170,7 +168,7 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
170
168
|
except:
|
|
171
169
|
print("Error on getting camera width.")
|
|
172
170
|
finally:
|
|
173
|
-
|
|
171
|
+
self.log.info("LNLSCamera width is %d." % (width))
|
|
174
172
|
return width
|
|
175
173
|
|
|
176
174
|
def read_height(self):
|
|
@@ -182,7 +180,7 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
182
180
|
except:
|
|
183
181
|
print("Error on getting camera height.")
|
|
184
182
|
finally:
|
|
185
|
-
|
|
183
|
+
self.log.info("LNLSCamera height is %d." % (height))
|
|
186
184
|
return height
|
|
187
185
|
|
|
188
186
|
def read_array_size(self):
|
|
@@ -343,7 +341,7 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
343
341
|
self.liveState = live
|
|
344
342
|
|
|
345
343
|
if live:
|
|
346
|
-
|
|
344
|
+
self.log.info("LNLSCamera is going to poll images")
|
|
347
345
|
self.delay = float(int(self.getProperty("interval")) / 1000.0)
|
|
348
346
|
thread = Thread(target=self.poll)
|
|
349
347
|
thread.daemon = True
|
|
@@ -414,7 +412,7 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
414
412
|
while motorHwobj.getPosition() < positions[index]:
|
|
415
413
|
gevent.sleep(0.02)
|
|
416
414
|
|
|
417
|
-
|
|
415
|
+
self.log.info(
|
|
418
416
|
"%s - taking snapshot #%d" % (self.__class__.__name__, index + 1)
|
|
419
417
|
)
|
|
420
418
|
|
|
@@ -443,7 +441,7 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
443
441
|
# centred_images.append((0, str(imageInfo)))
|
|
444
442
|
# centred_images.reverse()
|
|
445
443
|
except:
|
|
446
|
-
|
|
444
|
+
self.log.exception(
|
|
447
445
|
"%s - could not take crystal snapshots" % (self.__class__.__name__)
|
|
448
446
|
)
|
|
449
447
|
|
|
@@ -493,7 +491,7 @@ class LNLSCamera(BaseHardwareObjects.HardwareObject):
|
|
|
493
491
|
try:
|
|
494
492
|
self.centring_status["images"] = snapshots_procedure.get()
|
|
495
493
|
except:
|
|
496
|
-
|
|
494
|
+
self.log.exception(
|
|
497
495
|
"%s - could not take crystal snapshots" % (self.__class__.__name__)
|
|
498
496
|
)
|
|
499
497
|
|
|
@@ -93,16 +93,12 @@ class LNLSCollect(AbstractMultiCollect, HardwareObject):
|
|
|
93
93
|
path = output_directory
|
|
94
94
|
try:
|
|
95
95
|
if os.path.isdir(path):
|
|
96
|
-
|
|
96
|
+
self.log.info("Directory exists: %s " % path)
|
|
97
97
|
else:
|
|
98
98
|
os.makedirs(path)
|
|
99
|
-
|
|
100
|
-
"Successfully created the directory %s " % path
|
|
101
|
-
)
|
|
99
|
+
self.log.info("Successfully created the directory %s " % path)
|
|
102
100
|
except OSError:
|
|
103
|
-
|
|
104
|
-
"Creation of the directory %s failed." % path
|
|
105
|
-
)
|
|
101
|
+
self.log.error("Creation of the directory %s failed." % path)
|
|
106
102
|
|
|
107
103
|
if not output_directory.endswith("/"):
|
|
108
104
|
output_directory = output_directory + "/"
|
|
@@ -162,25 +158,23 @@ class LNLSCollect(AbstractMultiCollect, HardwareObject):
|
|
|
162
158
|
|
|
163
159
|
# command = 'scan -c {} -m "{}" -o {} --motor {} --xlabel {} --plot-type {} {} --start {} --end {} --step-or-points {} --time {} --prescan={} --postscan={}'.format(config_yml, message, output_file, motor_mnenomic, xlabel, plot_type, mode, start, end, step_or_points, time, prescan, postscan)
|
|
164
160
|
|
|
165
|
-
|
|
161
|
+
self.log.info("[SCAN-UTILS] Command: " + str(command))
|
|
166
162
|
print("\n[SCAN-UTILS] Command: " + str(command) + "\n")
|
|
167
163
|
|
|
168
164
|
# Store values for clean up
|
|
169
|
-
|
|
165
|
+
self.log.info("[Clean up] Configuring...")
|
|
170
166
|
omega = HWR.beamline.diffractometer.motor_hwobj_dict.get("phi")
|
|
171
167
|
if omega is None:
|
|
172
|
-
|
|
168
|
+
self.log.error("[Clean up] Could not get omega motor.")
|
|
173
169
|
else:
|
|
174
170
|
omega_original_velo = omega.get_velocity()
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
)
|
|
178
|
-
logging.getLogger("HWR").info("[Clean up] Configured.")
|
|
171
|
+
self.log.info("[Clean up] Omega velo: {}".format(omega_original_velo))
|
|
172
|
+
self.log.info("[Clean up] Configured.")
|
|
179
173
|
|
|
180
174
|
# Set detector cbf header
|
|
181
175
|
header_ok = self.set_pilatus_det_header(start_float, step_size)
|
|
182
176
|
if not header_ok:
|
|
183
|
-
|
|
177
|
+
self.log.error(
|
|
184
178
|
"[Collect] Pilatus header params could not be set! Collection aborted."
|
|
185
179
|
)
|
|
186
180
|
return
|
|
@@ -192,41 +186,37 @@ class LNLSCollect(AbstractMultiCollect, HardwareObject):
|
|
|
192
186
|
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True
|
|
193
187
|
)
|
|
194
188
|
|
|
195
|
-
|
|
189
|
+
self.log.info("[SCAN-UTILS] Executing scan...")
|
|
196
190
|
logging.getLogger("user_level_log").info("Executing scan...")
|
|
197
191
|
stdout, stderr = process.communicate()
|
|
198
192
|
# stdout
|
|
199
|
-
|
|
200
|
-
"[SCAN-UTILS] output : " + stdout.decode("utf-8")
|
|
201
|
-
)
|
|
193
|
+
self.log.info("[SCAN-UTILS] output : " + stdout.decode("utf-8"))
|
|
202
194
|
print("[SCAN-UTILS] output : " + stdout.decode("utf-8"))
|
|
203
195
|
# stderr
|
|
204
|
-
|
|
205
|
-
"[SCAN-UTILS] errors : " + stderr.decode("utf-8")
|
|
206
|
-
)
|
|
196
|
+
self.log.error("[SCAN-UTILS] errors : " + stderr.decode("utf-8"))
|
|
207
197
|
print("[SCAN-UTILS] errors : " + stderr.decode("utf-8"))
|
|
208
198
|
|
|
209
199
|
except BaseException:
|
|
210
|
-
|
|
200
|
+
self.log.error("[SCAN-UTILS] Error in calling scan.")
|
|
211
201
|
# print("[SCAN-UTILS] Error in calling scan.")
|
|
212
202
|
raise
|
|
213
203
|
else:
|
|
214
|
-
|
|
204
|
+
self.log.info("[SCAN-UTILS] Finished scan!")
|
|
215
205
|
logging.getLogger("user_level_log").info("Finished scan!")
|
|
216
206
|
# print("[SCAN-UTILS] Finished scan!")
|
|
217
207
|
finally:
|
|
218
208
|
# Clean up
|
|
219
|
-
|
|
209
|
+
self.log.info("[Clean up] Applying...")
|
|
220
210
|
import time as timee
|
|
221
211
|
|
|
222
212
|
timee.sleep(10)
|
|
223
213
|
if omega is not None:
|
|
224
214
|
# Restore omega default velocity
|
|
225
215
|
omega.set_velocity(omega_original_velo)
|
|
226
|
-
|
|
216
|
+
self.log.info(
|
|
227
217
|
"[Clean up] Omega velo reset to: {}".format(omega_original_velo)
|
|
228
218
|
)
|
|
229
|
-
|
|
219
|
+
self.log.info("[Clean up] Done!")
|
|
230
220
|
|
|
231
221
|
data_collect_parameters["status"] = "Running"
|
|
232
222
|
data_collect_parameters["status"] = "Data collection successful"
|
|
@@ -248,12 +238,12 @@ class LNLSCollect(AbstractMultiCollect, HardwareObject):
|
|
|
248
238
|
not failed,
|
|
249
239
|
failed_msg if failed else "Data collection successful",
|
|
250
240
|
)
|
|
251
|
-
|
|
241
|
+
self.log.info("data collection successful in loop")
|
|
252
242
|
self.emit("collectReady", (True,))
|
|
253
243
|
|
|
254
244
|
def set_pilatus_det_header(self, start_angle, step_size):
|
|
255
245
|
# Read current params
|
|
256
|
-
|
|
246
|
+
self.log.info("Setting Pilatus CBF header...")
|
|
257
247
|
wl = self.bl_control.energy.get_wavelength()
|
|
258
248
|
dd = self.bl_control.detector_distance.get_value()
|
|
259
249
|
te = self.bl_control.energy.get_value()
|
|
@@ -263,7 +253,7 @@ class LNLSCollect(AbstractMultiCollect, HardwareObject):
|
|
|
263
253
|
except Exception as e:
|
|
264
254
|
print("Error on setting Pilatus transmission: {}".format(str(e)))
|
|
265
255
|
|
|
266
|
-
|
|
256
|
+
self.log.exception("")
|
|
267
257
|
return False
|
|
268
258
|
|
|
269
259
|
# Write to det (values will be on the cbf header)
|
|
@@ -22,26 +22,24 @@ class LNLSDetDistMotor(LNLSMotor):
|
|
|
22
22
|
logging.getLogger("user_level_log").info("Setting detector distance...")
|
|
23
23
|
|
|
24
24
|
# Enable air
|
|
25
|
-
|
|
25
|
+
self.log.info("%s: Enabling air" % self.motor_name)
|
|
26
26
|
command = "#5,7,8j/"
|
|
27
27
|
self.set_channel_value(self.PMAC_SENDCMD, command)
|
|
28
28
|
time.sleep(2)
|
|
29
29
|
|
|
30
30
|
# Wait for stability
|
|
31
|
-
|
|
31
|
+
self.log.info("%s: Wait for air stability" % self.motor_name)
|
|
32
32
|
while self.get_channel_value(self.MOTOR_DMOV) == 0:
|
|
33
33
|
time.sleep(0.2)
|
|
34
34
|
current_value = self.get_value()
|
|
35
35
|
self.update_value(current_value)
|
|
36
36
|
|
|
37
37
|
# Move det dist motor
|
|
38
|
-
|
|
38
|
+
self.log.info("%s: Set motor to %s" % (self.motor_name, value))
|
|
39
39
|
self.set_channel_value(self.ACTUATOR_VAL, value)
|
|
40
40
|
|
|
41
41
|
# Wait for movement
|
|
42
|
-
|
|
43
|
-
"%s: Wait for movement to finish" % self.motor_name
|
|
44
|
-
)
|
|
42
|
+
self.log.info("%s: Wait for movement to finish" % self.motor_name)
|
|
45
43
|
while (
|
|
46
44
|
self.get_channel_value(self.MOTOR_DMOV) == 0
|
|
47
45
|
or abs(current_value - value) > 0.0005
|
|
@@ -52,22 +50,20 @@ class LNLSDetDistMotor(LNLSMotor):
|
|
|
52
50
|
|
|
53
51
|
# Disable air
|
|
54
52
|
time.sleep(1)
|
|
55
|
-
|
|
53
|
+
self.log.info("%s: Disabling air" % self.motor_name)
|
|
56
54
|
command = "#5,7,8dkill"
|
|
57
55
|
self.set_channel_value(self.PMAC_SENDCMD, command)
|
|
58
56
|
time.sleep(0.5)
|
|
59
57
|
|
|
60
58
|
# Wait for stability
|
|
61
|
-
|
|
62
|
-
"%s: Wait for air stability again" % self.motor_name
|
|
63
|
-
)
|
|
59
|
+
self.log.info("%s: Wait for air stability again" % self.motor_name)
|
|
64
60
|
while self.get_channel_value(self.MOTOR_DMOV) == 0:
|
|
65
61
|
time.sleep(0.2)
|
|
66
62
|
current_value = self.get_value()
|
|
67
63
|
self.update_value(current_value)
|
|
68
64
|
|
|
69
65
|
# Wait for stability
|
|
70
|
-
|
|
66
|
+
self.log.info("%s: Movement done!" % self.motor_name)
|
|
71
67
|
self.update_state(self.STATES.READY)
|
|
72
68
|
for i in range(2):
|
|
73
69
|
logging.getLogger("user_level_log").info("Detector distance is set.")
|