Beispiel #1
0
 void videoImbChannelIn_OnNormalEvent(TEventEntry aEvent, IMB3.ByteBuffers.TByteBuffer aPayload)
 {
     var cmdLine = aPayload.ReadString();
     var cmdParams = cmdLine.Split(new char[] {'|'}, StringSplitOptions.RemoveEmptyEntries);
     if (cmdParams.Length < 1) return;
     switch (cmdParams[0])
     {
         case "DisplayVideoCmd":
             var cmd = new DisplayVideoCmd(ref cmdParams);
             if (DisplayVideoEvent != null)
                 DisplayVideoEvent(new DisplayVideoCmdEventArgs(cmd));
             break;
     }
 }
Beispiel #2
0
 void followMap_OnNormalEvent(TEventEntry aEvent, IMB3.ByteBuffers.TByteBuffer aPayload)
 {
     var s = aPayload.ReadString();
     var ss = s.Split('|');
     double xmin = Convert.ToDouble(ss[0], CultureInfo.InvariantCulture);
     double ymin = Convert.ToDouble(ss[1], CultureInfo.InvariantCulture);
     double xmax = Convert.ToDouble(ss[2], CultureInfo.InvariantCulture);
     double ymax = Convert.ToDouble(ss[3], CultureInfo.InvariantCulture);
     Execute.OnUIThread(delegate
                            {
                                AppState.ViewDef.MapControl.Extent = new Envelope(xmin, ymin, xmax, ymax);    
                            });
     
 
     
 }  
Beispiel #3
0
        void CommandChannelOnNormalEvent(TEventEntry aEvent, IMB3.ByteBuffers.TByteBuffer aPayload)
        {
            var l  = aPayload.ReadString();
            var ss = l.Split('|');
            switch (ss[0])
            {
                case "point":
                    Execute.OnUIThread(() =>
                    {
                        var xp = Convert.ToDouble(ss[1], CultureInfo.InvariantCulture);
                        var yp = Convert.ToDouble(ss[2], CultureInfo.InvariantCulture);
                        var c = AppState.Imb.FindClient(long.Parse(ss[3]));
                        if (c != null)
                        {
                            var nea = new NotificationEventArgs()
                            {
                                Duration   = TimeSpan.FromSeconds(5),
                                Options    = new List<string> { "Zoom to" },
                                PathData   = MenuHelpers.PointerIcon,
                                Header     = "Pointer triggered by " + c.Name,
                                Background = AppState.AccentBrush,
                                Foreground = System.Windows.Media.Brushes.Black,

                            };

                            nea.OptionClicked += (e, f) => AppState.ViewDef.ZoomAndPoint(new Point(yp, xp), false);

                            AppState.TriggerNotification(nea);
                        }

                        AppState.ViewDef.AddGeoPointer(new GeoPointerArgs() { Position = new MapPoint(yp, xp), Duration = TimeSpan.FromSeconds(2) });
                    });
                    break;
                case "map":
                    if (!string.Equals(l, lastMapEvent) && FollowMap)
                    {
                        lastMapEvent = l;

                        var x = Convert.ToDouble(ss[1], CultureInfo.InvariantCulture);
                        var y = Convert.ToDouble(ss[2], CultureInfo.InvariantCulture);
                        var r = Convert.ToDouble(ss[3], CultureInfo.InvariantCulture);

                        Execute.OnUIThread(delegate
                        {
                            var w = (AppState.ViewDef.MapControl.ActualWidth / 2) * r;
                            var h = (AppState.ViewDef.MapControl.ActualHeight / 2) * r;
                            var env = new Envelope(x - w, y - h, x + w, y + h);
                            AppState.ViewDef.MapControl.Extent = env;
                        });
                        skipNext = true;
                    }
                    break;
            }
        }