using System; using System.Linq; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using System.Drawing.Imaging; using SmartX; using ITC81DB_0H.Forms; using ITC81DB_0H.DialogForms; using ITC81DB_0H_ImageDll; using System.Threading; namespace ITC81DB_0H.Controls { public partial class ControlCenterEquipEngineer : UserControl { #region Field private FormMenu m_ParentForm; #endregion #region Constructor public ControlCenterEquipEngineer(FormMenu parent) { InitializeComponent(); this.ParentForm = parent; this.InitializeDesign(); this.DefaultSetting(); } #endregion #region Property public FormMenu ParentForm { get { return this.m_ParentForm; } private set { this.m_ParentForm = value; } } #endregion #region Method public void InitializeDesign() { Class1 images = new Class1(); this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus); if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.English) { this.labelTitleCommunicationLog.Text = "Log"; this.labelTitleEquipmentType.Text = "Equipment Type"; this.labelTitleCommunicationOption.Text = "Communication Option"; this.labelTitleConveyorLength.Text = "Conveyor Length"; this.buttonCapture.Text = "Capture"; this.labelTitleOptionBoard.Text = "Option board"; this.labelTitleBarcode.Text = "Barcode"; this.labelTitleFileNameExtension.Text = "File Name Extension"; this.labelTitleDataBackupFormat.Text = "Databackup Format"; this.labelTitleStatPrintFormat.Text = "Statistics Print Format"; this.labelTitleFilter.Text = "Filter"; this.labelTitleMovingAverage.Text = "Moving Average"; this.comboBoxEquipmentType.SelectedIndexChanged -= new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); this.comboBoxEquipmentType.Items.Clear(); this.comboBoxEquipmentType.Items.Add("Conveyor"); this.comboBoxEquipmentType.Items.Add("Stop-Weight"); this.comboBoxEquipmentType.Items.Add("Updown"); this.comboBoxEquipmentType.SelectedIndexChanged += new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); this.comboBoxOptionBoard.SelectedIndexChanged -= new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.comboBoxOptionBoard.Items.Clear(); this.comboBoxOptionBoard.Items.Add("None"); this.comboBoxOptionBoard.Items.Add("OPT1"); this.comboBoxOptionBoard.Items.Add("OPT2"); this.comboBoxOptionBoard.SelectedIndexChanged += new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.buttonBarcode.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engON)); this.buttonBarcode.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engOFF)); this.buttonCommunicationOption.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engON)); this.buttonCommunicationOption.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engOFF)); this.buttonCommunicationLog.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engON)); this.buttonCommunicationLog.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engOFF)); } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Chinese) { this.labelTitleCommunicationLog.Text = "日志"; this.labelTitleEquipmentType.Text = "设备类型"; this.labelTitleCommunicationOption.Text = "通讯选项"; this.labelTitleConveyorLength.Text = "输送带长度"; this.buttonCapture.Text = "捕获"; this.labelTitleOptionBoard.Text = "选项板"; this.labelTitleBarcode.Text = "条形码"; this.labelTitleFileNameExtension.Text = "数据备份:文件扩展名"; this.labelTitleDataBackupFormat.Text = "数据备份:格式"; this.labelTitleStatPrintFormat.Text = "数据统计:列印格式"; this.labelTitleFilter.Text = "필터"; this.labelTitleMovingAverage.Text = "이동평균"; this.comboBoxEquipmentType.SelectedIndexChanged -= new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); this.comboBoxEquipmentType.Items.Clear(); this.comboBoxEquipmentType.Items.Add("输送带"); this.comboBoxEquipmentType.Items.Add("停止后重量"); this.comboBoxEquipmentType.Items.Add("上下操作"); this.comboBoxEquipmentType.SelectedIndexChanged += new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); this.comboBoxOptionBoard.SelectedIndexChanged -= new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.comboBoxOptionBoard.Items.Clear(); this.comboBoxOptionBoard.Items.Add("不使用"); this.comboBoxOptionBoard.Items.Add("OPT1"); this.comboBoxOptionBoard.Items.Add("OPT2"); this.comboBoxOptionBoard.SelectedIndexChanged += new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.buttonBarcode.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnON)); this.buttonBarcode.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnOFF)); this.buttonCommunicationOption.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnON)); this.buttonCommunicationOption.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnOFF)); this.buttonCommunicationLog.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnON)); this.buttonCommunicationLog.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnOFF)); } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Czech) { } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Russian) { this.labelTitleCommunicationLog.Text = "Журнал обмена"; this.labelTitleEquipmentType.Text = "Тип оборудования"; this.labelTitleCommunicationOption.Text = "Варианты связи"; this.labelTitleConveyorLength.Text = "Длина конвейера"; this.buttonCapture.Text = "Заголовок"; this.labelTitleOptionBoard.Text = "Опции"; this.labelTitleBarcode.Text = "Штрих-код"; this.labelTitleFileNameExtension.Text = "Расширение файла"; this.labelTitleDataBackupFormat.Text = "Формат"; this.labelTitleStatPrintFormat.Text = "Формат печати(Статистика)"; this.labelTitleFilter.Text = "필터"; this.labelTitleMovingAverage.Text = "이동평균"; this.comboBoxEquipmentType.SelectedIndexChanged -= new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); this.comboBoxEquipmentType.Items.Clear(); this.comboBoxEquipmentType.Items.Add("Конвейер"); this.comboBoxEquipmentType.Items.Add("Взвешивание с остановкой"); this.comboBoxEquipmentType.Items.Add("Вверх-вниз"); this.comboBoxEquipmentType.SelectedIndexChanged += new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); this.comboBoxOptionBoard.SelectedIndexChanged -= new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.comboBoxOptionBoard.Items.Clear(); this.comboBoxOptionBoard.Items.Add("Нет"); this.comboBoxOptionBoard.Items.Add("OPT1"); this.comboBoxOptionBoard.Items.Add("OPT2"); this.comboBoxOptionBoard.SelectedIndexChanged += new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.buttonBarcode.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusON)); this.buttonBarcode.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusOFF)); this.buttonCommunicationOption.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusON)); this.buttonCommunicationOption.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusOFF)); this.buttonCommunicationLog.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusON)); this.buttonCommunicationLog.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusOFF)); } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.German) { this.labelTitleCommunicationLog.Text = "Protokoll"; this.labelTitleEquipmentType.Text = "Waagentyp"; this.labelTitleCommunicationOption.Text = "Kommunikationsmöglichkeiten"; this.labelTitleConveyorLength.Text = "Fördererlänge"; this.buttonCapture.Text = "Fang"; this.labelTitleOptionBoard.Text = "Optionsplatine"; this.labelTitleBarcode.Text = "Barcode"; this.labelTitleFileNameExtension.Text = "Dateinamenerweiterung"; this.labelTitleDataBackupFormat.Text = "Datensicherung Format"; this.labelTitleStatPrintFormat.Text = "Statistik-Druckformat"; this.labelTitleFilter.Text = "필터"; this.labelTitleMovingAverage.Text = "이동평균"; this.comboBoxEquipmentType.SelectedIndexChanged -= new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); this.comboBoxEquipmentType.Items.Clear(); this.comboBoxEquipmentType.Items.Add("Förderer"); this.comboBoxEquipmentType.Items.Add("Stoppen"); this.comboBoxEquipmentType.Items.Add("Obenunten"); this.comboBoxEquipmentType.SelectedIndexChanged += new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); this.comboBoxOptionBoard.SelectedIndexChanged -= new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.comboBoxOptionBoard.Items.Clear(); this.comboBoxOptionBoard.Items.Add("Keiner"); this.comboBoxOptionBoard.Items.Add("OPT1"); this.comboBoxOptionBoard.Items.Add("OPT2"); this.comboBoxOptionBoard.SelectedIndexChanged += new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.buttonBarcode.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerON)); this.buttonBarcode.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerOFF)); this.buttonCommunicationOption.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerON)); this.buttonCommunicationOption.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerOFF)); this.buttonCommunicationLog.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerON)); this.buttonCommunicationLog.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerOFF)); } else { this.labelTitleCommunicationLog.Text = "통신로그"; this.labelTitleEquipmentType.Text = "장비타입"; this.labelTitleCommunicationOption.Text = "통신모드 옵션 사용"; this.labelTitleConveyorLength.Text = "컨베어 길이"; this.buttonCapture.Text = "Capture"; this.labelTitleOptionBoard.Text = "옵션보드"; this.labelTitleBarcode.Text = "바코드"; this.labelTitleFileNameExtension.Text = "데이터백업 확장자"; this.labelTitleDataBackupFormat.Text = "데이터백업 포맷"; this.labelTitleStatPrintFormat.Text = "데이터집계 출력 포맷"; this.labelTitleFilter.Text = "필터"; this.labelTitleMovingAverage.Text = "이동평균"; this.comboBoxEquipmentType.SelectedIndexChanged -= new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); this.comboBoxEquipmentType.Items.Clear(); this.comboBoxEquipmentType.Items.Add("컨베어"); this.comboBoxEquipmentType.Items.Add("정지계량"); this.comboBoxEquipmentType.Items.Add("업다운"); this.comboBoxEquipmentType.SelectedIndexChanged += new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); this.comboBoxOptionBoard.SelectedIndexChanged -= new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.comboBoxOptionBoard.Items.Clear(); this.comboBoxOptionBoard.Items.Add("None"); this.comboBoxOptionBoard.Items.Add("OPT1"); this.comboBoxOptionBoard.Items.Add("OPT2"); this.comboBoxOptionBoard.SelectedIndexChanged += new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.buttonBarcode.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engON)); this.buttonBarcode.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engOFF)); this.buttonCommunicationOption.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engON)); this.buttonCommunicationOption.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engOFF)); this.buttonCommunicationLog.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engON)); this.buttonCommunicationLog.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engOFF)); } } private void DefaultSetting() { this.comboBoxDataBackupFormat.SelectedIndexChanged -= new EventHandler(this.comboBoxFormat_SelectedIndexChanged); this.comboBoxDataBackupFormat.Items.Clear(); this.comboBoxDataBackupFormat.Items.Add("STD1"); this.comboBoxDataBackupFormat.Items.Add("OPT1"); // 종근당 this.comboBoxDataBackupFormat.SelectedIndexChanged += new EventHandler(this.comboBoxFormat_SelectedIndexChanged); this.comboBoxFilenameExtension.SelectedIndexChanged -= new EventHandler(this.comboBoxFilenameExtension_SelectedIndexChanged); this.comboBoxFilenameExtension.Items.Clear(); this.comboBoxFilenameExtension.Items.Add("CSV"); this.comboBoxFilenameExtension.Items.Add("TXT"); this.comboBoxFilenameExtension.SelectedIndexChanged += new EventHandler(this.comboBoxFilenameExtension_SelectedIndexChanged); this.comboBoxStatisticsPrintFormat.SelectedIndexChanged -= new EventHandler(this.comboBoxStatisticsPrintFormat_SelectedIndexChanged); this.comboBoxStatisticsPrintFormat.Items.Clear(); this.comboBoxStatisticsPrintFormat.Items.Add("STD1"); this.comboBoxStatisticsPrintFormat.Items.Add("OPT1"); // 삼천당제약 this.comboBoxStatisticsPrintFormat.SelectedIndexChanged += new EventHandler(this.comboBoxStatisticsPrintFormat_SelectedIndexChanged); } private void UpdateSystemParameterDisplay(JudgmentSetItem item) { string value = ""; value = item.Filter.ToString(); if (this.labelFilter.Text != value) this.labelFilter.Text = value; value = item.MovingAverage.ToString(); if (this.labelMovingAverage.Text != value) this.labelMovingAverage.Text = value; } private void UpdateParameterDisplay(SystemConfigurationItem1 item, SystemConfigurationItem2 item2, SystemParameter1 parameter) { int index = 0; string value = ""; // 장비타입 this.comboBoxEquipmentType.SelectedIndexChanged -= new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); switch (int.Parse(parameter.EquipmentType)) { case 0: // 컨베어 this.comboBoxEquipmentType.SelectedIndex = 0; break; case 4: // 업다운 this.comboBoxEquipmentType.SelectedIndex = 2; break; case 6: // 정지계량 this.comboBoxEquipmentType.SelectedIndex = 1; break; default: this.comboBoxEquipmentType.SelectedIndex = 0; break; } this.comboBoxEquipmentType.SelectedIndexChanged += new EventHandler(this.comboBoxEquipmentType_SelectedIndexChanged); // 통신옵션 사용 if (item2.IsCommunicationOption == true) this.buttonCommunicationOption.ButtonDown(); else this.buttonCommunicationOption.ButtonUp(); // 컨베어 입력 value = item2.ConveyorLength.ToString(); if (this.labelConveyorLength.Text != value) this.labelConveyorLength.Text = value; if (this.ParentForm.ParentForm.IsCommunicationLogOpen == false) this.buttonCommunicationLog.ButtonUp(); else this.buttonCommunicationLog.ButtonDown(); // 옵션보드 index = int.Parse(parameter.OptionBoard.Trim()); if (this.comboBoxOptionBoard.SelectedIndex != index) { this.comboBoxOptionBoard.SelectedIndexChanged -= new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); this.comboBoxOptionBoard.SelectedIndex = index; this.comboBoxOptionBoard.SelectedIndexChanged += new EventHandler(this.comboBoxOptionBoard_SelectedIndexChanged); } // 데이터백업 포맷 index = item.DatabackupFormat; if (this.comboBoxDataBackupFormat.SelectedIndex != index) { this.comboBoxDataBackupFormat.SelectedIndexChanged -= new EventHandler(this.comboBoxFormat_SelectedIndexChanged); this.comboBoxDataBackupFormat.SelectedIndex = index; this.comboBoxDataBackupFormat.SelectedIndexChanged += new EventHandler(this.comboBoxFormat_SelectedIndexChanged); } // 데이터백업 확장자 index = item2.FileNameExtension; if (this.comboBoxFilenameExtension.SelectedIndex != index) { this.comboBoxFilenameExtension.SelectedIndexChanged -= new EventHandler(this.comboBoxFilenameExtension_SelectedIndexChanged); this.comboBoxFilenameExtension.SelectedIndex = index; this.comboBoxFilenameExtension.SelectedIndexChanged += new EventHandler(this.comboBoxFilenameExtension_SelectedIndexChanged); } // 데이터집계 출력 포맷 index = item.StatisticsPrintFormat; if (this.comboBoxStatisticsPrintFormat.SelectedIndex != index) { this.comboBoxStatisticsPrintFormat.SelectedIndexChanged -= new EventHandler(this.comboBoxStatisticsPrintFormat_SelectedIndexChanged); this.comboBoxStatisticsPrintFormat.SelectedIndex = index; this.comboBoxStatisticsPrintFormat.SelectedIndexChanged += new EventHandler(this.comboBoxStatisticsPrintFormat_SelectedIndexChanged); } // 바코드 if (item.IsBarcodeEnable == false) this.buttonBarcode.ButtonUp(); else this.buttonBarcode.ButtonDown(); } public void DisplayRefresh(SystemStatus status) { this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = DataStore.DisplayStore.EquipEngineer; this.ParentForm.ParentForm.SetDisplayMode(DataStore.DisplayMode.Menu); this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus); this.UpdateSystemParameterDisplay(this.ParentForm.ParentForm.CurrentJudgmentSetItem); this.UpdateParameterDisplay(this.ParentForm.ParentForm.SystemConfig1, this.ParentForm.ParentForm.SystemConfig2, this.ParentForm.ParentForm.CurrentSystemParameter1); } #endregion #region Event Handler private void comboBoxEquipmentType_SelectedIndexChanged(object sender, EventArgs e) { string value = ""; switch (this.comboBoxEquipmentType.SelectedIndex) { case 0: // 컨베어 this.ParentForm.ParentForm.CurrentSystemParameter1.EquipmentType = "0"; break; case 1: // 정지계량 this.ParentForm.ParentForm.CurrentSystemParameter1.EquipmentType = "6"; break; case 2: // 업다운 this.ParentForm.ParentForm.CurrentSystemParameter1.EquipmentType = "4"; break; default: this.ParentForm.ParentForm.CurrentSystemParameter1.EquipmentType = "0"; break; } value = Helper.StringZeroFillDigits4(this.ParentForm.ParentForm.CurrentSystemParameter1.EquipmentType); this.ParentForm.CenterSystemJudgmentManual.ChangeScreen(); this.ParentForm.CenterInforSystem2.ReInitializeDesign(); this.ParentForm.ParentForm.SaveSystemParameter1File(this.ParentForm.ParentForm.CurrentSystemParameter1); this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress.EquipmentType, value); } private void buttonCommunicationOption_Click(object sender, EventArgs e) { if (this.buttonCommunicationOption.ButtonStatus == SmartButton.BUTSTATUS.DOWN) this.ParentForm.ParentForm.SystemConfig2.IsCommunicationOption = true; else this.ParentForm.ParentForm.SystemConfig2.IsCommunicationOption = false; this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2); this.ParentForm.ParentForm.ChildFormMenu.CenterConfiSerial.ChangeCommunicationMode(); this.ParentForm.ParentForm.ChildFormMenu.CenterConfiEthernet.ChangeCommunicationMode(); } private void labelConveyorLength_Click(object sender, EventArgs e) { string value = "", message = ""; DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelConveyorLength.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.IntValue < 1 || myKeyPad.IntValue > 2000) { // 입력범위를 확인하세요 DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language, message); myMsg.ShowDialog(); } else { this.labelConveyorLength.Text = myKeyPad.StringValue; this.ParentForm.ParentForm.SystemConfig2.ConveyorLength = myKeyPad.IntValue; this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2); } } } private void labelFilter_Click(object sender, EventArgs e) { string value = "", message = ""; DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelFilter.Text, 2, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language); if (myKeyPad.ShowDialog() == DialogResult.OK) { if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 16) { // 입력범위를 확인하세요 message = "1~16"; DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig1.Language, message); myMsg.ShowDialog(); } else { this.labelFilter.Text = myKeyPad.StringValue; this.ParentForm.ParentForm.CurrentJudgmentSetItem.Filter = myKeyPad.IntValue; value = Helper.StringZeroFillDigits4(myKeyPad.StringValue); this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress.Filter, value); this.ParentForm.ParentForm.SaveJudgmentSetFile(this.ParentForm.ParentForm.CurrentJudgmentSetItem, this.ParentForm.ParentForm.SystemConfig1.ProductNumber - 1); } } } private void labelMovingAverage_Click(object sender, EventArgs e) { string value = "", message = ""; DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelMovingAverage.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig1.Language); if (myKeyPad.ShowDialog() == DialogResult.OK) { this.labelMovingAverage.Text = myKeyPad.StringValue; value = Helper.StringZeroFillDigits4(myKeyPad.StringValue); this.ParentForm.ParentForm.CurrentJudgmentSetItem.MovingAverage = myKeyPad.IntValue; this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress.MovingAverage, value); this.ParentForm.ParentForm.SaveJudgmentSetFile(this.ParentForm.ParentForm.CurrentJudgmentSetItem, this.ParentForm.ParentForm.SystemConfig1.ProductNumber - 1); } } private void comboBoxOptionBoard_SelectedIndexChanged(object sender, EventArgs e) { string value = ""; if (this.comboBoxOptionBoard.SelectedIndex == 2) { this.ParentForm.ParentForm.CurrentSystemParameter1.PI7 = 1; this.ParentForm.ParentForm.CurrentSystemParameter1.PI6 = 1; this.ParentForm.ParentForm.CurrentSystemParameter1.PI5 = 1; } else { if (int.Parse(this.ParentForm.ParentForm.CurrentSystemParameter1.OptionBoard) == 2) { this.ParentForm.ParentForm.CurrentSystemParameter1.PI7 = 0; this.ParentForm.ParentForm.CurrentSystemParameter1.PI6 = 0; this.ParentForm.ParentForm.CurrentSystemParameter1.PI5 = 0; } } value = Helper.StringZeroFillDigits4(this.comboBoxOptionBoard.SelectedIndex.ToString()); this.ParentForm.ParentForm.CurrentSystemParameter1.OptionBoard = value; this.ParentForm.ParentForm.ChildFormMenu.CenterConfiOptionBoard.InitializeDesign(); this.ParentForm.ParentForm.SaveSystemParameter1File(this.ParentForm.ParentForm.CurrentSystemParameter1); this.ParentForm.ParentForm.TransferParameter1(); } private void comboBoxFilenameExtension_SelectedIndexChanged(object sender, EventArgs e) { this.ParentForm.ParentForm.SystemConfig2.FileNameExtension = this.comboBoxFilenameExtension.SelectedIndex; this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2); } private void comboBoxStatisticsPrintFormat_SelectedIndexChanged(object sender, EventArgs e) { string value = ""; value = Helper.StringZeroFillDigits4(this.comboBoxStatisticsPrintFormat.SelectedIndex.ToString()); this.ParentForm.ParentForm.SystemConfig1.StatisticsPrintFormat = this.comboBoxStatisticsPrintFormat.SelectedIndex; this.ParentForm.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.ParentForm.SystemConfig1); } private void buttonBarcode_Click(object sender, EventArgs e) { DialogFormYesNo myDlg; if (this.buttonBarcode.ButtonStatus == SmartButton.BUTSTATUS.UP) myDlg = new DialogFormYesNo(this.ParentForm.ParentForm.SystemConfig1.Language, 18); // 사용을 중지하시겠습니까? else myDlg = new DialogFormYesNo(this.ParentForm.ParentForm.SystemConfig1.Language, 17); // 사용하시겠습니까? if (myDlg.ShowDialog() == DialogResult.Yes) { if (this.buttonBarcode.ButtonStatus == SmartButton.BUTSTATUS.UP) this.ParentForm.ParentForm.SystemConfig1.IsBarcodeEnable = false; else this.ParentForm.ParentForm.SystemConfig1.IsBarcodeEnable = true; this.ParentForm.ParentForm.SystemConfig1.SerialCOM3BaudRate = 0; this.ParentForm.ParentForm.SystemConfig1.SerialCOM3Mode = 0; this.ParentForm.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.ParentForm.SystemConfig1); if (this.ParentForm.ParentForm.SystemConfig2.IsUsingRandomMode == true) { this.ParentForm.ParentForm.SystemConfig2.IsGroup1UsingRandomMode = false; this.ParentForm.ParentForm.SystemConfig2.IsGroup2UsingRandomMode = false; this.ParentForm.ParentForm.SystemConfig2.IsGroup3UsingRandomMode = false; this.ParentForm.ParentForm.SystemConfig2.IsGroup4UsingRandomMode = false; this.ParentForm.ParentForm.SystemConfig2.IsGroup5UsingRandomMode = false; this.ParentForm.ParentForm.SaveSystemConfigurationFile2(this.ParentForm.ParentForm.SystemConfig2); } DialogFormMessage msg = new DialogFormMessage(18, this.ParentForm.ParentForm.SystemConfig1.Language); msg.ShowDialog(); } else { if (this.ParentForm.ParentForm.SystemConfig1.IsBarcodeEnable == false) this.buttonBarcode.ButtonUp(); else this.buttonBarcode.ButtonDown(); } } private void comboBoxFormat_SelectedIndexChanged(object sender, EventArgs e) { string value = ""; value = Helper.StringZeroFillDigits4(this.comboBoxDataBackupFormat.SelectedIndex.ToString()); this.ParentForm.ParentForm.SystemConfig1.DatabackupFormat = this.comboBoxDataBackupFormat.SelectedIndex; this.ParentForm.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.ParentForm.SystemConfig1); } private void buttonCapture_Click(object sender, EventArgs e) { string filePath = ""; Bitmap bitMap = new Bitmap(800, 480); bitMap = IntechGraphics.CopyFromScreen(); filePath = string.Format("{0}{1}_EngineerSetting.jpg", this.ParentForm.ParentForm.PathDataBackupFolder, this.ParentForm.ParentForm.SystemConfig1.SerialNumber); bitMap.Save(filePath, ImageFormat.Jpeg); } private void buttonCommunicationLog_Click(object sender, EventArgs e) { if (this.buttonCommunicationLog.ButtonStatus == SmartButton.BUTSTATUS.DOWN) { this.ParentForm.ParentForm.smartFileCommunicationLog.Close(); this.ParentForm.ParentForm.smartFileCommunicationLog.Open(this.ParentForm.ParentForm.BufferSmartUart); this.ParentForm.ParentForm.IsCommunicationLogOpen = true; } else { this.ParentForm.ParentForm.smartFileCommunicationLog.Close(); this.ParentForm.ParentForm.IsCommunicationLogOpen = false; } } #endregion } }