示例#1
0
        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            /*******************************************************************************************
            *  Modules added in the Program.gadgeteer designer view are used by typing
            *  their name followed by a period, e.g.  button.  or  camera.
            *
            *  Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
            *   button.ButtonPressed +=<tab><tab>
            *
            *  If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
            *   GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
            *   timer.Tick +=<tab><tab>
            *   timer.Start();
            *******************************************************************************************/


            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");

            //Carga las ventanas
            controlWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.controlWindow));
            camaraWindow  = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.camaraWindow));
            GlideTouch.Initialize();

            //Inicializa los botones en la interface
            btn_start           = (Button)controlWindow.GetChildByName("start");
            btn_stop            = (Button)controlWindow.GetChildByName("stop");
            btn_start.TapEvent += btn_start_TapEvent;
            btn_stop.TapEvent  += btn_stop_TapEvent;

            //Selecciona mainWindow como la ventana de inicio
            Glide.MainWindow = controlWindow;
        }
示例#2
0
        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            /*******************************************************************************************
            Modules added in the Program.gadgeteer designer view are used by typing
            their name followed by a period, e.g.  button.  or  camera.

            Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
                button.ButtonPressed +=<tab><tab>

            If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
                GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
                timer.Tick +=<tab><tab>
                timer.Start();
            *******************************************************************************************/

            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");

            //Carga las ventanas
            controlWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.controlWindow));
            camaraWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.camaraWindow));
            GlideTouch.Initialize();

            //Inicializa los botones en la interface
            btn_start = (Button)controlWindow.GetChildByName("start");
            btn_stop = (Button)controlWindow.GetChildByName("stop");
            btn_start.TapEvent += btn_start_TapEvent;
            btn_stop.TapEvent += btn_stop_TapEvent;

            //Selecciona mainWindow como la ventana de inicio
            Glide.MainWindow = controlWindow;
        }
示例#3
0
        void ProgramStarted()
        {
            sensor = new SensorProximidad(extender);

            Debug.Print("Program Started");


            camera.BitmapStreamed += camera_BitmapStreamed;


            controlWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.controlWindow));
            camaraWindow  = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.camaraWindow));
            GlideTouch.Initialize();


            btn_start           = (Button)controlWindow.GetChildByName("start");
            btn_stop            = (Button)controlWindow.GetChildByName("stop");
            btn_start.TapEvent += btn_start_TapEvent;
            btn_stop.TapEvent  += btn_stop_TapEvent;

            sensor.ObjectOn  += sensor_ObjectOn;
            sensor.ObjectOff += sensor_ObjectOff;

            Glide.MainWindow = controlWindow;
        }
        //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);
        }
示例#5
0
        GT.Timer timerPictureCaptured;                                      // every second (1000ms)

        void ProgramStarted()
        {
            /*******************************************************************************************
            *  Modules added in the Program.gadgeteer designer view are used by typing
            *  their name followed by a period, e.g.  button.  or  camera.
            *
            *  Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
            *   button.ButtonPressed +=<tab><tab>
            *
            *  If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
            *   GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
            *   timer.Tick +=<tab><tab>
            *   timer.Start();
            *******************************************************************************************/


            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");

            //Timer
            timer.Tick += timer_Tick;
            timer.Start();
            timerPictureCaptured       = new GT.Timer(9000);
            timerPictureCaptured.Tick += timerPictureCaptured_Tick;
            timerPictureCaptured.Start();

            //Load windows
            mainWindow        = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MainWindow));
            resultWindow      = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.ResultWindow));
            cameraWindow      = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.CameraWindow));
            BtnLeer           = (GHI.Glide.UI.Button)resultWindow.GetChildByName("BtnLeer");
            BtnLeer.TapEvent += BtnLeer_TapEvent;
            GlideTouch.Initialize();
            Glide.MainWindow = mainWindow;



            button.ButtonPressed += button_ButtonPressed;

            //Conexion a Internet
            this.ethernetJ11D.NetworkInterface.Open();
            //this.ethernetJ11D.NetworkInterface.EnableStaticIP("200.9.176.102", "255.255.255.128", "200.9.176.2");

            this.ethernetJ11D.NetworkInterface.EnableDhcp();
            //this.ethernetJ11D.UseStaticIP("200.9.176.102", "255.255.255.128","200.9.176.2");
            this.ethernetJ11D.UseThisNetworkInterface();
            this.ethernetJ11D.NetworkDown += ethernetJ11D_NetworkDown;
            this.ethernetJ11D.NetworkUp   += ethernetJ11D_NetworkUp;



            //Funciones de Camara
            camera.BitmapStreamed  += camera_BitmapStreamed;
            camera.CameraConnected += camera_CameraConnected;
            camera.PictureCaptured += camera_PictureCaptured;
            systemState             = State.Camera;

            //imagen del qr
            currentBitmap = new Bitmap(camera.CurrentPictureResolution.Width, camera.CurrentPictureResolution.Height);
        }
