Closedown
This commit is contained in:
@@ -28,27 +28,25 @@ public class ShottkyScan extends Panel {
|
||||
//Overridable callbacks
|
||||
@Override
|
||||
public void onInitialize(int runCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateChange(State state, State former) {
|
||||
buttonAbort.setEnabled(state.isProcessing());
|
||||
buttonStart.setEnabled(state == State.Ready);
|
||||
|
||||
buttonSet.setEnabled(buttonStart.isEnabled());
|
||||
spinnerStart.setEnabled(buttonStart.isEnabled());
|
||||
spinnerStop.setEnabled(buttonStart.isEnabled());
|
||||
spinnerStep.setEnabled(buttonStart.isEnabled());
|
||||
spinnerSamples.setEnabled(buttonStart.isEnabled());
|
||||
spinnerLatency.setEnabled(buttonStart.isEnabled());
|
||||
|
||||
spinnerPhaseRef.setEnabled(buttonStart.isEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExecutedFile(String fileName, Object result) {
|
||||
}
|
||||
|
||||
|
||||
//Callback to perform update - in event thread
|
||||
@Override
|
||||
protected void doUpdate() {
|
||||
@@ -64,10 +62,8 @@ public class ShottkyScan extends Panel {
|
||||
public void onStop() {
|
||||
getContext().removeScanListener(scanListener);
|
||||
super.onStop();
|
||||
|
||||
}
|
||||
|
||||
|
||||
ScanListener scanListener = new ScanListener() {
|
||||
@Override
|
||||
public void onScanStarted(Scan scan, String plotTitle) {
|
||||
@@ -75,21 +71,17 @@ public class ShottkyScan extends Panel {
|
||||
series.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewRecord(Scan scan, ScanRecord record) {
|
||||
if ("ShottkyScan".equals(getContext().getExecutionPars().getName())){
|
||||
series.appendData((Double)record.getPositions()[0], ((Number)record.getValues()[0]).doubleValue());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScanEnded(Scan scan, Exception ex) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
@@ -111,7 +103,7 @@ public class ShottkyScan extends Panel {
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jLabel7 = new javax.swing.JLabel();
|
||||
spinnerPhaseRef = new javax.swing.JSpinner();
|
||||
jButton1 = new javax.swing.JButton();
|
||||
buttonSet = new javax.swing.JButton();
|
||||
|
||||
buttonStart.setText("Start");
|
||||
buttonStart.addActionListener(new java.awt.event.ActionListener() {
|
||||
@@ -228,10 +220,10 @@ public class ShottkyScan extends Panel {
|
||||
}
|
||||
});
|
||||
|
||||
jButton1.setText("Set");
|
||||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
||||
buttonSet.setText("Set");
|
||||
buttonSet.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jButton1ActionPerformed(evt);
|
||||
buttonSetActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -246,7 +238,7 @@ public class ShottkyScan extends Panel {
|
||||
.addComponent(jLabel7)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerPhaseRef, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addComponent(buttonSet, javax.swing.GroupLayout.Alignment.TRAILING))
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
@@ -257,7 +249,7 @@ public class ShottkyScan extends Panel {
|
||||
.addComponent(jLabel7)
|
||||
.addComponent(spinnerPhaseRef, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jButton1)
|
||||
.addComponent(buttonSet)
|
||||
.addContainerGap(79, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
@@ -346,18 +338,18 @@ public class ShottkyScan extends Panel {
|
||||
}
|
||||
}//GEN-LAST:event_spinnerPhaseRefStateChanged
|
||||
|
||||
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
||||
private void buttonSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSetActionPerformed
|
||||
try {
|
||||
//caput("SINEG01-RSYS:CALC-VSUM-PHASE-OFFSET", spinnerPhaseRef.value)
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_jButton1ActionPerformed
|
||||
}//GEN-LAST:event_buttonSetActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonAbort;
|
||||
private javax.swing.JButton buttonSet;
|
||||
private javax.swing.JButton buttonStart;
|
||||
private javax.swing.JButton jButton1;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JLabel jLabel3;
|
||||
|
||||
Reference in New Issue
Block a user