示例#1
0
 private void btnOk_Click(object sender, System.EventArgs e)
 {
     if (!tbZ.IsValid)
     {
         //MessageBox.Show("Please input a double number for z.");
         MetroSetMessageBox.Show(this, "请输入小数.");
         return;
     }
     moveAbsZCmdLine.Z = tbZ.Value;
     if (isCreating)
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, moveAbsZCmdLine);
     }
     else
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, moveAbsZCmdLine);
     }
     if (!this.isCreating)
     {
         if (this.moveAbsZCmdLine != null && this.moveAbsZCmdLineBackUp != null)
         {
             CompareObj.CompareField(this.moveAbsZCmdLine, this.moveAbsZCmdLineBackUp, null, this.GetType().Name, true);
         }
     }
 }
示例#2
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (!tbWaitInMills.IsValid)
            {
                //MessageBox.Show("Please input valid value.");
                MessageBox.Show("请输入正确的值");
                return;
            }
            timerCmdLine.WaitInMills = tbWaitInMills.Value;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, timerCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, timerCmdLine);
            }

            Properties.Settings.Default.NormalTimer = timerCmdLine.WaitInMills;
            if (!this.isCreating)
            {
                Close();
                if (this.timerCmdLine != null && this.timerCmdLineBackUp != null)
                {
                    CompareObj.CompareField(this.timerCmdLine, this.timerCmdLineBackUp, null, this.GetType().Name, true);
                }
            }
        }
示例#3
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!tbX.IsValid || !tbY.IsValid)
            {
                //MessageBox.Show("Please input valid values.");
                MessageBox.Show("请输入正确的值.");
                return;
            }
            PointD laserMap = this.pattern.SystemRel(tbX.Value, tbY.Value);

            measureHeightCmdLine.Position.X   = laserMap.X;
            measureHeightCmdLine.Position.Y   = laserMap.Y;
            measureHeightCmdLine.StandardHt   = this.heightControl1.BoardHeight;
            measureHeightCmdLine.ToleranceMax = this.heightControl1.MaxTolerance;
            measureHeightCmdLine.ToleranceMin = this.heightControl1.MinTolerance;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, measureHeightCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, measureHeightCmdLine);
            }
            Properties.Settings.Default.laserX = measureHeightCmdLine.Position.X;
            Properties.Settings.Default.laserY = measureHeightCmdLine.Position.Y;
            if (!this.isCreating)
            {
                Close();
                if (this.measureHeightCmdLine != null && this.measureHeightCmdLineBackUp != null)
                {
                    CompareObj.CompareProperty(this.measureHeightCmdLine, this.measureHeightCmdLineBackUp, null, this.GetType().Name, true);
                    CompareObj.CompareField(this.measureHeightCmdLine, this.measureHeightCmdLineBackUp, null, this.GetType().Name, true);
                }
            }
        }
示例#4
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (comboBoxSysPositions.SelectedItem == null)
            {
                //MessageBox.Show("System position is not selected.");
                MetroSetMessageBox.Show(this, "请选择坐标点位.");
                return;
            }
            UserPosition up = comboBoxSysPositions.SelectedItem as UserPosition;

            moveToLocationCmdLine.PositionName = up.Name;
            moveToLocationCmdLine.MoveType     = up.MoveType;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, moveToLocationCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, moveToLocationCmdLine);
            }
            if (!this.isCreating)
            {
                if (this.moveToLocationCmdLine != null && this.moveToLocationCmdLineBackUp != null)
                {
                    CompareObj.CompareField(this.moveToLocationCmdLine, this.moveToLocationCmdLineBackUp, null, this.GetType().Name, true);
                }
            }
        }
示例#5
0
 private void btnOk_Click(object sender, System.EventArgs e)
 {
     if (!tbStart.IsValid || !tbEnd.IsValid)
     {
         //MessageBox.Show("Please input valid values.");
         MetroSetMessageBox.Show(this, "请输入正确的值");
         return;
     }
     if (tbStart.Value > tbEnd.Value)
     {
         //MessageBox.Show("Start value can not be bigger than end value.");
         MetroSetMessageBox.Show(this, "起始点不可以大于结束点.");
         return;
     }
     loopPassCmdLine.Start = tbStart.Value;
     loopPassCmdLine.End   = tbEnd.Value;
     if (isCreating)
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, loopPassCmdLine, new NextLoopCmdLine());
     }
     else
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, loopPassCmdLine);
     }
     if (!this.isCreating)
     {
         if (this.loopPassCmdLine != null && this.loopPassCmdLineBackUp != null)
         {
             CompareObj.CompareField(this.loopPassCmdLine, this.loopPassCmdLineBackUp, null, this.GetType().Name, true);
         }
     }
 }
示例#6
0
 private void btnOk_Click(object sender, System.EventArgs e)
 {
     if (!tbX.IsValid || !tbY.IsValid)
     {
         //MessageBox.Show("Please input valid value.");
         MessageBox.Show("请输入正确的值.");
         return;
     }
     moveAbsXyCmdLine.MoveType   = this.getMoveType();
     moveAbsXyCmdLine.Position.X = tbX.Value;
     moveAbsXyCmdLine.Position.Y = tbY.Value;
     if (isCreating)
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, moveAbsXyCmdLine);
     }
     else
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, moveAbsXyCmdLine);
     }
     Properties.Settings.Default.absX = moveAbsXyCmdLine.Position.X;
     Properties.Settings.Default.absY = moveAbsXyCmdLine.Position.Y;
     if (!this.isCreating)
     {
         Close();
         if (this.moveAbsXyCmdLine != null && this.moveAbsXyCmdLineBackUp != null)
         {
             CompareObj.CompareField(this.moveAbsXyCmdLine, this.moveAbsXyCmdLineBackUp, null, this.GetType().Name, true);
         }
     }
 }
