Esempio n. 1
0
        public FormMeasurementTest()
        {
            InitializeComponent();

            this.Text = MeasurementSystemSetting.SystemData.Setting.Profile.AppTitle + " - 测试作业";

            btReferencecs.Image = StaticImage.Referencecs;

            measurementJob                  = new MeasurementJobInformation();
            measurementController           = new MeasurementController();
            referencesProcess               = new ReferencesProcess();
            measurementProcess              = new MeasurementProcess();
            referencesProcess.ProcessError += (o, e) =>
            {
                AppFramework.Context.Execute(
                    new Action(() =>
                {
                    AppFramework.Context.ShowError(e.ExceptionObject.ToString(), "归零错误");
                }));
            };
            measurementProcess.ProcessError += (o, e) =>
            {
                AppFramework.Context.Execute(
                    new Action(() =>
                {
                    AppFramework.Context.ShowError(e.ExceptionObject.ToString(), "测试错误");
                }));
            };
            measurementProcess.ProcessStart += (o, e) =>
            {
                btReferencecs.Enabled = false;
                btStart.Image         = Properties.Resources.stop_64;
                btStart.Text          = "       停止测试";
                tslMsg.Text           = "正在测试产品...";
            };
            measurementProcess.ProcessStop += (o, e) =>
            {
                btReferencecs.Enabled = true;
                btStart.Image         = Properties.Resources.Start_64;
                btStart.Text          = "       开始测试";
                tslMsg.Text           = "就绪";

                if (testSystemControls == null)
                {
                    return;
                }
                foreach (var testSystemControl in testSystemControls)
                {
                    testSystemControl.SetStop();
                }
            };
        }