This commit is contained in:
sfop
2016-09-13 11:22:59 +02:00
parent a1ed83ff62
commit 2da6aa2ee8
3 changed files with 339 additions and 47 deletions

View File

@@ -1,12 +1,12 @@
#Tue Sep 13 08:34:13 CEST 2016
colormap=Temperature
colormapAutomatic=false
#Tue Sep 13 11:19:17 CEST 2016
colormap=Grayscale
colormapAutomatic=true
colormapMax=0.0
colormapMin=0.0
flipHorizontally=false
flipVertically=false
flipHorizontally=true
flipVertically=true
grayscale=false
imageHeight=1024
imageHeight=1628
imageWidth=1280
invert=false
rescaleFactor=1.0
@@ -18,9 +18,9 @@ roiY=0
rotation=0.0
rotationCrop=true
scale=1.0
spatialCalOffsetX=NaN
spatialCalOffsetY=NaN
spatialCalScaleX=NaN
spatialCalScaleY=NaN
spatialCalOffsetX=-685.0
spatialCalOffsetY=-874.0
spatialCalScaleX=14.146772767462423
spatialCalScaleY=12.708498808578236
spatialCalUnits=mm
transpose=false

View File

@@ -219,12 +219,14 @@
<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="jPanel2" alignment="0" max="32767" attributes="0"/>
<Component id="jPanel3" alignment="0" max="32767" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jPanel3" max="32767" attributes="0"/>
<Component id="jPanel2" alignment="0" pref="0" max="32767" attributes="0"/>
<Component id="jPanel5" alignment="0" max="32767" attributes="0"/>
<Component id="panelScreen" alignment="0" max="32767" attributes="0"/>
<Component id="panelScreen1" alignment="1" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -235,11 +237,15 @@
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="jPanel5" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="panelScreen" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="panelScreen1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -366,7 +372,7 @@
<Component id="buttonFullRange" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonManual" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="24" max="32767" attributes="0"/>
<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"/>
@@ -605,6 +611,106 @@
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="panelScreen">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Screen"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="valueScreen" max="32767" attributes="0"/>
<Component id="comboScreen" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="comboScreen" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="valueScreen" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="valueScreen">
</Component>
<Component class="javax.swing.JComboBox" name="comboScreen">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboScreenActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="panelScreen1">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Filter"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="valueFilter" alignment="0" max="32767" attributes="0"/>
<Component id="comboFilter" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="comboFilter" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="valueFilter" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="valueFilter">
</Component>
<Component class="javax.swing.JComboBox" name="comboFilter">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboFilterActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>

View File