示例#7
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            string patternName = tbPatternName.Text.Trim();

            if (!tbOriginX.IsValid || !tbOriginY.IsValid)
            {
                //MessageBox.Show("Please input valid origin values.");
                MessageBox.Show("请输入正确的原点坐标.");
                return;
            }

            if (pattern is Workpiece)
            {
                Workpiece w = pattern as Workpiece;
                w.OriginPos.X = tbOriginX.Value;
                w.OriginPos.Y = tbOriginY.Value;
                FluidProgram.Current.GetWorkPieceCmdLine().Origin.X = tbOriginX.Value;
                FluidProgram.Current.GetWorkPieceCmdLine().Origin.Y = tbOriginY.Value;
                CompareObj.CompareField(w.OriginPos, workPieceOrgBackUp, null, this.GetType().Name, true);
            }
            else
            {
                //机械坐标->系统坐标
                PointD p = this.workpiece.SystemRel(tbOriginX.Value, tbOriginY.Value);
                pattern.Origin.X = p.X;
                pattern.Origin.Y = p.Y;
                CompareObj.CompareField(p, patternOrgBackUp, null, this.GetType().Name, true);
            }

            MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_PATTREN_ORIGIN, null, null);

            DialogResult = DialogResult.OK;
            Close();
        }
示例#8
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (lineCoordinateCache.Count <= 0)
            {
                //MessageBox.Show("Line points is empty.");
                MessageBox.Show("线轨迹点个数不可以为0.");
                return;
            }
            lineCmdLine.LineCoordinateList.Clear();
            lineCmdLine.LineCoordinateList.AddRange(lineCoordinateCache);
            lineCmdLine.IsWeightControl = cbWeightControl.Checked;

            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, lineCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, lineCmdLine);
            }

            int count = lineCmdLine.LineCoordinateList.Count;

            if (count > 0)
            {
                LineCoordinate lineCoordinate = lineCmdLine.LineCoordinateList[count - 1];
                Properties.Settings.Default.LineStartX = lineCoordinate.Start.X;
                Properties.Settings.Default.LineStartY = lineCoordinate.Start.Y;
                Properties.Settings.Default.LineEndX   = lineCoordinate.End.X;
                Properties.Settings.Default.LineEndY   = lineCoordinate.End.Y;
                Properties.Settings.Default.LineStyle  = (int)lineCmdLine.LineStyle;
                Properties.Settings.Default.LineIsWt   = lineCmdLine.IsWeightControl;
                Properties.Settings.Default.LineWt     = lineCmdLine.WholeWeight;
            }
            if (Machine.Instance.Valve1.RunMode == ValveRunMode.AdjustLine)
            {
                Line.WaitMsg.Set();
            }
            if (!this.isCreating)
            {
                Close();
                if (this.lineCmdLine != null && this.lineCmdLineBackUp != null)
                {
                    CompareObj.CompareField(this.lineCmdLine, this.lineCmdLineBackUp, null, this.GetType().Name, true);
                    CompareObj.CompareProperty(this.lineCmdLine, this.lineCmdLineBackUp, null, this.GetType().Name, true);
                    if (this.lineCmdLine.LineCoordinateList.Count == this.lineCmdLineBackUp.LineCoordinateList.Count)
                    {
                        for (int i = 0; i < this.lineCmdLine.LineCoordinateList.Count; i++)
                        {
                            string pathRoot = this.GetType().Name + "\\lineCmdLine\\" + "LineCoordinateList: " + i.ToString();
                            CompareObj.CompareField(this.lineCmdLine.LineCoordinateList[i], this.lineCmdLineBackUp.LineCoordinateList[i], null, pathRoot, true);
                        }
                    }
                }
            }
        }
示例#9
0
 private void EditDotParamsForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (FluidProgram.Current != null && this.dotParamList != null && this.dotParamListBackUp != null)
     {
         for (int i = 0; i < this.dotParamList.Count; i++)
         {
             CompareObj.CompareField(this.dotParamList[i], this.dotParamListBackUp[i], null, this.GetType().Name);
         }
     }
 }
示例#10
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!tbX.IsValid || !tbY.IsValid)
            {
                //MessageBox.Show("Please input valid values.");
                MessageBox.Show("请输入正确的参数.");
                return;
            }
            this.DialogResult = DialogResult.OK;
            Close();
            MsgCenter.Broadcast(Constants.MSG_TEACH_CONVEYOR2_ORIGIN, null, tbX.Value, tbY.Value);

            CompareObj.CompareField(new PointD(tbX.Value, tbY.Value), Conveyor2OriginOffsetBackUp, null, this.GetType().Name, true);
        }
示例#11
0
 private void btnOk_Click(object sender, System.EventArgs e)
 {
     if (!tbIndex.IsValid)
     {
         //MessageBox.Show("Please input valid value.");
         MetroSetMessageBox.Show(this, "请输入正确的值.");
         return;
     }
     startPassCmdLine.Index = tbIndex.Value;
     MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, startPassCmdLine);
     if (this.startPassCmdLine != null && this.startPassCmdLineBackUp != null)
     {
         CompareObj.CompareField(this.startPassCmdLine, this.startPassCmdLineBackUp, null, this.GetType().Name, true);
     }
 }
示例#12
0
 private void btnTeach_Click(object sender, EventArgs e)
 {
     if (this.inspection == null)
     {
         return;
     }
     this.inspection.PosInMachine.X = Machine.Instance.Robot.PosX;
     this.inspection.PosInMachine.Y = Machine.Instance.Robot.PosY;
     tbLocationX.Text = this.inspection.PosInMachine.X.ToString("0.000");
     tbLocationY.Text = this.inspection.PosInMachine.Y.ToString("0.000");
     //this.inspection.ExposureTime = this.cameraControl1.ExposureTime;
     //this.inspection.Gain = this.cameraControl1.Gain;
     //this.inspection.LightType = this.cameraControl1.Lighting;
     CompareObj.CompareField(this.inspection, this.inspectionBackUp, null, this.GetType().Name, true);
 }
示例#13
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     commentCmdLine.Content = tbContent.Text;
     if (isCreating)
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, commentCmdLine);
     }
     else
     {
         MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, commentCmdLine);
     }
     Close();
     if (this.commentCmdLine != null && this.commentCmdLineBackUp != null)
     {
         CompareObj.CompareField(this.commentCmdLine, this.commentCmdLineBackUp, null, this.GetType().Name, true);
     }
 }
