This commit is contained in:
gac-x10da
2019-02-26 09:40:26 +01:00
parent d1fc276caf
commit 06e8d4451e
7 changed files with 166 additions and 0 deletions

28
plugins/test.form Normal file
View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="449" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="137" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
</Form>

52
plugins/test.java Normal file
View File

@@ -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")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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)
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
// End of variables declaration//GEN-END:variables
}

View File

@@ -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")

View File

@@ -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")

View File

@@ -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")

2
script/test/bragg.py Normal file
View File

@@ -0,0 +1,2 @@
bragg = CrlogicPositioner("bragg", "X10DA-OP-MO3:ROX")
add_device(bragg)

41
script/test/crlogic.py Normal file
View File

@@ -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)