Пример #1
0
        /// <summary>
        /// Testing method for DisplayNHVN module
        /// </summary>
        private static void TestGlide()
        {
            var lcd = new DisplayNHVN(GHIElectronics.TinyCLR.Pins.FEZRaptor.I2cBus.Socket13, FEZRaptor.Socket16.Pin9, FEZRaptor.Socket13.Pin3,
                                      DisplayNHVN.DisplayTypes.Display7inch);

            Glide.SetupGlide(800, 480, 96, 0, lcd.displayController);
            string GlideXML = @"<Glide Version=""1.0.7""><Window Name=""instance115"" Width=""800"" Height=""480"" BackColor=""dce3e7""><Button Name=""btn"" X=""40"" Y=""60"" Width=""120"" Height=""40"" Alpha=""255"" Text=""Click Me"" Font=""4"" FontColor=""000000"" DisabledFontColor=""808080"" TintColor=""000000"" TintAmount=""0""/><TextBlock Name=""TxtTest"" X=""42"" Y=""120"" Width=""650"" Height=""32"" Alpha=""255"" Text=""TextBlock"" TextAlign=""Left"" TextVerticalAlign=""Top"" Font=""6"" FontColor=""0"" BackColor=""000000"" ShowBackColor=""False""/></Window></Glide>";

            //Resources.GetString(Resources.StringResources.Window)
            Window window = GlideLoader.LoadWindow(GlideXML);

            GlideTouch.Initialize();

            GHI.Glide.UI.Button    btn = (GHI.Glide.UI.Button)window.GetChildByName("btn");
            GHI.Glide.UI.TextBlock txt = (GHI.Glide.UI.TextBlock)window.GetChildByName("TxtTest");
            btn.TapEvent += (object sender) =>
            {
                txt.Text = "Welcome to Glide for TinyCLR - Cheers from Mif ;)";
                Debug.WriteLine("Button tapped.");

                window.Invalidate();
                txt.Invalidate();
            };

            Glide.MainWindow = window;

            lcd.CapacitiveScreenReleased += Lcd_CapacitiveScreenReleased;
            lcd.CapacitiveScreenPressed  += Lcd_CapacitiveScreenPressed;

            //Thread.Sleep(Timeout.Infinite);
        }
Пример #2
0
        /****************
         * FUNCTION
         * *************/
        void first_step()
        {
            flagmdf = 0;

            /*button plus(input 4)*/
            plus.ButtonPressed += Plus_ButtonPressed;
            plus.TurnLedOff();
            /*button minus(input 5)*/
            minus.ButtonPressed += Minus_ButtonPressed;
            minus.TurnLedOff();

            Glide.FitToScreen = true;
            _mainwindow       = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window));

            GlideTouch.Initialize();
            Glide.MainWindow = _mainwindow;

            /*create button to start*/
            _startbtn = (GHI.Glide.UI.Button)_mainwindow.GetChildByName("startbtn");
            /*press button event*/
            _startbtn.PressEvent += Button_PressEvent;

            //_logo = (GHI.Glide.UI.Image)_mainwindow.GetChildByName("logo");
            //_logo.Bitmap = new Bitmap(Resources.GetBytes(Resources.BinaryResources.logo), Bitmap.BitmapImageType.Jpeg);
            //_logo.Invalidate();
            //Bitmap prova = new Bitmap(Resources.GetBytes(Resources.BinaryResources.logo), Bitmap.BitmapImageType.Gif);

            //displayTE35.SimpleGraphics.DisplayImage(prova, 30, 20);
            //displayTE35.BacklightEnabled = true;
        }
Пример #3
0
        static void display_TouchDown(DisplayNhd5 sender, TouchEventArgs e)
        {
//            Debug.Print("Finger " + e.FingerNumber + " down!");
//            Debug.Print("Where " + e.X + "," + e.Y);
            //
            // Check if backlight is off and if so, we will switch it back
            // on and consume the touch
            //
            if (BacklightOff)
            {
                BacklightOff = false;
                //LCDbacklight.Write(true);

                ResetBacklightInternal();   // Reset the timer

                LCDTurnedOn = true;         // We should ignore the touch up
                return;
            }
            else
            {
                ResetBacklightInternal();   // Each touch will reset the timer
            }
            touches[0].X = e.X;
            touches[0].Y = e.Y;
            GlideTouch.RaiseTouchDownEvent(null, new GHI.Glide.TouchEventArgs(touches));
        }