示例#14
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (!tbLocationX.IsValid || !tbLocationY.IsValid || !tbWeight.IsValid)
            {
                //MessageBox.Show("Please input valid values.");
                MessageBox.Show("请输入正确的值");
                return;
            }
            //机械坐标->系统坐标
            PointD p = this.pattern.SystemRel(tbLocationX.Value, tbLocationY.Value);

            dotCmdLine.Position.X      = p.X;
            dotCmdLine.Position.Y      = p.Y;
            dotCmdLine.DotStyle        = (DotStyle)comboBoxDotType.SelectedIndex;
            dotCmdLine.IsWeightControl = cbWeightControl.Checked;
            dotCmdLine.Weight          = tbWeight.Value;
            dotCmdLine.IsAssign        = this.ckbShotNums.Checked;
            dotCmdLine.NumShots        = int.Parse(this.tbShots.Text);
            dotCmdLine.Tilt            = (TiltType)this.cbTiltType.SelectedIndex;
            if (!this.cbTiltType.Visible)
            {
                dotCmdLine.Tilt = 0;
            }
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, dotCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, dotCmdLine);
            }
            Properties.Settings.Default.DotX     = dotCmdLine.Position.X;
            Properties.Settings.Default.DotY     = dotCmdLine.Position.Y;
            Properties.Settings.Default.DotStyle = (int)dotCmdLine.DotStyle;
            Properties.Settings.Default.DotIsWt  = dotCmdLine.IsWeightControl;
            Properties.Settings.Default.DotWt    = dotCmdLine.Weight;
            if (!this.isCreating)
            {
                Close();
            }
            if (this.dotCmdLine != null && this.dotCmdLineBackUp != null)
            {
                CompareObj.CompareField(this.dotCmdLine, this.dotCmdLineBackUp, null, this.GetType().Name, true);
                CompareObj.CompareProperty(this.dotCmdLine, this.dotCmdLineBackUp, null, this.GetType().Name, true);
            }
        }
示例#15
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (listBoxPatterns.Items.Count <= 0)
            {
                //MessageBox.Show("No pattern is available!");
                MessageBox.Show("没有合适的拼版");
                return;
            }
            if (listBoxPatterns.SelectedItem == null)
            {
                MessageBox.Show("没有选择拼版");
                return;
            }
            if (!tbOriginX.IsValid || !tbOriginY.IsValid)
            {
                MessageBox.Show("请输入正确的原点值");
                return;
            }
            doMultipassCmdLine.PatternName = patternNameList[listBoxPatterns.SelectedIndex];
            //机械坐标->系统坐标
            PointD p = this.pattern.SystemRel(tbOriginX.Value, tbOriginY.Value);

            doMultipassCmdLine.Origin.X = p.X;
            doMultipassCmdLine.Origin.Y = p.Y;
            doMultipassCmdLine.Valve    = (ValveType)this.cbxValveType.SelectedItem;
            doMultipassCmdLine.BoardNo  = this.txtBoardNo.Value;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, doMultipassCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, doMultipassCmdLine);
            }
            if (!this.isCreating)
            {
                Close();
            }
            if (this.doMultipassCmdLine != null && this.doMultipassCmdLineBackUp != null)
            {
                CompareObj.CompareField(this.doMultipassCmdLine, this.doMultipassCmdLineBackUp, null, this.Tag, true);
                CompareObj.CompareProperty(this.doMultipassCmdLine, this.doMultipassCmdLineBackUp, null, this.Tag, true);
            }
        }
示例#16
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //string tipText = "End Pos cannot be smaller than Start Pos";
            string tipText = "终点坐标不能小于起点坐标";

            if (tbxLotEndPos.Value < tbxLotStartPos.Value)
            {
                MessageBox.Show(tipText);
                return;
            }
            this.fluidProgram.RuntimeSettings.LotId         = this.tbxLotID.Text;
            this.fluidProgram.RuntimeSettings.LotIdStartPos = tbxLotStartPos.Value;
            this.fluidProgram.RuntimeSettings.LotIdEndPos   = tbxLotEndPos.Value;
            this.Close();
            if (this.fluidProgram.RuntimeSettings != null && this.runtimeSettingsBackUp != null)
            {
                CompareObj.CompareField(this.fluidProgram.RuntimeSettings, this.runtimeSettingsBackUp, null, this.GetType().Name);
                CompareObj.CompareProperty(this.fluidProgram.RuntimeSettings, this.runtimeSettingsBackUp, null, this.GetType().Name);
            }
        }
示例#17
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (listBoxPatterns.Items.Count <= 0)
            {
                //MessageBox.Show("No pattern is available!");
                MetroSetMessageBox.Show(this, "没有合适的拼版");
                return;
            }
            if (listBoxPatterns.SelectedItem == null)
            {
                //MessageBox.Show("No pattern is selected!");
                MetroSetMessageBox.Show(this, "没有选择拼版");
                return;
            }
            if (!tbOriginX.IsValid || !tbOriginY.IsValid)
            {
                //MessageBox.Show("Please input valid origin values.");
                MetroSetMessageBox.Show(this, "请输入正确的原点值");
                return;
            }
            doCmdLine.PatternName = patternNameList[listBoxPatterns.SelectedIndex];
            //机械坐标->系统坐标
            PointD p = this.pattern.SystemRel(tbOriginX.Value, tbOriginY.Value);

            doCmdLine.Origin.X = p.X;
            doCmdLine.Origin.Y = p.Y;
            doCmdLine.Reverse  = this.ckbReverse.Checked;
            doCmdLine.Valve    = (ValveType)this.cbxValveType.SelectedItem;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, doCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, doCmdLine);
            }
            if (!this.isCreating)
            {
                CompareObj.CompareField(doCmdLine, doCmdLineBackUp, null, this.GetType().Name, true);
            }
        }
示例#18
0
        private void btnChange_Click(object sender, EventArgs e)
        {
            if (!tbX.IsValid || !tbY.IsValid)
            {
                //MessageBox.Show("Please input valid values.");
                MessageBox.Show("请输入正确的参数.");
                return;
            }
            if (listBoxDefs.SelectedItem == null)
            {
                return;
            }
            int selectedIndex = listBoxDefs.SelectedIndex;

            this.selectedUserPosition.Position.X = tbX.Value;
            this.selectedUserPosition.Position.Y = tbY.Value;
            this.selectedUserPosition.MoveType   = this.getMoveType();
            this.updateList();
            listBoxDefs.SelectedIndex = selectedIndex;
            CompareObj.CompareField(this.selectedUserPosition, this.selectedUserPositionBackUp, null, this.GetType().Name, true);
        }
