Ejemplo n.º 1
0
        //Austen: changed input params to pass entire layer list so that we'd have access to all it's values
        public void CreatePoint(ILayer FP_point, int layer, LayerList layerList, string id, double lat, double lon, DateTime time, bool isStale, int displayChoice)
        {
            if (isStale == false)
                iconLoc += "red turn.ico";
            else
                iconLoc += "white turn.ico";

            try
            {
                FP_point.DeleteAllObjects(layer);// delete everything on this layer.. keeps us from having bread crumbs

                FP_point.AddIcon(layer, iconLoc, lat, lon, "");

                if (layerList.FP_LatLonlist.Count > 1)
                {
                    double lat1 = layerList.FP_LatLonlist[layerList.FP_LatLonlist.Count - 1].lat;
                    double lon1 = layerList.FP_LatLonlist[layerList.FP_LatLonlist.Count - 1].lon;
                    DateTime time1 = layerList.FP_LatLonlist[layerList.FP_LatLonlist.Count - 1].time;

                    double heading = logistics.Heading(lat, lon, lat1, lon1); // Compute heading
                    double speed = logistics.SpeedMPH(lat, lon, lat1, lon1, time, time1); // Compute Speed
                    RenderArrow(FP_point, layerList, lat, lon, time, heading);

                    //{MPH = 0, Bearing = 1, None = 2, Both = 3};
                    if (displayChoice == 0) // if we want to see just mph
                    {
                        AddUIDText(FP_point, layerList, lat, lon, heading, id, YtextOffset - 15);
                        AddSpeedText(FP_point, layerList, lat, lon, speed, heading, YtextOffset);
                    }

                    if (displayChoice == 1) // if we want to see just bearing
                    {
                        AddUIDText(FP_point, layerList, lat, lon, heading, id, YtextOffset - 15);
                        AddHeadingText(FP_point, layerList, lat, lon, heading, YtextOffset);
                    }

                    if (displayChoice == 2) // if we want to see just id
                    {
                        AddUIDText(FP_point, layerList, lat, lon, heading, id, YtextOffset);
                    }

                    if (displayChoice == 3) // if we want to see just all
                    {
                        AddUIDText(FP_point, layerList, lat, lon, heading, id, YtextOffset - 30);
                        AddSpeedText(FP_point, layerList, lat, lon, speed, heading, YtextOffset - 15);
                        AddHeadingText(FP_point, layerList, lat, lon, heading, YtextOffset);
                    }
                }

                FP_point.Refresh(-1);
            }
            catch (Exception ex)
            {
                string error = ex.Message;
                MessageBox.Show("Error Message: "+ex.Message+ " Stack Trace: "+ex.StackTrace);
            }
        }
Ejemplo n.º 2
0
        //Austen: changed input params to pass entire layer list so that we'd have access to all it's values
        public void CreatePoint(ILayer FP_point, int layer, LayerList layerList, string id, double lat, double lon, DateTime time, bool isStale)
        {
            if (isStale == false)
                iconLoc += "red turn.ico";
            else
                iconLoc += "white turn.ico";

            try
            {
                FP_point.DeleteAllObjects(layer);// delete everything on this layer.. keeps us from having bread crumbs

                FP_point.AddIcon(layer, iconLoc, lat, lon, "");

                if (layerList.FP_LatLonlist.Count > 1)
                {
                    double lat1 = layerList.FP_LatLonlist[layerList.FP_LatLonlist.Count - 1].lat;
                    double lon1 = layerList.FP_LatLonlist[layerList.FP_LatLonlist.Count - 1].lon;
                    DateTime time1 = layerList.FP_LatLonlist[layerList.FP_LatLonlist.Count - 1].time;

                    double heading = logistics.Heading(lat, lon, lat1, lon1); //Compute heading
                    double speed = logistics.SpeedMPH(lat, lon, lat1, lon1, time, time1); //Compute Speed
                    RenderArrow(FP_point, layerList, lat, lon, time, heading);

                    AddUIDText(FP_point, layerList, lat, lon, heading, id);
                    AddHeadingText(FP_point, layerList, lat, lon, heading);
                    AddSpeedText(FP_point, layerList, lat, lon, speed, heading);
                }

                FP_point.Refresh(-1);
            }
            catch (Exception ex)
            {
                string error = ex.Message;
                MessageBox.Show("Error Message: "+ex.Message+ " Stack Trace: "+ex.StackTrace);
            }
        }
Ejemplo n.º 3
0
        // create a new layer, return the handle, and add info to list
        // Creates a new layer
        public int CreateLayer(string _cotID)
        {
            int result = 50; // result is used for debugging... i used 50 so that i could tell that -1, 0, or 1 was the output... nothing special about 50
            FP_point = new LayerClass();

            result = FP_point.RegisterWithMapServer("falconpoint", 0, _FPmainAddr); // result is used for debugging
            currentLayerHandle = FP_point.CreateLayer("FP layer");

            System.Diagnostics.Debug.WriteLine("registered with map server result = " + currentLayerHandle); // used for debugging... shows registration result in output window

            temp_layerList.Layer = currentLayerHandle; // temp list item
            temp_layerList.cotID = _cotID; // temp list item

            FP_layerList.Add(temp_layerList); // add temp items to real list

            temp_layerList = new LayerList(); // create a new temp list... otherwise we would keep writing over the old list

            return currentLayerHandle; // return the newly created layer handle ... should be something like 102, 103..
        }
