Пример #1
0
 private unsafe void CreateAndStartDiskCacheManager()
 {
     _diskCacheManager = new TileDiskCacheManager(_dataProvider, _settings.CacheDir,
                                                  _dataProvider.fileName, _tileComputer,
                                                  new TileReadedCallback(OnReceiveTile));
     //将第一次设置的读取波段添加到异步读取队列
     for (int i = 0; i < _bands.Length; i++)
     {
         _bandCaches.Add(_bands[i], new BandMemoryCache(_tileComputer, _bands[i], this));
         for (int lv = 0; lv < _tileComputer.Levels.Length; lv++)
         {
             _diskCacheManager.Enqueue(_bands[i], _tileComputer.Levels[lv]);
         }
     }
     //将剩余波段加入异步读取队列
     for (int b = 1; b <= _dataProvider.BandCount; b++)
     {
         if (Array.IndexOf <int>(_bands, b) >= 0)
         {
             continue;
         }
         _bandCaches.Add(b, new BandMemoryCache(_tileComputer, b, this));
         for (int lv = 0; lv < _tileComputer.Levels.Length; lv++)
         {
             _diskCacheManager.Enqueue(b, _tileComputer.Levels[lv]);
         }
     }
 }
Пример #2
0
        public void LoadBySync_MaxLevel()
        {
            LevelId lv = _tileComputer.Levels[_tileComputer.Levels.Length - 1];

            LoadBySync(lv.No);
            for (int b = 0; b < _dataProvider.BandCount; b++)
            {
                if (Array.IndexOf <int>(_bands, b + 1) >= 0)
                {
                    continue;
                }
                _diskCacheManager.Enqueue(b + 1, lv);
            }
        }