This commit is contained in:
gac-x09lb
2022-10-03 09:50:17 +02:00
parent 5edf774770
commit b12616ce42
5 changed files with 1453 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#Mon Oct 03 09:50:15 CEST 2022
offset=0.0
maxValue=10.0
rotation=false
precision=2
scale=1.0
description=null
estbilizationDelay=0
maxSpeed=10.0
resolution=NaN
startRetries=1
minValue=-10.0
unit=mm
defaultSpeed=1.0
sign_bit=0
monitorByPosition=false
minSpeed=0.1

637
plugins/Scan2D.form Normal file
View File

@@ -0,0 +1,637 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<NonVisualComponents>
<Component class="javax.swing.ButtonGroup" name="buttonGroup1">
</Component>
<Component class="javax.swing.ButtonGroup" name="buttonGroup2">
</Component>
</NonVisualComponents>
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[792, 567]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="panelSensors" linkSize="7" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="panelPositioner" linkSize="7" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jPanel3" linkSize="7" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" 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="0" attributes="0">
<Component id="panelPositioner" max="32767" attributes="0"/>
<Component id="panelSensors" max="32767" attributes="0"/>
<Component id="jPanel3" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="panelPositioner">
<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="Positioner"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="radioSteps" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="motorPanel" max="32767" attributes="0"/>
<Component id="comboMotor" pref="159" max="32767" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="spinnerLatency" linkSize="4" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel4" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="spinnerFrom" alignment="1" max="32767" attributes="0"/>
<Component id="spinnerRange" linkSize="4" alignment="1" max="32767" attributes="0"/>
<Component id="spinnerTo" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="spinnerSteps" linkSize="4" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="txtSize" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="spinnerStepSize" linkSize="4" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="radioStepSize" min="-2" max="-2" attributes="0"/>
<Component id="radioAbsolute" min="-2" max="-2" attributes="0"/>
<Component id="radioRelative" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkFlyScan" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<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="comboMotor" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel6" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="motorPanel" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="radioAbsolute" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="spinnerFrom" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="spinnerTo" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="radioRelative" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="spinnerRange" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="radioStepSize" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="spinnerStepSize" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtSize" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="radioSteps" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="spinnerSteps" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerLatency" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="81" max="32767" attributes="0"/>
<Component id="checkFlyScan" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Motor:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="comboMotor">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="7">
<StringItem index="0" value="dummy"/>
<StringItem index="1" value="ManipulatorX"/>
<StringItem index="2" value="ManipulatorY"/>
<StringItem index="3" value="ManipulatorZ"/>
<StringItem index="4" value="ManipulatorTheta"/>
<StringItem index="5" value="ManipulatorTilt"/>
<StringItem index="6" value="ManipulatorPhi"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboMotorActionPerformed"/>
</Events>
</Component>
<Component class="ch.psi.pshell.swing.MotorReadoutPanel" name="motorPanel">
</Component>
<Component class="javax.swing.JLabel" name="txtSize">
<Properties>
<Property name="text" type="java.lang.String" value="Size:"/>
</Properties>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerRange">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="1.0" maximum="100.0" minimum="0.001" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JRadioButton" name="radioStepSize">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Step Size"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="radioStepSizeActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="radioSteps">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="text" type="java.lang.String" value="Number of Steps"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="radioStepSizeActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerStepSize">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="0.1" maximum="1000.0" minimum="0.001" numberType="java.lang.Double" stepSize="0.1" type="number"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerSteps">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="10" maximum="1000" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="Latency(s):"/>
</Properties>
</Component>
<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.0" maximum="10.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.1" type="number"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JRadioButton" name="radioAbsolute">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup2"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Absolute Scan"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="radioAbsoluteActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerFrom">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="1.0" maximum="1.0" minimum="0.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="From:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" value="To:"/>
</Properties>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerTo">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="1.0" maximum="1.0" minimum="0.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JRadioButton" name="radioRelative">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup2"/>
</Property>
<Property name="text" type="java.lang.String" value="Relative Scan"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="radioAbsoluteActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="Position:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value="Range:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" value="Steps:"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkFlyScan">
<Properties>
<Property name="text" type="java.lang.String" value="Fly Scan"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="panelSensors">
<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="Sensors"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonScientaSetup" pref="234" max="32767" attributes="0"/>
<Component id="checkImage" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkImageIntegration" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkSpectrum" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkCounts1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkTotalCount" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkCounts2" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkCounts3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkCounts4" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkCurrent" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkCur1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkCur2" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkCur3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="checkAngleDistribution" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<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"/>
<Component id="checkImage" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkImageIntegration" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkAngleDistribution" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkSpectrum" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkTotalCount" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkCounts1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkCounts2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkCounts3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkCounts4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkCurrent" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkCur1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkCur2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="checkCur3" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="97" max="32767" attributes="0"/>
<Component id="buttonScientaSetup" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JCheckBox" name="checkImage">
<Properties>
<Property name="text" type="java.lang.String" value="Scienta Image"/>
<Property name="toolTipText" type="java.lang.String" value=""/>
<Property name="contentAreaFilled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="Scienta.dataMatrix" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkImageIntegration">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Scienta Energy Distribution"/>
<Property name="toolTipText" type="java.lang.String" value=""/>
<Property name="contentAreaFilled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="EnergyDistribution" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkAngleDistribution">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Scienta Angle Distribution"/>
<Property name="toolTipText" type="java.lang.String" value=""/>
<Property name="contentAreaFilled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="AngleDistribution" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkSpectrum">
<Properties>
<Property name="text" type="java.lang.String" value="Scienta Spectrum"/>
<Property name="name" type="java.lang.String" value="Scienta.spectrum" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkTotalCount">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Total Counts"/>
<Property name="name" type="java.lang.String" value="Counts" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkCounts1">
<Properties>
<Property name="text" type="java.lang.String" value="Counts Region 1"/>
<Property name="name" type="java.lang.String" value="CountsR1" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkCounts2">
<Properties>
<Property name="text" type="java.lang.String" value="Counts Region 2"/>
<Property name="name" type="java.lang.String" value="CountsR2" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkCounts3">
<Properties>
<Property name="text" type="java.lang.String" value="Counts Region 3"/>
<Property name="name" type="java.lang.String" value="CountsR3" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkCounts4">
<Properties>
<Property name="text" type="java.lang.String" value="Counts Region 4"/>
<Property name="name" type="java.lang.String" value="CountsR4" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkCurrent">
<Properties>
<Property name="text" type="java.lang.String" value="Machine Current"/>
<Property name="name" type="java.lang.String" value="MachineCurrent" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkCur1">
<Properties>
<Property name="text" type="java.lang.String" value="Sample Current"/>
<Property name="name" type="java.lang.String" value="SampleCurrent" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkCur2">
<Properties>
<Property name="text" type="java.lang.String" value="Ref Current"/>
<Property name="name" type="java.lang.String" value="RefCurrent" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkCur3">
<Properties>
<Property name="text" type="java.lang.String" value="Aux Current"/>
<Property name="name" type="java.lang.String" value="AuxCurrent" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="buttonScientaSetup">
<Properties>
<Property name="text" type="java.lang.String" value="Scienta Setup"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonScientaSetupActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
<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="Scan Control"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonStart" max="32767" attributes="0"/>
<Component id="buttonAbort" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="9" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="labelAcqTime" linkSize="10" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="labelTotalTime" linkSize="10" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="textTotalTime" linkSize="8" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="dvpAcqTime" linkSize="8" alignment="1" min="-2" pref="76" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="checkEndScan" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="buttonQueue" 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" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonStart" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="buttonAbort" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="32767" attributes="0"/>
<Component id="buttonQueue" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="32767" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="labelAcqTime" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="dvpAcqTime" linkSize="9" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="labelTotalTime" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="textTotalTime" linkSize="9" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="32767" attributes="0"/>
<Component id="checkEndScan" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="buttonStart">
<Properties>
<Property name="text" type="java.lang.String" value="Start"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonStartActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonAbort">
<Properties>
<Property name="text" type="java.lang.String" value="Abort"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonAbortActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkEndScan">
<Properties>
<Property name="text" type="java.lang.String" value="Turn off beam at end"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="textTotalTime">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<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/>
</Border>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="labelTotalTime">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Total time:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="labelAcqTime">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Acquisition time(s):"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="dvpAcqTime">
</Component>
<Component class="javax.swing.JButton" name="buttonQueue">
<Properties>
<Property name="text" type="java.lang.String" value="Queue"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonQueueActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>

