Пример #1
0
        private void GenerateTasks()
        {
            using (var scope = container.BeginLifetimeScope())
            {
                ISpectrumFactory spectrumFactory = scope.Resolve <ISpectrumFactory>();
                spectrumFactory.Init(SearchParameters.Access.MSMSFile);
                int start = spectrumFactory.GetFirstScan();
                int end   = spectrumFactory.GetLastScan();

                List <int> msSpectrumScans = new List <int>();
                for (int scan = start; scan <= end; scan++)
                {
                    if (spectrumFactory.GetMSnOrder(scan) == 1)
                    {
                        msSpectrumScans.Add(scan);
                    }
                }

                for (int i = 0; i < msSpectrumScans.Count; i++)
                {
                    if (i < msSpectrumScans.Count - 1)
                    {
                        tasks.Enqueue(new Tuple <int, int>(msSpectrumScans[i], msSpectrumScans[i + 1] - 1));
                    }
                    else
                    {
                        tasks.Enqueue(new Tuple <int, int>(msSpectrumScans[i], end));
                    }
                }
            }
        }
 private void InitializeWindow()
 {
     using (var scope = container.BeginLifetimeScope())
     {
         ISpectrumFactory spectrumFactory = scope.Resolve <ISpectrumFactory>();
         Results = scope.Resolve <IResults>();
         spectrumFactory.Init(SearchParameters.Access.MSMSFile);
         StartScan = spectrumFactory.GetFirstScan();
         EndScan   = spectrumFactory.GetLastScan();
     }
 }
 public int GetFirstScan()
 {
     return(spectrumFactory.GetFirstScan());
 }