Skip to content

Commit

Permalink
Fixed #1309 - Add detector/model support for LC-Raman and GC-FTIR
Browse files Browse the repository at this point in the history
  • Loading branch information
eselmeister committed Feb 23, 2023
1 parent 5a1968a commit ff21549
Show file tree
Hide file tree
Showing 63 changed files with 1,209 additions and 144 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2022 Lablicate GmbH.
* Copyright (c) 2017, 2023 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -24,6 +24,7 @@ public enum DataType {
MSD, // mass selective data
CSD, // current selective data
WSD, // wavelength selective data
ISD, // infrared selective data (FT-IR, Raman)
TSD, // time selective data (IMS)
XIR, // Infrared detectors, FTIR, NIR, MIR
NMR, // Nuclear magnetic resonance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,12 @@
import org.eclipse.chemclipse.support.l10n.TranslationSupport;
import org.eclipse.chemclipse.support.text.ILabel;

/**
* Describes very generic and broaden data categories a filter, processor or converter might handle
*
* @author Christoph Läubrich
*
*/
public enum DataCategory implements ILabel {

MSD(TranslationSupport.getTranslationService().translate("%DataCategory.MSD", Activator.getContributorURI())), //
CSD(TranslationSupport.getTranslationService().translate("%DataCategory.CSD", Activator.getContributorURI())), //
WSD(TranslationSupport.getTranslationService().translate("%DataCategory.WSD", Activator.getContributorURI())), //
ISD(TranslationSupport.getTranslationService().translate("%DataCategory.ISD", Activator.getContributorURI())), //
TSD(TranslationSupport.getTranslationService().translate("%DataCategory.TSD", Activator.getContributorURI())), //
FID(TranslationSupport.getTranslationService().translate("%DataCategory.FID", Activator.getContributorURI())), //
NMR(TranslationSupport.getTranslationService().translate("%DataCategory.NMR", Activator.getContributorURI())), //
Expand All @@ -51,4 +46,4 @@ public String label() {

return label;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013, 2021 Lablicate GmbH.
* Copyright (c) 2013, 2023 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -20,6 +20,7 @@ public interface ISupplierFileIdentifier extends SupplierContext {
String TYPE_MSD = "MSD";
String TYPE_CSD = "CSD";
String TYPE_WSD = "WSD";
String TYPE_ISD = "ISD";
String TYPE_TSD = "TSD";
String TYPE_XIR = "XIR";
String TYPE_NMR = "NMR";
Expand Down Expand Up @@ -84,4 +85,4 @@ default boolean isMatchMagicNumber(File file) {

return true;
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public interface IApplicationImage extends IApplicationImageProvider {
String IMAGE_CHROMATOGRAM_CSD = "chromatogram-csd.gif";
String IMAGE_CHROMATOGRAM_WSD = "chromatogram-wsd.gif";
String IMAGE_CHROMATOGRAM_TSD = "chromatogram-tsd.gif";
String IMAGE_CHROMATOGRAM_ISD = "chromatogram-isd.gif";
String IMAGE_SCAN_XIR = "scan-xir.gif"; // FTIR, NIR, ...
String IMAGE_SCAN_XIR_RAW = "scan-xir-raw.gif";
String IMAGE_SCAN_XIR_INVERTED = "scan-xir-inverted.gif";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2022 Lablicate GmbH.
* Copyright (c) 2012, 2023 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -21,6 +21,7 @@ public interface IChemClipseEvents {
String TOPIC_CHROMATOGRAM_MSD_UPDATE_RAWFILE = "chromatogram/msd/update/rawfile";
String TOPIC_CHROMATOGRAM_CSD_UPDATE_RAWFILE = "chromatogram/csd/update/rawfile";
String TOPIC_CHROMATOGRAM_WSD_UPDATE_RAWFILE = "chromatogram/wsd/update/rawfile";
String TOPIC_CHROMATOGRAM_ISD_UPDATE_RAWFILE = "chromatogram/isd/update/rawfile";
String TOPIC_CHROMATOGRAM_TSD_UPDATE_RAWFILE = "chromatogram/tsd/update/rawfile";
String TOPIC_SCAN_XIR_UPDATE_RAWFILE = "scan/xir/update/rawfile";
String TOPIC_SCAN_NMR_UPDATE_RAWFILE = "scan/nmr/update/rawfile";
Expand All @@ -34,6 +35,7 @@ public interface IChemClipseEvents {
String TOPIC_CHROMATOGRAM_MSD_UPDATE_OVERVIEW = "chromatogram/msd/update/overview";
String TOPIC_CHROMATOGRAM_CSD_UPDATE_OVERVIEW = "chromatogram/csd/update/overview";
String TOPIC_CHROMATOGRAM_WSD_UPDATE_OVERVIEW = "chromatogram/wsd/update/overview";
String TOPIC_CHROMATOGRAM_ISD_UPDATE_OVERVIEW = "chromatogram/isd/update/overview";
String TOPIC_CHROMATOGRAM_TSD_UPDATE_OVERVIEW = "chromatogram/tsd/update/overview";
String TOPIC_SCAN_NMR_UPDATE_OVERVIEW = "scan/nmr/update/overview";
String TOPIC_SCAN_XIR_UPDATE_OVERVIEW = "scan/xir/update/overview";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021 Lablicate GmbH.
* Copyright (c) 2021, 2023 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -51,4 +51,4 @@ public Object[] getConverterServices() {

return converterServiceTracker.getServices();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018 Lablicate GmbH.
* Copyright (c) 2018, 2023 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -11,9 +11,9 @@
*******************************************************************************/
package org.eclipse.chemclipse.ux.extension.ui.editors;

import org.eclipse.chemclipse.xir.model.core.IScanXIR;
import org.eclipse.chemclipse.xir.model.core.ISpectrumXIR;

public interface IScanEditorXIR extends IChemClipseEditor {

IScanXIR getScanSelection();
ISpectrumXIR getScanSelection();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2021 Lablicate GmbH.
* Copyright (c) 2017, 2023 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down Expand Up @@ -27,7 +27,7 @@
import org.eclipse.chemclipse.support.ui.workbench.EditorSupport;
import org.eclipse.chemclipse.ux.extension.ui.Activator;
import org.eclipse.chemclipse.wsd.model.core.IChromatogramWSD;
import org.eclipse.chemclipse.xir.model.core.IScanXIR;
import org.eclipse.chemclipse.xir.model.core.ISpectrumXIR;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.basic.MBasicFactory;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
Expand Down Expand Up @@ -99,7 +99,7 @@ default void openEditor(File file, Object object, String elementId, String contr
part.setLabel(((IChromatogram)object).getName() + type);
} else if(object instanceof IMassSpectra) {
part.setLabel(((IMassSpectra)object).getName());
} else if(object instanceof IScanXIR) {
} else if(object instanceof ISpectrumXIR) {
part.setLabel("FTIR");
} else if(object instanceof IMeasurement) {
part.setLabel(((IMeasurement)object).getDataName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
import org.eclipse.chemclipse.wsd.converter.chromatogram.ChromatogramConverterWSD;
import org.eclipse.chemclipse.wsd.model.core.IChromatogramWSD;
import org.eclipse.chemclipse.wsd.model.core.selection.ChromatogramSelectionWSD;
import org.eclipse.chemclipse.xir.model.core.IChromatogramISD;
import org.eclipse.chemclipse.xir.model.core.selection.ChromatogramSelectionISD;
import org.eclipse.chemclipse.xxd.process.support.ProcessTypeSupport;
import org.eclipse.core.runtime.Adapters;
import org.eclipse.core.runtime.IProgressMonitor;
Expand Down Expand Up @@ -365,6 +367,8 @@ private synchronized IChromatogramSelection loadChromatogram() {
chromatogramSelection = new ChromatogramSelectionCSD(chromatogram);
} else if(object instanceof IChromatogramWSD chromatogram) {
chromatogramSelection = new ChromatogramSelectionWSD(chromatogram);
} else if(object instanceof IChromatogramISD chromatogram) {
chromatogramSelection = new ChromatogramSelectionISD(chromatogram);
}
chromatogramFile = null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*******************************************************************************
* Copyright (c) 2023 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Philip Wenig - initial API and implementation
*******************************************************************************/
package org.eclipse.chemclipse.ux.extension.xxd.ui.editors;

import javax.inject.Inject;

import org.eclipse.chemclipse.model.types.DataType;
import org.eclipse.chemclipse.processing.ui.E4ProcessSupplierContext;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;

public class ChromatogramEditorISD extends ChromatogramEditor {

public static final String ID = "org.eclipse.chemclipse.ux.extension.xxd.ui.part.chromatogramEditorISD";
public static final String CONTRIBUTION_URI = "bundleclass://org.eclipse.chemclipse.ux.extension.xxd.ui/org.eclipse.chemclipse.ux.extension.xxd.ui.editors.ChromatogramEditorISD";

@Inject
public ChromatogramEditorISD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext filterFactory, IEclipseContext eclipseContext) {

super(DataType.ISD, parent, part, dirtyable, shell, filterFactory, eclipseContext);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.eclipse.chemclipse.ux.extension.xxd.ui.internal.runnables.ScanXIRImportRunnable;
import org.eclipse.chemclipse.ux.extension.xxd.ui.l10n.ExtensionMessages;
import org.eclipse.chemclipse.ux.extension.xxd.ui.swt.editors.ExtendedXIRScanUI;
import org.eclipse.chemclipse.xir.model.core.IScanXIR;
import org.eclipse.chemclipse.xir.model.core.ISpectrumXIR;
import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.di.Persist;
import org.eclipse.e4.ui.model.application.MApplication;
Expand Down Expand Up @@ -64,7 +64,7 @@ public class ScanEditorXIR implements IScanEditorXIR {
private File scanFile;
private ExtendedXIRScanUI extendedScanXIREditorUI;
//
private IScanXIR scanXIR = null;
private ISpectrumXIR scanXIR = null;
//
private final Shell shell;

Expand Down Expand Up @@ -126,7 +126,7 @@ public boolean saveAs() {
}

@Override
public IScanXIR getScanSelection() {
public ISpectrumXIR getScanSelection() {

return scanXIR;
}
Expand All @@ -138,9 +138,9 @@ private void initialize(Composite parent) {
extendedScanXIREditorUI.update(scanXIR);
}

private synchronized IScanXIR loadScan() {
private synchronized ISpectrumXIR loadScan() {

IScanXIR scanXIR = null;
ISpectrumXIR scanXIR = null;
//
try {
Object object = part.getObject();
Expand All @@ -161,7 +161,7 @@ private synchronized IScanXIR loadScan() {
return scanXIR;
}

private IScanXIR loadScan(File file, boolean batch) {
private ISpectrumXIR loadScan(File file, boolean batch) {

ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
ScanXIRImportRunnable runnable = new ScanXIRImportRunnable(file);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
import org.eclipse.chemclipse.wsd.converter.chromatogram.ChromatogramConverterWSD;
import org.eclipse.chemclipse.wsd.model.core.IChromatogramWSD;
import org.eclipse.chemclipse.wsd.model.core.selection.ChromatogramSelectionWSD;
import org.eclipse.chemclipse.xir.converter.chromatogram.ChromatogramConverterISD;
import org.eclipse.chemclipse.xir.model.core.IChromatogramISD;
import org.eclipse.chemclipse.xir.model.core.selection.ChromatogramSelectionISD;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

Expand Down Expand Up @@ -96,6 +99,11 @@ public void run(final IProgressMonitor monitor) throws InvocationTargetException
IChromatogramWSD chromatogramWSD = processingInfoWSD.getProcessingResult();
chromatogramSelections.add(new ChromatogramSelectionWSD(chromatogramWSD, fireUpdate));
break;
case ISD:
IProcessingInfo<IChromatogramISD> processingInfoISD = ChromatogramConverterISD.getInstance().convert(file, monitor);
IChromatogramISD chromatogramISD = processingInfoISD.getProcessingResult();
chromatogramSelections.add(new ChromatogramSelectionISD(chromatogramISD, fireUpdate));
break;
default:
// No action
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.eclipse.chemclipse.processing.core.IProcessingInfo;
import org.eclipse.chemclipse.ux.extension.xxd.ui.l10n.ExtensionMessages;
import org.eclipse.chemclipse.xir.converter.core.ScanConverterXIR;
import org.eclipse.chemclipse.xir.model.core.IScanXIR;
import org.eclipse.chemclipse.xir.model.core.ISpectrumXIR;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

Expand All @@ -27,14 +27,14 @@ public class ScanXIRImportRunnable implements IRunnableWithProgress {
private static final Logger logger = Logger.getLogger(ScanXIRImportRunnable.class);
//
private File file;
private IScanXIR scanXIR = null;
private ISpectrumXIR scanXIR = null;

public ScanXIRImportRunnable(File file) {

this.file = file;
}

public IScanXIR getScanXIR() {
public ISpectrumXIR getScanXIR() {

return scanXIR;
}
Expand All @@ -45,7 +45,7 @@ public void run(final IProgressMonitor monitor) throws InvocationTargetException
try {
monitor.beginTask(ExtensionMessages.importScan, IProgressMonitor.UNKNOWN);
IProcessingInfo<?> processingInfo = ScanConverterXIR.convert(file, monitor);
scanXIR = (IScanXIR)processingInfo.getProcessingResult();
scanXIR = (ISpectrumXIR)processingInfo.getProcessingResult();
} catch(Exception e) {
logger.error(e);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class ExtensionMessages extends NLS {
public static String chromatogram;
public static String chromatogramFromProjectExplorer;
public static String chromatogramEditorTSD;
public static String chromatogramEditorISD;
public static String quantitationEditor;
public static String editorNMR;
public static String editorXIR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ saveChromatogram=Save Chromatogram
chromatogram=Chromatogram
chromatogramFromProjectExplorer=Chromatogram from Project Explorer
chromatogramEditorTSD=Chromatogram Editor (TSD)
chromatogramEditorISD=Chromatogram Editor (ISD)
quantitationEditor=Quantitation Editor
editorNMR=NMR Editor
editorXIR=FTIR/NIR/MIR Editor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ saveChromatogram=Chromatogramm Speichern
chromatogram=Chromatogramm
chromatogramFromProjectExplorer=Chromatogramm aus Projekt-Explorer
chromatogramEditorTSD=Chromatogramm-Editor (TSD)
chromatogramEditorISD=Chromatogramm-Editor (ISD)
quantitationEditor=Quantifizierungs-Editor
editorNMR=NMR-Editor
editorXIR=FTIR/NIR/MIR-Editor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.eclipse.chemclipse.ux.extension.ui.editors.IScanEditorNMR;
import org.eclipse.chemclipse.ux.extension.ui.editors.IScanEditorXIR;
import org.eclipse.chemclipse.ux.extension.xxd.ui.Activator;
import org.eclipse.chemclipse.xir.model.core.IScanXIR;
import org.eclipse.chemclipse.xir.model.core.ISpectrumXIR;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
Expand Down Expand Up @@ -143,9 +143,9 @@ public List<IScanMSD> getMassSpectrumSelections() {
return dataSelections;
}

public List<IScanXIR> getScanSelectionsXIR() {
public List<ISpectrumXIR> getScanSelectionsXIR() {

List<IScanXIR> dataNMRSelections = new ArrayList<>();
List<ISpectrumXIR> dataNMRSelections = new ArrayList<>();
if(partService != null) {
/*
* TODO: see message
Expand All @@ -158,7 +158,7 @@ public List<IScanXIR> getScanSelectionsXIR() {
/*
* XIR
*/
IScanXIR selection = null;
ISpectrumXIR selection = null;
if(object instanceof IScanEditorXIR editor) {
selection = editor.getScanSelection();
}
Expand Down
Loading

0 comments on commit ff21549

Please sign in to comment.