Пример #4
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);
        }
Пример #5
0
        public void StartProgram()
        {
            Debug.WriteLine("Program Started");
            var lcd = new DisplayDriver43(SC20260.GpioPin.PA15);

            Glide.SetupGlide(480, 272, 96, 0, lcd.display);
            Screens = new Hashtable();
            //populate all form
            var F1 = new SplashForm(ref MainWindow);

            F1.FormRequestEvent += General_FormRequestEvent;
            Screens.Add(Screen.ScreenTypes.Splash, F1);

            var F2 = new MainMenuForm(ref MainWindow);

            F2.FormRequestEvent += General_FormRequestEvent;
            Screens.Add(Screen.ScreenTypes.MainMenu, F2);

            var F6 = new GameForm(ref MainWindow, ref lcd);

            F6.FormRequestEvent += General_FormRequestEvent;
            Screens.Add(Screen.ScreenTypes.Game, F6);
            //init glide touch
            Glide.FitToScreen = true;
            GlideTouch.Initialize();
            //enable touch screen
            lcd.CapacitiveScreenReleased += Lcd_CapacitiveScreenReleased;
            lcd.CapacitiveScreenPressed  += Lcd_CapacitiveScreenPressed;
            lcd.CapacitiveScreenMove     += Lcd_CapacitiveScreenMove;
            //load splash
            LoadForm(Screen.ScreenTypes.Splash);
        }
Пример #6
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;
        }
Пример #7
0
        private void InitializeDisplay()
        {
            _window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window));

            GlideTouch.Initialize();

            _buttons = new UIButton[5];

            _forwardButton           = (UIButton)_window.GetChildByName("forwardButton");
            _forwardButton.TapEvent += s => Move(Action.Forward);
            _buttons[0]              = _forwardButton;

            _backwardButton           = (UIButton)_window.GetChildByName("backwardButton");
            _backwardButton.TapEvent += s => Move(Action.Backward);
            _buttons[1] = _backwardButton;

            _leftButton           = (UIButton)_window.GetChildByName("leftButton");
            _leftButton.TapEvent += s => Move(Action.Left);
            _buttons[2]           = _leftButton;

            _rightButton           = (UIButton)_window.GetChildByName("rightButton");
            _rightButton.TapEvent += s => Move(Action.Right);
            _buttons[3]            = _rightButton;

            _stopButton           = (UIButton)_window.GetChildByName("stopButton");
            _stopButton.TapEvent += s => Move(Action.Stop);
            _buttons[4]           = _stopButton;

            _logTextBlock = (UITextBlock)_window.GetChildByName("logTextBlock");

            Glide.FitToScreen = true;

            Glide.MainWindow = _window;
        }
Пример #8
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;
        }
