示例#1
0
        private void mmnuOpenResults_Click(object sender, System.EventArgs e)
        {
            try
            {
                var openFileDialog1 = new OpenFileDialog();
                openFileDialog1.Filter           = "Raw Peak Files (*.dat)|*.dat";
                openFileDialog1.FilterIndex      = 1;
                openFileDialog1.RestoreDirectory = true;
                openFileDialog1.InitialDirectory = mobj_config.OpenDir;

                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    var file_name = openFileDialog1.FileName;
                    var index     = file_name.LastIndexOf("\\");
                    var path_dir  = "";

                    if (index > 0)
                    {
                        path_dir            = file_name.Substring(0, index);
                        mobj_config.OpenDir = path_dir;
                    }
                    var transformResults = new DeconToolsV2.Results.clsTransformResults();
                    transformResults.ReadResults(file_name);
                    var frmTwoD = new frm2DPeakProcessing(transformResults);
                    frmTwoD.HornTransformParameters = mobjTransformParameters;
                    frmTwoD.PeakProcessorParameters = mobjPeakParameters;
                    frmTwoD.FTICRPreProcessOptions  = mobjFTICRRawPreProcessParameters;
                    mMediator.RequestFormOpen(frmTwoD);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
示例#2
0
        private void frmDecon2LS_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
        {
            foreach (var fileName in (string[])e.Data.GetData(DataFormats.FileDrop))
            {
                var index    = fileName.LastIndexOf("\\");
                var path_dir = "";

                if (index > 0)
                {
                    path_dir            = fileName.Substring(0, index);
                    mobj_config.OpenDir = path_dir;
                }

                if (fileName.EndsWith("_scans.csv"))
                {
                    index++;
                    var file_name_without_path = "";

                    if (index > 0)
                    {
                        file_name_without_path = fileName.Substring(index, fileName.Length - index);
                    }

                    var frmTIC = new frmTICViewer();
                    frmTIC.mFileName          = fileName;
                    frmTIC.mFileNameForHeader = file_name_without_path;
                    frmTIC.LoadScansTICFile();
                    mMediator.RequestFormOpen(frmTIC);
                }
                else if (fileName.EndsWith(".dat"))
                {
                    var transformResults = new DeconToolsV2.Results.clsTransformResults();
                    transformResults.ReadResults(fileName);
                    var frmTwoD = new frm2DPeakProcessing(transformResults);
                    frmTwoD.HornTransformParameters = mobjTransformParameters;
                    frmTwoD.PeakProcessorParameters = mobjPeakParameters;
                    frmTwoD.FTICRPreProcessOptions  = mobjFTICRRawPreProcessParameters;
                    mMediator.RequestFormOpen(frmTwoD);
                }
                else if (fileName.EndsWith(".tic"))
                {
                    index++;
                    var file_name_without_path = "";

                    if (index > 0)
                    {
                        file_name_without_path = fileName.Substring(index, fileName.Length - index);
                    }

                    var frmTIC = new frmTICViewer();
                    frmTIC.mFileName          = fileName;
                    frmTIC.mFileNameForHeader = file_name_without_path;
                    frmTIC.LoadIcr2lsTICFile();
                    mMediator.RequestFormOpen(frmTIC);
                }
                else
                {
                    Console.WriteLine("File cannot be dragged and dropped");
                }
            }
        }