using System; using System.Linq; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using SmartX; using INT_LKD.DataStore; using INT_LKD.Forms; using INT_LKD.DialogForms; namespace INT_LKD.Controls { public partial class ControlMenuManualIoTest : UserControl { #region Field private FormMenu m_ParentForm; private Color ColorEnable; private Color ColorDisable; private Collection CollLabelInput; #endregion #region Constructor public ControlMenuManualIoTest(FormMenu parent) { InitializeComponent(); this.ParentForm = parent; this.Initialize(); this.InitializeDesign(); } #endregion #region Property public FormMenu ParentForm { get { return this.m_ParentForm; } private set { this.m_ParentForm = value; } } #endregion #region Method private void Initialize() { this.ColorEnable = Color.Lime; this.ColorDisable = Color.Gainsboro; this.CollLabelInput = new Collection(); this.CollLabelInput.Add(this.labelInput1); this.CollLabelInput.Add(this.labelInput2); this.CollLabelInput.Add(this.labelInput3); this.CollLabelInput.Add(this.labelInput4); this.CollLabelInput.Add(this.labelInput5); this.labelDiff1.Text = "0.00"; this.labelDisp1.Text = "0.00"; this.labelVacuumWorking1.Text = "0.0"; this.labelVacuumMaster1.Text = "0.0"; this.labelSbAlarm1.Visible = false; this.labeldispAlarm1.Visible = false; for (int i = 0; i < this.CollLabelInput.Count; i++) this.CollLabelInput[i].RoundRectFillColor = this.ColorDisable; } public void InitializeDesign() { switch (this.ParentForm.ParentForm.SystemConfig.LANGUAGE) { case Define.E_LanguageID.Chinese: this.smartGroupBox1.Text = "手动设置 > IO Test"; this.groupBoxInput.Text = "输入"; this.groupBoxStatus.Text = "地位"; this.groupBoxOutput.Text = "输出"; this.groupBoxServo.Text = "伺服电机"; this.labelTitleInput1.Text = "输入 1"; this.labelTitleInput2.Text = "输入 2"; this.labelTitleInput3.Text = "输入 3"; this.labelTitleInput4.Text = "输入 4"; this.labelTitleInput5.Text = "输入 5"; this.labelTitleDisp.Text = "位移"; this.labelTitleDiff.Text = "压差"; this.labelTitlePressureW.Text = "工作腔"; this.labelTitlePressureM.Text = "主腔"; this.buttonOut4.ButtonText = "阀门稳定"; this.buttonOut5.ButtonText = "阀门维护 1"; this.buttonOut6.ButtonText = "阀门维护 2"; this.buttonOut7.ButtonText = "CD 电磁阀"; this.buttonOut8.ButtonText = "PD 电磁阀"; this.buttonOut9.ButtonText = "未使用"; this.buttonOut10.ButtonText = "未使用"; this.buttonOut11.ButtonText = "未使用"; this.buttonOut12.ButtonText = "未使用"; this.labelTitleDiscriptionCD.Text = "CD : 商会下电磁阀"; this.labelTitleDiscriptionPD.Text = "PD : 产品卸料"; this.buttonMotor1Origin.ButtonText = "原点"; this.buttonMotor1AlarmClear.ButtonText = "报警清除"; this.buttonMotorReady.ButtonText = "初始状态"; this.buttonMotorDischarge.ButtonText = "排出"; this.buttonJogCW.ButtonText = "顺时针点动"; this.buttonJogCCW.ButtonText = "逆时针点动"; this.buttonMotorChamber1.ButtonText = "腔 1"; this.buttonMotorChamber2.ButtonText = "腔 2"; this.buttonMotorChamber3.ButtonText = "腔 3"; this.buttonMotorChamber4.ButtonText = "腔 4"; this.buttonMotorChamber5.ButtonText = "腔 5"; this.buttonMotorChamber6.ButtonText = "腔 6"; this.buttonMotorChamber7.ButtonText = "腔 7"; this.buttonOut1.ButtonText = "红色"; this.buttonOut2.ButtonText = "绿色"; this.buttonOut3.ButtonText = "蜂鸣器"; break; default: this.smartGroupBox1.Text = "Manual > IO Test"; this.groupBoxInput.Text = "INPUT"; this.groupBoxStatus.Text = "STATUS"; this.groupBoxOutput.Text = "OUTPUT"; this.groupBoxServo.Text = "SERVO"; this.labelTitleInput1.Text = "Input 1"; this.labelTitleInput2.Text = "Input 2"; this.labelTitleInput3.Text = "Input 3"; this.labelTitleInput4.Text = "Input 4"; this.labelTitleInput5.Text = "Input 5"; this.labelTitleDisp.Text = "Disp"; this.labelTitleDiff.Text = "Diff"; this.labelTitlePressureW.Text = "Pressure W"; this.labelTitlePressureM.Text = "Pressure M"; this.buttonOut4.ButtonText = "Valve relief"; this.buttonOut5.ButtonText = "Valve hold 1"; this.buttonOut6.ButtonText = "Valve hold 2"; this.buttonOut7.ButtonText = "CD Sol Valve"; this.buttonOut8.ButtonText = "PD Sol Valve"; this.buttonOut9.ButtonText = "None"; this.buttonOut10.ButtonText = "None"; this.buttonOut11.ButtonText = "None"; this.buttonOut12.ButtonText = "None"; this.labelTitleDiscriptionCD.Text = "CD : Chamber Down"; this.labelTitleDiscriptionPD.Text = "PD : Product Discharge"; this.buttonMotor1Origin.ButtonText = "ORIGIN"; this.buttonMotor1AlarmClear.ButtonText = "Alarm Clear"; this.buttonMotorReady.ButtonText = "Ready"; this.buttonMotorDischarge.ButtonText = "Discharge"; this.buttonJogCW.ButtonText = "JOG CW"; this.buttonJogCCW.ButtonText = "JOG CCW"; this.buttonMotorChamber1.ButtonText = "Chamber 1"; this.buttonMotorChamber2.ButtonText = "Chamber 2"; this.buttonMotorChamber3.ButtonText = "Chamber 3"; this.buttonMotorChamber4.ButtonText = "Chamber 4"; this.buttonMotorChamber5.ButtonText = "Chamber 5"; this.buttonMotorChamber6.ButtonText = "Chamber 6"; this.buttonMotorChamber7.ButtonText = "Chamber 7"; this.buttonOut1.ButtonText = "Red"; this.buttonOut2.ButtonText = "Green"; this.buttonOut3.ButtonText = "Buzzer"; break; } } private void OutputCommand(string address, string data) { string command = "", id = ""; command = CommunicationCommand.IOTest; id = CommunicationID.MainBoard; this.ParentForm.ParentForm.TransferDataStream(command, id, address, data); } private void ServoParameterAllRead() { SmartSplash.Start(SmartSplash.BuiltInLoadingImages.PROCESSING1, 200); // ServoMotor 1 this.labelMotor1Origin.Text = this.ParentForm.ParentForm.ServoMotorRead2(1, ServoMotorAddress.CMD17); this.labelMotorReady.Text = this.ParentForm.ParentForm.ServoMotorRead2(1, ServoMotorAddress.CMD1); this.labelMotorChamber1.Text = this.ParentForm.ParentForm.ServoMotorRead2(1, ServoMotorAddress.CMD2); this.labelMotorChamber2.Text = this.ParentForm.ParentForm.ServoMotorRead2(1, ServoMotorAddress.CMD3); this.labelMotorChamber3.Text = this.ParentForm.ParentForm.ServoMotorRead2(1, ServoMotorAddress.CMD4); this.labelMotorChamber4.Text = this.ParentForm.ParentForm.ServoMotorRead2(1, ServoMotorAddress.CMD5); this.labelMotorChamber5.Text = this.ParentForm.ParentForm.ServoMotorRead2(1, ServoMotorAddress.CMD6); this.labelMotorChamber6.Text = this.ParentForm.ParentForm.ServoMotorRead2(1, ServoMotorAddress.CMD7); this.labelMotorChamber7.Text = this.ParentForm.ParentForm.ServoMotorRead2(1, ServoMotorAddress.CMD8); this.labelMotorDischarge.Text = this.ParentForm.ParentForm.ServoMotorRead2(1, ServoMotorAddress.CMD9); SmartSplash.Finish(); this.ParentForm.Enabled = true; switch (this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUser.Group) { case Define.E_UserGroup.None: this.Enabled = false; break; case Define.E_UserGroup.Level1: this.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuIOTest; break; case Define.E_UserGroup.Level2: this.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuIOTest; break; case Define.E_UserGroup.Level3: this.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuIOTest; break; case Define.E_UserGroup.Admin: this.Enabled = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuIOTest; break; case Define.E_UserGroup.Developer: this.Enabled = true; break; case Define.E_UserGroup.NotLogin: this.Enabled = false; break; case Define.E_UserGroup.LogOut: this.Enabled = false; break; default: break; } } // 변위센서 데이터 public void UpdateDisplayDispData1(LeakData1 data) { this.labelDisp1.Text = data.DispData.RData; } public void UpdateDisplayDispData2(LeakData1 data) { this.labelDisp2.Text = data.DispData.RData; } // 차압센서 데이터 public void UpdateDisplayDiffData1(LeakData1 data) { this.labelDiff1.Text = data.DiffData.MAdc; } public void UpdateDisplayDiffData2(LeakData1 data) { this.labelDiff2.Text = data.DiffData.MAdc; } // 압력센서 데이터 public void UpdateDisplayPresData1(LeakData1 data) { this.labelVacuumWorking1.Text = data.PresData.WorkingChamber; this.labelVacuumMaster1.Text = data.PresData.MasterChamber; } public void UpdateDisplayPresData2(LeakData1 data) { this.labelVacuumWorking2.Text = data.PresData.WorkingChamber; this.labelVacuumMaster2.Text = data.PresData.MasterChamber; } public void UpdateDisplayInputData(Collection datas) { Color value = this.ColorDisable; for (int i = 0; i < datas.Count; i++) { if (datas[i] == "0") value = this.ColorDisable; else value = this.ColorEnable; this.CollLabelInput[i].RoundRectFillColor = value; } } public void UpdateDisplayAlarmView(AlarmList alarm) { } public void DisplayRefresh() { this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplayMode = Define.E_DisplayModeStore.IOTest; this.ParentForm.ParentForm.SetDisplayMode(Define.E_EquipmentMode.IOTest); // Servo Parameter Read // 서보설정 읽는동안 Enable = false this.ParentForm.Enabled = false; this.smartTimer.Start(); } #endregion #region Event Handler // Output 1~10 private void buttonOut1_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7701_Output1); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut2_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7702_Output2); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut3_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7703_Output3); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut4_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7704_Output4); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut5_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7705_Output5); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut6_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7706_Output6); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut7_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7707_Output7); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut8_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7708_Output8); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut9_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7709_Output9); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut10_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7710_Output10); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut11_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7711_Output11); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } private void buttonOut12_Click(object sender, EventArgs e) { string address = "", data = ""; SmartButton button = sender as SmartButton; if (button == null) return; // adress address = Helper.StringBlankFillDigits4(CommunicationAddress._7712_Output12); // data if (button.ButtonStatus == SmartButton.BUTSTATUS.DOWN) data = Helper.StringBlankFillDigits4("1"); else data = Helper.StringBlankFillDigits4("0"); this.OutputCommand(address, data); } // Motor private void buttonMotor1Origin_Click(object sender, EventArgs e) { if (this.buttonOut7.ButtonStatus == SmartButton.BUTSTATUS.DOWN) return; this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorOrigin, CommunicationID.MainBoard); } private void buttonMotor1AlarmClear_Click(object sender, EventArgs e) { this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorAlarmReset, CommunicationID.MainBoard); } private void buttonMotorReady_Click(object sender, EventArgs e) { if (this.buttonOut7.ButtonStatus == SmartButton.BUTSTATUS.DOWN) return; this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorMove1, CommunicationID.SubBoard1); } private void buttonMotorChamber1_Click(object sender, EventArgs e) { if (this.buttonOut7.ButtonStatus == SmartButton.BUTSTATUS.DOWN) return; this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorMove1, CommunicationID.SubBoard2); } private void buttonMotorChamber2_Click(object sender, EventArgs e) { if (this.buttonOut7.ButtonStatus == SmartButton.BUTSTATUS.DOWN) return; this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorMove1, CommunicationID.SubBoard3); } private void buttonMotorChamber3_Click(object sender, EventArgs e) { if (this.buttonOut7.ButtonStatus == SmartButton.BUTSTATUS.DOWN) return; this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorMove1, CommunicationID.SubBoard4); } private void buttonMotorChamber4_Click(object sender, EventArgs e) { if (this.buttonOut7.ButtonStatus == SmartButton.BUTSTATUS.DOWN) return; this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorMove1, CommunicationID.SubBoard5); } private void buttonMotorChamber5_Click(object sender, EventArgs e) { if (this.buttonOut7.ButtonStatus == SmartButton.BUTSTATUS.DOWN) return; this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorMove1, CommunicationID.SubBoard6); } private void buttonMotorChamber6_Click(object sender, EventArgs e) { if (this.buttonOut7.ButtonStatus == SmartButton.BUTSTATUS.DOWN) return; this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorMove1, CommunicationID.SubBoard7); } private void buttonMotorChamber7_Click(object sender, EventArgs e) { if (this.buttonOut7.ButtonStatus == SmartButton.BUTSTATUS.DOWN) return; this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorMove1, CommunicationID.SubBoard8); } private void buttonMotorDischarge_Click(object sender, EventArgs e) { if (this.buttonOut7.ButtonStatus == SmartButton.BUTSTATUS.DOWN) return; this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorMove1, CommunicationID.SubBoard9); } private void buttonJogCW_MouseDown(object sender, MouseEventArgs e) { this.ParentForm.Set_Equipment_ButtonEnable(false); this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorJogCwOn, CommunicationID.MainBoard); } private void buttonJogCW_MouseUp(object sender, MouseEventArgs e) { this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorJogCwOff, CommunicationID.MainBoard); this.buttonJogCW.Enabled = false; this.buttonJogCCW.Enabled = false; this.smartTimerJog.Start(); } private void buttonJogCCW_MouseDown(object sender, MouseEventArgs e) { this.ParentForm.Set_Equipment_ButtonEnable(false); this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorJogCcwOn, CommunicationID.MainBoard); } private void buttonJogCCW_MouseUp(object sender, MouseEventArgs e) { this.ParentForm.ParentForm.TransferData(CommunicationCommand.MotorJogCcwOff, CommunicationID.MainBoard); this.buttonJogCW.Enabled = false; this.buttonJogCCW.Enabled = false; this.smartTimerJog.Start(); } private void labelMotor1Origin_Click(object sender, EventArgs e) { string caption = "Origin", before = "", after = ""; before = this.labelMotor1Origin.Text; DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(caption, this.labelMotor1Origin.Text, 7, 0, false, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue == 0) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); myMsg.ShowDialog(); } else { this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD8, myKeyPad.IntValue, this.labelMotorDischarge); this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD17, myKeyPad.IntValue, this.labelMotor1Origin); before = myKeyPad.StringValue; this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.M_Origin, "", before, after); this.ParentForm.ParentForm.ServoMotorWrite1(1, ServoMotorAddress.SaveAllParameters, ServoMotorAddress.EEPROM); } } } private void labelMotorReady_Click(object sender, EventArgs e) { string caption = "", before = "", after = ""; before = this.labelMotorReady.Text; caption = string.Format("{0} Location - {1}", this.buttonMotorReady.ButtonText, before); DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(caption, this.labelMotorReady.Text, 7, 0, false, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue == 0) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); myMsg.ShowDialog(); } else { this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD1, myKeyPad.IntValue, this.labelMotorReady); this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD17, myKeyPad.IntValue, this.labelMotor1Origin); after = myKeyPad.StringValue; this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.M_Ready, "", before, after); this.ParentForm.ParentForm.ServoMotorWrite1(1, ServoMotorAddress.SaveAllParameters, ServoMotorAddress.EEPROM); } } } private void labelMotorChamber1_Click(object sender, EventArgs e) { string caption = "", before = "", after = ""; before = this.labelMotorChamber1.Text; caption = string.Format("{0} Location - {1}", this.buttonMotorChamber1.ButtonText, before); DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(caption, this.labelMotorChamber1.Text, 7, 0, false, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue == 0) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); myMsg.ShowDialog(); } else { this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD2, myKeyPad.IntValue, this.labelMotorChamber1); after = myKeyPad.StringValue; this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.M_Chamber1, "", before, after); this.ParentForm.ParentForm.ServoMotorWrite1(1, ServoMotorAddress.SaveAllParameters, ServoMotorAddress.EEPROM); } } } private void labelMotorChamber2_Click(object sender, EventArgs e) { string caption = "", before = "", after = ""; before = this.labelMotorChamber2.Text; caption = string.Format("{0} Location - {1}", this.buttonMotorChamber2.ButtonText, before); DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(caption, this.labelMotorChamber2.Text, 7, 0, false, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue == 0) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); myMsg.ShowDialog(); } else { this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD3, myKeyPad.IntValue, this.labelMotorChamber2); after = myKeyPad.StringValue; this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.M_Chamber2, "", before, after); this.ParentForm.ParentForm.ServoMotorWrite1(1, ServoMotorAddress.SaveAllParameters, ServoMotorAddress.EEPROM); } } } private void labelMotorChamber3_Click(object sender, EventArgs e) { string caption = "", before = "", after = ""; before = this.labelMotorChamber3.Text; caption = string.Format("{0} Location - {1}", this.buttonMotorChamber3.ButtonText, before); DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(caption, this.labelMotorChamber3.Text, 7, 0, false, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue == 0) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); myMsg.ShowDialog(); } else { this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD4, myKeyPad.IntValue, this.labelMotorChamber3); after = myKeyPad.StringValue; this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.M_Chamber3, "", before, after); this.ParentForm.ParentForm.ServoMotorWrite1(1, ServoMotorAddress.SaveAllParameters, ServoMotorAddress.EEPROM); } } } private void labelMotorChamber4_Click(object sender, EventArgs e) { string caption = "", before = "", after = ""; before = this.labelMotorChamber4.Text; caption = string.Format("{0} Location - {1}", this.buttonMotorChamber4.ButtonText, before); DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(caption, this.labelMotorChamber4.Text, 7, 0, false, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue == 0) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); myMsg.ShowDialog(); } else { this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD5, myKeyPad.IntValue, this.labelMotorChamber4); after = myKeyPad.StringValue; this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.M_Chamber4, "", before, after); this.ParentForm.ParentForm.ServoMotorWrite1(1, ServoMotorAddress.SaveAllParameters, ServoMotorAddress.EEPROM); } } } private void labelMotorChamber5_Click(object sender, EventArgs e) { string caption = "", before = "", after = ""; before = this.labelMotorChamber5.Text; caption = string.Format("{0} Location - {1}", this.buttonMotorChamber5.ButtonText, before); DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(caption, this.labelMotorChamber5.Text, 7, 0, false, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue == 0) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); myMsg.ShowDialog(); } else { this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD6, myKeyPad.IntValue, this.labelMotorChamber5); after = myKeyPad.StringValue; this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.M_Chamber5, "", before, after); this.ParentForm.ParentForm.ServoMotorWrite1(1, ServoMotorAddress.SaveAllParameters, ServoMotorAddress.EEPROM); } } } private void labelMotorChamber6_Click(object sender, EventArgs e) { string caption = "", before = "", after = ""; before = this.labelMotorChamber6.Text; caption = string.Format("{0} Location - {1}", this.buttonMotorChamber6.ButtonText, before); DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(caption, this.labelMotorChamber6.Text, 7, 0, false, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue == 0) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); myMsg.ShowDialog(); } else { this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD7, myKeyPad.IntValue, this.labelMotorChamber6); after = myKeyPad.StringValue; this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.M_Chamber6, "", before, after); this.ParentForm.ParentForm.ServoMotorWrite1(1, ServoMotorAddress.SaveAllParameters, ServoMotorAddress.EEPROM); } } } private void labelMotorChamber7_Click(object sender, EventArgs e) { string caption = "", before = "", after = ""; before = this.labelMotorChamber7.Text; caption = string.Format("{0} Location - {1}", this.buttonMotorChamber7.ButtonText, before); DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(caption, this.labelMotorChamber7.Text, 7, 0, false, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue == 0) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); myMsg.ShowDialog(); } else { this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD8, myKeyPad.IntValue, this.labelMotorChamber7); after = myKeyPad.StringValue; this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.M_Chamber7, "", before, after); this.ParentForm.ParentForm.ServoMotorWrite1(1, ServoMotorAddress.SaveAllParameters, ServoMotorAddress.EEPROM); } } } private void labelMotorDischarge_Click(object sender, EventArgs e) { string caption = "", before = "", after = ""; before = this.labelMotorDischarge.Text; caption = string.Format("{0} Location - {1}", this.buttonMotorDischarge.ButtonText, before); DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(caption, this.labelMotorDischarge.Text, 7, 0, false, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue == 0) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.LANGUAGE); myMsg.ShowDialog(); } else { this.ParentForm.ParentForm.ServoMotorWrite2(1, ServoMotorAddress.CMD9, myKeyPad.IntValue, this.labelMotorDischarge); after = myKeyPad.StringValue; this.ParentForm.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.M_ChamberDischarge, "", before, after); this.ParentForm.ParentForm.ServoMotorWrite1(1, ServoMotorAddress.SaveAllParameters, ServoMotorAddress.EEPROM); } } } private void smartTimer_Tick(object sender, EventArgs e) { this.smartTimer.Stop(); this.ServoParameterAllRead(); this.ParentForm.UpdateButtonColor(); } private void smartTimerJog_Tick(object sender, EventArgs e) { this.smartTimerJog.Stop(); this.buttonJogCW.Enabled = true; this.buttonJogCCW.Enabled = true; this.ParentForm.Set_Equipment_ButtonEnable(true); } #endregion } }