This commit is contained in:
2018-08-15 17:04:21 +02:00
parent 1de8ced3d5
commit 3e41debde1
55 changed files with 1015 additions and 277 deletions

16
script/test/TestCfg.py Normal file
View File

@@ -0,0 +1,16 @@
"""
class DevConfig(DeviceConfig):
def __init__(self):
self.i = 1
self.d = 1.0
self.b = True
self.s = "Test"
"""
class Dev(DeviceBase):
def __init__(self, name):
#DeviceBase.__init__(self, name, DevConfig())
DeviceBase.__init__(self, name, DeviceConfig({"i":1, "d":1.0, "b":True, "s": "Test"}))
raise Exception("test ex")
add_device(Dev("test_cfg"), True)

View File

@@ -1,6 +1,6 @@
import traceback
is_panel = get_exec_pars().source != CommandSource.ui #Must be checked before callin "run"
is_panel = False #get_exec_pars().source != CommandSource.ui #Must be checked before callin "run"
#set_exec_pars(provider="txt")
@@ -10,8 +10,8 @@ BPM_SENSORS = [("x","X1"), ("y","Y1"), ("q","Q1")] #(logic name sufix, channel s
prefix = args[0] if is_panel else "S30CB09-DWSC440" #"SINDI01-DWSC090"
scan_type = args[1] if is_panel else "X1"
scan_range = args[2] if is_panel else [-200, 200, -200, 200]
cycles = args[3] if is_panel else 3
velocity = args[4] if is_panel else 200
cycles = args[3] if is_panel else 1
velocity = args[4] if is_panel else 400
bpms = args[5] if is_panel else ["BPM1", "BPM2"]
blms = args[6] if is_panel else ["BLM1", "BLM2"]
bkgrd = args[7] if is_panel else 10

View File

@@ -6,11 +6,11 @@
#iavg = create_averager("ca://TESTIOC:TESTSINUS:SinCalc", 3, interval = -1)
iavg = create_averager("bs://Int8Scalar", 3, interval = 0.1)
iavg = create_averager("ca://TESTIOC:TESTSINUS:SinCalc", 3, interval = -1)
#iavg = create_averager("bs://Int8Scalar", 3, interval = 0.1)
tscan (iavg, 10, 0.5)
tscan (iavg, 10, 0.2, layout = "sf", domain_axis = "Time")
#$iavg.close()

View File

@@ -0,0 +1,23 @@
###################################################################################################
# Example of using ImageJ functionalities through ijutils.
###################################################################################################
from ijutils import *
import java.awt.Color as Color
#Image Loading
ip = load_image("images/img.png", title="Image")
aux = grayscale(ip, in_place = False)
bin = ip.duplicate()
ip_bin = auto_threshold(aux, in_place=False)
create_stack([ ip_bin,
#binary_fill_holes(ip_bin, in_place=False),
#binary_outline(ip_bin, in_place=False),
#binary_outline(binary_fill_holes(ip_bin, in_place=False)),
binary_dilate(ip_bin, in_place=False),
binary_erode(ip_bin, in_place=False),
binary_open(ip_bin, in_place=False),
binary_close(ip_bin, in_place=False),
binary_skeletonize(ip_bin, in_place=False)], title = "Binarization").show()

7
script/test/testmain.py Normal file
View File

@@ -0,0 +1,7 @@
def add(a1, a2):
return a1+a2
if __name__ == "__main__":
print add(4,3)