示例#6
0
        private void LumTap(object sender)
        {
            GHI.Glide.Display.Window SUB_LUMINOSITY_MENU = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.SUB_LUMINOSITY_MENU));
            Glide.MainWindow = SUB_LUMINOSITY_MENU;
            Button Main_light = (Button)SUB_LUMINOSITY_MENU.GetChildByName("Main_light");

            Main_light.TapEvent += MenuTap;
        }
示例#7
0
        private void TempTap(object sender)
        {
            GHI.Glide.Display.Window SUB_TEMPERATURE_MENU = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.SUB_TEMPERATURE_MENU));
            Glide.MainWindow = SUB_TEMPERATURE_MENU;
            Button Main_temperature = (Button)SUB_TEMPERATURE_MENU.GetChildByName("Main_temperature");

            Main_temperature.TapEvent += MenuTap;
        }
示例#8
0
        private void setupCallbackManiMenu(GHI.Glide.Display.Window Main_menu)
        {
            Button Set_heating = (Button)Main_menu.GetChildByName("Set_heating");

            Set_heating.TapEvent += TempTap;

            Button Set_light = (Button)Main_menu.GetChildByName("Set_light");

            Set_light.TapEvent += LumTap;

            Button Up_motor   = (Button)Main_menu.GetChildByName("Up_motor");
            Button Down_motor = (Button)Main_menu.GetChildByName("Down_motor");

            Up_motor.PressEvent   += Up_motor_PressEvent;
            Up_motor.ReleaseEvent += Up_motor_ReleaseEvent;

            Down_motor.PressEvent   += Down_motor_PressEvent;
            Down_motor.ReleaseEvent += Up_motor_ReleaseEvent;
        }
        //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);
        }
示例#10
0
        private void cambiarEstado(Estado es)
        {
            TextBlock text = (TextBlock)controlWindow.GetChildByName("status");

            switch (es)
            {
            case Estado.APAGADO:
                text.Text        = "Monitoreo OFF";
                Glide.MainWindow = controlWindow;
                break;

            case Estado.MONITOREAR:
                text.Text        = "Monitoreo ON";
                Glide.MainWindow = controlWindow;
                break;

            case Estado.CAPTURAR:
                break;
            }
        }
        void ProgramStarted()
        {
            Glide.FitToScreen = true;

            //load screen from xml
            mainWindow    = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MainWindow));
            winMasterMind = new MasterMind();

            // reference for buttons from first screen
            btn1Player = (GHI.Glide.UI.Button)mainWindow.GetChildByName("btn1Player");
            btn2Player = (GHI.Glide.UI.Button)mainWindow.GetChildByName("btn2Player");

            btn1Player.TintColor = GHI.Glide.Colors.Red;


            //listeners from button clicked
            btn1Player.TapEvent += btn1Player_ButtonPressed;
            btn2Player.TapEvent += btn2Player_ButtonPressed;

            f             = Resources.GetFont(Resources.FontResources.NinaB);
            fontHeight    = f.Height;
            displayHeight = displayTE35.Height;

            // position for joystick
            double xPos = joystick.GetPosition().X;
            double yPos = joystick.GetPosition().Y;

            GT.Timer jt = new GT.Timer(275);

            jt.Tick += jt_Tick;

            joystick.JoystickPressed += joystick_JoystickPressed;
            jt.Start();

            button.ButtonPressed += button_ButtonPressed;

            Glide.MainWindow = mainWindow;
            GlideTouch.Initialize();
        }
        // 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);
        }
