using System; using System.Linq; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using SmartX; using INT_PT002.Controls; using INT_PT002.DataStore; using INT_PT002.DialogForms; using INT_PT002.Part11_UserManager; namespace INT_PT002.Forms { public partial class FormMenu : Form { #region Field private FormMain m_ParentForm; // Recipe private ControlMenuRecipeSetting Child_Recipe_Setting; // User private ControlMenuUserUserEditor Child_User_UserEditor; private ControlMenuUserGroupEditor Child_User_GroupEditor; // Manual private ControlMenuManualIoTest Child_Manual_IoTest; // Log private ControlMenuLogHistory Child_Log_History; private ControlMenuLogInspection Child_Log_Inspection; private ControlMenuLogAlarm Child_Log_Alarm; // System private ControlMenuSystemInformation Child_System_Information; private ControlMenuSystemStatus Child_System_Status; public Define.E_TopMenuStore SelectedTopMenu; public Define.E_MenuRecipeStore SelectedMenuRecipe; public Define.E_MenuUserStore SelectedMenuUser; public Define.E_MenuManualStore SelectedMenuManual; public Define.E_MenuLogStore SelectedMenuLog; public Define.E_MenuSystemStore SelectedMenuSystem; private Queue Q_FileList = new Queue(); #endregion #region Constructor public FormMenu(FormMain parent) { InitializeComponent(); this.ParentForm = parent; this.Initialize(); this.CreateChildControls(); } #endregion #region Property public FormMain ParentForm { get { return this.m_ParentForm; } private set { this.m_ParentForm = value; } } #endregion #region Method private void Initialize() { this.SelectedTopMenu = Define.E_TopMenuStore.Recipe; this.SelectedMenuRecipe = Define.E_MenuRecipeStore._0_None; this.SelectedMenuUser = Define.E_MenuUserStore._0_None; this.SelectedMenuManual = Define.E_MenuManualStore._0_None; this.SelectedMenuLog = Define.E_MenuLogStore._0_None; this.SelectedMenuSystem = Define.E_MenuSystemStore._0_None; } private void CreateChildControls() { this.Child_Recipe_Setting = new ControlMenuRecipeSetting(this); this.Child_User_UserEditor = new ControlMenuUserUserEditor(this); this.Child_User_GroupEditor = new ControlMenuUserGroupEditor(this); this.Child_Manual_IoTest = new ControlMenuManualIoTest(this); this.Child_Log_History = new ControlMenuLogHistory(this); this.Child_Log_Inspection = new ControlMenuLogInspection(this); this.Child_Log_Alarm = new ControlMenuLogAlarm(this); this.Child_System_Information = new ControlMenuSystemInformation(this); this.Child_System_Status = new ControlMenuSystemStatus(this); this.Controls.Add(this.Child_Recipe_Setting); this.Controls.Add(this.Child_User_UserEditor); this.Controls.Add(this.Child_User_GroupEditor); this.Controls.Add(this.Child_Manual_IoTest); this.Controls.Add(this.Child_Log_Alarm); this.Controls.Add(this.Child_Log_History); this.Controls.Add(this.Child_Log_Inspection); this.Controls.Add(this.Child_System_Information); this.Controls.Add(this.Child_System_Status); this.Child_Recipe_Setting.Location = new Point(0, 39); this.Child_User_UserEditor.Location = new Point(0, 39); this.Child_User_GroupEditor.Location = new Point(0, 39); this.Child_Manual_IoTest.Location = new Point(0, 39); this.Child_Log_Alarm.Location = new Point(0, 39); this.Child_Log_History.Location = new Point(0, 39); this.Child_Log_Inspection.Location = new Point(0, 39); this.Child_System_Information.Location = new Point(0, 39); this.Child_System_Status.Location = new Point(0, 39); } public void UpdateButtonColor() { this.buttonRecipe.ButtonColor = this.ParentForm.ButtonColorChange(this.buttonRecipe.Enabled); this.buttonUser.ButtonColor = this.ParentForm.ButtonColorChange(this.buttonUser.Enabled); this.buttonManual.ButtonColor = this.ParentForm.ButtonColorChange(this.buttonManual.Enabled); this.buttonLog.ButtonColor = this.ParentForm.ButtonColorChange(this.buttonLog.Enabled); this.buttonSystem.ButtonColor = this.ParentForm.ButtonColorChange(this.buttonSystem.Enabled); } private void UpdateDisplayUser(UserItem user) { string id = "", group = ""; switch (user.Status) { case Define.E_UserStatus.Level1: id = user.ID; group = user.Status.ToString(); this.buttonRecipe.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsRecipeEnable; this.buttonUser.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsUserEnable; this.buttonManual.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsManualEnable; this.buttonLog.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsLogEnable; this.buttonSystem.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsSystemEnable; break; case Define.E_UserStatus.Level2: id = user.ID; group = user.Status.ToString(); this.buttonRecipe.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsRecipeEnable; this.buttonUser.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsUserEnable; this.buttonManual.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsManualEnable; this.buttonLog.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsLogEnable; this.buttonSystem.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsSystemEnable; break; case Define.E_UserStatus.Level3: id = user.ID; group = user.Status.ToString(); this.buttonRecipe.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsRecipeEnable; this.buttonUser.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsUserEnable; this.buttonManual.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsManualEnable; this.buttonLog.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsLogEnable; this.buttonSystem.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsSystemEnable; break; case Define.E_UserStatus.Developer: id = user.ID; group = user.Status.ToString(); this.buttonRecipe.Enabled = true; this.buttonUser.Enabled = true; this.buttonManual.Enabled = true; this.buttonLog.Enabled = true; this.buttonSystem.Enabled = true; //this.buttonHiddenMenu.Enabled = true; break; default: id = ""; group = "Off"; this.buttonRecipe.Enabled = false; this.buttonUser.Enabled = false; this.buttonManual.Enabled = false; this.buttonLog.Enabled = false; this.buttonSystem.Enabled = false; break; } this.UpdateButtonColor(); if (this.labelUserLevel.Text != group) this.labelUserLevel.Text = group; if (this.labelUserID.Text != id) this.labelUserID.Text = id; } public void UpdateDisplayAlarmView(AlarmList alarm) { string value = ""; // ServoEmergencyStop if (alarm.IsServoEmergencyStop == true) value = "a1_Servo emergency stop "; // Servo1Alarm if (alarm.IsServo1Alarm == true) value += "a2_Servo1 "; // Servo2Alarm if (alarm.IsServo2Alarm == true) value += "a3_Servo2 "; // ServoTorque1AlarmTorque if (alarm.IsServoTorque1AlarmTorque == true) value += "a4_Servo1 Torque "; // ServoTorque2AlarmTorque if (alarm.IsServoTorque2AlarmTorque == true) value += "a5_Servo2 Torque "; // PressureError if (alarm.IsPressureError == true) value += "a6_Pressure "; value = value.Trim(); this.labelAlarm.Size = new Size(value.Length * 9, 30); this.labelAlarm.Text = value; if (this.labelAlarm.Width > 465) { if (this.labelAlarm.Text != "") this.smartTimerAlarm.Start(); } else { this.smartTimerAlarm.Stop(); this.labelAlarm.Location = new Point(0, 0); } } #region Log // FileCopy public void FileCopy(Define.E_DataType type, string targetFileFullPath) { string targetPath = "", destTargetPath = "", sourceFolderPath = "", sourceFilePath = "", destFilePath = ""; string[] result; DirectoryInfo dir; FileInfo[] files; try { #region USB 장착 유무 체크 targetPath = "하드 디스크\\"; // USB 장착 유무 체크 dir = new DirectoryInfo(targetPath); if (dir.Exists == false) { // USB메모리가 장착되지 않았습니다 DialogFormMessage msg1 = new DialogFormMessage(5, this.ParentForm.SystemConfig.LANGUAGE); msg1.ShowDialog(); SmartSplash.Finish(); return; } #endregion // USB\SerialNumber\Inspection or Alarm or History destTargetPath = string.Format("{0}{1}\\{2}\\", targetPath, this.ParentForm.SystemConfig.SERIAL_NUMBER, type); switch(type) { case Define.E_DataType.Inspection: sourceFolderPath = this.ParentForm.PathDataInspectionFolder; break; case Define.E_DataType.History: sourceFolderPath = this.ParentForm.PathDataHistoryFolder; break; case Define.E_DataType.Alarm: sourceFolderPath = this.ParentForm.PathDataAlarmFolder; break; default: sourceFolderPath = this.ParentForm.PathDataInspectionFolder; break; } SmartSplash.Start(SmartX.SmartSplash.BuiltInLoadingImages.LOADING1_SMALL, 200); this.CopyFile(sourceFolderPath + targetFileFullPath, destTargetPath + targetFileFullPath); // 복사 완료 메시지 DialogFormMessage msg2 = new DialogFormMessage("1", this.ParentForm.SystemConfig.LANGUAGE); SmartSplash.Finish(); msg2.ShowDialog(); } catch { // 제조사에 문의하세요 DialogFormMessage msg = new DialogFormMessage(6, this.ParentForm.SystemConfig.LANGUAGE); SmartSplash.Finish(); msg.ShowDialog(); return; } } public void CopyFolder(string sourceFolder, string destFolder) { if (!Directory.Exists(destFolder)) Directory.CreateDirectory(destFolder); string[] files = Directory.GetFiles(sourceFolder); string[] folders = Directory.GetDirectories(sourceFolder); foreach (string file in files) { string name = Path.GetFileName(file); string dest = Path.Combine(destFolder, name); File.Copy(file, dest); } foreach (string folder in folders) { string name = Path.GetFileName(folder); string dest = Path.Combine(destFolder, name); this.CopyFolder(folder, dest); } } public void CopyFile(string sourceFile, string destFile) { string[] targetPath = destFile.Split('\\'); StringBuilder sb = new StringBuilder(); for (int i = 0; i < targetPath.Length - 1; i++) { sb.Append(targetPath[i]); sb.Append("\\"); } if (!Directory.Exists(sb.ToString())) Directory.CreateDirectory(sb.ToString()); File.Copy(sourceFile, destFile); //string[] files = Directory.GetFiles(sourceFolder); //string[] folders = Directory.GetDirectories(sourceFolder); //foreach (string file in files) //{ // if (targetFileFullPath == file) // { // string name = Path.GetFileName(file); // string dest = Path.Combine(destFolder, name); // File.Copy(sourceFile, destFile); // return; // } //} //foreach (string folder in folders) //{ // for (int i = 0; i < targetPath.Length; i++) // { // if (targetPath[i] == folder) // { // string name = Path.GetFileName(folder); // string dest = Path.Combine(destFolder, name); // this.CopyFolder(folder, dest); // } // } //} } public List DirectorySort(DirectoryInfo[] directorys) { List listDirectory = new List(); Dictionary dirNames = new Dictionary(); foreach (DirectoryInfo dir in directorys) dirNames.Add(dir.Name, int.Parse(dir.Name)); // 순서데로 오름차순 정렬 var vrList = dirNames.OrderBy(x => x.Value); foreach (var v in vrList) listDirectory.Add(v.Key); return listDirectory; } private List GetSeletedNodeList(TreeView tree) { int yearCNT, monthCNT, dayCNT; List listSelectedFile = new List(); yearCNT = tree.Nodes.Count; if (yearCNT != 0) { for (int i = 0; i < yearCNT; i++) { monthCNT = tree.Nodes[i].Nodes.Count; if (monthCNT != 0) { for (int j = 0; j < monthCNT; j++) { dayCNT = tree.Nodes[i].Nodes[j].Nodes.Count; if (dayCNT != 0) { for (int k = 0; k < dayCNT; k++) { if (tree.Nodes[i].Nodes[j].Nodes[k].Checked == true) { //listSelectedFile.Add(tree.Nodes[i].Nodes[j].Nodes[k].Text); listSelectedFile.Add(string.Format("{0}\\{1}\\{2}", tree.Nodes[i].Text, tree.Nodes[i].Nodes[j].Text, tree.Nodes[i].Nodes[j].Nodes[k].Text)); } } } } } } } return listSelectedFile; } #endregion private void SetTopMenu(Define.E_TopMenuStore bottom) { switch (bottom) { case Define.E_TopMenuStore.Recipe: this.buttonRecipe.ButtonDown(); this.buttonUser.ButtonUp(); this.buttonManual.ButtonUp(); this.buttonLog.ButtonUp(); this.buttonSystem.ButtonUp(); this.buttonBottom1.ButtonText = "Setting"; this.buttonBottom1.Visible = true; this.buttonBottom2.Visible = false; this.buttonBottom3.Visible = false; this.buttonBottom4.Visible = false; this.SelectedMenuRecipe = Define.E_MenuRecipeStore._1_Setting; this.SetBottomMenuRecipe(this.SelectedMenuRecipe); break; case Define.E_TopMenuStore.User: this.buttonRecipe.ButtonUp(); this.buttonUser.ButtonDown(); this.buttonManual.ButtonUp(); this.buttonLog.ButtonUp(); this.buttonSystem.ButtonUp(); this.buttonBottom1.ButtonText = "User Edit"; this.buttonBottom2.ButtonText = "Group Edit"; this.buttonBottom1.Visible = true; this.buttonBottom2.Visible = true; this.buttonBottom3.Visible = false; this.buttonBottom4.Visible = false; this.SelectedMenuUser = Define.E_MenuUserStore._1_UserEditor; this.SetBottomMenuUser(this.SelectedMenuUser); break; case Define.E_TopMenuStore.Manual: this.buttonRecipe.ButtonUp(); this.buttonUser.ButtonUp(); this.buttonManual.ButtonDown(); this.buttonLog.ButtonUp(); this.buttonSystem.ButtonUp(); this.buttonBottom1.ButtonText = "IO Test"; this.buttonBottom1.Visible = true; this.buttonBottom2.Visible = false; this.buttonBottom3.Visible = false; this.buttonBottom4.Visible = false; this.SelectedMenuManual = Define.E_MenuManualStore._1_IoTest; this.SetBottomMenuManual(this.SelectedMenuManual); break; case Define.E_TopMenuStore.Log: this.buttonRecipe.ButtonUp(); this.buttonUser.ButtonUp(); this.buttonManual.ButtonUp(); this.buttonLog.ButtonDown(); this.buttonSystem.ButtonUp(); this.buttonBottom1.ButtonText = "Inspection"; this.buttonBottom2.ButtonText = "History"; this.buttonBottom3.ButtonText = "Alarm"; this.buttonBottom1.Visible = true; this.buttonBottom2.Visible = true; this.buttonBottom3.Visible = true; this.buttonBottom4.Visible = false; this.SelectedMenuLog = Define.E_MenuLogStore._1_Inspection; this.SetBottomMenuLog(this.SelectedMenuLog); break; case Define.E_TopMenuStore.System: this.buttonRecipe.ButtonUp(); this.buttonUser.ButtonUp(); this.buttonManual.ButtonUp(); this.buttonLog.ButtonUp(); this.buttonSystem.ButtonDown(); this.buttonBottom1.ButtonText = "Information"; this.buttonBottom2.ButtonText = "Equipment"; this.buttonBottom1.Visible = true; this.buttonBottom2.Visible = true; this.buttonBottom3.Visible = false; this.buttonBottom4.Visible = false; this.SelectedMenuSystem = Define.E_MenuSystemStore._1_Information; this.SetBottomMenuSystem(this.SelectedMenuSystem); break; default: this.buttonBottom1.Visible = false; this.buttonBottom2.Visible = false; this.buttonBottom3.Visible = false; this.buttonBottom4.Visible = false; break; } this.UpdateButtonColor(); } private void SetBottomMenuRecipe(Define.E_MenuRecipeStore menu) { switch (menu) { case Define.E_MenuRecipeStore._0_None: break; case Define.E_MenuRecipeStore._1_Setting: this.Child_Recipe_Setting.DisplayRefresh(); this.Child_Recipe_Setting.BringToFront(); this.buttonBottom1.ButtonDown(); this.buttonBottom2.ButtonUp(); this.buttonBottom3.ButtonUp(); this.buttonBottom4.ButtonUp(); break; default: break; } } private void SetBottomMenuUser(Define.E_MenuUserStore menu) { switch (menu) { case Define.E_MenuUserStore._1_UserEditor: this.Child_User_UserEditor.DisplayRefresh(); this.Child_User_UserEditor.BringToFront(); this.buttonBottom1.ButtonDown(); this.buttonBottom2.ButtonUp(); this.buttonBottom3.ButtonUp(); this.buttonBottom4.ButtonUp(); break; case Define.E_MenuUserStore._2_GroupEditor: this.Child_User_GroupEditor.DisplayRefresh(); this.Child_User_GroupEditor.BringToFront(); this.buttonBottom1.ButtonUp(); this.buttonBottom2.ButtonDown(); this.buttonBottom3.ButtonUp(); this.buttonBottom4.ButtonUp(); break; default: break; } } private void SetBottomMenuManual(Define.E_MenuManualStore menu) { switch (menu) { case Define.E_MenuManualStore._1_IoTest: this.Child_Manual_IoTest.DisplayRefresh(); this.Child_Manual_IoTest.BringToFront(); this.buttonBottom1.ButtonDown(); this.buttonBottom2.ButtonUp(); this.buttonBottom3.ButtonUp(); this.buttonBottom4.ButtonUp(); break; default: break; } } private void SetBottomMenuLog(Define.E_MenuLogStore menu) { switch (menu) { case Define.E_MenuLogStore._1_Inspection: this.Child_Log_Inspection.BringToFront(); this.Child_Log_Inspection.DisplayRefresh(); this.buttonBottom1.ButtonDown(); this.buttonBottom2.ButtonUp(); this.buttonBottom3.ButtonUp(); this.buttonBottom4.ButtonUp(); break; case Define.E_MenuLogStore._2_History: this.Child_Log_History.BringToFront(); this.Child_Log_History.DisplayRefresh(); this.buttonBottom1.ButtonUp(); this.buttonBottom2.ButtonDown(); this.buttonBottom3.ButtonUp(); this.buttonBottom4.ButtonUp(); break; case Define.E_MenuLogStore._3_Alarm: this.Child_Log_Alarm.BringToFront(); this.Child_Log_Alarm.DisplayRefresh(); this.buttonBottom1.ButtonUp(); this.buttonBottom2.ButtonUp(); this.buttonBottom3.ButtonDown(); this.buttonBottom4.ButtonUp(); break; default: break; } } private void SetBottomMenuSystem(Define.E_MenuSystemStore menu) { switch (menu) { case Define.E_MenuSystemStore._1_Information: this.Child_System_Information.DisplayRefresh(); this.Child_System_Information.BringToFront(); this.buttonBottom1.ButtonDown(); this.buttonBottom2.ButtonUp(); this.buttonBottom3.ButtonUp(); this.buttonBottom4.ButtonUp(); break; case Define.E_MenuSystemStore._2_Status: this.Child_System_Status.DisplayRefresh(); this.Child_System_Status.BringToFront(); this.buttonBottom1.ButtonUp(); this.buttonBottom2.ButtonDown(); this.buttonBottom3.ButtonUp(); this.buttonBottom4.ButtonUp(); break; default: break; } } // Menu public void UpdateEquipmentStatusDisplay(Define.E_EquipmentStatus status) { if (status == Define.E_EquipmentStatus.Start) { #region Start this.labelStart.Visible = true; this.labelStop.Visible = false; #endregion this.Set_Equipment_ButtonEnable(false); } else { #region Stop this.labelStart.Visible = false; this.labelStop.Visible = true; #endregion this.Set_Equipment_ButtonEnable(true); } } public void Set_Equipment_ButtonEnable(bool data) { if (data == true) { this.buttonRecipe.Enabled = true; this.buttonUser.Enabled = true; this.buttonManual.Enabled = true; this.buttonLog.Enabled = true; this.buttonSystem.Enabled = true; this.buttonBottom1.Enabled = true; this.buttonBottom2.Enabled = true; this.buttonBottom3.Enabled = true; this.buttonBottom4.Enabled = true; this.buttonHome.Enabled = true; } else { this.buttonRecipe.Enabled = false; this.buttonUser.Enabled = false; this.buttonManual.Enabled = false; this.buttonLog.Enabled = false; this.buttonSystem.Enabled = false; this.buttonBottom1.Enabled = false; this.buttonBottom2.Enabled = false; this.buttonBottom3.Enabled = false; this.buttonBottom4.Enabled = false; this.buttonHome.Enabled = false; } this.UpdateButtonColor(); } // Menu Recipe public void UpdateDisplayRecipeData(Recipe item) { this.Child_Recipe_Setting.UpdateDisplayControlData(item); } // Menu Manual public void UpdateDisplayIOTestAlarmView(AlarmList data) { this.Child_Manual_IoTest.UpdateDisplayAlarmView(data); } public void UpdateDisplayIOTestInputData(Collection datas) { this.Child_Manual_IoTest.UpdateDisplayInputData(datas); } // 변위센서 데이터 public void UpdateDisplayIOTestDispData(Collection datas) { this.Child_Manual_IoTest.UpdateDisplayDispData(datas); } public void UpdateDisplayIOTestDispData1(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDispData1(data); } public void UpdateDisplayIOTestDispData2(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDispData2(data); } public void UpdateDisplayIOTestDispData3(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDispData3(data); } public void UpdateDisplayIOTestDispData4(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDispData4(data); } public void UpdateDisplayIOTestDispData5(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDispData5(data); } public void UpdateDisplayIOTestDispData6(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDispData6(data); } public void UpdateDisplayIOTestDispData7(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDispData7(data); } public void UpdateDisplayIOTestDispData8(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDispData8(data); } public void UpdateDisplayIOTestDispData9(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDispData9(data); } public void UpdateDisplayIOTestDispData10(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDispData10(data); } // 차압센서 데이터 public void UpdateDisplayIOTestDiffData(Collection datas) { this.Child_Manual_IoTest.UpdateDisplayDiffData(datas); } public void UpdateDisplayIOTestDiffData1(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDiffData1(data); } public void UpdateDisplayIOTestDiffData2(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDiffData2(data); } public void UpdateDisplayIOTestDiffData3(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDiffData3(data); } public void UpdateDisplayIOTestDiffData4(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDiffData4(data); } public void UpdateDisplayIOTestDiffData5(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDiffData5(data); } public void UpdateDisplayIOTestDiffData6(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDiffData6(data); } public void UpdateDisplayIOTestDiffData7(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDiffData7(data); } public void UpdateDisplayIOTestDiffData8(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDiffData8(data); } public void UpdateDisplayIOTestDiffData9(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDiffData9(data); } public void UpdateDisplayIOTestDiffData10(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayDiffData10(data); } // 압력센서 데이터 public void UpdateDisplayIOTestPresData(Collection datas) { this.Child_Manual_IoTest.UpdateDisplayPresData(datas); } public void UpdateDisplayIOTestPresData1(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayPresData1(data); } public void UpdateDisplayIOTestPresData2(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayPresData2(data); } public void UpdateDisplayIOTestPresData3(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayPresData3(data); } public void UpdateDisplayIOTestPresData4(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayPresData4(data); } public void UpdateDisplayIOTestPresData5(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayPresData5(data); } public void UpdateDisplayIOTestPresData6(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayPresData6(data); } public void UpdateDisplayIOTestPresData7(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayPresData7(data); } public void UpdateDisplayIOTestPresData8(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayPresData8(data); } public void UpdateDisplayIOTestPresData9(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayPresData9(data); } public void UpdateDisplayIOTestPresData10(LeakData1 data) { this.Child_Manual_IoTest.UpdateDisplayPresData10(data); } // Menu System public void UpdateMainBoardVersionDisplay(string data) { this.Child_System_Information.UpdateMainBoardVersionDisplay(data); } // Menu User public void UpdateLevelNameDisplay(SystemConfiguration data) { this.Child_User_UserEditor.UpdateLevelNameDisplay(data); } public void CallBackGetUserData(UserManager.UserMgr_user_list_t userList) { this.Child_User_UserEditor.CallBackGetUserData(userList); } public void CallBackUserListLockDataEvent(UserManager.UserMgr_user_lock_t user) { this.Child_User_UserEditor.CallBackUserListLockDataEvent(user); } public void CallBackUserListDeleteDataEvent(UserManager.UserMgr_user_del_t user) { this.Child_User_UserEditor.CallBackUserListDeleteDataEvent(user); } public void CallBackUserModifyUserData(UserManager.UserMgr_user_modify_t user) { this.Child_User_UserEditor.CallBackUserModifyUserData(user); } public void CallBackUserListNewData(UserManager.UserMgr_user_info_t user) { this.Child_User_UserEditor.CallBackUserListNewData(user); } // Menu System public void UpdateDisplayEquipmentAlarmView(AlarmList data) { this.Child_System_Status.UpdateDisplayAlarmView(data); } public void UpdateDisplayEquipmentProcessStatusDisplay(Define.E_ProcessStatus status) { this.Child_System_Status.UpdateProcessStatusDisplay(status); } // 변위센서 데이터 public void UpdateDisplayEquipmentDispData(Collection datas) { this.Child_System_Status.UpdateDisplayDispData(datas); } public void UpdateDisplayEquipmentDispData1(LeakData1 data) { this.Child_System_Status.UpdateDisplayDispData1(data); } public void UpdateDisplayEquipmentDispData2(LeakData1 data) { this.Child_System_Status.UpdateDisplayDispData2(data); } public void UpdateDisplayEquipmentDispData3(LeakData1 data) { this.Child_System_Status.UpdateDisplayDispData3(data); } public void UpdateDisplayEquipmentDispData4(LeakData1 data) { this.Child_System_Status.UpdateDisplayDispData4(data); } public void UpdateDisplayEquipmentDispData5(LeakData1 data) { this.Child_System_Status.UpdateDisplayDispData5(data); } public void UpdateDisplayEquipmentDispData6(LeakData1 data) { this.Child_System_Status.UpdateDisplayDispData6(data); } public void UpdateDisplayEquipmentDispData7(LeakData1 data) { this.Child_System_Status.UpdateDisplayDispData7(data); } public void UpdateDisplayEquipmentDispData8(LeakData1 data) { this.Child_System_Status.UpdateDisplayDispData8(data); } public void UpdateDisplayEquipmentDispData9(LeakData1 data) { this.Child_System_Status.UpdateDisplayDispData9(data); } public void UpdateDisplayEquipmentDispData10(LeakData1 data) { this.Child_System_Status.UpdateDisplayDispData10(data); } // 차압센서 데이터 public void UpdateDisplayEquipmentDiffData(Collection datas) { this.Child_System_Status.UpdateDisplayDiffData(datas); } public void UpdateDisplayEquipmentDiffData1(LeakData1 data) { this.Child_System_Status.UpdateDisplayDiffData1(data); } public void UpdateDisplayEquipmentDiffData2(LeakData1 data) { this.Child_System_Status.UpdateDisplayDiffData2(data); } public void UpdateDisplayEquipmentDiffData3(LeakData1 data) { this.Child_System_Status.UpdateDisplayDiffData3(data); } public void UpdateDisplayEquipmentDiffData4(LeakData1 data) { this.Child_System_Status.UpdateDisplayDiffData4(data); } public void UpdateDisplayEquipmentDiffData5(LeakData1 data) { this.Child_System_Status.UpdateDisplayDiffData5(data); } public void UpdateDisplayEquipmentDiffData6(LeakData1 data) { this.Child_System_Status.UpdateDisplayDiffData6(data); } public void UpdateDisplayEquipmentDiffData7(LeakData1 data) { this.Child_System_Status.UpdateDisplayDiffData7(data); } public void UpdateDisplayEquipmentDiffData8(LeakData1 data) { this.Child_System_Status.UpdateDisplayDiffData8(data); } public void UpdateDisplayEquipmentDiffData9(LeakData1 data) { this.Child_System_Status.UpdateDisplayDiffData9(data); } public void UpdateDisplayEquipmentDiffData10(LeakData1 data) { this.Child_System_Status.UpdateDisplayDiffData10(data); } // 압력센서 데이터 public void UpdateDisplayEquipmentPresData(Collection datas) { this.Child_System_Status.UpdateDisplayPresData(datas); } public void UpdateDisplayEquipmentPresData1(LeakData1 data) { this.Child_System_Status.UpdateDisplayPresData1(data); } public void UpdateDisplayEquipmentPresData2(LeakData1 data) { this.Child_System_Status.UpdateDisplayPresData2(data); } public void UpdateDisplayEquipmentPresData3(LeakData1 data) { this.Child_System_Status.UpdateDisplayPresData3(data); } public void UpdateDisplayEquipmentPresData4(LeakData1 data) { this.Child_System_Status.UpdateDisplayPresData4(data); } public void UpdateDisplayEquipmentPresData5(LeakData1 data) { this.Child_System_Status.UpdateDisplayPresData5(data); } public void UpdateDisplayEquipmentPresData6(LeakData1 data) { this.Child_System_Status.UpdateDisplayPresData6(data); } public void UpdateDisplayEquipmentPresData7(LeakData1 data) { this.Child_System_Status.UpdateDisplayPresData7(data); } public void UpdateDisplayEquipmentPresData8(LeakData1 data) { this.Child_System_Status.UpdateDisplayPresData8(data); } public void UpdateDisplayEquipmentPresData9(LeakData1 data) { this.Child_System_Status.UpdateDisplayPresData9(data); } public void UpdateDisplayEquipmentPresData10(LeakData1 data) { this.Child_System_Status.UpdateDisplayPresData10(data); } // 판정결과 public void UpdateDisplayEquipmentJudgmentData(LeakData datas) { this.Child_System_Status.UpdateDisplayJudgmentData(datas); } public void UpdateDisplayEquipmentJudgmentData1(LeakData1 data) { this.Child_System_Status.UpdateDisplayJudgmentData1(data); } public void UpdateDisplayEquipmentJudgmentData2(LeakData1 data) { this.Child_System_Status.UpdateDisplayJudgmentData2(data); } public void UpdateDisplayEquipmentJudgmentData3(LeakData1 data) { this.Child_System_Status.UpdateDisplayJudgmentData3(data); } public void UpdateDisplayEquipmentJudgmentData4(LeakData1 data) { this.Child_System_Status.UpdateDisplayJudgmentData4(data); } public void UpdateDisplayEquipmentJudgmentData5(LeakData1 data) { this.Child_System_Status.UpdateDisplayJudgmentData5(data); } public void UpdateDisplayEquipmentJudgmentData6(LeakData1 data) { this.Child_System_Status.UpdateDisplayJudgmentData6(data); } public void UpdateDisplayEquipmentJudgmentData7(LeakData1 data) { this.Child_System_Status.UpdateDisplayJudgmentData7(data); } public void UpdateDisplayEquipmentJudgmentData8(LeakData1 data) { this.Child_System_Status.UpdateDisplayJudgmentData8(data); } public void UpdateDisplayEquipmentJudgmentData9(LeakData1 data) { this.Child_System_Status.UpdateDisplayJudgmentData9(data); } public void UpdateDisplayEquipmentJudgmentData10(LeakData1 data) { this.Child_System_Status.UpdateDisplayJudgmentData10(data); } public void DisplayRefresh(SystemStatus status) { this.SelectedTopMenu = Define.E_TopMenuStore.Recipe; this.SetTopMenu(this.SelectedTopMenu); this.UpdateDisplayUser(status.CurrentUser); } #endregion #region Event Handler private void buttonHome_Click(object sender, EventArgs e) { this.buttonRecipe.ButtonDown(); this.buttonUser.ButtonUp(); this.buttonManual.ButtonUp(); this.buttonLog.ButtonUp(); this.buttonSystem.ButtonUp(); this.ParentForm.ChildFormMainDisplay.DisplayRefresh(); this.ParentForm.FormChange((int)Define.E_FormStore.FormMainDisplay); } private void buttonRecipe_Click(object sender, EventArgs e) { if (this.SelectedTopMenu != Define.E_TopMenuStore.Recipe) { this.SelectedTopMenu = Define.E_TopMenuStore.Recipe; this.SetTopMenu(this.SelectedTopMenu); } } private void buttonUser_Click(object sender, EventArgs e) { if (this.SelectedTopMenu != Define.E_TopMenuStore.User) { this.SelectedTopMenu = Define.E_TopMenuStore.User; this.SetTopMenu(this.SelectedTopMenu); } } private void buttonManual_Click(object sender, EventArgs e) { if (this.SelectedTopMenu != Define.E_TopMenuStore.Manual) { this.SelectedTopMenu = Define.E_TopMenuStore.Manual; this.SetTopMenu(this.SelectedTopMenu); } } private void buttonLog_Click(object sender, EventArgs e) { if (this.SelectedTopMenu != Define.E_TopMenuStore.Log) { this.SelectedTopMenu = Define.E_TopMenuStore.Log; this.SetTopMenu(this.SelectedTopMenu); } } private void buttonSystem_Click(object sender, EventArgs e) { if (this.SelectedTopMenu != Define.E_TopMenuStore.System) { this.SelectedTopMenu = Define.E_TopMenuStore.System; this.SetTopMenu(this.SelectedTopMenu); } } private void buttonBottom1_Click(object sender, EventArgs e) { switch (this.SelectedTopMenu) { case Define.E_TopMenuStore.Recipe: this.SelectedMenuRecipe = Define.E_MenuRecipeStore._1_Setting; this.SetBottomMenuRecipe(this.SelectedMenuRecipe); break; case Define.E_TopMenuStore.User: this.SelectedMenuUser = Define.E_MenuUserStore._1_UserEditor; this.SetBottomMenuUser(this.SelectedMenuUser); break; case Define.E_TopMenuStore.Manual: this.SelectedMenuManual = Define.E_MenuManualStore._1_IoTest; this.SetBottomMenuManual(this.SelectedMenuManual); break; case Define.E_TopMenuStore.Log: this.SelectedMenuLog = Define.E_MenuLogStore._1_Inspection; this.SetBottomMenuLog(this.SelectedMenuLog); break; case Define.E_TopMenuStore.System: this.SelectedMenuSystem = Define.E_MenuSystemStore._1_Information; this.SetBottomMenuSystem(this.SelectedMenuSystem); break; default: break; } } private void buttonBottom2_Click(object sender, EventArgs e) { switch (this.SelectedTopMenu) { case Define.E_TopMenuStore.Recipe: this.SelectedMenuRecipe = Define.E_MenuRecipeStore._0_None; this.SetBottomMenuRecipe(this.SelectedMenuRecipe); break; case Define.E_TopMenuStore.User: this.SelectedMenuUser = Define.E_MenuUserStore._2_GroupEditor; this.SetBottomMenuUser(this.SelectedMenuUser); break; case Define.E_TopMenuStore.Manual: this.SelectedMenuManual = Define.E_MenuManualStore._0_None; this.SetBottomMenuManual(this.SelectedMenuManual); break; case Define.E_TopMenuStore.Log: this.SelectedMenuLog = Define.E_MenuLogStore._2_History; this.SetBottomMenuLog(this.SelectedMenuLog); break; case Define.E_TopMenuStore.System: this.SelectedMenuSystem = Define.E_MenuSystemStore._2_Status; this.SetBottomMenuSystem(this.SelectedMenuSystem); break; default: break; } } private void buttonBottom3_Click(object sender, EventArgs e) { switch (this.SelectedTopMenu) { case Define.E_TopMenuStore.Recipe: this.SelectedMenuRecipe = Define.E_MenuRecipeStore._0_None; this.SetBottomMenuRecipe(this.SelectedMenuRecipe); break; case Define.E_TopMenuStore.User: this.SelectedMenuUser = Define.E_MenuUserStore._0_None; this.SetBottomMenuUser(this.SelectedMenuUser); break; case Define.E_TopMenuStore.Manual: this.SelectedMenuManual = Define.E_MenuManualStore._0_None; this.SetBottomMenuManual(this.SelectedMenuManual); break; case Define.E_TopMenuStore.Log: this.SelectedMenuLog = Define.E_MenuLogStore._3_Alarm; this.SetBottomMenuLog(this.SelectedMenuLog); break; case Define.E_TopMenuStore.System: this.SelectedMenuSystem = Define.E_MenuSystemStore._0_None; this.SetBottomMenuSystem(this.SelectedMenuSystem); break; default: break; } } private void buttonBottom4_Click(object sender, EventArgs e) { switch (this.SelectedTopMenu) { case Define.E_TopMenuStore.Recipe: this.SelectedMenuRecipe = Define.E_MenuRecipeStore._0_None; this.SetBottomMenuRecipe(this.SelectedMenuRecipe); break; case Define.E_TopMenuStore.User: this.SelectedMenuUser = Define.E_MenuUserStore._0_None; this.SetBottomMenuUser(this.SelectedMenuUser); break; case Define.E_TopMenuStore.Manual: this.SelectedMenuManual = Define.E_MenuManualStore._0_None; this.SetBottomMenuManual(this.SelectedMenuManual); break; case Define.E_TopMenuStore.Log: this.SelectedMenuLog = Define.E_MenuLogStore._0_None; this.SetBottomMenuLog(this.SelectedMenuLog); break; case Define.E_TopMenuStore.System: this.SelectedMenuSystem = Define.E_MenuSystemStore._0_None; this.SetBottomMenuSystem(this.SelectedMenuSystem); break; default: break; } } private void labelStart_Click(object sender, EventArgs e) { if (this.ParentForm.CurrentSystemStatus.CurrentDisplayMode == Define.E_DisplayModeStore.Equipment) this.ParentForm.TransferData(CommunicationCommand.Stop, CommunicationID.MainBoard); } private void labelStop_Click(object sender, EventArgs e) { if (this.ParentForm.CurrentSystemStatus.CurrentDisplayMode == Define.E_DisplayModeStore.Equipment) this.ParentForm.TransferData(CommunicationCommand.Start, CommunicationID.MainBoard); } private void smartTimerAlarm_Tick(object sender, EventArgs e) { this.labelAlarm.Left = this.labelAlarm.Left - 5; if (this.labelAlarm.Left < 0 - this.labelAlarm.Width - 20) this.labelAlarm.Left = this.smartGroupBox3.Width - 10; } #endregion private void smartButton1_Click(object sender, EventArgs e) { string value = ""; this.smartTimerAlarm.Stop(); value = "a1_Servo emergency stop "; //value += "a2_Servo1 "; //value += "a3_Servo2 "; //value += "a4_Servo1 Torque "; //value += "a5_Servo2 Torque "; //value += "a6_Pressure "; value = value.Trim(); this.labelAlarm.Size = new Size(value.Length * 9, 30); this.labelAlarm.Text = value; if (this.labelAlarm.Width > 465) { if (this.labelAlarm.Text != "") this.smartTimerAlarm.Start(); } else { this.smartTimerAlarm.Stop(); this.labelAlarm.Location = new Point(0, 0); } } private void smartButton2_Click(object sender, EventArgs e) { string value = ""; this.smartTimerAlarm.Stop(); value = "a1_Servo emergency stop "; value += "a2_Servo1 "; //value += "a3_Servo2 "; //value += "a4_Servo1 Torque "; //value += "a5_Servo2 Torque "; //value += "a6_Pressure "; value = value.Trim(); this.labelAlarm.Size = new Size(value.Length * 9, 30); this.labelAlarm.Text = value; if (this.labelAlarm.Width > 465) { if (this.labelAlarm.Text != "") this.smartTimerAlarm.Start(); } else { this.smartTimerAlarm.Stop(); this.labelAlarm.Location = new Point(0, 0); } } private void smartButton3_Click(object sender, EventArgs e) { string value = ""; this.smartTimerAlarm.Stop(); value = "a1_Servo emergency stop "; value += "a2_Servo1 "; value += "a3_Servo2 "; //value += "a4_Servo1 Torque "; //value += "a5_Servo2 Torque "; //value += "a6_Pressure "; value = value.Trim(); this.labelAlarm.Size = new Size(value.Length * 9, 30); this.labelAlarm.Text = value; if (this.labelAlarm.Width > 465) { if (this.labelAlarm.Text != "") this.smartTimerAlarm.Start(); } else { this.smartTimerAlarm.Stop(); this.labelAlarm.Location = new Point(0, 0); } } private void smartButton4_Click(object sender, EventArgs e) { string value = ""; this.smartTimerAlarm.Stop(); value = "a1_Servo emergency stop "; value += "a2_Servo1 "; value += "a3_Servo2 "; value += "a4_Servo1 Torque "; value += "a5_Servo2 Torque "; //value += "a6_Pressure "; value = value.Trim(); this.labelAlarm.Size = new Size(value.Length * 9, 30); this.labelAlarm.Text = value; if (this.labelAlarm.Width > 465) { if (this.labelAlarm.Text != "") this.smartTimerAlarm.Start(); } else { this.smartTimerAlarm.Stop(); this.labelAlarm.Location = new Point(0,0); } } } }