private void Button_Click(object sender, RoutedEventArgs e) { if (!Tmr.IsEnabled) { M2BMakeDrink makedrink = new M2BMakeDrink(8); byte[] sendcmd = makedrink.EnCode(); comunication.Getinstance().AddtoSend(sendcmd, (byte)sendcmd.Length); _Total++; tbtotal.Text = string.Format("Total:{0}", _Total); Tmr.Start(); btstart.IsEnabled = false; btstop.IsEnabled = true; } }
private void Tmr_Tick(object sender, EventArgs e) { //Tmr.Stop(); _second--; if (_second <= 0) { _second = 30; M2BMakeDrink makedrink = new M2BMakeDrink(8); byte[] sendcmd = makedrink.EnCode(); comunication.Getinstance().AddtoSend(sendcmd, (byte)sendcmd.Length); _Total++; tbtotal.Text = string.Format("Total:{0}", _Total); } else { tbsecond.Text = string.Format("{0} s", _second); } //Tmr.Start(); }
private void EvoDrinkUi_MouseUp(object sender, RoutedEventArgs e) { M2BMakeDrink makedrink = new M2BMakeDrink(_crtID, 0); _crtID = ((RecipeInfo)(sender as Button).Tag).ID; byte[] sendcmd = makedrink.EnCode(); comunication.Getinstance().AddtoSend(sendcmd, (byte)sendcmd.Length); recoverybtn(); }
private void Btn_start(object sender, RoutedEventArgs e) { M2BMakeDrink makedrink = new M2BMakeDrink(_crtID); makedrink.SetMilk = _preMilk; makedrink.SetStrength = _preStrength; makedrink.SetSugar = _preSugar; makedrink.SetVolume = _preVolume; byte[] sendcmd = makedrink.EnCode(); comunication.Getinstance().AddtoSend(sendcmd, (byte)sendcmd.Length); }
private void EvoDrinkUi_MouseDown(object sender, RoutedEventArgs e) { disablebtn(); (sender as Button).Visibility = System.Windows.Visibility.Visible; _crtID = ((RecipeInfo)(sender as Button).Tag).ID; M2BMakeDrink makedrink = new M2BMakeDrink(_crtID); byte[] sendcmd = makedrink.EnCode(); comunication.Getinstance().AddtoSend(sendcmd, (byte)sendcmd.Length); }