示例#19
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (!tbX.IsValid || !tbY.IsValid)
     {
         //MessageBox.Show("Please input valid values.");
         MessageBox.Show("请输入合理的值");
         return;
     }
     this.fluidProgram.RuntimeSettings.HeightPosX          = tbX.Value;
     this.fluidProgram.RuntimeSettings.HeightPosY          = tbY.Value;
     this.fluidProgram.RuntimeSettings.StandardBoardHeight = this.heightControl1.BoardHeight;
     this.fluidProgram.RuntimeSettings.MaxTolerance        = this.heightControl1.MaxTolerance;
     this.fluidProgram.RuntimeSettings.MinTolerance        = this.heightControl1.MinTolerance;
     this.DialogResult = DialogResult.OK;
     this.Close();
     if (FluidProgram.Current.RuntimeSettings != null && this.runtimeSettingsBackUp != null)
     {
         CompareObj.CompareProperty(FluidProgram.Current.RuntimeSettings, this.runtimeSettingsBackUp, false);
         CompareObj.CompareField(FluidProgram.Current.RuntimeSettings, this.runtimeSettingsBackUp, null, this.GetType().Name, false);
     }
 }
示例#20
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (!tbLocationX.IsValid || !tbLocationY.IsValid)
            {
                //MessageBox.Show("Please input valid values.");
                MetroSetMessageBox.Show(this, "请输入正确的值");
                return;
            }
            //机械坐标->系统坐标
            PointD dotMap = this.pattern.SystemRel(tbLocationX.Value, tbLocationY.Value);

            finishShotCmdLine.Position.X      = dotMap.X;
            finishShotCmdLine.Position.Y      = dotMap.Y;
            finishShotCmdLine.DotStyle        = (DotStyle)comboBoxDotType.SelectedIndex;
            finishShotCmdLine.IsWeightControl = false;
            finishShotCmdLine.Weight          = 0;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, finishShotCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, finishShotCmdLine);
            }
            Properties.Settings.Default.DotX     = finishShotCmdLine.Position.X;
            Properties.Settings.Default.DotY     = finishShotCmdLine.Position.Y;
            Properties.Settings.Default.DotStyle = (int)finishShotCmdLine.DotStyle;
            if (this.isCreating)
            {
                return;
            }
            if (this.finishShotCmdLine != null && this.finishShotCmdLineBackUp != null)
            {
                CompareObj.CompareProperty(this.finishShotCmdLine, this.finishShotCmdLineBackUp, null, this.GetType().Name, true);
                CompareObj.CompareField(this.finishShotCmdLine, this.finishShotCmdLineBackUp, null, this.GetType().Name, true);
            }
        }
示例#21
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            string patternName = tbPatternName.Text.Trim();

            if (!tbOriginX.IsValid || !tbOriginY.IsValid)
            {
                //MessageBox.Show("Please input valid origin values.");
                MetroSetMessageBox.Show(this, "请输入正确的原点坐标.");
                return;
            }

            if (pattern is Workpiece)
            {
                Workpiece w = pattern as Workpiece;
                w.OriginPos.X = tbOriginX.Value;
                w.OriginPos.Y = tbOriginY.Value;
                FluidProgram.Current.GetWorkPieceCmdLine().Origin.X = tbOriginX.Value;
                FluidProgram.Current.GetWorkPieceCmdLine().Origin.Y = tbOriginY.Value;
                CompareObj.CompareField(w.OriginPos, workPieceOrgBackUp, null, this.GetType().Name, true);
            }
            else
            {
                //机械坐标->系统坐标
                PointD p = this.workpiece.SystemRel(tbOriginX.Value, tbOriginY.Value);
                pattern.Origin.X = p.X;
                pattern.Origin.Y = p.Y;
                CompareObj.CompareField(p, patternOrgBackUp, null, this.GetType().Name, true);
            }

            MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_PATTREN_ORIGIN, null, null);
            MsgCenter.Broadcast(MsgDef.MSG_PARAMPAGE_CLEAR, null);

            Log.Print("change pattern origin to : " + pattern.Origin);
            // 移动到新原点位置
            Machine.Instance.Robot.MoveSafeZ();
            Machine.Instance.Robot.ManualMovePosXY(pattern.GetOriginPos());
        }
示例#22
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!tbX.IsValid)
            {
                //MessageBox.Show("Please input a double number for X.");
                MessageBox.Show("请在X方向输入一个小数.");
                return;
            }
            if (!tbY.IsValid)
            {
                MessageBox.Show("请在Y方向输入一个小数.");
                return;
            }
            PointD p = this.pattern.SystemRel(this.tbX.Value, this.tbY.Value);

            this.moveXyCmdLine.Position.X = p.X;
            this.moveXyCmdLine.Position.Y = p.Y;
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, moveXyCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, moveXyCmdLine);
            }
            Properties.Settings.Default.MoveX = this.moveXyCmdLine.Position.X;
            Properties.Settings.Default.MoveY = this.moveXyCmdLine.Position.Y;
            if (!this.isCreating)
            {
                Close();
                if (this.moveXyCmdLine != null && this.moveXyCmdLineBackUp != null)
                {
                    CompareObj.CompareField(this.moveXyCmdLine, this.moveXyCmdLineBackUp, null, this.GetType().Name, true);
                }
            }
        }
