diff --git a/config/plugins.properties b/config/plugins.properties index 5d37a10..0014b44 100644 --- a/config/plugins.properties +++ b/config/plugins.properties @@ -1,14 +1,15 @@ +MXSC-1.10.0.jar=enabled WagoPanel.java=enabled LaserUEPanel.java=enabled BarcodeReaderPanel.java=enabled PuckDetectionPanel.java=enabled HexiposiPanel.java=enabled MjpegSource2.java=enabled -MXSC-1.10.0.jar=enabled LN2.java=enabled Hexiposi.java=disabled NewJPanel.java=disabled Expert.java=disabled +RecoveryPanel.java=disabled RobotPanel.java=enabled SmartMagnetConfig.java=disabled SmartMagnetPanel.java=enabled diff --git a/plugins/Expert.form b/plugins/Commands.form similarity index 100% rename from plugins/Expert.form rename to plugins/Commands.form diff --git a/plugins/Expert.java b/plugins/Commands.java similarity index 99% rename from plugins/Expert.java rename to plugins/Commands.java index 3249ef2..b11a50b 100644 --- a/plugins/Expert.java +++ b/plugins/Commands.java @@ -13,9 +13,9 @@ import javax.swing.JTextField; /** * */ -public class Expert extends Panel { +public class Commands extends Panel { - public Expert() { + public Commands() { initComponents(); ((JSpinner.DefaultEditor)spinnerSegment.getEditor()).getTextField().setHorizontalAlignment(JTextField.RIGHT); } diff --git a/plugins/MXSC-1.10.0.jar b/plugins/MXSC-1.10.0.jar index c51970f..0c137d2 100644 Binary files a/plugins/MXSC-1.10.0.jar and b/plugins/MXSC-1.10.0.jar differ diff --git a/plugins/Recovery.form b/plugins/Recovery.form new file mode 100644 index 0000000..0a89edd --- /dev/null +++ b/plugins/Recovery.form @@ -0,0 +1,90 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/plugins/Recovery.java b/plugins/Recovery.java new file mode 100644 index 0000000..d6bd7a3 --- /dev/null +++ b/plugins/Recovery.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved. + */ + +import ch.psi.pshell.ui.Panel; +import ch.psi.utils.State; +import ch.psi.utils.swing.SwingUtils; + +/** + * + */ +public class Recovery extends Panel { + + public Recovery() { + initComponents(); + } + + //Overridable callbacks + @Override + public void onInitialize(int runCount) { + + } + + @Override + public void onStateChange(State state, State former) { + } + + @Override + public void onExecutedFile(String fileName, Object result) { + } + + //Callback to perform update - in event thread + @Override + protected void doUpdate() { + } + + @Override + public boolean isActive() { + return true; + } + + + void execute(String statement){ + execute(statement, false); + } + + void execute(String statement, boolean background){ + execute(statement, background, false); + } + + void execute(String statement, boolean background, boolean showReturn){ + try { + evalAsync(statement, background).handle((ret, ex) -> { + if (ex != null){ + showException((Exception)ex); + } else if (showReturn){ + SwingUtils.showMessage(getTopLevel(), "Return", String.valueOf(ret)); + } + return ret; + }); + } catch (Exception ex) { + showException(ex); + } + } + + void execute(String script, Object args){ + try { + runAsync(script, args).handle((ret, ex) -> { + if (ex != null){ + showException((Exception)ex); + } + return ret; + }); + } catch (Exception ex) { + showException(ex); + } + } + + + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + ledLidControlActive = new ch.psi.pshell.swing.Led(); + jLabel6 = new javax.swing.JLabel(); + ledLidInitialized = new ch.psi.pshell.swing.Led(); + jLabel7 = new javax.swing.JLabel(); + buttonInitHexiposi = new javax.swing.JButton(); + + jLabel6.setText("Known position"); + + jLabel7.setText("Valid segment"); + + buttonInitHexiposi.setText("Recover"); + buttonInitHexiposi.setEnabled(false); + buttonInitHexiposi.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + buttonInitHexiposiActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(ledLidControlActive, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel6)) + .addGroup(layout.createSequentialGroup() + .addComponent(ledLidInitialized, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel7)))) + .addGroup(layout.createSequentialGroup() + .addContainerGap(96, Short.MAX_VALUE) + .addComponent(buttonInitHexiposi))) + .addContainerGap(116, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(ledLidControlActive, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel6)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(ledLidInitialized, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7)) + .addGap(18, 18, 18) + .addComponent(buttonInitHexiposi) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + private void buttonInitHexiposiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonInitHexiposiActionPerformed + try{ + this.showDevicePanel("hexiposi"); + } catch (Exception ex) { + showException(ex); + } + }//GEN-LAST:event_buttonInitHexiposiActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton buttonInitHexiposi; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private ch.psi.pshell.swing.Led ledLidControlActive; + private ch.psi.pshell.swing.Led ledLidInitialized; + // End of variables declaration//GEN-END:variables +}