From 2da9d356350b7b1009e552a51498cf9e8398fc45 Mon Sep 17 00:00:00 2001 From: voulot_d Date: Mon, 3 Apr 2017 15:26:17 +0200 Subject: [PATCH] Startup --- devices/camtool.properties | 6 +++--- script/RFscan/SchottkyScan.py | 8 ++++---- script/local.py | 8 ++++++-- script/test/CamtoolPseudoDevice.py | 7 ------- script/test/PseudoDeviceTrigger.py | 7 +++++++ 5 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 script/test/CamtoolPseudoDevice.py create mode 100644 script/test/PseudoDeviceTrigger.py diff --git a/devices/camtool.properties b/devices/camtool.properties index 9991d41..9e016c6 100644 --- a/devices/camtool.properties +++ b/devices/camtool.properties @@ -1,4 +1,4 @@ -#Mon Apr 03 11:24:29 CEST 2017 +#Mon Apr 03 15:18:48 CEST 2017 colormap=Temperature colormapAutomatic=true colormapMax=578.797 @@ -18,8 +18,8 @@ roiY=0 rotation=0.0 rotationCrop=false scale=1.0 -spatialCalOffsetX=9324.4111328125 -spatialCalOffsetY=11107.228515625 +spatialCalOffsetX=-685.5355704856097 +spatialCalOffsetY=-874.5371885002435 spatialCalScaleX=-13.612279109045152 spatialCalScaleY=-12.708499394975416 spatialCalUnits=mm diff --git a/script/RFscan/SchottkyScan.py b/script/RFscan/SchottkyScan.py index bfeb655..cc18a06 100644 --- a/script/RFscan/SchottkyScan.py +++ b/script/RFscan/SchottkyScan.py @@ -12,9 +12,9 @@ else: step = args[2] nb = int(args[3]) lat = args[4] - -phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE", "SINEG01-RSYS:GET-VSUM-PHASE") + +phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE", "SINEG01-RSYS:SET-VSUM-PHASE") phase.config.minValue =-180.0 phase.config.maxValue = 180.0 phase.config.resolution = 0.5 @@ -38,8 +38,8 @@ finally: #st.close() #Setting the return value -y = charge -x = rf_phase +y = charge +x = rf_phase index_max = y.index(max(y)) phase_ref = x[index_max] - 80 phase_offset = - phase_ref diff --git a/script/local.py b/script/local.py index 451eaf7..265e21b 100755 --- a/script/local.py +++ b/script/local.py @@ -306,6 +306,7 @@ if get_context().isServerEnabled(): #Managing local camtool server CAMTOOL_SERVER_SCRIPT = "camtool_pshell" #"cam_server" +PRINT_CAMTOOL_OUTPUT = True #When process quit def _get_camtool_port(): return camtool.url[camtool.url.rfind(":")+1:] @@ -326,7 +327,10 @@ def kill_camtool(): def _run_camtool(): try: #cmd = "source /opt/gfa/python\n" - cmd = CAMTOOL_SERVER_SCRIPT + " -p " + _get_camtool_port() + " -b /afs/psi.ch/intranet/SF/Applications/config/camtool_n > /dev/null &" + cmd = CAMTOOL_SERVER_SCRIPT + " -p " + _get_camtool_port() + " -b /afs/psi.ch/intranet/SF/Applications/config/camtool_n" + if not PRINT_CAMTOOL_OUTPUT: + cmd = cmd + " > /dev/null 2>&1" + print "Executing: ", cmd print exec_cmd(cmd) except: import traceback @@ -343,7 +347,7 @@ def check_camtool(): while not is_camtool_running(): if time.time() - start > 2.0: raise Exception("Error starting camtool process") - time.sleep(0.1) + time.sleep(0.5) def bsget(channel): """ diff --git a/script/test/CamtoolPseudoDevice.py b/script/test/CamtoolPseudoDevice.py deleted file mode 100644 index 9034f15..0000000 --- a/script/test/CamtoolPseudoDevice.py +++ /dev/null @@ -1,7 +0,0 @@ -class PseudoDevice(ReadonlyRegisterBase): - def doRead(self): - return gun_solenoid.take()/gun_phase.take() - -add_device(PseudoDevice("pseudo_device"), True) -pseudo_device.triggers = [gun_solenoid, gun_phase] - diff --git a/script/test/PseudoDeviceTrigger.py b/script/test/PseudoDeviceTrigger.py new file mode 100644 index 0000000..78fe4ed --- /dev/null +++ b/script/test/PseudoDeviceTrigger.py @@ -0,0 +1,7 @@ +class PseudoDevice(ReadonlyRegisterBase): + def doRead(self): + return gun_solenoid.readback.take()+gun_phase.readback.take() + +add_device(PseudoDevice("pseudo_device"), True) +pseudo_device.triggers = [gun_solenoid.readback, gun_phase.readback] +