示例#1
0
        private bool Load(ILoadMonitor loader)
        {
            ProgressStatus status = new ProgressStatus(string.Empty);

            loader.UpdateProgress(status);

            bool cached = loader.StreamManager.IsCached(FilePath, CachePath);

            if (Load(loader, status, cached))
            {
                return(true);
            }

            // If loading from the cache failed, rebuild it.
            if (cached)
            {
                // Reset readStream so we don't read corrupt file.
                _readStream = null;
                if (Load(loader, status, false))
                {
                    return(true);
                }
            }

            return(false);
        }
示例#2
0
 private Stream CreateStream(ILoadMonitor loader)
 {
     if (_readStream == null)
     {
         _readStream = loader.StreamManager.CreatePooledStream(FilePath, false);
     }
     return(ReadStream.Stream);
 }
示例#3
0
        public ChromCacheJoiner(string cachePath, IPooledStream streamDest,
            IList<string> cacheFilePaths, ILoadMonitor loader, ProgressStatus status,
            Action<ChromatogramCache, Exception> completed)
            : base(cachePath, loader, status, completed)
        {
            _destinationStream = streamDest;

            CacheFilePaths = cacheFilePaths;
        }
示例#4
0
        public ChromCacheJoiner(string cachePath, IPooledStream streamDest,
                                IList <string> cacheFilePaths, ILoadMonitor loader, ProgressStatus status,
                                Action <ChromatogramCache, IProgressStatus> completed)
            : base(cachePath, loader, status, completed)
        {
            _destinationStream = streamDest;

            CacheFilePaths = cacheFilePaths;
        }
示例#5
0
        public ChromCacheJoiner(string cachePath, IPooledStream streamDest,
                                IList <string> cacheFilePaths, ILoadMonitor loader, ProgressStatus status,
                                Action <ChromatogramCache, IProgressStatus> completed,
                                bool assumeNegativeChargeInPreV11Caches)
            : base(cachePath, loader, status, completed)
        {
            _destinationStream = streamDest;

            CacheFilePaths = cacheFilePaths;
            _assumeNegativeChargeInPreV11Caches = assumeNegativeChargeInPreV11Caches; // Deal with older cache formats where we did not record polarity
        }
示例#6
0
 public void Commit(string pathTemp, string pathDestination, IPooledStream streamDest)
 {
     if (_textFiles.ContainsKey(pathTemp))
     {
         _textFiles[pathDestination] = _textFiles[pathTemp];
     }
     else if (_binaryFiles.ContainsKey(pathTemp))
     {
         _binaryFiles[pathDestination] = _binaryFiles[pathTemp];
     }
     Delete(pathTemp);
 }
示例#7
0
        public ChorusResponseChromDataProvider(SrmDocument document, ChromFileInfo chromFileInfo, IProgressStatus progressStatus, int startPercent,
                                               int endPercent, ILoadMonitor loader) : base(chromFileInfo, progressStatus, startPercent, endPercent, loader)
        {
            ChromatogramCache.RawData rawData;
            MsDataFilePath            msDataFilePath = (MsDataFilePath)chromFileInfo.FilePath;
            IPooledStream             stream         = loader.StreamManager.CreatePooledStream(msDataFilePath.FilePath, false);

            ChromatogramCache.LoadStructs(stream.Stream, out rawData);
            var chromCacheFile = rawData.ChromCacheFiles[0];

            rawData.ChromCacheFiles = new[]
            {
                new ChromCachedFile(chromFileInfo.FilePath, chromCacheFile.Flags, chromCacheFile.FileWriteTime,
                                    chromCacheFile.RunStartTime, chromCacheFile.MaxRetentionTime, chromCacheFile.MaxIntensity,
                                    chromCacheFile.InstrumentInfoList),
            };
            var cache = new ChromatogramCache("cachePath", rawData, stream); // Not L10N

            _cachedChromatogramDataProvider = new CachedChromatogramDataProvider(cache, document,
                                                                                 chromFileInfo.FilePath, chromFileInfo, null, progressStatus, startPercent, endPercent, loader);
        }
 public void Commit(string pathTemp, string pathDestination, IPooledStream streamDest)
 {
     if (_textFiles.ContainsKey(pathTemp))
         _textFiles[pathDestination] = _textFiles[pathTemp];
     else if (_binaryFiles.ContainsKey(pathTemp))
         _binaryFiles[pathDestination] = _binaryFiles[pathTemp];
     Delete(pathTemp);
 }
示例#9
0
 private Stream CreateStream(ILoadMonitor loader)
 {
     if (_readStream == null)
         _readStream = loader.StreamManager.CreatePooledStream(FilePath, false);
     return ReadStream.Stream;
 }