Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Commit

Permalink
unticking enable processing will reload the scan to remove results
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenHeu committed Jun 2, 2019
1 parent db1f376 commit a4cb8db
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,7 @@ public void checkAndRunController() {
controller = null;

// if a controller is re-run then delete previous results
for (int i = 0; i < plot.getDatasetCount(); i++) {
XYDataset dataSet = plot.getDataset(i);
if (dataSet instanceof DPPResultsDataSet) {
plot.setDataset(i, null);
}
}
removeDataPointProcessingResultDataSets();

// if enabled, do the data point processing as set up by the user
XYDataset dataSet = getMainScanDataSet();
Expand All @@ -532,4 +527,14 @@ public boolean isProcessingAllowed() {
public void setProcessingAllowed(boolean processingAllowed) {
this.processingAllowed = processingAllowed;
}

public void removeDataPointProcessingResultDataSets() {
for (int i = 0; i < plot.getDatasetCount(); i++) {
XYDataset dataSet = plot.getDataset(i);
if (dataSet instanceof DPPResultsDataSet) {
plot.setDataset(i, null);
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,12 @@ public void run() {
inst.setEnabled(!inst.isEnabled());
bottomPanel.updateProcessingButton();
getSpectrumPlot().checkAndRunController();

// if the tick is removed, set the data back to default
if(!inst.isEnabled()) {
// getSpectrumPlot().removeDataPointProcessingResultDataSets();
loadRawData(currentScan);
}
}
});
}
Expand Down

0 comments on commit a4cb8db

Please sign in to comment.