Пример #9
0
        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            multicolorLED.BlinkOnce(GT.Color.Red);
            //7" Displays
            Display.Width  = 800;
            Display.Height = 480;
            Display.OutputEnableIsFixed      = false;
            Display.OutputEnablePolarity     = true;
            Display.PixelPolarity            = false;
            Display.PixelClockRateKHz        = 30000;
            Display.HorizontalSyncPolarity   = false;
            Display.HorizontalSyncPulseWidth = 48;
            Display.HorizontalBackPorch      = 88;
            Display.HorizontalFrontPorch     = 40;
            Display.VerticalSyncPolarity     = false;
            Display.VerticalSyncPulseWidth   = 3;
            Display.VerticalBackPorch        = 32;
            Display.VerticalFrontPorch       = 13;
            Display.Type = Display.DisplayType.Lcd;
            if (Display.Save())      // Reboot required?
            {
                PowerState.RebootDevice(false);
            }
            //set up touch screen
            CapacitiveTouchController.Initialize(GHI.Pins.FEZRaptor.Socket14.Pin3);

            window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MyForm));
            //glide init
            GlideTouch.Initialize();

            GHI.Glide.UI.Button btn = (GHI.Glide.UI.Button)window.GetChildByName("btnTest");
            img          = (GHI.Glide.UI.Image)window.GetChildByName("img1");
            txtLora      = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtLora");
            txtStatus    = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtStatus");
            txtSPO2      = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtSPO2");
            txtSignal    = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtSignal");
            txtPulseRate = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtPulseRate");
            txtDesc      = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtDesc");
            img.Visible  = false;

            btn.TapEvent += btn_TapEvent;

            Glide.MainWindow = window;
            JoinWifi();
            Thread.Sleep(500);
            if (client == null)
            {
                // create client instance
                MQTT_BROKER_ADDRESS = "cloud.makestro.com";
                client = new MqttClient(MQTT_BROKER_ADDRESS);
                string clientId = Guid.NewGuid().ToString();
                client.Connect(clientId, "mifmasterz", "123qweasd");
                SubscribeMessage();
            }
            Thread th1 = new Thread(new ThreadStart(Loop));

            th1.Start();
        }
Пример #10
0
        public static void showWindowPinCorto()
        {
            Window window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window_pin_corto));

            GHI.Glide.UI.Button btnTryAgain = (GHI.Glide.UI.Button)window.GetChildByName("tryagain");

            btnTryAgain.TapEvent += btnTryAgain_TapEvent;
            GlideTouch.Initialize();
            Glide.MainWindow = window;
            Glide.MainWindow.Invalidate();
        }
Пример #11
0
        public static void showWindowNotRegistered()
        {
            Window window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window_not_regitered));

            GHI.Glide.UI.Button btnBack = (GHI.Glide.UI.Button)window.GetChildByName("back");

            btnBack.TapEvent += btnRetryerrorpin_TapEvent;
            GlideTouch.Initialize();
            Glide.MainWindow = window;
            Glide.MainWindow.Invalidate();
        }
Пример #12
0
        /*
         * public static GHI.Glide.UI.ProgressBar showWindowProgress()
         * {
         *
         *  Window window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window_loading));
         *  GHI.Glide.UI.ProgressBar progress = (GHI.Glide.UI.ProgressBar)window.GetChildByName("progress");
         *
         *  progress.Enabled = true;
         *  progress.MaxValue = 100;
         *
         *  GlideTouch.Initialize();
         *  Glide.MainWindow = window;
         *  Glide.MainWindow.Invalidate();
         *  return progress;
         * }
         */
        public static void showWindowNetworkDown()
        {
            Window window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window_network_down));

            //    GHI.Glide.UI.Button btnRetry = (GHI.Glide.UI.Button)window.GetChildByName("btn_retry");

            //    btnRetry.TapEvent += btnRetry_TapEvent;
            GlideTouch.Initialize();
            Glide.MainWindow = window;
            Glide.MainWindow.Invalidate();
        }
Пример #13
0
        // ---------------------------------------------------

        // Méthodes ------------------------------------------
        /// <summary>
        /// Affiche la fenetre précédemment generer
        /// </summary>
        public override void Afficher(byte numFenetre = 0)
        {
            if (m_window != null)
            {
                GlideTouch.Initialize();
                Glide.MainWindow = m_window;
            }
            else
            {
                Debug.Print("Erreur: la fenetre n'existe pas");
            }
        }
Пример #14
0
 public IHM()
 {
     GlideTouch.Initialize();
     Debug.Print("IHM created");
     fenetreSelection = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.fenetreSelection));
     Glide.MainWindow = fenetreSelection;
     //Charge le fichier XML pour la fenetre de selection
     fenetreAffichage = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.fenetreAffichage));     // -- -- -- -- -- -- -- -- -- -- -- -- -- d'affichage
     fenetrePhase     = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.fenetrePhase));
     Debug.Print("IHM completed");
     Glide.FitToScreen = true;                   //Dimensionne la fenetre pour l'adapter à l'écran LCD
 }
