Esempio n. 1
0
File: OSDPage.cs Progetto: cuav/MAAT
        void draw_course(GLCD lcd)
        {
            //lcd.DrawVParallel(7, 90, 2, 18, );

            lcd.DrawVLine(79, 81, 2);
            int num = (360 - (int)course) % 45;
            num = (num >= 35 || num <= 10) ? 3 : 2;
            lcd.DrawVParallel(24 + (370 - (int)course) % 45, 85, 1, 45, num);
            lcd.DrawVParallel(24 + (360 - (int)course) % 5, 87, 2, 5, 23);

            //lcd.DrawLine(0, 15, 158, 15);
            string[] name = { "NW", "N", "NE", "E", "SE", "S", "SW", "W" };
            for (int i = 0; i < num; i++)
            {
                lcd.DrawString(24 + (370 - (int)course) % 45 + i * 45 - 3, 93, name[(((int)course + 35) / 45 + i) % 8]);
            }
            //lcd.DrawString(78, 90, "N");
            //lcd.DrawString(27, 90, "NW");
            //lcd.DrawString(120, 90, "NE");
        }
Esempio n. 2
0
        void draw_course(GLCD lcd)
        {
            //lcd.DrawVParallel(7, 90, 2, 18, );


            lcd.DrawVLine(79, 81, 2);
            int num = (360 - (int)course) % 45;

            num = (num >= 35 || num <= 10) ? 3 : 2;
            lcd.DrawVParallel(24 + (370 - (int)course) % 45, 85, 1, 45, num);
            lcd.DrawVParallel(24 + (360 - (int)course) % 5, 87, 2, 5, 23);

            //lcd.DrawLine(0, 15, 158, 15);
            string[] name = { "NW", "N", "NE", "E", "SE", "S", "SW", "W" };
            for (int i = 0; i < num; i++)
            {
                lcd.DrawString(24 + (370 - (int)course) % 45 + i * 45 - 3, 93, name[(((int)course + 35) / 45 + i) % 8]);
            }
            //lcd.DrawString(78, 90, "N");
            //lcd.DrawString(27, 90, "NW");
            //lcd.DrawString(120, 90, "NE");
        }
Esempio n. 3
0
        public void paint(GLCD lcd)
        {
            lcd.DrawString(3, 2, "Fly Mode");
            lcd.DrawHLine(3, 12, 152);

            lcd.DrawString(54, 2, "(ArduPlane)");
            lcd.DrawString(9, 40, "Manual");
            lcd.DrawString(9, 50, "Stabilize");
            lcd.DrawString(9, 60, "Auto");
            lcd.DrawString(9, 70, "Guided");
            lcd.DrawString(9, 80, "Loiter");

            lcd.DrawString(81, 40, "Retn Home");
            lcd.DrawString(81, 50, "Circle");
            lcd.DrawString(81, 60, "FBW A");
            lcd.DrawString(81, 70, "FBW B");

            /*
            lcd.DrawString(54, 2, "(ArduCopter)");
            lcd.DrawString(9, 40, "Stabilize");
            lcd.DrawString(9, 50, "Alth Hold");
            lcd.DrawString(9, 60, "Auto");
            lcd.DrawString(9, 70, "Guided");
            lcd.DrawString(9, 80, "Loiter");
            lcd.DrawString(81, 40, "Retn Home");
            lcd.DrawString(81, 50, "Circle");
            lcd.DrawString(81, 60, "Position");
            lcd.DrawString(81, 70, "Land");
            lcd.DrawString(81, 80, "Oflo");
             */
            /*
            lcd.DrawString(9, 20, "Stab");
            lcd.DrawString(9, 30, "Acro");
            lcd.DrawString(9, 40, "Alth");
            lcd.DrawString(9, 50, "Auto");
            lcd.DrawString(9, 60, "Guid");
            lcd.DrawString(9, 70, "Loit");
            lcd.DrawString(9, 80, "Retl");*/
        }