示例#23
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (listBoxPatterns.SelectedIndex < 0)
            {
                //MessageBox.Show("No Pattern is selected.");
                MetroSetMessageBox.Show(this, "请选择一个拼版.");
                return;
            }
            if (!tbHNums.IsValid || !tbVNums.IsValid || !tbOriginX.IsValid || !tbOriginY.IsValid ||
                !tbHEndX.IsValid || !tbHEndY.IsValid || !tbVEndX.IsValid || !tbVEndY.IsValid)
            {
                //MessageBox.Show("Please input valid values.");
                MetroSetMessageBox.Show(this, "请输入正确的参数.");
                return;
            }
            if (tbVNums.Value < 1)
            {
                //MessageBox.Show("Vertical Nums can not be smaller than 1.");
                MetroSetMessageBox.Show(this, "纵向拼版数不可以小于 1.");
                return;
            }
            if (tbHNums.Value < 1)
            {
                //MessageBox.Show("Horizontal Nums can not be smaller than 1.");
                MetroSetMessageBox.Show(this, "横向拼版个数不可以小于1.");
                return;
            }
            if (tbHNums.Value * tbVNums.Value == 1)
            {
                MetroSetMessageBox.Show(this, "拼版数量不可以等于1.");
                return;
            }
            if (tbOriginX.Value == tbHEndX.Value && tbOriginY.Value == tbHEndY.Value)
            {
                //MessageBox.Show("Origin can not be same with horizontal end.");
                if (tbVNums.Value == 1 || tbHNums.Value != 1)
                {
                    MetroSetMessageBox.Show(this, "原点坐标和横向终点坐标不可以相同");
                    return;
                }
            }
            if (tbOriginX.Value == tbVEndX.Value && tbOriginY.Value == tbVEndY.Value)
            {
                //MessageBox.Show("Origin can not be same with vertical end.");
                if (tbHNums.Value == 1 || tbVNums.Value != 1)
                {
                    MetroSetMessageBox.Show(this, "原点坐标和纵向终点坐标不可以相同");
                    return;
                }
            }
            if (tbHEndX.Value == tbVEndX.Value && tbHEndY.Value == tbVEndY.Value)
            {
                //MessageBox.Show("Horizontal end can not be same with vertical end.");
                if (tbHNums.Value != 1 && tbVNums.Value != 1)
                {
                    MetroSetMessageBox.Show(this, "横向终点和纵向终点不能相同");
                    return;
                }
            }
            stepAndRepeatCmdLine.PatternName = patternNameList[listBoxPatterns.SelectedIndex];
            //机械坐标->系统坐标
            PointD pO = this.pattern.SystemRel(tbOriginX.Value, tbOriginY.Value);
            PointD pH = this.pattern.SystemRel(tbHEndX.Value, tbHEndY.Value);
            PointD pV = this.pattern.SystemRel(tbVEndX.Value, tbVEndY.Value);

            stepAndRepeatCmdLine.Origin.X        = pO.X;
            stepAndRepeatCmdLine.Origin.Y        = pO.Y;
            stepAndRepeatCmdLine.HorizontalEnd.X = pH.X;
            stepAndRepeatCmdLine.HorizontalEnd.Y = pH.Y;
            stepAndRepeatCmdLine.VerticalEnd.X   = pV.X;
            stepAndRepeatCmdLine.VerticalEnd.Y   = pV.Y;
            stepAndRepeatCmdLine.HorizontalNums  = tbHNums.Value;
            stepAndRepeatCmdLine.VerticalNums    = tbVNums.Value;
            stepAndRepeatCmdLine.DoCmdLineList.Clear();
            foreach (PatternItem item in patternItems)
            {
                DoCmdLine doCmdLine = new DoCmdLine(stepAndRepeatCmdLine.PatternName, item.Point.X, item.Point.Y)
                {
                    Enabled = item.Enabled, Reverse = item.Reverse
                };
                doCmdLine.Valve = item.Valve;
                stepAndRepeatCmdLine.DoCmdLineList.Add(doCmdLine);
            }
            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, stepAndRepeatCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, stepAndRepeatCmdLine);
            }

            CompareObj.CompareField(this.stepAndRepeatCmdLine, this.stepAndRepeatCmdLineBackUp, null, this.GetType().Name, true);
            if (this.stepAndRepeatCmdLineBackUp.DoCmdLineList != null && this.stepAndRepeatCmdLine.DoCmdLineList != null)
            {
                if (this.stepAndRepeatCmdLineBackUp.DoCmdLineList.Count == this.stepAndRepeatCmdLine.DoCmdLineList.Count)
                {
                    for (int i = 0; i < this.stepAndRepeatCmdLine.DoCmdLineList.Count; i++)
                    {
                        string pathRoot = this.GetType().Name + "\\stepAndRepeatCmdLine\\DoCmdLineList";
                        CompareObj.CompareField(this.stepAndRepeatCmdLine.DoCmdLineList[i], this.stepAndRepeatCmdLineBackUp.DoCmdLineList[i], null, pathRoot, true);
                    }
                }
            }
        }
示例#24
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (cbWeightControl.Checked && !tbWeight.IsValid)
            {
                //MessageBox.Show("Please input valid weight values.");
                MetroSetMessageBox.Show(this, "请输入合理的胶重.");
                return;
            }
            if (!tbStartX.IsValid || !tbStartY.IsValid || !tbEndX.IsValid || !tbEndY.IsValid)
            {
                //MessageBox.Show("Please input valid values.");
                MetroSetMessageBox.Show(this, "请输入正确的起始点和结束点值.");
                return;
            }
            if (tbStartX.Value == tbEndX.Value && tbStartY.Value == tbEndY.Value)
            {
                //MessageBox.Show("Start point cannot be same with end point.");
                MetroSetMessageBox.Show(this, "起始点和结束点不可以相同.");
                return;
            }

            PointD startMap = this.pattern.SystemRel(tbStartX.Value, tbStartY.Value);
            PointD endMap   = this.pattern.SystemRel(tbEndX.Value, tbEndY.Value);

            this.lineCoordinate.Start.X   = startMap.X;
            this.lineCoordinate.Start.Y   = startMap.Y;
            this.lineCoordinate.End.X     = endMap.X;
            this.lineCoordinate.End.Y     = endMap.Y;
            this.lineCoordinate.Weight    = tbWeight.Value;
            this.lineCoordinate.LineStyle = (LineStyle)comboBoxLineType.SelectedIndex;

            lineCmdLine.LineCoordinateList.Clear();
            lineCmdLine.LineCoordinateList.Add(this.lineCoordinate);
            lineCmdLine.LineStyle       = (LineStyle)comboBoxLineType.SelectedIndex;
            lineCmdLine.IsWeightControl = cbWeightControl.Checked;
            if (lineCmdLine.IsWeightControl)
            {
                lineCmdLine.WholeWeight = tbWeight.Value;
            }

            if (Machine.Instance.Valve1.RunMode == ValveRunMode.AdjustLine)
            {
                //保存调整值
                if (pattern.IsReversePattern)
                {
                    this.lineCoordinate.LookOffsetRevs = this.offset;
                }
                else
                {
                    this.lineCoordinate.LookOffset = this.offset;
                }
            }

            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, lineCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, lineCmdLine);
            }

            Properties.Settings.Default.LineStartX = this.lineCoordinate.Start.X;
            Properties.Settings.Default.LineStartY = this.lineCoordinate.Start.Y;
            Properties.Settings.Default.LineEndX   = this.lineCoordinate.End.X;
            Properties.Settings.Default.LineEndY   = this.lineCoordinate.End.Y;
            Properties.Settings.Default.LineStyle  = (int)lineCmdLine.LineStyle;
            Properties.Settings.Default.LineIsWt   = lineCmdLine.IsWeightControl;
            Properties.Settings.Default.LineWt     = lineCmdLine.WholeWeight;

            if (Machine.Instance.Valve1.RunMode == ValveRunMode.AdjustLine)
            {
                Line.WaitMsg.Set();
            }

            if (this.isCreating)
            {
                return;
            }
            if (this.lineCmdLine != null && this.lineCmdLineBackUp != null)
            {
                CompareObj.CompareField(this.lineCmdLine, this.lineCmdLineBackUp, null, this.GetType().Name, true);
                CompareObj.CompareProperty(this.lineCmdLine, this.lineCmdLineBackUp, null, this.GetType().Name, true);
                for (int i = 0; i < this.lineCmdLine.LineCoordinateList.Count; i++)
                {
                    string pathRoot = this.GetType().Name + "\\lineCmdLine\\" + "LineCoordinateList: " + i.ToString();
                    CompareObj.CompareField(this.lineCmdLine.LineCoordinateList[i], this.lineCmdLineBackUp.LineCoordinateList[i], null, pathRoot, true);
                }
            }
        }