Пример #15
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();
            *******************************************************************************************/
            GHI.Glide.Display.Window Main_menu = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MAIN_MENU));
            //Debug.Print(Resources.GetString(Resources.StringResources.MAIN_MENU));
            Glide.MainWindow = Main_menu;

            GlideTouch.Initialize();
            setupCallbackManiMenu(Main_menu);

            multicolorLED.TurnOff(); //init the multicolor led
            //display = new DisplayController(this);
            status = new BoardStatus(this);
            presenceSensor.SomeoneDetected += presenceSensor_SomeoneDetected;

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

            //starting the timer for the remperature sensor
            temperatureSensor.MeasurementComplete += ts_MeasurementComplete;
            GT.Timer timer = new GT.Timer(60000); // every second (1000ms)
            timer.Tick += temperature_timer_Tick;
            timer.Start();

            //setting up the ethernet interface
            ethernetJ11D.UseThisNetworkInterface();
            ethernetJ11D.UseStaticIP(boardIpAddress, "255.255.255.0", "192.168.1.1");
            ethernetJ11D.NetworkUp   += ethernetJ11D_NetworkUp;
            ethernetJ11D.NetworkDown += ethernetJ11D_NetworkDown;


            GT.Timer timer1 = new GT.Timer(60000); // every second (1000ms)
            timer1.Tick += luminosity_Getter;
            timer1.Start();

            //starting thread to send data to the server
            Thread t = new Thread(sendDataToServer);

            t.Start();
            temperatureSensor.RequestMeasurement();
            luminosity_Getter(timer1);
        }
Пример #16
0
        static void display_TouchUp(DisplayNhd5 sender, TouchEventArgs e)
        {
//            Debug.Print("Finger " + e.FingerNumber + " up!");
            if (LCDTurnedOn)
            {
                LCDTurnedOn = false;
                return;
            }
            touches[0].X = e.X;
            touches[0].Y = e.Y;
            GlideTouch.RaiseTouchUpEvent(null, new GHI.Glide.TouchEventArgs(touches));
        }
Пример #17
0
 private void DrawConnetorsAlarmWindow()
 {
     lock (myLock)
     {
         window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.CAlarmWindow));
         GlideTouch.Initialize();
         reset            = (Button)window.GetChildByName("reset");
         reset.TapEvent  += resetAll;
         Glide.MainWindow = window;
         return;
     }
 }
Пример #18
0
        private void ShowConnectionWindow()
        {
            window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.StartWindow)); //carico window da mostrare
            GlideTouch.Initialize();
            b_rj   = (Button)window.GetChildByName("rjbutton");
            b_wifi = (Button)window.GetChildByName("wifibutton");

            b_rj.TapEvent   += ChooseRJ;
            b_wifi.TapEvent += ChooseWiFi;

            Glide.MainWindow = window;

            connected = false;
            return;
        }
Пример #19
0
        private void showWindow()
        {
            GHI.Glide.Display.Window Main_menu = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MAIN_MENU));
            Glide.MainWindow = Main_menu;

            GlideTouch.Initialize();
            Glide.MainWindow.Invalidate();
            this.setupCallbackManiMenu(Main_menu);


            while (true)
            {
                Thread.Sleep(1000);
            }
        }
Пример #20
0
        public static void showWindowErrorPin()
        {
            if (!Program.NetworkUp)
            {
                showWindowNetworkDown();
                return;
            }
            Window window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window_error_pin));

            GHI.Glide.UI.Button btnRetryerrorpin = (GHI.Glide.UI.Button)window.GetChildByName("retry");

            btnRetryerrorpin.TapEvent += btnRetryerrorpin_TapEvent;
            GlideTouch.Initialize();
            Glide.MainWindow = window;
            Glide.MainWindow.Invalidate();
        }
Пример #21
0
        public static void showWindowServerDown()
        {
            if (!Program.NetworkUp)
            {
                showWindowNetworkDown();
                return;
            }
            Window window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window_server_down));

            GHI.Glide.UI.Button btnRestart = (GHI.Glide.UI.Button)window.GetChildByName("restart");

            btnRestart.TapEvent += btnRestart_TapEvent;
            GlideTouch.Initialize();
            Glide.MainWindow = window;
            Glide.MainWindow.Invalidate();
        }