Esempio n. 4
0
        void draw_horizon(GLCD lcd)
        {
            //pitch = 4;
            //roll = -38;
            //lcd.DrawVParallel(
            lcd.DrawHParallel(28, 40, 2, 5, 9);
            lcd.DrawHParallel(27, 40, 3, 10, 5);
            lcd.DrawHParallel(129, 40, 2, 5, 9);
            lcd.DrawHParallel(129, 40, 3, 10, 5);

            lcd.DrawString(72, 30, string.Format("{0:f0}", roll));
            lcd.DrawString(135, 58, string.Format("{0:f0}", pitch));

            // lcd.DrawLine(33, 58, 125, 58);

            int right = 92;
            int top   = 40;

            /*if (roll > 90)
             *  roll -= 180;
             * else*/if (roll == 90)
            {
                roll = 89.99f;
            }
            else if (roll == -90)
            {
                roll = -89.99f;
            }

            /*else if (roll < -90)
             *  roll += 180;
             */


            roll *= (float)(Math.PI / 180);

            int x1 = 0;
            int y1 = (int)(20 - 46 * Math.Tan(roll) - pitch / 2);

            if (y1 < 0)
            {
                y1 = 0;
                x1 = (int)(-(20 - pitch / 2) / Math.Tan(roll) + 46);
            }
            else if (y1 > 40)
            {
                y1 = 40;
                x1 = (int)((20 + pitch / 2) / Math.Tan(roll) + 46);
            }


            int x2 = 92;
            int y2 = (int)(20 - pitch / 2 + 46 * Math.Tan(roll));

            if (y2 < 0)
            {
                y2 = 0;
                x2 = (int)(-(20 - pitch / 2) / Math.Tan(roll) + 46);
            }
            else if (y2 > 40)
            {
                y2 = 40;
                x2 = (int)((20 + pitch / 2) / Math.Tan(roll) + 46);
            }
            lcd.FillRectange(33, 40, 96, 41, Color.Blue);
            lcd.DrawLine(x1 + 33, -y1 + 80, x2 + 33, -y2 + 80);
        }
Esempio n. 5
0
        public void paint(GLCD lcd)
        {
            draw_course(lcd);
            draw_horizon(lcd);

            lcd.DrawString(3, 2, "Spd");
            lcd.DrawString(24, 2, string.Format("{0:f0}", aspd));
            lcd.DrawString(3, 10, "Thr");
            lcd.DrawString(24, 10, string.Format("{0:p0}", thr));
            //lcd.DrawString(3, 10, "GS");
            //lcd.DrawString(24, 10, string.Format("{0:f0}", gspd));

            lcd.DrawString(54, 2, "Dis");
            lcd.DrawString(54, 10, "Alt");
            lcd.DrawString(75, 2, string.Format("{0:f0}", dis));
            lcd.DrawString(75, 10, string.Format("{0:f0}", alt));
            lcd.DrawString(3, 20 /*127 - 8*/, DateTime.Now.ToString("mm:ss"));

            lcd.DrawString(111, 2, "Vol");
            lcd.DrawString(111, 10, "Amp");

            lcd.DrawString(132, 2, string.Format("{0:f1}", vol));
            lcd.DrawString(132, 10, string.Format("{0:f1}", amp));



            lcd.DrawString(3, 127 - 8 * 2, string.Format("{0:f6}", lat));
            lcd.DrawString(3, 127 - 8, string.Format("{0:f6}", lon));

            lcd.DrawChar(81, 127 - 8 * 2, 0xf0);
            lcd.DrawString(96, 127 - 8 * 2, "6");
            lcd.DrawString(96, 127 - 8, "2D");

            lcd.DrawString(120, 127 - 8 * 2, "Auto");
            lcd.DrawString(126, 127 - 8, "360>2");
            lcd.FillRectange(54, 57, 53, 9, Color.Blue);
            lcd.DrawString(57, 58, "Disarmed");
        }
