//Initializes setup window.
        void initSetupWindow(GW.Window window)
        {
            // Create a Canvas
            GHI.Glide.UI.Canvas canvas = new GHI.Glide.UI.Canvas();
            _window.AddChild(canvas);

            // Draw a separator line.
            //canvas.DrawLine(GHI.Glide.Colors.White, 1, 30, 35, window.Width - 30, 35);

            // Draw a fieldset around our "Login" text block.
            _txtTitle           = (TextBlock)window.GetChildByName("txtTitle");
            _txtTitle.FontColor = GHI.Glide.Colors.White;
            canvas.DrawFieldset(_txtTitle, 90, 110, 220, GHI.Glide.Colors.White, 1);

            _txtBlWheelOut   = (TextBlock)_window.GetChildByName("txtBlWheelOut");
            _txtBlTriggerOut = (TextBlock)_window.GetChildByName("txtBlTriggerOut");
            _txtBlTrigScaled = (TextBlock)_window.GetChildByName("txtBlTrigScaled");
            _txtBlWhlScaled  = (TextBlock)_window.GetChildByName("txtBlWhlScaled");
            _txtBlSpeedLimit = (TextBlock)_window.GetChildByName("txtBlSpeedLimit");

            _chkBoxSpeedLimit           = (CheckBox)_window.GetChildByName("chkBoxSpeedLimit");
            _chkBoxSpeedLimit.TapEvent += _chkBoxSpeedLimit_TapEvent;

            _btnBackSetup           = (Button)_window.GetChildByName("btnBack");
            _btnBackSetup.TapEvent += new OnTap(btnBackSetup_TapEvent);

            _btnMode           = (Button)_window.GetChildByName("btnMode");
            _btnMode.TapEvent += new OnTap(btnMode_TapEvent);

            DiagnosticWindowTimer = new Timer(new TimerCallback(SetupWindowTimer_Tick), null, -1, diagnosticWindowTimerPeriod);
        }
        //Initializes ground efx window.
        void initGndEfxWindow(GW.Window window)
        {
            // Create a Canvas
            GHI.Glide.UI.Canvas canvas = new GHI.Glide.UI.Canvas();
            window.AddChild(canvas);

            // Draw a separator line.
            //canvas.DrawLine(GHI.Glide.Colors.White, 1, 30, 50, window.Width - 30, 50);

            // Draw a fieldset around our "Login" text block.
            _txtTitle           = (TextBlock)window.GetChildByName("txtTitle");
            _txtTitle.FontColor = GHI.Glide.Colors.White;
            canvas.DrawFieldset(_txtTitle, 40, 160, 220, GHI.Glide.Colors.White, 1);

            _btnGndEfxShow           = (Button)_window.GetChildByName("btnGndEfxShow");
            _btnGndEfxShow.TapEvent += new OnTap(btnGndEfxShow_TapEvent);

            _btnBackGndEfx           = (Button)_window.GetChildByName("btnBack");
            _btnBackGndEfx.TapEvent += new OnTap(btnBackGndEfx_TapEvent);
        }
        // Initializes main window buttons
        void initWindow(GW.Window window)
        {
            //Image imgLogo = (Image)window.GetChildByName("imgLogo");
            //imgLogo.Bitmap = Resources.GetBitmap(Resources.BitmapResources.Stinkmeaner_Thumb);

            // Create a Canvas
            GHI.Glide.UI.Canvas canvas = new GHI.Glide.UI.Canvas();
            window.AddChild(canvas);

            // Draw a separator line.
            canvas.DrawLine(GHI.Glide.Colors.White, 1, 30, 50, window.Width - 30, 50);

            // Draw a fieldset around our "Login" text block.
            _txtTitle           = (TextBlock)window.GetChildByName("txtTitle");
            _txtTitle.FontColor = GHI.Glide.Colors.White;
            canvas.DrawFieldset(_txtTitle, 30, 100, 220, GHI.Glide.Colors.White, 1);

            _pBarConnected       = (ProgressBar)_window.GetChildByName("pBarConnected");
            _pBarConnected.Value = 0;

            _txtStatus      = (TextBlock)_window.GetChildByName("txtStatus");
            _txtStatus.Text = "Status:";

            _btnBack           = (Button)_window.GetChildByName("btnBack");
            _btnBack.TapEvent += new OnTap(btnBack_TapEvent);

            _btnStop           = (Button)_window.GetChildByName("btnStop");
            _btnStop.TapEvent += new OnTap(btnStop_TapEvent);

            _btnSerialCam           = (Button)_window.GetChildByName("btnSerialCam");
            _btnSerialCam.TapEvent += new OnTap(btnSerialCam_TapEvent);

            _btnVideo           = (Button)_window.GetChildByName("btnVideo");
            _btnVideo.TapEvent += new OnTap(btnVideo_TapEvent);

            _btnSingleCam           = (Button)_window.GetChildByName("btnSingleCam");
            _btnSingleCam.TapEvent += new OnTap(btnSingleCam_TapEvent);
        }
