diff --git a/script/back.py b/script/back.py deleted file mode 100644 index 1e382a74..00000000 --- a/script/back.py +++ /dev/null @@ -1,7 +0,0 @@ -import java.util.logging.Logger as Logger -logger = Logger.getLogger("back") - - -logger.info("Started") - - diff --git a/script/calc.groovy b/script/calc.groovy deleted file mode 100644 index 2eb6185b..00000000 --- a/script/calc.groovy +++ /dev/null @@ -1,6 +0,0 @@ - - -def calc(a){ - a*2 -} - diff --git a/script/calc.js b/script/calc.js deleted file mode 100644 index 39afdfa6..00000000 --- a/script/calc.js +++ /dev/null @@ -1,5 +0,0 @@ - - -function calc(a) { - return a * 5; - } \ No newline at end of file diff --git a/script/calc.py b/script/calc.py deleted file mode 100644 index a86ca499..00000000 --- a/script/calc.py +++ /dev/null @@ -1,3 +0,0 @@ -def calc(a): - return a*2 - diff --git a/script/cls.groovy b/script/cls.groovy deleted file mode 100644 index 97d7612b..00000000 --- a/script/cls.groovy +++ /dev/null @@ -1,7 +0,0 @@ -package script -class cls { - double val = 1.0 - void exec(){ - println "Exec" - } -} \ No newline at end of file diff --git a/script/cls.py b/script/cls.py deleted file mode 100644 index 6c2a6f23..00000000 --- a/script/cls.py +++ /dev/null @@ -1,4 +0,0 @@ -class cls: - def execute(self): - print "Execute" - diff --git a/script/local.py b/script/local.py index 4b7a5364..c8b2efdb 100644 --- a/script/local.py +++ b/script/local.py @@ -1,2 +1,2 @@ #det.data.monitored=True -startBackgroudTask("back",1.0) \ No newline at end of file +#startBackgroudTask("back",1.0) \ No newline at end of file diff --git a/script/scan.py b/script/scan.py deleted file mode 100644 index a86ca499..00000000 --- a/script/scan.py +++ /dev/null @@ -1,3 +0,0 @@ -def calc(a): - return a*2 - diff --git a/script/scan1.py b/script/scan1.py deleted file mode 100644 index e0154061..00000000 --- a/script/scan1.py +++ /dev/null @@ -1 +0,0 @@ -a= lscan(scienta.sizeX, (scienta.spectrum,current,cur1), 980.0, 992.0, 12, 0.1) \ No newline at end of file diff --git a/script/script.groovy b/script/script.groovy deleted file mode 100644 index 7f275d78..00000000 --- a/script/script.groovy +++ /dev/null @@ -1,31 +0,0 @@ - -def function(a){ - a*2 -} -//evaluate (new File("calc.groovy")) -//evaluate (new File("cls.groovy")) - -println "--------------" - -lib.load "calc" -cls = lib.load "cls" - - -//This is how to load a new class dinamically -// ClassLoader parent = lib.class.getClassLoader(); -// groovy.lang.GroovyClassLoader loader = new groovy.lang.GroovyClassLoader(parent); -// Class cls = loader.parseClass(new File("script\\cls.groovy")); - - -println dev.get() -println dev2.val -println calc(6) - - -//cls = Class.forName('cls') -//obj = new cls() -obj = cls.newInstance() -println obj.val -obj.exec() - - diff --git a/script/script.js b/script/script.js deleted file mode 100644 index d6ec8b62..00000000 --- a/script/script.js +++ /dev/null @@ -1,13 +0,0 @@ -function calcx(a) { - return a * 5; - } - -print('Hello, World') -lib.load ("calc") - - -a=3 -a -print (dev.get()) -print (dev2.val) -print (calc(5)) diff --git a/script/script.py b/script/script.py deleted file mode 100644 index 74493601..00000000 --- a/script/script.py +++ /dev/null @@ -1,42 +0,0 @@ -import sys -import time - -#To add library folders from within the script -#sys.path.append("./site-packages") - - -import requests -r = requests.get('https://api.github.com', auth=('user', 'pass')) -print r.status_code -print r.headers['content-type'] -r.close() - - -def calc2(a): - return a*2 -time.sleep(2) -#import os -#print os.environ -#import calc - - -lib.load("calc") -lib.load("cls") -time.sleep(2) -for x in range(3): - print x - while(True): - print x*2 - break -time.sleep(2) -x=cls() -x.execute() -print dev.take() -print dev2.val -time.sleep(1) -print calc(4) - - -""" -It lives!!!! -""" \ No newline at end of file diff --git a/script/startup.groovy b/script/startup.groovy deleted file mode 100644 index b17d5a1d..00000000 --- a/script/startup.groovy +++ /dev/null @@ -1,53 +0,0 @@ -import ch.psi.pshell.scan.LineScan; -import ch.psi.pshell.scan.AreaScan; - - -def sleep(millis){ - Thread.sleep(millis); -} - -def toArray(obj){ - /* if (!obj.getClass().isArray()){ - arr = java.lang.reflect.Array.newInstance(obj.getClass(), 1); - arr[0]= obj; - obj=arr - }*/ - return obj -} - - -def scan(writables, readables, start, end, steps, latency_ms=0, plot=null){ - writables=toList(writables) - readables=toList(readables) - start=toList(start) - end=toList(end) - scan = LineScan(writables,readables, start, end , steps,latency_ms, controller) - scan.setPlotName(plot) - scan.start() - return scan.getResult() -} - -def tscan(readables, points, interval_ms, plot=null){ - writables=[] - //readables=toList(readables) - readables=[readables,] - start=[0] - - end=[points] - steps=points - scan = LineScan(writables,readables, start, end , steps,interval_ms, controller) - scan.setPlotName(plot) - scan.start() - return scan.getResult() -} - -def ascan(writables, readables, start, end, steps, latency_ms0, plot=null){ - writables=toList(writables) - readables=toList(readables) - start=toList(start) - end=toList(end) - scan = AreaScan(writables,readables, start, end , steps,latency_ms, controller) - scan.setPlotName(plot) - scan.start() - return scan.getResult() -} \ No newline at end of file diff --git a/script/test1.py b/script/test1.py deleted file mode 100644 index 7b36398e..00000000 --- a/script/test1.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -Line Scan -""" - -a= lscan(inp,(sin,out,arr),0,40,20,0.1) \ No newline at end of file diff --git a/script/test2.py b/script/test2.py deleted file mode 100644 index de4ec03b..00000000 --- a/script/test2.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -Line Scan with 2 writables and triggering -""" - -index=0 - -def BeforeReadout(): - global index - print "Frame = " + str(index) - index=index+1 - #log("trigger " + index) - caput("TESTIOC:TESTBO:MyBO","On") - caput("TESTIOC:TESTBO:MyBO","Off") - - -a= lscan((motor,inp),(sin,out,arr),(0,0),(4,40),20,0.1, before_read=BeforeReadout) \ No newline at end of file diff --git a/script/test3.py b/script/test3.py deleted file mode 100644 index 9aa7971f..00000000 --- a/script/test3.py +++ /dev/null @@ -1,12 +0,0 @@ -""" -Processing and plotting scan data -""" - -inp.write(0.0) -scan1= lscan(inp,(sin,out,arr),0,40,20,0.1,"Scan 1") -scan2= lscan(inp,(sin,out,arr),0,40,20,0.1,"Scan 2") -result=[] -for i in range(20): - result.append(scan1[i].values[0]+scan2[i].values[0]) -plot(result) -print result diff --git a/script/test4.py b/script/test4.py deleted file mode 100644 index a3eefabc..00000000 --- a/script/test4.py +++ /dev/null @@ -1,11 +0,0 @@ -""" -Vector Scan -""" - -vector = [ [1,1] , [1,2] , [1,3] , [1,4] , - [1.5,2.5] , - [2,1] , [2,2] , [2,3] , [2,4] , - [2.5,2.5] , - [3,1] , [3,2] , [3,3] , [3,4] ] - -a= vscan((dev,inp),(sin,out),vector,0.1) diff --git a/script/test5.py b/script/test5.py deleted file mode 100644 index bf6c7a60..00000000 --- a/script/test5.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -Area Scan -""" - -ascan((dev,out),(sin,out,arr),(0,10),(20,30),(100,100)) \ No newline at end of file diff --git a/script/test6.py b/script/test6.py deleted file mode 100644 index 199f9bba..00000000 --- a/script/test6.py +++ /dev/null @@ -1,36 +0,0 @@ -""" -Creating pseudo-devices -""" -import time - -sin_val=None - -class Sensor(ch.psi.pshell.dev.Readable): - def read(self): - global sin_val - return sin_val + time.clock() - def getName(self): - return "Sensor" - -class Positioner(ch.psi.pshell.dev.Writable): - def write(self,pos): - print pos - def getName(self): - return "Positioner" - -class Listener (ch.psi.pshell.dev.DeviceListener): - def onStateChanged(self, device, state, former): - pass - def onValueChanged(self, device, value, former): - global sin_val - sin_val=value - -sensor=Sensor() -positioner=Positioner() -listener = Listener() - -sin.addListener(listener) -try: - a= lscan((inp,positioner),(sin,sensor),(0,0),(40,10),20,0.1) -finally: - sin.removeListener(listener) \ No newline at end of file