This commit is contained in:
@@ -17,7 +17,7 @@ public class Correlation extends Panel {
|
||||
|
||||
public Correlation() {
|
||||
initComponents();
|
||||
this.setPersistedComponents(new Component[]{textDevX, textDevY, spinnerInterval, spinnerWindow, checkBS});
|
||||
this.setPersistedComponents(new Component[]{textDevX, textDevY, spinnerInterval, spinnerWindow, comboTypeX, comboTypeY});
|
||||
plot.getAxis(Plot.AxisId.X).setLabel(null);
|
||||
plot.getAxis(Plot.AxisId.Y).setLabel(null);
|
||||
}
|
||||
@@ -34,8 +34,15 @@ public class Correlation extends Panel {
|
||||
textDevY.setText(App.getArgumentValue("dy"));
|
||||
}
|
||||
try{
|
||||
if (App.hasArgument("bs")) {
|
||||
checkBS.setSelected(Boolean.valueOf(App.getArgumentValue("bs")));
|
||||
if (App.hasArgument("dxtype")) {
|
||||
comboTypeX.setSelectedIndex(Integer.valueOf(App.getArgumentValue("dxtype")));
|
||||
}
|
||||
} catch (Exception ex){
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
try{
|
||||
if (App.hasArgument("dytype")) {
|
||||
comboTypeY.setSelectedIndex(Integer.valueOf(App.getArgumentValue("dytype")));
|
||||
}
|
||||
} catch (Exception ex){
|
||||
System.err.println(ex.getMessage());
|
||||
@@ -110,7 +117,8 @@ public class Correlation extends Panel {
|
||||
textDevY.setEnabled(state==State.Ready);
|
||||
spinnerInterval.setEnabled(state==State.Ready);
|
||||
spinnerWindow.setEnabled(state==State.Ready);
|
||||
checkBS.setEnabled(state==State.Ready);
|
||||
comboTypeX.setEnabled(state==State.Ready);
|
||||
comboTypeY.setEnabled(state==State.Ready);
|
||||
checkLinear.setEnabled(state==State.Ready);
|
||||
checkQuadratic.setEnabled(state==State.Ready);
|
||||
|
||||
@@ -153,13 +161,14 @@ public class Correlation extends Panel {
|
||||
buttonStart = new javax.swing.JButton();
|
||||
jLabel5 = new javax.swing.JLabel();
|
||||
textCorrelation = new javax.swing.JTextField();
|
||||
checkBS = new javax.swing.JCheckBox();
|
||||
jLabel6 = new javax.swing.JLabel();
|
||||
textLinear = new javax.swing.JTextField();
|
||||
jLabel7 = new javax.swing.JLabel();
|
||||
textQuadratic = new javax.swing.JTextField();
|
||||
checkLinear = new javax.swing.JCheckBox();
|
||||
checkQuadratic = new javax.swing.JCheckBox();
|
||||
comboTypeX = new javax.swing.JComboBox();
|
||||
comboTypeY = new javax.swing.JComboBox();
|
||||
|
||||
plot.setTitle("");
|
||||
|
||||
@@ -192,8 +201,6 @@ public class Correlation extends Panel {
|
||||
textCorrelation.setEditable(false);
|
||||
textCorrelation.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
|
||||
checkBS.setText("Beam synchronous");
|
||||
|
||||
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
|
||||
jLabel6.setText("Liner fit:");
|
||||
|
||||
@@ -211,10 +218,18 @@ public class Correlation extends Panel {
|
||||
|
||||
checkQuadratic.setText("Quadratic fit");
|
||||
|
||||
comboTypeX.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Channel", "Stream", "Camera" }));
|
||||
|
||||
comboTypeY.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Channel", "Stream", "Camera" }));
|
||||
|
||||
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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonStart, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -227,21 +242,20 @@ public class Correlation extends Panel {
|
||||
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(textDevX, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
|
||||
.addComponent(textDevY, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
|
||||
.addComponent(textCorrelation, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
|
||||
.addComponent(spinnerInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerWindow, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(checkBS)
|
||||
.addComponent(textLinear, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
|
||||
.addComponent(textQuadratic, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
|
||||
.addComponent(checkLinear)
|
||||
.addComponent(checkQuadratic))
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonStart, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(comboTypeY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(comboTypeX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(textCorrelation, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
|
||||
.addComponent(spinnerInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerWindow, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(textLinear, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
|
||||
.addComponent(textQuadratic, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
|
||||
.addComponent(checkLinear)
|
||||
.addComponent(checkQuadratic))
|
||||
.addContainerGap())
|
||||
.addComponent(textDevX)
|
||||
.addComponent(textDevY)))
|
||||
);
|
||||
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel3, jLabel4});
|
||||
@@ -250,7 +264,7 @@ public class Correlation extends Panel {
|
||||
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel5, jLabel6, jLabel7});
|
||||
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {textCorrelation, textDevX, textDevY, textLinear, textQuadratic});
|
||||
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {textCorrelation, textLinear, textQuadratic});
|
||||
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -260,11 +274,13 @@ public class Correlation extends Panel {
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(textDevX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(comboTypeX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(textDevY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(checkBS)
|
||||
.addGap(3, 3, 3)
|
||||
.addComponent(comboTypeY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel3)
|
||||
@@ -277,7 +293,7 @@ public class Correlation extends Panel {
|
||||
.addComponent(checkLinear)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(checkQuadratic)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(textCorrelation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel5))
|
||||
@@ -289,7 +305,7 @@ public class Correlation extends Panel {
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(jLabel7)
|
||||
.addComponent(textQuadratic, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
|
||||
.addComponent(buttonStart)
|
||||
.addGap(45, 45, 45))
|
||||
);
|
||||
@@ -302,7 +318,7 @@ public class Correlation extends Panel {
|
||||
.addContainerGap()
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 371, Short.MAX_VALUE))
|
||||
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 345, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -331,12 +347,13 @@ public class Correlation extends Panel {
|
||||
args.put("dy", textDevY.getText());
|
||||
args.put("interval", spinnerInterval.getValue());
|
||||
args.put("window", spinnerWindow.getValue());
|
||||
args.put("bs", checkBS.isSelected());
|
||||
args.put("dxtype", comboTypeX.getSelectedIndex());
|
||||
args.put("dytype", comboTypeY.getSelectedIndex());
|
||||
args.put("linear_fit", checkLinear.isSelected());
|
||||
args.put("quadratic_fit", checkQuadratic.isSelected());
|
||||
|
||||
args.put("p", plot);
|
||||
runAsync("Correlation/Correlation", args).handle((ok, ex) -> {
|
||||
runAsync("Correlation/Correlation2", args).handle((ok, ex) -> {
|
||||
if (ex != null) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
@@ -352,9 +369,10 @@ public class Correlation extends Panel {
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonStart;
|
||||
private javax.swing.JCheckBox checkBS;
|
||||
private javax.swing.JCheckBox checkLinear;
|
||||
private javax.swing.JCheckBox checkQuadratic;
|
||||
private javax.swing.JComboBox comboTypeX;
|
||||
private javax.swing.JComboBox comboTypeY;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
|
||||
Reference in New Issue
Block a user