示例#25
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!tbStartIndex.IsValid)
            {
                //MessageBox.Show("Please input integer number for start index.");
                MessageBox.Show("请输入起始值");
                return;
            }
            if (!tbEndIndex.IsValid)
            {
                //MessageBox.Show("Please input integer number for end index.");
                MessageBox.Show("请输入结束值");
                return;
            }
            if (tbStartIndex.Value > tbEndIndex.Value)
            {
                //MessageBox.Show("Start index can not be bigger than end index.");
                MessageBox.Show("起始值不可以大于结束值");
                return;
            }

            int startIndex = tbStartIndex.Value;
            int endIndex   = tbEndIndex.Value;

            Properties.Settings.Default.passBlockStart = startIndex;
            Properties.Settings.Default.passBlockEnd   = endIndex;

            if (isCreating)
            {
                this.passBlockCmdLine = new PassBlockCmdLine(startIndex, endIndex);
                List <CmdLine> cmdLineList = new List <CmdLine>();
                cmdLineList.Add(passBlockCmdLine);
                for (int i = startIndex; i <= endIndex; i++)
                {
                    cmdLineList.Add(new StartPassCmdLine(i));
                    cmdLineList.Add(new EndPassCmdLine());
                }
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, cmdLineList.ToArray());
            }
            else
            {
                this.passBlockCmdLine.StartIndex = startIndex;
                this.passBlockCmdLine.EndIndex   = endIndex;

                List <CmdLine> cmdLineList = this.passBlockCmdLine.CommandsModule.CmdLineList;
                //保存StartPassCmdLine的[passIndex, listIndex]
                Dictionary <int, int> startIndexes = new Dictionary <int, int>();
                //保存EndPassCmdLine的[passIndex, listIndex]
                Dictionary <int, int> endIndexes = new Dictionary <int, int>();
                int startIndexMin = 0;
                int startIndexMax = 0;

                //获取所有的StartPassCmdLine和EndPassCmdLine的[passIndex, listIndex]
                Action getStartEndIndexes = () =>
                {
                    startIndexes.Clear();
                    endIndexes.Clear();
                    int tempIndex = 0;
                    foreach (var item in cmdLineList)
                    {
                        if (item is StartPassCmdLine)
                        {
                            StartPassCmdLine startPassCmdLine = item as StartPassCmdLine;
                            startIndexes.Add(startPassCmdLine.Index, cmdLineList.IndexOf(item));
                            tempIndex = startPassCmdLine.Index;
                        }
                        else if (item is EndPassCmdLine)
                        {
                            EndPassCmdLine endPassCmdLine = item as EndPassCmdLine;
                            endIndexes.Add(tempIndex, cmdLineList.IndexOf(item));
                        }
                    }
                    startIndexMin = startIndexes.Keys.Min();
                    startIndexMax = startIndexes.Keys.Max();
                };

                getStartEndIndexes();
                if (startIndex < startIndexMin)
                {//起始index小于初始值
                    List <CmdLine> newLines = new List <CmdLine>();
                    for (int i = startIndex; i < startIndexMin; i++)
                    {
                        newLines.Add(new StartPassCmdLine(i));
                        newLines.Add(new EndPassCmdLine());
                    }
                    MsgCenter.Broadcast(Constants.MSG_FINISH_INSERTING_CMD_LINE, this, 1, newLines);
                    MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, this.passBlockCmdLine);
                }
                else if (startIndex > startIndexMin)
                {//起始index大于初始值
                    List <int> indexes = new List <int>();
                    for (int i = 1; i < startIndexes[startIndex]; i++)
                    {
                        indexes.Add(i);
                    }
                    MsgCenter.Broadcast(Constants.MSG_FINISH_DELETING_CMD_LINE, this, indexes[0], indexes.Count);
                    MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, this.passBlockCmdLine);
                }

                getStartEndIndexes();
                if (endIndex > startIndexMax)
                {//结束index大于初始值
                    List <CmdLine> newLines = new List <CmdLine>();
                    for (int i = startIndexMax + 1; i <= endIndex; i++)
                    {
                        newLines.Add(new StartPassCmdLine(i));
                        newLines.Add(new EndPassCmdLine());
                    }
                    MsgCenter.Broadcast(Constants.MSG_FINISH_INSERTING_CMD_LINE, this, endIndexes[startIndexMax] + 1, newLines);
                    MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, this.passBlockCmdLine);
                }
                else if (endIndex < startIndexMax)
                {//结束index小于初始值
                    List <int> indexes = new List <int>();
                    for (int i = endIndexes[endIndex] + 1; i <= endIndexes[startIndexMax]; i++)
                    {
                        indexes.Add(i);
                    }
                    MsgCenter.Broadcast(Constants.MSG_FINISH_DELETING_CMD_LINE, this, indexes[0], indexes.Count);
                    MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, this.passBlockCmdLine);
                }
            }
            Close();
            if (this.passBlockCmdLine != null && this.passBlockCmdLineBackUp != null)
            {
                CompareObj.CompareProperty(this.passBlockCmdLine, this.passBlockCmdLineBackUp, null, this.GetType().Name, true);
                CompareObj.CompareField(this.passBlockCmdLine, this.passBlockCmdLineBackUp, null, this.GetType().Name, true);
            }
        }
