This commit is contained in:
+17
-2
@@ -2,7 +2,15 @@
|
||||
# Deployment specific global definitions - executed after startup.py
|
||||
###################################################################################################
|
||||
|
||||
|
||||
def get_additional_positioners():
|
||||
ret = []
|
||||
try:
|
||||
for dev in [exit_slit, fe_vert_width, fe_horiz_width, cff, energy]:
|
||||
ret.append(dev)
|
||||
except:
|
||||
log("Error getting additional positioner: " + str(sys.exc_info()[1]))
|
||||
return ret
|
||||
|
||||
|
||||
###################################################################################################
|
||||
# Device initialization
|
||||
@@ -11,7 +19,10 @@ class Energy(PositionerBase):
|
||||
def __init__(self, name, config):
|
||||
ControlledVariableBase.__init__(self, name, photon_energy.config)
|
||||
self.setReadback(photon_energy.getReadback())
|
||||
|
||||
|
||||
def take(self):
|
||||
return photon_energy.take()
|
||||
|
||||
def doRead(self):
|
||||
return photon_energy.read()
|
||||
|
||||
@@ -66,6 +77,9 @@ class Cff(PositionerBase):
|
||||
def doRead(self):
|
||||
return pgm_cff.read()
|
||||
|
||||
def take(self):
|
||||
return pgm_cff.take()
|
||||
|
||||
def doWrite(self, val):
|
||||
if not pgm_cff.isInPosition(val):
|
||||
change_photon_pars(_cff=val)
|
||||
@@ -109,6 +123,7 @@ fe_state.setSettlingCondition(FeSettlingCondition())
|
||||
oper_mode.getSetpoint().setBlockingWrite(True)
|
||||
photon_energy.setSettlingCondition(IdSettlingCondition())
|
||||
id_mode.setSettlingCondition(IdSettlingCondition())
|
||||
id_mode.setpoint.blockingWrite=True
|
||||
grating.setSettlingCondition(GrSettlingCondition())
|
||||
pgm_cff.setSettlingCondition(CffSettlingCondition())
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"PASSES" : 1,
|
||||
"STOP" : [ 42.0 ],
|
||||
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
|
||||
"PRE_ACTIONS" : { },
|
||||
"COMPRESSION" : true,
|
||||
"SENSORS" : [ "scienta.dataMatrix" ],
|
||||
"ZIGZAG" : false,
|
||||
"SETTLING_TIME" : 0.0,
|
||||
"MONITORS" : [ "current" ],
|
||||
"START" : [ 40.0 ],
|
||||
"RANGE" : [ null, null, null, null ],
|
||||
"POSITIONERS" : [ "energy" ],
|
||||
"STEPS" : [ 4 ],
|
||||
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
|
||||
}
|
||||
@@ -29,6 +29,7 @@ def load_parameters(name):
|
||||
if NAME:
|
||||
load_parameters(NAME)
|
||||
|
||||
reinit(None)
|
||||
|
||||
#Enforece parameter types
|
||||
positioners = string_to_obj(POSITIONERS)
|
||||
@@ -50,7 +51,7 @@ if "grating" in PRE_ACTIONS.keys():
|
||||
if (_id_mode is not None) or (_grating is not None):
|
||||
print _id_mode, _grating
|
||||
change_photon_pars(_id_mode=_id_mode, _grating=_grating)
|
||||
1/0
|
||||
|
||||
#Execute pre-actions
|
||||
for key in PRE_ACTIONS.keys():
|
||||
if key=="eval":
|
||||
@@ -73,7 +74,7 @@ if COMPRESSION:
|
||||
set_exec_pars(compression=[scienta.dataMatrix])
|
||||
|
||||
|
||||
def before_read(pos, scan):
|
||||
def before_read(pos, scan):
|
||||
trigger_scienta()
|
||||
|
||||
|
||||
@@ -82,12 +83,15 @@ def after_read(rec, scan):
|
||||
pass
|
||||
|
||||
try:
|
||||
ret= ascan (positioners, sensors, start, end, steps, \
|
||||
latency= latency, relative=False, passes=passes, zigzag=zigzag, \
|
||||
before_read=before_read, after_read=after_read, \
|
||||
snaps=SNAPS, diags=DIAGS, monitors=MONITORS)
|
||||
if len(positioners)==0:
|
||||
ret= tscan (sensors, 1,0, passes=passes, \
|
||||
before_read=before_read, after_read=after_read, \
|
||||
snaps=SNAPS, diags=DIAGS, monitors=MONITORS)
|
||||
else:
|
||||
ret= ascan (positioners, sensors, start, end, steps, \
|
||||
latency= latency, relative=False, passes=passes, zigzag=zigzag, \
|
||||
before_read=before_read, after_read=after_read, \
|
||||
snaps=SNAPS, diags=DIAGS, monitors=MONITORS)
|
||||
finally:
|
||||
scienta.zeroSupplies()
|
||||
pass
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user