Exemplo n.º 1
0
 public static async Task ExecuteTask(IEnumerable <string> preinstalledUuids, IEnumerable <int> supportedVersions)
 {
     foreach (var tagVersion in supportedVersions)
     {
         await CachePackage.DownloadAndCachePluginPackages(tagVersion);
     }
     UnzipPackages(preinstalledUuids);
 }
Exemplo n.º 2
0
        public void AccumulateRobustHash_PerTile(CachePackage cachePackage, IRobustHash hash)
        {
            hash.Accumulate("SourceMap:");
            var sourceDocument = documentFuture.RealizeSynchronously(cachePackage);

            sourceDocument.localDocument.AccumulateRobustHash(hash);
            AccumulateRobustHash_Common(hash);
        }
Exemplo n.º 3
0
 public void AccumulateRobustHash_PerTile(CachePackage cachePackage, IRobustHash hash)
 {
     hash.Accumulate("Layer(");
     foreach (SourceMap current in this.sourceMaps)
     {
         current.AccumulateRobustHash_PerTile(cachePackage, hash);
     }
     hash.Accumulate(")");
 }
Exemplo n.º 4
0
 internal OneLayerBoundApplier(IRenderableSource source, Layer layer, CachePackage cachePackage)
 {
     this.source             = source;
     this.layer              = layer;
     this.clippedImageFuture = new MemCachePrototype(cachePackage.computeCache, new ApplyPrototype(new UserClipperVerb(), new IFuturePrototype[]
     {
         source.GetImagePrototype(null, (FutureFeatures)11),
         new UnevaluatedTerm(TermName.TileAddress),
         source.GetUserBounds(null, FutureFeatures.Cached)
     }));
 }
Exemplo n.º 5
0
        internal EntityIndexManager(string cachekey)
        {
            _cachekey = cachekey;
            _indexCache = new CachePackage(CachePackageKey);

            _indexCache.TryGetCache(_cachekey, out _entityIndexDict);
            if (_entityIndexDict == null)
            {
                _indexCache.AddCache(_cachekey, new TDictionary<string, EntityIndexList>());
                _indexCache.TryGetCache(_cachekey, out _entityIndexDict);
            }
        }
Exemplo n.º 6
0
 public RenderedMashupViewer(CachePackage cachePackage, ToolStripMenuItem dmsMenuItem)
 {
     this.InitializeComponent();
     this.cachePackage = cachePackage;
     this.mapPos       = new MapPosition(this.viewer);
     this.viewer.Initialize(new MapPositionDelegate(this.GetMapPos), "Map Location");
     this.viewer.ShowDMS = new MapDrawingOption(this.viewer, dmsMenuItem, false);
     this.SetVEMapStyle(VirtualEarthWebDownloader.RoadStyle);
     this.mapPos.setPosition(this.viewer.GetCoordinateSystem().GetDefaultView());
     this.printDoc            = new PrintDocument();
     this.printDoc.PrintPage += new PrintPageEventHandler(this.PrintPage);
 }
Exemplo n.º 7
0
        internal EntityIndexManager(string cachekey)
        {
            _cachekey   = cachekey;
            _indexCache = new CachePackage(CachePackageKey);

            _indexCache.TryGetCache(_cachekey, out _entityIndexDict);
            if (_entityIndexDict == null)
            {
                _indexCache.AddCache(_cachekey, new TDictionary <string, EntityIndexList>());
                _indexCache.TryGetCache(_cachekey, out _entityIndexDict);
            }
        }
Exemplo n.º 8
0
        public SourceDocument RealizeSynchronously(CachePackage cachePackage)
        {
            Present present = GetSynchronousFuture(cachePackage).Realize("SourceDocument.RealizeSynchronously");

            if (present is SourceDocument)
            {
                SourceDocument sourceDocument = (SourceDocument)present;
                D.Assert(sourceDocument.localDocument != null, "We waited for document to arrive synchronously.");
                return(sourceDocument);
            }

            throw ((PresentFailureCode)present).exception;
        }