707
plugins/Scan2D.java Normal file
View File

@@ -0,0 +1,707 @@
/*
* Copyright (c) 2014 Paul Scherrer Institute. All rights reserved.
*/
import ch.psi.pshell.device.Device;
import ch.psi.pshell.device.DeviceAdapter;
import ch.psi.pshell.device.Motor;
import ch.psi.pshell.epics.Scienta;
import ch.psi.pshell.ui.Panel;
import ch.psi.pshell.ui.ScriptProcessor;
import ch.psi.utils.State;
import ch.psi.utils.swing.SwingUtils;
import java.awt.Component;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JCheckBox;
import javax.swing.JSpinner;
import javax.swing.JToggleButton;
import javax.swing.SpinnerNumberModel;
/**
*
*/
public class Scan2D extends ScriptProcessor {
public Scan2D() {
initComponents();
//Component persistence
ArrayList<Component> persistedComponents = new ArrayList<>();
persistedComponents.addAll(Arrays.asList(SwingUtils.getComponentsByType(this, JToggleButton.class)));
persistedComponents.addAll(Arrays.asList(SwingUtils.getComponentsByType(this, JSpinner.class)));
setPersistedComponents(persistedComponents.toArray(new Component[0]));
startTimer(1000);
}
//Overridable callbacks
@Override
public void onInitialize(int runCount) {
Motor phi = (Motor) getDevice("ManipulatorPhi");
Motor theta = (Motor) getDevice("ManipulatorTheta");
Scienta scienta = (Scienta) getDevice("Scienta");
motorPanelPhi.setDevice(phi);
motorPanelTheta.setDevice(theta);
dvpAcqTime.setDevice(scienta.getAcquisitionTime());
try{
spinnerFromPhi.setModel(new SpinnerNumberModel(Math.max(phi.getMinValue(),(Double)spinnerFromPhi.getValue()), phi.getMinValue(), phi.getMaxValue(), 1.0));
spinnerToPhi.setModel(new SpinnerNumberModel(Math.min(phi.getMaxValue(),(Double)spinnerToPhi.getValue()), phi.getMinValue(), phi.getMaxValue(), 1.0));
} catch (Exception ex){
spinnerFromPhi.setModel(new SpinnerNumberModel(phi.getMinValue(), phi.getMinValue(), phi.getMaxValue(), 1.0));
spinnerToPhi.setModel(new SpinnerNumberModel(phi.getMaxValue(), phi.getMinValue(), phi.getMaxValue(), 1.0));
}
try{
spinnerFromTheta.setModel(new SpinnerNumberModel(Math.max(theta.getMinValue(),(Double)spinnerFromTheta.getValue()), theta.getMinValue(), theta.getMaxValue(), 1.0));
spinnerToTheta.setModel(new SpinnerNumberModel(Math.min(theta.getMaxValue(),(Double)spinnerToTheta.getValue()), theta.getMinValue(), theta.getMaxValue(), 1.0));
} catch (Exception ex){
spinnerFromTheta.setModel(new SpinnerNumberModel(theta.getMinValue(), theta.getMinValue(), theta.getMaxValue(), 1.0));
spinnerToTheta.setModel(new SpinnerNumberModel(theta.getMaxValue(), theta.getMinValue(), theta.getMaxValue(), 1.0));
}
}
protected void onTimer(){
try{
int steps = (radioSteps.isSelected() ?
(Integer)spinnerStepsPhi.getValue() * (Integer)spinnerStepsTheta.getValue() :
(int)(Math.abs((Double)spinnerToPhi.getValue() - (Double)spinnerFromPhi.getValue()) / (Double)spinnerStepSizePhi.getValue() + 1) *
(int)(Math.abs((Double)spinnerToTheta.getValue() - (Double)spinnerFromTheta.getValue()) / (Double)spinnerStepSizeTheta.getValue() +1));
int seconds = (int) (Double.valueOf(dvpAcqTime.getLabel().getText()) * steps);
int hours= seconds / (60 * 60);
textTotalTime.setText(hours >= 24 ? hours+"h": LocalTime.ofSecondOfDay(seconds).toString());
} catch (Exception ex){
textTotalTime.setText("");
}
}
@Override
public void onStateChange(State state, State former) {
setEnabled(isEnabled());
}
@Override
public void onExecutedFile(String fileName, Object result) {
}
@Override
public void setEnabled(boolean value) {
super.setEnabled(value);
boolean enableControls = (value && (getState()==State.Ready));
for (Component c : panelSensors.getComponents()) {
c.setEnabled(enableControls);
}
for (Component c : panelPositioners.getComponents()) {
c.setEnabled(enableControls);
}
labelAcqTime.setEnabled(enableControls);
labelTotalTime.setEnabled(enableControls);
buttonStart.setEnabled(enableControls);
checkEndScan.setEnabled(enableControls);
buttonAbort.setEnabled(value && getState().isInitialized());
spinnerStepSizePhi.setEnabled(enableControls && radioStepSize.isSelected());
spinnerStepsPhi.setEnabled(enableControls && radioSteps.isSelected());
spinnerFromPhi.setEnabled(enableControls);
spinnerToPhi.setEnabled(enableControls);
spinnerStepSizeTheta.setEnabled(spinnerStepSizePhi.isEnabled());
spinnerStepsTheta.setEnabled(spinnerStepsPhi.isEnabled());
spinnerFromTheta.setEnabled(spinnerFromPhi.isEnabled());
spinnerToTheta.setEnabled(spinnerToPhi.isEnabled());
buttonScientaSetup.setEnabled(value);
}
@Override
public String getScript() {
return "HoloScan";
}
@Override
public Map<String, Object> getArgs() {
HashMap<String, Object> args = new HashMap<>();
ArrayList<String> sensors = new ArrayList();
for (Component c : panelSensors.getComponents()) {
if ((c instanceof JCheckBox) && ((JCheckBox) c).isSelected()) {
sensors.add(c.getName());
}
}
args.put("SENSORS", sensors);
args.put("PHI_RANGE", new Double[]{(Double) spinnerFromPhi.getValue(), (Double) spinnerToPhi.getValue()});
args.put("THETA_RANGE", new Double[]{(Double) spinnerFromTheta.getValue(), (Double) spinnerToTheta.getValue()});
ArrayList steps = new ArrayList();
if (radioStepSize.isSelected()) {
steps.add((Double) spinnerStepSizePhi.getValue());
steps.add((Double) spinnerStepSizeTheta.getValue());
} else {
steps.add((Integer) spinnerStepsPhi.getValue());
steps.add((Integer) spinnerStepsTheta.getValue());
}
args.put("STEPS", steps);
args.put("LATENCY", (Double) 0.0);
args.put("RELATIVE", false);
args.put("ZIGZAG", checkZigzag.isSelected());
args.put("ENDSCAN", checkEndScan.isSelected());
return args;
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
buttonGroup1 = new javax.swing.ButtonGroup();
buttonGroup2 = new javax.swing.ButtonGroup();
panelPositioners = new javax.swing.JPanel();
motorPanelPhi = new ch.psi.pshell.swing.MotorReadoutPanel();
radioStepSize = new javax.swing.JRadioButton();
radioSteps = new javax.swing.JRadioButton();
spinnerStepSizePhi = new javax.swing.JSpinner();
spinnerStepsPhi = new javax.swing.JSpinner();
spinnerFromPhi = new javax.swing.JSpinner();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
spinnerToPhi = new javax.swing.JSpinner();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
motorPanelTheta = new ch.psi.pshell.swing.MotorReadoutPanel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
spinnerFromTheta = new javax.swing.JSpinner();
spinnerToTheta = new javax.swing.JSpinner();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
spinnerStepSizeTheta = new javax.swing.JSpinner();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
spinnerStepsTheta = new javax.swing.JSpinner();
checkZigzag = new javax.swing.JCheckBox();
panelSensors = new javax.swing.JPanel();
checkImage = new javax.swing.JCheckBox();
checkImageIntegration = new javax.swing.JCheckBox();
checkAngleDistribution = new javax.swing.JCheckBox();
checkSpectrum = new javax.swing.JCheckBox();
checkTotalCount = new javax.swing.JCheckBox();
checkCounts1 = new javax.swing.JCheckBox();
checkCounts2 = new javax.swing.JCheckBox();
checkCounts3 = new javax.swing.JCheckBox();
checkCounts4 = new javax.swing.JCheckBox();
checkCurrent = new javax.swing.JCheckBox();
checkCur1 = new javax.swing.JCheckBox();
checkCur2 = new javax.swing.JCheckBox();
checkCur3 = new javax.swing.JCheckBox();
buttonScientaSetup = new javax.swing.JButton();
panelScan = new javax.swing.JPanel();
buttonStart = new javax.swing.JButton();
buttonAbort = new javax.swing.JButton();
checkEndScan = new javax.swing.JCheckBox();
labelAcqTime = new javax.swing.JLabel();
dvpAcqTime = new ch.psi.pshell.swing.DeviceValuePanel();
labelTotalTime = new javax.swing.JLabel();
textTotalTime = new javax.swing.JLabel();
buttonQueue = new javax.swing.JButton();
panelPositioners.setBorder(javax.swing.BorderFactory.createTitledBorder("Positioners"));
panelPositioners.setPreferredSize(new java.awt.Dimension(248, 543));
buttonGroup1.add(radioStepSize);
radioStepSize.setSelected(true);
radioStepSize.setText("Step Size");
radioStepSize.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
radioStepSizeActionPerformed(evt);
}
});
buttonGroup1.add(radioSteps);
radioSteps.setText("Number of Steps");
radioSteps.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
radioStepSizeActionPerformed(evt);
}
});
spinnerStepSizePhi.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.1d, 180.0d, 0.1d));
spinnerStepsPhi.setModel(new javax.swing.SpinnerNumberModel(10, 1, 1000, 1));
spinnerStepsPhi.setEnabled(false);
spinnerFromPhi.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.0d, 1.0d, 1.0d));
jLabel4.setText("Phi From:");
jLabel5.setText("Phi To:");
spinnerToPhi.setModel(new javax.swing.SpinnerNumberModel(10.0d, 0.0d, 10.0d, 1.0d));
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel6.setText("Phi:");
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel7.setText("Theta:");
jLabel8.setText("Theta To:");
jLabel9.setText("Theta From:");
spinnerFromTheta.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.0d, 1.0d, 1.0d));
spinnerToTheta.setModel(new javax.swing.SpinnerNumberModel(10.0d, 0.0d, 10.0d, 1.0d));
jLabel11.setText("Phi:");
jLabel12.setText("Theta:");
spinnerStepSizeTheta.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.1d, 90.0d, 0.1d));
jLabel13.setText("Phi:");
jLabel14.setText("Theta:");
spinnerStepsTheta.setModel(new javax.swing.SpinnerNumberModel(10, 1, 1000, 1));
spinnerStepsTheta.setEnabled(false);
checkZigzag.setText("Zigzag");
javax.swing.GroupLayout panelPositionersLayout = new javax.swing.GroupLayout(panelPositioners);
panelPositioners.setLayout(panelPositionersLayout);
panelPositionersLayout.setHorizontalGroup(
panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelPositionersLayout.createSequentialGroup()
.addContainerGap()
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelPositionersLayout.createSequentialGroup()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(motorPanelPhi, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelPositionersLayout.createSequentialGroup()
.addGap(0, 36, Short.MAX_VALUE)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelPositionersLayout.createSequentialGroup()
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(spinnerFromPhi, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE)
.addComponent(spinnerToPhi, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(spinnerFromTheta, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(spinnerToTheta, javax.swing.GroupLayout.Alignment.TRAILING)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelPositionersLayout.createSequentialGroup()
.addComponent(jLabel11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(spinnerStepSizePhi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelPositionersLayout.createSequentialGroup()
.addComponent(jLabel12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(spinnerStepSizeTheta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelPositionersLayout.createSequentialGroup()
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel14)
.addComponent(jLabel13))
.addGap(6, 6, 6)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(spinnerStepsPhi, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(spinnerStepsTheta, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGroup(panelPositionersLayout.createSequentialGroup()
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(motorPanelTheta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(panelPositionersLayout.createSequentialGroup()
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(radioSteps)
.addComponent(radioStepSize)
.addComponent(checkZigzag))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
panelPositionersLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {radioStepSize, radioSteps});
panelPositionersLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerStepSizePhi, spinnerStepSizeTheta, spinnerStepsPhi});
panelPositionersLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel6, jLabel7});
panelPositionersLayout.setVerticalGroup(
panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelPositionersLayout.createSequentialGroup()
.addContainerGap()
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabel6)
.addComponent(motorPanelPhi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabel7)
.addComponent(motorPanelTheta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerFromPhi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addGap(3, 3, 3)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerToPhi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5))
.addGap(3, 3, 3)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerFromTheta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9))
.addGap(3, 3, 3)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerToTheta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8))
.addGap(18, 18, 18)
.addComponent(radioStepSize)
.addGap(3, 3, 3)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerStepSizePhi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel11))
.addGap(3, 3, 3)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerStepSizeTheta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel12))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(radioSteps)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerStepsPhi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(panelPositionersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerStepsTheta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel14))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkZigzag)
.addContainerGap(99, Short.MAX_VALUE))
);
panelSensors.setBorder(javax.swing.BorderFactory.createTitledBorder("Sensors"));
panelSensors.setPreferredSize(new java.awt.Dimension(248, 543));
checkImage.setSelected(true);
checkImage.setText("Scienta Image");
checkImage.setToolTipText("");
checkImage.setContentAreaFilled(false);
checkImage.setName("Scienta.dataMatrix"); // NOI18N
checkImageIntegration.setSelected(true);
checkImageIntegration.setText("Scienta Energy Distribution");
checkImageIntegration.setToolTipText("");
checkImageIntegration.setContentAreaFilled(false);
checkImageIntegration.setName("EnergyDistribution"); // NOI18N
checkAngleDistribution.setSelected(true);
checkAngleDistribution.setText("Scienta Angle Distribution");
checkAngleDistribution.setToolTipText("");
checkAngleDistribution.setContentAreaFilled(false);
checkAngleDistribution.setName("AngleDistribution"); // NOI18N
checkSpectrum.setText("Scienta Spectrum");
checkSpectrum.setName("Scienta.spectrum"); // NOI18N
checkTotalCount.setSelected(true);
checkTotalCount.setText("Total Counts");
checkTotalCount.setName("Counts"); // NOI18N
checkCounts1.setText("Counts Region 1");
checkCounts1.setName("CountsR1"); // NOI18N
checkCounts2.setText("Counts Region 2");
checkCounts2.setName("CountsR2"); // NOI18N
checkCounts3.setText("Counts Region 3");
checkCounts3.setName("CountsR3"); // NOI18N
checkCounts4.setText("Counts Region 4");
checkCounts4.setName("CountsR4"); // NOI18N
checkCurrent.setText("Machine Current");
checkCurrent.setName("MachineCurrent"); // NOI18N
checkCur1.setText("Sample Current");
checkCur1.setName("SampleCurrent"); // NOI18N
checkCur2.setText("Ref Current");
checkCur2.setName("RefCurrent"); // NOI18N
checkCur3.setText("Aux Current");
checkCur3.setName("AuxCurrent"); // NOI18N
buttonScientaSetup.setText("Scienta Setup");
buttonScientaSetup.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonScientaSetupActionPerformed(evt);
}
});
javax.swing.GroupLayout panelSensorsLayout = new javax.swing.GroupLayout(panelSensors);
panelSensors.setLayout(panelSensorsLayout);
panelSensorsLayout.setHorizontalGroup(
panelSensorsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelSensorsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(panelSensorsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonScientaSetup, javax.swing.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE)
.addComponent(checkImage)
.addComponent(checkImageIntegration)
.addComponent(checkSpectrum)
.addComponent(checkCounts1)
.addComponent(checkTotalCount)
.addComponent(checkCounts2)
.addComponent(checkCounts3)
.addComponent(checkCounts4)
.addComponent(checkCurrent)
.addComponent(checkCur1)
.addComponent(checkCur2)
.addComponent(checkCur3)
.addComponent(checkAngleDistribution))
.addContainerGap())
);
panelSensorsLayout.setVerticalGroup(
panelSensorsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelSensorsLayout.createSequentialGroup()
.addContainerGap()
.addComponent(checkImage)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkImageIntegration)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkAngleDistribution)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkSpectrum)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkTotalCount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkCounts1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkCounts2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkCounts3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkCounts4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkCurrent)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkCur1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkCur2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(checkCur3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 97, Short.MAX_VALUE)
.addComponent(buttonScientaSetup)
.addGap(26, 26, 26))
);
panelScan.setBorder(javax.swing.BorderFactory.createTitledBorder("Scan Control"));
panelScan.setPreferredSize(new java.awt.Dimension(248, 543));
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);
}
});
checkEndScan.setText("Turn off beam at end");
labelAcqTime.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
labelAcqTime.setText("Acquisition time(s):");
labelTotalTime.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
labelTotalTime.setText("Total time:");
textTotalTime.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
textTotalTime.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
buttonQueue.setText("Queue");
buttonQueue.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonQueueActionPerformed(evt);
}
});
javax.swing.GroupLayout panelScanLayout = new javax.swing.GroupLayout(panelScan);
panelScan.setLayout(panelScanLayout);
panelScanLayout.setHorizontalGroup(
panelScanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelScanLayout.createSequentialGroup()
.addContainerGap()
.addGroup(panelScanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonStart, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonAbort, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(panelScanLayout.createSequentialGroup()
.addGroup(panelScanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(labelAcqTime)
.addComponent(labelTotalTime))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(panelScanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(textTotalTime, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(dvpAcqTime, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 6, Short.MAX_VALUE))
.addGroup(panelScanLayout.createSequentialGroup()
.addComponent(checkEndScan)
.addGap(53, 53, 53))
.addComponent(buttonQueue, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
panelScanLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {labelAcqTime, labelTotalTime});
panelScanLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {dvpAcqTime, textTotalTime});
panelScanLayout.setVerticalGroup(
panelScanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelScanLayout.createSequentialGroup()
.addContainerGap()
.addComponent(buttonStart)
.addGap(18, 18, 18)
.addComponent(buttonAbort)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonQueue)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(panelScanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(labelAcqTime)
.addComponent(dvpAcqTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(panelScanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(textTotalTime)
.addComponent(labelTotalTime))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(checkEndScan)
.addGap(26, 26, 26))
);
panelScanLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {dvpAcqTime, textTotalTime});
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()
.addComponent(panelSensors, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(panelPositioners, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(panelScan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {panelPositioners, panelScan, panelSensors});
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(panelPositioners, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(panelSensors, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(panelScan, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void buttonScientaSetupActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScientaSetupActionPerformed
try{
showDevicePanel("Scienta");
} catch (Exception ex){
SwingUtils.showException(this, ex);
}
}//GEN-LAST:event_buttonScientaSetupActionPerformed
private void buttonStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonStartActionPerformed
try{
execute();
} catch (Exception ex){
SwingUtils.showException(this, ex);
}
}//GEN-LAST:event_buttonStartActionPerformed
private void buttonAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAbortActionPerformed
try {
abort();
((Scienta) getDevice("Scienta")).stop();
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_buttonAbortActionPerformed
private void radioStepSizeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioStepSizeActionPerformed
setEnabled(isEnabled());
}//GEN-LAST:event_radioStepSizeActionPerformed
private void buttonQueueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonQueueActionPerformed
try {
queue();
} catch (Exception ex) {
SwingUtils.showException(this, ex);
}
}//GEN-LAST:event_buttonQueueActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonAbort;
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.ButtonGroup buttonGroup2;
private javax.swing.JButton buttonQueue;
private javax.swing.JButton buttonScientaSetup;
private javax.swing.JButton buttonStart;
private javax.swing.JCheckBox checkAngleDistribution;
private javax.swing.JCheckBox checkCounts1;
private javax.swing.JCheckBox checkCounts2;
private javax.swing.JCheckBox checkCounts3;
private javax.swing.JCheckBox checkCounts4;
private javax.swing.JCheckBox checkCur1;
private javax.swing.JCheckBox checkCur2;
private javax.swing.JCheckBox checkCur3;
private javax.swing.JCheckBox checkCurrent;
private javax.swing.JCheckBox checkEndScan;
private javax.swing.JCheckBox checkImage;
private javax.swing.JCheckBox checkImageIntegration;
private javax.swing.JCheckBox checkSpectrum;
private javax.swing.JCheckBox checkTotalCount;
private javax.swing.JCheckBox checkZigzag;
private ch.psi.pshell.swing.DeviceValuePanel dvpAcqTime;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JLabel labelAcqTime;
private javax.swing.JLabel labelTotalTime;
private ch.psi.pshell.swing.MotorReadoutPanel motorPanelPhi;
private ch.psi.pshell.swing.MotorReadoutPanel motorPanelTheta;
private javax.swing.JPanel panelPositioners;
private javax.swing.JPanel panelScan;
private javax.swing.JPanel panelSensors;
private javax.swing.JRadioButton radioStepSize;
private javax.swing.JRadioButton radioSteps;
private javax.swing.JSpinner spinnerFromPhi;
private javax.swing.JSpinner spinnerFromTheta;
private javax.swing.JSpinner spinnerStepSizePhi;
private javax.swing.JSpinner spinnerStepSizeTheta;
private javax.swing.JSpinner spinnerStepsPhi;
private javax.swing.JSpinner spinnerStepsTheta;
private javax.swing.JSpinner spinnerToPhi;
private javax.swing.JSpinner spinnerToTheta;
private javax.swing.JLabel textTotalTime;
// End of variables declaration//GEN-END:variables
}

View File

@@ -0,0 +1,46 @@
"""
Arguments:
MOTOR (device)
SENSORS (list)
RANGE (tuple (min, max))
STEPS (int or tuple)
LATENCY (double)
RELATIVE (BOOLEAN)
FLY_SCAN (BOOLEAN)
ENDSCAN (BOOLEAN)
"""
#set_preference(Preference.PLOT_TYPES,{'ImageIntegrator':1})
adjust_sensors()
set_adc_averaging()
set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1})
set_exec_pars(compression=True)
try:
if FLY_SCAN:
# time per scienta acquisition in seconds
trig_scienta()
time1 = time.time()
before_readout()
time.sleep(0.2)
time2 = time.time()
scienta_time = (time2 - time1) + 1.
print "step time: ", scienta_time
if isinstance(STEPS,int):
raise Exception ("Fly Scan must define step size, and not number of steps")
STEP = STEPS[0]
SPEED = STEP / scienta_time
fly_time = (RANGE[1] - RANGE[0]) / SPEED
STEPS = int(fly_time / scienta_time) + 1
print "speed: ", SPEED
print "scan time: ", fly_time
cscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, fly_time, RELATIVE, before_read=before_readout, after_read = after_readout, check_positions = False)
else:
lscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout)
finally:
if ENDSCAN:
after_scan()

