Inheritance: Caliburn.Micro.PropertyChangedBase, IPlugin
Exemplo n.º 1
0
        public void PoiService_SetExtent()
        {
            var appState = AppStateSettings.GetInstance();
            appState.ViewDef.AcceleratedLayers = new GroupLayer();
            appState.ViewDef.Layers = new GroupLayer();
            appState.ViewDef.MapControl = new Map();
            appState.TimelineManager = new TimelineManager();
            var dataServerPlugin = new DataServerPlugin();
            dataServerPlugin.AppState = appState;
            dataServerPlugin.Init();
            dataServerPlugin.Start();

            var ds = dataServerPlugin.Dsb;

            /*
            DataServerBase ds = null;
            ds = new DataServerBase();
            ds.Start("PoiLayers", Mode.server, null, false, true);
            */


            Assert.NotNull(ds);
            Assert.Equal(ds.IsRunning, true);
            Assert.Equal(ds.Services.OfType<PoiService>().Any(), true);

            var nl = new BoundingBox(1.41852205678639, 50.6702276112004, 9.595187398461, 53.4954126495966);
            var amersfoort = new BoundingBox(5.16706546164613, 52.0767306960208, 5.67810704550079, 52.2530563435811);
            var veenendaal = new BoundingBox(5.28710700035366, 51.969451898025, 5.79814858420832, 52.1462014821955);
            var service = ds.Services.OfType<PoiService>().Skip(0).First();
            service.Start();
            //service.Init(Mode.server, ds);

            service.Initialized += (sender, args) =>
            {
                _output.WriteLine("Initialized: {0} pois", service.PoIs.Count);

                var timer = new Stopwatch();
                timer.Start();
                service.SetExtent(nl); // nl
                timer.Stop();
                _output.WriteLine("{0} pois in nl({1:N2}s)", service.ContentInExtent.Count(), timer.Elapsed.TotalSeconds);
                timer.Reset();

                timer.Start();
                service.SetExtent(amersfoort); // amersfoort
                timer.Stop();
                _output.WriteLine("{0} pois in amersfoort({1:N2}s)", service.ContentInExtent.Count(), timer.Elapsed.TotalSeconds);
                timer.Reset();

                timer.Start();
                service.SetExtent(veenendaal); // veenendaal
                timer.Stop();
                _output.WriteLine("{0} pois in veenendaal({1:N2}s)", service.ContentInExtent.Count(), timer.Elapsed.TotalSeconds);

            };

            service.Start();
            //service.InitPoiService();
        }
Exemplo n.º 2
0
 public dsLayer(PoiService s, DataServerPlugin p)
 {
     if (s == null)
     {
         csCommon.Logging.LogCs.LogMessage(String.Format("dsLayer: Create PoiService '{0}'", "empty"));
         s = new PoiService();
     }
     Service = s;
     ID = Service.Name;
     plugin = p;
     PoiLayers = new Dictionary<string, dsPoiLayer>();
     OverlayLayers = new Dictionary<string, dsOverlayLayer>();
     Children = new ObservableCollection<Layer>();
     s.PropertyChanged += s_PropertyChanged;
 }
Exemplo n.º 3
0
        public dsStaticLayer(PoiService s, DataServerPlugin p)
        {
            if (s == null)
            {
                csCommon.Logging.LogCs.LogMessage(String.Format("dsStaticLayer: Create PoiService '{0}'", "empty"));
                s = new PoiService();
            }
            Service   = s;
            Visible   = false;
            ID        = Service.Name;
            plugin    = p;
            subLayers = new Dictionary<string, dsStaticSubLayer>();
            Children  = new ObservableCollection<Layer>();

            s.AllPoisRefreshed += (delegate { RefreshAllVisiblePois(); });
        }
Exemplo n.º 4
0
        public void DataServer_LoadsServices()
        {
            /*
            DataServerBase ds = null;
            ds = new DataServerBase();
            ds.Start("PoiLayers", Mode.server, null, false, true);
            Assert.NotNull(ds);
            Assert.Equal(ds.IsRunning, true);
            Assert.Equal(ds.Services.Count > 0, true);
            */

            var appState = AppStateSettings.GetInstance();
            var dataServerPlugin = new DataServerPlugin();
            dataServerPlugin.AppState = appState;
            dataServerPlugin.Init();
            dataServerPlugin.Start();
            var ds = dataServerPlugin.Dsb;

            //ds.Start("PoiLayers", Mode.server, null, false, true);
            Assert.NotNull(ds);
            Assert.Equal(ds.IsRunning, true);
            Assert.Equal(ds.Services.Count > 0, true);
        }