Startup
This commit is contained in:
1 parent
c74d5661f5
commit
54c3592384
31 files changed
+1939
-266
No files matched your search
@@ -1,16 +1,16 @@
|
||||
#Tue Jul 11 15:08:20 CEST 2017
|
||||
colormap=Flame
|
||||
colormapAutomatic=false
|
||||
colormapMax=280.0
|
||||
colormapMin=77.0
|
||||
#Fri Jul 14 10:44:20 CEST 2017
|
||||
colormap=Grayscale
|
||||
colormapAutomatic=true
|
||||
colormapMax=520.0
|
||||
colormapMin=204.0
|
||||
flipHorizontally=false
|
||||
flipVertically=false
|
||||
grayscale=false
|
||||
imageHeight=1680
|
||||
imageWidth=1744
|
||||
imageHeight=2160
|
||||
imageWidth=2560
|
||||
invert=false
|
||||
regionStartX=433
|
||||
regionStartY=241
|
||||
regionStartX=1
|
||||
regionStartY=1
|
||||
rescaleFactor=1.0
|
||||
rescaleOffset=0.0
|
||||
roiHeight=-1
|
||||
@@ -21,9 +21,9 @@ rotation=0.0
|
||||
rotationCrop=false
|
||||
scale=1.0
|
||||
serverURL=localhost\:10000
|
||||
spatialCalOffsetX=-861.4939970777481
|
||||
spatialCalOffsetY=-820.4883730911062
|
||||
spatialCalScaleX=-18.90359092620482
|
||||
spatialCalScaleY=-19.37984500632817
|
||||
spatialCalOffsetX=-606.4867444313851
|
||||
spatialCalOffsetY=-602.502078032311
|
||||
spatialCalScaleX=-26.714158979668674
|
||||
spatialCalScaleY=-27.100271547904505
|
||||
spatialCalUnits=mm
|
||||
transpose=false
|
||||
@@ -0,0 +1,15 @@
|
||||
#Thu Jul 13 13:32:57 CEST 2017
|
||||
defaultSpeed=1.0
|
||||
estbilizationDelay=0
|
||||
hasEnable=false
|
||||
homingType=None
|
||||
maxSpeed=1.0
|
||||
maxValue=346.0
|
||||
minSpeed=0.05
|
||||
minValue=130.0
|
||||
offset=0.0
|
||||
precision=5
|
||||
resolution=8.0E-4
|
||||
rotation=false
|
||||
scale=1.0
|
||||
unit=mm
|
||||
@@ -0,0 +1,13 @@
|
||||
#Thu Jul 13 11:34:36 CEST 2017
|
||||
defaultSpeed=1.0
|
||||
estbilizationDelay=0
|
||||
maxSpeed=10.0
|
||||
maxValue=10.0
|
||||
minSpeed=0.1
|
||||
minValue=-10.0
|
||||
offset=0.0
|
||||
precision=2
|
||||
resolution=NaN
|
||||
rotation=false
|
||||
scale=1.0
|
||||
unit=mm
|
||||
@@ -0,0 +1,13 @@
|
||||
#Thu Jul 13 11:34:17 CEST 2017
|
||||
defaultSpeed=NaN
|
||||
estbilizationDelay=0
|
||||
maxSpeed=NaN
|
||||
maxValue=NaN
|
||||
minSpeed=NaN
|
||||
minValue=NaN
|
||||
offset=0.0
|
||||
precision=-1
|
||||
resolution=NaN
|
||||
rotation=false
|
||||
scale=1.0
|
||||
unit=null
|
||||
@@ -0,0 +1,13 @@
|
||||
#Thu Jul 13 11:41:31 CEST 2017
|
||||
defaultSpeed=1.0
|
||||
estbilizationDelay=0
|
||||
maxSpeed=10.0
|
||||
maxValue=10.0
|
||||
minSpeed=0.1
|
||||
minValue=-10.0
|
||||
offset=0.0
|
||||
precision=2
|
||||
resolution=NaN
|
||||
rotation=false
|
||||
scale=1.0
|
||||
unit=mm
|
||||
@@ -1,8 +1,9 @@
|
||||
#Tue Apr 11 10:12:57 CEST 2017
|
||||
#Thu Jul 13 12:56:15 CEST 2017
|
||||
maxValue=NaN
|
||||
minValue=NaN
|
||||
offset=0.0
|
||||
precision=-1
|
||||
resolution=NaN
|
||||
rotation=false
|
||||
scale=1.0
|
||||
unit=null
|
||||
@@ -1,5 +1,5 @@
|
||||
#Wed Jun 07 14:12:02 CEST 2017
|
||||
defaultSpeed=282.842712474619
|
||||
#Thu Jul 13 13:13:16 CEST 2017
|
||||
defaultSpeed=6000.0
|
||||
estbilizationDelay=0
|
||||
hasEnable=false
|
||||
homingType=None
|
||||
@@ -10,5 +10,6 @@ minValue=-47600.0
|
||||
offset=0.0
|
||||
precision=1
|
||||
resolution=0.1
|
||||
rotation=false
|
||||
scale=1.0
|
||||
unit=um
|
||||
@@ -1,4 +1,4 @@
|
||||
#Tue Jul 11 14:06:09 CEST 2017
|
||||
#Thu Jul 13 15:35:44 CEST 2017
|
||||
colormap=Flame
|
||||
colormapAutomatic=true
|
||||
colormapMax=578.797
|
||||
@@ -18,9 +18,9 @@ roiY=0
|
||||
rotation=0.0
|
||||
rotationCrop=false
|
||||
scale=1.0
|
||||
spatialCalOffsetX=-633.6028650396007
|
||||
spatialCalOffsetY=-375.4578643259528
|
||||
spatialCalScaleX=-14.14677269345238
|
||||
spatialCalScaleY=-12.708499074710012
|
||||
spatialCalOffsetX=542.4551282051282
|
||||
spatialCalOffsetY=422.17999999999995
|
||||
spatialCalScaleX=1.0
|
||||
spatialCalScaleY=1.0
|
||||
spatialCalUnits=mm
|
||||
transpose=false
|
||||
@@ -1,4 +1,4 @@
|
||||
#Wed Dec 09 13:57:47 CET 2015
|
||||
#Tue Jul 11 15:24:17 CEST 2017
|
||||
defaultSpeed=1.0
|
||||
estbilizationDelay=0
|
||||
maxSpeed=10.0
|
||||
@@ -8,5 +8,6 @@ minValue=-10.0
|
||||
offset=0.0
|
||||
precision=2
|
||||
resolution=NaN
|
||||
rotation=false
|
||||
scale=1.0
|
||||
unit=mm
|
||||
@@ -1,4 +1,4 @@
|
||||
#Wed Dec 09 13:57:47 CET 2015
|
||||
#Tue Jul 11 15:24:17 CEST 2017
|
||||
defaultSpeed=1.0
|
||||
estbilizationDelay=0
|
||||
maxSpeed=10.0
|
||||
@@ -8,5 +8,6 @@ minValue=-10.0
|
||||
offset=0.0
|
||||
precision=2
|
||||
resolution=NaN
|
||||
rotation=false
|
||||
scale=1.0
|
||||
unit=mm
|
||||
@@ -1,8 +1,9 @@
|
||||
#Wed Dec 09 13:57:47 CET 2015
|
||||
#Tue Jul 11 15:24:17 CEST 2017
|
||||
maxValue=1000.0
|
||||
minValue=0.0
|
||||
offset=0.0
|
||||
precision=-1
|
||||
resolution=NaN
|
||||
rotation=false
|
||||
scale=1.0
|
||||
unit=mm
|
||||
@@ -0,0 +1,524 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="2"/>
|
||||
</SyntheticProperties>
|
||||
<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" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel1" max="32767" attributes="0"/>
|
||||
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="jPanel2" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="jPanel3" alignment="0" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="buttonOk" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="buttonCancel" linkSize="2" min="-2" max="-2" attributes="0"/>
|
||||
<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"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="16" 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="Calibrate the camera moving the line overlays to the reference marks."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||
<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="Calibration"/>
|
||||
</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">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel2" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerTop" min="-2" pref="80" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerRefWidth" min="-2" pref="80" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel8" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerBottom" min="-2" pref="80" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerRefHeight" min="-2" pref="80" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel10" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerRight" min="-2" pref="80" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerAngleVer" min="-2" pref="80" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel9" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerLeft" min="-2" pref="80" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerAngleHor" min="-2" pref="80" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="buttonFetch" min="-2" max="-2" 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="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerRefWidth" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerTop" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerRefHeight" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerBottom" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerAngleHor" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerLeft" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerAngleVer" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerRight" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="12" max="32767" attributes="0"/>
|
||||
<Component id="buttonFetch" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Reference marker height (um):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Horizontal camera angle (deg):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Vertical camera angle (deg):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Reference marker width (um):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Top (px):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel8">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Botton (px):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel9">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Left (px):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel10">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="11"/>
|
||||
<Property name="text" type="java.lang.String" value="Right (px):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerAngleHor">
|
||||
<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>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="calibrationSpinnerChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerAngleVer">
|
||||
<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>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="calibrationSpinnerChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerRefWidth">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="30000.0" maximum="500000.0" minimum="1.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="calibrationSpinnerChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerRefHeight">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="30000.0" maximum="500000.0" minimum="1.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="calibrationSpinnerChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerTop">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" maximum="10000" minimum="-10000" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="calibrationSpinnerChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerBottom">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" maximum="10000" minimum="-10000" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="calibrationSpinnerChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerLeft">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" maximum="10000" minimum="-10000" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="calibrationSpinnerChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spinnerRight">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="0" maximum="10000" minimum="-10000" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="calibrationSpinnerChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonFetch">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Fetch from Inventory"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonFetchActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel2">
|
||||
<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="Transformations"/>
|
||||
</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">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="checkMirrorX" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="comboRotation" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="checkMirrorY" min="-2" max="-2" attributes="0"/>
|
||||
<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="0" attributes="0">
|
||||
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
|
||||
<Component id="comboRotation" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="checkMirrorX" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="checkMirrorY" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JCheckBox" name="checkMirrorX">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Mirror X"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="checkMirrorY">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Mirror Y"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="comboRotation">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
||||
<StringArray count="4">
|
||||
<StringItem index="0" value="0"/>
|
||||
<StringItem index="1" value="270"/>
|
||||
<StringItem index="2" value="180"/>
|
||||
<StringItem index="3" value="90"/>
|
||||
</StringArray>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel7">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Rotation: "/>
|
||||
</Properties>
|
||||
</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="Results"/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="21" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel12" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textOriginY" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel11" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textOriginX" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel13" linkSize="4" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textPixelSizeY" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel14" linkSize="4" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textPixelSizeX" min="-2" pref="100" max="-2" 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="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textPixelSizeX" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textPixelSizeY" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textOriginX" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textOriginY" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JLabel" name="jLabel11">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Origin X (px):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textOriginX">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel12">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Origin Y (px):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textOriginY">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel13">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Y pixel size (um/px):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel14">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="X pixel size (um/px):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textPixelSizeX">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textPixelSizeY">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="buttonOk">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Ok"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonOkActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonCancel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Cancel"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCancelActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
@@ -0,0 +1,692 @@
|
||||
|
||||
|
||||
import ch.psi.utils.swing.StandardDialog;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import ch.psi.pshell.bs.Camtool;
|
||||
import ch.psi.pshell.imaging.Overlay;
|
||||
import ch.psi.pshell.imaging.Overlays;
|
||||
import ch.psi.pshell.imaging.Pen;
|
||||
import ch.psi.pshell.imaging.Renderer;
|
||||
import ch.psi.pshell.imaging.RendererListener;
|
||||
import ch.psi.pshell.imaging.RendererMode;
|
||||
import ch.psi.utils.Convert;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.swing.JDialog;
|
||||
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class CameraConfigDialog extends StandardDialog {
|
||||
|
||||
Camtool camera;
|
||||
Renderer renderer;
|
||||
String cameraName;
|
||||
Overlay[] calibrationOverlays;
|
||||
Pen pen = new Pen(new Color(128, 0, 128), 1, Pen.LineStyle.solid);
|
||||
Overlays.Crosshairs ovTop = new Overlays.Crosshairs(pen, new Dimension(-1, 1));
|
||||
Overlays.Crosshairs ovBottom = new Overlays.Crosshairs(pen, new Dimension(-1, 1));
|
||||
Overlays.Crosshairs ovLeft = new Overlays.Crosshairs(pen, new Dimension(1, -1));
|
||||
Overlays.Crosshairs ovRight = new Overlays.Crosshairs(pen, new Dimension(1, -1));
|
||||
|
||||
/**
|
||||
*
|
||||
* {
|
||||
* name=SINEG01-DSCR350,
|
||||
* prefix=SINEG01-DSCR350,
|
||||
* mirror_x=true,
|
||||
* mirror_y=true,
|
||||
* rotate=0,
|
||||
* calibration={
|
||||
* horizontal_camera_angle=0,
|
||||
* vertical_camera_angle=0
|
||||
* reference_marker_width=16000.0,
|
||||
* reference_marker_height=16000.0,
|
||||
* reference_marker=[120, 245, 1251, 1504],
|
||||
* },
|
||||
* }
|
||||
*/
|
||||
public CameraConfigDialog(Frame parent, Camtool camera, Renderer renderer) throws IOException {
|
||||
super(parent, camera.getCurrentCamera(), false);
|
||||
|
||||
initComponents();
|
||||
|
||||
this.camera = camera;
|
||||
this.cameraName = camera.getCurrentCamera();
|
||||
this.renderer = renderer;
|
||||
|
||||
Map<String, Object> config = camera.getConfig(cameraName);
|
||||
Map<String, Object> calibration = (Map<String, Object>) config.get("calibration");
|
||||
List<Integer> refMarker = null;
|
||||
System.out.println("Current config: " + config);
|
||||
checkMirrorX.setSelected((config.get("mirror_x") ==null) ? Boolean.FALSE: (Boolean)config.get("mirror_x"));
|
||||
checkMirrorY.setSelected((config.get("mirror_y") ==null) ? Boolean.FALSE: (Boolean)config.get("mirror_y"));
|
||||
comboRotation.setSelectedIndex((config.get("rotate") == null) ? 0 :(Integer) (config.get("rotate")));
|
||||
if (calibration!=null){
|
||||
spinnerRefWidth.setValue(((Number)calibration.get("reference_marker_width")).doubleValue());
|
||||
spinnerRefHeight.setValue(((Number)calibration.get("reference_marker_height")).doubleValue());
|
||||
spinnerAngleHor.setValue(((Number)calibration.get("horizontal_camera_angle")).doubleValue());
|
||||
spinnerAngleVer.setValue(((Number)calibration.get("vertical_camera_angle")).doubleValue());
|
||||
refMarker = ((List)calibration.get("reference_marker"));
|
||||
if (refMarker.size()==4){
|
||||
spinnerLeft.setValue(refMarker.get(0));
|
||||
spinnerTop.setValue(refMarker.get(1));
|
||||
spinnerRight.setValue(refMarker.get(2));
|
||||
spinnerBottom.setValue(refMarker.get(3));
|
||||
}
|
||||
}
|
||||
updateResults();
|
||||
|
||||
camera.resetRoi();
|
||||
|
||||
|
||||
renderer.setMode(RendererMode.Fit);
|
||||
calibrationOverlays = new Overlay[]{ovTop, ovBottom, ovLeft, ovRight};
|
||||
for (Overlay ov : calibrationOverlays){
|
||||
ov.setMovable(true);
|
||||
}
|
||||
renderer.addOverlays(calibrationOverlays);
|
||||
|
||||
try{
|
||||
Rectangle r = new Rectangle();
|
||||
ovLeft.update(new Point(Math.max(refMarker.get(0), 0), 0));
|
||||
ovTop.update(new Point(0, Math.max(refMarker.get(1), 0)));
|
||||
ovRight.update(new Point(Math.max(refMarker.get(2), 0), 0));
|
||||
ovBottom.update(new Point(0, Math.max(refMarker.get(3),0)));
|
||||
} catch (Exception ex){
|
||||
SwingUtils.invokeDelayed(() -> {
|
||||
Dimension size = renderer.getImageSize();
|
||||
ovTop.update(new Point(0, size.height/8));
|
||||
ovBottom.update(new Point(0, 7*size.height/8));
|
||||
ovLeft.update(new Point(size.width/8, 0));
|
||||
ovRight.update(new Point(7*size.width/8, 0));
|
||||
}, 500);
|
||||
}
|
||||
renderer.addListener(new RendererListener(){
|
||||
@Override
|
||||
public void onMoveFinished(Renderer renderer, Overlay overlay) {
|
||||
if (overlay==ovTop){
|
||||
spinnerTop.setValue(ovTop.getPosition().y);
|
||||
} else if (overlay==ovBottom){
|
||||
spinnerBottom.setValue(ovBottom.getPosition().y);
|
||||
} else if (overlay==ovLeft){
|
||||
spinnerLeft.setValue(ovLeft.getPosition().x);
|
||||
} else if (overlay==ovRight){
|
||||
spinnerRight.setValue(ovRight.getPosition().x);
|
||||
}
|
||||
}
|
||||
});
|
||||
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||
pack();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onClosed() {
|
||||
renderer.removeOverlays(calibrationOverlays);
|
||||
calibrationOverlays = null;
|
||||
}
|
||||
|
||||
|
||||
void updateResults(){
|
||||
try{
|
||||
int left = (Integer)spinnerLeft.getValue();
|
||||
int right = (Integer)spinnerRight.getValue();
|
||||
int top = (Integer)spinnerTop.getValue();
|
||||
int bottom = (Integer)spinnerBottom.getValue();
|
||||
double width = (Double)spinnerRefWidth.getValue();
|
||||
double height = (Double)spinnerRefHeight.getValue();
|
||||
textOriginX.setText(String.valueOf((left+right)/2));
|
||||
textOriginY.setText(String.valueOf((top+bottom)/2));
|
||||
textPixelSizeX.setText(String.valueOf(Convert.roundDouble(width/Math.abs(right-left),2)));
|
||||
textPixelSizeY.setText(String.valueOf(Convert.roundDouble(height/Math.abs(bottom-top),2)));
|
||||
ovLeft.update(new Point(Math.max(left, 0), 0));
|
||||
ovTop.update(new Point(0, Math.max(top, 0)));
|
||||
ovRight.update(new Point(Math.max(right, 0), 0));
|
||||
ovBottom.update(new Point(0, Math.max(bottom,0)));
|
||||
renderer.refresh();
|
||||
|
||||
} catch (Exception ex){
|
||||
SwingUtils.showException(this, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
//String cameraName = "SINEG01-DSCR190";
|
||||
String cameraName = "SATSY02-DSCR220" ;
|
||||
Camtool camtool = new Camtool("Camera", "localhost:10000");
|
||||
camtool.start(cameraName);
|
||||
//java.awt.EventQueue.invokeLater(() -> {
|
||||
Renderer renderer = new Renderer();
|
||||
camtool.addListener(renderer);
|
||||
JDialog dlgRenderer = SwingUtils.showDialog(null, cameraName, new Dimension(600,400), renderer);
|
||||
CameraConfigDialog dialog = new CameraConfigDialog(null, camtool, renderer);
|
||||
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(java.awt.event.WindowEvent e) {
|
||||
dlgRenderer.setVisible(false);
|
||||
camtool.close();
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
SwingUtils.centerComponent(null, dialog);
|
||||
dialog.setVisible(true);
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
jLabel5 = new javax.swing.JLabel();
|
||||
jLabel6 = new javax.swing.JLabel();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
jLabel8 = new javax.swing.JLabel();
|
||||
jLabel9 = new javax.swing.JLabel();
|
||||
jLabel10 = new javax.swing.JLabel();
|
||||
spinnerAngleHor = new javax.swing.JSpinner();
|
||||
spinnerAngleVer = new javax.swing.JSpinner();
|
||||
spinnerRefWidth = new javax.swing.JSpinner();
|
||||
spinnerRefHeight = new javax.swing.JSpinner();
|
||||
spinnerTop = new javax.swing.JSpinner();
|
||||
spinnerBottom = new javax.swing.JSpinner();
|
||||
spinnerLeft = new javax.swing.JSpinner();
|
||||
spinnerRight = new javax.swing.JSpinner();
|
||||
buttonFetch = new javax.swing.JButton();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
checkMirrorX = new javax.swing.JCheckBox();
|
||||
checkMirrorY = new javax.swing.JCheckBox();
|
||||
comboRotation = new javax.swing.JComboBox();
|
||||
jLabel7 = new javax.swing.JLabel();
|
||||
jPanel3 = new javax.swing.JPanel();
|
||||
jLabel11 = new javax.swing.JLabel();
|
||||
textOriginX = new javax.swing.JTextField();
|
||||
jLabel12 = new javax.swing.JLabel();
|
||||
textOriginY = new javax.swing.JTextField();
|
||||
jLabel13 = new javax.swing.JLabel();
|
||||
jLabel14 = new javax.swing.JLabel();
|
||||
textPixelSizeX = new javax.swing.JTextField();
|
||||
textPixelSizeY = new javax.swing.JTextField();
|
||||
buttonOk = new javax.swing.JButton();
|
||||
buttonCancel = new javax.swing.JButton();
|
||||
|
||||
jLabel1.setText("Calibrate the camera moving the line overlays to the reference marks.");
|
||||
|
||||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Calibration"));
|
||||
|
||||
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel4.setText("Reference marker height (um):");
|
||||
|
||||
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel5.setText("Horizontal camera angle (deg):");
|
||||
|
||||
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel6.setText("Vertical camera angle (deg):");
|
||||
|
||||
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel3.setText("Reference marker width (um):");
|
||||
|
||||
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel2.setText("Top (px):");
|
||||
|
||||
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel8.setText("Botton (px):");
|
||||
|
||||
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel9.setText("Left (px):");
|
||||
|
||||
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel10.setText("Right (px):");
|
||||
|
||||
spinnerAngleHor.setModel(new javax.swing.SpinnerNumberModel(0.0d, -360.0d, 360.0d, 1.0d));
|
||||
spinnerAngleHor.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
calibrationSpinnerChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
spinnerAngleVer.setModel(new javax.swing.SpinnerNumberModel(0.0d, -360.0d, 360.0d, 1.0d));
|
||||
spinnerAngleVer.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
calibrationSpinnerChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
spinnerRefWidth.setModel(new javax.swing.SpinnerNumberModel(30000.0d, 1.0d, 500000.0d, 1.0d));
|
||||
spinnerRefWidth.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
calibrationSpinnerChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
spinnerRefHeight.setModel(new javax.swing.SpinnerNumberModel(30000.0d, 1.0d, 500000.0d, 1.0d));
|
||||
spinnerRefHeight.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
calibrationSpinnerChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
spinnerTop.setModel(new javax.swing.SpinnerNumberModel(0, -10000, 10000, 1));
|
||||
spinnerTop.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
calibrationSpinnerChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
spinnerBottom.setModel(new javax.swing.SpinnerNumberModel(0, -10000, 10000, 1));
|
||||
spinnerBottom.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
calibrationSpinnerChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
spinnerLeft.setModel(new javax.swing.SpinnerNumberModel(0, -10000, 10000, 1));
|
||||
spinnerLeft.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
calibrationSpinnerChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
spinnerRight.setModel(new javax.swing.SpinnerNumberModel(0, -10000, 10000, 1));
|
||||
spinnerRight.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
calibrationSpinnerChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonFetch.setText("Fetch from Inventory");
|
||||
buttonFetch.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonFetchActionPerformed(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()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerTop, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel3)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerRefWidth, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(jLabel8)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerBottom, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel4)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerRefHeight, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(jLabel10)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerRight, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel6)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerAngleVer, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(jLabel9)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel5)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerAngleHor, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(buttonFetch)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel10, jLabel2, jLabel8, jLabel9});
|
||||
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(spinnerRefWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerTop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(jLabel8)
|
||||
.addComponent(spinnerRefHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerBottom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(jLabel9)
|
||||
.addComponent(spinnerAngleHor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel6)
|
||||
.addComponent(jLabel10)
|
||||
.addComponent(spinnerAngleVer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerRight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
|
||||
.addComponent(buttonFetch)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Transformations"));
|
||||
|
||||
checkMirrorX.setText("Mirror X");
|
||||
|
||||
checkMirrorY.setText("Mirror Y");
|
||||
|
||||
comboRotation.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "270", "180", "90" }));
|
||||
|
||||
jLabel7.setText("Rotation: ");
|
||||
|
||||
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()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(checkMirrorX)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel7)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(comboRotation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(checkMirrorY)
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(comboRotation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel7))
|
||||
.addComponent(checkMirrorX))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(checkMirrorY)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Results"));
|
||||
|
||||
jLabel11.setText("Origin X (px):");
|
||||
|
||||
textOriginX.setEditable(false);
|
||||
textOriginX.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
|
||||
jLabel12.setText("Origin Y (px):");
|
||||
|
||||
textOriginY.setEditable(false);
|
||||
textOriginY.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
|
||||
jLabel13.setText("Y pixel size (um/px):");
|
||||
|
||||
jLabel14.setText("X pixel size (um/px):");
|
||||
|
||||
textPixelSizeX.setEditable(false);
|
||||
textPixelSizeX.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
|
||||
textPixelSizeY.setEditable(false);
|
||||
textPixelSizeY.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
|
||||
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
|
||||
jPanel3.setLayout(jPanel3Layout);
|
||||
jPanel3Layout.setHorizontalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addComponent(jLabel12)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textOriginY, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addComponent(jLabel11)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textOriginX, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addComponent(jLabel13)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textPixelSizeY, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addComponent(jLabel14)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textPixelSizeX, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel11, jLabel12});
|
||||
|
||||
jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel13, jLabel14});
|
||||
|
||||
jPanel3Layout.setVerticalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel14)
|
||||
.addComponent(textPixelSizeX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel13)
|
||||
.addComponent(textPixelSizeY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel11)
|
||||
.addComponent(textOriginX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel12)
|
||||
.addComponent(textOriginY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
buttonOk.setText("Ok");
|
||||
buttonOk.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonOkActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonCancel.setText("Cancel");
|
||||
buttonCancel.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonCancelActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel1, 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)
|
||||
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(buttonOk)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(buttonCancel)
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonCancel, buttonOk});
|
||||
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jPanel2, 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(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonOk)
|
||||
.addComponent(buttonCancel))
|
||||
.addContainerGap(16, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void buttonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOkActionPerformed
|
||||
|
||||
try {
|
||||
//renderer.removeOverlays(calibrationOverlays);
|
||||
//calibrationOverlays = null;
|
||||
//calibrationDialolg = null;
|
||||
|
||||
int left = (Integer)spinnerLeft.getValue(); //left.getPosition().x
|
||||
int right = (Integer)spinnerRight.getValue(); //right.getPosition().x
|
||||
int top = (Integer)spinnerTop.getValue(); //top.getPosition().y
|
||||
int bottom = (Integer)spinnerBottom.getValue(); //bottom.getPosition().y
|
||||
double width = (Double)spinnerRefWidth.getValue();
|
||||
double height = (Double)spinnerRefHeight.getValue();
|
||||
double angleHor = (Double)spinnerAngleHor.getValue();
|
||||
double angleVer = (Double)spinnerAngleVer.getValue();
|
||||
|
||||
int x1 = Math.min(left, right);
|
||||
int x2 = Math.max(left, right);
|
||||
int y1 = Math.min(top, bottom);
|
||||
int y2 = Math.max(top, bottom);
|
||||
if ((x1!=-1) && (x2!=-1) && (y1!=-1) && (y2!=-1)){
|
||||
System.out.println("Updating " + cameraName + " configuration");
|
||||
HashMap calibration = new HashMap();
|
||||
calibration.put("reference_marker", Arrays.asList(new Integer[]{x1, y1, x2, y2}));
|
||||
calibration.put("reference_marker_width", width);
|
||||
calibration.put("reference_marker_height", height);
|
||||
calibration.put("horizontal_camera_angle", angleHor);
|
||||
calibration.put("vertical_camera_angle", angleVer);
|
||||
//((Camtool) camera).setCalibration(cameraName, calibration);
|
||||
|
||||
HashMap config = new HashMap();
|
||||
config.put("calibration", calibration);
|
||||
config.put("mirror_x", checkMirrorX.isSelected());
|
||||
config.put("mirror_y", checkMirrorY.isSelected());
|
||||
config.put("rotate", comboRotation.getSelectedIndex());
|
||||
((Camtool) camera).setConfig(cameraName, config);
|
||||
|
||||
System.out.println("New config: " + config);
|
||||
SwingUtils.showMessage(this, "Success", "Updated " + cameraName + " configuration");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
SwingUtils.showException(this, ex);
|
||||
}
|
||||
|
||||
accept();
|
||||
}//GEN-LAST:event_buttonOkActionPerformed
|
||||
|
||||
private void buttonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCancelActionPerformed
|
||||
cancel();
|
||||
}//GEN-LAST:event_buttonCancelActionPerformed
|
||||
|
||||
private void buttonFetchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonFetchActionPerformed
|
||||
try{
|
||||
//List<Double> calib = Inventory.getCalibFromInventory(null, cameraName);
|
||||
List<Double> calib = (List<Double>) Class.forName("Inventory").
|
||||
getMethod("getCalibFromInventory",
|
||||
new Class[]{String.class,String.class}).
|
||||
invoke(null, new Object[]{(String)null, cameraName});
|
||||
spinnerRefWidth.setValue(calib.get(0)*1000.0);
|
||||
spinnerRefHeight.setValue(calib.get(1)*1000.0);
|
||||
spinnerAngleHor.setValue(calib.get(2).intValue());
|
||||
spinnerAngleVer.setValue(calib.get(3).intValue());
|
||||
} catch (Exception ex){
|
||||
if (ex instanceof InvocationTargetException){
|
||||
ex = (Exception) ((InvocationTargetException)ex).getCause();
|
||||
}
|
||||
SwingUtils.showException(this, ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonFetchActionPerformed
|
||||
|
||||
private void calibrationSpinnerChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_calibrationSpinnerChanged
|
||||
updateResults();
|
||||
}//GEN-LAST:event_calibrationSpinnerChanged
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonCancel;
|
||||
private javax.swing.JButton buttonFetch;
|
||||
private javax.swing.JButton buttonOk;
|
||||
private javax.swing.JCheckBox checkMirrorX;
|
||||
private javax.swing.JCheckBox checkMirrorY;
|
||||
private javax.swing.JComboBox comboRotation;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel10;
|
||||
private javax.swing.JLabel jLabel11;
|
||||
private javax.swing.JLabel jLabel12;
|
||||
private javax.swing.JLabel jLabel13;
|
||||
private javax.swing.JLabel jLabel14;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
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.JPanel jPanel1;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JPanel jPanel3;
|
||||
private javax.swing.JSpinner spinnerAngleHor;
|
||||
private javax.swing.JSpinner spinnerAngleVer;
|
||||
private javax.swing.JSpinner spinnerBottom;
|
||||
private javax.swing.JSpinner spinnerLeft;
|
||||
private javax.swing.JSpinner spinnerRefHeight;
|
||||
private javax.swing.JSpinner spinnerRefWidth;
|
||||
private javax.swing.JSpinner spinnerRight;
|
||||
private javax.swing.JSpinner spinnerTop;
|
||||
private javax.swing.JTextField textOriginX;
|
||||
private javax.swing.JTextField textOriginY;
|
||||
private javax.swing.JTextField textPixelSizeX;
|
||||
private javax.swing.JTextField textPixelSizeY;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
</Form>
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author gobbo_a
|
||||
*/
|
||||
public class CameraConfigPanel extends javax.swing.JPanel {
|
||||
|
||||
/**
|
||||
* Creates new form CameraConfigPanel
|
||||
*/
|
||||
public CameraConfigPanel() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 400, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 300, Short.MAX_VALUE)
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
@@ -421,7 +421,7 @@ public class Cameras extends Panel {
|
||||
int profileSize = Math.min(data.getWidth(), data.getHeight())/4;
|
||||
|
||||
try {
|
||||
double[] sum = (double[]) Convert.toDouble(data.integrateVertically());
|
||||
double[] sum = (double[]) Convert.toDouble(data.integrateVertically(true));
|
||||
int[] x = Arr.indexesInt(sum.length);
|
||||
DescriptiveStatistics stats = new DescriptiveStatistics(sum);
|
||||
double min = stats.getMin();
|
||||
@@ -449,7 +449,7 @@ public class Cameras extends Panel {
|
||||
}
|
||||
|
||||
try {
|
||||
double[] sum = (double[]) Convert.toDouble(data.integrateHorizontally());
|
||||
double[] sum = (double[]) Convert.toDouble(data.integrateHorizontally(true));
|
||||
int[] x = Arr.indexesInt(sum.length);
|
||||
DescriptiveStatistics stats = new DescriptiveStatistics(sum);
|
||||
double min = stats.getMin();
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" 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"/>
|
||||
@@ -162,7 +161,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="5.0" maximum="90.0" minimum="1.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
<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]"/>
|
||||
@@ -177,7 +176,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="-180.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
<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]"/>
|
||||
@@ -192,7 +191,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.0" maximum="50.0" minimum="1.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
<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]"/>
|
||||
@@ -217,7 +216,7 @@
|
||||
<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="-180.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
<SpinnerModel initial="180.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]"/>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
import ch.psi.pshell.plot.LinePlotJFree;
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
@@ -16,6 +17,7 @@ public class GunScan extends Panel {
|
||||
public GunScan() {
|
||||
initComponents();
|
||||
setPersistedComponents(SwingUtils.getComponentsByType(panelScanPars, JSpinner.class));
|
||||
plot.setStyle(LinePlotJFree.Style.ErrorY);
|
||||
}
|
||||
|
||||
//Overridable callbacks
|
||||
@@ -32,6 +34,8 @@ public class GunScan extends Panel {
|
||||
spinnerStep.setEnabled(buttonStart.isEnabled());
|
||||
spinnerSamples.setEnabled(buttonStart.isEnabled());
|
||||
spinnerLatency.setEnabled(buttonStart.isEnabled());
|
||||
spinnerDispersion.setEnabled(buttonStart.isEnabled());
|
||||
spinnerEnergy.setEnabled(buttonStart.isEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,17 +79,17 @@ public class GunScan extends Panel {
|
||||
|
||||
labelStop.setText("Stop:");
|
||||
|
||||
spinnerStep.setModel(new javax.swing.SpinnerNumberModel(5.0d, 1.0d, 90.0d, 1.0d));
|
||||
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:");
|
||||
|
||||
spinnerStart.setModel(new javax.swing.SpinnerNumberModel(0.0d, -180.0d, 360.0d, 1.0d));
|
||||
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.0d, 1.0d, 50.0d, 1.0d));
|
||||
spinnerSamples.setModel(new javax.swing.SpinnerNumberModel(1, 1, 50, 1));
|
||||
spinnerSamples.setPreferredSize(new java.awt.Dimension(64, 20));
|
||||
|
||||
labelLatency.setText("Latency:");
|
||||
@@ -93,7 +97,7 @@ public class GunScan extends Panel {
|
||||
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, -180.0d, 360.0d, 1.0d));
|
||||
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));
|
||||
|
||||
@@ -224,7 +228,6 @@ public class GunScan extends Panel {
|
||||
.addComponent(panelBeamPars, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonStart)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonAbort)
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* Copyright (c) 2014 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
import ch.psi.pshell.core.JsonSerializer;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.client.Client;
|
||||
import javax.ws.rs.client.ClientBuilder;
|
||||
import javax.ws.rs.client.Entity;
|
||||
import javax.ws.rs.client.WebTarget;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.glassfish.jersey.client.ClientConfig;
|
||||
import org.glassfish.jersey.jackson.JacksonFeature;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class Inventory {
|
||||
|
||||
public static <T> T inventoryRequest(String url, Map attributes, Class<T> type) throws IOException {
|
||||
String json = JsonSerializer.encode(attributes);
|
||||
Client client = ClientBuilder.newClient(new ClientConfig().register(JacksonFeature.class));
|
||||
try {
|
||||
WebTarget resource = client.target(url);
|
||||
Response r = resource.request().accept(MediaType.TEXT_HTML).post(Entity.json(json));
|
||||
json = r.readEntity(String.class);
|
||||
if (r.getStatus() != Response.Status.OK.getStatusCode()) {
|
||||
throw new IOException("Inventory returned error: " + json);
|
||||
}
|
||||
Map ret = (Map) JsonSerializer.decode(json, Map.class);
|
||||
return (T) ret.get("d");
|
||||
} finally {
|
||||
client.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static String findPartidByHoly(String holy_name, String type) throws IOException {
|
||||
if (type == null) {
|
||||
type = "DSCR";
|
||||
}
|
||||
Map query = new HashMap();
|
||||
Map qn = new HashMap();
|
||||
Map qt = new HashMap();
|
||||
qn.put("Field", "Holy List Name");
|
||||
qn.put("Operator", "Is");
|
||||
qn.put("Value", holy_name);
|
||||
qt.put("Field", "Type");
|
||||
qt.put("Operator", "Is");
|
||||
qt.put("Value", type);
|
||||
query.put("query", Arrays.asList(new Map[]{qn, qt}));
|
||||
query.put("columns", Arrays.asList(new String[]{"Label"}));
|
||||
|
||||
Map attr = new HashMap();
|
||||
attr.put("search", query);
|
||||
Map ret = (Map) inventoryRequest("https://inventory.psi.ch/DataAccess.asmx/FindObjects", attr, Map.class);
|
||||
try {
|
||||
return (String) ((List) (((List) ret.get("Rows")).get(0))).get(0);
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static List findAllByType(String type, String column) throws IOException {
|
||||
if (type == null) {
|
||||
type = "DSCR";
|
||||
}
|
||||
if (column == null) {
|
||||
column = "Holy List Name";
|
||||
}
|
||||
|
||||
Map query = new HashMap();
|
||||
Map q = new HashMap();
|
||||
q.put("Field", "Type");
|
||||
q.put("Operator", "Is");
|
||||
q.put("Value", type);
|
||||
query.put("query", Arrays.asList(new Map[]{q}));
|
||||
query.put("columns", Arrays.asList(new String[]{"Label"}));
|
||||
|
||||
Map attr = new HashMap();
|
||||
attr.put("search", query);
|
||||
Map r = (Map) inventoryRequest("https://inventory.psi.ch/DataAccess.asmx/FindObjects", attr, Map.class);
|
||||
List rows = (List) (r.get("Rows"));
|
||||
List ret = new ArrayList();
|
||||
for (Object list : rows) {
|
||||
ret.add(((List) list).get(0));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static List<Map> getPartAttributesFromInventory(String part_label, String holy_name) throws IOException {
|
||||
if ((holy_name != null) && !holy_name.isEmpty()) {
|
||||
part_label = findPartidByHoly(holy_name, "DSCR");
|
||||
if ((part_label == null) || part_label.isEmpty()) {
|
||||
throw new IOException("Could not find inventory part for: " + holy_name);
|
||||
}
|
||||
}
|
||||
Map map = new HashMap();
|
||||
map.put("psiLabel", part_label);
|
||||
return (List) inventoryRequest("https://inventory.psi.ch/DataAccess.asmx/GetPartAttributes", map, List.class);
|
||||
}
|
||||
|
||||
public static List<Double> getCalibFromInventory(String part_label, String holy_name) throws IOException {
|
||||
double horizontal_dist = 0.0;
|
||||
double vertical_dist = 0.0;
|
||||
double horizontal_tilt = 0.0;
|
||||
double vertical_tilt = 0.0;
|
||||
|
||||
List<Map> attributes = getPartAttributesFromInventory(part_label, holy_name);
|
||||
|
||||
for (Map a : attributes) {
|
||||
String name = (String) a.get("Name");
|
||||
Double val = 0.0;
|
||||
try {
|
||||
val = Double.valueOf(a.get("Value").toString());
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
|
||||
switch (name) {
|
||||
case "Crystal angle in x (e-beam system) [deg]":
|
||||
horizontal_tilt = val;
|
||||
break;
|
||||
case "Crystal angle in y (e-beam system) [deg]":
|
||||
vertical_tilt = val;
|
||||
break;
|
||||
case "Mark distance in x (e-beam system) [mm]":
|
||||
horizontal_dist = val;
|
||||
break;
|
||||
case "Mark distance in y (e-beam system) [mm]":
|
||||
vertical_dist = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return Arrays.asList(new Double[]{horizontal_dist, vertical_dist, horizontal_tilt, vertical_tilt});
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
System.out.println(getCalibFromInventory("SINEG01-DSCR190", "SINEG01-DSCR190"));
|
||||
System.out.println(findAllByType(null, null));
|
||||
}
|
||||
}
|
||||
+25
-109
@@ -27,6 +27,7 @@ import ch.psi.pshell.ui.App;
|
||||
import ch.psi.pshell.imaging.Data;
|
||||
import ch.psi.pshell.imaging.DimensionDouble;
|
||||
import ch.psi.pshell.imaging.Histogram;
|
||||
import ch.psi.pshell.imaging.ImageBuffer;
|
||||
import ch.psi.pshell.imaging.Overlay;
|
||||
import ch.psi.pshell.imaging.Overlays;
|
||||
import ch.psi.pshell.imaging.Overlays.Text;
|
||||
@@ -47,6 +48,7 @@ import ch.psi.utils.TcpClient;
|
||||
import ch.psi.utils.swing.Editor.EditorDialog;
|
||||
import ch.psi.utils.swing.MainFrame;
|
||||
import ch.psi.utils.swing.StandardDialog;
|
||||
import ch.psi.utils.swing.StandardDialog.StandardDialogListener;
|
||||
import ch.psi.utils.swing.SwingUtils.OptionResult;
|
||||
import ch.psi.utils.swing.SwingUtils.OptionType;
|
||||
import java.awt.BorderLayout;
|
||||
@@ -281,6 +283,7 @@ public class ScreenPanel extends Panel {
|
||||
try {
|
||||
calibrate();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
showException(ex);
|
||||
}
|
||||
});
|
||||
@@ -363,7 +366,7 @@ public class ScreenPanel extends Panel {
|
||||
menuSetROI.setEnabled(camera instanceof Camtool);
|
||||
menuShowImageData.setVisible(camera instanceof Camtool);
|
||||
menuCalibrate.setVisible(camera instanceof Camtool);
|
||||
menuCalibrate.setEnabled(calibrationOverlays==null);
|
||||
menuCalibrate.setEnabled((calibrationDialolg==null) || (!calibrationDialolg.isShowing()) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1020,8 +1023,8 @@ public class ScreenPanel extends Panel {
|
||||
checkHistogram.setSelected((histogramDialog != null) && (histogramDialog.isShowing()));
|
||||
}
|
||||
|
||||
Pen penFit = new Pen(new Color(192, 105, 0), 1);
|
||||
Pen penCross = new Pen(new Color(192, 105, 0), 1);
|
||||
Pen penFit = new Pen(new Color(192, 105, 0), 0);
|
||||
Pen penCross = new Pen(new Color(192, 105, 0), 0);
|
||||
|
||||
|
||||
Frame getCurrentFrame(){
|
||||
@@ -1626,7 +1629,9 @@ public class ScreenPanel extends Panel {
|
||||
//Enforce the same timestamp to data & image files.
|
||||
//snapshotFile = getContext().getSetup().expandPath("{images}/{date}_{time}_snapshot.png", getContext().getExecutionPars().getStart());
|
||||
snapshotFile = getContext().getExecutionPars().getPath() + ".png";
|
||||
renderer.saveSnapshot(snapshotFile, "png", true);
|
||||
//renderer.saveSnapshot(snapshotFile, "png", true);
|
||||
ImageBuffer.saveImage(SwingUtils.createImage(renderer), snapshotFile, "png");
|
||||
|
||||
}
|
||||
|
||||
JPanel panel = new JPanel();
|
||||
@@ -1691,112 +1696,23 @@ public class ScreenPanel extends Panel {
|
||||
SwingUtils.showMessage(getTopLevel(), "Success", "Generated data file:\n" + getContext().getExecutionPars().getPath(), 5000);
|
||||
}
|
||||
|
||||
JDialog calibrationDialolg;
|
||||
Overlay[] calibrationOverlays;
|
||||
void calibrate() throws IOException{
|
||||
if ( (camera instanceof Camtool) && (calibrationOverlays==null)) {
|
||||
Map<String, Object> calibration = ((Camtool) camera).getCalibration(cameraName);
|
||||
//Map<String, Object> calibration = (Map<String, Object>) ((Camtool) camera).getConfig(cameraName).get("calibration");
|
||||
((Camtool) camera).resetRoi();
|
||||
renderer.setMode(RendererMode.Fit);
|
||||
Pen pen = new Pen(new Color(128, 0, 128), 1, Pen.LineStyle.solid);
|
||||
Overlays.Crosshairs top = new Overlays.Crosshairs(pen, new Dimension(-1, 1));
|
||||
Overlays.Crosshairs bottom = new Overlays.Crosshairs(pen, new Dimension(-1, 1));
|
||||
Overlays.Crosshairs left = new Overlays.Crosshairs(pen, new Dimension(1, -1));
|
||||
Overlays.Crosshairs right = new Overlays.Crosshairs(pen, new Dimension(1, -1));
|
||||
calibrationOverlays = new Overlay[]{top, bottom, left, right};
|
||||
for (Overlay ov : calibrationOverlays){
|
||||
ov.setMovable(true);
|
||||
}
|
||||
renderer.addOverlays(calibrationOverlays);
|
||||
|
||||
try{
|
||||
List refMarker = ((List)calibration.get("reference_marker"));
|
||||
Rectangle r = new Rectangle();
|
||||
left.update(new Point(Math.max((Integer)refMarker.get(0), 0), 0));
|
||||
top.update(new Point(0, Math.max((Integer)refMarker.get(1), 0)));
|
||||
right.update(new Point(Math.max((Integer)refMarker.get(2), 0), 0));
|
||||
bottom.update(new Point(0, Math.max((Integer)refMarker.get(3),0)));
|
||||
} catch (Exception ex){
|
||||
SwingUtils.invokeDelayed(() -> {
|
||||
Dimension size = renderer.getImageSize();
|
||||
top.update(new Point(0, size.height/8));
|
||||
bottom.update(new Point(0, 7*size.height/8));
|
||||
left.update(new Point(size.width/8, 0));
|
||||
right.update(new Point(7*size.width/8, 0));
|
||||
}, 500);
|
||||
}
|
||||
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
JTextField textWidth = new JTextField();
|
||||
JTextField textHeight= new JTextField();
|
||||
if (calibration!=null){
|
||||
textWidth.setText(String.valueOf(calibration.get("reference_marker_width")));
|
||||
textHeight.setText(String.valueOf(calibration.get("reference_marker_height")));
|
||||
}
|
||||
((BorderLayout) panel.getLayout()).setVgap(10);
|
||||
JPanel p1 = new JPanel(new BorderLayout());
|
||||
((BorderLayout) p1.getLayout()).setHgap(5);
|
||||
p1.add(new JLabel("Move the lines to the reference marks"), BorderLayout.NORTH);
|
||||
p1.add(new JLabel("and press 'OK' to update the calibration."), BorderLayout.SOUTH);
|
||||
panel.add(p1, BorderLayout.NORTH);
|
||||
JPanel p2 = new JPanel(new BorderLayout());
|
||||
((BorderLayout) p2.getLayout()).setHgap(5);
|
||||
p2.add(new JLabel("Reference marker width (um): "), BorderLayout.WEST);
|
||||
p2.add(textWidth, BorderLayout.EAST);
|
||||
panel.add(p2, BorderLayout.CENTER);
|
||||
JPanel p3 = new JPanel(new BorderLayout());
|
||||
((BorderLayout) p3.getLayout()).setHgap(5);
|
||||
p3.add(new JLabel("Reference marker height(um): "), BorderLayout.WEST);
|
||||
p3.add(textHeight, BorderLayout.EAST);
|
||||
panel.add(p3, BorderLayout.SOUTH);
|
||||
textWidth.setPreferredSize(new Dimension(70, textWidth.getPreferredSize().height));
|
||||
textHeight.setPreferredSize(new Dimension(70, textHeight.getPreferredSize().height));
|
||||
|
||||
JOptionPane calibrationMessage = new JOptionPane(panel,JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null,null, null);
|
||||
calibrationDialolg = calibrationMessage.createDialog(getTopLevel(), "Calibration");
|
||||
calibrationDialolg.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||
calibrationDialolg.setModal(false);
|
||||
calibrationDialolg.addWindowListener(new java.awt.event.WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
if (calibrationOverlays!=null){
|
||||
try {
|
||||
renderer.removeOverlays(calibrationOverlays);
|
||||
calibrationOverlays = null;
|
||||
calibrationDialolg = null;
|
||||
if ((calibrationMessage.getValue()!=null) && calibrationMessage.getValue().equals(0)){ //If pressed OK
|
||||
int x1 = Math.min(left.getPosition().x, right.getPosition().x);
|
||||
int x2 = Math.max(left.getPosition().x, right.getPosition().x);
|
||||
int y1 = Math.min(top.getPosition().y, bottom.getPosition().y);
|
||||
int y2 = Math.max(top.getPosition().y, bottom.getPosition().y);
|
||||
if ((x1!=-1) && (x2!=-1) && (y1!=-1) && (y2!=-1)){
|
||||
System.out.println("Updating " + cameraName + " calibration: " + x1 + ", "+ x2 + ", " + y1 + ", " + y2);
|
||||
HashMap c = new HashMap();
|
||||
c.put("reference_marker", Arrays.asList(new Integer[]{x1, y1, x2, y2}));
|
||||
if (textWidth.getText().trim().length() > 0){
|
||||
c.put("reference_marker_width", Double.valueOf(textWidth.getText()));
|
||||
}
|
||||
if (textHeight.getText().trim().length() > 0){
|
||||
c.put("reference_marker_height", Double.valueOf(textHeight.getText()));
|
||||
}
|
||||
((Camtool) camera).setCalibration(cameraName, c);
|
||||
Logger.getLogger(ScreenPanel.class.getName()).warning("Updated " + cameraName + " calibration: " + x1 + ", "+ x2 + ", " + y1 + ", " + y2);
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(ScreenPanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void windowDeactivated(java.awt.event.WindowEvent e) {
|
||||
if (!calibrationDialolg.isShowing()){ //windowClosed is not called if window closed with ok/cancel
|
||||
windowClosed(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
StandardDialog calibrationDialolg;
|
||||
void calibrate() throws Exception{
|
||||
if (camera instanceof Camtool){
|
||||
calibrationDialolg = (StandardDialog) getContext().getClassByName("CameraConfigDialog").getConstructors()[0].newInstance(new Object[]{getTopLevel(), camera, renderer});
|
||||
SwingUtils.centerComponent(this, calibrationDialolg);
|
||||
calibrationDialolg.setVisible(true);
|
||||
calibrationDialolg.setListener(new StandardDialogListener() {
|
||||
@Override
|
||||
public void onWindowOpened(StandardDialog dlg) {
|
||||
}
|
||||
@Override
|
||||
public void onWindowClosed(StandardDialog dlg, boolean accepted) {
|
||||
if (accepted){
|
||||
comboCamerasActionPerformed(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import ch.psi.pshell.epics.Motor
|
||||
|
||||
prefix = "SINDI02-DLAC055:"
|
||||
print caget (prefix + "MOTOR_Y1")
|
||||
for i in range(7):
|
||||
print prefix + "P" + str(i) + "_U0_SP"
|
||||
print caget (prefix + "P" + str(i) + "_U0_SP")
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
DBPM = 1
|
||||
DWSC = 2
|
||||
DBLM = 3
|
||||
DLAC = 4
|
||||
|
||||
elements = (
|
||||
(DBPM, "SINEG01-DBPM340", 3.0149),
|
||||
@@ -29,10 +30,11 @@ elements = (
|
||||
(DBPM, "SINBC02-DBPM320", 77.5610),
|
||||
(DBPM, "SINDI01-DBPM010", 82.0967),
|
||||
(DBPM, "SINDI01-DBPM060", 83.5117),
|
||||
(DWSC, "SINDI01-DWSC090", 84.2537),
|
||||
(DWSC, "SINDI01-DWSC090", 84.2537),
|
||||
(DBPM, "SINDI02-DBPM010", 86.0767),
|
||||
(DBLM, "SINDI02-DBLM025", 86.862),
|
||||
(DBPM, "SINDI02-DBPM040", 88.3857),
|
||||
(DLAC, "SINDI02-DLAC0550", 89.05),
|
||||
(DBPM, "SINDI02-DBPM080", 90.6297),
|
||||
(DBLM, "SINDI02-DBLM085", 90.7796),
|
||||
(DBPM, "S10CB01-DBPM220", 95.3947),
|
||||
@@ -247,6 +249,13 @@ def get_wire_scanners():
|
||||
ret.append(element[1])
|
||||
return ret
|
||||
|
||||
def get_dlacs():
|
||||
ret = []
|
||||
for element in elements:
|
||||
if element[0]==DLAC:
|
||||
ret.append(element[1])
|
||||
return ret
|
||||
|
||||
def get_wire_scanners_bpms(wire_scan):
|
||||
last = None
|
||||
ret = []
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
import traceback
|
||||
|
||||
is_panel = get_exec_pars().source != CommandSource.ui #Must be checked before callin "run"
|
||||
DLAC_POSITIONS = ["RF_shield", "Mirror1", "Mirror2", "Shrom1", "Shrom2", "Shrom3", "Shrom4"]
|
||||
#IN_POSITION = 0.01
|
||||
dry_run = False
|
||||
|
||||
run("Devices/Elements")
|
||||
run("Diagnostics/sig_process_wrapper")
|
||||
|
||||
BPM_SENSORS = [("x","X1"), ("y","Y1"), ("q","Q1")] #(logic name sufix, channel sufix)
|
||||
TRAVEL_SPEED = 1.0
|
||||
|
||||
#Paramter parsing
|
||||
prefix = args[0] if is_panel else "SINDI02-DLAC055"
|
||||
scan_type = args[1] if is_panel else "Shrom1"
|
||||
scan_range = args[2] if is_panel else [-0.5, 0.5]
|
||||
cycles = args[3] if is_panel else 3
|
||||
velocity = args[4] if is_panel else 0.1
|
||||
bpms = args[5] if is_panel else ["SINDI02-DBPM040", "SINDI02-DBPM080"]
|
||||
blms = args[6] if is_panel else ["SINDI02-DBLM085", "S10DI01-DBLM045"]
|
||||
bkgrd = args[7] if is_panel else 0 #Number of beam synchronous messages
|
||||
plt = args[8] if is_panel else plot(None, title = "DLAC Scan")[0]
|
||||
do_elog = True if is_panel else False
|
||||
print "DLAC scan parameters: ", prefix, scan_type, scan_range, cycles, velocity, bpms, blms, bkgrd
|
||||
|
||||
|
||||
scan_type_index = DLAC_POSITIONS.index(scan_type)
|
||||
if scan_type_index<0:
|
||||
raise Exception("Bad sample position name")
|
||||
|
||||
#Plot setup
|
||||
plt.clear()
|
||||
plt.removeMarker(None)
|
||||
plt.getAxis(plt.AxisId.X).setLabel("Position");
|
||||
plt.getAxis(plt.AxisId.Y).setLabel("");
|
||||
plt.getAxis(plt.AxisId.Y2).setLabel("");
|
||||
plt.setLegendVisible(True);
|
||||
snapshots = []
|
||||
|
||||
|
||||
#Motor
|
||||
if dry_run:
|
||||
motor = DummyMotor("SimMotor")
|
||||
motor.config.defaultSpeed = 10.0
|
||||
motor.config.maxSpeed = TRAVEL_SPEED
|
||||
motor.config.maxValue = 1000.0
|
||||
else:
|
||||
motor = ch.psi.pshell.epics.Motor("DLAC motor", prefix + ":MOTOR_Y1")
|
||||
motor.monitored = True
|
||||
motor.initialize()
|
||||
add_device(motor, True)
|
||||
motor.setSpeed(TRAVEL_SPEED)
|
||||
park_pos = caget (prefix + ":P0_U0_SP")
|
||||
center_pos = caget (prefix + ":P" + str(scan_type_index) + "_U0_SP")
|
||||
|
||||
|
||||
#List of stream channels
|
||||
channels = [] #[("m_pos", scanner.motor_bs_readback.get_name()), ]
|
||||
for i in range (len(blms)):
|
||||
channels.append (("blm" + str(i+1), blms[i] + ":B1_LOSS"))
|
||||
series = LinePlotSeries(blms[i], None, min(i+1, 2))
|
||||
plt.addSeries(series)
|
||||
series.setLinesVisible(False)
|
||||
series.setPointSize(2)
|
||||
for i in range (len(bpms)):
|
||||
for sensor in BPM_SENSORS:
|
||||
channels.append (("bpm" + str(i+1) + "_" + sensor[0], bpms[i] + ":" + sensor[1]))
|
||||
|
||||
#Metadata
|
||||
set_attribute("/", "DLAC Scanner", prefix)
|
||||
set_attribute("/", "Sample", scan_type)
|
||||
set_attribute("/", "Range", scan_range)
|
||||
set_attribute("/", "Cycles", cycles)
|
||||
set_attribute("/", "Velocity", velocity)
|
||||
set_attribute("/", "Background Measures", bkgrd)
|
||||
set_attribute("/", "BPMs", bpms)
|
||||
set_attribute("/", "BLMs", blms)
|
||||
|
||||
filename = get_exec_pars().path
|
||||
|
||||
#Stream creation
|
||||
print "Starting stream..."
|
||||
st = Stream("pulse_id", dispatcher)
|
||||
for c in channels:
|
||||
st.addScalar(c[0], c[1], 10, 0)
|
||||
st.initialize()
|
||||
st.start()
|
||||
st.waitCacheChange(10000) #Wait stream be running before starting scan
|
||||
if st.take() is None:
|
||||
raise Exception("Error initializing data stream")
|
||||
start = st.take().timestamp
|
||||
|
||||
|
||||
#Scan callback
|
||||
scan_complete, cur_cycle = False, 0
|
||||
destination = None
|
||||
def check_end_scan(record, scan):
|
||||
global scan_complete, start, destination
|
||||
#if motor.ready:
|
||||
if motor.isInPosition(destination):
|
||||
print "Data aquisition completed"
|
||||
scan_complete=True
|
||||
scan.abort()
|
||||
record.cancel() #So it won't be saved
|
||||
else:
|
||||
position = float( rec[0].timestamp - start )
|
||||
for i in range (len(blms)):
|
||||
plt.getSeries(i).appendData(position, record[1 + i])
|
||||
|
||||
|
||||
|
||||
#Process background
|
||||
def do_background():
|
||||
#Store Background
|
||||
if bkgrd>0:
|
||||
motor.move(park_pos)
|
||||
time.sleep(0.1)
|
||||
set_exec_pars(group = "background")
|
||||
r = mscan (st, st.getReadables()[4:], bkgrd)
|
||||
for i in range(len(r.getReadables())):
|
||||
d = r.getReadable(i)
|
||||
path = get_exec_pars().group + "/"+ r.getReadables()[i].name
|
||||
set_attribute(path, "Mean", mean(d))
|
||||
set_attribute(path, "Sigma", stdev(d) )
|
||||
|
||||
motor.move(center_pos + scan_range[0] )
|
||||
motor.setSpeed(velocity)
|
||||
|
||||
msg = ""
|
||||
|
||||
print "Starting scan..."
|
||||
try:
|
||||
do_background()
|
||||
|
||||
#plt.getAxis(plt.AxisId.X).setRange(scan_range[0], scan_range[1])
|
||||
for s in plt.getAllSeries():
|
||||
s.clear()
|
||||
plt.removeMarker(None)
|
||||
for i in range(cycles):
|
||||
scan_complete=False
|
||||
try:
|
||||
cur_cycle = i+1
|
||||
set_exec_pars(group="Cycle_" + str(cur_cycle), reset=True)
|
||||
motor.setSpeed(TRAVEL_SPEED)
|
||||
motor.move(center_pos + scan_range[0] )
|
||||
motor.setSpeed(velocity)
|
||||
destination = center_pos + scan_range[1]
|
||||
motor.moveAsync(destination)
|
||||
|
||||
#if (i%2) == 0:
|
||||
# motor.moveAsync(center_pos + scan_range[1])
|
||||
#else:
|
||||
# motor.moveAsync(center_pos + scan_range[0])
|
||||
start = st.take().timestamp
|
||||
mscan (st, st.getReadables() , -1, -1, take_initial = True, after_read = check_end_scan)
|
||||
except:
|
||||
print "Quit scan"
|
||||
if not scan_complete:
|
||||
raise
|
||||
print "Scan complete"
|
||||
"""
|
||||
finally:
|
||||
#Combining data of multiple series
|
||||
calculate()
|
||||
img_file = os.path.abspath(filename + "_" + get_exec_pars().group[0:1] + ".png")
|
||||
time.sleep(0.1) #Give some time to plot finish (async)
|
||||
plt.saveSnapshot(img_file, "png")
|
||||
snapshots.append(img_file)
|
||||
"""
|
||||
|
||||
finally:
|
||||
print "Closing stream"
|
||||
st.close()
|
||||
|
||||
print msg
|
||||
|
||||
# save the entry in the logbook
|
||||
if do_elog:
|
||||
if get_option("Generated data file:\n" + filename +"\n\n" + msg + "\n\n" + "Save to ELOG?", "YesNo") == "Yes":
|
||||
log_msg = "Data file: " + filename
|
||||
log_msg = log_msg + "\nDLAC: " + prefix
|
||||
log_msg = log_msg + "\nSample: " + str(scan_type)
|
||||
log_msg = log_msg + "\nRange: " + str(scan_range)
|
||||
log_msg = log_msg + "\nCycles: " + str(cycles)
|
||||
log_msg = log_msg + "\nVelocity: " + str(velocity)
|
||||
log_msg = log_msg + "\nBackground Measures: " + str(bkgrd)
|
||||
log_msg = log_msg + "\nBPMs: " + str(bpms)
|
||||
log_msg = log_msg + "\nBLMs: " + str(blms)
|
||||
|
||||
log_msg = log_msg + "\n" + msg
|
||||
elog("Wire Scan", log_msg, snapshots)
|
||||
|
||||
@@ -19,7 +19,7 @@ blms = args[6] if is_panel else get_wire_scanners_blms(prefix)
|
||||
bkgrd = args[7] if is_panel else 10
|
||||
plt = args[8] if is_panel else plot(None, title = "Wire Scan")[0]
|
||||
do_elog = True if is_panel else True
|
||||
print "WireScan parameters: ", prefix, scan_type, scan_range, cycles, cycles, bpms
|
||||
print "WireScan parameters: ", prefix, scan_type, scan_range, cycles, velocity, bpms, blms, bkgrd
|
||||
|
||||
|
||||
#Plot setup
|
||||
|
||||
@@ -39,7 +39,7 @@ plt.setLegendVisible(True)
|
||||
#Creating Phase positioner
|
||||
if dry_run:
|
||||
phase = Positioner("Phase", "SINEG01-RSYS:SET-BEAM-PHASE-SIM", "SINEG01-RSYS:SET-BEAM-PHASE-SIM")
|
||||
camera_name = "SLG-LCAM-C041"
|
||||
camera_name = "simulation"
|
||||
else:
|
||||
phase = Positioner("Phase", "SINEG01-RSYS:SET-BEAM-PHASE", "SINEG01-RSYS:GET-BEAM-PHASE")
|
||||
camera_name = "SINBD01-DSCR010"
|
||||
@@ -94,7 +94,18 @@ save_dataset(get_exec_pars().group + "/dE", dE)
|
||||
|
||||
if do_elog:
|
||||
if get_option("Generated data file:\n" + get_exec_pars().path +"\n\n" + "Save to ELOG?", "YesNo") == "Yes":
|
||||
log_msg = "Data file: " + get_exec_pars().path
|
||||
Laser = str(caget("SLGTV-LMTO-M055:MOT-KNOWN-POS"))
|
||||
log_msg = "Data file: " + get_exec_pars().path + "\n\n"
|
||||
log_msg = log_msg + "Laser: " + Laser + "\n"
|
||||
if Laser == "Alcor":
|
||||
log_msg = log_msg + "Energy plate: %0.2f" % caget("SLGTH01-LMRM-M074:MOT.RBV") + " deg \n"
|
||||
else:
|
||||
log_msg = log_msg + "Energy plate: %0.2f" % caget("SLGJG-LMRM-M031:MOT.RBV") + " deg \n"
|
||||
if caget("SLGTV-LMTO-M053:MOT-ACT-POS") == "IRIS":
|
||||
log_msg = log_msg + "Collimator: IRIS %0.2f" % caget("SLGTV-LAPP:SIZE-GET") + " mm \n"
|
||||
else:
|
||||
log_msg = log_msg + "Collimator: " + str(caget("SLGTV-LMTO-M053:MOT-ACT-POS")) + "\n"
|
||||
log_msg = log_msg + "Charge: %0.2f" % caget("SINEG01-DICT215:B1_CHARGE-OP") + " pC \n"
|
||||
sleep(0.1) #Give some time to plot to be finished - it is not sync with acquisition
|
||||
file_name = os.path.abspath(get_context().setup.getContextPath() + "/GunScanPlot.png")
|
||||
plt.saveSnapshot(file_name , "png")
|
||||
|
||||
@@ -20,11 +20,9 @@ else:
|
||||
|
||||
if plt is not None:
|
||||
plt.clear()
|
||||
#plt.setStyle(plt.Style.ErrorY) #Must be set by Plugin otherwise first scan is not shown
|
||||
plt.addSeries(LinePlotErrorSeries("Values"))
|
||||
plt.getAxis(plt.AxisId.X).setLabel("Gun Beam Phase (deg)")
|
||||
plt.getAxis(plt.AxisId.Y).setLabel("SINEG01-DICT215:B1_CHARGE")
|
||||
|
||||
plt.getAxis(plt.AxisId.Y).setLabel("SINEG01-DICT215:B1_CHARGE")
|
||||
|
||||
if dry_run:
|
||||
bph = Positioner("Beam phase", "SINEG01-RSYS:SET-BEAM-PHASE-SIM", "SINEG01-RSYS:SET-BEAM-PHASE-SIM")
|
||||
@@ -77,11 +75,28 @@ finally:
|
||||
rph.close()
|
||||
q.close()
|
||||
|
||||
#Elog entry
|
||||
Laser = str(caget("SLGTV-LMTO-M055:MOT-KNOWN-POS"))
|
||||
log_msg = "Data file: " + get_exec_pars().path + "\n\n"
|
||||
log_msg = log_msg + "Laser: " + Laser + "\n"
|
||||
if Laser == "Alcor":
|
||||
log_msg = log_msg + "Energy plate: %0.2f" % caget("SLGTH01-LMRM-M074:MOT.RBV") + " deg \n"
|
||||
else:
|
||||
log_msg = log_msg + "Energy plate: %0.2f" % caget("SLGJG-LMRM-M031:MOT.RBV") + " deg \n"
|
||||
if caget("SLGTV-LMTO-M053:MOT-ACT-POS") == "IRIS":
|
||||
log_msg = log_msg + "Collimator: IRIS %0.2f" % caget("SLGTV-LAPP:SIZE-GET") + " mm \n"
|
||||
else:
|
||||
log_msg = log_msg + "Collimator: " + str(caget("SLGTV-LMTO-M053:MOT-ACT-POS")) + "\n"
|
||||
log_msg = log_msg + "Charge: %0.2f" % caget("SINEG01-DICT215:B1_CHARGE-OP") + " pC \n"
|
||||
attachments = []
|
||||
if plt is not None:
|
||||
sleep(0.1) #Give some time to plot to be finished - it is not sync with acquisition
|
||||
file_name = os.path.abspath(get_context().setup.getContextPath() + "/SchottkyScanPlot.png")
|
||||
plt.saveSnapshot(file_name , "png")
|
||||
attachments = [file_name]
|
||||
elog("Schottky scan", log_msg, attachments)
|
||||
|
||||
#Setting the return value
|
||||
index_max = charge.index(max(charge))
|
||||
#bph_ref_guess = beamphase[index_max] - 80
|
||||
#rph_ref_guess = rfphase[index_max] - 80
|
||||
|
||||
bph_ref_guess = (start + stop)/2
|
||||
|
||||
set_return([bph_ref_guess])
|
||||
@@ -23,5 +23,5 @@ if do_elog:
|
||||
file_name = os.path.abspath(get_context().setup.getContextPath() + "/SchottkyScanSetPlot.png")
|
||||
plt.saveSnapshot(file_name , "png")
|
||||
attachments = [file_name]
|
||||
elog("SchottkyScanSet", log_msg, attachments)
|
||||
elog("Set gun phase", log_msg, attachments)
|
||||
show_message("Success setting phase reference")
|
||||
@@ -71,7 +71,15 @@ try:
|
||||
(fit_amplitude, fit_phase_deg, fit_offset, ph_crest, fit_x, fit_y) = hfitoff(energy , rf_phase)
|
||||
except:
|
||||
raise Exception("Fit failure")
|
||||
plot([energy, fit_y], ["data", "fit"], [rf_phase, fit_x])
|
||||
#plot([energy, fit_y], ["data", "fit"], [rf_phase, fit_x])
|
||||
plt = plot(None,name="data")[0]
|
||||
plt.addSeries(LinePlotSeries("fit"))
|
||||
plt.getSeries(0).setData(to_array(rf_phase,'d'), to_array(energy,'d'))
|
||||
plt.getSeries(0).setPointSize(8)
|
||||
plt.getSeries(0).setLinesVisible(False)
|
||||
plt.getSeries(1).setPointsVisible(False)
|
||||
plt.getSeries(1).setData(fit_x, fit_y)
|
||||
plt.setLegendVisible(True)
|
||||
caput(station + "-RSYS:GET-ONCREST-VSUM-PHASE", ph_crest)
|
||||
caput(station + "-RSYS:GET-ONCREST-E-GAIN", fit_amplitude)
|
||||
caput(station + "-RSYS:GET-FIT-PHASE-ARRAY", fit_x)
|
||||
@@ -101,12 +109,11 @@ caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE-CALC", amplitude_scale)
|
||||
caput(station + "-RSYS:SET-VOLT-POWER-SCALE-CALC", power_scale)
|
||||
|
||||
if do_elog:
|
||||
if get_option("Generated data file:\n" + get_exec_pars().path +"\n\n" + "Save to ELOG?", "YesNo") == "Yes":
|
||||
title = "Phase scan" + station
|
||||
log_msg = "Data file: " + get_exec_pars().path + "\n"
|
||||
log_msg = log_msg + "Energy Gain: %0.3f" % energy_gain + "MeV\n"
|
||||
log_msg = log_msg + "Phase Offset: %0.2f" % phase_offset + "deg\n"
|
||||
log_msg = log_msg + "Amplitude Scale: %0.3f" % amplitude_scale + "MV\n"
|
||||
log_msg = log_msg + "Power Scale: %0.3f" % power_scale + "MW/MV^2"
|
||||
attachments = []
|
||||
elog(title, log_msg, attachments)
|
||||
title = "Phase scan" + station
|
||||
log_msg = "Data file: " + get_exec_pars().path + "\n"
|
||||
log_msg = log_msg + "Energy Gain: %0.3f" % fit_amplitude + "MeV\n"
|
||||
log_msg = log_msg + "Phase Offset: %0.2f" % phase_offset + "deg\n"
|
||||
log_msg = log_msg + "Amplitude Scale: %0.3f" % amplitude_scale + "MV\n"
|
||||
log_msg = log_msg + "Power Scale: %0.3f" % power_scale + "MW/MV^2"
|
||||
attachments = get_plot_snapshots()
|
||||
elog(title, log_msg, attachments)
|
||||
@@ -0,0 +1,152 @@
|
||||
import requests
|
||||
|
||||
def inventory_request(url, attributes):
|
||||
"""
|
||||
Thin wrapper for PSI Inventory system (I4). This wrapper does nothing
|
||||
more than sanitises output (decompresses dict) and takes care of dict
|
||||
to json conversion for attributes and json to dict conversion for
|
||||
response.
|
||||
|
||||
Use: https://inventory.psi.ch/#action=Introspection for details
|
||||
|
||||
|
||||
Example usage:
|
||||
|
||||
Query:
|
||||
|
||||
query = {"query": [
|
||||
{"Field": "Holy List Name", "Operator": "Is", "Value": holy_name},
|
||||
{"Field": 'Type', "Operator": "Is", "Value": type}
|
||||
|
||||
], "columns": ["Label"]}
|
||||
attr = {"search": query}
|
||||
|
||||
r = inventory_request('https://inventory.psi.ch/DataAccess.asmx/FindObjects', attr)
|
||||
|
||||
Fetch atributes for part:
|
||||
|
||||
attributes = inventory_request('https://inventory.psi.ch/DataAccess.asmx/GetPartAttributes', {'psiLabel': part_id})
|
||||
|
||||
|
||||
|
||||
|
||||
:param url: Inventory URL endpoint
|
||||
:param attributes: Python dict of attributes
|
||||
:return:
|
||||
"""
|
||||
r = requests.post(url, json=attributes)
|
||||
|
||||
if not r.ok:
|
||||
raise ConnectionError("Inventory returned error: ", r.json())
|
||||
|
||||
return r.json()['d']
|
||||
|
||||
|
||||
def find_partid_by_holy(holy_name, type="DSCR"):
|
||||
"""
|
||||
:param holy_name:
|
||||
:param type:
|
||||
:return: Returns first partId that matches holy_name and type
|
||||
"""
|
||||
query = {"query": [
|
||||
{"Field": "Holy List Name", "Operator": "Is", "Value": holy_name},
|
||||
{"Field": 'Type', "Operator": "Is", "Value": type}
|
||||
|
||||
], "columns": ["Label"]}
|
||||
attr = {"search": query}
|
||||
|
||||
r = inventory_request('https://inventory.psi.ch/DataAccess.asmx/FindObjects', attr)
|
||||
try:
|
||||
id = r['Rows'][0][0]
|
||||
except:
|
||||
return None
|
||||
|
||||
return id
|
||||
|
||||
|
||||
def find_all_by_type(type="DSCR", column = "Holy List Name"):
|
||||
"""
|
||||
:param type: Type to match
|
||||
:param column: Label, Holy List Name, ...
|
||||
:return: List
|
||||
"""
|
||||
|
||||
query = {"query": [
|
||||
{"Field": 'Type', "Operator": "Is", "Value": type}
|
||||
|
||||
], "columns": [column]}
|
||||
attr = {"search": query}
|
||||
|
||||
r = inventory_request('https://inventory.psi.ch/DataAccess.asmx/FindObjects', attr)
|
||||
|
||||
rows = []
|
||||
for i in r['Rows']:
|
||||
rows.append(i[0])
|
||||
|
||||
return rows
|
||||
|
||||
def get_part_attributes_from_inventory(part_label = None, holy_name = None):
|
||||
if holy_name:
|
||||
part_label = find_partid_by_holy(holy_name, "DSCR")
|
||||
if not part_label: raise RuntimeError("Could not find inventory part for >>{}<<".format(holy_name))
|
||||
|
||||
return inventory_request('https://inventory.psi.ch/DataAccess.asmx/GetPartAttributes', {'psiLabel': part_label})
|
||||
|
||||
def get_logbook_from_inventory(part_label = None, holy_name = None):
|
||||
import re
|
||||
attributes = get_part_attributes_from_inventory(part_label, holy_name)
|
||||
|
||||
elog_link = None
|
||||
for a in attributes:
|
||||
if a['Name'] == 'Elog':
|
||||
try:
|
||||
elog_link = a['Value']
|
||||
elog_link = re.findall('http(?:s|)://[^\s]*')
|
||||
if elog_link:
|
||||
elog_link = elog_link[0]
|
||||
else:
|
||||
elog_link = None
|
||||
|
||||
except TypeError:
|
||||
elog_link = None
|
||||
|
||||
return elog_link
|
||||
|
||||
def get_calib_from_inventory(part_label = None, holy_name = None):
|
||||
horizontal_dist = 0.0
|
||||
vertical_dist = 0.0
|
||||
horizontal_tilt = 0.0
|
||||
vertical_tilt = 0.0
|
||||
|
||||
attributes = get_part_attributes_from_inventory(part_label, holy_name)
|
||||
|
||||
for a in attributes:
|
||||
if a['Name'] == 'Crystal angle in x (e-beam system) [deg]':
|
||||
try:
|
||||
horizontal_tilt = float(a['Value'])
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
if a['Name'] == 'Crystal angle in y (e-beam system) [deg]':
|
||||
try:
|
||||
vertical_tilt = float(a['Value'])
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
if a['Name'] == 'Mark distance in x (e-beam system) [mm]':
|
||||
try:
|
||||
horizontal_dist = float(a['Value']) * 1e3
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
if a['Name'] == 'Mark distance in y (e-beam system) [mm]':
|
||||
try:
|
||||
vertical_dist = float(a['Value']) * 1e3
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
return horizontal_dist, vertical_dist, horizontal_tilt, vertical_tilt
|
||||
|
||||
|
||||
|
||||
#print get_calib_from_inventory(None, "SINEG01-DSCR190")
|
||||
@@ -1,7 +1,7 @@
|
||||
import ch.psi.pshell.epics.Positioner as Positioner
|
||||
import ch.psi.pshell.epics.ChannelDouble as ChannelDouble
|
||||
|
||||
dry_run = False
|
||||
dry_run = True
|
||||
do_elog = True
|
||||
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
@@ -23,11 +23,11 @@ A = energy0 / disp / 1e3
|
||||
B = energy0
|
||||
|
||||
phase = Positioner("Phase", station + "-RSYS:SET-VSUM-PHASE", station + "-RSYS:GET-VSUM-PHASE")
|
||||
phase.config.minValue =-180.0
|
||||
phase.config.maxValue = 180.0
|
||||
phase.config.minValue =-360.0
|
||||
phase.config.maxValue = 360.0
|
||||
phase.config.precision = 4
|
||||
phase.config.rotation = True
|
||||
phase.config.resolution = 0.5
|
||||
phase.config.rotation = False
|
||||
phase.config.resolution = 0.01
|
||||
phase.initialize()
|
||||
V = ChannelDouble("Amplitude Readback", station + "-RSYS:GET-VSUM-AMPLT")
|
||||
P = ChannelDouble("Power Readback", station + "-RSYS:GET-KLY-POWER")
|
||||
@@ -71,7 +71,7 @@ try:
|
||||
(fit_amplitude, fit_phase_deg, fit_offset, ph_crest, fit_x, fit_y) = hfitoff(energy , rf_phase)
|
||||
except:
|
||||
raise Exception("Fit failure")
|
||||
plot([energy, fit_y], ["data", "fit"], [rf_phase, fit_x])
|
||||
plt = plot([energy, fit_y], ["data", "fit"], [rf_phase, fit_x])
|
||||
caput(station + "-RSYS:GET-ONCREST-VSUM-PHASE", ph_crest)
|
||||
caput(station + "-RSYS:GET-ONCREST-E-GAIN", fit_amplitude)
|
||||
caput(station + "-RSYS:GET-FIT-PHASE-ARRAY", fit_x)
|
||||
@@ -101,12 +101,14 @@ caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE-CALC", amplitude_scale)
|
||||
caput(station + "-RSYS:SET-VOLT-POWER-SCALE-CALC", power_scale)
|
||||
|
||||
if do_elog:
|
||||
if get_option("Generated data file:\n" + get_exec_pars().path +"\n\n" + "Save to ELOG?", "YesNo") == "Yes":
|
||||
title = "Phase scan" + station
|
||||
log_msg = "Data file: " + get_exec_pars().path + "\n"
|
||||
log_msg = log_msg + "Energy Gain: %0.3f" % energy_gain + "MeV\n"
|
||||
log_msg = log_msg + "Phase Offset: %0.2f" % phase_offset + "deg\n"
|
||||
log_msg = log_msg + "Amplitude Scale: %0.3f" % amplitude_scale + "MV\n"
|
||||
log_msg = log_msg + "Power Scale: %0.3f" % power_scale + "MW/MV^2"
|
||||
attachments = []
|
||||
elog(title, log_msg, attachments)
|
||||
title = "Phase scan " + station
|
||||
log_msg = "Data file: " + get_exec_pars().path + "\n"
|
||||
log_msg = log_msg + "Energy Gain: %0.3f" % fit_amplitude + "MeV\n"
|
||||
log_msg = log_msg + "Phase Offset: %0.2f" % phase_offset + "deg\n"
|
||||
log_msg = log_msg + "Amplitude Scale: %0.3f" % amplitude_scale + "MV\n"
|
||||
log_msg = log_msg + "Power Scale: %0.3f" % power_scale + "MW/MV^2"
|
||||
if plt is not None:
|
||||
sleep(0.1) #Give some time to plot to be finished - it is not sync with acquisition
|
||||
attachments = [file_name]
|
||||
attachments = []
|
||||
elog(title, log_msg, attachments)
|
||||
+18
-12
@@ -29,20 +29,25 @@ if plt is not None:
|
||||
if dry_run:
|
||||
bph = Positioner("Beam phase", "SINEG01-RSYS:SET-BEAM-PHASE-SIM", "SINEG01-RSYS:SET-BEAM-PHASE-SIM")
|
||||
rph = ChannelDouble('RF phase', "SINEG01-RSYS:SET-VSUM-PHASE-SIM")
|
||||
q = ChannelDouble("Charge", "SINEG01-DICT215:B1_CHARGE-SIM")
|
||||
q.initialize()
|
||||
q.monitored=True
|
||||
st = Stream("ICTstream", dispatcher)
|
||||
q = st.addScalar("Charge", "SINEG01-DICT215:B1_CHARGE", 1, 0)
|
||||
st.initialize()
|
||||
st.start()
|
||||
st.waitValueChange(10000)
|
||||
#q = ChannelDouble("Charge", "SINEG01-DICT215:B1_CHARGE-SIM")
|
||||
#q.initialize()
|
||||
#q.monitored=True
|
||||
else:
|
||||
bph = Positioner("Beam phase", "SINEG01-RSYS:SET-BEAM-PHASE", "SINEG01-RSYS:GET-BEAM-PHASE")
|
||||
rph = ChannelDouble('RF phase', "SINEG01-RSYS:SET-VSUM-PHASE")
|
||||
#st = Stream("ICTstream", dispatcher)
|
||||
#q = st.addScalar("Charge", "SINEG01-DICT215:B1_CHARGE", 1, 0)
|
||||
#st.initialize()
|
||||
#st.start()
|
||||
#st.waitValueChange(10000)
|
||||
q = ChannelDouble("Charge", "SINEG01-DICT215:B1_CHARGE")
|
||||
q.initialize()
|
||||
q.monitored=True
|
||||
st = Stream("ICTstream", dispatcher)
|
||||
q = st.addScalar("Charge", "SINEG01-DICT215:B1_CHARGE", 1, 0)
|
||||
st.initialize()
|
||||
st.start()
|
||||
st.waitValueChange(10000)
|
||||
#q = ChannelDouble("Charge", "SINEG01-DICT215:B1_CHARGE")
|
||||
#q.initialize()
|
||||
#q.monitored=True
|
||||
|
||||
bph.config.minValue = -360.0
|
||||
bph.config.maxValue = 360.0
|
||||
@@ -75,7 +80,8 @@ finally:
|
||||
rph.write(rph0)
|
||||
bph.close()
|
||||
rph.close()
|
||||
q.close()
|
||||
#q.close()
|
||||
st.close()
|
||||
|
||||
#Setting the return value
|
||||
index_max = charge.index(max(charge))
|
||||
|
||||
Reference in new issue
Block a user