View File

@@ -0,0 +1,46 @@
"""
Arguments:
MOTOR (device)
SENSORS (list)
RANGE (tuple (min, max))
STEPS (int or tuple)
LATENCY (double)
RELATIVE (BOOLEAN)
FLY_SCAN (BOOLEAN)
ENDSCAN (BOOLEAN)
"""
#set_preference(Preference.PLOT_TYPES,{'ImageIntegrator':1})
adjust_sensors()
set_adc_averaging()
set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1})
set_exec_pars(compression=True)
try:
if FLY_SCAN:
# time per scienta acquisition in seconds
trig_scienta()
time1 = time.time()
before_readout()
time.sleep(0.2)
time2 = time.time()
scienta_time = (time2 - time1) + 1.
print "step time: ", scienta_time
if isinstance(STEPS,int):
raise Exception ("Fly Scan must define step size, and not number of steps")
STEP = STEPS[0]
SPEED = STEP / scienta_time
fly_time = (RANGE[1] - RANGE[0]) / SPEED
STEPS = int(fly_time / scienta_time) + 1
print "speed: ", SPEED
print "scan time: ", fly_time
cscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, fly_time, RELATIVE, before_read=before_readout, after_read = after_readout, check_positions = False)
else:
lscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout)
finally:
if ENDSCAN:
after_scan()