示例#13
0
        private void cambiarEstado(Estado es)
        {
            TextBlock text = (TextBlock)controlWindow.GetChildByName("status");

            switch (es)
            {
            case Estado.ESTADO_1:

                Glide.MainWindow = controlWindow;
                sensor_prox.StopSampling();
                text.Text = "Monitoreo OFF";
                actual    = Estado.ESTADO_1;
                break;

            case Estado.ESTADO_2:

                Glide.MainWindow = controlWindow;
                sensor_prox.StartSampling();
                camera.StopStreaming();
                text.Text = "Monitoreo ON";
                actual    = Estado.ESTADO_2;
                break;

            case Estado.ESTADO_3:
                if (actual != Estado.ESTADO_3)
                {
                    Glide.MainWindow = camaraWindow;
                }
                camera.StartStreaming();
                actual = Estado.ESTADO_3;
                break;

            default:
                Debug.Print("Aiiiuudaaaa");
                break;
            }
        }
示例#14
0
        void ProgramStarted()
        {
            Glide.FitToScreen = true;

            //load screen from xml
            mainWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MainWindow));
            winMasterMind = new MasterMind();

            // reference for buttons from first screen
            btn1Player = (GHI.Glide.UI.Button)mainWindow.GetChildByName("btn1Player");
            btn2Player = (GHI.Glide.UI.Button)mainWindow.GetChildByName("btn2Player");

            btn1Player.TintColor = GHI.Glide.Colors.Red;

            //listeners from button clicked
            btn1Player.TapEvent += btn1Player_ButtonPressed;
            btn2Player.TapEvent += btn2Player_ButtonPressed;

            f = Resources.GetFont(Resources.FontResources.NinaB);
            fontHeight = f.Height;
            displayHeight = displayTE35.Height;

            // position for joystick
            double xPos = joystick.GetPosition().X;
            double yPos = joystick.GetPosition().Y;
            GT.Timer jt = new GT.Timer(275);

            jt.Tick += jt_Tick;

            joystick.JoystickPressed += joystick_JoystickPressed;
            jt.Start();

            button.ButtonPressed += button_ButtonPressed;

            Glide.MainWindow = mainWindow;
            GlideTouch.Initialize();
        }
示例#15
0
        void ProgramStarted()
        {
            /*******************************************************************************************
            Modules added in the Program.gadgeteer designer view are used by typing
            their name followed by a period, e.g.  button.  or  camera.

            Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
                button.ButtonPressed +=<tab><tab>

            If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
                GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
                timer.Tick +=<tab><tab>
                timer.Start();
            *******************************************************************************************/

            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");

            //Timer
            timer.Tick += timer_Tick;
            timer.Start();
            timerPictureCaptured = new GT.Timer(9000);
            timerPictureCaptured.Tick += timerPictureCaptured_Tick;
            timerPictureCaptured.Start();

            //Load windows
            mainWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MainWindow));
            resultWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.ResultWindow));
            cameraWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.CameraWindow));
            BtnLeer = (GHI.Glide.UI.Button)resultWindow.GetChildByName("BtnLeer");
            BtnLeer.TapEvent += BtnLeer_TapEvent;
            GlideTouch.Initialize();
            Glide.MainWindow = mainWindow;

            button.ButtonPressed += button_ButtonPressed;

            //Conexion a Internet
            this.ethernetJ11D.NetworkInterface.Open();
            //this.ethernetJ11D.NetworkInterface.EnableStaticIP("200.9.176.102", "255.255.255.128", "200.9.176.2");

            this.ethernetJ11D.NetworkInterface.EnableDhcp();
            //this.ethernetJ11D.UseStaticIP("200.9.176.102", "255.255.255.128","200.9.176.2");
            this.ethernetJ11D.UseThisNetworkInterface();
            this.ethernetJ11D.NetworkDown += ethernetJ11D_NetworkDown;
            this.ethernetJ11D.NetworkUp += ethernetJ11D_NetworkUp;

            //Funciones de Camara
            camera.BitmapStreamed += camera_BitmapStreamed;
            camera.CameraConnected += camera_CameraConnected;
            camera.PictureCaptured += camera_PictureCaptured;
            systemState = State.Camera;

            //imagen del qr
            currentBitmap = new Bitmap(camera.CurrentPictureResolution.Width, camera.CurrentPictureResolution.Height);
        }
