Example #1
0
        private void Init()
        {
            try
            {
                mctl_spectrum      = new ctlMassSpectrum();
                mctl_spectrum.Dock = DockStyle.Fill;
                panel1.Controls.Add(mctl_spectrum);
                mctl_spectrum.Mediator          = mMediator;
                mctl_spectrum.mevntScanChanged += new Decon2LS.ctlMassSpectrum.ScanChangedEventHandler(mctl_spectrum_mevntScanChanged);

                marr_tic_values = new float[1];
                marr_scan_times = new float[1];

                this.m_tic_current_scan_pen_provider      = new PenProvider();
                m_tic_current_scan_pen_provider.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;

                var shape = new PNNL.Controls.DiamondShape(3, false);
                mobj_tic_plt_params = new PNNL.Controls.clsPlotParams(shape, Color.DarkSlateGray, false, true, true);

                this.KeyDown               += new KeyEventHandler(frmSpectra_KeyDown);
                this.mctl_tic.KeyDown      += new KeyEventHandler(frmSpectra_KeyDown);
                this.mctl_spectrum.KeyDown += new KeyEventHandler(frmSpectra_KeyDown);

                mint_spectrum_num = -1;

                this.m_tic_chart_data_provider = new ArrayChartDataProvider();
                this.mobj_tic_series           = new clsSeries(this.m_tic_chart_data_provider, this.mobj_tic_plt_params);
                this.mctl_tic.SeriesCollection.Add(mobj_tic_series);

                // Set category info
                this.Category        = new CategoryInfo[] { frmSpectra.MainCategory, new CategoryInfo("Unopened") };
                this.CategorizedText = "Unopened";

                mobjRawData = new DeconToolsV2.Readers.clsRawData();

                mctl_tic.DefaultZoomHandler.SingleClickNoZoomPerformed += new SingleClickNoZoomHandler(TicDefaultZoomHandler_SingleClickNoZoomPerformed);

                this.frmSpectra_Resize(this, null);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message);
            }
        }
Example #2
0
        public void LoadIcr2lsTICFile()
        {
            try
            {
                mobjRawData.LoadFile(mFileName, DeconToolsV2.Readers.FileType.ICR2LSRAWDATA);
                mobjRawData.GetTicFromFile(ref marr_tic_values, ref marr_scans, true);
                var plotParams = (clsPlotParams)mobj_tic_plt_params.Clone();
                plotParams.Name = "TIC";

                mobj_tic_series =
                    new clsSpectraSeries(new PNNL.Controls.ArrayChartDataProvider(marr_scans, marr_tic_values),
                                         plotParams, mFileNameForHeader);
                mctl_tic.SeriesCollection.Add(mobj_tic_series);
                m_tic_chart_data_provider.SetData(marr_scans, marr_tic_values);
                mctl_tic.Title = "TIC";
                this.mctl_tic.ViewPortHistory.Clear();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message + ex.StackTrace);
            }
        }
Example #3
0
        public void LoadScansTICFile()
        {
            try
            {
                mdata_tbl = new System.Data.DataTable();
                using (var parser = new clsGenericParserAdapter())
                {
                    parser.SetDataSource(mFileName);
                    parser.ColumnDelimiter   = ",".ToCharArray();
                    parser.FirstRowHasHeader = true;
                    parser.MaxBufferSize     = 4096;
                    parser.TextQualifier     = '\'';
                    mdata_tbl = parser.GetDataTable();
                    var    scan_num_col = parser.GetColumnIndex("scan_num");
                    var    tic_col      = parser.GetColumnIndex("tic");
                    var    bpi_col      = parser.GetColumnIndex("bpi");
                    var    num_entries  = mdata_tbl.Rows.Count;
                    double scan;
                    double tic;
                    double bpi;

                    marr_tic_values = new float[num_entries];
                    marr_scans      = new float[num_entries];
                    marr_bpi_values = new float[num_entries];

                    for (var entry_num = 0; entry_num < num_entries; entry_num++)
                    {
                        var row = mdata_tbl.Rows[entry_num];
                        scan = Convert.ToDouble(row[scan_num_col].ToString());
                        tic  = Convert.ToDouble(row[tic_col].ToString());
                        bpi  = Convert.ToDouble(row[bpi_col].ToString());

                        marr_scans.SetValue((float)scan, entry_num);
                        marr_tic_values.SetValue((float)tic, entry_num);
                        marr_bpi_values.SetValue((float)bpi, entry_num);
                    }

                    parser.Close();

                    var plotParams = (clsPlotParams)mobj_tic_plt_params.Clone();
                    plotParams.Name = "TIC";

                    mobj_tic_series =
                        new clsSpectraSeries(new PNNL.Controls.ArrayChartDataProvider(marr_scans, marr_tic_values),
                                             plotParams, mFileNameForHeader);

                    var plotParams1 = (clsPlotParams)mobj_bpi_plt_params.Clone();
                    plotParams1.Name = "BPI";

                    mobj_bpi_series =
                        new clsSpectraSeries(new PNNL.Controls.ArrayChartDataProvider(marr_scans, marr_bpi_values),
                                             plotParams1, mFileNameForHeader);


                    mctl_tic.SeriesCollection.Add(mobj_tic_series);
                    mctl_bpi.SeriesCollection.Add(mobj_bpi_series);
                    m_tic_chart_data_provider.SetData(marr_scans, marr_tic_values);
                    m_bpi_chart_data_provider.SetData(marr_scans, marr_bpi_values);
                    mctl_bpi.Title = "BPI";
                    mctl_tic.Title = "TIC";
                    this.Text      = mFileNameForHeader;


                    this.mctl_tic.ViewPortHistory.Clear();
                    this.mctl_bpi.ViewPortHistory.Clear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message + ex.StackTrace);
            }
        }