Esempio n. 6
0
        public void paint(GLCD lcd)
        {
            /*
            lcd.DrawString(3, 2, "Servo Setup");
            lcd.DrawHLine(3, 12, 152);

            lcd.DrawString(9, 20, "Pan");
            //lcd.DrawHLine(9, 23, 30);
            lcd.DrawString(15, 30, "Cen");
            //lcd.DrawRectange(40, 31, 105, 5);
            draw_processbar(lcd, 40, 31, 105, 5, 2200, 800, 1500);
            lcd.DrawString(15, 40, "Max");
            //lcd.DrawRectange(40, 41, 105, 5);
            draw_processbar(lcd, 40, 41, 105, 5, 2200, 800, 2000);

            lcd.DrawString(9, 60, "Tilt");
            lcd.DrawString(15, 60 + 10, "Cen");
            //lcd.DrawRectange(40, 71, 105, 5);
            draw_processbar(lcd, 40, 71, 105, 5, 1800, 1200, 1500);

            lcd.DrawString(15, 60 + 10 * 2, "Max");
            //lcd.DrawRectange(40, 60 + 10 * 2 + 1, 105, 5);
            draw_processbar(lcd, 40, 81, 105, 5, 2200, 800, 2000);

            lcd.DrawString(15, 60 + 10 * 3, "Min");
            //lcd.DrawRectange(40, 60 + 10 * 3 + 1, 105, 5);
            draw_processbar(lcd, 40, 91, 105, 5, 2200, 800, 1000);
            lcd.DrawString(15, 60 + 10 * 4, "Rev");
            lcd.DrawRectange(40, 60 + 10 * 4 + 1, 105, 5);
            lcd.DrawString(15, 60 + 10 * 5, "90");
            //lcd.DrawRectange(40, 60 + 10 * 5 + 1, 105, 5);
            draw_processbar(lcd, 40, 111, 105, 5, 2200, 800, 2000);
             */

            lcd.DrawString(3, 2, "Setup");
            lcd.DrawHLine(3, 12, 152);

            lcd.DrawString(3, 20, "Tilt Servo");
            lcd.DrawString(15, 30, "Cen");
            lcd.DrawString(39, 30, "+150");
            lcd.DrawString(81, 30, "90");
            lcd.DrawChar(93, 30, 0x80);
            lcd.DrawString(105, 30, "+150");

            lcd.DrawString(15, 40, "Min");
            lcd.DrawString(39, 40, "-100");
            lcd.DrawString(81, 40, "Max");
            lcd.DrawString(105, 40, "-200");

            //lcd.DrawString(60, 40, "Rev");
            //lcd.DrawRectange(81, 41, 5, 5);

            lcd.DrawString(3, 55, "Compass");
            lcd.DrawString(15, 65, "Declination -175");
            lcd.DrawChar(15 + 6*16, 65, 0x80);
            lcd.DrawString(15 + 6*17, 65, "30'");
            lcd.DrawString(15, 75, "Calibrate");
            lcd.DrawRectange(87, 76, 5, 5);

            lcd.DrawString(3, 90, "Accel.");
            lcd.DrawString(15, 100, "Calibrate");
            lcd.DrawRectange(87, 101, 5, 5);
            //lcd.DrawString(60, 30, "Max 2200");
        }
