This commit is contained in:
sfop
2017-06-09 15:35:40 +02:00
parent dce363f434
commit 2bec0f441e
5 changed files with 293 additions and 436 deletions

View File

@@ -1,7 +1,7 @@
#Fri Jun 09 12:01:41 CEST 2017
#Fri Jun 09 15:35:21 CEST 2017
colormap=Flame
colormapAutomatic=true
colormapMax=583.0
colormapAutomatic=false
colormapMax=0.0
colormapMin=0.0
flipHorizontally=false
flipVertically=false

View File

@@ -305,7 +305,7 @@
<Component id="pauseSelection" alignment="1" pref="0" max="32767" attributes="0"/>
<Component id="panelScreen2" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -357,7 +357,7 @@
<Component id="buttonZoom05" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonZoom2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -466,32 +466,31 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="checkHistogram" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jLabel3" linkSize="9" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" linkSize="9" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonAutomatic" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonFullRange" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonManual" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="comboColormap" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="12" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="labelMax" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="spinnerMax" linkSize="7" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonAutomatic" alignment="0" min="-2" max="-2" 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 type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="spinnerMin" linkSize="7" min="-2" max="-2" attributes="0"/>
<Component id="spinnerMax" linkSize="7" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Component id="jPanel8" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="labelMin" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="spinnerMin" linkSize="7" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="checkHistogram" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -499,41 +498,71 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="buttonAutomatic" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="buttonFullRange" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="buttonManual" min="-2" max="-2" 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="spinnerMin" 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="spinnerMax" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jPanel8" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="comboColormap" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="checkHistogram" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Component id="checkHistogram" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonAutomatic" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="labelMin" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="spinnerMin" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="buttonFullRange" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="buttonManual" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="labelMax" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="spinnerMax" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JCheckBox" name="checkHistogram">
<Properties>
<Property name="text" type="java.lang.String" value="Histogram"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkHistogramActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JComboBox" name="comboColormap">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
</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="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Type:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="horizontalAlignment" type="int" value="11"/>
<Property name="text" type="java.lang.String" value="Range:"/>
</Properties>
</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"/>
<Property name="text" type="java.lang.String" value="Full"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
@@ -550,16 +579,22 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<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>
<Component class="javax.swing.JLabel" name="labelMin">
<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">
@@ -588,128 +623,11 @@
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="onChangeColormapRange"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="buttonAutomatic">
<Component class="javax.swing.JLabel" name="labelMax">
<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"/>
<Property name="text" type="java.lang.String" value="Max:"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkHistogram">
<Properties>
<Property name="text" type="java.lang.String" value="Histogram"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkHistogramActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JPanel" name="jPanel8">
<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="103" alignment="1" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonGrayscale" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonInverted" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<Component id="buttonFlame" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
<Component id="buttonTemperature" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonRainbow" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="buttonGrayscale" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="buttonInverted" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="buttonFlame" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="buttonRainbow" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="buttonTemperature" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JRadioButton" name="buttonInverted">
<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="Inverted"/>
</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="buttonFlame">
<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="Flame"/>
</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="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="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>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel5">
@@ -892,31 +810,30 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="checkBackground" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="checkGoodRegion" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Component id="labelGrScale" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="spinnerGrScale" linkSize="8" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="labelGrThreshold" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="spinnerGrThreshold" linkSize="8" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="checkBackground" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="checkThreshold" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="spinnerThreshold" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="checkGoodRegion" min="-2" 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="spinnerGrScale" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="spinnerGrThreshold" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Component id="spinnerThreshold" linkSize="8" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -934,14 +851,14 @@
<Group type="103" groupAlignment="3" attributes="0">
<Component id="checkGoodRegion" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="spinnerGrScale" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="labelGrScale" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="spinnerGrThreshold" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="labelGrThreshold" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -949,7 +866,7 @@
<SubComponents>
<Component class="javax.swing.JCheckBox" name="checkThreshold">
<Properties>
<Property name="text" type="java.lang.String" value="Threshold:"/>
<Property name="text" type="java.lang.String" value="Threshold"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkThresholdActionPerformed"/>
@@ -960,7 +877,6 @@
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="0.0" maximum="99999.0" minimum="0.0" numberType="java.lang.Double" stepSize="1.0" 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="[77, 20]"/>
</Property>
@@ -990,7 +906,6 @@
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="3.0" maximum="100.0" minimum="0.01" numberType="java.lang.Double" stepSize="1.0" 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="[77, 20]"/>
</Property>
@@ -1004,7 +919,6 @@
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="0.5" maximum="1.0" minimum="0.04" numberType="java.lang.Double" stepSize="0.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="[77, 20]"/>
</Property>
@@ -1013,12 +927,12 @@
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spinnerGrThresholdonChange"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Component class="javax.swing.JLabel" name="labelGrThreshold">
<Properties>
<Property name="text" type="java.lang.String" value="Threshold:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Component class="javax.swing.JLabel" name="labelGrScale">
<Properties>
<Property name="text" type="java.lang.String" value="Scale:"/>
</Properties>

