public UpdateCAMThread(GszMeasureWindow wnd)
 {
     this.wnd = wnd;
     uiHandleMessageDelegate = new UIHandleMessageDelegate(UIHandleMessage);
 }
 public TimerThread(GszMeasureWindow wnd)
 {
     this.wnd        = wnd;
     readCAMDelegate = new ReadCAMDelegate(ReadCAM);
 }
Beispiel #3
0
        private void ButtonNext_Click(object sender, RoutedEventArgs e)
        {
            // 是否选择了检测孔
            int i = 0;

            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;
            }
            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.gszItems, Global.gszItemsFile);
            GszMeasureWindow window = new GszMeasureWindow()
            {
                _item         = _item,
                ShowInTaskbar = false,
                Owner         = this
            };
            window.ShowDialog();
        }