/* * */ private void Test_Click(object sender, RoutedEventArgs e) { Button tmp = sender as Button; _CalPartNo = byte.Parse(tmp.Tag.ToString()); CalibrateType cltype = (CalibrateType)int.Parse(tmp.Tag.ToString()); this.tb_title.Text = cltype.ToString(); switch (cltype) { case CalibrateType.CAL_HOT: case CalibrateType.CAL_HOT_BREW: case CalibrateType.CAL_HOT_MIX_ONE: case CalibrateType.CAL_HOT_MIX_TWO: case CalibrateType.CAL_CANISTER_ONE: case CalibrateType.CAL_CANISTER_TWO: case CalibrateType.CAL_CANISTER_THREE: case CalibrateType.CAL_CANISTER_FOUR: case CalibrateType.CAL_BREW_100: case CalibrateType.CAL_BREW_75: case CalibrateType.CAL_BREW_50: case CalibrateType.CAL_CARBON: case CalibrateType.CAL_COLD: case CalibrateType.CAL_COLD_MIX: //grd_test_brew.Visibility = System.Windows.Visibility.Visible; //this.grd_test.Visibility = Visibility.Hidden; //this.grd_cal.Visibility = System.Windows.Visibility.Hidden; //this.grd_test_temp.Visibility = System.Windows.Visibility.Hidden; //this.tb_brew.Text = cltype.ToString(); if (MessageBox.Show(this, "Please place the cup,then press the ok to start!", "Calibration", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { M2BCalibration calcmd = new M2BCalibration(_CalPartNo, _CalValue); byte[] sendcmd = calcmd.EnCode(); lock (this) { comunication.Getinstance().AddtoSend(sendcmd, (byte)sendcmd.Length); } //this.grd_Process.Visibility = System.Windows.Visibility.Visible; //Tmrpb.Start(); } break; case CalibrateType.CAL_TEMPERATURE: grd_test_brew.Visibility = System.Windows.Visibility.Hidden; this.grd_test.Visibility = Visibility.Hidden; this.grd_cal.Visibility = System.Windows.Visibility.Hidden; this.grd_test_temp.Visibility = System.Windows.Visibility.Visible; this.tb_title1.Text = cltype.ToString(); //TODO:开启温度查询 Tmr.Start(); break; default: break; } }
private void brew_Cal(object sender, RoutedEventArgs e) { M2BCalibration calcmd = new M2BCalibration(_CalPartNo, _CalValue); byte[] sendcmd = calcmd.EnCode(); lock (this) { comunication.Getinstance().AddtoSend(sendcmd, (byte)sendcmd.Length); } }
private void Button_Click(object sender, RoutedEventArgs e) { //TODO:Send Cal CMD _CalValue = (UInt16)CalInport.Value; if (_CalValue == 0) { MessageBox.Show("Value can not be null!!!"); return; } M2BCalibration calcmd = new M2BCalibration(_CalPartNo, _CalValue); byte[] sendcmd = calcmd.EnCode(); lock (this) { comunication.Getinstance().AddtoSend(sendcmd, (byte)sendcmd.Length); } MessageBox.Show("Calibration is start ,please wait"); grd_test.Visibility = System.Windows.Visibility.Hidden; grd_test_temp.Visibility = System.Windows.Visibility.Hidden; this.grd_cal.Visibility = System.Windows.Visibility.Hidden; grd_test_brew.Visibility = System.Windows.Visibility.Hidden; }