示例#16
0
        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            /*******************************************************************************************
            Modules added in the Program.gadgeteer designer view are used by typing
            their name followed by a period, e.g.  button.  or  camera.

            Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
                button.ButtonPressed +=<tab><tab>

            If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
                GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
                timer.Tick +=<tab><tab>
                timer.Start();
            *******************************************************************************************/

            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");
            ethernetJ11D.NetworkInterface.Open();
            ethernetJ11D.NetworkInterface.EnableDhcp();
            ethernetJ11D.UseThisNetworkInterface();
            //Carga la ventana principal
            iniciarWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.inicioWindow));
            pantallaTemperatura = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.pantallaTemperatura));
            GlideTouch.Initialize();

            //Inicializa el boton en la interface
            btn_inicio = (Button)iniciarWindow.GetChildByName("button_iniciar");
            atras = (Button)pantallaTemperatura.GetChildByName("atras");
            barra = (ProgressBar)pantallaTemperatura.GetChildByName("instance23061");
            texto = (TextBlock)iniciarWindow.GetChildByName("text_net_status");
            textotemp = (TextBlock)pantallaTemperatura.GetChildByName("valor");
            btn_inicio.TapEvent += btn_inicio_TapEvent;
            atras.TapEvent += atras_TapEvent;
            ethernetJ11D.NetworkDown += ethernetJ11D_NetworkDown;
            ethernetJ11D.NetworkUp += ethernetJ11D_NetworkUp;
            timer.Tick += timer_Tick;

            //Selecciona iniciarWindow como la ventana de inicio
            Glide.MainWindow = iniciarWindow;
        }
示例#17
0
        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            /*******************************************************************************************
            Modules added in the Program.gadgeteer designer view are used by typing
            their name followed by a period, e.g.  button.  or  camera.

            Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
                button.ButtonPressed +=<tab><tab>

            If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
                GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
                timer.Tick +=<tab><tab>
                timer.Start();
            *******************************************************************************************/

            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");
            ethernetJ11D.NetworkInterface.Open();
            ethernetJ11D.NetworkInterface.EnableDhcp();
            ethernetJ11D.UseThisNetworkInterface();
            //Carga la ventana principal

            pantallaTiempo = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.pantallaTiempo));
            pantallaTemperatura = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.pantallaTemperatura));
            pantallaNoticias = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.pantallaNoticias));
            GlideTouch.Initialize();

            //Inicializa el boton en la interface
            btn_temperature = (Button)pantallaTiempo.GetChildByName("clima");
            btn_news = (Button)pantallaTiempo.GetChildByName("noticias");
            deportes = (Button)pantallaNoticias.GetChildByName("deportes");
            cine = (Button)pantallaNoticias.GetChildByName("cine");
            economia = (Button)pantallaNoticias.GetChildByName("economia");
            atrastemp = (Button)pantallaTemperatura.GetChildByName("atras");
            atrasnews = (Button)pantallaNoticias.GetChildByName("atrasnews");
            //texto = (TextBlock)pantallaTiempo.GetChildByName("text_net_status");
            textotemp = (TextBlock)pantallaTiempo.GetChildByName("hora");
            fechatext = (TextBlock)pantallaTiempo.GetChildByName("fecha");
            msm = (TextBlock)pantallaTemperatura.GetChildByName("msm");
            temp = (TextBlock)pantallaTemperatura.GetChildByName("temp");
            n1 = (TextBlock)pantallaNoticias.GetChildByName("n1");
            n2 = (TextBlock)pantallaNoticias.GetChildByName("n2");
            labeld = (TextBlock)pantallaNoticias.GetChildByName("labeld");
            labelc = (TextBlock)pantallaNoticias.GetChildByName("labelc");
            labele = (TextBlock)pantallaNoticias.GetChildByName("labele");
            back = (Button)pantallaNoticias.GetChildByName("back");
            next = (Button)pantallaNoticias.GetChildByName("next");
            btn_temperature.TapEvent += btn_temperature_TapEvent;
            btn_news.TapEvent += btn_news_TapEvent;

            atrasnews.TapEvent += atrasnews_TapEvent;
            atrastemp.TapEvent += atrastemp_TapEvent;
            deportes.TapEvent += deportes_TapEvent;
            cine.TapEvent += cine_TapEvent;
            economia.TapEvent += economia_TapEvent;
            back.TapEvent += back_TapEvent;
            next.TapEvent += next_TapEvent;
            ethernetJ11D.NetworkDown += ethernetJ11D_NetworkDown;
            ethernetJ11D.NetworkUp += ethernetJ11D_NetworkUp;
            timer.Tick += timer_Tick;
            timer2.Tick += timer2_Tick;

            //Selecciona iniciarWindow como la ventana de inicio
            Glide.MainWindow = pantallaTiempo;
            timer2.Start();
        }
