Beispiel #1
0
        private void DrawPosition(CoordinateCalculator corCalc, Graphics g)
        {
            var point    = _db.GetPosition();
            var projectd = corCalc.MapPoint(new PointF(Decimal.ToSingle(point.lng), Decimal.ToSingle(point.lat)));

            g.DrawLine(new Pen(Color.Red, 2), projectd.X - 6, projectd.Y, projectd.X + 6, projectd.Y);
            g.DrawLine(new Pen(Color.Red, 2), projectd.X, projectd.Y - 6, projectd.X, projectd.Y + 6);
        }
Beispiel #2
0
        private void DrawLineSet(EpochTime startTime, List <One_Sgp4.Sgp4Data> data, Color c, CoordinateCalculator cCalc, Graphics g)
        {
            foreach (var point in data)
            {
                startTime.addMinutes(0.01);
                var position        = SatFunctions.calcSatSubPoint(startTime, point, Sgp4.wgsConstant.WGS_84);
                var pointOverGround = cCalc.MapPoint(new PointF((float)position.getLongitude(), (float)position.getLatitude()));


                g.FillRectangle(new SolidBrush(c), new RectangleF(pointOverGround, new Size(1, 1)));
            }
        }
Beispiel #3
0
        public void DrawLocation(Graphics g, CoordinateCalculator cCalc)
        {
            Sgp4Data position    = SatFunctions.getSatPositionAtTime(Tle, new EpochTime(TimeKeeper.Now()), Sgp4.wgsConstant.WGS_84);
            var      point       = SatFunctions.calcSatSubPoint(new EpochTime(TimeKeeper.Now()), position, Sgp4.wgsConstant.WGS_84);
            var      mappedPoint = cCalc.MapPoint(new PointF((float)point.getLongitude(), (float)point.getLatitude()));

            mappedPoint = new PointF((float)Math.Round(mappedPoint.X), (float)Math.Round(mappedPoint.Y));

            g.DrawImage(Properties.Resources.satellite, mappedPoint.X - 25, mappedPoint.Y - 25, 50, 50);
            var font = new Font("Times New Roman", 18, FontStyle.Bold, GraphicsUnit.Pixel);

            g.DrawString(Name, font, new SolidBrush(Color.OrangeRed), mappedPoint.X, mappedPoint.Y + 15);
        }
Beispiel #4
0
        private void DrawGrid(CoordinateCalculator corCalc, Graphics g)
        {
            var fontSize = (float)Math.Round(0.013888888888889 * _panel.Width + 5);
            var font     = new Font("Times New Roman", fontSize, FontStyle.Bold, GraphicsUnit.Pixel);

            for (var i = 60; i >= -60; i -= 30)
            {
                var start = corCalc.MapPoint(new PointF(-180, i));
                var end   = corCalc.MapPoint(new PointF(180, i));

                g.DrawString($"{i}°", font, new SolidBrush(Color.White), start);
                g.DrawLine(new Pen(Color.LightGray, 1), start, end);
            }

            for (var i = -180; i <= 180; i += 30)
            {
                var start = corCalc.MapPoint(new PointF(i, 90));
                var end   = corCalc.MapPoint(new PointF(i, -90));

                g.DrawString($"{i}°", font, new SolidBrush(Color.White), new PointF(start.X, start.Y + 20));
                g.DrawLine(new Pen(Color.LightGray, 1), start, end);
            }
        }