コード例 #1
0
 public TimerThread(JtjMeasureWindow wnd)
 {
     this.wnd        = wnd;
     readCAMDelegate = new ReadCAMDelegate(ReadCAM);
 }
コード例 #2
0
        private void ButtonNext_Click(object sender, RoutedEventArgs e)
        {
            int i = 0;

            try
            {
                // 是否选择了检测孔
                for (i = 0; i < Global.deviceHole.SxtCount; ++i)
                {
                    if (_item.Hole[i].Use)
                    {
                        break;
                    }
                }
                if (Global.deviceHole.SxtCount == i)
                {
                    MessageBox.Show(this, "请至少选择一个检测孔!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                    return;
                }

                // 下一步的时候,遍历所有的comboBoxSampleName 和 comboBoxSampleSource
                List <TextBox> listSampleName = UIUtils.GetChildObjects <TextBox>(WrapPanelChannel, "SampleName");
                //List<TextBox> listTextBoxTask = UIUtils.GetChildObjects<TextBox>(WrapPanelChannel, "TaskName");
                List <TextBox> listCompany = UIUtils.GetChildObjects <TextBox>(WrapPanelChannel, "Company");
                //List<TextBox> listTextBoxProduceCompany = UIUtils.GetChildObjects<TextBox>(WrapPanelChannel, "ProduceCompany");
                //List<TextBox> listTextBoxSampleid = UIUtils.GetChildObjects<TextBox>(WrapPanelChannel, "Sampleid");
                for (i = 0; i < Global.deviceHole.SxtCount; ++i)
                {
                    if (_item.Hole[i].Use)
                    {
                        #region 必填验证
                        if (listSampleName[i].Text.Trim().Length == 0)
                        {
                            MessageBox.Show("样品名称不能为空!\r\n请双击选择样品", "操作提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                            listSampleName[i].Focus();
                            return;
                        }
                        if (listCompany[i].Text.Trim().Length == 0 && !Global.KsVersion.Equals("1"))
                        {
                            MessageBox.Show(this, "经营户不能为空!\n\n请双击选择经营户", "操作提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                            listCompany[i].Focus();
                            return;
                        }
                        #endregion
                        _item.Hole[i].SampleName = listSampleName[i].Text.Trim();
                        _item.Hole[i].SampleCode = listSampleName[i].DataContext.ToString();
                        if (!Global.KsVersion.Equals("1"))
                        {
                            _item.Hole[i].CompanyName = listCompany[i].Text.Trim();
                            _item.Hole[i].CompanyCode = listCompany[i].DataContext.ToString();
                        }
                        else
                        {
                            _item.Hole[i].CompanyName = _item.Hole[i].CompanyCode = "";
                        }
                    }
                }
                Global.SerializeToFile(Global.jtjItems, Global.jtjItemsFile);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            JtjMeasureWindow window = new JtjMeasureWindow()
            {
                _item         = _item,
                ShowInTaskbar = false,
                Owner         = this
            };
            window.ShowDialog();
        }
コード例 #3
0
 public UpdateCAMThread(JtjMeasureWindow wnd)
 {
     this.wnd = wnd;
     uiHandleMessageDelegate = new UIHandleMessageDelegate(UIHandleMessage);
 }