Пример #22
0
        static void display_TouchUp(DisplayNhd5 sender, TouchEventArgs e)
        {
            //point loc;

            touches[0].X = e.X;
            touches[0].Y = e.Y;

            GlideTouch.RaiseTouchUpEvent(null, new GHI.Glide.TouchEventArgs(touches));

            //Debug.Print("Finger " + e.FingerNumber + " up!");

            //loc.X = e.X;
            //loc.Y = e.Y;

            //Core.RaiseTouchEvent(TouchType.TouchUp, loc);
        }
Пример #23
0
        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            multicolorLED.BlinkOnce(GT.Color.Red);
            //7" Displays
            Display.Width  = 800;
            Display.Height = 480;
            Display.OutputEnableIsFixed      = false;
            Display.OutputEnablePolarity     = true;
            Display.PixelPolarity            = false;
            Display.PixelClockRateKHz        = 30000;
            Display.HorizontalSyncPolarity   = false;
            Display.HorizontalSyncPulseWidth = 48;
            Display.HorizontalBackPorch      = 88;
            Display.HorizontalFrontPorch     = 40;
            Display.VerticalSyncPolarity     = false;
            Display.VerticalSyncPulseWidth   = 3;
            Display.VerticalBackPorch        = 32;
            Display.VerticalFrontPorch       = 13;
            Display.Type = Display.DisplayType.Lcd;
            if (Display.Save())      // Reboot required?
            {
                PowerState.RebootDevice(false);
            }
            //set up touch screen
            CapacitiveTouchController.Initialize(GHI.Pins.FEZRaptor.Socket14.Pin3);

            window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MyForm));
            //glide init
            GlideTouch.Initialize();

            GHI.Glide.UI.Button btn = (GHI.Glide.UI.Button)window.GetChildByName("btnTest");
            img          = (GHI.Glide.UI.Image)window.GetChildByName("img1");
            txtLora      = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtLora");
            txtStatus    = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtStatus");
            txtSPO2      = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtSPO2");
            txtSignal    = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtSignal");
            txtPulseRate = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtPulseRate");
            txtDesc      = (GHI.Glide.UI.TextBlock)window.GetChildByName("txtDesc");
            img.Visible  = false;

            btn.TapEvent += btn_TapEvent;

            Glide.MainWindow = window;
            Thread th1 = new Thread(new ThreadStart(Loop));

            th1.Start();
        }
Пример #24
0
        // ---------------------------------------------------

        // Méthodes ------------------------------------------
        public override void Afficher(byte numFenetre = 0)
        {
            if (m_window.Length > numFenetre && m_window[numFenetre] != null)
            {
                m_currentIndice = numFenetre;

                InitBoutons();

                GlideTouch.Initialize();
                Glide.MainWindow = m_window[numFenetre];
            }

            else
            {
                Debug.Print("Erreur: la fenetre n'existe pas");
            }
        }
Пример #25
0
        public static void setupWindowInsertPin()
        {
            Window window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window));

            GlideTouch.Initialize();

            GHI.Glide.UI.Button btn1 = (GHI.Glide.UI.Button)window.GetChildByName("button1");
            GHI.Glide.UI.Button btn2 = (GHI.Glide.UI.Button)window.GetChildByName("button2");
            GHI.Glide.UI.Button btn3 = (GHI.Glide.UI.Button)window.GetChildByName("button3");
            GHI.Glide.UI.Button btn4 = (GHI.Glide.UI.Button)window.GetChildByName("button4");
            GHI.Glide.UI.Button btn5 = (GHI.Glide.UI.Button)window.GetChildByName("button5");
            GHI.Glide.UI.Button btn6 = (GHI.Glide.UI.Button)window.GetChildByName("button6");
            GHI.Glide.UI.Button btn7 = (GHI.Glide.UI.Button)window.GetChildByName("button7");
            GHI.Glide.UI.Button btn8 = (GHI.Glide.UI.Button)window.GetChildByName("button8");
            btn1.TapEvent += btn1_TapEvent;

            Glide.MainWindow = window;
        }
