Search in sources :

Example 51 with ParameterSet

use of net.sf.mzmine.parameters.ParameterSet in project mzmine2 by mzmine.

the class DataPointProcessingQueue method saveToXML.

public void saveToXML(@Nonnull final Element xmlElement) {
    final Document document = xmlElement.getOwnerDocument();
    // Process each step.
    for (final MZmineProcessingStep<?> step : this) {
        // Append a new batch step element.
        final Element stepElement = document.createElement(DATA_POINT_PROCESSING_STEP_ELEMENT);
        stepElement.setAttribute(METHOD_ELEMENT, step.getModule().getClass().getName());
        xmlElement.appendChild(stepElement);
        // Save parameters.
        final ParameterSet parameters = step.getParameterSet();
        if (parameters != null) {
            parameters.saveValuesToXML(stepElement);
        }
    }
}
Also used : ParameterSet(net.sf.mzmine.parameters.ParameterSet) Element(org.w3c.dom.Element) Document(org.w3c.dom.Document)

Example 52 with ParameterSet

use of net.sf.mzmine.parameters.ParameterSet in project mzmine2 by mzmine.

the class ModuleComboParameter method cloneParameter.

@SuppressWarnings("unchecked")
@Override
public ModuleComboParameter<ModuleType> cloneParameter() {
    MZmineProcessingStep<ModuleType>[] newModules = new MZmineProcessingStep[modulesWithParams.length];
    MZmineProcessingStep<ModuleType> newValue = null;
    for (int i = 0; i < modulesWithParams.length; i++) {
        ModuleType module = modulesWithParams[i].getModule();
        ParameterSet params = modulesWithParams[i].getParameterSet();
        params = params.cloneParameterSet();
        newModules[i] = new MZmineProcessingStepImpl<ModuleType>(module, params);
        if (value == modulesWithParams[i])
            newValue = newModules[i];
    }
    ModuleComboParameter<ModuleType> copy = new ModuleComboParameter<ModuleType>(name, description, newModules);
    copy.setValue(newValue);
    return copy;
}
Also used : ParameterSet(net.sf.mzmine.parameters.ParameterSet) MZmineProcessingStep(net.sf.mzmine.modules.MZmineProcessingStep)

Example 53 with ParameterSet

use of net.sf.mzmine.parameters.ParameterSet in project mzmine2 by mzmine.

the class ModuleComboParameter method getValue.

public MZmineProcessingStep<ModuleType> getValue() {
    if (value == null)
        return null;
    // First check that the module has all parameters set
    ParameterSet embeddedParameters = value.getParameterSet();
    if (embeddedParameters == null)
        return value;
    for (Parameter<?> p : embeddedParameters.getParameters()) {
        if (p instanceof UserParameter) {
            UserParameter<?, ?> up = (UserParameter<?, ?>) p;
            Object upValue = up.getValue();
            if (upValue == null)
                return null;
        }
    }
    return value;
}
Also used : ParameterSet(net.sf.mzmine.parameters.ParameterSet) UserParameter(net.sf.mzmine.parameters.UserParameter)

Aggregations

ParameterSet (net.sf.mzmine.parameters.ParameterSet)53 ExitCode (net.sf.mzmine.util.ExitCode)19 RawDataFile (net.sf.mzmine.datamodel.RawDataFile)11 File (java.io.File)9 ArrayList (java.util.ArrayList)8 SimpleParameterSet (net.sf.mzmine.parameters.impl.SimpleParameterSet)8 Task (net.sf.mzmine.taskcontrol.Task)8 Element (org.w3c.dom.Element)8 PeakList (net.sf.mzmine.datamodel.PeakList)6 MZmineModule (net.sf.mzmine.modules.MZmineModule)6 Document (org.w3c.dom.Document)6 IOException (java.io.IOException)5 DataPoint (net.sf.mzmine.datamodel.DataPoint)5 PeakListRow (net.sf.mzmine.datamodel.PeakListRow)5 Scan (net.sf.mzmine.datamodel.Scan)5 MZmineProcessingModule (net.sf.mzmine.modules.MZmineProcessingModule)5 Nonnull (javax.annotation.Nonnull)4 Feature (net.sf.mzmine.datamodel.Feature)4 IsotopePattern (net.sf.mzmine.datamodel.IsotopePattern)4 PeakListsParameter (net.sf.mzmine.parameters.parametertypes.selectors.PeakListsParameter)4