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