View File

@@ -149,6 +149,7 @@ public class ScreenPanelDev extends Panel {
yRms = getCamtoolDouble("y_rms");
if (goodRegion){
double[] gX2 = new double[x_profile.length];
Arrays.fill(gX2, Double.NaN);
try{
double x = getCamtoolDoubleArray("gr_x_axis")[0];
System.arraycopy(x_fit_gauss_function, 0, gX2, (int) ((renderer.getCalibration() != null) ? renderer.getCalibration().convertToImageX(x): x), x_fit_gauss_function.length);
@@ -156,6 +157,7 @@ public class ScreenPanelDev extends Panel {
}
x_fit_gauss_function = gX2;
double[] gY2 = new double[y_profile.length];
Arrays.fill(gY2, Double.NaN);
try{
double y = getCamtoolDoubleArray("gr_y_axis")[0];
System.arraycopy(y_fit_gauss_function, 0, gY2, (int) ((renderer.getCalibration() != null) ? renderer.getCalibration().convertToImageY(y): y), y_fit_gauss_function.length);
@@ -193,9 +195,15 @@ public class ScreenPanelDev extends Panel {
public ScreenPanelDev() {
initComponents();
spinnerThreshold.setVisible(false);
spinnerGrThreshold.setVisible(false); labelGrThreshold.setVisible(false);
spinnerGrScale.setVisible(false); labelGrScale.setVisible(false);
//spinnerMin.setVisible(false); labelMin.setVisible(false);
//spinnerMax.setVisible(false); labelMax.setVisible(false);
renderer.setPersistenceFile(Paths.get(getContext().getSetup().getContextPath(), "Renderer_Cameras.bin"));
setPersistedComponents(new Component[]{buttonCamtool, buttonDirect});
comboCameras.setEnabled(false);
SwingUtils.setEnumCombo(comboColormap, Colormap.class);
if (App.hasArgument("poll")) {
try {
polling = Integer.valueOf(App.getArgumentValue("poll"));
@@ -593,9 +601,9 @@ public class ScreenPanelDev extends Panel {
parseUserOverlays();
errorOverlay = null;
checkBackground.setEnabled(false);
spinnerThreshold.setEnabled(false);
spinnerGrThreshold.setEnabled(false);
spinnerGrScale.setEnabled(false);
spinnerThreshold.setVisible(false);
spinnerGrThreshold.setVisible(false); labelGrThreshold.setVisible(false);
spinnerGrScale.setVisible(false); labelGrScale.setVisible(false);
checkThreshold.setEnabled(false);
checkGoodRegion.setEnabled(false);
@@ -610,8 +618,10 @@ public class ScreenPanelDev extends Panel {
calibrationDialolg = null;
}
boolean was_camtool = false;
if (camera != null) {
//camera.removeAllListeners();
was_camtool = camera instanceof Camtool;
camera.close();
camera = null;
}
@@ -668,7 +678,7 @@ public class ScreenPanelDev extends Panel {
if (camera instanceof Camtool) {
//Managing no background exception. Can be done in a better way?
checkBackground.setEnabled(true);
if (changed) {
if (changed || !was_camtool) {
((Camtool) camera).startPipeline(cameraName, null);
updateCamtoolControls();
} else {
@@ -680,9 +690,6 @@ public class ScreenPanelDev extends Panel {
}
((Camtool) camera).startPipeline(cameraName, null, checkBackground.isSelected(), null, checkThreshold.isSelected() ? (Double) spinnerThreshold.getValue() : null, gr);
}
spinnerThreshold.setEnabled(true);
spinnerGrThreshold.setEnabled(true);
spinnerGrScale.setEnabled(true);
checkThreshold.setEnabled(true);
checkGoodRegion.setEnabled(true);
@@ -690,6 +697,8 @@ public class ScreenPanelDev extends Panel {
} else {
checkBackground.setEnabled(true);
checkBackground.setSelected(false);
checkThreshold.setSelected(false);
checkGoodRegion.setSelected(false);
if (polling <= 0) {
camera.setMonitored(true);
} else {
@@ -877,26 +886,7 @@ public class ScreenPanelDev extends Panel {
try {
if ((camera != null) && (camera instanceof ColormapSource)) {
ColormapSourceConfig config = ((ColormapSource) camera).getConfig();
switch (config.colormap) {
case Grayscale:
buttonGrayscale.setSelected(true);
break;
case Rainbow:
buttonRainbow.setSelected(true);
break;
case Temperature:
buttonTemperature.setSelected(true);
break;
case Flame:
buttonFlame.setSelected(true);
break;
case Inverted:
buttonInverted.setSelected(true);
break;
default:
buttonGroup2.clearSelection();
}
comboColormap.setSelectedItem(config.colormap);
if (config.isDefaultColormap()) {
buttonFullRange.setSelected(true);
} else if (config.colormapAutomatic) {
@@ -905,6 +895,8 @@ public class ScreenPanelDev extends Panel {
buttonManual.setSelected(true);
}
//spinnerMin.setVisible(buttonManual.isSelected()); labelMin.setVisible(spinnerMin.isVisible());
//spinnerMax.setVisible(buttonManual.isSelected()); labelMax.setVisible(spinnerMax.isVisible());
spinnerMin.setEnabled(buttonManual.isSelected());
spinnerMax.setEnabled(buttonManual.isSelected());
spinnerMin.setValue(Double.isNaN(config.colormapMin) ? 0 : Math.min(Math.max((int) config.colormapMin, 0), 65535));
@@ -935,6 +927,9 @@ public class ScreenPanelDev extends Panel {
} catch (Exception ex) {
}
goodRegion = checkGoodRegion.isSelected();
spinnerThreshold.setVisible(checkThreshold.isSelected());
spinnerGrThreshold.setVisible(goodRegion); labelGrThreshold.setVisible(spinnerGrThreshold.isVisible());
spinnerGrScale.setVisible(goodRegion); labelGrScale.setVisible(spinnerGrScale.isVisible());
updatingCamtoolControls = false;
}
}
@@ -1029,7 +1024,7 @@ public class ScreenPanelDev extends Panel {
}
xMean = id.xMean; xSigma = id.xSigma;yMean = id.yMean;ySigma = id.ySigma;
gX = id.x_fit_gauss_function; gY = id.y_fit_gauss_function;
pX = id.x_profile;pY = id.y_profile;
pX = id.x_profile; pY = id.y_profile;
xCom = id.xCom; xRms = id.xRms; yCom = id.yCom; yRms = id.yRms;
profileSize /= 4;
@@ -1044,16 +1039,23 @@ public class ScreenPanelDev extends Panel {
double rangePlot = max - min;
for (int i = 0; i < x.length; i++) {
if (gX != null) {
y[i] = (int) (height - 1 - (((gX[i] - minPlot) / rangePlot) * profileSize));
if (gX != null) {
y[i] = (int) (height - 1 - (((gX[i] - minPlot) / rangePlot) * profileSize));
}
p[i] = (int) (height - 1 - (((pX[i] - minPlot) / rangePlot) * profileSize));
}
if (goodRegion){
for (int i = 0; i < x.length; i++) {
y[i] = (Double.isNaN(gX[i])) ? 100000 : y[i];
}
}
vgaussian = new Overlays.Polyline(penFit, x, y);
vprofile = new Overlays.Polyline(renderer.getPenProfile(), x, p);
}
if (pX != null) {
if (pY != null) {
int[] y = Arr.indexesInt(pY.length);
int[] x = new int[pY.length];
int[] p = new int[pY.length];
@@ -1066,10 +1068,16 @@ public class ScreenPanelDev extends Panel {
for (int i = 0; i < x.length; i++) {
if (gY != null) {
x[i] = (int) (((gY[i] - minPlot) / rangePlot) * profileSize);
x[i] = (int) (((gY[i] - minPlot) / rangePlot) * profileSize);
}
p[i] = (int) (((pY[i] - minPlot) / rangePlot) * profileSize);
}
if (goodRegion){
for (int i = 0; i < x.length; i++) {
x[i] = (Double.isNaN(gY[i])) ? -1 :x[i];
}
}
hgaussian = new Overlays.Polyline(penFit, x, y);
hprofile = new Overlays.Polyline(renderer.getPenProfile(), p, y);
}
@@ -1827,20 +1835,17 @@ public class ScreenPanelDev extends Panel {
buttonZoom05 = new javax.swing.JRadioButton();
buttonZoom2 = new javax.swing.JRadioButton();
jPanel2 = new javax.swing.JPanel();
buttonFullRange = new javax.swing.JRadioButton();
buttonManual = new javax.swing.JRadioButton();
checkHistogram = new javax.swing.JCheckBox();
comboColormap = new javax.swing.JComboBox();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
buttonFullRange = new javax.swing.JRadioButton();
buttonManual = new javax.swing.JRadioButton();
buttonAutomatic = new javax.swing.JRadioButton();
labelMin = new javax.swing.JLabel();
spinnerMin = new javax.swing.JSpinner();
spinnerMax = new javax.swing.JSpinner();
buttonAutomatic = new javax.swing.JRadioButton();
checkHistogram = new javax.swing.JCheckBox();
jPanel8 = new javax.swing.JPanel();
buttonInverted = new javax.swing.JRadioButton();
buttonFlame = new javax.swing.JRadioButton();
buttonTemperature = new javax.swing.JRadioButton();
buttonRainbow = new javax.swing.JRadioButton();
buttonGrayscale = new javax.swing.JRadioButton();
labelMax = new javax.swing.JLabel();
jPanel5 = new javax.swing.JPanel();
buttonCamtool = new javax.swing.JRadioButton();
buttonDirect = new javax.swing.JRadioButton();
@@ -1858,8 +1863,8 @@ public class ScreenPanelDev extends Panel {
checkGoodRegion = new javax.swing.JCheckBox();
spinnerGrScale = new javax.swing.JSpinner();
spinnerGrThreshold = new javax.swing.JSpinner();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
labelGrThreshold = new javax.swing.JLabel();
labelGrScale = new javax.swing.JLabel();
setPreferredSize(new java.awt.Dimension(873, 600));
@@ -2122,7 +2127,7 @@ public class ScreenPanelDev extends Panel {
.addComponent(buttonZoom025)
.addComponent(buttonZoom05)
.addComponent(buttonZoom2))
.addGap(47, 47, 47))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -2144,8 +2149,27 @@ public class ScreenPanelDev extends Panel {
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Colormap"));
checkHistogram.setText("Histogram");
checkHistogram.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkHistogramActionPerformed(evt);
}
});
comboColormap.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel3.setText("Type:");
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel4.setText("Range:");
buttonGroup3.add(buttonFullRange);
buttonFullRange.setText("Full range");
buttonFullRange.setText("Full");
buttonFullRange.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
@@ -2160,9 +2184,15 @@ public class ScreenPanelDev extends Panel {
}
});
jLabel3.setText("Min:");
buttonGroup3.add(buttonAutomatic);
buttonAutomatic.setText("Automatic");
buttonAutomatic.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
jLabel4.setText("Max:");
labelMin.setText("Min:");
spinnerMin.setModel(new javax.swing.SpinnerNumberModel(0, 0, 65535, 1));
spinnerMin.setEnabled(false);
@@ -2182,148 +2212,63 @@ public class ScreenPanelDev extends Panel {
}
});
buttonGroup3.add(buttonAutomatic);
buttonAutomatic.setText("Automatic");
buttonAutomatic.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
checkHistogram.setText("Histogram");
checkHistogram.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkHistogramActionPerformed(evt);
}
});
buttonGroup2.add(buttonInverted);
buttonInverted.setText("Inverted");
buttonInverted.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
buttonGroup2.add(buttonFlame);
buttonFlame.setText("Flame");
buttonFlame.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);
}
});
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(buttonGrayscale);
buttonGrayscale.setText("Grayscale");
buttonGrayscale.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
onChangeColormap(evt);
}
});
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonGrayscale)
.addComponent(buttonInverted))
.addGap(20, 20, 20))
.addComponent(buttonFlame))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonTemperature)
.addComponent(buttonRainbow)))
.addGap(0, 0, 0))
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(0, 0, 0)
.addComponent(buttonGrayscale)
.addGap(0, 0, 0)
.addComponent(buttonInverted)
.addGap(0, 0, 0)
.addComponent(buttonFlame)
.addGap(0, 0, 0)
.addComponent(buttonRainbow)
.addGap(0, 0, 0)
.addComponent(buttonTemperature)
.addGap(0, 0, 0))
);
labelMax.setText("Max:");
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()
.addGap(4, 4, 4)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(checkHistogram)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonAutomatic)
.addComponent(buttonFullRange)
.addComponent(buttonManual)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel3))
.addGap(2, 2, 2)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(spinnerMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(spinnerMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel3)
.addComponent(jLabel4))
.addGap(4, 4, 4)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonAutomatic)
.addComponent(buttonFullRange)
.addComponent(buttonManual)
.addComponent(comboColormap, 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)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addComponent(labelMax)
.addGap(2, 2, 2)
.addComponent(spinnerMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addComponent(labelMin)
.addGap(2, 2, 2)
.addComponent(spinnerMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(checkHistogram, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap())
);
jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerMax, spinnerMin});
jPanel2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel3, jLabel4});
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addGap(4, 4, 4)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(buttonAutomatic)
.addGap(0, 0, 0)
.addComponent(buttonFullRange)
.addGap(0, 0, 0)
.addComponent(buttonManual)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.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)
.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)))
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(checkHistogram))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(comboColormap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(checkHistogram))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonAutomatic)
.addComponent(jLabel4))
.addGap(0, 0, 0)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(labelMin)
.addComponent(spinnerMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonFullRange))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(buttonManual)
.addComponent(labelMax)
.addComponent(spinnerMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Source"));
@@ -2430,7 +2375,7 @@ public class ScreenPanelDev extends Panel {
panelScreen2.setBorder(javax.swing.BorderFactory.createTitledBorder("Image"));
checkThreshold.setText("Threshold:");
checkThreshold.setText("Threshold");
checkThreshold.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkThresholdActionPerformed(evt);
@@ -2438,7 +2383,6 @@ public class ScreenPanelDev extends Panel {
});
spinnerThreshold.setModel(new javax.swing.SpinnerNumberModel(0.0d, 0.0d, 99999.0d, 1.0d));
spinnerThreshold.setEnabled(false);
spinnerThreshold.setPreferredSize(new java.awt.Dimension(77, 20));
spinnerThreshold.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
@@ -2461,7 +2405,6 @@ public class ScreenPanelDev extends Panel {
});
spinnerGrScale.setModel(new javax.swing.SpinnerNumberModel(3.0d, 0.01d, 100.0d, 1.0d));
spinnerGrScale.setEnabled(false);
spinnerGrScale.setPreferredSize(new java.awt.Dimension(77, 20));
spinnerGrScale.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
@@ -2470,7 +2413,6 @@ public class ScreenPanelDev extends Panel {
});
spinnerGrThreshold.setModel(new javax.swing.SpinnerNumberModel(0.5d, 0.04d, 1.0d, 0.1d));
spinnerGrThreshold.setEnabled(false);
spinnerGrThreshold.setPreferredSize(new java.awt.Dimension(77, 20));
spinnerGrThreshold.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
@@ -2478,9 +2420,9 @@ public class ScreenPanelDev extends Panel {
}
});
jLabel5.setText("Threshold:");
labelGrThreshold.setText("Threshold:");
jLabel6.setText("Scale:");
labelGrScale.setText("Scale:");
javax.swing.GroupLayout panelScreen2Layout = new javax.swing.GroupLayout(panelScreen2);
panelScreen2.setLayout(panelScreen2Layout);
@@ -2489,26 +2431,29 @@ public class ScreenPanelDev extends Panel {
.addGroup(panelScreen2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(panelScreen2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(checkBackground)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelScreen2Layout.createSequentialGroup()
.addComponent(checkGoodRegion)
.addGap(18, 18, Short.MAX_VALUE)
.addComponent(labelGrScale)
.addGap(2, 2, 2)
.addComponent(spinnerGrScale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelScreen2Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(labelGrThreshold)
.addGap(2, 2, 2)
.addComponent(spinnerGrThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(panelScreen2Layout.createSequentialGroup()
.addComponent(checkBackground)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(panelScreen2Layout.createSequentialGroup()
.addComponent(checkThreshold)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(spinnerThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(panelScreen2Layout.createSequentialGroup()
.addGroup(panelScreen2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(panelScreen2Layout.createSequentialGroup()
.addComponent(checkGoodRegion)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(spinnerGrScale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(panelScreen2Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(spinnerGrThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())))
.addGap(18, 18, Short.MAX_VALUE)
.addComponent(spinnerThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
panelScreen2Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerGrScale, spinnerGrThreshold, spinnerThreshold});
panelScreen2Layout.setVerticalGroup(
panelScreen2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelScreen2Layout.createSequentialGroup()
@@ -2522,12 +2467,12 @@ public class ScreenPanelDev extends Panel {
.addGroup(panelScreen2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(checkGoodRegion)
.addComponent(spinnerGrScale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addComponent(labelGrScale))
.addGap(2, 2, 2)
.addGroup(panelScreen2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerGrThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(labelGrThreshold))
.addContainerGap())
);
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
@@ -2544,7 +2489,7 @@ public class ScreenPanelDev extends Panel {
.addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(pauseSelection, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addComponent(panelScreen2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -2789,23 +2734,23 @@ public class ScreenPanelDev extends Panel {
private void onChangeColormap(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onChangeColormap
try {
if ((camera != null) && (camera instanceof ColormapSource) && !updatingColormap) {
if ((camera != null) && (camera instanceof ColormapSource) && !updatingColormap) {
ColormapSource source = (ColormapSource) camera;
Color colorReticule = new Color(16, 16, 16);
Color colorMarker = new Color(128, 128, 128);
if (buttonGrayscale.isSelected() || buttonInverted.isSelected()) {
colorReticule = new Color(0, 192, 0);
colorMarker = new Color(64, 255, 64);
source.getConfig().colormap = buttonGrayscale.isSelected() ? Colormap.Grayscale : Colormap.Inverted;
} else if (buttonFlame.isSelected()) {
colorReticule = new Color(0, 192, 0);
colorMarker = new Color(64, 255, 64);
source.getConfig().colormap = Colormap.Flame;
} else if (buttonTemperature.isSelected()) {
source.getConfig().colormap = Colormap.Temperature;
} else if (buttonRainbow.isSelected()) {
source.getConfig().colormap = Colormap.Rainbow;
source.getConfig().colormap = (Colormap)comboColormap.getSelectedItem();
switch (source.getConfig().colormap){
case Grayscale:
case Inverted:
colorReticule = new Color(0, 192, 0);
colorMarker = new Color(64, 255, 64);
break;
case Flame:
colorReticule = new Color(0, 192, 0);
colorMarker = new Color(64, 255, 64);
break;
}
renderer.setPenReticle(new Pen(colorReticule));
renderer.setPenProfile(new Pen(colorReticule, 0));
renderer.setPenMarker(new Pen(colorMarker, 2));
@@ -2815,14 +2760,15 @@ public class ScreenPanelDev extends Panel {
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();
source.refresh();
if (buttonPause.isSelected()) {
updatePause();
}
updateColormap();
}
} catch (Exception ex) {
showException(ex);
}
}
}//GEN-LAST:event_onChangeColormap
private void onChangeColormapRange(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_onChangeColormapRange
@@ -2966,7 +2912,7 @@ public class ScreenPanelDev extends Panel {
if (!updatingCamtoolControls) {
try {
if ((camera instanceof Camtool) && (((Camtool) camera).isPipelineStarted())) {
spinnerThreshold.setEnabled(checkThreshold.isSelected());
spinnerThreshold.setVisible(checkThreshold.isSelected());
((Camtool) camera).setThreshold(checkThreshold.isSelected() ? (Double) spinnerThreshold.getValue() : null);
}
} catch (Exception ex) {
@@ -3012,8 +2958,8 @@ public class ScreenPanelDev extends Panel {
if (!updatingCamtoolControls) {
try {
if ((camera instanceof Camtool) && (((Camtool) camera).isPipelineStarted())) {
spinnerGrScale.setEnabled(checkGoodRegion.isSelected());
spinnerGrThreshold.setEnabled(checkGoodRegion.isSelected());
spinnerGrScale.setVisible(checkGoodRegion.isSelected()); labelGrScale.setVisible(spinnerGrScale.isVisible());
spinnerGrThreshold.setVisible(checkGoodRegion.isSelected()); labelGrThreshold.setVisible(spinnerGrThreshold.isVisible());
if (checkGoodRegion.isSelected()){
((Camtool) camera).setGoodRegion( (Double)spinnerGrThreshold.getValue(), (Double)spinnerGrScale.getValue() );
} else {
@@ -3048,24 +2994,19 @@ public class ScreenPanelDev extends Panel {
private javax.swing.JButton buttonConfig;
private javax.swing.JRadioButton buttonDirect;
private javax.swing.JToggleButton buttonFit;
private javax.swing.JRadioButton buttonFlame;
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.ButtonGroup buttonGroup4;
private javax.swing.JRadioButton buttonInverted;
private javax.swing.JRadioButton buttonManual;
private javax.swing.JToggleButton buttonMarker;
private javax.swing.JToggleButton buttonPause;
private javax.swing.JToggleButton buttonProfile;
private javax.swing.JRadioButton buttonRainbow;
private javax.swing.JToggleButton buttonReticle;
private javax.swing.JToggleButton buttonSave;
private javax.swing.JButton buttonStop;
private javax.swing.JRadioButton buttonTemperature;
private javax.swing.JRadioButton buttonZoom025;
private javax.swing.JRadioButton buttonZoom05;
private javax.swing.JRadioButton buttonZoom2;
@@ -3077,14 +3018,13 @@ public class ScreenPanelDev extends Panel {
private javax.swing.JCheckBox checkHistogram;
private javax.swing.JCheckBox checkThreshold;
private javax.swing.JComboBox comboCameras;
private javax.swing.JComboBox comboColormap;
private javax.swing.JComboBox comboFilter;
private javax.swing.JComboBox comboScreen;
private javax.swing.JLabel jLabel1;
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.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
@@ -3092,8 +3032,11 @@ public class ScreenPanelDev extends Panel {
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JProgressBar jProgressBar1;
private javax.swing.JLabel labelGrScale;
private javax.swing.JLabel labelGrThreshold;
private javax.swing.JLabel labelMax;
private javax.swing.JLabel labelMin;
private javax.swing.JPanel panelScreen;
private javax.swing.JPanel panelScreen1;
private javax.swing.JPanel panelScreen2;

View File

@@ -77,7 +77,7 @@ finally:
x.close()
phase_offset = 90 - ph_crest
amplitude_scale = energy_max / Ampl
amplitude_scale = fit_amplitude / Ampl
power_scale = Power / math.pow(Ampl,2)
caput(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", phase_offset)

View File

@@ -77,7 +77,7 @@ finally:
x.close()
phase_offset = 90 - ph_crest
amplitude_scale = energy_max / Ampl
amplitude_scale = fit_amplitude / Ampl
power_scale = Power / math.pow(Ampl,2)
caput(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", phase_offset)