示例#26
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (!tbLineNumbers.IsValid ||
                !tbP1X.IsValid || !tbP1Y.IsValid ||
                !tbP2X.IsValid || !tbP2Y.IsValid ||
                !tbP3X.IsValid || !tbP3Y.IsValid ||
                tbLineNumbers.Value < 2 ||
                (tbP1X.Value == tbP2X.Value && tbP1Y.Value == tbP2Y.Value) ||
                (tbP1X.Value == tbP3X.Value && tbP1Y.Value == tbP3Y.Value) ||
                (tbP2X.Value == tbP3X.Value && tbP2Y.Value == tbP3Y.Value))
            {
                //MessageBox.Show("please input valid values.");
                MessageBox.Show("请输入正确的点1、点2、点3的值.");
                return;
            }
            if (lineCoordinateCache.Count <= 0)
            {
                //MessageBox.Show("Line points is empty.");
                MessageBox.Show("线轨迹上点个数不可以小于0.");
                return;
            }
            //机械坐标->系统坐标
            PointD p1 = pattern.SystemRel(tbP1X.Value, tbP1Y.Value);
            PointD p2 = pattern.SystemRel(tbP2X.Value, tbP2Y.Value);
            PointD p3 = pattern.SystemRel(tbP3X.Value, tbP3Y.Value);

            if (MathUtils.IsInOneLine(p1, p2, p3))
            {
                //MessageBox.Show("The three points cannot be in one line.");
                MessageBox.Show("三点不可以在同一条线轨迹上.");
                return;
            }
            snakeLineCmdLine.LineNumbers = tbLineNumbers.Value;
            snakeLineCmdLine.Point1.X    = p1.X;
            snakeLineCmdLine.Point1.Y    = p1.Y;
            snakeLineCmdLine.Point2.X    = p2.X;
            snakeLineCmdLine.Point2.Y    = p2.Y;
            snakeLineCmdLine.Point3.X    = p3.X;
            snakeLineCmdLine.Point3.Y    = p3.Y;
            snakeLineCmdLine.LineCoordinateList.Clear();
            snakeLineCmdLine.LineCoordinateList.AddRange(lineCoordinateCache);
            snakeLineCmdLine.IsWeightControl = cbWeightControl.Checked;
            snakeLineCmdLine.IsContinuous    = this.chkContinuous.Checked;

            if (isCreating)
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, snakeLineCmdLine);
            }
            else
            {
                MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, snakeLineCmdLine);
            }
            if (!this.isCreating)
            {
                Close();
                if (this.snakeLineCmdLine != null && this.snakeLineCmdLineBackUp != null)
                {
                    CompareObj.CompareField(this.snakeLineCmdLine, this.snakeLineCmdLineBackUp, null, this.GetType().Name, true);
                    for (int i = 0; i < this.snakeLineCmdLine.LineCoordinateList.Count; i++)
                    {
                        string pathRoot = this.GetType().Name + "\\snakeLineCmdLine\\LineCoordinateList";
                        CompareObj.CompareField(this.snakeLineCmdLine.LineCoordinateList[i], this.snakeLineCmdLineBackUp.LineCoordinateList[i], null, pathRoot, true);
                    }
                }
            }
        }
