//Navigate to start screen after button component is pressed after finishing the game
        void button_ButtonPressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)
        {
            if (isGameOver)
            {
                Glide.MainWindow = mainWindow;
                isGameOver       = false;
                isGameScreen     = false;

                winMasterMind.getGameWindow().Dispose();
            }
        }
Beispiel #2
0
 public void buttonPressed(GHIE.Button sender, GHIE.Button.ButtonState state)
 {
     if (isRecording)
     {
         StopRecording();
     }
     else
     {
         StartRecording();
     }
 }
Beispiel #3
0
 void button_ButtonPressed(Button sender, Button.ButtonState state)
 {
     if (!timerStarted)
     {
         dataReadTimer.Start();
         timerStarted = true;
     }
     else
     {
         dataReadTimer.Stop();
         timerStarted = false;
     }
 }
Beispiel #4
0
 void button_ButtonPressed(GTM.Button sender, GTM.Button.ButtonState state)
 {
     Debug.Print("boton apretado program");
     if (Scheduler.Instance().getActivation())
     {
         Scheduler.Instance().setActivation(false);
         sender.LEDMode = Button.LEDModes.Off;
     }
     else
     {
         sender.LEDMode = Button.LEDModes.On;
         Thread.Sleep(waitTime);
         Scheduler.Instance().setActivation(true);
     }
 }
 void button_ButtonPressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)
 {
     if (button.IsLedOn)         //check if button is “on"
     {
         camera.StopStreaming(); //stop streaming
         button.TurnLedOff();    //mark button as "off"
     }
     else
     {
         if (camera.CameraReady)
         {
             camera.StartStreaming(mBitmap); //start streaming
             //fillColores();
             button.TurnLedOn();             //mark button as "on"
         }
     }
 }
Beispiel #6
0
 void button_Button2Pressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)
 {
     if (autenticato)
     {
         displayTE35.SimpleGraphics.Clear();
         displayTE35.SimpleGraphics.DisplayTextInRectangle("Access Granted.", 100, 120, 200, 200, GT.Color.Cyan, Resources.GetFont(Resources.FontResources.NinaB));
         Thread.Sleep(5000);
         autenticato = false;
         resetta_stato();
     }
     else
     {
         camera.BitmapStreamed -= stampa_video;
         button.ButtonPressed  -= scatta_foto;
         displayTE35.SimpleGraphics.Clear();
         displayTE35.SimpleGraphics.DisplayTextInRectangle("Access Denied\nAuthentication Requested.", 100, 120, 200, 200, GT.Color.Red, Resources.GetFont(Resources.FontResources.NinaB));
         Thread.Sleep(5000);
         camera.BitmapStreamed += stampa_video;
         button.ButtonPressed  += scatta_foto;
     }
 }
Beispiel #7
0
        /**
         * This method is triggered when the button is pressed.
         */
        private void button_ButtonPressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)
        {
            Debug.Print("Button pressed!");
            button.ButtonPressed -= button_ButtonPressed;
            streaming             = false;
            camera.StopStreaming();
            camera.StopStreaming();
            timer_joystick.Stop();
            WindowsManager.showWindowLoadingStatic();
            Thread.Sleep(200);

            if (NetworkUp)
            {
                initServer();
            }
            else
            {
                Debug.Print("Network_Down!!!");
                WindowsManager.showWindowNetworkDown();
            }
        }
Beispiel #8
0
 void button_ButtonPressed(GTM.Button sender, GTM.Button.ButtonState state)
 {
     blueT.HostMode.InquireDevice();
     Debug.Print("boton");
 }
Beispiel #9
0
 private void GetTemperatures(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)
 {
     updateValue();
 }
Beispiel #10
0
 void button_ButtonPressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)
 {
 }
Beispiel #11
0
 private void button_ButtonPressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)
 {
     ImidiateMeasure();
     //Bitmap my_bitmap = new Bitmap((Int32)displayTE35.Width / 2, (Int32)displayTE35.Height / 2);
     //Measurement mymeasure = new Measurement();
 }
Beispiel #12
0
 void button_ButtonPressed(Gadgeteer.Modules.GHIElectronics.Button sender, Gadgeteer.Modules.GHIElectronics.Button.ButtonState state)
 {
     camera.StartStreaming();
     systemState = State.Camera;
     //camera.TakePicture();
 }
