Esempio n. 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;
        }
        // TODO Create only one instance of setting Window

        public MaintenanceWindow() : base()
        {
            Window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MaintenanceWindow));

            // Load window elements
            var bback     = (Button)Window.GetChildByName("bback");
            var blockip   = (Button)Window.GetChildByName("blockip");
            var bserverip = (Button)Window.GetChildByName("bserverip");
            var bport     = (Button)Window.GetChildByName("bport");
            var blockid   = (Button)Window.GetChildByName("blockid");
            var bmaster   = (Button)Window.GetChildByName("bmaster");
            var bperiod   = (Button)Window.GetChildByName("bperiod");
            var bretry    = (Button)Window.GetChildByName("bretry");
            var bclear    = (Button)Window.GetChildByName("bclear");
            var breboot   = (Button)Window.GetChildByName("breboot");

            bback.TapEvent     += bback_TapEvent;
            bserverip.TapEvent += bserverip_TapEvent;
            blockip.TapEvent   += blockip_TapEvent;
            bport.TapEvent     += bport_TapEvent;
            blockid.TapEvent   += blockid_TapEvent;
            bmaster.TapEvent   += bmaster_TapEvent;
            bretry.TapEvent    += bretry_TapEvent;
            bperiod.TapEvent   += bperiod_TapEvent;
            bclear.TapEvent    += bclear_TapEvent;
            breboot.TapEvent   += breboot_TapEvent;
        }
Esempio n. 3
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;
        }
Esempio n. 4
0
        public override void Init(params string[] Param)
        {
            LinesOfCode = new ArrayList();
            LineCounter = 0;
            MainWindow  = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.PromptForm));

            imgCode = (GHI.Glide.UI.Image)MainWindow.GetChildByName("imgCode");

            GHI.Glide.Glide.MainWindow = MainWindow;
            s                   = new GvShell(ref displayTE35, ref sdCard, ref usbHost);
            s.PrintEvent       += S_Print;
            s.ClearScreenEvent += S_ClearScreen;
            usbHost.OnConnectionChangedEvent +=
                UsbHostController_OnConnectionChangedEvent;

            /*
             * usbHost.ConnectedKeyboard.KeyDown += (GHI.Usb.Host.Keyboard sender, GHI.Usb.Host.Keyboard.KeyboardEventArgs args) =>
             * {
             *
             * };*/
            s.PrintWelcome();
            Thread.Sleep(500);

            //execute the code
            //s.ExecuteScript(Param[0]);
            //MainWindow.Invalidate();
        }
Esempio n. 5
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;
        }
Esempio n. 6
0
        public override void Init(params string[] Param)
        {
            LinesOfCode = new ArrayList();
            LineCounter = 0;
            bmp         = new Bitmap(WidthScreen, HeightScreen);
            MainWindow  = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.ExecuteForm));

            imgCode = (GHI.Glide.UI.Image)MainWindow.GetChildByName("imgCode");
            btnBack = (GHI.Glide.UI.Button)MainWindow.GetChildByName("btnBack");

            Glide.MainWindow = MainWindow;

            myFont = Resources.GetFont(Resources.FontResources.NinaB);
            SBASIC s = new SBASIC();

            Thread.Sleep(500);

            s.Print            += S_Print;
            s.ClearScreen      += S_ClearScreen;
            btnBack.PressEvent += (sender) =>
            {
                s.Print       -= S_Print;
                s.ClearScreen -= S_ClearScreen;
                CallFormRequestEvent(ScreenTypes.Editor);
            };
            //execute the code
            s.Run(Param[0]);
            //MainWindow.Invalidate();
        }
Esempio n. 7
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;
        }
Esempio n. 8
0
        private void MenuTap(object sender)
        {
            GHI.Glide.Display.Window Main_menu = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MAIN_MENU));
            Glide.MainWindow = Main_menu;

            this.setupCallbackManiMenu(Main_menu);
        }
Esempio n. 9
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);
        }
Esempio n. 10
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);
        }
Esempio n. 11
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;
        }
Esempio n. 12
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;
        }
Esempio n. 13
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();
        }
        //Get input from the user
        public Player2Window()
        {
            Glide.FitToScreen = true;
            winPlayer2        = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Player2));
            currentGroup      = 1;
            winPlayer2.Render();

            startNewRow();
        }
Esempio n. 15
0
        /*apre pagina per il pagamento*/
        private void _payBtn_TapEvent(object sender)
        {
            /*load pagamento*/
            _pagamento       = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Pagamento));
            Glide.MainWindow = _pagamento;

            _paypal = (GHI.Glide.UI.TextBlock)_ordina.GetChildByName("paypal");
            _pagamento.Invalidate();
        }
Esempio n. 16
0
        public AccessWindow(int period)
            : base(period)
        {
            Window             = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.AccessWindow));
            Window.CloseEvent += OnClose;

            // Load access window elements
            accessImage = (Image)Window.GetChildByName("access_imm");
            accessText  = (TextBlock)Window.GetChildByName("access_tb");
        }