Exemplo n.º 9
0
 public RenderedTileSource(CachePackage cachePackage, RenderedTileNamingScheme namingScheme)
 {
     this.cachePackage = cachePackage;
     this.namingScheme = namingScheme;
     coordinateSystem  = new MercatorCoordinateSystem();
 }
Exemplo n.º 10
0
        private static RenderedLayerDisplayInfo BuildLayerSelector(ViewerControl viewer, CachePackage cachePackage,
                                                                   string basePath, CrunchedFile crunchedFile)
        {
            RenderedLayerDisplayInfo renderedLayerDisplayInfo = new RenderedLayerDisplayInfo();

            renderedLayerDisplayInfo.tsmiList = new List <ToolStripMenuItem>();
            foreach (CrunchedLayer current in crunchedFile.crunchedLayers)
            {
                RenderedLayerSelector renderedLayerSelector = new RenderedLayerSelector(current);
                renderedLayerSelector.viewer     = viewer;
                renderedLayerSelector.menuItem   = new ToolStripMenuItem(current.displayName);
                renderedLayerSelector.tileSource = new RenderedTileSource(cachePackage,
                                                                          new VENamingScheme(Path.Combine(basePath, current.namingScheme.GetFilePrefix()),
                                                                                             current.namingScheme.GetFileSuffix()));
                renderedLayerSelector.menuItem.Tag    = renderedLayerSelector;
                renderedLayerSelector.menuItem.Click += MenuItem_Click;
                renderedLayerDisplayInfo.tsmiList.Add(renderedLayerSelector.menuItem);
            }

            for (int i = 0; i < renderedLayerDisplayInfo.tsmiList.Count; i++)
            {
                ((RenderedLayerSelector)renderedLayerDisplayInfo
                 .tsmiList[renderedLayerDisplayInfo.tsmiList.Count - 1 - i].Tag).ToggleLayer();
            }

            renderedLayerDisplayInfo.defaultView = crunchedFile.crunchedLayers[0].defaultView;
            return(renderedLayerDisplayInfo);
        }
Exemplo n.º 11
0
        public static RenderedLayerDisplayInfo GetLayerSelector(ViewerControl viewer, CachePackage cachePackage,
                                                                Uri uri)
        {
            RenderedLayerDisplayInfo result;

            try
            {
                CrunchedFile renderedMashupsFromFile = GetRenderedMashupsFromFile(uri);
                D.Assert(uri.IsFile);
                string localPath = uri.LocalPath;
                result = BuildLayerSelector(viewer,
                                            cachePackage,
                                            Path.GetDirectoryName(localPath),
                                            renderedMashupsFromFile);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error opening crunched file ", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                result = null;
            }

            return(result);
        }
Exemplo n.º 12
0
        public static RenderedLayerDisplayInfo GetLayerSelector(ViewerControl viewer, CachePackage cachePackage)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = string.Format("MapCruncher Rendered Layers (*{0})|*{1}{2}",
                                                  CrunchedFile.CrunchedFilenameExtension,
                                                  CrunchedFile.CrunchedFilenameExtension,
                                                  BuildConfig.theConfig.allFilesOption);
            openFileDialog.FilterIndex      = 1;
            openFileDialog.RestoreDirectory = true;
            if (openFileDialog.ShowDialog() != DialogResult.OK)
            {
                return(null);
            }

            Uri uri = new Uri(openFileDialog.FileName);

            return(GetLayerSelector(viewer, cachePackage, uri));
        }
Exemplo n.º 13
0
 public MapTileSourceFactory(CachePackage cachePackage)
 {
     this.cachePackage = cachePackage;
 }
Exemplo n.º 14
0
 public IFuture GetAsynchronousFuture(CachePackage cachePackage)
 {
     return(new MemCacheFuture(cachePackage.asyncCache,
                               Asynchronizer.MakeFuture(cachePackage.computeAsyncScheduler, GetSynchronousFuture(cachePackage))));
 }
Exemplo n.º 15
0
 public IFuture GetSynchronousFuture(CachePackage cachePackage)
 {
     return(new MemCacheFuture(cachePackage.documentFetchCache, documentFuture));
 }