From 06e8d4451ec5d06c6a28825a3333d53d559efe84 Mon Sep 17 00:00:00 2001 From: gac-x10da Date: Tue, 26 Feb 2019 09:40:26 +0100 Subject: [PATCH] Startup --- plugins/test.form | 28 ++++++++++++++ plugins/test.java | 52 ++++++++++++++++++++++++++ script/test/MultipleFDAE-Fe-Patrick.py | 12 ++++++ script/test/MultipleFDAE-Ni-Patrick.py | 19 ++++++++++ script/test/MultipleFDAExemple.py | 12 ++++++ script/test/bragg.py | 2 + script/test/crlogic.py | 41 ++++++++++++++++++++ 7 files changed, 166 insertions(+) create mode 100644 plugins/test.form create mode 100644 plugins/test.java create mode 100644 script/test/MultipleFDAE-Fe-Patrick.py create mode 100644 script/test/MultipleFDAE-Ni-Patrick.py create mode 100644 script/test/MultipleFDAExemple.py create mode 100644 script/test/bragg.py create mode 100644 script/test/crlogic.py diff --git a/plugins/test.form b/plugins/test.form new file mode 100644 index 0000000..ff9cfab --- /dev/null +++ b/plugins/test.form @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/test.java b/plugins/test.java new file mode 100644 index 0000000..a3907cf --- /dev/null +++ b/plugins/test.java @@ -0,0 +1,52 @@ +import ch.psi.pshell.ui.Panel; +import ch.psi.utils.State; + +/** + * + */ +public class test extends Panel { + + public test() { + initComponents(); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + + } + + @Override + public void onStateChange(State state, State former) { + + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + + //Callback to perform update - in event thread + @Override + protected void doUpdate() { + } + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 449, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 137, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff --git a/script/test/MultipleFDAE-Fe-Patrick.py b/script/test/MultipleFDAE-Fe-Patrick.py new file mode 100644 index 0000000..b8f5412 --- /dev/null +++ b/script/test/MultipleFDAE-Fe-Patrick.py @@ -0,0 +1,12 @@ + +positions = [ ("Nr_14-Ni" ,8.5,-0.5), \ + ("Nr_13-Ni-Redo" ,20,-2)] + + + +for pos in positions: + caput("X10DA-ES1-MA1:TRX", pos[1]) + caput("X10DA-ES1-MA1:TRY", pos[2] ) + set_exec_pars(name = pos[0], reset = True) + run_fda("users/20170314_Andrey/Ni_EXAFS_fluo.xml") + diff --git a/script/test/MultipleFDAE-Ni-Patrick.py b/script/test/MultipleFDAE-Ni-Patrick.py new file mode 100644 index 0000000..7cac59f --- /dev/null +++ b/script/test/MultipleFDAE-Ni-Patrick.py @@ -0,0 +1,19 @@ + +positions = [ ("Nr_9-Fe" ,6,12), \ + ("Nr_10-Fe" ,-12.5,5), \ + ("Nr_15-Fe" ,-16,-5), \ + ("Nr_16-Fe" ,-9,-4), \ + ("Nr_18-Fe" ,-2,-4.1), \ + ("Nr_19-Fe" ,5,-4), \ + ("Nr_11-Fe" ,15,-7), \ + ("Nr_17-Fe" ,15.1,1), \ + ("Nr20-Fe" ,17,11)] + + + +for pos in positions: + caput("X10DA-ES1-MA1:TRX", pos[1]) + caput("X10DA-ES1-MA1:TRY", pos[2] ) + set_exec_pars(name = pos[0], reset = True) + run_fda("users/20170314_Andrey/Fe_EXAFS_fluo.xml") + diff --git a/script/test/MultipleFDAExemple.py b/script/test/MultipleFDAExemple.py new file mode 100644 index 0000000..4a45a71 --- /dev/null +++ b/script/test/MultipleFDAExemple.py @@ -0,0 +1,12 @@ + +positions = [ ("name1" ,-6,-1.5), \ + ("name2" ,-1.5,-1.6)] + + +for pos in positions: + caput("X10DA-ES1-MA1:TRX", pos[1]) + caput("X10DA-ES1-MA1:TRY", pos[2] ) + set_exec_pars(name = pos[0], reset = True) + run_fda("users/20170314_Andrey/Fe_EXAFS_fluo.xml") + + diff --git a/script/test/bragg.py b/script/test/bragg.py new file mode 100644 index 0000000..472912c --- /dev/null +++ b/script/test/bragg.py @@ -0,0 +1,2 @@ +bragg = CrlogicPositioner("bragg", "X10DA-OP-MO3:ROX") +add_device(bragg) \ No newline at end of file diff --git a/script/test/crlogic.py b/script/test/crlogic.py new file mode 100644 index 0000000..9a4fdf4 --- /dev/null +++ b/script/test/crlogic.py @@ -0,0 +1,41 @@ +scan_start = 9.0 +scan_stop = 9.2 +scan_step = 0.002 +passes = 1 +zigzag = False + + +setup_brag_plot(False) + +scaler.stop() #caput("X10DA-ES-SCALER.CNT", 0) +scaler.channels[0].setPreset(False) #caput("X10DA-ES-SCALER.G1", 0) +#scaler.channels[0].setPresetValue(0) +scaler.setOneShot() #caput("X10DA-ES-SCALER.CONT", 0) + +caput("X10DA-ES1:START-CSMPL", 1) +caput("X10DA-ES1:TOTAL-CYCLES", 5) +caput("X10DA-ES1:SMPL-BTN", 1) + +i0 = CrlogicSensor("I0", "SCALER12", True) +i1 = CrlogicSensor("I1", "SCALER13", True) +i2 = CrlogicSensor("I2", "SCALER14", True) +ref = CrlogicSensor("ScalerRef", "SCALER15", True) + +class AbsCalc(Readable): + def read(self): + return math.log(math.fabs(i0.take()) / math.fabs(i1.take())) +abs_calc = AbsCalc() + +class ECalc(Readable): + def read(self): + return 12.39842 / (crystal.take() * math.sin( math.radians(bragg.readback.take()))) + +e_calc = ECalc() +sensors = [crystal, i0, i1, i2, ref, abs_calc, e_calc] + +bragg.move(scan_start) +#caput("X10DA-OP-MO3:ROX.URIP", 'No') +scaler.start() + +r1 = hscan(crlogic_config, bragg, sensors, scan_start, scan_stop, scan_step, passes=passes, zigzag=zigzag) +