Ejemplo n.º 1
0
 def rawAsynchronousMoveTo(self, mode):
     if mode not in SourceMode.SOURCE_MODES:
         print "mode string is wrong: legal values are %s" % (
             SourceMode.SOURCE_MODES)
         return
     self.amIBusy = True  # need to block to ensure script run complete before any other actions
     if mode == SourceMode.SOURCE_MODES[0]:
         GeneralCommands.run(self.remove_zacscan_script)
         sleep(1)
         if installation.isLive():
             GeneralCommands.run(self.idd_fast_energy_scan_script)
         else:
             print("zacscan is not available in DUMMY mode")
     elif mode == SourceMode.SOURCE_MODES[1]:
         GeneralCommands.run(self.remove_zacscan_script)
         sleep(1)
         if installation.isLive():
             GeneralCommands.run(self.idu_fast_energy_scan_script)
         else:
             print("zacscan is not available in DUMMY mode")
     elif mode == SourceMode.SOURCE_MODES[
             2] or mode == SourceMode.SOURCE_MODES[3]:
         GeneralCommands.run(self.remove_zacscan_script)
         sleep(1)
     else:
         print "Input mode is wrong: legal values %s or [SourceModeScannable.idd, SourceModeScannable.idu, SourceModeScannable.dpu, SourceModeScannable.dmu]." % (
             SourceMode.SOURCE_MODES)
         self.mode = SourceMode.SOURCE_MODES[4]
         raise ValueError("Input mode %s is not supported." % (str(mode)))
     self.mode = mode
     self.amIBusy = False
Ejemplo n.º 2
0
 def __init__(self, name, defaultmode='unknown'):
     '''
     Constructor - default source mode is 'idd'
     '''
     self.setName(name)
     self.amIBusy = False
     self.mode = defaultmode
     self.idd_fast_energy_scan_script = str(
         gda_git_loc +
         "/gda-diamond.git/configurations/i06-shared/scripts/i06shared/scan/idd_fast_energy_scan.py"
     )
     self.idu_fast_energy_scan_script = str(
         gda_git_loc +
         "/gda-diamond.git/configurations/i06-shared/scripts/i06shared/scan/idu_fast_energy_scan.py"
     )
     self.remove_zacscan_script = str(
         gda_git_loc +
         "/gda-diamond.git/configurations/i06-shared/scripts/i06shared/scan/remove_zacscan.py"
     )
     if installation.isLive():
         GeneralCommands.run(self.idd_fast_energy_scan_script)
Ejemplo n.º 3
0
import __main__  # @UnresolvedImport

blList = [__main__.beamenergy, __main__.ringcurrent]
fileHeader.add(blList)

#bpmList= [xbpm1x, xbpm1y, xbpm2x, xbpm2y, xbpm1anglex, xbpm1angley]; fileHeader.add(bpmList);

idList = [
    __main__.iddgap, __main__.iddtrp, __main__.iddbrp, __main__.idugap,
    __main__.idutrp, __main__.idubrp, __main__.pugap
]
fileHeader.add(idList)

beamline = LocalProperties.get(LocalProperties.GDA_BEAMLINE_NAME)

if installation.isLive() and beamline != "lab44":
    pgmList = [
        __main__.pgmpitch, __main__.pgmgratpitch, __main__.cff,
        __main__.grating, __main__.pgmenergy
    ]
else:
    #grating requires EPICS access
    pgmList = [
        __main__.pgmpitch, __main__.pgmgratpitch, __main__.cff,
        __main__.pgmenergy
    ]

fileHeader.add(pgmList)

if installation.isLive() and beamline != "lab44":
    energyList = [__main__.denergy, __main__.uenergy]
Ejemplo n.º 4
0
from Diamond.PseudoDevices.PGM_Grating import PGM_GratingClass
from i06shared import installation
from i06shared.scannables.dummyListScannable import DummyListScannable

print "-" * 100
print "Enable the Grating Control on PGM: 'grating'"

gratingGetPV = 'BL06I-OP-PGM-01:NLINES.VAL'
gratingSetPV = 'BL06I-OP-PGM-01:NLINES2.VAL'
gratingMoveStatusPV = "BL06I-OP-PGM-01:STATUS:MOVING"
if installation.isLive():
    grating = PGM_GratingClass('grating', gratingGetPV, gratingSetPV,
                               gratingMoveStatusPV)
else:
    grating = DummyListScannable('grating',
                                 list_values=[150, 400, 1200],
                                 unit="lines/mm",
                                 format_string="%d")