Esempio n. 17
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();
        }
Esempio n. 18
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();
        }
Esempio n. 19
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();
        }
Esempio n. 20
0
        private void Generer_Fen_Erreur()
        {
            m_window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.fenetreErreur));

            Button boutonOK = (Button)m_window.GetChildByName("boutonOK");

            boutonOK.TapEvent += new OnTap(sender =>
            {
                m_autoReset.Set();
            });
        }
Esempio n. 21
0
        public static void showWindowErrorServer()
        {
            if (!Program.NetworkUp)
            {
                showWindowNetworkDown();
                return;
            }
            Window window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window_error_server));

            Glide.MainWindow = window;
            Glide.MainWindow.Invalidate();
        }
Esempio n. 22
0
        public static void showWindowLoadingStatic()
        {
            if (!Program.NetworkUp)
            {
                showWindowNetworkDown();
                return;
            }
            Window window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.window_loading_static));

            Glide.MainWindow = window;
            Glide.MainWindow.Invalidate();
        }
Esempio n. 23
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
 }
Esempio n. 24
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;
     }
 }
Esempio n. 25
0
        public override void Init(params string[] Param)
        {
            MainWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.SplashForm));
            var img = (GHI.Glide.UI.Image)MainWindow.GetChildByName("ImgLogo");

            GT.Picture pic = new GT.Picture(Resources.GetBytes(Resources.BinaryResources.logo), GT.Picture.PictureEncoding.JPEG);
            img.Bitmap = pic.MakeBitmap();

            Glide.MainWindow = MainWindow;
            Thread.Sleep(2000);
            CallFormRequestEvent(ScreenTypes.Prompt);
        }
Esempio n. 26
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);
        }
Esempio n. 27
0
        private void Genetre_Fen_Mode_Test()
        {
            string[] fenetreXML = GenererFenetreXMLForTest();

            m_window = new Window[fenetreXML.Length];

            for (int i = 0; i < fenetreXML.Length; i++)
            {
                m_window[i] = GlideLoader.LoadWindow(fenetreXML[i]);
            }

            InitRadio();
        }
Esempio n. 28
0
        private void Generer_Fen_Information()
        {
            m_window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.fenetreInformation));

            if (m_autoReset != null)
            {
                Button boutonOK = (Button)m_window.GetChildByName("boutonOK");
                boutonOK.TapEvent += new OnTap(sender =>
                {
                    m_autoReset.Set();
                });
            }
        }
Esempio n. 29
0
        public override void Init(params string[] Param)
        {
            sdCard.Mounted += (SDCard sender, GT.StorageDevice device) =>
            {
                PopulateList();
            };
            MainWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.EditorForm));
            //populate Code data
            PopulateList();

            txtCode           = (GHI.Glide.UI.TextBox)MainWindow.GetChildByName("txtCode");
            btnExec           = (GHI.Glide.UI.Button)MainWindow.GetChildByName("btnExec");
            btnClear          = (GHI.Glide.UI.Button)MainWindow.GetChildByName("btnClear");
            txtCode.TapEvent += new OnTap(Glide.OpenKeyboard);

            listFile.CloseEvent += (object sender) =>
            {
                Glide.CloseList();
            };

            cmbFile           = (GHI.Glide.UI.Dropdown)MainWindow.GetChildByName("cmbFile");
            cmbFile.TapEvent += (object sender) =>
            {
                Glide.OpenList(sender, listFile);
            };
            cmbFile.ValueChangedEvent += (object sender) =>
            {
                var dropdown = (GHI.Glide.UI.Dropdown)sender;
                if (dropdown.Value == null)
                {
                    return;
                }
                var data = sdCard.StorageDevice.ReadFile(dropdown.Value.ToString());
                txtCode.Text = new string(Encoding.UTF8.GetChars(data));
                txtCode.Invalidate();
                //Debug.Print("Dropdown value: " + dropdown.Text + " : " + dropdown.Value.ToString());
            };

            btnExec.PressEvent += (sender) =>
            {
                CallFormRequestEvent(ScreenTypes.Executor, txtCode.Text);
            };

            btnClear.PressEvent += (sender) =>
            {
                txtCode.Text = string.Empty;
            };
            Glide.MainWindow = MainWindow;
            //MainWindow.Invalidate();
        }
Esempio n. 30
0
        static void Main()
        {
            Display.InitializeDisplay();
            Input.Touch.InitializeTouch();

            MainApp = new Program(Display.DisplayController);

            GHIElectronics.TinyCLR.Glide.Glide.SetupGlide(Display.Width, Display.Height, 96, 0, Display.DisplayController);

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

            GHIElectronics.TinyCLR.Glide.Glide.MainWindow = (GHIElectronics.TinyCLR.UI.Controls.GlideWindow)window;

            MainApp.Run(GHIElectronics.TinyCLR.Glide.Glide.MainWindow);
        }