示例#18
0
        GT.Timer timer2 = new GT.Timer(900); // every second (1000ms)
        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            /*******************************************************************************************
            *  Modules added in the Program.gadgeteer designer view are used by typing
            *  their name followed by a period, e.g.  button.  or  camera.
            *
            *  Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
            *   button.ButtonPressed +=<tab><tab>
            *
            *  If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
            *   GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
            *   timer.Tick +=<tab><tab>
            *   timer.Start();
            *******************************************************************************************/


            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");
            ethernetJ11D.NetworkInterface.Open();
            ethernetJ11D.NetworkInterface.EnableDhcp();
            ethernetJ11D.UseThisNetworkInterface();
            //Carga la ventana principal

            pantallaTiempo      = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.pantallaTiempo));
            pantallaTemperatura = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.pantallaTemperatura));
            pantallaNoticias    = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.pantallaNoticias));
            GlideTouch.Initialize();

            //Inicializa el boton en la interface
            btn_temperature = (Button)pantallaTiempo.GetChildByName("clima");
            btn_news        = (Button)pantallaTiempo.GetChildByName("noticias");
            deportes        = (Button)pantallaNoticias.GetChildByName("deportes");
            cine            = (Button)pantallaNoticias.GetChildByName("cine");
            economia        = (Button)pantallaNoticias.GetChildByName("economia");
            atrastemp       = (Button)pantallaTemperatura.GetChildByName("atras");
            atrasnews       = (Button)pantallaNoticias.GetChildByName("atrasnews");
            //texto = (TextBlock)pantallaTiempo.GetChildByName("text_net_status");
            textotemp = (TextBlock)pantallaTiempo.GetChildByName("hora");
            fechatext = (TextBlock)pantallaTiempo.GetChildByName("fecha");
            msm       = (TextBlock)pantallaTemperatura.GetChildByName("msm");
            temp      = (TextBlock)pantallaTemperatura.GetChildByName("temp");
            n1        = (TextBlock)pantallaNoticias.GetChildByName("n1");
            n2        = (TextBlock)pantallaNoticias.GetChildByName("n2");
            labeld    = (TextBlock)pantallaNoticias.GetChildByName("labeld");
            labelc    = (TextBlock)pantallaNoticias.GetChildByName("labelc");
            labele    = (TextBlock)pantallaNoticias.GetChildByName("labele");
            back      = (Button)pantallaNoticias.GetChildByName("back");
            next      = (Button)pantallaNoticias.GetChildByName("next");
            btn_temperature.TapEvent += btn_temperature_TapEvent;
            btn_news.TapEvent        += btn_news_TapEvent;

            atrasnews.TapEvent       += atrasnews_TapEvent;
            atrastemp.TapEvent       += atrastemp_TapEvent;
            deportes.TapEvent        += deportes_TapEvent;
            cine.TapEvent            += cine_TapEvent;
            economia.TapEvent        += economia_TapEvent;
            back.TapEvent            += back_TapEvent;
            next.TapEvent            += next_TapEvent;
            ethernetJ11D.NetworkDown += ethernetJ11D_NetworkDown;
            ethernetJ11D.NetworkUp   += ethernetJ11D_NetworkUp;
            timer.Tick  += timer_Tick;
            timer2.Tick += timer2_Tick;

            //Selecciona iniciarWindow como la ventana de inicio
            Glide.MainWindow = pantallaTiempo;
            timer2.Start();
        }