Пример #26
0
        // This method is run when the mainboard is powered up or reset.
        public void ProgramStarted()
        {
            //usb host
            var usbHostController = GHIElectronics.TinyCLR.Devices.UsbHost.
                                    UsbHostController.GetDefault();

            usbHostController.Enable();
            //sdcard
            var sd    = StorageController.FromName(SC20260.StorageController.SdCard);
            var drive = FileSystem.Mount(sd.Hdc);


            var lcd = new DisplayDriver43(SC20260.GpioPin.PA15);

            GHI.Glide.Glide.SetupGlide(480, 272, 96, 0, lcd.display);

            // Use Debug.WriteLine to show messages in Visual Studio's "Output" window during debugging.
            Debug.WriteLine("Program Started");
            Screens = new Hashtable();
            //populate all form
            var F1 = new SplashForm(ref MainWindow);

            F1.FormRequestEvent += General_FormRequestEvent;
            Screens.Add(Screen.ScreenTypes.Splash, F1);

            var F2 = new PromptForm(ref MainWindow, ref lcd, ref drive, ref usbHostController);

            F2.FormRequestEvent += General_FormRequestEvent;
            Screens.Add(Screen.ScreenTypes.Prompt, F2);

            GHI.Glide.Glide.FitToScreen = true;
            GlideTouch.Initialize();

            //load splash
            LoadForm(Screen.ScreenTypes.Splash);
            //GHI.Glide.Glide.MainWindow = window;

            lcd.CapacitiveScreenReleased += Lcd_CapacitiveScreenReleased;
            lcd.CapacitiveScreenPressed  += Lcd_CapacitiveScreenPressed;
            lcd.CapacitiveScreenMove     += Lcd_CapacitiveScreenMove;

            //string dir = Strings.NormalizeDirectory("\\sd");
            //string siz = Strings.FormatDiskSize(1128);
        }
Пример #27
0
        //Hashtable Screens { set; get; }
        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            Debug.Print("Program Started");

            //7" Displays
            Display.Width  = 800;
            Display.Height = 480;
            Display.OutputEnableIsFixed      = false;
            Display.OutputEnablePolarity     = true;
            Display.PixelPolarity            = false;
            Display.PixelClockRateKHz        = 30000;
            Display.HorizontalSyncPolarity   = false;
            Display.HorizontalSyncPulseWidth = 48;
            Display.HorizontalBackPorch      = 88;
            Display.HorizontalFrontPorch     = 40;
            Display.VerticalSyncPolarity     = false;
            Display.VerticalSyncPulseWidth   = 3;
            Display.VerticalBackPorch        = 32;
            Display.VerticalFrontPorch       = 13;
            Display.Type = Display.DisplayType.Lcd;
            if (Display.Save())      // Reboot required?
            {
                PowerState.RebootDevice(false);
            }
            //set up touch screen
            CapacitiveTouchController.Initialize(GHI.Pins.FEZRaptor.Socket14.Pin3);

            /*
             * Screens = new Hashtable();
             * //populate all form
             * var F1 = new SplashForm(ref MainWindow);
             * F1.FormRequestEvent += General_FormRequestEvent;
             * Screens.Add(Screen.ScreenTypes.Splash, F1);
             *
             * var F2 = new PromptForm(ref MainWindow, ref displayNHVN, ref sdCard, ref usbHost, ref usbClientEDP, ref wifiRS21);
             * F2.FormRequestEvent += General_FormRequestEvent;
             * Screens.Add(Screen.ScreenTypes.Prompt, F2);
             */
            Glide.FitToScreen = true;
            GlideTouch.Initialize();

            //load splash
            LoadForm(Screen.ScreenTypes.Splash);
        }