Esempio n. 7
0
        public void paint(GLCD lcd)
        {
            /*
             * lcd.DrawString(3, 2, "Servo Setup");
             * lcd.DrawHLine(3, 12, 152);
             *
             * lcd.DrawString(9, 20, "Pan");
             * //lcd.DrawHLine(9, 23, 30);
             * lcd.DrawString(15, 30, "Cen");
             * //lcd.DrawRectange(40, 31, 105, 5);
             * draw_processbar(lcd, 40, 31, 105, 5, 2200, 800, 1500);
             * lcd.DrawString(15, 40, "Max");
             * //lcd.DrawRectange(40, 41, 105, 5);
             * draw_processbar(lcd, 40, 41, 105, 5, 2200, 800, 2000);
             *
             * lcd.DrawString(9, 60, "Tilt");
             * lcd.DrawString(15, 60 + 10, "Cen");
             * //lcd.DrawRectange(40, 71, 105, 5);
             * draw_processbar(lcd, 40, 71, 105, 5, 1800, 1200, 1500);
             *
             * lcd.DrawString(15, 60 + 10 * 2, "Max");
             * //lcd.DrawRectange(40, 60 + 10 * 2 + 1, 105, 5);
             * draw_processbar(lcd, 40, 81, 105, 5, 2200, 800, 2000);
             *
             * lcd.DrawString(15, 60 + 10 * 3, "Min");
             * //lcd.DrawRectange(40, 60 + 10 * 3 + 1, 105, 5);
             * draw_processbar(lcd, 40, 91, 105, 5, 2200, 800, 1000);
             * lcd.DrawString(15, 60 + 10 * 4, "Rev");
             * lcd.DrawRectange(40, 60 + 10 * 4 + 1, 105, 5);
             * lcd.DrawString(15, 60 + 10 * 5, "90");
             * //lcd.DrawRectange(40, 60 + 10 * 5 + 1, 105, 5);
             * draw_processbar(lcd, 40, 111, 105, 5, 2200, 800, 2000);
             */

            lcd.DrawString(3, 2, "Setup");
            lcd.DrawHLine(3, 12, 152);

            lcd.DrawString(3, 20, "Tilt Servo");
            lcd.DrawString(15, 30, "Cen");
            lcd.DrawString(39, 30, "+150");
            lcd.DrawString(81, 30, "90");
            lcd.DrawChar(93, 30, 0x80);
            lcd.DrawString(105, 30, "+150");

            lcd.DrawString(15, 40, "Min");
            lcd.DrawString(39, 40, "-100");
            lcd.DrawString(81, 40, "Max");
            lcd.DrawString(105, 40, "-200");

            //lcd.DrawString(60, 40, "Rev");
            //lcd.DrawRectange(81, 41, 5, 5);

            lcd.DrawString(3, 55, "Compass");
            lcd.DrawString(15, 65, "Declination -175");
            lcd.DrawChar(15 + 6 * 16, 65, 0x80);
            lcd.DrawString(15 + 6 * 17, 65, "30'");
            lcd.DrawString(15, 75, "Calibrate");
            lcd.DrawRectange(87, 76, 5, 5);

            lcd.DrawString(3, 90, "Accel.");
            lcd.DrawString(15, 100, "Calibrate");
            lcd.DrawRectange(87, 101, 5, 5);
            //lcd.DrawString(60, 30, "Max 2200");
        }
Esempio n. 8
0
        public void paint(GLCD lcd)
        {
            lcd.DrawString(3, 2, "Fly Mode");
            lcd.DrawHLine(3, 12, 152);


            lcd.DrawString(54, 2, "(ArduPlane)");
            lcd.DrawString(9, 40, "Manual");
            lcd.DrawString(9, 50, "Stabilize");
            lcd.DrawString(9, 60, "Auto");
            lcd.DrawString(9, 70, "Guided");
            lcd.DrawString(9, 80, "Loiter");

            lcd.DrawString(81, 40, "Retn Home");
            lcd.DrawString(81, 50, "Circle");
            lcd.DrawString(81, 60, "FBW A");
            lcd.DrawString(81, 70, "FBW B");



            /*
             * lcd.DrawString(54, 2, "(ArduCopter)");
             * lcd.DrawString(9, 40, "Stabilize");
             * lcd.DrawString(9, 50, "Alth Hold");
             * lcd.DrawString(9, 60, "Auto");
             * lcd.DrawString(9, 70, "Guided");
             * lcd.DrawString(9, 80, "Loiter");
             * lcd.DrawString(81, 40, "Retn Home");
             * lcd.DrawString(81, 50, "Circle");
             * lcd.DrawString(81, 60, "Position");
             * lcd.DrawString(81, 70, "Land");
             * lcd.DrawString(81, 80, "Oflo");
             */
            /*
             * lcd.DrawString(9, 20, "Stab");
             * lcd.DrawString(9, 30, "Acro");
             * lcd.DrawString(9, 40, "Alth");
             * lcd.DrawString(9, 50, "Auto");
             * lcd.DrawString(9, 60, "Guid");
             * lcd.DrawString(9, 70, "Loit");
             * lcd.DrawString(9, 80, "Retl");*/
        }
