use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.DataPointProcessingController in project mzmine2 by mzmine.
the class SpectraPlot method checkAndRunController.
/**
* Checks if the spectra processing is enabled & allowed and executes the controller if it is.
* Processing is forbidden for instances of ParameterSetupDialogWithScanPreviews
*/
public void checkAndRunController() {
// if controller != null, processing on the current spectra has already been executed. When
// loading a new spectrum, the controller is set to null in removeAllDataSets()
DataPointProcessingManager inst = DataPointProcessingManager.getInst();
if (!isProcessingAllowed() || !inst.isEnabled())
return;
if (controller != null)
controller = null;
// if a controller is re-run then delete previous results
removeDataPointProcessingResultDataSets();
// if enabled, do the data point processing as set up by the user
XYDataset dataSet = getMainScanDataSet();
if (dataSet instanceof ScanDataSet) {
Scan scan = ((ScanDataSet) dataSet).getScan();
MSLevel mslevel = inst.decideMSLevel(scan);
controller = new DataPointProcessingController(inst.getProcessingQueue(mslevel), this, getMainScanDataSet().getDataPoints());
inst.addController(controller);
}
}
Aggregations