private void btnOk_Click(object sender, EventArgs e) { if (this.measureCmdLine == null) { MessageBox.Show("当前轨迹未增加基准测高,请生成测高指令"); return; } if (this.SymbolLinesCache.Count < 1) { MessageBox.Show("未生成轨迹请生成轨迹"); return; } if (this.tbArcSpeed.Text == "") { MessageBox.Show("圆弧速度未设置"); return; } this.symbolLinesCmdLine.BindMHCmdLine = this.measureCmdLine; this.symbolLinesCmdLine.Symbols = this.SymbolLinesCache; this.symbolLinesCmdLine.LineStyle = (LineStyle)cbxLineType.SelectedIndex; this.symbolLinesCmdLine.ArcSpeed = this.tbArcSpeed.Value; this.symbolLinesCmdLine.OffsetX = (double)this.nudOffsetX.Value; this.symbolLinesCmdLine.OffsetY = (double)this.nudOffsetY.Value; if (isCreating) { MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, this.symbolLinesCmdLine); } else { MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, this.symbolLinesCmdLine); } this.Close(); }
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(); }
private void btnOk_Click(object sender, EventArgs e) { int otherFormAccessCount = RoleMgr.Instance.Developer.OtherFormAccess.GetLength(); int mainFormAccessCount = RoleMgr.Instance.Developer.MainFormAccess.GetLength(); int programFormAccessCount = RoleMgr.Instance.Developer.ProgramFormAccess.GetLength(); int i = 0; for (; i < mainFormAccessCount; i++) { RoleMgr.Instance.Operator.MainFormAccess[i] = (bool)dgvAccess.Rows[i].Cells[0].Value; RoleMgr.Instance.Technician.MainFormAccess[i] = (bool)dgvAccess.Rows[i].Cells[1].Value; RoleMgr.Instance.Supervisor.MainFormAccess[i] = (bool)dgvAccess.Rows[i].Cells[2].Value; } for (; i < mainFormAccessCount + programFormAccessCount; i++) { int j = i - mainFormAccessCount; RoleMgr.Instance.Operator.ProgramFormAccess[j] = (bool)dgvAccess.Rows[i].Cells[0].Value; RoleMgr.Instance.Technician.ProgramFormAccess[j] = (bool)dgvAccess.Rows[i].Cells[1].Value; RoleMgr.Instance.Supervisor.ProgramFormAccess[j] = (bool)dgvAccess.Rows[i].Cells[2].Value; } for (; i < mainFormAccessCount + programFormAccessCount + otherFormAccessCount; i++) { int j = i - mainFormAccessCount - programFormAccessCount; RoleMgr.Instance.Operator.OtherFormAccess[j] = (bool)dgvAccess.Rows[i].Cells[0].Value; RoleMgr.Instance.Technician.OtherFormAccess[j] = (bool)dgvAccess.Rows[i].Cells[1].Value; RoleMgr.Instance.Supervisor.OtherFormAccess[j] = (bool)dgvAccess.Rows[i].Cells[2].Value; } MsgCenter.Broadcast(MsgConstants.MODIFY_ACCESS, this, null); this.Close(); }
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); } } }
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); } } }
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); } } }
private void BtnSave_Click(object sender, EventArgs e) { Machine.Instance.SetupValve(); MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this); Machine.Instance.Setting.Save(); CompareObj.CompareProperty(Machine.Instance.Setting, this.SettingBackUp, null, this.GetType().Name); }
private void btnOk_Click(object sender, EventArgs e) { if (changed) { MsgCenter.Broadcast(Constants.MSG_SYS_POSITIONS_DEFS_CHANGED, this, null); } }
private void BeginBroadcastIdle() { this.BeginInvoke(new Action(() => { MsgCenter.Broadcast(MsgType.IDLE, this, null); })); }
private void btnOk_Click(object sender, EventArgs e) { if (!tbWaitInMills.IsValid || !tbSpeed.IsValid) { //MessageBox.Show("Please input valid value"); MetroSetMessageBox.Show(this, "请输入合理的值"); return; } changeSpeedCmdLine.Speed = tbSpeed.Value; changeSpeedCmdLine.WaitInMills = tbWaitInMills.Value; if (isCreating) { MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, changeSpeedCmdLine); } else { MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, changeSpeedCmdLine); } if (!this.isCreating) { if (this.changeSpeedCmdLine != null && this.changeSpeedCmdLineBackUp != null) { CompareObj.CompareProperty(this.changeSpeedCmdLine, this.changeSpeedCmdLineBackUp, null, this.GetType().Name, true); } } }
private void CbxChn2_SelectedIndexChanged(object sender, EventArgs e) { SensorMgr.Instance.Proportioners.Channel2 = (int)cbxChn2.SelectedItem; MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this, null); SensorMgr.Instance.Save(); CompareObj.CompareProperty(SensorMgr.Instance.Proportioners, this.settingBackUp, true); }
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); } } }
private void btnOK_Click(object sender, EventArgs e) { foreach (DataGridViewRow item in this.dgvAccess.Rows) { if (item.Tag is ControlAccess) { ControlAccess access = item.Tag as ControlAccess; RoleEnums roleLevel = RoleEnums.Operator; if ((bool)item.Cells[1].Value) { roleLevel = RoleEnums.Operator; } else if ((bool)item.Cells[2].Value) { roleLevel = RoleEnums.Technician; } else if ((bool)item.Cells[3].Value) { roleLevel = RoleEnums.Supervisor; } access.RoleLevel = roleLevel; } } MsgCenter.Broadcast(MsgConstants.MODIFY_ACCESS, this, null); AccessControlMgr.Instance.Save(); }
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); } } }
private void btnReverse_Click(object sender, EventArgs e) { Pattern p = pattern.ReversePattern(); MsgCenter.Broadcast(Constants.MSG_ADD_PATTERN, this, p); this.Close(); }
private async void Cms_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { MsgCenter.Broadcast(MsgType.BUSY, this, null); await Task.Factory.StartNew(() => { if (e.ClickedItem.Text == strMoveHome) { Machine.Instance.MoveHome(); } else if (e.ClickedItem.Text == strInitMotion) { AlarmServer.Instance.MachineInitDone = false; Machine.Instance.InitMotion(); AlarmServer.Instance.MachineInitDone = true; } else if (e.ClickedItem.Text == strInitVision) { AlarmServer.Instance.MachineInitDone = false; Machine.Instance.InitVision(); AlarmServer.Instance.MachineInitDone = true; this.BeginInvoke(new MethodInvoker(() => { MsgCenter.Broadcast(MachineMsg.INIT_VISION, this); })); } else if (e.ClickedItem.Text == strInitSensors) { AlarmServer.Instance.MachineInitDone = false; Machine.Instance.InitSensors(); AlarmServer.Instance.MachineInitDone = true; } }); MsgCenter.Broadcast(MsgType.IDLE, this, null); }
private void BeginBroadcastPaused() { this.BeginInvoke(new Action(() => { MsgCenter.Broadcast(MsgType.PAUSED, this, null); })); }
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); } } }
private void btnSave_Click(object sender, EventArgs e) { Machine.Instance.Setting.ValveSelect = (ValveSelection)this.cmbValveSelect.SelectedIndex; if (!Machine.Instance.Valve1.ValveSeries.Equals(Machine.Instance.Valve2.ValveSeries) && Machine.Instance.Setting.ValveSelect == ValveSelection.双阀) { MetroSetMessageBox.Show(this, "请选择同类型阀组", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Machine.Instance.SetupValve(); Machine.Instance.Valve1.ValveSeries = (ValveSeries)this.metroSetListBox1.SelectedIndex; Machine.Instance.Valve2.ValveSeries = (ValveSeries)this.metroSetListBox2.SelectedIndex; ValvePrmMgr.Instance.FindBy(ValveType.Valve1).ValveSeires = (ValveSeries)this.metroSetListBox1.SelectedIndex; ValvePrmMgr.Instance.FindBy(ValveType.Valve2).ValveSeires = (ValveSeries)this.metroSetListBox2.SelectedIndex; Machine.Instance.Setting.Save(); Machine.Instance.SaveValveSettings(); if (Machine.Instance.Setting.ValveSelect == ValveSelection.双阀) { if (Machine.Instance.Valve1.ValveSeries == Machine.Instance.Valve2.ValveSeries) { if (Machine.Instance.Valve1.ValveSeries == ValveSeries.喷射阀) { Machine.Instance.DualValve = new JtDualValve(CardMgr.Instance.FindBy(0), Machine.Instance.Valve1, Machine.Instance.Valve2); } if (Machine.Instance.Valve1.ValveSeries == ValveSeries.螺杆阀) { Machine.Instance.DualValve = new SvDualValve(CardMgr.Instance.FindBy(0), Machine.Instance.Valve1, Machine.Instance.Valve2); } } } MsgCenter.Broadcast(MachineMsg.SETUP_VALVE, this, Machine.Instance.Valve1.ValveSeries, Machine.Instance.Valve2.ValveSeries); }
private void SettingSensorsForm_OnSaveClicked() { MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this, null); SensorMgr.Instance.Save(); this.Close(); CompareObj.CompareProperty(this.currEasySerialPort, this.currEasySerialPortBackUp, null, this.GetType().Name, true); }
/// <summary> /// 切换用户操作 /// </summary> /// <param name="user"></param> public void SwitchUser(Account user) { this.CurrentAccount = user; RoleMgr.Instance.SwitchRole(this.currentAccount.RoleType); AccessControlMgr.Instance.CurrRole = (RoleEnums)(int)user.RoleType; //通知主界面和编程界面,更新界面,处理非模态窗口。 MsgCenter.Broadcast(MsgConstants.SWITCH_USER, this, null); }
private void cbxVendor_SelectedIndexChanged(object sender, EventArgs e) { Camera.Vendor vendor = (Camera.Vendor) this.cmbVendor.SelectedItem; Machine.Instance.Camera.Close(); Machine.Instance.Camera.SelectVendor(vendor); Machine.Instance.InitVision(); MsgCenter.Broadcast(MachineMsg.INIT_VISION, this); }
private void CbxVendor_SelectedIndexChanged(object sender, EventArgs e) { HeaterControllerMgr.Vendor vendor = (HeaterControllerMgr.Vendor) this.cbxVendor.SelectedItem; Machine.Instance.HeaterController1.SetHeater(vendor); Machine.Instance.HeaterController2.SetHeater(vendor); MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this, null); SensorMgr.Instance.Save(); }
private void CbxControlType2_SelectedIndexChanged(object sender, EventArgs e) { Proportioner.ControlType controlType = (Proportioner.ControlType)cbxControlType2.SelectedItem; Machine.Instance.Proportioner2.SetProportionor(2, controlType, SensorMgr.Instance.Proportioners); MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this, null); SensorMgr.Instance.Save(); CompareObj.CompareProperty(SensorMgr.Instance.Proportioners, this.settingBackUp, true); }
private void btnSave_Click(object sender, EventArgs e) { MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this); CameraPrmMgr.Instance.Save(); if (Machine.Instance.Camera.Prm != null && this.prmBackUp != null) { CompareObj.CompareProperty(Machine.Instance.Camera.Prm, this.prmBackUp, null, this.GetType().Name); } }
private void btnOk_Click(object sender, EventArgs e) { if (rbModelFind.Checked) { badMarkCmdLine.FindType = BadMarkCmdLine.BadMarkType.ModelFind; if (this.editModelFindForm != null) { if (this.editModelFindForm.DialogResult == DialogResult.OK) { badMarkCmdLine.Position.X = badMarkCmdLine.ModelFindPrm.PosInPattern.X; badMarkCmdLine.Position.Y = badMarkCmdLine.ModelFindPrm.PosInPattern.Y; } } else if (isCreating) { MessageBox.Show(messageTip[0]); return; } } else { badMarkCmdLine.FindType = BadMarkCmdLine.BadMarkType.GrayScale; if (this.editGrayCheckForm != null) { if (this.editGrayCheckForm.DialogResult == DialogResult.OK) { badMarkCmdLine.Position.X = badMarkCmdLine.GrayCheckPrm.PosInPattern.X; badMarkCmdLine.Position.Y = badMarkCmdLine.GrayCheckPrm.PosInPattern.Y; } } else if (isCreating) { MessageBox.Show(messageTip[1]); return; } } if (rbNgSkip.Checked) { badMarkCmdLine.IsOkSkip = false; } else { badMarkCmdLine.IsOkSkip = true; } if (isCreating) { MsgCenter.Broadcast(Constants.MSG_FINISH_ADDING_CMD_LINE, this, badMarkCmdLine); } else { MsgCenter.Broadcast(Constants.MSG_FINISH_EDITING_CMD_LINE, this, badMarkCmdLine); } Close(); CompareObj.CompareMember(this.badMarkCmdLine, this.badMarkCmdLineBackUp, null, this.GetType().Name, true); }
private void btnOk_Click(object sender, EventArgs e) { Machine.Instance.Setting.MachineSelect = (MachineSelection)this.comboBox1.SelectedItem; Machine.Instance.SetupIO(); MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this, null); Machine.Instance.Setting.Save(); this.Close(); CompareObj.CompareProperty(Machine.Instance.Setting, this.SettingBackUp, null, this.GetType().Name); }
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); } } } } }
private void CbxVendor_SelectedIndexChanged(object sender, EventArgs e) { Laser.Vendor vendor = (Laser.Vendor) this.cbxVendor.SelectedItem; Machine.Instance.Laser.SetLaserable(vendor); this.txtReadCmd.Text = Machine.Instance.Laser.Laserable.CmdReadValue; MsgCenter.Broadcast(MachineMsg.SETUP_INFO, this, null); SensorMgr.Instance.Save(); CompareObj.CompareProperty(SensorMgr.Instance.Laser, this.settingBackUp, null, this.GetType().Name, true); }
private void btnCancel_Click(object sender, System.EventArgs e) { if (Machine.Instance.Valve1.RunMode == ValveRunMode.AdjustLine) { //偏移量调整 Line.WaitMsg.Set(); //TODO } MsgCenter.Broadcast(MsgDef.MSG_PARAMPAGE_CLEAR, null); }