Esempio n. 9
0
File: OSDPage.cs Progetto: cuav/MAAT
        void draw_horizon(GLCD lcd)
        {
            //pitch = 4;
            //roll = -38;
            //lcd.DrawVParallel(
            lcd.DrawHParallel(28, 40, 2, 5, 9);
            lcd.DrawHParallel(27, 40, 3, 10, 5);
            lcd.DrawHParallel(129, 40, 2, 5, 9);
            lcd.DrawHParallel(129, 40, 3, 10, 5);

            lcd.DrawString(72, 30, string.Format("{0:f0}", roll));
            lcd.DrawString(135, 58, string.Format("{0:f0}", pitch));

            // lcd.DrawLine(33, 58, 125, 58);

            int right = 92;
            int top = 40;

            /*if (roll > 90)
                roll -= 180;
            else*/ if (roll == 90)
                roll = 89.99f;
            else if (roll == -90)
                roll = -89.99f;
            /*else if (roll < -90)
                roll += 180;
            */

            roll *= (float)(Math.PI / 180);

            int x1 = 0;
            int y1 = (int)(20 - 46 * Math.Tan(roll) - pitch / 2);

            if (y1 < 0)
            {
                y1 = 0;
                x1 = (int)(-(20 - pitch / 2) / Math.Tan(roll) + 46);
            }
            else if (y1 > 40)
            {
                y1 = 40;
                x1 = (int)((20 + pitch / 2) / Math.Tan(roll) + 46);
            }

            int x2 = 92;
            int y2 = (int)(20 - pitch / 2 + 46 * Math.Tan(roll));

            if (y2 < 0)
            {
                y2 = 0;
                x2 = (int)(-(20 - pitch / 2) / Math.Tan(roll) + 46);
            }
            else if (y2 > 40)
            {
                y2 = 40;
                x2 = (int)((20 + pitch / 2) / Math.Tan(roll) + 46);
            }
            lcd.FillRectange(33, 40, 96, 41, Color.Blue);
            lcd.DrawLine(x1 + 33, -y1 + 80, x2 + 33, -y2 + 80);
        }
Esempio n. 10
0
File: OSDPage.cs Progetto: cuav/MAAT
        public void paint(GLCD lcd)
        {
            draw_course(lcd);
            draw_horizon(lcd);

            lcd.DrawString(3, 2, "Spd");
            lcd.DrawString(24, 2, string.Format("{0:f0}", aspd));
            lcd.DrawString(3, 10, "Thr");
            lcd.DrawString(24, 10, string.Format("{0:p0}", thr));
            //lcd.DrawString(3, 10, "GS");
            //lcd.DrawString(24, 10, string.Format("{0:f0}", gspd));

            lcd.DrawString(54, 2, "Dis");
            lcd.DrawString(54, 10, "Alt");
            lcd.DrawString(75, 2, string.Format("{0:f0}", dis));
            lcd.DrawString(75, 10, string.Format("{0:f0}", alt));
            lcd.DrawString(3, 20/*127 - 8*/, DateTime.Now.ToString("mm:ss"));

            lcd.DrawString(111, 2, "Vol");
            lcd.DrawString(111, 10, "Amp");

            lcd.DrawString(132, 2, string.Format("{0:f1}", vol));
            lcd.DrawString(132, 10, string.Format("{0:f1}", amp));

            lcd.DrawString(3, 127 - 8 * 2, string.Format("{0:f6}", lat));
            lcd.DrawString(3, 127 - 8, string.Format("{0:f6}", lon));

            lcd.DrawChar(81, 127 - 8 * 2, 0xf0);
            lcd.DrawString(96, 127 - 8 * 2, "6");
            lcd.DrawString(96, 127 - 8, "2D");

            lcd.DrawString(120, 127 - 8 * 2, "Auto");
            lcd.DrawString(126, 127 - 8, "360>2");
            lcd.FillRectange(54, 57, 53, 9, Color.Blue);
            lcd.DrawString(57, 58, "Disarmed");
        }