This commit is contained in:
sfop
2016-09-12 15:40:53 +02:00
parent 0b6becd66e
commit ec78778cc2
6 changed files with 2204 additions and 243 deletions
+10 -10
View File
@@ -1,12 +1,12 @@
#Mon Sep 12 10:50:08 CEST 2016
#Mon Sep 12 15:37:13 CEST 2016
colormap=Temperature
colormapAutomatic=true
colormapMax=NaN
colormapMin=NaN
flipHorizontally=true
flipVertically=true
colormapMax=1.0
colormapMin=0.0
flipHorizontally=false
flipVertically=false
grayscale=false
imageHeight=1628
imageHeight=1024
imageWidth=1280
invert=true
rescaleFactor=1.0
@@ -18,9 +18,9 @@ roiY=0
rotation=0.0
rotationCrop=true
scale=1.0
spatialCalOffsetX=-685.0
spatialCalOffsetY=-874.0
spatialCalScaleX=14.146772767462423
spatialCalScaleY=12.708498808578236
spatialCalOffsetX=NaN
spatialCalOffsetY=NaN
spatialCalScaleX=NaN
spatialCalScaleY=NaN
spatialCalUnits=mm
transpose=false
+474 -144
View File
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<NonVisualComponents>
<Component class="javax.swing.ButtonGroup" name="buttonGroup1">
</Component>
<Component class="javax.swing.ButtonGroup" name="buttonGroup2">
</Component>
<Component class="javax.swing.ButtonGroup" name="buttonGroup3">
</Component>
</NonVisualComponents>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@@ -16,174 +24,496 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="renderer" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="checkCamtool" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="comboCameras" pref="170" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="buttonConfig" linkSize="3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonSetup" linkSize="3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="textState" min="-2" pref="120" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="buttonPause" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonMarker" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonFit" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonReticle" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonGrabBackground" linkSize="6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonSave" linkSize="6" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="checkCamtool" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jPanel2" alignment="0" max="32767" attributes="0"/>
<Component id="jPanel3" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="comboCameras" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="textState" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonConfig" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonSetup" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="checkCamtool" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="renderer" pref="307" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonPause" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonFit" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonMarker" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonSave" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonReticle" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonGrabBackground" alignment="3" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="checkCamtool" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="61" max="-2" attributes="0"/>
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="jPanel1" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="ch.psi.pshell.imaging.Renderer" name="renderer">
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Container class="javax.swing.JPanel" name="jPanel1">
<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="renderer" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="comboCameras" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonConfig" linkSize="3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonSetup" linkSize="3" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="textState" min="-2" pref="120" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="buttonPause" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonMarker" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonFit" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonReticle" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonGrabBackground" linkSize="6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonSave" linkSize="6" 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" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="comboCameras" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="textState" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonConfig" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonSetup" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="renderer" pref="498" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonPause" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonFit" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonMarker" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonSave" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonReticle" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonGrabBackground" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="buttonGrabBackground">
<Properties>
<Property name="text" type="java.lang.String" value="Grab Background"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonGrabBackgroundActionPerformed"/>
</Events>
</Component>
<Component class="ch.psi.pshell.imaging.Renderer" name="renderer">
</Component>
<Component class="javax.swing.JTextField" name="textState">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="disabledTextColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="0" type="rgb"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonSave">
<Properties>
<Property name="text" type="java.lang.String" value="Save Snapshot"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSaveActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonPause">
<Properties>
<Property name="text" type="java.lang.String" value="Pause"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonPauseActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="State:"/>
</Properties>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonFit">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Fit"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonFitActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JComboBox" name="comboCameras">
<Properties>
<Property name="maximumRowCount" type="int" value="30"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboCamerasActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonSetup">
<Properties>
<Property name="text" type="java.lang.String" value="Setup"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSetupActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonMarker">
<Properties>
<Property name="text" type="java.lang.String" value="Marker"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonMarkerActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Camera:"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="buttonConfig">
<Properties>
<Property name="text" type="java.lang.String" value="Config"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonConfigActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonReticle">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Reticle"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonReticleActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
<Property name="text" type="java.lang.String" value="Camera:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="comboCameras">
<Properties>
<Property name="maximumRowCount" type="int" value="30"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboCamerasActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="State:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="textState">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="disabledTextColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="0" type="rgb"/>
<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="Colormap"/>
</Border>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="buttonConfig">
<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">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonFullRange" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonManual" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="spinnerMax" min="-2" max="-2" attributes="0"/>
<Component id="spinnerMin" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonGrayscale" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonRainbow" min="-2" max="-2" attributes="0"/>
<Component id="buttonTemperature" min="-2" max="-2" attributes="0"/>
<Component id="buttonAutomatic" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="buttonGrayscale" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonRainbow" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonTemperature" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Component id="buttonAutomatic" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonFullRange" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerMin" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonManual" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerMax" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JRadioButton" name="buttonGrayscale">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup2"/>
</Property>
<Property name="text" type="java.lang.String" value="Grayscale"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="buttonRainbow">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup2"/>
</Property>
<Property name="text" type="java.lang.String" value="Rainbow"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="buttonTemperature">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup2"/>
</Property>
<Property name="text" type="java.lang.String" value="Temperature"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="buttonFullRange">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup3"/>
</Property>
<Property name="text" type="java.lang.String" value="Full range"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="buttonManual">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup3"/>
</Property>
<Property name="text" type="java.lang.String" value="Manual"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="min:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="max:"/>
</Properties>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerMin">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="0" maximum="65535" minimum="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[60, 20]"/>
</Property>
</Properties>
<Events>
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="onChangeColormapRange"/>
</Events>
</Component>
<Component class="javax.swing.JSpinner" name="spinnerMax">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="255" maximum="65535" minimum="0" numberType="java.lang.Integer" stepSize="1" type="number"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[60, 20]"/>
</Property>
</Properties>
<Events>
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="onChangeColormapRange"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="buttonAutomatic">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup3"/>
</Property>
<Property name="text" type="java.lang.String" value="Automatic"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="text" type="java.lang.String" value="Config"/>
<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="Zoom"/>
</Border>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonConfigActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonSetup">
<Properties>
<Property name="text" type="java.lang.String" value="Setup"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSetupActionPerformed"/>
</Events>
</Component>
<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="buttonZoomFit" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonZoomStretch" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonZoomNormal" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonZoom025" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonZoom05" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" 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="buttonZoomFit" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonZoomStretch" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonZoom025" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonZoom05" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonZoomNormal" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JRadioButton" name="buttonZoomFit">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="text" type="java.lang.String" value="Fit"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonZoomFitActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="buttonZoomStretch">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="text" type="java.lang.String" value="Stretch"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonZoomStretchActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="buttonZoomNormal">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="text" type="java.lang.String" value="Normal"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonZoomNormalActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="buttonZoom025">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="text" type="java.lang.String" value="0.25"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonZoom025ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="buttonZoom05">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="text" type="java.lang.String" value="0.5"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonZoom05ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JCheckBox" name="checkCamtool">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Camtool"/>
<Property name="text" type="java.lang.String" value="Use Camtool"/>
</Properties>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonFit">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Fit"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonFitActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonPause">
<Properties>
<Property name="text" type="java.lang.String" value="Pause"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonPauseActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonMarker">
<Properties>
<Property name="text" type="java.lang.String" value="Marker"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonMarkerActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonSave">
<Properties>
<Property name="text" type="java.lang.String" value="Save Snapshot"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSaveActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonReticle">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Reticle"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonReticleActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonGrabBackground">
<Properties>
<Property name="text" type="java.lang.String" value="Grab Background"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonGrabBackgroundActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
+436 -76
View File
@@ -22,6 +22,9 @@ import ch.psi.pshell.epics.ChannelDouble;
import ch.psi.pshell.epics.ChannelDoubleArray;
import ch.psi.pshell.epics.ChannelInteger;
import ch.psi.pshell.epics.ChannelIntegerArray;
import ch.psi.pshell.imaging.Colormap;
import ch.psi.pshell.imaging.ColormapSource;
import ch.psi.pshell.imaging.ColormapSource.ColormapSourceConfig;
import ch.psi.pshell.ui.App;
import ch.psi.pshell.imaging.Data;
import ch.psi.pshell.imaging.Overlay;
@@ -31,6 +34,7 @@ import ch.psi.pshell.imaging.Pen;
import static ch.psi.pshell.imaging.Renderer.PEN_ERROR_TEXT;
import ch.psi.pshell.imaging.Renderer.Profile;
import static ch.psi.pshell.imaging.RendererMenu.PEN_MARKER;
import ch.psi.pshell.imaging.RendererMode;
import ch.psi.pshell.imaging.Source;
import ch.psi.pshell.imaging.Utils;
import ch.psi.pshell.scripting.InterpreterResult;
@@ -182,7 +186,7 @@ public class Cameras extends Panel {
public ArrayList<Integer> getCalibration() {
return (ArrayList<Integer>) state.get("calibration");
}
public double getCalOffsetX(){
ArrayList<Integer> calibration = getCalibration();
double ret = - (calibration.get(0) + calibration.get(2))/2;
@@ -393,7 +397,40 @@ public class Cameras extends Panel {
}
renderer.refresh();
}
void updateZoom(){
try{
buttonZoomStretch.setSelected(renderer.getMode() == RendererMode.Stretch);
buttonZoomFit.setSelected(renderer.getMode() == RendererMode.Fit);
buttonZoomNormal.setSelected( (renderer.getMode() == RendererMode.Fixed) || ((renderer.getMode() == RendererMode.Zoom) && (renderer.getZoom()==1.0)));
buttonZoom05.setSelected((renderer.getMode() == RendererMode.Zoom) && (renderer.getZoom()==0.5));
buttonZoom025.setSelected((renderer.getMode() == RendererMode.Zoom) && (renderer.getZoom()==0.25));
}catch (Exception ex) {
ex.printStackTrace();
}
}
void updateColormap(){
try{
if ((camera!=null) && (camera instanceof ColormapSource)){
ColormapSourceConfig config = ((ColormapSource)camera).getConfig();
buttonGrayscale.setSelected(config.colormap == Colormap.Grayscale);
buttonRainbow.setSelected(config.colormap == Colormap.Rainbow);
buttonTemperature.setSelected(config.colormap == Colormap.Temperature);
buttonFullRange.setSelected(config.isDefaultColormap());
buttonAutomatic.setSelected(config.colormapAutomatic);
buttonManual.setSelected((!buttonFullRange.isSelected()) && (!buttonAutomatic.isSelected()));
spinnerMin.setEnabled(buttonManual.isSelected());
spinnerMax.setEnabled(buttonManual.isSelected());
spinnerMin.setValue(Double.isNaN(config.colormapMin) ? 0 : Math.min(Math.max((int)config.colormapMin, 0), 65535));
spinnerMax.setValue(Double.isNaN(config.colormapMax) ? 0 : Math.min(Math.max((int)config.colormapMax, 0), 65535));
}
}catch (Exception ex) {
ex.printStackTrace();
}
}
@Override
protected void onTimer() {
textState.setText((camera == null) ? "" : camera.getState().toString());
@@ -407,6 +444,8 @@ public class Cameras extends Panel {
Logger.getLogger(Cameras.class.getName()).log(Level.SEVERE, null, ex);
}
}
updateZoom();
updateColormap();
}
Pen fitPen = new Pen(new Color(192, 105, 0), 1);
@@ -761,59 +800,58 @@ public class Camtool extends ArraySource {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
renderer = new ch.psi.pshell.imaging.Renderer();
jLabel1 = new javax.swing.JLabel();
comboCameras = new javax.swing.JComboBox();
jLabel2 = new javax.swing.JLabel();
textState = new javax.swing.JTextField();
buttonConfig = new javax.swing.JButton();
buttonSetup = new javax.swing.JButton();
checkCamtool = new javax.swing.JCheckBox();
buttonFit = new javax.swing.JToggleButton();
buttonPause = new javax.swing.JToggleButton();
buttonMarker = new javax.swing.JToggleButton();
buttonSave = new javax.swing.JToggleButton();
buttonReticle = new javax.swing.JToggleButton();
buttonGroup1 = new javax.swing.ButtonGroup();
buttonGroup2 = new javax.swing.ButtonGroup();
buttonGroup3 = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
buttonGrabBackground = new javax.swing.JButton();
renderer = new ch.psi.pshell.imaging.Renderer();
textState = new javax.swing.JTextField();
buttonSave = new javax.swing.JToggleButton();
buttonPause = new javax.swing.JToggleButton();
jLabel2 = new javax.swing.JLabel();
buttonFit = new javax.swing.JToggleButton();
comboCameras = new javax.swing.JComboBox();
buttonSetup = new javax.swing.JButton();
buttonMarker = new javax.swing.JToggleButton();
jLabel1 = new javax.swing.JLabel();
buttonConfig = new javax.swing.JButton();
buttonReticle = new javax.swing.JToggleButton();
jPanel2 = new javax.swing.JPanel();
buttonGrayscale = new javax.swing.JRadioButton();
buttonRainbow = new javax.swing.JRadioButton();
buttonTemperature = new javax.swing.JRadioButton();
buttonFullRange = new javax.swing.JRadioButton();
buttonManual = new javax.swing.JRadioButton();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
spinnerMin = new javax.swing.JSpinner();
spinnerMax = new javax.swing.JSpinner();
buttonAutomatic = new javax.swing.JRadioButton();
jPanel3 = new javax.swing.JPanel();
buttonZoomFit = new javax.swing.JRadioButton();
buttonZoomStretch = new javax.swing.JRadioButton();
buttonZoomNormal = new javax.swing.JRadioButton();
buttonZoom025 = new javax.swing.JRadioButton();
buttonZoom05 = new javax.swing.JRadioButton();
checkCamtool = new javax.swing.JCheckBox();
jLabel1.setText("Camera:");
comboCameras.setMaximumRowCount(30);
comboCameras.addActionListener(new java.awt.event.ActionListener() {
buttonGrabBackground.setText("Grab Background");
buttonGrabBackground.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
comboCamerasActionPerformed(evt);
buttonGrabBackgroundActionPerformed(evt);
}
});
jLabel2.setText("State:");
textState.setEditable(false);
textState.setHorizontalAlignment(javax.swing.JTextField.CENTER);
textState.setDisabledTextColor(new java.awt.Color(0, 0, 0));
textState.setEnabled(false);
buttonConfig.setText("Config");
buttonConfig.addActionListener(new java.awt.event.ActionListener() {
buttonSave.setText("Save Snapshot");
buttonSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonConfigActionPerformed(evt);
}
});
buttonSetup.setText("Setup");
buttonSetup.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonSetupActionPerformed(evt);
}
});
checkCamtool.setSelected(true);
checkCamtool.setText("Camtool");
buttonFit.setSelected(true);
buttonFit.setText("Fit");
buttonFit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonFitActionPerformed(evt);
buttonSaveActionPerformed(evt);
}
});
@@ -824,6 +862,30 @@ public class Camtool extends ArraySource {
}
});
jLabel2.setText("State:");
buttonFit.setSelected(true);
buttonFit.setText("Fit");
buttonFit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonFitActionPerformed(evt);
}
});
comboCameras.setMaximumRowCount(30);
comboCameras.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
comboCamerasActionPerformed(evt);
}
});
buttonSetup.setText("Setup");
buttonSetup.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonSetupActionPerformed(evt);
}
});
buttonMarker.setText("Marker");
buttonMarker.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
@@ -831,10 +893,12 @@ public class Camtool extends ArraySource {
}
});
buttonSave.setText("Save Snapshot");
buttonSave.addActionListener(new java.awt.event.ActionListener() {
jLabel1.setText("Camera:");
buttonConfig.setText("Config");
buttonConfig.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonSaveActionPerformed(evt);
buttonConfigActionPerformed(evt);
}
});
@@ -846,36 +910,27 @@ public class Camtool extends ArraySource {
}
});
buttonGrabBackground.setText("Grab Background");
buttonGrabBackground.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonGrabBackgroundActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
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(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(renderer, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(checkCamtool)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboCameras, 0, 170, Short.MAX_VALUE)
.addComponent(comboCameras, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonConfig)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonSetup)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGap(50, 50, 50)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(textState, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(buttonPause)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonMarker)
@@ -890,28 +945,27 @@ public class Camtool extends ArraySource {
.addContainerGap())
);
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonConfig, buttonSetup});
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonConfig, buttonSetup});
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonFit, buttonMarker, buttonPause, buttonReticle});
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonFit, buttonMarker, buttonPause, buttonReticle});
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonGrabBackground, buttonSave});
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonGrabBackground, buttonSave});
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(comboCameras, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2)
.addComponent(textState, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonConfig)
.addComponent(buttonSetup)
.addComponent(checkCamtool))
.addComponent(buttonSetup))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
.addComponent(renderer, javax.swing.GroupLayout.DEFAULT_SIZE, 498, Short.MAX_VALUE)
.addGap(12, 12, 12)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonPause)
.addComponent(buttonFit)
.addComponent(buttonMarker)
@@ -921,8 +975,237 @@ public class Camtool extends ArraySource {
.addContainerGap())
);
layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {comboCameras, textState});
jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {comboCameras, textState});
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Colormap"));
buttonGroup2.add(buttonGrayscale);
buttonGrayscale.setText("Grayscale");
buttonGrayscale.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
buttonGroup2.add(buttonRainbow);
buttonRainbow.setText("Rainbow");
buttonRainbow.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
buttonGroup2.add(buttonTemperature);
buttonTemperature.setText("Temperature");
buttonTemperature.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
buttonGroup3.add(buttonFullRange);
buttonFullRange.setText("Full range");
buttonFullRange.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
buttonGroup3.add(buttonManual);
buttonManual.setText("Manual");
buttonManual.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
jLabel3.setText("min:");
jLabel4.setText("max:");
spinnerMin.setModel(new javax.swing.SpinnerNumberModel(0, 0, 65535, 1));
spinnerMin.setEnabled(false);
spinnerMin.setPreferredSize(new java.awt.Dimension(60, 20));
spinnerMin.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
onChangeColormapRange(evt);
}
});
spinnerMax.setModel(new javax.swing.SpinnerNumberModel(255, 0, 65535, 1));
spinnerMax.setEnabled(false);
spinnerMax.setPreferredSize(new java.awt.Dimension(60, 20));
spinnerMax.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
onChangeColormapRange(evt);
}
});
buttonGroup3.add(buttonAutomatic);
buttonAutomatic.setText("Automatic");
buttonAutomatic.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonFullRange)
.addComponent(buttonManual))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel4)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(spinnerMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(spinnerMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonGrayscale)
.addComponent(buttonRainbow)
.addComponent(buttonTemperature)
.addComponent(buttonAutomatic))
.addGap(0, 0, Short.MAX_VALUE))))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(buttonGrayscale)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonRainbow)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonTemperature)
.addGap(18, 18, 18)
.addComponent(buttonAutomatic)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonFullRange)
.addComponent(jLabel3)
.addComponent(spinnerMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonManual))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(spinnerMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Zoom"));
buttonGroup1.add(buttonZoomFit);
buttonZoomFit.setText("Fit");
buttonZoomFit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonZoomFitActionPerformed(evt);
}
});
buttonGroup1.add(buttonZoomStretch);
buttonZoomStretch.setText("Stretch");
buttonZoomStretch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonZoomStretchActionPerformed(evt);
}
});
buttonGroup1.add(buttonZoomNormal);
buttonZoomNormal.setText("Normal");
buttonZoomNormal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonZoomNormalActionPerformed(evt);
}
});
buttonGroup1.add(buttonZoom025);
buttonZoom025.setText("0.25");
buttonZoom025.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonZoom025ActionPerformed(evt);
}
});
buttonGroup1.add(buttonZoom05);
buttonZoom05.setText("0.5");
buttonZoom05.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonZoom05ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonZoomFit)
.addComponent(buttonZoomStretch)
.addComponent(buttonZoomNormal)
.addComponent(buttonZoom025)
.addComponent(buttonZoom05))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(buttonZoomFit)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonZoomStretch)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonZoom025)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonZoom05)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonZoomNormal)
.addContainerGap())
);
checkCamtool.setSelected(true);
checkCamtool.setText("Use Camtool");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(checkCamtool)
.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))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(0, 0, 0))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(checkCamtool)
.addGap(61, 61, 61)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 0, 0))
);
}// </editor-fold>//GEN-END:initComponents
private void comboCamerasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboCamerasActionPerformed
@@ -1043,20 +1326,97 @@ public class Camtool extends ArraySource {
}
}//GEN-LAST:event_buttonGrabBackgroundActionPerformed
private void buttonZoomFitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonZoomFitActionPerformed
try {
renderer.setMode(RendererMode.Fit);
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_buttonZoomFitActionPerformed
private void buttonZoomStretchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonZoomStretchActionPerformed
try {
renderer.setMode(RendererMode.Stretch);
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_buttonZoomStretchActionPerformed
private void buttonZoomNormalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonZoomNormalActionPerformed
try {
renderer.setMode(RendererMode.Fixed);
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_buttonZoomNormalActionPerformed
private void onChangeColormap(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onChangeColormap
try {
if ((camera != null) && (camera instanceof ColormapSource)){
ColormapSource source = (ColormapSource)camera;
if (buttonGrayscale.isSelected()) source.getConfig().colormap = Colormap.Grayscale;
if (buttonTemperature.isSelected()) source.getConfig().colormap = Colormap.Temperature;
if (buttonRainbow.isSelected()) source.getConfig().colormap = Colormap.Rainbow;
source.getConfig().colormapAutomatic = buttonAutomatic.isSelected();
source.getConfig().colormapMin = buttonFullRange.isSelected() ? Double.NaN : (Integer)spinnerMin.getValue();
source.getConfig().colormapMax = buttonFullRange.isSelected() ? Double.NaN : (Integer)spinnerMax.getValue();
source.getConfig().save();
source.refresh();
}
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_onChangeColormap
private void onChangeColormapRange(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_onChangeColormapRange
onChangeColormap(null);
}//GEN-LAST:event_onChangeColormapRange
private void buttonZoom025ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonZoom025ActionPerformed
renderer.setZoom(0.25);
renderer.setMode(RendererMode.Zoom);
}//GEN-LAST:event_buttonZoom025ActionPerformed
private void buttonZoom05ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonZoom05ActionPerformed
renderer.setZoom(0.5);
renderer.setMode(RendererMode.Zoom);
}//GEN-LAST:event_buttonZoom05ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JRadioButton buttonAutomatic;
private javax.swing.JButton buttonConfig;
private javax.swing.JToggleButton buttonFit;
private javax.swing.JRadioButton buttonFullRange;
private javax.swing.JButton buttonGrabBackground;
private javax.swing.JRadioButton buttonGrayscale;
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.ButtonGroup buttonGroup2;
private javax.swing.ButtonGroup buttonGroup3;
private javax.swing.JRadioButton buttonManual;
private javax.swing.JToggleButton buttonMarker;
private javax.swing.JToggleButton buttonPause;
private javax.swing.JRadioButton buttonRainbow;
private javax.swing.JToggleButton buttonReticle;
private javax.swing.JToggleButton buttonSave;
private javax.swing.JButton buttonSetup;
private javax.swing.JRadioButton buttonTemperature;
private javax.swing.JRadioButton buttonZoom025;
private javax.swing.JRadioButton buttonZoom05;
private javax.swing.JRadioButton buttonZoomFit;
private javax.swing.JRadioButton buttonZoomNormal;
private javax.swing.JRadioButton buttonZoomStretch;
private javax.swing.JCheckBox checkCamtool;
private javax.swing.JComboBox comboCameras;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private ch.psi.pshell.imaging.Renderer renderer;
private javax.swing.JSpinner spinnerMax;
private javax.swing.JSpinner spinnerMin;
private javax.swing.JTextField textState;
// End of variables declaration//GEN-END:variables
}
+189
View File
@@ -0,0 +1,189 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="renderer" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="checkCamtool" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="comboCameras" pref="170" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="buttonConfig" linkSize="3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonSetup" linkSize="3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="textState" min="-2" pref="120" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="buttonPause" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonMarker" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonFit" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonReticle" linkSize="5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonGrabBackground" linkSize="6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonSave" linkSize="6" 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="1" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="comboCameras" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="textState" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonConfig" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonSetup" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="checkCamtool" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="renderer" pref="307" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonPause" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonFit" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonMarker" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonSave" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonReticle" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonGrabBackground" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="ch.psi.pshell.imaging.Renderer" name="renderer">
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Camera:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="comboCameras">
<Properties>
<Property name="maximumRowCount" type="int" value="30"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboCamerasActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="State:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="textState">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="disabledTextColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="0" type="rgb"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="buttonConfig">
<Properties>
<Property name="text" type="java.lang.String" value="Config"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonConfigActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonSetup">
<Properties>
<Property name="text" type="java.lang.String" value="Setup"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSetupActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkCamtool">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Camtool"/>
</Properties>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonFit">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Fit"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonFitActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonPause">
<Properties>
<Property name="text" type="java.lang.String" value="Pause"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonPauseActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonMarker">
<Properties>
<Property name="text" type="java.lang.String" value="Marker"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonMarkerActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonSave">
<Properties>
<Property name="text" type="java.lang.String" value="Save Snapshot"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSaveActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JToggleButton" name="buttonReticle">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Reticle"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonReticleActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonGrabBackground">
<Properties>
<Property name="text" type="java.lang.String" value="Grab Background"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonGrabBackgroundActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
File diff suppressed because it is too large Load Diff
+33 -13
View File
@@ -18,12 +18,14 @@ public class Camtool extends ArraySource {
final boolean latch;
final public ChannelInteger channelRun;
final public ChannelInteger channelLatch;
final public ChannelInteger channelLatch;
final public ChannelDouble channelTimestamp;
final public ChannelDoubleArray origin;
final public ChannelDouble posX, posY;
final public ChannelDoubleArray profileX, profileY;
final public ChannelIntegerArray shape;
final public ChannelInteger roiEnabled;
final public ChannelIntegerArray roiShape;
final public ChannelInteger bgEnable, bgCapture, bgCaptureRemain;
final public ChannelDouble calOffX, calOffY, calScaleX, calScaleY;
final public CamToolPosX posMeanX;
@@ -32,11 +34,12 @@ public class Camtool extends ArraySource {
final public CamToolVarY posVarY;
public Camtool(String name, String prefix) {
this(name, prefix, false, true);
this(name, prefix, false);
}
public Camtool(String name, String prefix, boolean latch, boolean roi) {
super(name, prefix + (latch ? ":latch" : ":pipeline") + (roi ? ".roi.output" : ".image"));
public Camtool(String name, String prefix, boolean latch) {
//super(name, prefix + (latch ? ":latch" : ":pipeline") + (roi ? ".roi.output" : ".image"));
super(name, prefix + (latch ? ":latch" : ":pipeline") + ".roi.output");
this.prefix = prefix + ":";
this.latch = latch;
dataPrefix = this.prefix + (latch ? "latch" : "pipeline") + ".";
@@ -51,8 +54,12 @@ public class Camtool extends ArraySource {
posY = new ChannelDouble(name + " com y", dataPrefix + "y_stats.com_egu");
profileX = new ChannelDoubleArray(name + " profile x", dataPrefix + "profile.x");
profileY = new ChannelDoubleArray(name + " profile y", dataPrefix + "profile.y");
shape = new ChannelIntegerArray(name + " shape", dataPrefix + (roi ? "roi.output.shape" : "image.shape"));
origin = new ChannelDoubleArray(name + " origin X", roi ? (dataPrefix + "roi.origin_out") : (prefix + "origin"));
//shape = new ChannelIntegerArray(name + " shape", dataPrefix + (roi ? "roi.output.shape" : "image.shape"));
shape = new ChannelIntegerArray(name + " shape", dataPrefix + ("image.shape"));
roiShape = new ChannelIntegerArray(name + " roi shape", dataPrefix + "roi.roi");
roiEnabled = new ChannelInteger(name + " roi enabled", dataPrefix + "roi.enabled");
//origin = new ChannelDoubleArray(name + " origin X", roi ? (dataPrefix + "roi.origin_out") : (prefix + "origin"));
origin = new ChannelDoubleArray(name + " origin X", dataPrefix + "roi.origin_out");
bgEnable = new ChannelInteger(name + " bg enable", this.prefix + "pipeline.bg.enabled");
bgCapture = new ChannelInteger(name + " bg capture", this.prefix + "pipeline.bg.capture");
bgCaptureRemain = new ChannelInteger(name + " bg capture remain", this.prefix + "pipeline.bg.capture_remain");
@@ -92,11 +99,12 @@ public class Camtool extends ArraySource {
}
}
}
@Override
protected void doInitialize() throws IOException, InterruptedException {
try {
safeInitialize(channelRun, 3000);
channelRun.initialize();
channelLatch.initialize();
if (latch) {
start();
@@ -108,6 +116,8 @@ public class Camtool extends ArraySource {
profileX.initialize();
profileY.initialize();
shape.initialize();
roiShape.initialize();
roiEnabled.initialize();
origin.initialize();
bgEnable.initialize();
bgCapture.initialize();
@@ -120,13 +130,23 @@ public class Camtool extends ArraySource {
} catch (Exception ex) {
ex.printStackTrace();
}
int[] s = shape.read();
getConfig().imageHeight = s[0];
getConfig().imageWidth = s[1];
if (roiEnabled.read()>0){
int[] s = roiShape.read();
//for (int x : s) System.out.println(x);
getConfig().imageHeight = s[3];
getConfig().imageWidth = s[2];
} else {
int[] s = shape.read();
//for (int x : s){ System.out.println(x);}
getConfig().imageHeight = s[0];
getConfig().imageWidth = s[1];
}
getConfig().save();
getDevice().setSize(s[0] * s[1]);
super.doInitialize();
getDevice().setSize(getConfig().imageHeight * getConfig().imageWidth);
super.doInitialize();
//System.out.println(((int[])(getDevice().read())).length);
} catch (InterruptedException ex) {
throw ex;
} catch (Exception ex) {