Example #1
0
        private void Bt1_Click(object sender, EventArgs e)
        {
            for (int i = data.Count; i >= 0; i--)
            {
                data.Remove(i);
            }

            if (btStart.Text == "Iniciar a coleta")
            {
                lbMoviment.Text    = "Repouso";
                lbMoviment.Visible = true;
                btStart.Text       = "Parar a coleta";
                ImageShow();
                TimerOne.Start();
                DataSave();
            }
            else if (btStart.Text == "Parar a coleta")
            {
                pbMain.Image       = imageList[0];
                lbMoviment.Visible = false;
                btStart.Text       = "Iniciar a coleta";
                TimerOne.Stop();
                countTwo      = 0;
                countOne      = 0;
                countT        = 0;
                countP        = 0;
                lbCountT.Text = "0";
                lbCountP.Text = "0";
            }
        }
Example #2
0
        private void TimerOne_Tick(object sender, EventArgs e)
        {
            if (iRest == true)
            {
                TimerOne.Interval   = 3000;
                pbMain.Image        = null;
                iRest               = false;
                pnTrigger.BackColor = Color.White;
                switch (countTwo)
                {
                case 10:
                    countTwo          = 0;
                    lbCountT.Text     = "0";
                    pbMain.Image      = null;
                    pnTrigger.Visible = false;
                    for (int i = data.Count; i >= 0; i--)
                    {
                        data.Remove(i);
                    }
                    BtColeta.Text    = "Iniciar Coleta";
                    BtColeta.Enabled = false;
                    TimerOne.Stop();
                    break;
                }
            }
            else
            {
                if (iImg == true)
                {
                    TimerOne.Interval = 1000;
                    pbCross.Image     = imageList[2];
                    pbCross.Visible   = true;
                    pbMain.Visible    = false;
                    player.Play();
                    iImg = false;
                }
                else
                {
                    TimerOne.Interval   = 4000;
                    pbMain.Visible      = true;
                    pbCross.Visible     = false;
                    pnTrigger.BackColor = Color.Black;
                    pbMain.Image        = imageList[data[countTwo][countOne++] - 1];

                    countP++;
                    iRest = true;
                    iImg  = true;
                }
                switch (countOne)
                {
                case 2:
                    countT++;
                    lbCountT.Text = countT.ToString();
                    countOne      = 0;
                    countTwo++;
                    break;
                }
            }
        }
Example #3
0
 private void TimerOne_Tick(object sender, EventArgs e)
 {
     if (iRest == true)
     {
         TimerOne.Interval   = 3000;
         lbMoviment.Text     = "Repouso";
         pbTrigger.BackColor = Color.White;
         pbMain.Image        = imageList[0];
         iRest = false;
         switch (countTwo)
         {
         case 10:
             countP        = 0;
             lbCountP.Text = "0";
             btStart.Text  = "Iniciar a coleta";
             countTwo      = 0;
             TimerOne.Stop();
             a++;
             break;
         }
     }
     else
     {
         TimerOne.Interval = 3000;
         MovimentText(pbMain.Image);
         pbMain.Image = imageList[data[countTwo][countOne++]];
         countT++;
         lbCountT.Text = countT.ToString();
         countP++;
         lbCountP.Text = countP.ToString();
         MovimentText(pbMain.Image);
         pbTrigger.BackColor = Color.Black;
         switch (countOne)
         {
         case 6:
             countOne = 0;
             countTwo++;
             break;
         }
         iRest = true;
     }
 }
Example #4
0
 private void BtColeta_Click(object sender, EventArgs e)
 {
     if (BtColeta.Text == "Iniciar Coleta")
     {
         BtColeta.Text     = "Parar Coleta";
         pnTrigger.Visible = true;
         TimerOne.Start();
     }
     else if (BtColeta.Text == "Parar Coleta")
     {
         BtColeta.Text = "Iniciar Coleta";
         TimerOne.Stop();
         countTwo          = 0;
         countOne          = 0;
         countT            = 0;
         countP            = 0;
         lbCountT.Text     = "0";
         pbMain.Image      = null;
         pnTrigger.Visible = false;
         BtColeta.Enabled  = false;
     }
 }