This commit is contained in:
x03daop
2016-07-26 15:58:28 +02:00
parent b9b0415e83
commit 652babc564
4 changed files with 37 additions and 16 deletions

View File

@@ -38,10 +38,20 @@ public class HoloScan extends Panel {
Motor theta = (Motor) getDevice("ManipulatorTheta");
motorPanelPhi.setDevice(phi);
motorPanelTheta.setDevice(theta);
spinnerFromPhi.setModel(new SpinnerNumberModel(phi.getMinValue(), phi.getMinValue(), phi.getMaxValue(), 1.0));
spinnerToPhi.setModel(new SpinnerNumberModel(phi.getMaxValue(), phi.getMinValue(), phi.getMaxValue(), 1.0));
spinnerFromTheta.setModel(new SpinnerNumberModel(theta.getMinValue(), theta.getMinValue(), theta.getMaxValue(), 1.0));
spinnerToTheta.setModel(new SpinnerNumberModel(theta.getMaxValue(), theta.getMinValue(), theta.getMaxValue(), 1.0));
try{
spinnerFromPhi.setModel(new SpinnerNumberModel(Math.max(phi.getMinValue(),(Double)spinnerFromPhi.getValue()), phi.getMinValue(), phi.getMaxValue(), 1.0));
spinnerToPhi.setModel(new SpinnerNumberModel(Math.min(phi.getMaxValue(),(Double)spinnerToPhi.getValue()), phi.getMinValue(), phi.getMaxValue(), 1.0));
} catch (Exception ex){
spinnerFromPhi.setModel(new SpinnerNumberModel(phi.getMinValue(), phi.getMinValue(), phi.getMaxValue(), 1.0));
spinnerToPhi.setModel(new SpinnerNumberModel(phi.getMaxValue(), phi.getMinValue(), phi.getMaxValue(), 1.0));
}
try{
spinnerFromTheta.setModel(new SpinnerNumberModel(Math.max(theta.getMinValue(),(Double)spinnerFromTheta.getValue()), theta.getMinValue(), theta.getMaxValue(), 1.0));
spinnerToTheta.setModel(new SpinnerNumberModel(Math.min(theta.getMaxValue(),(Double)spinnerFromTheta.getValue()), theta.getMinValue(), theta.getMaxValue(), 1.0));
} catch (Exception ex){
spinnerFromTheta.setModel(new SpinnerNumberModel(theta.getMinValue(), theta.getMinValue(), theta.getMaxValue(), 1.0));
spinnerToTheta.setModel(new SpinnerNumberModel(theta.getMaxValue(), theta.getMinValue(), theta.getMaxValue(), 1.0));
}
}
@Override
@@ -192,7 +202,7 @@ public class HoloScan extends Panel {
jLabel5.setText("Phi To:");
spinnerToPhi.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.0d, 1.0d, 1.0d));
spinnerToPhi.setModel(new javax.swing.SpinnerNumberModel(10.0d, 0.0d, 10.0d, 1.0d));
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel6.setText("Phi:");
@@ -206,7 +216,7 @@ public class HoloScan extends Panel {
spinnerFromTheta.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.0d, 1.0d, 1.0d));
spinnerToTheta.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.0d, 1.0d, 1.0d));
spinnerToTheta.setModel(new javax.swing.SpinnerNumberModel(10.0d, 0.0d, 10.0d, 1.0d));
jLabel11.setText("Phi:");