示例#19
0
        public void Selection()
        {
            Glide.MainWindow = fenetreSelection;                                                //Affiche la fenetre de selection sur l'écran LCD

            BoutonBleu    = (GHI.Glide.UI.Button)fenetreSelection.GetChildByName("BoutonBleu"); //Créer les différents boutons
            BoutonJaune   = (GHI.Glide.UI.Button)fenetreSelection.GetChildByName("BoutonJaune");
            BoutonDispo1  = (GHI.Glide.UI.Button)fenetreSelection.GetChildByName("BoutonHomologation");
            BoutonDispo2  = (GHI.Glide.UI.Button)fenetreSelection.GetChildByName("BoutonDispo2");
            BoutonDispo3  = (GHI.Glide.UI.Button)fenetreSelection.GetChildByName("BoutonDispo3");
            BoutonDispo4  = (GHI.Glide.UI.Button)fenetreSelection.GetChildByName("BoutonDispo4");
            BoutonDispo5  = (GHI.Glide.UI.Button)fenetreSelection.GetChildByName("BoutonDispo5");
            BoutonValider = (GHI.Glide.UI.Button)fenetreSelection.GetChildByName("BoutonValider");

            TexteCouleur = (TextBlock)fenetreSelection.GetChildByName("TexteCouleur");        //Bloc de texte pour la selection (affiche la couleur et la disposition choisie)
            TexteDispo   = (TextBlock)fenetreSelection.GetChildByName("TexteDispo");          //

            BoutonBleu.TapEvent += new OnTap(sender => { m_equipe               = Couleur.Bleu;
                                                         TexteCouleur.Text      = "Equipe bleue";
                                                         TexteCouleur.BackColor = (Color)0xE8D630;
                                                         fenetreSelection.FillRect(TexteCouleur.Rect);
                                                         TexteCouleur.Invalidate(); });

            BoutonJaune.TapEvent += new OnTap(sender => { m_equipe               = Couleur.Jaune;
                                                          TexteCouleur.Text      = "Equipe jaune";
                                                          TexteCouleur.BackColor = (Color)0x1E7FCB;
                                                          fenetreSelection.FillRect(TexteCouleur.Rect);
                                                          TexteCouleur.Invalidate(); });

            BoutonDispo1.TapEvent += new OnTap(sender => { m_disposition   = 1;
                                                           TexteDispo.Text = "Strategie 1";
                                                           fenetreSelection.FillRect(TexteDispo.Rect);
                                                           TexteDispo.Invalidate(); });

            BoutonDispo2.TapEvent += new OnTap(sender => { m_disposition   = 2;
                                                           TexteDispo.Text = "Strategie 2";
                                                           fenetreSelection.FillRect(TexteDispo.Rect);
                                                           TexteDispo.Invalidate(); });

            BoutonDispo3.TapEvent += new OnTap(sender => { m_disposition   = 3;
                                                           TexteDispo.Text = "Dispo. no. 3";
                                                           fenetreSelection.FillRect(TexteDispo.Rect);
                                                           TexteDispo.Invalidate(); });

            BoutonDispo4.TapEvent += new OnTap(sender => { m_disposition   = 4;
                                                           TexteDispo.Text = "Dispo. no. 4";
                                                           fenetreSelection.FillRect(TexteDispo.Rect);
                                                           TexteDispo.Invalidate(); });

            BoutonDispo5.TapEvent += new OnTap(sender => { m_disposition   = 5;
                                                           TexteDispo.Text = "Dispo. no. 5";
                                                           fenetreSelection.FillRect(TexteDispo.Rect);
                                                           TexteDispo.Invalidate(); });

            while (m_equipe == Couleur.Null || m_disposition == 0)      //Execution de la boucle tant que l'equipe et la disposition du terrain ne sont pas validés



            {
                while (validation == false)
                {
                    BoutonValider.TapEvent += new OnTap(sender => { validation = true; });
                }
            }

            Fermer();                                                                        //ferme la fenetre de selection

            Glide.MainWindow = fenetreAffichage;                                             //Affiche la fenetre d'affichage sur l'écran LCD
            TexteAffichage   = (TextBlock)fenetreAffichage.GetChildByName("TexteAffichage"); //Bloc de texte pour l'affichage des instructions
        }