This commit is contained in:
gobbo_a
2025-12-15 16:53:16 +01:00
parent 1fa968a960
commit 4f6a49c538
37 changed files with 1214 additions and 518 deletions
+1
View File
@@ -11,6 +11,7 @@ CAMERA = "S10BC02-DSRM310"
CAMERA = "SARBD02-DSCR051"
CAMERA = "SATOP21-PMOS127-1D"
CAMERA = "SATBD01-DSCR210"
CAMERA = "SATOP31-PMOS132-2D"
CAMERA_URL = caget(CAMERA + ":BSREADCONFIG").replace("tcp://daq", "tcp://")
#CAMERA_URL= "tcp://sf-sioc-cs-83:9020"
#sCAMERA_URL= "tcp://sf-daqsync-17:9002"
+23
View File
@@ -0,0 +1,23 @@
run("Diagnostics/WSCdata")
run("Devices/Elements")
ws = "SINDI01-DWSC090"
current_state = {}
blms = WSC_data.get(ws, {})["BLM"]
for blm in blms:
current_state[blm] = is_blm_enabled(blm)
for blm, state in current_state.items():
if state != (False, False):
#set_blm_enabled(False, name)
print "Disable: ", blm
for blm, state in current_state.items():
if state != (False, False):
#set_blm_enabled(state, blm)
print "Restore: ", blm, state
+8
View File
@@ -0,0 +1,8 @@
import ch.psi.pshell.epics.Positioner as Positioner
import ch.psi.pshell.epics.ChannelDouble as ChannelDouble
import_py("CPython/hfitoff", "hfitoff")
import_py("CPython/extremum", "extremum")
fit_amplitude, fit_x_deg, fit_offset, x_max, fit_x, fit_y = hfitoff(y_array, x_array)
error_bar = mean([val.stdev for val in r.getReadable(0)])
+12
View File
@@ -0,0 +1,12 @@
test_bg_scan_state.assertReady()
test_bg_scan_state = State.Busy
test_bg_scan_result = None
try:
caput("STATS:TESTVALUE4", 11)
test_bg_scan_result = "Ok"
except:
test_bg_scan_result = str(sys.exc_info()[1])
finally:
#Make sure add this in the finally, otherwise you may get blocked
test_bg_scan_state = State.Ready
+16
View File
@@ -0,0 +1,16 @@
from java.util import Date
from java.text import SimpleDateFormat
channel = "ARS07-CECL-DPCT:BIN-PCT-STAT0-BIN"
bins = 0
time_range = 30
now = System.currentTimeMillis()
fmt = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
start = fmt.format(Date(now_ms - time_range * 1000 ))
end = fmt.format(Date(now))
set_exec_pars(reset=True) # A different file on each time
filename = get_exec_pars().path
d=Daqbuf(None, "sls-archiver")
d.saveQuery(filename, channel, start, end, bins)
+2
View File
@@ -0,0 +1,2 @@
run("test/test_daqbuf")
run("test/test_daqbuf")
+6
View File
@@ -0,0 +1,6 @@
#set_exec_pars(format="txt")
data2d = [ [1.0, 2.0, 3.0, 4.0, 5.0], [2.0, 3.0, 4.0, 5.0, 6.0, ], [3.0, 4.0, 5.0, 6.0, 7.0]]
time.sleep(10.0)
plot(data2d)
set_return(True)
+6
View File
@@ -0,0 +1,6 @@
#set_exec_pars(format="txt")
data2d = [ [1.0, 2.0, 3.0, 4.0, 5.0], [2.0, 3.0, 4.0, 5.0, 6.0, ], [3.0, 4.0, 5.0, 6.0, 7.0]]
plot(data2d)
set_return(True)
+10
View File
@@ -0,0 +1,10 @@
run("test/test_data_txt")
time.sleep(0.5)
run("test/test_data_txt")
time.sleep(0.5)
run("test/test_data_txt")
time.sleep(0.5)
run("test/test_data_txt")
time.sleep(0.5)
run("test/test_data_txt")
set_return(True)