Example #1
0
        private void Button_Click_Clear(object sender, RoutedEventArgs e)
        {
            Tb1.Clear();
            Tb2.Clear();
            helper Clear = new helper(Tb1.Text, Tb2.Text);

            answ.Content = Clear.GetClear();
        }
 private void Tb1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         //Aufgaben.Add(Tb1.Text);
         //Lv1.Items.Refresh();
         AddTodoItem(Tb1.Text);
         Tb1.Clear();
     }
 }
Example #3
0
        private void Button_Click(object sender, EventArgs e)
        {
            if ((
                    Tb1.Text == "0") || (click))
            {
                Tb1.Clear();
            }
            click = false;
            Button b = (Button)sender;

            Tb1.Text = Tb1.Text + b.Text;
        }
Example #4
0
 private static void Cam1AutoProcess()
 {
     while (Cam1AcqThread.IsAlive || Cam1ImageQueue.Count > 0)
     {
         if (Cam1ImageQueue.Count > 0)
         {
             SortedList <string, string> rs = RunCam1Program(Cam1ImageQueue.Dequeue());
             if (Cam1ResultAvailable != null)
             {
                 Cam1ResultAvailable(null, new VisionResultAvailableEventArgs(Tb1.CreateLastRunRecord(), rs));
             }
         }
     }
 }
Example #5
0
        private void Button_Click15(object sender, EventArgs e) // -+*/
        {
            try
            {
                a    = Convert.ToDouble(Tb1.Text); //переводим в double
                mark = (sender as Button).Content.ToString();
                Tb1.Clear();
            }

            catch
            {
                MessageBox.Show("Invalid operation", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }
Example #6
0
        public static SortedList <string, string> RunCam1Program(ICogImage iCogImage)
        {
            WriteBlockInput(Tb1, "Image", iCogImage);
            Tb1.Run();
            Tb1.CreateLastRunRecord();

            SortedList <string, string> rs = new SortedList <string, string>()
            {
            };

            rs["RunStatus"] = Tb1.RunStatus.Result.ToString();
            if (rs["RunStatus"] != "Accept")
            {             //检测异常
                rs["Result"]       = "4";
                rs["ResultString"] = "检测失败";
                return(rs);
            }

            //处理结果,生成结果
            rs["Result"]       = "1";
            rs["ResultString"] = "OK";
            rs["NGKeys"]       = "";
            foreach (CogToolBlockTerminal item in Tb1.Outputs)
            {
                ConfigItem cfg   = ProductManager.GetCurProduct().Configs.Find(cfi => cfi.CamIndex == 1 && cfi.Key == item.Name);
                double     value = 0;
                double.TryParse(item.Value.ToString(), out value);
                value = Math.Round(value, 3);
                rs.Add(item.Name, value.ToString());
                if (value > cfg.Usl || value < cfg.Lsl)
                {
                    rs["Result"]       = "2";
                    rs["ResultString"] = "NG";
                    rs["NGKeys"]      += item.Name + ",";
                }
            }
            return(rs);
        }
Example #7
0
 private void button8_Click(object sender, EventArgs e)
 {
     Tb1.Clear();
 }
Example #8
0
 private void Button_Click13(object sender, RoutedEventArgs e) // C
 {
     Tb1.Clear();
 }