Startup
This commit is contained in:
@@ -28,11 +28,14 @@ public class GunSolenoidAlignment extends Panel {
|
||||
public GunSolenoidAlignment() {
|
||||
initComponents();
|
||||
}
|
||||
boolean running;
|
||||
|
||||
ScanListener scanListener = new ScanListener() {
|
||||
public void onNewRecord(Scan scan, ScanRecord record) {
|
||||
progressBar.setValue(getView().getStatusBar().getProgressBar().getValue());
|
||||
scanSeries.appendData((Double)record.getValues()[0], (Double)record.getValues()[1]);
|
||||
public void onNewRecord(Scan scan, ScanRecord record) {
|
||||
if (running){
|
||||
progressBar.setValue(getView().getStatusBar().getProgressBar().getValue());
|
||||
scanSeries.appendData((Double)record.getValues()[0], (Double)record.getValues()[1]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -49,6 +52,9 @@ public class GunSolenoidAlignment extends Panel {
|
||||
|
||||
buttonAbort.setEnabled(state == State.Busy);
|
||||
buttonRun.setEnabled(state == State.Ready);
|
||||
if (state !=State.Busy){
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -328,6 +334,7 @@ public class GunSolenoidAlignment extends Panel {
|
||||
centroidPlot.addSeries(scanSeries);
|
||||
scanSeries.setLinesVisible(false);
|
||||
scanSeries.setPointSize(4);
|
||||
running = true;
|
||||
|
||||
HashMap args = new HashMap();
|
||||
args.put("I1", spinnerI1.getValue());
|
||||
@@ -344,6 +351,7 @@ public class GunSolenoidAlignment extends Panel {
|
||||
onEndScan((ScanResult)ret.get(0), (List)ret.get(1), (List)ret.get(2) );
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
running = false;
|
||||
System.out.println("Error " + ex.toString());
|
||||
showException(ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user