This commit is contained in:
@@ -23,50 +23,74 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="buttonStart" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonAbort" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="panelOutput" max="32767" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="panelScanPars" max="32767" attributes="0"/>
|
||||
<Component id="panelBeamPars" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||
<Component id="jPanel2" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="buttonPrepare" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="buttonStart" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonAbort" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="buttonSetPhase" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="spinnerPhase" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="panelScanPars" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="plot21" pref="475" max="32767" attributes="0"/>
|
||||
<Component id="plot11" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="plot" pref="528" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="plot12" pref="438" max="32767" attributes="0"/>
|
||||
<Component id="plot22" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="plot" max="32767" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="panelScanPars" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="panelBeamPars" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonPrepare" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonSetPhase" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerPhase" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="30" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonStart" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonAbort" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Component id="plot11" max="32767" attributes="0"/>
|
||||
<Component id="plot12" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="plot22" max="32767" attributes="0"/>
|
||||
<Component id="plot21" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="panelOutput" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="19" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -88,33 +112,33 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="labelStop" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelStart" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelSamples" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelStep" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="labelThreshold" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelLatency" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="labelStation" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelBunch" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelLatency" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerLatency" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelStop" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerStop" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelStart" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerStart" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelSamples" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerSamples" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelStep" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerStep" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="spinnerStart" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="spinnerStation" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="spinnerBunch" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="spinnerThreshold" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="spinnerLatency" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="spinnerSamples" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="spinnerStep" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="spinnerStop" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
@@ -148,7 +172,21 @@
|
||||
<Component id="spinnerLatency" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelLatency" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="labelThreshold" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerThreshold" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerStation" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelStation" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerBunch" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelBunch" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -167,10 +205,7 @@
|
||||
<Component class="javax.swing.JSpinner" name="spinnerStep">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="1.0" maximum="10.0" minimum="0.05" numberType="java.lang.Double" stepSize="0.05" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
<SpinnerModel initial="0.05" maximum="10.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -182,25 +217,19 @@
|
||||
<Component class="javax.swing.JSpinner" name="spinnerStart">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
<SpinnerModel initial="-0.1" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelSamples">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Nb Samples:"/>
|
||||
<Property name="text" type="java.lang.String" value="Nb samples:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerSamples">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="1" maximum="50" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
<SpinnerModel initial="10" maximum="100" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -212,107 +241,63 @@
|
||||
<Component class="javax.swing.JSpinner" name="spinnerLatency">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.1" maximum="5.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
<SpinnerModel initial="0.4" maximum="5.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerStop">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="180.0" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
<SpinnerModel initial="0.1" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[53, 20]"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelThreshold">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Threshold:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerThreshold">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="7000" maximum="50000" minimum="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelStation">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="TDS Station:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerStation">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel type="list">
|
||||
<ListItem value="S30CB14"/>
|
||||
<ListItem value="SATMA02"/>
|
||||
<ListItem value="SINDI01"/>
|
||||
</SpinnerModel>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerBunch">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel type="list">
|
||||
<ListItem value="Bunch1"/>
|
||||
<ListItem value="Bunch2"/>
|
||||
</SpinnerModel>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelBunch">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Bunch:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="panelBeamPars">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Beam Parameters"/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="labelDispersion" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelEnergy" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Component id="spinnerEnergy" pref="73" max="32767" attributes="0"/>
|
||||
<Component id="spinnerDispersion" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerDispersion" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelDispersion" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spinnerEnergy" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelEnergy" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerDispersion">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="-0.387" maximum="10.0" minimum="-10.0" numberType="java.lang.Double" stepSize="0.001" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelEnergy">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="p (MeV/c):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerEnergy">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="7.1" maximum="10.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelDispersion">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Disp. (m):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="ch.psi.pshell.plot.LinePlotJFree" name="plot">
|
||||
<Component class="ch.psi.pshell.plot.LinePlotJFree" name="plot11">
|
||||
<Properties>
|
||||
<Property name="title" type="java.lang.String" value=""/>
|
||||
</Properties>
|
||||
@@ -333,75 +318,34 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonAbortActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
<Component class="javax.swing.JButton" name="buttonPrepare">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Set RF Phase"/>
|
||||
</Border>
|
||||
<Property name="text" type="java.lang.String" value="Prepare"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonPrepareActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonSetPhase">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Set Beam Phase"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSetPhaseActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerPhase">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonPhaseSet" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textRefPhase" min="-2" pref="69" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textRefPhase" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="buttonPhaseSet" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Ref phase:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonPhaseSet">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Set"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonPhaseSetActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textRefPhase">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="panelOutput">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder title="Set Laser Delay "/>
|
||||
<TitledBorder title="Output"/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
@@ -410,15 +354,8 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonSetDelay" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textOffset" min="-2" pref="69" max="-2" attributes="0"/>
|
||||
<Component id="jTextAreaOutput" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -426,40 +363,38 @@
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jTextAreaOutput" pref="142" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textOffset" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="buttonSetDelay" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Component class="javax.swing.JTextArea" name="jTextAreaOutput">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Offset:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonSetDelay">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Set"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSetDelayActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textOffset">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Courier 10 Pitch" size="14" style="0"/>
|
||||
</Property>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="ch.psi.pshell.plot.LinePlotJFree" name="plot21">
|
||||
<Properties>
|
||||
<Property name="title" type="java.lang.String" value=""/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.plot.LinePlotJFree" name="plot12">
|
||||
<Properties>
|
||||
<Property name="title" type="java.lang.String" value=""/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.plot.LinePlotJFree" name="plot22">
|
||||
<Properties>
|
||||
<Property name="title" type="java.lang.String" value=""/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
444
plugins/BunchLength.java
Executable file
444
plugins/BunchLength.java
Executable file
@@ -0,0 +1,444 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
import ch.psi.pshell.plot.LinePlot;
|
||||
import ch.psi.pshell.plot.LinePlotSeries;
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.swing.JSpinner;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class BunchLength extends Panel {
|
||||
|
||||
public BunchLength() {
|
||||
initComponents();
|
||||
setPersistedComponents(SwingUtils.getComponentsByType(panelScanPars, JSpinner.class));
|
||||
plot11.setStyle(LinePlot.Style.ErrorY);
|
||||
plot12.setStyle(LinePlot.Style.Normal);
|
||||
plot21.setStyle(LinePlot.Style.ErrorY);
|
||||
plot22.setStyle(LinePlot.Style.Normal);
|
||||
}
|
||||
|
||||
//Overridable callbacks
|
||||
@Override
|
||||
public void onInitialize(int runCount) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateChange(State state, State former) {
|
||||
buttonAbort.setEnabled(state.isProcessing());
|
||||
boolean enabled = (state == State.Ready);
|
||||
buttonPrepare.setEnabled(enabled);
|
||||
buttonSetPhase.setEnabled(enabled);
|
||||
buttonStart.setEnabled(enabled);
|
||||
spinnerStart.setEnabled(enabled);
|
||||
spinnerStop.setEnabled(enabled);
|
||||
spinnerStep.setEnabled(enabled);
|
||||
spinnerSamples.setEnabled(enabled);
|
||||
spinnerLatency.setEnabled(enabled);
|
||||
spinnerThreshold.setEnabled(enabled);
|
||||
spinnerStation.setEnabled(enabled);
|
||||
spinnerBunch.setEnabled(enabled);
|
||||
}
|
||||
|
||||
@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() {
|
||||
|
||||
panelScanPars = new javax.swing.JPanel();
|
||||
labelStart = new javax.swing.JLabel();
|
||||
labelStop = new javax.swing.JLabel();
|
||||
spinnerStep = new javax.swing.JSpinner();
|
||||
labelStep = new javax.swing.JLabel();
|
||||
spinnerStart = new javax.swing.JSpinner();
|
||||
labelSamples = new javax.swing.JLabel();
|
||||
spinnerSamples = new javax.swing.JSpinner();
|
||||
labelLatency = new javax.swing.JLabel();
|
||||
spinnerLatency = new javax.swing.JSpinner();
|
||||
spinnerStop = new javax.swing.JSpinner();
|
||||
labelThreshold = new javax.swing.JLabel();
|
||||
spinnerThreshold = new javax.swing.JSpinner();
|
||||
labelStation = new javax.swing.JLabel();
|
||||
spinnerStation = new javax.swing.JSpinner();
|
||||
spinnerBunch = new javax.swing.JSpinner();
|
||||
labelBunch = new javax.swing.JLabel();
|
||||
plot11 = new ch.psi.pshell.plot.LinePlotJFree();
|
||||
buttonStart = new javax.swing.JButton();
|
||||
buttonAbort = new javax.swing.JButton();
|
||||
buttonPrepare = new javax.swing.JButton();
|
||||
buttonSetPhase = new javax.swing.JButton();
|
||||
spinnerPhase = new javax.swing.JSpinner();
|
||||
panelOutput = new javax.swing.JPanel();
|
||||
jTextAreaOutput = new javax.swing.JTextArea();
|
||||
plot21 = new ch.psi.pshell.plot.LinePlotJFree();
|
||||
plot12 = new ch.psi.pshell.plot.LinePlotJFree();
|
||||
plot22 = new ch.psi.pshell.plot.LinePlotJFree();
|
||||
|
||||
setPreferredSize(new java.awt.Dimension(737, 445));
|
||||
|
||||
panelScanPars.setBorder(javax.swing.BorderFactory.createTitledBorder("Scan Parameters"));
|
||||
|
||||
labelStart.setText("Start:");
|
||||
|
||||
labelStop.setText("Stop:");
|
||||
|
||||
spinnerStep.setModel(new javax.swing.SpinnerNumberModel(0.05d, 0.0d, 10.0d, 0.01d));
|
||||
|
||||
labelStep.setText("Step size:");
|
||||
|
||||
spinnerStart.setModel(new javax.swing.SpinnerNumberModel(-0.1d, -360.0d, 360.0d, 1.0d));
|
||||
|
||||
labelSamples.setText("Nb samples:");
|
||||
|
||||
spinnerSamples.setModel(new javax.swing.SpinnerNumberModel(10, 1, 100, 1));
|
||||
|
||||
labelLatency.setText("Latency:");
|
||||
|
||||
spinnerLatency.setModel(new javax.swing.SpinnerNumberModel(0.4d, 0.0d, 5.0d, 0.01d));
|
||||
|
||||
spinnerStop.setModel(new javax.swing.SpinnerNumberModel(0.1d, -360.0d, 360.0d, 1.0d));
|
||||
|
||||
labelThreshold.setText("Threshold:");
|
||||
|
||||
spinnerThreshold.setModel(new javax.swing.SpinnerNumberModel(7000, 0, 50000, 1));
|
||||
|
||||
labelStation.setText("TDS Station:");
|
||||
|
||||
spinnerStation.setModel(new javax.swing.SpinnerListModel(new String[] {"S30CB14", "SATMA02", "SINDI01"}));
|
||||
|
||||
spinnerBunch.setModel(new javax.swing.SpinnerListModel(new String[] {"Bunch1", "Bunch2"}));
|
||||
|
||||
labelBunch.setText("Bunch:");
|
||||
|
||||
javax.swing.GroupLayout panelScanParsLayout = new javax.swing.GroupLayout(panelScanPars);
|
||||
panelScanPars.setLayout(panelScanParsLayout);
|
||||
panelScanParsLayout.setHorizontalGroup(
|
||||
panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(labelStop, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelStart, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelSamples, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelStep, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelScanParsLayout.createSequentialGroup()
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelThreshold)
|
||||
.addComponent(labelLatency))
|
||||
.addGap(2, 2, 2)))
|
||||
.addComponent(labelStation)
|
||||
.addComponent(labelBunch, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(spinnerStart)
|
||||
.addComponent(spinnerStation)
|
||||
.addComponent(spinnerBunch)
|
||||
.addComponent(spinnerThreshold)
|
||||
.addComponent(spinnerLatency)
|
||||
.addComponent(spinnerSamples)
|
||||
.addComponent(spinnerStep)
|
||||
.addComponent(spinnerStop))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
panelScanParsLayout.setVerticalGroup(
|
||||
panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelStart))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerStop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelStop))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelStep))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelSamples))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelLatency))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(labelThreshold)
|
||||
.addComponent(spinnerThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerStation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelStation))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerBunch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelBunch)))
|
||||
);
|
||||
|
||||
plot11.setTitle("");
|
||||
|
||||
buttonStart.setText("Start");
|
||||
buttonStart.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonStartActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonAbort.setText("Abort");
|
||||
buttonAbort.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonAbortActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonPrepare.setText("Prepare");
|
||||
buttonPrepare.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonPrepareActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonSetPhase.setText("Set Beam Phase");
|
||||
buttonSetPhase.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonSetPhaseActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
spinnerPhase.setModel(new javax.swing.SpinnerNumberModel(0.0d, -360.0d, 360.0d, 1.0d));
|
||||
|
||||
panelOutput.setBorder(javax.swing.BorderFactory.createTitledBorder("Output"));
|
||||
|
||||
jTextAreaOutput.setColumns(20);
|
||||
jTextAreaOutput.setFont(new java.awt.Font("Courier 10 Pitch", 0, 14)); // NOI18N
|
||||
jTextAreaOutput.setRows(5);
|
||||
|
||||
javax.swing.GroupLayout panelOutputLayout = new javax.swing.GroupLayout(panelOutput);
|
||||
panelOutput.setLayout(panelOutputLayout);
|
||||
panelOutputLayout.setHorizontalGroup(
|
||||
panelOutputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelOutputLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jTextAreaOutput)
|
||||
.addContainerGap())
|
||||
);
|
||||
panelOutputLayout.setVerticalGroup(
|
||||
panelOutputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelOutputLayout.createSequentialGroup()
|
||||
.addComponent(jTextAreaOutput, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
plot21.setTitle("");
|
||||
|
||||
plot12.setTitle("");
|
||||
|
||||
plot22.setTitle("");
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(panelOutput, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonPrepare)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(buttonStart)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonAbort))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(buttonSetPhase)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(spinnerPhase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(panelScanPars, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(plot21, javax.swing.GroupLayout.DEFAULT_SIZE, 475, Short.MAX_VALUE)
|
||||
.addComponent(plot11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(plot12, javax.swing.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE)
|
||||
.addComponent(plot22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGap(28, 28, 28))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(panelScanPars, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonPrepare)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonSetPhase)
|
||||
.addComponent(spinnerPhase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonStart)
|
||||
.addComponent(buttonAbort)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(plot11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(plot12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(plot22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(plot21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(panelOutput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(19, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
panelScanPars.getAccessibleContext().setAccessibleDescription("");
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void buttonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartActionPerformed
|
||||
ArrayList parameters = new ArrayList();
|
||||
parameters.add(spinnerStart.getValue());
|
||||
parameters.add(spinnerStop.getValue());
|
||||
parameters.add(spinnerStep.getValue());
|
||||
parameters.add(spinnerSamples.getValue());
|
||||
parameters.add(spinnerLatency.getValue());
|
||||
parameters.add(spinnerThreshold.getValue());
|
||||
parameters.add(spinnerStation.getValue());
|
||||
parameters.add(spinnerBunch.getValue());
|
||||
parameters.add(plot11);
|
||||
parameters.add(plot12);
|
||||
parameters.add(plot21);
|
||||
parameters.add(plot22);
|
||||
try {
|
||||
runAsync("Tools/BunchLengthScan", parameters).handle((ret, ex) -> {
|
||||
if (ex != null) {
|
||||
String message = "Exception executing scan: " + ex;
|
||||
getLogger().info(message);
|
||||
showException((Exception) ex);
|
||||
} else {
|
||||
List ret_list = (List)ret;
|
||||
try{
|
||||
double bunch_length_rms_1 = ((Number)ret_list.get(0)).doubleValue();
|
||||
double bunch_length_fw_1 = ((Number)ret_list.get(1)).doubleValue();
|
||||
double bunch_length_fit_1 = ((Number)ret_list.get(2)).doubleValue();
|
||||
double calibration_1 = ((Number)ret_list.get(3)).doubleValue();
|
||||
double bunch_length_rms_2 = ((Number)ret_list.get(4)).doubleValue();
|
||||
double bunch_length_fw_2 = ((Number)ret_list.get(5)).doubleValue();
|
||||
double bunch_length_fit_2 = ((Number)ret_list.get(6)).doubleValue();
|
||||
double calibration_2 = ((Number)ret_list.get(7)).doubleValue();
|
||||
double bunch_length_rms = ((Number)ret_list.get(8)).doubleValue();
|
||||
double bunch_length_fw = ((Number)ret_list.get(9)).doubleValue();
|
||||
double bunch_length_fit = ((Number)ret_list.get(10)).doubleValue();
|
||||
double calibration = ((Number)ret_list.get(11)).doubleValue();
|
||||
jTextAreaOutput.setText(null);
|
||||
jTextAreaOutput.append(String.format(" 0 deg 180 deg mean\n"));
|
||||
jTextAreaOutput.append(String.format("Bunch length rms (fs): %12.1f%12.1f%12.1f\n",bunch_length_rms_1,bunch_length_rms_2,bunch_length_rms));
|
||||
jTextAreaOutput.append(String.format("Bunch length fw (fs): %12.1f%12.1f%12.1f\n",bunch_length_fw_1,bunch_length_fw_2,bunch_length_fw));
|
||||
jTextAreaOutput.append(String.format("Bunch length gauss fit rms (fs): %12.1f%12.1f%12.1f\n",bunch_length_fit_1,bunch_length_fit_2,bunch_length_fit));
|
||||
jTextAreaOutput.append(String.format("Calibration (fs/um): %12.3f%12.3f%12.3f\n",calibration_1,calibration_2,calibration));
|
||||
} catch (Exception e) {
|
||||
showException(e);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonStartActionPerformed
|
||||
|
||||
private void buttonAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAbortActionPerformed
|
||||
try {
|
||||
abort();
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonAbortActionPerformed
|
||||
|
||||
private void buttonPrepareActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPrepareActionPerformed
|
||||
ArrayList parameters = new ArrayList();
|
||||
parameters.add(spinnerStation.getValue());
|
||||
try {
|
||||
runAsync("Tools/BunchLengthPrep", parameters).handle((ret, ex) -> {
|
||||
if (ex != null) {
|
||||
String message = "Exception executing scan: " + ex;
|
||||
getLogger().info(message);
|
||||
showException((Exception) ex);
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonPrepareActionPerformed
|
||||
|
||||
private void buttonSetPhaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSetPhaseActionPerformed
|
||||
ArrayList parameters = new ArrayList();
|
||||
parameters.add(spinnerStation.getValue());
|
||||
parameters.add(spinnerPhase.getValue());
|
||||
try {
|
||||
runAsync("Tools/SetTdsBeamPhase", parameters).handle((ret, ex) -> {
|
||||
if (ex != null) {
|
||||
String message = "Exception executing scan: " + ex;
|
||||
getLogger().info(message);
|
||||
showException((Exception) ex);
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonSetPhaseActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonAbort;
|
||||
private javax.swing.JButton buttonPrepare;
|
||||
private javax.swing.JButton buttonSetPhase;
|
||||
private javax.swing.JButton buttonStart;
|
||||
private javax.swing.JTextArea jTextAreaOutput;
|
||||
private javax.swing.JLabel labelBunch;
|
||||
private javax.swing.JLabel labelLatency;
|
||||
private javax.swing.JLabel labelSamples;
|
||||
private javax.swing.JLabel labelStart;
|
||||
private javax.swing.JLabel labelStation;
|
||||
private javax.swing.JLabel labelStep;
|
||||
private javax.swing.JLabel labelStop;
|
||||
private javax.swing.JLabel labelThreshold;
|
||||
private javax.swing.JPanel panelOutput;
|
||||
private javax.swing.JPanel panelScanPars;
|
||||
private ch.psi.pshell.plot.LinePlotJFree plot11;
|
||||
private ch.psi.pshell.plot.LinePlotJFree plot12;
|
||||
private ch.psi.pshell.plot.LinePlotJFree plot21;
|
||||
private ch.psi.pshell.plot.LinePlotJFree plot22;
|
||||
private javax.swing.JSpinner spinnerBunch;
|
||||
private javax.swing.JSpinner spinnerLatency;
|
||||
private javax.swing.JSpinner spinnerPhase;
|
||||
private javax.swing.JSpinner spinnerSamples;
|
||||
private javax.swing.JSpinner spinnerStart;
|
||||
private javax.swing.JSpinner spinnerStation;
|
||||
private javax.swing.JSpinner spinnerStep;
|
||||
private javax.swing.JSpinner spinnerStop;
|
||||
private javax.swing.JSpinner spinnerThreshold;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
@@ -495,7 +495,7 @@ public class Correlation2 extends Panel {
|
||||
|
||||
private void comboTypeXActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboTypeXActionPerformed
|
||||
if (comboTypeX.getSelectedIndex()==0){
|
||||
textDevX.configure(ChannelSelector.Type.Epics, "http://epics-boot-info.psi.ch", "swissfel", 5000);
|
||||
textDevX.configure(ChannelSelector.Type.IocInfo, "http://iocinfo.psi.ch/api/v2", "swissfel", 5000);
|
||||
} else if (comboTypeX.getSelectedIndex()==1){
|
||||
textDevX.configure(ChannelSelector.Type.DataAPI, "https://data-api.psi.ch/sf", "sf-databuffer", 5000);
|
||||
} else if (comboTypeX.getSelectedIndex()==2){
|
||||
@@ -505,7 +505,7 @@ public class Correlation2 extends Panel {
|
||||
|
||||
private void comboTypeYActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboTypeYActionPerformed
|
||||
if (comboTypeY.getSelectedIndex()==0){
|
||||
textDevY.configure(ChannelSelector.Type.Epics, "http://epics-boot-info.psi.ch", "swissfel", 5000);
|
||||
textDevY.configure(ChannelSelector.Type.IocInfo, "http://iocinfo.psi.ch/api/v2", "swissfel", 5000);
|
||||
} else if (comboTypeY.getSelectedIndex()==1){
|
||||
textDevY.configure(ChannelSelector.Type.DataAPI, "https://data-api.psi.ch/sf", "sf-databuffer", 5000);
|
||||
} else if (comboTypeY.getSelectedIndex()==2){
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="plot" pref="528" max="32767" attributes="0"/>
|
||||
<Component id="plot" pref="523" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -88,38 +88,23 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelLatency" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerLatency" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelStop" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerStop" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelStart" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerStart" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelSamples" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerSamples" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelStep" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerStep" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="labelLatency1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerThreshold" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="labelStart" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelStop" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelStep" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelSamples" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelLatency" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelLatency1" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="2" pref="2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spinnerStart" linkSize="4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerStop" linkSize="4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerStep" linkSize="4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerSamples" linkSize="4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerLatency" linkSize="4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerThreshold" linkSize="4" alignment="0" min="-2" pref="40" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
@@ -177,10 +162,7 @@
|
||||
<Component class="javax.swing.JSpinner" name="spinnerStep">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="1.0" maximum="10.0" minimum="0.05" numberType="java.lang.Double" stepSize="0.05" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
<SpinnerModel initial="0.5" maximum="10.0" minimum="0.05" numberType="java.lang.Double" stepSize="0.05" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -192,10 +174,7 @@
|
||||
<Component class="javax.swing.JSpinner" name="spinnerStart">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.0" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
<SpinnerModel initial="86.0" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -207,10 +186,7 @@
|
||||
<Component class="javax.swing.JSpinner" name="spinnerSamples">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="1" maximum="50" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
<SpinnerModel initial="10" maximum="50" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -222,33 +198,24 @@
|
||||
<Component class="javax.swing.JSpinner" name="spinnerLatency">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0.1" maximum="5.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
<SpinnerModel initial="0.4" maximum="5.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerStop">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="180.0" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
<SpinnerModel initial="96.0" maximum="360.0" minimum="-360.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[53, 20]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerThreshold">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="500.0" maximum="10000.0" minimum="0.0" numberType="java.lang.Double" stepSize="100.0" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
<SpinnerModel initial="400" maximum="10000" minimum="0" numberType="java.lang.Integer" stepSize="100" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -272,17 +239,17 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="labelEnergy" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelDispersion" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelEnergy" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Component id="spinnerEnergy" pref="73" max="32767" attributes="0"/>
|
||||
<Component id="spinnerDispersion" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spinnerDispersion" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="spinnerEnergy" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -310,9 +277,6 @@
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="-0.387" maximum="10.0" minimum="-10.0" numberType="java.lang.Double" stepSize="0.001" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelEnergy">
|
||||
@@ -325,9 +289,6 @@
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="7.1" maximum="10.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[64, 20]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelDispersion">
|
||||
@@ -371,15 +332,20 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonPhaseSet" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textRefPhase" min="-2" pref="69" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textRefPhase" min="-2" pref="69" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="buttonPhaseEdit" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonPhaseSet" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -393,7 +359,10 @@
|
||||
<Component id="textRefPhase" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="buttonPhaseSet" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonPhaseSet" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonPhaseEdit" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -419,6 +388,18 @@
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="textRefPhaseActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonPhaseEdit">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Edit"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonPhaseEditActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
@@ -434,16 +415,21 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonSetDelay" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textOffset" min="-2" pref="69" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textOffset" min="-2" pref="69" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="buttonDelayEdit" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonSetDelay" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -457,7 +443,10 @@
|
||||
<Component id="textOffset" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="buttonSetDelay" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonSetDelay" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonDelayEdit" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -484,6 +473,15 @@
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonDelayEdit">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Edit"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDelayEditActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
||||
@@ -41,6 +41,8 @@ public class GunEnergyScan extends Panel {
|
||||
spinnerEnergy.setEnabled(enabled);
|
||||
buttonPhaseSet.setEnabled(enabled && !textRefPhase.getText().trim().isEmpty());
|
||||
buttonSetDelay.setEnabled(enabled && !textOffset.getText().trim().isEmpty());
|
||||
buttonPhaseEdit.setEnabled(enabled);
|
||||
buttonDelayEdit.setEnabled(enabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -81,10 +83,12 @@ public class GunEnergyScan extends Panel {
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
buttonPhaseSet = new javax.swing.JButton();
|
||||
textRefPhase = new javax.swing.JTextField();
|
||||
buttonPhaseEdit = new javax.swing.JButton();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
buttonSetDelay = new javax.swing.JButton();
|
||||
textOffset = new javax.swing.JTextField();
|
||||
buttonDelayEdit = new javax.swing.JButton();
|
||||
|
||||
setPreferredSize(new java.awt.Dimension(737, 445));
|
||||
|
||||
@@ -94,30 +98,24 @@ public class GunEnergyScan extends Panel {
|
||||
|
||||
labelStop.setText("Stop:");
|
||||
|
||||
spinnerStep.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.05d, 10.0d, 0.05d));
|
||||
spinnerStep.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
spinnerStep.setModel(new javax.swing.SpinnerNumberModel(0.5d, 0.05d, 10.0d, 0.05d));
|
||||
|
||||
labelStep.setText("Step size:");
|
||||
|
||||
spinnerStart.setModel(new javax.swing.SpinnerNumberModel(0.0d, -360.0d, 360.0d, 1.0d));
|
||||
spinnerStart.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
spinnerStart.setModel(new javax.swing.SpinnerNumberModel(86.0d, -360.0d, 360.0d, 1.0d));
|
||||
|
||||
labelSamples.setText("Nb Samples:");
|
||||
|
||||
spinnerSamples.setModel(new javax.swing.SpinnerNumberModel(1, 1, 50, 1));
|
||||
spinnerSamples.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
spinnerSamples.setModel(new javax.swing.SpinnerNumberModel(10, 1, 50, 1));
|
||||
|
||||
labelLatency.setText("Latency:");
|
||||
|
||||
spinnerLatency.setModel(new javax.swing.SpinnerNumberModel(0.1d, 0.0d, 5.0d, 0.01d));
|
||||
spinnerLatency.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
spinnerLatency.setModel(new javax.swing.SpinnerNumberModel(0.4d, 0.0d, 5.0d, 0.01d));
|
||||
|
||||
spinnerStop.setModel(new javax.swing.SpinnerNumberModel(180.0d, -360.0d, 360.0d, 1.0d));
|
||||
spinnerStop.setModel(new javax.swing.SpinnerNumberModel(96.0d, -360.0d, 360.0d, 1.0d));
|
||||
spinnerStop.setMinimumSize(new java.awt.Dimension(53, 20));
|
||||
spinnerStop.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
spinnerThreshold.setModel(new javax.swing.SpinnerNumberModel(500.0d, 0.0d, 10000.0d, 100.0d));
|
||||
spinnerThreshold.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
spinnerThreshold.setModel(new javax.swing.SpinnerNumberModel(400, 0, 10000, 100));
|
||||
|
||||
labelLatency1.setText("Threshold:");
|
||||
|
||||
@@ -126,34 +124,27 @@ public class GunEnergyScan extends Panel {
|
||||
panelScanParsLayout.setHorizontalGroup(
|
||||
panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelLatency)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelStop)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerStop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelStart)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelSamples)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelStep)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelLatency1)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(labelStart, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelStop, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelStep, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelSamples, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelLatency, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelLatency1, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addGap(2, 2, 2)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerStop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
panelScanParsLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerLatency, spinnerSamples, spinnerStart, spinnerStep, spinnerStop, spinnerThreshold});
|
||||
|
||||
panelScanParsLayout.setVerticalGroup(
|
||||
panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
@@ -187,12 +178,10 @@ public class GunEnergyScan extends Panel {
|
||||
panelBeamPars.setBorder(javax.swing.BorderFactory.createTitledBorder("Beam Parameters"));
|
||||
|
||||
spinnerDispersion.setModel(new javax.swing.SpinnerNumberModel(-0.387d, -10.0d, 10.0d, 0.001d));
|
||||
spinnerDispersion.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
labelEnergy.setText("p (MeV/c):");
|
||||
|
||||
spinnerEnergy.setModel(new javax.swing.SpinnerNumberModel(7.1d, 0.0d, 10.0d, 0.01d));
|
||||
spinnerEnergy.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
labelDispersion.setText("Disp. (m):");
|
||||
|
||||
@@ -201,14 +190,14 @@ public class GunEnergyScan extends Panel {
|
||||
panelBeamParsLayout.setHorizontalGroup(
|
||||
panelBeamParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelBeamParsLayout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(30, 30, 30)
|
||||
.addGroup(panelBeamParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(labelDispersion, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelEnergy))
|
||||
.addComponent(labelEnergy, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelDispersion, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addGap(4, 4, 4)
|
||||
.addGroup(panelBeamParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(spinnerEnergy, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE)
|
||||
.addComponent(spinnerDispersion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(panelBeamParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerDispersion)
|
||||
.addComponent(spinnerEnergy))
|
||||
.addContainerGap())
|
||||
);
|
||||
panelBeamParsLayout.setVerticalGroup(
|
||||
@@ -255,22 +244,41 @@ public class GunEnergyScan extends Panel {
|
||||
|
||||
textRefPhase.setEditable(false);
|
||||
textRefPhase.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
textRefPhase.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
textRefPhaseActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonPhaseEdit.setText("Edit");
|
||||
buttonPhaseEdit.setEnabled(false);
|
||||
buttonPhaseEdit.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonPhaseEditActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonPhaseSet)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textRefPhase, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textRefPhase, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(buttonPhaseEdit)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonPhaseSet)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonPhaseEdit, buttonPhaseSet});
|
||||
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
@@ -279,7 +287,9 @@ public class GunEnergyScan extends Panel {
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(textRefPhase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(buttonPhaseSet)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonPhaseSet)
|
||||
.addComponent(buttonPhaseEdit))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
@@ -298,21 +308,35 @@ public class GunEnergyScan extends Panel {
|
||||
textOffset.setEditable(false);
|
||||
textOffset.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
|
||||
buttonDelayEdit.setText("Edit");
|
||||
buttonDelayEdit.setEnabled(false);
|
||||
buttonDelayEdit.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonDelayEditActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
jPanel2Layout.setHorizontalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonSetDelay)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textOffset, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textOffset, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(buttonDelayEdit)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonSetDelay)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonDelayEdit, buttonSetDelay});
|
||||
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
@@ -321,7 +345,9 @@ public class GunEnergyScan extends Panel {
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(textOffset, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(buttonSetDelay)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonSetDelay)
|
||||
.addComponent(buttonDelayEdit))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
@@ -344,7 +370,7 @@ public class GunEnergyScan extends Panel {
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
|
||||
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 528, Short.MAX_VALUE)
|
||||
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 523, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
@@ -468,8 +494,38 @@ public class GunEnergyScan extends Panel {
|
||||
}
|
||||
}//GEN-LAST:event_buttonSetDelayActionPerformed
|
||||
|
||||
private void buttonPhaseEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPhaseEditActionPerformed
|
||||
try{
|
||||
String ret =getString("Enter Ref. Phase:", "");
|
||||
if (ret!=null){
|
||||
textRefPhase.setText(ret.isBlank() ? "" : String.valueOf(Double.valueOf(ret.trim())));
|
||||
}
|
||||
onStateChange(getState(), getState());
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonPhaseEditActionPerformed
|
||||
|
||||
private void buttonDelayEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDelayEditActionPerformed
|
||||
try{
|
||||
String ret =getString("Enter Offset:", "");
|
||||
if (ret!=null){
|
||||
textOffset.setText(ret.isBlank() ? "" : String.valueOf(Double.valueOf(ret.trim())));
|
||||
}
|
||||
onStateChange(getState(), getState());
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonDelayEditActionPerformed
|
||||
|
||||
private void textRefPhaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textRefPhaseActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_textRefPhaseActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonAbort;
|
||||
private javax.swing.JButton buttonDelayEdit;
|
||||
private javax.swing.JButton buttonPhaseEdit;
|
||||
private javax.swing.JButton buttonPhaseSet;
|
||||
private javax.swing.JButton buttonSetDelay;
|
||||
private javax.swing.JButton buttonStart;
|
||||
|
||||
@@ -1,483 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
import ch.psi.pshell.plot.LinePlot;
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.swing.JSpinner;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class GunEnergyScanNew extends Panel {
|
||||
|
||||
public GunEnergyScanNew() {
|
||||
initComponents();
|
||||
setPersistedComponents(SwingUtils.getComponentsByType(panelScanPars, JSpinner.class));
|
||||
plot.setStyle(LinePlot.Style.ErrorY);
|
||||
}
|
||||
|
||||
//Overridable callbacks
|
||||
@Override
|
||||
public void onInitialize(int runCount) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateChange(State state, State former) {
|
||||
buttonAbort.setEnabled(state.isProcessing());
|
||||
boolean enabled = (state == State.Ready);
|
||||
buttonStart.setEnabled(enabled);
|
||||
spinnerStart.setEnabled(enabled);
|
||||
spinnerStop.setEnabled(enabled);
|
||||
spinnerStep.setEnabled(enabled);
|
||||
spinnerSamples.setEnabled(enabled);
|
||||
spinnerLatency.setEnabled(enabled);
|
||||
spinnerDispersion.setEnabled(enabled);
|
||||
spinnerEnergy.setEnabled(enabled);
|
||||
buttonPhaseSet.setEnabled(enabled && !textRefPhase.getText().trim().isEmpty());
|
||||
buttonSetDelay.setEnabled(enabled && !textOffset.getText().trim().isEmpty());
|
||||
}
|
||||
|
||||
@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() {
|
||||
|
||||
panelScanPars = new javax.swing.JPanel();
|
||||
labelStart = new javax.swing.JLabel();
|
||||
labelStop = new javax.swing.JLabel();
|
||||
spinnerStep = new javax.swing.JSpinner();
|
||||
labelStep = new javax.swing.JLabel();
|
||||
spinnerStart = new javax.swing.JSpinner();
|
||||
labelSamples = new javax.swing.JLabel();
|
||||
spinnerSamples = new javax.swing.JSpinner();
|
||||
labelLatency = new javax.swing.JLabel();
|
||||
spinnerLatency = new javax.swing.JSpinner();
|
||||
spinnerStop = new javax.swing.JSpinner();
|
||||
panelBeamPars = new javax.swing.JPanel();
|
||||
spinnerDispersion = new javax.swing.JSpinner();
|
||||
labelEnergy = new javax.swing.JLabel();
|
||||
spinnerEnergy = new javax.swing.JSpinner();
|
||||
labelDispersion = new javax.swing.JLabel();
|
||||
plot = new ch.psi.pshell.plot.LinePlotJFree();
|
||||
buttonStart = new javax.swing.JButton();
|
||||
buttonAbort = new javax.swing.JButton();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
buttonPhaseSet = new javax.swing.JButton();
|
||||
textRefPhase = new javax.swing.JTextField();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
buttonSetDelay = new javax.swing.JButton();
|
||||
textOffset = new javax.swing.JTextField();
|
||||
|
||||
setPreferredSize(new java.awt.Dimension(737, 445));
|
||||
|
||||
panelScanPars.setBorder(javax.swing.BorderFactory.createTitledBorder("Scan Parameters"));
|
||||
|
||||
labelStart.setText("Start:");
|
||||
|
||||
labelStop.setText("Stop:");
|
||||
|
||||
spinnerStep.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.05d, 10.0d, 0.05d));
|
||||
spinnerStep.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
labelStep.setText("Step size:");
|
||||
|
||||
spinnerStart.setModel(new javax.swing.SpinnerNumberModel(0.0d, -360.0d, 360.0d, 1.0d));
|
||||
spinnerStart.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
labelSamples.setText("Nb Samples:");
|
||||
|
||||
spinnerSamples.setModel(new javax.swing.SpinnerNumberModel(1, 1, 50, 1));
|
||||
spinnerSamples.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
labelLatency.setText("Latency:");
|
||||
|
||||
spinnerLatency.setModel(new javax.swing.SpinnerNumberModel(0.1d, 0.0d, 5.0d, 0.01d));
|
||||
spinnerLatency.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
spinnerStop.setModel(new javax.swing.SpinnerNumberModel(180.0d, -360.0d, 360.0d, 1.0d));
|
||||
spinnerStop.setMinimumSize(new java.awt.Dimension(53, 20));
|
||||
spinnerStop.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
javax.swing.GroupLayout panelScanParsLayout = new javax.swing.GroupLayout(panelScanPars);
|
||||
panelScanPars.setLayout(panelScanParsLayout);
|
||||
panelScanParsLayout.setHorizontalGroup(
|
||||
panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelLatency)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelStop)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerStop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelStart)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelSamples)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addComponent(labelStep)
|
||||
.addGap(2, 2, 2)
|
||||
.addComponent(spinnerStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
panelScanParsLayout.setVerticalGroup(
|
||||
panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelScanParsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelStart))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerStop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelStop))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelStep))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelSamples))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelScanParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelLatency))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
panelBeamPars.setBorder(javax.swing.BorderFactory.createTitledBorder("Beam Parameters"));
|
||||
|
||||
spinnerDispersion.setModel(new javax.swing.SpinnerNumberModel(-0.387d, -10.0d, 10.0d, 0.001d));
|
||||
spinnerDispersion.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
labelEnergy.setText("p (MeV/c):");
|
||||
|
||||
spinnerEnergy.setModel(new javax.swing.SpinnerNumberModel(7.1d, 0.0d, 10.0d, 0.01d));
|
||||
spinnerEnergy.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
labelDispersion.setText("Disp. (m):");
|
||||
|
||||
javax.swing.GroupLayout panelBeamParsLayout = new javax.swing.GroupLayout(panelBeamPars);
|
||||
panelBeamPars.setLayout(panelBeamParsLayout);
|
||||
panelBeamParsLayout.setHorizontalGroup(
|
||||
panelBeamParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelBeamParsLayout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(panelBeamParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(labelDispersion, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(labelEnergy))
|
||||
.addGap(4, 4, 4)
|
||||
.addGroup(panelBeamParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(spinnerEnergy, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE)
|
||||
.addComponent(spinnerDispersion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
panelBeamParsLayout.setVerticalGroup(
|
||||
panelBeamParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelBeamParsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelBeamParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerDispersion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelDispersion))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelBeamParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerEnergy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelEnergy))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
plot.setTitle("");
|
||||
|
||||
buttonStart.setText("Start");
|
||||
buttonStart.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonStartActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonAbort.setText("Abort");
|
||||
buttonAbort.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonAbortActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Set RF Phase"));
|
||||
|
||||
jLabel1.setText("Ref phase:");
|
||||
|
||||
buttonPhaseSet.setText("Set");
|
||||
buttonPhaseSet.setEnabled(false);
|
||||
buttonPhaseSet.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonPhaseSetActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
textRefPhase.setEditable(false);
|
||||
textRefPhase.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonPhaseSet)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textRefPhase, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(textRefPhase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(buttonPhaseSet)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Set Laser Delay "));
|
||||
|
||||
jLabel2.setText("Offset:");
|
||||
|
||||
buttonSetDelay.setText("Set");
|
||||
buttonSetDelay.setEnabled(false);
|
||||
buttonSetDelay.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonSetDelayActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
textOffset.setEditable(false);
|
||||
textOffset.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
jPanel2Layout.setHorizontalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonSetDelay)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textOffset, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(textOffset, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(buttonSetDelay)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(buttonStart)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonAbort)
|
||||
.addGap(15, 15, 15))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(panelScanPars, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(panelBeamPars, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
|
||||
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 528, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(panelScanPars, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(panelBeamPars, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonStart)
|
||||
.addComponent(buttonAbort))))
|
||||
.addGap(14, 14, 14))
|
||||
);
|
||||
|
||||
panelScanPars.getAccessibleContext().setAccessibleDescription("");
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void buttonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartActionPerformed
|
||||
textRefPhase.setText("");
|
||||
ArrayList parameters = new ArrayList();
|
||||
parameters.add(spinnerStart.getValue());
|
||||
parameters.add(spinnerStop.getValue());
|
||||
parameters.add(spinnerStep.getValue());
|
||||
parameters.add(spinnerSamples.getValue());
|
||||
parameters.add(spinnerLatency.getValue());
|
||||
parameters.add((Double) spinnerDispersion.getValue());
|
||||
parameters.add((Double) spinnerEnergy.getValue());
|
||||
parameters.add(plot);
|
||||
try {
|
||||
runAsync("RFscan/GunEnergyScanNew", parameters).handle((ret, ex) -> {
|
||||
if (ex != null) {
|
||||
getLogger().info("Exception executing scan: " + ex);
|
||||
showException((Exception) ex);
|
||||
} else {
|
||||
List list = (List)ret;
|
||||
try{
|
||||
double phase = ((Number)list.get(0)).doubleValue();
|
||||
double offset = ((Number)list.get(1)).doubleValue();
|
||||
textRefPhase.setText(String.format("%1.2f",phase));
|
||||
textOffset.setText(String.format("%1.2f",offset));
|
||||
buttonPhaseSet.setEnabled(true);
|
||||
buttonSetDelay.setEnabled(true);
|
||||
} catch (Exception e) {
|
||||
showException(e);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonStartActionPerformed
|
||||
|
||||
private void buttonAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAbortActionPerformed
|
||||
try {
|
||||
abort();
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonAbortActionPerformed
|
||||
|
||||
private void buttonPhaseSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPhaseSetActionPerformed
|
||||
try {
|
||||
if (!textRefPhase.getText().isEmpty()){
|
||||
Double phase = Double.parseDouble(textRefPhase.getText());
|
||||
|
||||
ArrayList parameters = new ArrayList();
|
||||
parameters.add(phase);
|
||||
parameters.add(plot);
|
||||
try {
|
||||
//How to get a callback on the end of execution
|
||||
runAsync("RFscan/GunEnergyScanRfSetNew", parameters).handle((ret, ex) -> {
|
||||
if (ex != null) {
|
||||
getLogger().info("Exception executing scan: " + ex);
|
||||
showException((Exception) ex);
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonPhaseSetActionPerformed
|
||||
|
||||
private void buttonSetDelayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSetDelayActionPerformed
|
||||
try {
|
||||
if (!textOffset.getText().isEmpty()){
|
||||
Double offset = Double.parseDouble(textOffset.getText());
|
||||
|
||||
ArrayList parameters = new ArrayList();
|
||||
parameters.add(offset);
|
||||
parameters.add(plot);
|
||||
try {
|
||||
//How to get a callback on the end of execution
|
||||
runAsync("RFscan/GunEnergyScanLasSetNew", parameters).handle((ret, ex) -> {
|
||||
if (ex != null) {
|
||||
getLogger().info("Exception executing scan: " + ex);
|
||||
showException((Exception) ex);
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonSetDelayActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonAbort;
|
||||
private javax.swing.JButton buttonPhaseSet;
|
||||
private javax.swing.JButton buttonSetDelay;
|
||||
private javax.swing.JButton buttonStart;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JLabel labelDispersion;
|
||||
private javax.swing.JLabel labelEnergy;
|
||||
private javax.swing.JLabel labelLatency;
|
||||
private javax.swing.JLabel labelSamples;
|
||||
private javax.swing.JLabel labelStart;
|
||||
private javax.swing.JLabel labelStep;
|
||||
private javax.swing.JLabel labelStop;
|
||||
private javax.swing.JPanel panelBeamPars;
|
||||
private javax.swing.JPanel panelScanPars;
|
||||
private ch.psi.pshell.plot.LinePlotJFree plot;
|
||||
private javax.swing.JSpinner spinnerDispersion;
|
||||
private javax.swing.JSpinner spinnerEnergy;
|
||||
private javax.swing.JSpinner spinnerLatency;
|
||||
private javax.swing.JSpinner spinnerSamples;
|
||||
private javax.swing.JSpinner spinnerStart;
|
||||
private javax.swing.JSpinner spinnerStep;
|
||||
private javax.swing.JSpinner spinnerStop;
|
||||
private javax.swing.JTextField textOffset;
|
||||
private javax.swing.JTextField textRefPhase;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
@@ -86,7 +86,7 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="labelStart" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
@@ -97,11 +97,6 @@
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="spinnerSamples" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="labelLatency" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="spinnerLatency" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="labelStop" linkSize="2" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
@@ -113,6 +108,19 @@
|
||||
<Component id="spinnerStop" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="labelLatency" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="labelLatency1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spinnerBunch" max="32767" attributes="0"/>
|
||||
<Component id="spinnerLatency" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
@@ -146,6 +154,11 @@
|
||||
<Component id="labelLatency" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerLatency" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="labelLatency1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerBunch" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -217,6 +230,19 @@
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelLatency1">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Bunch:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerBunch">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="1" maximum="2" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="ch.psi.pshell.plot.LinePlotJFree" name="plot">
|
||||
|
||||
@@ -16,6 +16,7 @@ import ch.psi.utils.Convert;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.swing.JSpinner;
|
||||
@@ -44,11 +45,9 @@ public class SchottkyScan extends Panel {
|
||||
public void onStateChange(State state, State former) {
|
||||
buttonAbort.setEnabled(state.isProcessing());
|
||||
buttonStart.setEnabled(state == State.Ready);
|
||||
spinnerStart.setEnabled(buttonStart.isEnabled());
|
||||
spinnerStop.setEnabled(buttonStart.isEnabled());
|
||||
spinnerStep.setEnabled(buttonStart.isEnabled());
|
||||
spinnerSamples.setEnabled(buttonStart.isEnabled());
|
||||
spinnerLatency.setEnabled(buttonStart.isEnabled());
|
||||
for (Component c : SwingUtils.getComponentsByType(panelPars, JSpinner.class)){
|
||||
c.setEnabled(buttonStart.isEnabled());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,6 +76,8 @@ public class SchottkyScan extends Panel {
|
||||
spinnerSamples = new javax.swing.JSpinner();
|
||||
labelSamples = new javax.swing.JLabel();
|
||||
spinnerStart = new javax.swing.JSpinner();
|
||||
labelLatency1 = new javax.swing.JLabel();
|
||||
spinnerBunch = new javax.swing.JSpinner();
|
||||
plot = new ch.psi.pshell.plot.LinePlotJFree();
|
||||
|
||||
buttonStart.setText("Start");
|
||||
@@ -120,13 +121,18 @@ public class SchottkyScan extends Panel {
|
||||
|
||||
spinnerStart.setModel(new javax.swing.SpinnerNumberModel(-10.0d, -360.0d, 360.0d, 1.0d));
|
||||
|
||||
labelLatency1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
labelLatency1.setText("Bunch:");
|
||||
|
||||
spinnerBunch.setModel(new javax.swing.SpinnerNumberModel(1, 1, 2, 1));
|
||||
|
||||
javax.swing.GroupLayout panelParsLayout = new javax.swing.GroupLayout(panelPars);
|
||||
panelPars.setLayout(panelParsLayout);
|
||||
panelParsLayout.setHorizontalGroup(
|
||||
panelParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelParsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addGroup(panelParsLayout.createSequentialGroup()
|
||||
.addComponent(labelStart)
|
||||
.addGap(0, 0, 0)
|
||||
@@ -135,10 +141,6 @@ public class SchottkyScan extends Panel {
|
||||
.addComponent(labelSamples)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(spinnerSamples, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelParsLayout.createSequentialGroup()
|
||||
.addComponent(labelLatency)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelParsLayout.createSequentialGroup()
|
||||
.addGroup(panelParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(labelStop)
|
||||
@@ -146,7 +148,16 @@ public class SchottkyScan extends Panel {
|
||||
.addGap(1, 1, 1)
|
||||
.addGroup(panelParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerStop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||
.addComponent(spinnerStop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGroup(panelParsLayout.createSequentialGroup()
|
||||
.addGroup(panelParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(labelLatency)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelParsLayout.createSequentialGroup()
|
||||
.addComponent(labelLatency1)
|
||||
.addGap(0, 0, 0)))
|
||||
.addGroup(panelParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerBunch)
|
||||
.addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
@@ -177,6 +188,10 @@ public class SchottkyScan extends Panel {
|
||||
.addGroup(panelParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(labelLatency)
|
||||
.addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelParsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(labelLatency1)
|
||||
.addComponent(spinnerBunch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
@@ -229,6 +244,7 @@ public class SchottkyScan extends Panel {
|
||||
parameters.add(spinnerSamples.getValue());
|
||||
parameters.add(spinnerLatency.getValue());
|
||||
parameters.add(plot);
|
||||
parameters.add(spinnerBunch.getValue());
|
||||
try {
|
||||
//How to get a callback on the end of execution
|
||||
runAsync("RFscan/SchottkyScan", parameters).handle((ret, ex) -> {
|
||||
@@ -260,12 +276,14 @@ public class SchottkyScan extends Panel {
|
||||
private javax.swing.JButton buttonAbort;
|
||||
private javax.swing.JButton buttonStart;
|
||||
private javax.swing.JLabel labelLatency;
|
||||
private javax.swing.JLabel labelLatency1;
|
||||
private javax.swing.JLabel labelSamples;
|
||||
private javax.swing.JLabel labelStart;
|
||||
private javax.swing.JLabel labelStep;
|
||||
private javax.swing.JLabel labelStop;
|
||||
private javax.swing.JPanel panelPars;
|
||||
private ch.psi.pshell.plot.LinePlotJFree plot;
|
||||
private javax.swing.JSpinner spinnerBunch;
|
||||
private javax.swing.JSpinner spinnerLatency;
|
||||
private javax.swing.JSpinner spinnerSamples;
|
||||
private javax.swing.JSpinner spinnerStart;
|
||||
|
||||
Reference in New Issue
Block a user