Ejemplo n.º 4
0
 public void AddUIDText(ILayer FP_point, LayerList layerList, double lat, double lon, double heading, string id, int YtextOffset)
 {
     FP_point.AddText(layerList.Layer, lat, lon, id, XtextOffset(heading), YtextOffset);
 }
Ejemplo n.º 5
0
 public void AddSpeedText(ILayer FP_point, LayerList layerList, double lat, double lon, double speed, double heading, int YtextOffset)
 {
     FP_point.AddText(layerList.Layer, lat, lon, speed + " MPH", XtextOffset(heading), YtextOffset);
 }
Ejemplo n.º 6
0
 public void AddHeadingText(ILayer FP_point, LayerList layerList, double lat, double lon, double heading, int YtextOffset)
 {
     FP_point.AddText(layerList.Layer, lat, lon, heading + "°", XtextOffset(heading), YtextOffset);
 }
Ejemplo n.º 7
0
        public void RenderArrow(ILayer FP_point, LayerList layerList, double lat, double lon, DateTime time, double heading)
        {
            int symbolHandle = FP_point.CreateSymbol("arrow", 0);  //Create symbol 0 = doesn't already exist

            //add line to symbol from pixel 0,0 to 0,1 (use this to change where degree 0 is)
            FP_point.AddLineToSymbol(symbolHandle, 0, 0, 0, 2);
            FP_point.AddLineToSymbol(symbolHandle, 0, 2, 1, 1);
            FP_point.AddLineToSymbol(symbolHandle, 0, 2, -1, 1);

            //add created symbol to layer with lat long and rotation
            FP_point.AddSymbol(layerList.Layer, symbolHandle, lat, lon, 20, heading);
        }
Ejemplo n.º 8
0
        //Austen: changed input params to pass entire layer list so that we'd have access to all it's values
        public void CreatePoint(ILayer FP_point, int layer, LayerList layerList, string id, double lat, double lon, DateTime time, bool isStale)
        {
            iconLoc = FalconPoint4.Properties.Settings.Default.DefaultIconFolder + WhichIcon(id);

            if (isStale == true) // data is stale -
            {
                id += " - STALE";
                FP_point.SetPen(layer, 0, 0, 0, 0, 0, 0, 1, 3, 0);
            }
            else // data is not stale
                FP_point.SetPen(layer, 50, 205, 50, 0, 0, 0, 0, 3, 0);

            try
            {
                FP_point.DeleteAllObjects(layer);// delete everything on this layer.. keeps us from having bread crumbs

                FP_point.AddIcon(layer, iconLoc, lat, lon, "");

                if (layerList.FP_LatLonlist.Count > 1)
                {
                    double lat1 = layerList.FP_LatLonlist[layerList.FP_LatLonlist.Count - 1].lat;
                    double lon1 = layerList.FP_LatLonlist[layerList.FP_LatLonlist.Count - 1].lon;
                    DateTime time1 = layerList.FP_LatLonlist[layerList.FP_LatLonlist.Count - 1].time;

                    double heading = logistics.Heading(lat, lon, lat1, lon1); // Compute heading
                    double speed = logistics.SpeedMPH(lat, lon, lat1, lon1, time, time1); // Compute Speed

                    if (layerList.showArrow != false)
                    {
                        RenderArrow(FP_point, layerList, lat, lon, time, heading);

                        //{MPH = 0, Bearing = 1, None = 2, Both = 3};
                        if (FPmain.DisplayChoice == 0) // if we want to see just mph
                        {
                            AddUIDText(FP_point, layerList, lat, lon, heading, id, YtextOffset - 15);
                            AddSpeedText(FP_point, layerList, lat, lon, speed, heading, YtextOffset);
                        }

                        if (FPmain.DisplayChoice == 1) // if we want to see just bearing
                        {
                            AddUIDText(FP_point, layerList, lat, lon, heading, id, YtextOffset - 15);
                            AddHeadingText(FP_point, layerList, lat, lon, heading, YtextOffset);
                        }

                        if (FPmain.DisplayChoice == 2) // if we want to see just id
                        {
                            AddUIDText(FP_point, layerList, lat, lon, heading, id, YtextOffset);
                        }

                        if (FPmain.DisplayChoice == 3) // if we want to see just all
                        {
                            AddUIDText(FP_point, layerList, lat, lon, heading, id, YtextOffset - 30);
                            AddSpeedText(FP_point, layerList, lat, lon, speed, heading, YtextOffset - 15);
                            AddHeadingText(FP_point, layerList, lat, lon, heading, YtextOffset);
                        }
                    }
                }

                FP_point.Refresh(-1);
            }
            catch (Exception ex)
            {
                string error = ex.Message;
                MessageBox.Show("Error Message: "+ex.Message+ " Stack Trace: "+ex.StackTrace);
            }
        }
Ejemplo n.º 9
0
 public void AddUIDText(ILayer FP_point, LayerList layerList, double lat, double lon, double heading, string id)
 {
     FP_point.AddText(layerList.Layer, lat, lon, id, OffsetText(heading), -70);
 }
Ejemplo n.º 10
0
 public void AddSpeedText(ILayer FP_point, LayerList layerList, double lat, double lon, double speed, double heading)
 {
     FP_point.AddText(layerList.Layer, lat, lon, speed + " MPH", OffsetText(heading), -55);
 }
Ejemplo n.º 11
0
 public void AddHeadingText(ILayer FP_point, LayerList layerList, double lat, double lon, double heading)
 {
     FP_point.AddText(layerList.Layer, lat, lon, heading + "°", OffsetText(heading), -40); // -13,-35 sets position of text
 }