コード例 #1
0
        /// <summary>
        /// Initiates a dynamic connection with a Thermo .raw file. Data can be "streamed" instead of loaded all at once. Use
        /// GetOneBasedScanFromDynamicConnection to get data from a particular scan. Use CloseDynamicConnection to close the
        /// dynamic connection after all desired data has been retrieved from the dynamic connection.
        /// </summary>
        private void InitiateDynamicConnection(string filePath)
        {
            Loaders.LoadElements();

            if (dynamicConnection != null)
            {
                dynamicConnection.Dispose();
            }

            dynamicConnection = RawFileReaderAdapter.FileFactory(filePath);

            if (!File.Exists(filePath))
            {
                throw new FileNotFoundException();
            }

            if (!dynamicConnection.IsOpen)
            {
                throw new MzLibException("Unable to access RAW file!");
            }

            if (dynamicConnection.IsError)
            {
                throw new MzLibException("Error opening RAW file!");
            }

            if (dynamicConnection.InAcquisition)
            {
                throw new MzLibException("RAW file still being acquired!");
            }

            dynamicConnection.SelectInstrument(Device.MS, 1);
            GetMsOrdersByScanInDynamicConnection();
        }
コード例 #2
0
ファイル: RawFileViz.cs プロジェクト: stoeckli/RawTools
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     if (ConfirmExit() == false)
     {
         e.Cancel = true;
     }
     else
     {
         RawData.Dispose();
         rawFileThreadManager.Dispose();
     }
 }
コード例 #3
0
ファイル: ThermoDynamicData.cs プロジェクト: zrolfs/mzLib
        /// <summary>
        /// Initiates a dynamic connection with a Thermo .raw file. Data can be "streamed" instead of loaded all at once. Use
        /// GetOneBasedScanFromDynamicConnection to get data from a particular scan. Use CloseDynamicConnection to close the
        /// dynamic connection after all desired data has been retrieved from the dynamic connection.
        /// </summary>
        protected override void InitiateDynamicConnection()
        {
            if (!File.Exists(FilePath))
            {
                throw new FileNotFoundException();
            }

            if (Path.GetExtension(FilePath).ToUpper() != ".RAW")
            {
                throw new InvalidDataException();
            }

            Loaders.LoadElements();

            if (dynamicConnection != null)
            {
                dynamicConnection.Dispose();
            }

            dynamicConnection = RawFileReaderAdapter.FileFactory(FilePath);

            if (!dynamicConnection.IsOpen)
            {
                throw new MzLibException("Unable to access RAW file!");
            }

            if (dynamicConnection.IsError)
            {
                throw new MzLibException("Error opening RAW file!");
            }

            if (dynamicConnection.InAcquisition)
            {
                throw new MzLibException("RAW file still being acquired!");
            }

            dynamicConnection.SelectInstrument(Device.MS, 1);
            GetMsOrdersByScanInDynamicConnection();
        }
コード例 #4
0
 /// <summary>
 /// Dispose of the raw file object to handle memory situation
 /// </summary>
 /// <param name="rawFile"></param>
 private void CleanUpRawFile(IRawDataPlus rawFile)
 {
     rawFile.Dispose();
 }
コード例 #5
0
ファイル: RawReader.cs プロジェクト: gygilab/Monocle
 /// <summary>
 /// Dispose of the raw file when reading multiple files.
 /// </summary>
 public void Close()
 {
     rawFile.Dispose();
 }