Пример #1
0
        /// <summary>
        /// Submit latest result to sample tree.
        /// </summary>
        public void SubmitResultToTree()
        {
            // No Result
            if (Result == null)
            {
                return;
            }

            ClrMsDataVariant     msObj = new ClrMsDataVariant(_clrVariant);
            DataGroupNodeWrapper dgnw  = msObj.getSample().getRootDataGroupNode();

            //Add result to sample tree.
            SampleSetResampling sampleSet = new SampleSetResampling();
            SampleResampling    sample    = new SampleResampling(sampleSet);

            sample.openSample();
            DataGroupNodeWrapper root = sample.getRootDataGroupNode();

            sample.setName("Contaminant peak removed " + msObj.getSample().getName());
            root.setName("Contaminant peak removed " + dgnw.getName());

            int cnt = 0;

            for (int i = 0; i < Result.Spectrums.Count(); i++)
            {
                ClrDataPoints      pts = Result.DataPoints[i];
                SpectrumWrapper    sw  = Result.Spectrums[i];
                XYDataWrapper      xyd;
                SpectrumResampling spec;

                if (Result.Spectrums.Count == 1)
                {
                    spec = new SpectrumResampling(sample, sw.getName());
                }
                else
                {
                    cnt++;
                    spec = new SpectrumResampling(sample, Result.Spectrums[i].getName() + " (" + cnt.ToString() + ")");
                }
                xyd = spec.getXYData();
                spec.SetData(pts);
                spec.onGetXYData(xyd, -1.0, -1.0);
                spec.setMinX(pts.getMinX());
                spec.setMaxX(pts.getMaxX());
                spec.setMaxIntensity(pts.getMaxY());
                spec.setMsStage((int)sw.getMsStage());
                sample.setSampleIndex((int)0);
                root.addSpectrum(spec);
            }
            sampleSet.addSample(sample);
            ClrPluginCallTool.onOpenSample(sample);
        }
Пример #2
0
        /// <summary>
        /// Display Calculation Results on tree view
        /// </summary>
        public void DisplayCalculationResult()
        {
            // No Result
            if (_resultSpecCal == null)
            {
                return;
            }

            //Add result to sample tree.
            SampleSetResampling sampleSet = new SampleSetResampling();
            SampleResampling    sample    = new SampleResampling(sampleSet);

            sample.openSample();
            DataGroupNodeWrapper root = sample.getRootDataGroupNode();

            sample.setName(_resultSpecCal.Spectrums[0].getName() + " Sample");
            root.setName(_resultSpecCal.Spectrums[0].getName() + " Sample");

            int cnt = 0;

            foreach (SpectrumResampling sr in _resultSpecCal.Spectrums)
            {
                ClrDataPoints      xyd = new ClrDataPoints();
                SpectrumResampling spec;

                if (_resultSpecCal.Spectrums.Count == 1)
                {
                    spec = new SpectrumResampling(sample, sr.getName() + " Spectrum");
                }
                else
                {
                    cnt++;
                    spec = new SpectrumResampling(sample, sr.getName() + " Spectrum_" + cnt.ToString());
                }
                ClrDataPoints pts = new ClrDataPoints();
                sr.getXYData(pts, false);
                spec.getXYData(xyd, false);
                spec.SetData(pts);
                spec.setMinX(pts.getMinX());
                spec.setMaxX(pts.getMaxX());
                spec.setMaxIntensity(pts.getMaxY());
                spec.onGetXYData(xyd, -1.0, -1.0);
                spec.setMsStage((int)sr.getMsStage());
                sample.setSampleIndex((int)0);
                root.addSpectrum(spec);
            }
            sampleSet.addSample(sample);
            ClrPluginCallTool.onOpenSample(sample);
        }