Skip to content

Commit

Permalink
Add support for time in minutes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Oct 9, 2024
1 parent ce65b51 commit 6409498
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import javax.xml.parsers.ParserConfigurationException;

import org.eclipse.chemclipse.logging.core.Logger;
import org.eclipse.chemclipse.model.core.IChromatogramOverview;
import org.eclipse.chemclipse.msd.converter.io.IChromatogramMSDReader;
import org.eclipse.chemclipse.msd.converter.supplier.mzdata.internal.v105.model.AdminType;
import org.eclipse.chemclipse.msd.converter.supplier.mzdata.internal.v105.model.CvParamType;
Expand Down Expand Up @@ -102,7 +103,9 @@ public IChromatogramMSD read(File file, IProgressMonitor monitor) throws IOExcep
for(Object object : params) {
if(object instanceof CvParamType cvParamType) {
if(cvParamType.getName().equals("TimeInSeconds")) {
retentionTime = Math.round(Float.parseFloat(cvParamType.getValue()) * 1000); // milliseconds
retentionTime = (int)Math.round(Double.parseDouble(cvParamType.getValue()) * IChromatogramOverview.SECOND_CORRELATION_FACTOR);
} else if(cvParamType.getName().equals("TimeInMinutes")) {
retentionTime = (int)Math.round(Double.parseDouble(cvParamType.getValue()) * IChromatogramOverview.MINUTE_CORRELATION_FACTOR);
}
}
}
Expand Down

0 comments on commit 6409498

Please sign in to comment.