示例#27
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if ((double)this.nudSingleDotWt.Value <= 0)
            {
                this.tabControl1.SelectedTab  = this.tabPage1;
                this.nudSingleDotWt.BackColor = Color.Red;
                return;
            }
            this.nudSingleDotWt.BackColor = System.Drawing.SystemColors.Window;
            this.fluidProgram.RuntimeSettings.SingleDropWeight = (double)this.nudSingleDotWt.Value;

            // 设置气压1
            if (this.fluidProgram.RuntimeSettings.AirPressure != (int)this.nudAirPressure.Value)
            {
                this.fluidProgram.RuntimeSettings.AirPressure = (int)this.nudAirPressure.Value;
                Machine.Instance.Valve1.Proportioner.Proportional.SetValue((ushort)this.nudAirPressure.Value);
            }
            // 设置气压2
            if (Machine.Instance.Setting.ValveSelect == ValveSelection.双阀)
            {
                if (this.fluidProgram.RuntimeSettings.AirPressure2 != (int)this.nudAirPressure2.Value)
                {
                    this.fluidProgram.RuntimeSettings.AirPressure2 = (int)this.nudAirPressure2.Value;
                    Proportioner.Sleep();
                    Machine.Instance.Valve2.Proportioner.Proportional.SetValue((ushort)this.nudAirPressure2.Value);
                }
            }
            //设置温度
            if (this.fluidProgram.RuntimeSettings.Valve1Temperature != (double)this.nudValve1Temprature.Value)
            {
                this.fluidProgram.RuntimeSettings.Valve1Temperature      = (double)this.nudValve1Temprature.Value;
                Machine.Instance.HeaterController1.HeaterPrm.Standard[0] = this.fluidProgram.RuntimeSettings.Valve1Temperature;
                Machine.Instance.HeaterController1.Fire(HeaterMsg.设置标准温度值, (double)this.nudValve1Temprature.Value, 0);
            }
            if (Machine.Instance.Setting.ValveSelect == ValveSelection.双阀)
            {
                if (this.fluidProgram.RuntimeSettings.Valve2Temperature != (double)this.nudValve2Temprature.Value)
                {
                    this.fluidProgram.RuntimeSettings.Valve2Temperature = (double)this.nudValve2Temprature.Value;
                    if (SensorMgr.Instance.Heater.Vendor == HeaterControllerMgr.Vendor.Aika)
                    {
                        Machine.Instance.HeaterController1.HeaterPrm.Standard[1] = this.fluidProgram.RuntimeSettings.Valve2Temperature;
                        Machine.Instance.HeaterController1.Fire(HeaterMsg.设置标准温度值, (double)this.nudValve2Temprature.Value, 1);
                    }
                    else
                    {
                        Machine.Instance.HeaterController2.HeaterPrm.Standard[0] = this.fluidProgram.RuntimeSettings.Valve2Temperature;
                        Machine.Instance.HeaterController2.Fire(HeaterMsg.设置标准温度值, (double)this.nudValve2Temprature.Value, 0);
                    }
                }
            }

            this.fluidProgram.RuntimeSettings.isHalfAdjust  = this.cbxHalfAdjust.Checked;
            this.fluidProgram.RuntimeSettings.MaxTolerance  = (double)this.nudMaxHeight.Value;
            this.fluidProgram.RuntimeSettings.MinTolerance  = (double)this.nudMinHeight.Value;
            this.fluidProgram.RuntimeSettings.SimulDistence = (double)this.nudSimulDistence.Value;
            this.fluidProgram.RuntimeSettings.SimulOffsetX  = (double)this.nudSimulOffsetX.Value;
            this.fluidProgram.RuntimeSettings.SimulOffsetY  = (double)this.nudSimulOffsetY.Value;

            #region 称重清洗吐液,浸泡
            this.fluidProgram.RuntimeSettings.PurgeBeforeStart       = this.cbxPurge.Checked;
            this.fluidProgram.RuntimeSettings.ScaleBeforeStart       = this.cbxScale.Checked;
            this.fluidProgram.RuntimeSettings.IsAutoScaleSpan        = this.chxAutoScaleSpan.Checked;
            this.fluidProgram.RuntimeSettings.IsAutoScaleCount       = this.chxAutoScaleCount.Checked;
            this.fluidProgram.RuntimeSettings.AutoScaleCount         = (int)this.nudAutoScaleCount.Value;
            this.fluidProgram.RuntimeSettings.AutoScaleSpan          = new TimeSpan((int)this.nudAutoScaleHour.Value, (int)this.nudAutoScaleMinu.Value, (int)this.nudAutoScaleSeco.Value);
            this.fluidProgram.RuntimeSettings.IsAutoPurgeSpan        = this.chxAutoPurgeSpan.Checked;
            this.fluidProgram.RuntimeSettings.IsAutoPurgeCount       = this.chxAutoPurgeCount.Checked;
            this.fluidProgram.RuntimeSettings.AutoPurgeCount         = (int)this.nudAutoPurgeCount.Value;
            this.fluidProgram.RuntimeSettings.AutoPurgeSpan          = new TimeSpan((int)this.nudAutoPurgeHour.Value, (int)this.nudAutoPurgeMinu.Value, (int)this.nudAutoPurgeSeco.Value);
            this.fluidProgram.RuntimeSettings.IsSyncSingleDropWeight = this.ckbSync.Checked;

            this.fluidProgram.RuntimeSettings.AutoSoakSpan = new TimeSpan((int)this.nudDoSoakHour.Value, (int)this.nudDoSoakMin.Value, (int)this.nudDoSoakSec.Value);

            #endregion

            #region marks
            this.fluidProgram.RuntimeSettings.AutoSkipNgMarks       = this.chxAutoSkipNgMark.Checked;
            this.fluidProgram.RuntimeSettings.SaveMarkImages        = this.chxSaveMarkImages.Checked;
            this.fluidProgram.RuntimeSettings.SaveMeasureMentImages = this.ckbSaveMeasureImages.Checked;
            this.fluidProgram.RuntimeSettings.MarksSort             = this.ckbMarkSort.Checked;
            this.fluidProgram.RuntimeSettings.Back2WorkpieceOrigin  = this.chxBackToWorkpieceOrigin.Checked;
            this.fluidProgram.RuntimeSettings.MeasureCmdsSort       = this.ckbMeasureHeightSort.Checked;

            #endregion

            #region 飞拍参数
            this.fluidProgram.RuntimeSettings.isFlyMarks    = this.cbxFlyEnable.Checked;
            this.fluidProgram.RuntimeSettings.FlyIsRowFirst = this.cbxIsRowFirst.Checked;
            //如果飞拍运动参数改动需要重新校对飞拍校正值
            if (this.tbxFlySpeed.Value != this.fluidProgram.RuntimeSettings.FlySpeed ||
                this.tbxCornerSpeed.Value != this.fluidProgram.RuntimeSettings.FlyCornerSpeed ||
                this.tbxFlyAcc.Value != this.fluidProgram.RuntimeSettings.FlyAcc)
            {
                this.fluidProgram.RuntimeSettings.FlyOffsetIsValid = false;
            }
            this.fluidProgram.RuntimeSettings.FlySpeed           = this.tbxFlySpeed.Value;
            this.fluidProgram.RuntimeSettings.FlyAcc             = this.tbxFlyAcc.Value;
            this.fluidProgram.RuntimeSettings.FlyCornerSpeed     = this.tbxCornerSpeed.Value;
            this.fluidProgram.RuntimeSettings.FlyPreDistance     = this.tbxPreDistance.Value;
            this.fluidProgram.RuntimeSettings.isAdjustFlyOffset  = this.cbxAdjustFlyOffset.Checked;
            this.fluidProgram.RuntimeSettings.IsNGReshoot        = this.cbxNGReshoot.Checked;
            this.fluidProgram.RuntimeSettings.FlyOriginPos       = this.cbxFlyOriginPos.Checked;
            this.fluidProgram.RuntimeSettings.DisposeThreadCount = this.tbxThreadCount.Value;
            if (this.fluidProgram.RuntimeSettings.DisposeThreadCount < 1)
            {
                this.fluidProgram.RuntimeSettings.DisposeThreadCount = 1;
            }
            else if (this.fluidProgram.RuntimeSettings.DisposeThreadCount > 5)
            {
                this.fluidProgram.RuntimeSettings.DisposeThreadCount = 5;
            }
            #endregion

            #region 连续前瞻

            this.fluidProgram.RuntimeSettings.FluidMoveMode = rbnNormal.Checked ? FluidMoveMode.普通 : FluidMoveMode.连续;
            this.fluidProgram.RuntimeSettings.LookTime      = (double)this.nudLookTime.Value;
            this.fluidProgram.RuntimeSettings.LookAccMax    = (double)this.nudLookAccMax.Value;
            this.fluidProgram.RuntimeSettings.LookCount     = (int)this.nudLookCount.Value;

            #endregion

            #region 浸泡

            this.fluidProgram.RuntimeSettings.AutoSoakSpan = new TimeSpan((int)this.nudDoSoakHour.Value, (int)this.nudDoSoakMin.Value, (int)this.nudDoSoakSec.Value);

            this.fluidProgram.RuntimeSettings.IsAutoSoakSpan = this.chxAutoSoakSpan.Checked;
            #endregion

            // data 参数保存
            this.dataControl.SetParam(this.fluidProgram);

            this.Close();
            CompareObj.CompareProperty(this.fluidProgram.RuntimeSettings, this.runtimeSettingsBackUp, null, this.GetType().Name);
            CompareObj.CompareField(this.fluidProgram.RuntimeSettings, this.runtimeSettingsBackUp, null, this.GetType().Name);
        }