This commit is contained in:
gac-S_Changer
2019-02-05 15:54:27 +01:00
parent 7ff9cb684b
commit 911022b078
48 changed files with 456 additions and 98 deletions

View File

@@ -78,6 +78,7 @@ public class PuckDetectionPanel extends DevicePanel {
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
table = new javax.swing.JTable();
buttonConfigure = new javax.swing.JButton();
deviceStatePanel1 = new ch.psi.pshell.swing.DeviceStatePanel();
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Raspberry Pi "));
@@ -186,6 +187,13 @@ public class PuckDetectionPanel extends DevicePanel {
});
jScrollPane1.setViewportView(table);
buttonConfigure.setText("Configure");
buttonConfigure.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonConfigureActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
@@ -194,11 +202,17 @@ public class PuckDetectionPanel extends DevicePanel {
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addContainerGap())
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonConfigure)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonConfigure)
.addContainerGap())
);
@@ -236,9 +250,24 @@ public class PuckDetectionPanel extends DevicePanel {
execute("start_puck_detection()", false);
}//GEN-LAST:event_buttonPuckDetStartActionPerformed
private void buttonConfigureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigureActionPerformed
try {
if (table.getSelectedRow()<0){
throw new Exception("Select a puck");
}
String name = table.getModel().getValueAt(table.getSelectedRow(), 0).toString();
Puck puck = getDevice().getPuck(name);
DevicePanel.showConfigEditor(this, puck, true, false);
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_buttonConfigureActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonConfigure;
private javax.swing.JButton buttonPuckDetCheck;
private javax.swing.JButton buttonPuckDetStart;
private javax.swing.JButton buttonPuckDetStop;