Beispiel #13
0
        private void Minus_ButtonPressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)
        {
            minus.TurnLedOn();
            count = 1;

            if (getqnt == 0)
            {
                Debug.Print("Aggiungi pizza!");
                _errMsg.Text    = "Add pizza!";
                _errMsg.Visible = true;
                _menu.Invalidate();
            }
            else
            {
                _errMsg.Visible = false;

                /*calculate price function*/
                aux              = getqnt;
                price            = price - getprice;
                _pCounter.Text   = price.ToString();
                getqnt           = getqnt - 1; //quantità della pizza selezionata
                qnt              = qnt - 1;    //quantità totale
                _qntCounter.Text = qnt.ToString();
                _dataGrid.SetCellData(3, row, getqnt);
                _menu.Invalidate();

                if (qnt == 0)
                {
                    _ordBtn.Enabled    = false;
                    _deleteBtn.Enabled = false;
                    _menu.Invalidate();
                }

                /*inizio parte array*/
                foreach (Product i in payment)
                {
                    int indice = payment.IndexOf(i);
                    //Debug.Print("Indice: " + indice);

                    if (getid == i.id && count == 1)
                    {
                        Debug.Print("IF");
                        //Debug.Print("QNT: " + aux);
                        if (aux >= 2)
                        {
                            Debug.Print("IF MAGGIORE DI UNO --- ELIMINO");
                            payment.RemoveAt(indice);
                            payment.Insert(indice, new Product(getid, getpizza, getprice, getqnt));
                            count = 0;
                            break;
                        }
                        else
                        {
                            Debug.Print("ELSE UNO --- ELIMINO");
                            payment.RemoveAt(indice);
                            count = 0;
                            break;
                        }
                    }
                }

                //Debug.Print("Elementi presenti array(minus):  " + payment.Count);
                /*fine parte array*/

                Debug.Print("Hai eliminato: " + getpizza + " Qnt: " + getqnt);
                Debug.Print("Prezzo Totale: " + price.ToString());
                Debug.Print("QNT dopo rimozione: " + getqnt);
            }
            minus.TurnLedOff();
        }
Beispiel #14
0
        private void Plus_ButtonPressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)
        {
            plus.TurnLedOn();
            if (row == -1)
            {
                Debug.Print("Seleziona una pizza!!");
                _errMsg.Text    = "Select pizza!";
                _errMsg.Visible = true;
                _menu.Invalidate();
            }
            else
            {
                _deleteBtn.Enabled = true;
                _ordBtn.Enabled    = true;
                _errMsg.Visible    = false;
                /*calculate price function*/
                price          = price + getprice;
                _pCounter.Text = price.ToString();

                getqnt           = getqnt + 1; //quantità della pizza selezionata
                qnt              = qnt + 1;    //quantità totale
                _qntCounter.Text = qnt.ToString();
                _dataGrid.SetCellData(3, row, getqnt);
                _menu.Invalidate();

                /*inizio parte array*/

                if (payment.Count == 0)
                {
                    Debug.Print("First insert into array");
                    payment.Add(new Product(getid, getpizza, getprice, getqnt));
                    //Debug.Print("Elementi presenti array(plus):  " + payment.Count);
                }

                else
                {
                    Debug.Print("Second or plus insert into array");
                    exist = 0;
                    foreach (Product i in payment)
                    {
                        int indice = payment.IndexOf(i);
                        //Debug.Print("Indice: " + indice);

                        if (getid == i.id)
                        {
                            Debug.Print("Esiste già uno -- setto qnt+1");
                            payment.RemoveAt(indice);
                            payment.Insert(indice, new Product(getid, getpizza, getprice, getqnt));
                            //Debug.Print("Elementi presenti array(plus):  " + payment.Count);
                            exist = 1;
                            break;
                        }
                    }

                    if (exist == 0)
                    {
                        Debug.Print("Non esiste -- aggiungo");
                        payment.Add(new Product(getid, getpizza, getprice, getqnt));
                        //Debug.Print("Elementi presenti array(plus):  " + payment.Count);
                    }
                }
                /*fine parte array*/

                Debug.Print("Hai Aggiunto: " + getpizza + " Qnt: " + getqnt);
                Debug.Print("Prezzo Totale: " + price.ToString());
            }
            plus.TurnLedOff();
        }