Пример #28
0
        public static void showWindowInsertPin()
        {
            if (!Program.NetworkUp && !Program.setupComplete)
            {
                showWindowNetworkDown();
                return;
            }

            Window window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window_pin));

            GlideTouch.Initialize();

            GHI.Glide.UI.Button btn1   = (GHI.Glide.UI.Button)window.GetChildByName("button1");
            GHI.Glide.UI.Button btn2   = (GHI.Glide.UI.Button)window.GetChildByName("button2");
            GHI.Glide.UI.Button btn3   = (GHI.Glide.UI.Button)window.GetChildByName("button3");
            GHI.Glide.UI.Button btn4   = (GHI.Glide.UI.Button)window.GetChildByName("button4");
            GHI.Glide.UI.Button btn5   = (GHI.Glide.UI.Button)window.GetChildByName("button5");
            GHI.Glide.UI.Button btn6   = (GHI.Glide.UI.Button)window.GetChildByName("button6");
            GHI.Glide.UI.Button btn7   = (GHI.Glide.UI.Button)window.GetChildByName("button7");
            GHI.Glide.UI.Button btn8   = (GHI.Glide.UI.Button)window.GetChildByName("button8");
            GHI.Glide.UI.Button btn9   = (GHI.Glide.UI.Button)window.GetChildByName("button9");
            GHI.Glide.UI.Button btn0   = (GHI.Glide.UI.Button)window.GetChildByName("button0");
            GHI.Glide.UI.Button btnOk  = (GHI.Glide.UI.Button)window.GetChildByName("button_ok");
            GHI.Glide.UI.Button btnDel = (GHI.Glide.UI.Button)window.GetChildByName("button_del");
            password         = (GHI.Glide.UI.PasswordBox)window.GetChildByName("textpassword");
            password.Enabled = true;

            btn1.TapEvent   += btn1_TapEvent;
            btn2.TapEvent   += btn2_TapEvent;
            btn3.TapEvent   += btn3_TapEvent;
            btn4.TapEvent   += btn4_TapEvent;
            btn5.TapEvent   += btn5_TapEvent;
            btn6.TapEvent   += btn6_TapEvent;
            btn7.TapEvent   += btn7_TapEvent;
            btn8.TapEvent   += btn8_TapEvent;
            btn9.TapEvent   += btn9_TapEvent;
            btn0.TapEvent   += btn0_TapEvent;
            btnDel.TapEvent += btnDel_TapEvent;
            btnOk.TapEvent  += btnOk_TapEvent;

            Glide.MainWindow = window;
            Glide.MainWindow.Invalidate();
        }
Пример #29
0
        internal static void Initialize()
        {
            GlideTouch.Initialize();
            GlideTouch.TouchDownEvent  += new TouchEventHandler(Display_TouchDown);
            Glide.Keyboard.TapKeyEvent += Keyboard_TapKeyEvent;

            backgroundImages = SD_Card.GetAllFilesInFolder("Bilder");

            window_Main           = new Window_Main();
            window_Calibration    = new Window_Calibration();
            window_Fertilize      = new Window_Fertilize();
            window_PumpProperties = new Window_PumpProperties();
            window_PumpSchedule   = new Window_PumpSchedule();
            window_AWC_Edit       = new Window_AWC_Edit();

            backgroundImageTimer = new Timer(backgroundImageTimer_Tick, null, 0, BackgroundImageTimer_TickTime);
            backlightTimer_Restart();

            Debug.Print("Window Manager initialized.");
        }
Пример #30
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");
            Screens = new Hashtable();
            //populate all form
            var F1 = new SplashForm(ref MainWindow);

            F1.FormRequestEvent += General_FormRequestEvent;
            Screens.Add(Screen.ScreenTypes.Splash, F1);

            var F2 = new EditorForm(ref MainWindow, ref sdCard, ref displayTE35);

            F2.FormRequestEvent += General_FormRequestEvent;
            Screens.Add(Screen.ScreenTypes.Editor, F2);

            var F3 = new ExecutorForm(ref MainWindow, ref displayTE35);

            F3.FormRequestEvent += General_FormRequestEvent;
            Screens.Add(Screen.ScreenTypes.Executor, F3);

            Glide.FitToScreen = true;
            GlideTouch.Initialize();

            //load splash
            LoadForm(Screen.ScreenTypes.Splash);
        }