@@ -22,6 +22,7 @@ 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.epics.DiscretePositioner;
import ch.psi.pshell.imaging.Colormap;
import ch.psi.pshell.imaging.ColormapSource;
import ch.psi.pshell.imaging.ColormapSource.ColormapSourceConfig;
@@ -73,7 +74,7 @@ public class Cameras extends Panel {
initComponents();
renderer.setPersistenceFile(Paths.get(getController().getSetup().getContextPath(), "Renderer_Cameras.bin"));
renderer.setProfileFactor(4);
//setPersistedComponents(new Component[]{buttonCamtool, buttonDirect});
setPersistedComponents(new Component[]{buttonCamtool, buttonDirect});
comboCameras.setEnabled(false);
if (App.hasArgument("poll")) {
try{
@@ -96,9 +97,10 @@ public class Cameras extends Panel {
public void onStart() {
super.onStart();
if (App.hasArgument("ct")) {
buttonCamtool.setSelected(!App.getArgumentValue("ct").equals("0") && !App.getArgumentValue("ct").equalsIgnoreCase("false"));
buttonDirect.setSelected(!buttonCamtool.isSelected());
}
boolean direct = App.getArgumentValue("ct").equals("0") || App.getArgumentValue("ct").equalsIgnoreCase("false");
buttonCamtool.setSelected(!direct);
buttonDirect.setSelected(direct);
}
}
final String configFolder = "/afs/psi.ch/intranet/SF/Applications/config/camtool";
@@ -110,6 +112,8 @@ public class Cameras extends Panel {
int polling = 1000;
Overlay marker = null;
JDialog histogramDialog;
DiscretePositioner screen;
DiscretePositioner filter;
//Overridable callbacks
@Override
@@ -282,6 +286,14 @@ public class Cameras extends Panel {
renderer.clear();
renderer.resetZoom();
}
if (screen!=null){
screen.close();
screen = null;
}
if (filter!=null){
filter.close();
filter = null;
}
try {
Path configFile = Paths.get(configFolder, cameraName + ".json");
cameraConfigJson = new String(Files.readAllBytes(configFile));
@@ -388,7 +400,46 @@ public class Cameras extends Panel {
} finally {
checkReticle();
onTimer();
}
}
try {
screen = new DiscretePositioner(cameraName+":SET_SCREEN1_POS", cameraName+":GET_SCREEN1_POS");
screen.initialize();
DefaultComboBoxModel model = new DefaultComboBoxModel();
for (String pos: screen.getPositions()){
String aux = pos.toLowerCase();
if (!aux.contains("moving") && !aux.contains("n/a")){
model.addElement(pos);
};
}
comboScreen.setModel(model);
comboScreen.setSelectedItem(screen.read());
} catch (Exception ex) {
comboScreen.setModel(new DefaultComboBoxModel());
ex.printStackTrace();
screen = null;
}
comboScreen.setEnabled(screen!=null);
valueScreen.setDevice(screen);
try {
filter = new DiscretePositioner(cameraName+":SET_FILTER", cameraName+":GET_FILTER");
filter.initialize();
DefaultComboBoxModel model = new DefaultComboBoxModel();
for (String pos: filter.getPositions()){
if (!pos.contains("busy")) model.addElement(pos);
}
comboFilter.setModel(model);
comboFilter.setSelectedItem(filter.read());
} catch (Exception ex) {
comboFilter.setModel(new DefaultComboBoxModel());
ex.printStackTrace();
filter = null;
}
comboFilter.setEnabled(filter!=null);
valueFilter.setDevice(filter);
}
void checkReticle(){
@@ -403,12 +454,22 @@ public class Cameras extends Panel {
}
void updateZoom(){
try{
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));
buttonZoomFit.setSelected(renderer.getMode() == RendererMode.Fit);
if (renderer.getMode() == RendererMode.Fixed){
buttonZoomNormal.setSelected(true);
} else if (renderer.getMode() == RendererMode.Zoom){
if (renderer.getZoom()==1){
buttonZoomNormal.setSelected(true);
}else if (renderer.getZoom()==0.5){
buttonZoom05.setSelected(true);
}else if (renderer.getZoom()==0.25){
buttonZoom025.setSelected(true);
} else{
buttonGroup1.clearSelection();
}
}
}catch (Exception ex) {
ex.printStackTrace();
}
@@ -418,13 +479,21 @@ public class Cameras extends Panel {
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((!config.colormapAutomatic) && (!config.isDefaultColormap()));
switch (config.colormap){
case Grayscale: buttonGrayscale.setSelected(true);
case Rainbow: buttonRainbow.setSelected(true);
case Temperature: buttonTemperature.setSelected(true);
default: buttonGroup2.clearSelection();
}
if (config.isDefaultColormap()){
buttonFullRange.setSelected(true);
} else if (config.colormapAutomatic){
buttonAutomatic.setSelected(true);
} else {
buttonManual.setSelected(true);
}
spinnerMin.setEnabled(buttonManual.isSelected());
spinnerMax.setEnabled(buttonManual.isSelected());
spinnerMin.setValue(Double.isNaN(config.colormapMin) ? 0 : Math.min(Math.max((int)config.colormapMin, 0), 65535));
@@ -437,6 +506,12 @@ public class Cameras extends Panel {
@Override
protected void onTimer() {
for (Device dev : new Device[]{screen, filter}){
if (dev!=null){
dev.request();
}
}
textState.setText((camera == null) ? "" : camera.getState().toString());
buttonConfig.setEnabled(camera != null);
if (App.hasArgument("s")){
@@ -846,6 +921,12 @@ public class Camtool extends ArraySource {
jPanel5 = new javax.swing.JPanel();
buttonCamtool = new javax.swing.JRadioButton();
buttonDirect = new javax.swing.JRadioButton();
panelScreen = new javax.swing.JPanel();
valueScreen = new ch.psi.pshell.swing.DeviceValuePanel();
comboScreen = new javax.swing.JComboBox();
panelScreen1 = new javax.swing.JPanel();
valueFilter = new ch.psi.pshell.swing.DeviceValuePanel();
comboFilter = new javax.swing.JComboBox();
buttonGrabBackground.setText("Grab Background");
buttonGrabBackground.addActionListener(new java.awt.event.ActionListener() {
@@ -1150,7 +1231,7 @@ public class Camtool extends ArraySource {
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonFullRange)
.addComponent(buttonManual))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
.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))
@@ -1239,16 +1320,78 @@ public class Camtool extends ArraySource {
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
panelScreen.setBorder(javax.swing.BorderFactory.createTitledBorder("Screen"));
comboScreen.setEnabled(false);
comboScreen.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
comboScreenActionPerformed(evt);
}
});
javax.swing.GroupLayout panelScreenLayout = new javax.swing.GroupLayout(panelScreen);
panelScreen.setLayout(panelScreenLayout);
panelScreenLayout.setHorizontalGroup(
panelScreenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelScreenLayout.createSequentialGroup()
.addContainerGap()
.addGroup(panelScreenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(valueScreen, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(comboScreen, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
panelScreenLayout.setVerticalGroup(
panelScreenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelScreenLayout.createSequentialGroup()
.addContainerGap()
.addComponent(comboScreen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(valueScreen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
panelScreen1.setBorder(javax.swing.BorderFactory.createTitledBorder("Filter"));
comboFilter.setEnabled(false);
comboFilter.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
comboFilterActionPerformed(evt);
}
});
javax.swing.GroupLayout panelScreen1Layout = new javax.swing.GroupLayout(panelScreen1);
panelScreen1.setLayout(panelScreen1Layout);
panelScreen1Layout.setHorizontalGroup(
panelScreen1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(panelScreen1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(panelScreen1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(valueFilter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(comboFilter, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
panelScreen1Layout.setVerticalGroup(
panelScreen1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelScreen1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(comboFilter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(valueFilter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(panelScreen, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(panelScreen1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel4Layout.setVerticalGroup(
@@ -1256,11 +1399,15 @@ public class Camtool extends ArraySource {
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(panelScreen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(panelScreen1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@@ -1420,6 +1567,7 @@ public class Camtool extends ArraySource {
private void buttonZoomNormalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonZoomNormalActionPerformed
try {
renderer.setMode(RendererMode.Fixed);
renderer.setViewPosition(new Point(0,0));
} catch (Exception ex) {
showException(ex);
}
@@ -1450,18 +1598,20 @@ public class Camtool extends ArraySource {
private void buttonZoom025ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonZoom025ActionPerformed
renderer.setZoom(0.25);
renderer.setMode(RendererMode.Zoom);
renderer.setViewPosition(new Point(0,0));
}//GEN-LAST:event_buttonZoom025ActionPerformed
private void buttonZoom05ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonZoom05ActionPerformed
renderer.setZoom(0.5);
renderer.setMode(RendererMode.Zoom);
renderer.setMode(RendererMode.Zoom);
renderer.setViewPosition(new Point(0,0));
}//GEN-LAST:event_buttonZoom05ActionPerformed
private void buttonHistogramActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonHistogramActionPerformed
try {
if (buttonHistogram.isSelected()){
if ((histogramDialog==null)||(!histogramDialog.isShowing())){
Histogram histogram = new Histogram();
Histogram histogram = new Histogram(true);
histogram.setRenderer(renderer);
histogramDialog = SwingUtils.showDialog(SwingUtils.getWindow(renderer), "Histogram", null, histogram);
renderer.refresh();
@@ -1485,6 +1635,36 @@ public class Camtool extends ArraySource {
comboCamerasActionPerformed(null);
}//GEN-LAST:event_buttonDirectActionPerformed
private void comboScreenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboScreenActionPerformed
ChannelInteger setpoint = null;
try {
int index = comboScreen.getSelectedIndex();
setpoint = new ChannelInteger(null, cameraName+":SET_SCREEN1_POS");
setpoint.initialize();
if (setpoint.read()!=index){
setpoint.write(index);
}
screen.read();
} catch (Exception ex) {
showException(ex);
}
if (setpoint!=null){
setpoint.close();
}
}//GEN-LAST:event_comboScreenActionPerformed
private void comboFilterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboFilterActionPerformed
try {
String setpoint = (String) comboFilter.getSelectedItem();
if (!setpoint.equals(filter.read())){
filter.write(setpoint);
}
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_comboFilterActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JRadioButton buttonAutomatic;
private javax.swing.JRadioButton buttonCamtool;
@@ -1513,6 +1693,8 @@ public class Camtool extends ArraySource {
private javax.swing.JRadioButton buttonZoomNormal;
private javax.swing.JRadioButton buttonZoomStretch;
private javax.swing.JComboBox comboCameras;
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;
@@ -1522,9 +1704,13 @@ public class Camtool extends ArraySource {
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel panelScreen;
private javax.swing.JPanel panelScreen1;
private ch.psi.pshell.imaging.Renderer renderer;
private javax.swing.JSpinner spinnerMax;
private javax.swing.JSpinner spinnerMin;
private javax.swing.JTextField textState;
private ch.psi.pshell.swing.DeviceValuePanel valueFilter;
private ch.psi.pshell.swing.DeviceValuePanel valueScreen;
// End of variables declaration//GEN-END:variables
}