This commit is contained in:
sfop
2016-06-28 15:36:11 +02:00
parent 6ebcdd5f38
commit 35a396586d

View File

@@ -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);
}