Exemplo n.º 4
0
        // Initializes main window buttons
        static void initMainWindow(Window window)
        {
            //Image imgLogo = (Image)window.GetChildByName("imgLogo");
            //imgLogo.Bitmap = Resources.GetBitmap(Resources.BitmapResources.Stinkmeaner_Thumb);

            // Create a Canvas
            GHI.Glide.UI.Canvas canvas = new GHI.Glide.UI.Canvas();
            window.AddChild(canvas);

            // Draw a separator line.
            //canvas.DrawLine(GHI.Glide.Colors.White, 1, 30, 50, window.Width - 30, 50);

            // Draw a fieldset around our "Login" text block.
            _txtTitle           = (TextBlock)window.GetChildByName("txtTitle");
            _txtTitle.FontColor = GHI.Glide.Colors.White;
            canvas.DrawFieldset(_txtTitle, 30, 100, 220, GHI.Glide.Colors.White, 1);

            _pBarConnected       = (ProgressBar)_mainWindow.GetChildByName("pBarConnected");
            _pBarConnected.Value = 0;

            _txtCntrlBattery         = (TextBlock)_mainWindow.GetChildByName("txtCntrlBattery");
            _txtCntrlBattery.Text    = "Battery: ";
            _txtCntrlBatteryOut      = (TextBlock)_mainWindow.GetChildByName("txtCntrlBatteryOut");
            _txtCntrlBatteryOut.Text = "---%";

            _txtRoverBattery         = (TextBlock)_mainWindow.GetChildByName("txtRoverBattery");
            _txtRoverBattery.Text    = "Rover: ";
            _txtRoverBatteryOut      = (TextBlock)_mainWindow.GetChildByName("txtRoverBatteryOut");
            _txtRoverBatteryOut.Text = "---%";

            _txtRoverRange         = (TextBlock)_mainWindow.GetChildByName("txtRoverRange");
            _txtRoverRange.Text    = "Range: ";
            _txtRoverRangeOut      = (TextBlock)_mainWindow.GetChildByName("txtRoverRangeOut");
            _txtRoverRangeOut.Text = "---in.";

            _txtRoverHeading         = (TextBlock)_mainWindow.GetChildByName("txtRoverHeading");
            _txtRoverHeading.Text    = "Head: ";
            _txtRoverHeadingOut      = (TextBlock)_mainWindow.GetChildByName("txtRoverHeadingOut");
            _txtRoverHeadingOut.Text = "---deg";

            _txtRoverTemp         = (TextBlock)_mainWindow.GetChildByName("txtRoverTemp");
            _txtRoverTemp.Text    = "Temp: ";
            _txtRoverTempOut      = (TextBlock)_mainWindow.GetChildByName("txtRoverTempOut");
            _txtRoverTempOut.Text = "---F";

            _txtRoverPress         = (TextBlock)_mainWindow.GetChildByName("txtRoverPress");
            _txtRoverPress.Text    = "Press: ";
            _txtRoverPressOut      = (TextBlock)_mainWindow.GetChildByName("txtRoverPressOut");
            _txtRoverPressOut.Text = "---psi";

            _txtRoverLat         = (TextBlock)_mainWindow.GetChildByName("txtRoverLat");
            _txtRoverLat.Text    = "Lat: ";
            _txtRoverLatOut      = (TextBlock)_mainWindow.GetChildByName("txtRoverLatOut");
            _txtRoverLatOut.Text = "---";

            _txtRoverLon         = (TextBlock)_mainWindow.GetChildByName("txtRoverLon");
            _txtRoverLon.Text    = "Lon: ";
            _txtRoverLonOut      = (TextBlock)_mainWindow.GetChildByName("txtRoverLonOut");
            _txtRoverLonOut.Text = "---";

            _txtWpDist         = (TextBlock)_mainWindow.GetChildByName("txtWpDist");
            _txtWpDist.Text    = "WpDist: ";
            _txtWpDistOut      = (TextBlock)_mainWindow.GetChildByName("txtWpDistOut");
            _txtWpDistOut.Text = "-m";

            _txtTargetHead         = (TextBlock)_mainWindow.GetChildByName("txtTargetHead");
            _txtTargetHead.Text    = "TarHd: ";
            _txtTargetHeadOut      = (TextBlock)_mainWindow.GetChildByName("txtTargetHeadOut");
            _txtTargetHeadOut.Text = "-deg";

            _txtWpSpeedDir         = (TextBlock)_mainWindow.GetChildByName("txtWpSpeedDir");
            _txtWpSpeedDir.Text    = "Spd_Dir:";
            _txtWpSpeedDirOut      = (TextBlock)_mainWindow.GetChildByName("txtWpSpeedDirOut");
            _txtWpSpeedDirOut.Text = "0_0";

            _txtTargetWpNum         = (TextBlock)_mainWindow.GetChildByName("txtTargetWpNum");
            _txtTargetWpNum.Text    = "TarWP: ";
            _txtTargetWpNumOut      = (TextBlock)_mainWindow.GetChildByName("txtTargetWpNumOut");
            _txtTargetWpNumOut.Text = "0";

            _txtRovMode         = (TextBlock)_mainWindow.GetChildByName("txtRovMode");
            _txtRovMode.Text    = "Mode: ";
            _txtRovModeOut      = (TextBlock)_mainWindow.GetChildByName("txtRovModeOut");
            _txtRovModeOut.Text = "-";

            _btnSettings           = (GHI.Glide.UI.Button)_mainWindow.GetChildByName("btnSettings");
            _btnSettings.TapEvent += new OnTap(btnSettings_TapEvent);

            _btnOutputs           = (GHI.Glide.UI.Button)_mainWindow.GetChildByName("btnOutputs");
            _btnOutputs.TapEvent += new OnTap(btnOutputs_TapEvent);

            _btnMode           = (GHI.Glide.UI.Button)_mainWindow.GetChildByName("btnMode");
            _btnMode.TapEvent += new OnTap(btnMode_TapEvent);

            _btnInputs           = (GHI.Glide.UI.Button)_mainWindow.GetChildByName("btnInputs");
            _btnInputs.TapEvent += new OnTap(btnInputs_TapEvent);
        }