diff --git a/INT_PT002/Controls/Recipe/ControlMenuRecipeSetting.cs b/INT_PT002/Controls/Recipe/ControlMenuRecipeSetting.cs index 8f5e087..a5a30c4 100644 --- a/INT_PT002/Controls/Recipe/ControlMenuRecipeSetting.cs +++ b/INT_PT002/Controls/Recipe/ControlMenuRecipeSetting.cs @@ -1,12 +1,14 @@ 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_PT002.Forms; using INT_PT002.DataStore; using INT_PT002.DialogForms; @@ -18,6 +20,8 @@ namespace INT_PT002.Controls #region Field private FormMenu m_ParentForm; private string MessageBoxRange; + + private Collection CollLabel; #endregion #region Constructor @@ -43,8 +47,66 @@ namespace INT_PT002.Controls { this.smartGroupBox1.Text = "Recipe > Setting"; this.MessageBoxRange = ""; + + this.CollLabel = new Collection(); + this.CollLabel.Add(this.labelNumber); + this.CollLabel.Add(this.labelPressureLevel); + this.CollLabel.Add(this.labelDispEmptyLevel); + this.CollLabel.Add(this.labelDispHoldDelay); + this.CollLabel.Add(this.labelDispMinLevel); + this.CollLabel.Add(this.labelDispStdLevel); + this.CollLabel.Add(this.labelDiffHoldDelay); + this.CollLabel.Add(this.labelDiffLrMean); + this.CollLabel.Add(this.labelDiffLrSecond); + this.CollLabel.Add(this.labelDiffLrTotal); + this.CollLabel.Add(this.labelVacuumRelief); + this.CollLabel.Add(this.labelVacuumHold1); + this.CollLabel.Add(this.labelVacuumHold2); + this.CollLabel.Add(this.labelVacuumBlowoff); + this.CollLabel.Add(this.labelLcdDataPeriod); + this.CollLabel.Add(this.labelChattering); + this.CollLabel.Add(this.labelCutWait); + this.CollLabel.Add(this.labelBuzzer); + this.CollLabel.Add(this.labelSbDiffFilter); } + private void UpdateDisplauUserControls(bool enable) + { + for (int i = 0; i < this.CollLabel.Count; i++) + this.CollLabel[i].Enabled = enable; + } + private void UpdateDisplayUser(UserItem user) + { + switch (user.Status) + { + case Define.E_UserStatus.None: + this.UpdateDisplauUserControls(false); + break; + case Define.E_UserStatus.Level1: + this.UpdateDisplauUserControls(this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuRecipe); + break; + case Define.E_UserStatus.Level2: + this.UpdateDisplauUserControls(this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuRecipe); + break; + case Define.E_UserStatus.Level3: + this.UpdateDisplauUserControls(this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuRecipe); + break; + case Define.E_UserStatus.Admin: + this.UpdateDisplauUserControls(this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuRecipe); + break; + case Define.E_UserStatus.Developer: + this.UpdateDisplauUserControls(true); + break; + case Define.E_UserStatus.NotLogin: + this.UpdateDisplauUserControls(false); + break; + case Define.E_UserStatus.LogOff: + this.UpdateDisplauUserControls(false); + break; + default: + break; + } + } public void UpdateDisplayControlData(Recipe item) { string value = ""; @@ -147,6 +209,8 @@ namespace INT_PT002.Controls this.ParentForm.ParentForm.SetDisplayMode(Define.E_EquipmentMode.Menu); this.UpdateDisplayControlData(this.ParentForm.ParentForm.CurrentRecipe); this.UpdateDisplayControlData(this.ParentForm.ParentForm.SystemConfig); + + this.UpdateDisplayUser(this.ParentForm.ParentForm.CurrentSystemStatus.CurrentUser); } #endregion diff --git a/INT_PT002/Controls/User/ControlMenuUserGroupEditor.cs b/INT_PT002/Controls/User/ControlMenuUserGroupEditor.cs index 52a1f14..ef6a822 100644 --- a/INT_PT002/Controls/User/ControlMenuUserGroupEditor.cs +++ b/INT_PT002/Controls/User/ControlMenuUserGroupEditor.cs @@ -76,7 +76,7 @@ namespace INT_PT002.Controls this.checkBoxL1MainClear.Checked = group.Level1.IsMainDisplayClear; this.checkBoxL1MainSubMenu.Checked = group.Level1.IsMainDisplaySubMenu; - this.checkBoxL1MenuProduct.Checked = group.Level1.IsMenuProduct; + this.checkBoxL1MenuProduct.Checked = group.Level1.IsMenuRecipe; this.checkBoxL1MenuUserSetting.Checked = group.Level1.IsMenuUserSetting; this.checkBoxL1MenuUserGroupEditor.Checked = group.Level1.IsMenuUserGroupEditor; this.checkBoxL1MenuIOTest.Checked = group.Level1.IsMenuIOTest; @@ -92,7 +92,7 @@ namespace INT_PT002.Controls this.checkBoxL2MainClear.Checked = group.Level2.IsMainDisplayClear; this.checkBoxL2MainSubMenu.Checked = group.Level2.IsMainDisplaySubMenu; - this.checkBoxL2MenuProduct.Checked = group.Level2.IsMenuProduct; + this.checkBoxL2MenuProduct.Checked = group.Level2.IsMenuRecipe; this.checkBoxL2MenuUserSetting.Checked = group.Level2.IsMenuUserSetting; this.checkBoxL2MenuUserGroupEditor.Checked = group.Level2.IsMenuUserGroupEditor; this.checkBoxL2MenuIOTest.Checked = group.Level2.IsMenuIOTest; @@ -108,7 +108,7 @@ namespace INT_PT002.Controls this.checkBoxL3MainClear.Checked = group.Level3.IsMainDisplayClear; this.checkBoxL3MainSubMenu.Checked = group.Level3.IsMainDisplaySubMenu; - this.checkBoxL3MenuProduct.Checked = group.Level3.IsMenuProduct; + this.checkBoxL3MenuProduct.Checked = group.Level3.IsMenuRecipe; this.checkBoxL3MenuUserSetting.Checked = group.Level3.IsMenuUserSetting; this.checkBoxL3MenuUserGroupEditor.Checked = group.Level3.IsMenuUserGroupEditor; this.checkBoxL3MenuIOTest.Checked = group.Level3.IsMenuIOTest; @@ -124,7 +124,7 @@ namespace INT_PT002.Controls this.checkBoxDefaultMainClear.Checked = group.Default.IsMainDisplayClear; this.checkBoxDefaultMainSubMenu.Checked = group.Default.IsMainDisplaySubMenu; - this.checkBoxDefaultMenuProduct.Checked = group.Default.IsMenuProduct; + this.checkBoxDefaultMenuProduct.Checked = group.Default.IsMenuRecipe; this.checkBoxDefaultMenuUserSetting.Checked = group.Default.IsMenuUserSetting; this.checkBoxDefaultMenuUserGroupEditor.Checked = group.Default.IsMenuUserGroupEditor; this.checkBoxDefaultMenuIOTest.Checked = group.Default.IsMenuIOTest; @@ -298,7 +298,7 @@ namespace INT_PT002.Controls this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayClear = this.checkBoxL1MainClear.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplaySubMenu = this.checkBoxL1MainSubMenu.Checked; - this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuProduct = this.checkBoxL1MenuProduct.Checked; + this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuRecipe = this.checkBoxL1MenuProduct.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuUserSetting = this.checkBoxL1MenuUserSetting.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuUserGroupEditor = this.checkBoxL1MenuUserGroupEditor.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuIOTest = this.checkBoxL1MenuIOTest.Checked; @@ -314,7 +314,7 @@ namespace INT_PT002.Controls this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayClear = this.checkBoxL2MainClear.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplaySubMenu = this.checkBoxL2MainSubMenu.Checked; - this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuProduct = this.checkBoxL2MenuProduct.Checked; + this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuRecipe = this.checkBoxL2MenuProduct.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuUserSetting = this.checkBoxL2MenuUserSetting.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuUserGroupEditor = this.checkBoxL2MenuUserGroupEditor.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuIOTest = this.checkBoxL2MenuIOTest.Checked; @@ -330,7 +330,7 @@ namespace INT_PT002.Controls this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayClear = this.checkBoxL3MainClear.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplaySubMenu = this.checkBoxL3MainSubMenu.Checked; - this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuProduct = this.checkBoxL3MenuProduct.Checked; + this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuRecipe = this.checkBoxL3MenuProduct.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuUserSetting = this.checkBoxL3MenuUserSetting.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuUserGroupEditor = this.checkBoxL3MenuUserGroupEditor.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuIOTest = this.checkBoxL3MenuIOTest.Checked; @@ -346,7 +346,7 @@ namespace INT_PT002.Controls this.ParentForm.ParentForm.CurrentUserGroup.Default.IsMainDisplayClear = this.checkBoxDefaultMainClear.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Default.IsMainDisplaySubMenu = this.checkBoxDefaultMainSubMenu.Checked; - this.ParentForm.ParentForm.CurrentUserGroup.Default.IsMenuProduct = this.checkBoxDefaultMenuProduct.Checked; + this.ParentForm.ParentForm.CurrentUserGroup.Default.IsMenuRecipe = this.checkBoxDefaultMenuProduct.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Default.IsMenuUserSetting = this.checkBoxDefaultMenuUserSetting.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Default.IsMenuUserGroupEditor = this.checkBoxDefaultMenuUserGroupEditor.Checked; this.ParentForm.ParentForm.CurrentUserGroup.Default.IsMenuIOTest = this.checkBoxDefaultMenuIOTest.Checked; diff --git a/INT_PT002/Controls/User/ControlMenuUserUserEditor.cs b/INT_PT002/Controls/User/ControlMenuUserUserEditor.cs index 50d9f68..e8169e5 100644 --- a/INT_PT002/Controls/User/ControlMenuUserUserEditor.cs +++ b/INT_PT002/Controls/User/ControlMenuUserUserEditor.cs @@ -20,7 +20,7 @@ namespace INT_PT002.Controls #region Field private FormMenu m_ParentForm; - private UserItem CurrentUserItem; + private UserItem SelectedUserItem; #endregion #region Constructor @@ -265,11 +265,11 @@ namespace INT_PT002.Controls this.buttonSave.Visible = false; } } - private void CheckBoxCheckedAsLevel(Define.E_UserGroup level) + private void CheckBoxCheckedAsLevel(Define.E_UserStatus level) { switch (level) { - case Define.E_UserGroup.f0_Level1: + case Define.E_UserStatus.Level1: this.buttonLevel2.ButtonUp(); this.buttonLevel3.ButtonUp(); this.buttonLevel1.ButtonDown(); @@ -280,7 +280,7 @@ namespace INT_PT002.Controls this.checkBoxMainClear.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplayClear; this.checkBoxMainSubMenu.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMainDisplaySubMenu; - this.checkBoxMenuProduct.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuProduct; + this.checkBoxMenuProduct.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuRecipe; this.checkBoxMenuUserSetting.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuUserSetting; this.checkBoxMenuUserGroupEditor.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuUserGroupEditor; this.checkBoxMenuIOTest.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuIOTest; @@ -290,7 +290,7 @@ namespace INT_PT002.Controls this.checkBoxMenuInformation.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuInformation; this.checkBoxMenuStatus.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level1.IsMenuStatus; break; - case Define.E_UserGroup.f1_Level2: + case Define.E_UserStatus.Level2: this.buttonLevel1.ButtonUp(); this.buttonLevel3.ButtonUp(); this.buttonLevel2.ButtonDown(); @@ -301,7 +301,7 @@ namespace INT_PT002.Controls this.checkBoxMainClear.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplayClear; this.checkBoxMainSubMenu.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMainDisplaySubMenu; - this.checkBoxMenuProduct.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuProduct; + this.checkBoxMenuProduct.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuRecipe; this.checkBoxMenuUserSetting.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuUserSetting; this.checkBoxMenuUserGroupEditor.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuUserGroupEditor; this.checkBoxMenuIOTest.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuIOTest; @@ -311,7 +311,7 @@ namespace INT_PT002.Controls this.checkBoxMenuInformation.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuInformation; this.checkBoxMenuStatus.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level2.IsMenuStatus; break; - case Define.E_UserGroup.f2_Level3: + case Define.E_UserStatus.Level3: this.buttonLevel1.ButtonUp(); this.buttonLevel2.ButtonUp(); this.buttonLevel3.ButtonDown(); @@ -322,7 +322,7 @@ namespace INT_PT002.Controls this.checkBoxMainClear.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplayClear; this.checkBoxMainSubMenu.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMainDisplaySubMenu; - this.checkBoxMenuProduct.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuProduct; + this.checkBoxMenuProduct.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuRecipe; this.checkBoxMenuUserSetting.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuUserSetting; this.checkBoxMenuUserGroupEditor.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuUserGroupEditor; this.checkBoxMenuIOTest.Checked = this.ParentForm.ParentForm.CurrentUserGroup.Level3.IsMenuIOTest; @@ -339,7 +339,7 @@ namespace INT_PT002.Controls private void UpdateInitializeUserDisplay(SystemConfiguration system) { - this.CurrentUserItem = new UserItem(); + this.SelectedUserItem = new UserItem(); this.textBoxID.Text = ""; this.textBoxPassword.Text = ""; @@ -383,90 +383,88 @@ namespace INT_PT002.Controls private void UpdateCurrentUserItem(UserManager.UserMgr_user_list_t item) { // CurrentUserItem SET - this.CurrentUserItem.ID = item.user_id; - this.CurrentUserItem.Password = item.user_pw; + this.SelectedUserItem.ID = item.user_id; + this.SelectedUserItem.Password = item.user_pw; - this.CurrentUserItem.ExpireAccount = item.expire_period_account; - this.CurrentUserItem.ExpirePassword = item.expire_period_pw; + this.SelectedUserItem.ExpireAccount = item.expire_period_account; + this.SelectedUserItem.ExpirePassword = item.expire_period_pw; DateTime time = DateTime.ParseExact(item.register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.CurrentUserItem.DateRegister = time; + this.SelectedUserItem.DateRegister = time; time = DateTime.ParseExact(item.login_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.CurrentUserItem.DateLogin = time; + this.SelectedUserItem.DateLogin = time; time = DateTime.ParseExact(item.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.CurrentUserItem.DateExpireRegister = time; + this.SelectedUserItem.DateExpireRegister = time; time = DateTime.ParseExact(item.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.CurrentUserItem.DateExpireLogin = time; + this.SelectedUserItem.DateExpireLogin = time; - this.CurrentUserItem.IsLockAccount = item.flock_status_account == 0 ? false : true; - this.CurrentUserItem.IsLockPassword = item.flock_status_password == 0 ? false : true; + this.SelectedUserItem.IsLockAccount = item.flock_status_account == 0 ? false : true; + this.SelectedUserItem.IsLockPassword = item.flock_status_password == 0 ? false : true; - this.CurrentUserItem.IsAdmin = item.fadmin == 0 ? false : true; - this.CurrentUserItem.IsMainProductChange = item.menuID.fMenu[0]; - this.CurrentUserItem.IsMainWeightSetting = item.menuID.fMenu[1]; - this.CurrentUserItem.IsMainClear = item.menuID.fMenu[2]; - this.CurrentUserItem.IsMainSubMenu = item.menuID.fMenu[3]; + this.SelectedUserItem.IsAdmin = item.fadmin == 0 ? false : true; + this.SelectedUserItem.IsMainRecipeChange = item.menuID.fMenu[0]; + this.SelectedUserItem.IsMainClear = item.menuID.fMenu[1]; + this.SelectedUserItem.IsMainSubMenu = item.menuID.fMenu[2]; - this.CurrentUserItem.IsMenuProduct = item.menuID.fMenu[4]; - this.CurrentUserItem.IsMenuUserSetting = item.menuID.fMenu[7]; - this.CurrentUserItem.IsMenuUserGroupEditor = item.menuID.fMenu[8]; - this.CurrentUserItem.IsMenuIOTest = item.menuID.fMenu[9]; - this.CurrentUserItem.IsMenuEquipmentLog = item.menuID.fMenu[11]; - this.CurrentUserItem.IsMenuCheckLog = item.menuID.fMenu[12]; - this.CurrentUserItem.IsMenuAlarmList = item.menuID.fMenu[13]; - this.CurrentUserItem.IsMenuInformation = item.menuID.fMenu[14]; - this.CurrentUserItem.IsMenuStatus = item.menuID.fMenu[16]; + this.SelectedUserItem.IsMenuProduct = item.menuID.fMenu[3]; + this.SelectedUserItem.IsMenuUserSetting = item.menuID.fMenu[4]; + this.SelectedUserItem.IsMenuUserGroupEditor = item.menuID.fMenu[5]; + this.SelectedUserItem.IsMenuIOTest = item.menuID.fMenu[6]; + this.SelectedUserItem.IsMenuEquipmentLog = item.menuID.fMenu[7]; + this.SelectedUserItem.IsMenuCheckLog = item.menuID.fMenu[8]; + this.SelectedUserItem.IsMenuAlarmList = item.menuID.fMenu[9]; + this.SelectedUserItem.IsMenuInformation = item.menuID.fMenu[10]; + this.SelectedUserItem.IsMenuEquipmentTest = item.menuID.fMenu[11]; if (item.menuID.fMenu[25] == true) - this.CurrentUserItem.UserGroup = Define.E_UserGroup.f0_Level1; + this.SelectedUserItem.Status = Define.E_UserStatus.Level1; else if(item.menuID.fMenu[26] == true) - this.CurrentUserItem.UserGroup = Define.E_UserGroup.f1_Level2; + this.SelectedUserItem.Status = Define.E_UserStatus.Level2; else if(item.menuID.fMenu[27] == true) - this.CurrentUserItem.UserGroup = Define.E_UserGroup.f2_Level3; + this.SelectedUserItem.Status = Define.E_UserStatus.Level3; } private void UpdateCurrentUserItem(UserManager.UserMgr_user_info_t item) { // CurrentUserItem SET - this.CurrentUserItem.ID = item.user_id; - this.CurrentUserItem.Password = item.user_pw; + this.SelectedUserItem.ID = item.user_id; + this.SelectedUserItem.Password = item.user_pw; - this.CurrentUserItem.ExpireAccount = item.expire_period_account; - this.CurrentUserItem.ExpirePassword = item.expire_period_pw; + this.SelectedUserItem.ExpireAccount = item.expire_period_account; + this.SelectedUserItem.ExpirePassword = item.expire_period_pw; DateTime time = DateTime.ParseExact(item.register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.CurrentUserItem.DateRegister = time; + this.SelectedUserItem.DateRegister = time; time = DateTime.ParseExact(item.login_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.CurrentUserItem.DateLogin = time; + this.SelectedUserItem.DateLogin = time; time = DateTime.ParseExact(item.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.CurrentUserItem.DateExpireRegister = time; + this.SelectedUserItem.DateExpireRegister = time; time = DateTime.ParseExact(item.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.CurrentUserItem.DateExpireLogin = time; + this.SelectedUserItem.DateExpireLogin = time; - this.CurrentUserItem.IsLockAccount = item.flock_status_account == 0 ? false : true; - this.CurrentUserItem.IsLockPassword = item.flock_status_password == 0 ? false : true; + this.SelectedUserItem.IsLockAccount = item.flock_status_account == 0 ? false : true; + this.SelectedUserItem.IsLockPassword = item.flock_status_password == 0 ? false : true; - this.CurrentUserItem.IsAdmin = item.fadmin == 0 ? false : true; - this.CurrentUserItem.IsMainProductChange = item.menuID.fMenu[0]; - this.CurrentUserItem.IsMainWeightSetting = item.menuID.fMenu[1]; - this.CurrentUserItem.IsMainClear = item.menuID.fMenu[2]; - this.CurrentUserItem.IsMainSubMenu = item.menuID.fMenu[3]; + this.SelectedUserItem.IsAdmin = item.fadmin == 0 ? false : true; + this.SelectedUserItem.IsMainRecipeChange = item.menuID.fMenu[0]; + this.SelectedUserItem.IsMainClear = item.menuID.fMenu[1]; + this.SelectedUserItem.IsMainSubMenu = item.menuID.fMenu[2]; - this.CurrentUserItem.IsMenuProduct = item.menuID.fMenu[4]; - this.CurrentUserItem.IsMenuUserSetting = item.menuID.fMenu[5]; - this.CurrentUserItem.IsMenuUserGroupEditor = item.menuID.fMenu[6]; - this.CurrentUserItem.IsMenuIOTest = item.menuID.fMenu[7]; - this.CurrentUserItem.IsMenuEquipmentLog = item.menuID.fMenu[8]; - this.CurrentUserItem.IsMenuCheckLog = item.menuID.fMenu[9]; - this.CurrentUserItem.IsMenuAlarmList = item.menuID.fMenu[10]; - this.CurrentUserItem.IsMenuInformation = item.menuID.fMenu[11]; - this.CurrentUserItem.IsMenuStatus = item.menuID.fMenu[12]; + this.SelectedUserItem.IsMenuProduct = item.menuID.fMenu[3]; + this.SelectedUserItem.IsMenuUserSetting = item.menuID.fMenu[4]; + this.SelectedUserItem.IsMenuUserGroupEditor = item.menuID.fMenu[5]; + this.SelectedUserItem.IsMenuIOTest = item.menuID.fMenu[6]; + this.SelectedUserItem.IsMenuEquipmentLog = item.menuID.fMenu[7]; + this.SelectedUserItem.IsMenuCheckLog = item.menuID.fMenu[8]; + this.SelectedUserItem.IsMenuAlarmList = item.menuID.fMenu[9]; + this.SelectedUserItem.IsMenuInformation = item.menuID.fMenu[10]; + this.SelectedUserItem.IsMenuEquipmentTest = item.menuID.fMenu[11]; if (item.menuID.fMenu[25] == true) - this.CurrentUserItem.UserGroup = Define.E_UserGroup.f0_Level1; + this.SelectedUserItem.Status = Define.E_UserStatus.Level1; else if (item.menuID.fMenu[26] == true) - this.CurrentUserItem.UserGroup = Define.E_UserGroup.f1_Level2; + this.SelectedUserItem.Status = Define.E_UserStatus.Level2; else if (item.menuID.fMenu[27] == true) - this.CurrentUserItem.UserGroup = Define.E_UserGroup.f2_Level3; + this.SelectedUserItem.Status = Define.E_UserStatus.Level3; } private void UpdateSelectUserDisplay(UserItem item) { @@ -483,7 +481,7 @@ namespace INT_PT002.Controls this.labelExpiryDateOfAccount2.Text = string.Format("{0:yyyy/MM/dd} ~ {1:yyyy/MM/dd}", item.DateRegister, item.DateExpireRegister); this.labelExpiryDateOfPassword2.Text = string.Format("{0:yyyy/MM/dd} ~ {1:yyyy/MM/dd}", item.DateLogin, item.DateExpireLogin); - this.CheckBoxCheckedAsLevel(item.UserGroup); + this.CheckBoxCheckedAsLevel(item.Status); //this.cbAdministrator.Visible = true; //this.cbAdministrator.Checked = item.IsAdmin; @@ -522,7 +520,7 @@ namespace INT_PT002.Controls this.UI_Invoke(delegate { - this.UpdateSelectUserDisplay(this.CurrentUserItem); + this.UpdateSelectUserDisplay(this.SelectedUserItem); }); } public void CallBackUserListNewData(UserManager.UserMgr_user_info_t user) @@ -550,7 +548,7 @@ namespace INT_PT002.Controls this.UI_Invoke(delegate { this.UpdateCurrentUserItem(user); - this.UpdateSelectUserDisplay(this.CurrentUserItem); + this.UpdateSelectUserDisplay(this.SelectedUserItem); this.ParentForm.ParentForm.ListDllUserName.Add(user.user_id); this.UpdateUserListBoxDisplay(this.ParentForm.ParentForm.ListDllUserName); @@ -619,10 +617,10 @@ namespace INT_PT002.Controls } public void CallBackUserListLockDataEvent(UserManager.UserMgr_user_lock_t user) { - if (user.user_id == this.CurrentUserItem.ID) + if (user.user_id == this.SelectedUserItem.ID) { - this.CurrentUserItem.IsLockAccount = user.flock_status_account == 0 ? false : true; - this.CurrentUserItem.IsLockPassword = user.flock_status_password == 0 ? false : true; + this.SelectedUserItem.IsLockAccount = user.flock_status_account == 0 ? false : true; + this.SelectedUserItem.IsLockPassword = user.flock_status_password == 0 ? false : true; UserManager.UserManager_GetUserListID(this.listBoxUserList.Items[this.listBoxUserList.SelectItemIndex]); } @@ -773,7 +771,7 @@ namespace INT_PT002.Controls { e.Handled = true; - this.textBoxID.Text = this.CurrentUserItem.ID; + this.textBoxID.Text = this.SelectedUserItem.ID; this.KeyboardClose(); } else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?' @@ -807,7 +805,7 @@ namespace INT_PT002.Controls { e.Handled = true; - this.textBoxPassword.Text = this.CurrentUserItem.Password; + this.textBoxPassword.Text = this.SelectedUserItem.Password; this.KeyboardClose(); } else if (e.KeyChar == '<' || e.KeyChar == '>' || e.KeyChar == '|' || e.KeyChar == '"' || e.KeyChar == '?' @@ -819,9 +817,9 @@ namespace INT_PT002.Controls private void smartKeyboard_OnXKeyClick(object sender, EventArgs e) { if (this.smartKeyboard.TargetInputObject == this.textBoxPassword) - this.textBoxPassword.Text = this.CurrentUserItem.Password; + this.textBoxPassword.Text = this.SelectedUserItem.Password; else - this.textBoxID.Text = this.CurrentUserItem.ID; + this.textBoxID.Text = this.SelectedUserItem.ID; this.KeyboardClose(); } @@ -988,15 +986,15 @@ namespace INT_PT002.Controls if (button == this.buttonLevel1) { - this.CheckBoxCheckedAsLevel(Define.E_UserGroup.f0_Level1); + this.CheckBoxCheckedAsLevel(Define.E_UserStatus.Level1); } else if (button == this.buttonLevel2) { - this.CheckBoxCheckedAsLevel(Define.E_UserGroup.f1_Level2); + this.CheckBoxCheckedAsLevel(Define.E_UserStatus.Level2); } else if (button == this.buttonLevel3) { - this.CheckBoxCheckedAsLevel(Define.E_UserGroup.f2_Level3); + this.CheckBoxCheckedAsLevel(Define.E_UserStatus.Level3); } if (this.buttonSave.Visible == false) diff --git a/INT_PT002/DataStore/Define.cs b/INT_PT002/DataStore/Define.cs index 7f95bea..34805c6 100644 --- a/INT_PT002/DataStore/Define.cs +++ b/INT_PT002/DataStore/Define.cs @@ -137,10 +137,10 @@ namespace INT_PT002.DataStore public enum E_UserGroup { f0_Level1 = 0, - f1_Level2 = 1, - f2_Level3 = 2, - f3_Default = 3, - f4_Developer = 4, + f1_Level2, + f2_Level3, + f3_Default, + f4_Developer, } public enum E_UserStatus diff --git a/INT_PT002/DataStore/SystemConfiguration.cs b/INT_PT002/DataStore/SystemConfiguration.cs index 079a28b..e4685e1 100644 --- a/INT_PT002/DataStore/SystemConfiguration.cs +++ b/INT_PT002/DataStore/SystemConfiguration.cs @@ -537,7 +537,7 @@ namespace INT_PT002.DataStore private bool m_IsMainDisplayClear; private bool m_IsMainDisplaySubMenu; - private bool m_IsMenuProduct; + private bool m_IsMenuRecipe; private bool m_IsMenuUserSetting; private bool m_IsMenuUserGroupEditor; private bool m_IsMenuIOTest; @@ -572,10 +572,10 @@ namespace INT_PT002.DataStore set { this.m_IsMainDisplaySubMenu = value; } } - public bool IsMenuProduct + public bool IsMenuRecipe { - get { return this.m_IsMenuProduct; } - set { this.m_IsMenuProduct = value; } + get { return this.m_IsMenuRecipe; } + set { this.m_IsMenuRecipe = value; } } public bool IsMenuUserSetting { @@ -638,7 +638,7 @@ namespace INT_PT002.DataStore { bool ret = false; - if (this.IsMenuProduct == true) + if (this.IsMenuRecipe == true) ret = true; return ret; @@ -701,7 +701,7 @@ namespace INT_PT002.DataStore this.IsMainDisplayClear = false; this.IsMainDisplaySubMenu = false; - this.IsMenuProduct = false; + this.IsMenuRecipe = false; this.IsMenuUserSetting = false; this.IsMenuUserGroupEditor = false; this.IsMenuIOTest = false; @@ -718,11 +718,11 @@ namespace INT_PT002.DataStore [StructLayout(LayoutKind.Sequential)] public struct StructUserGroupItem { - public bool IsMainDisplayProductChange; + public bool IsMainDisplayRecipeChange; public bool IsMainDisplayClear; public bool IsMainDispalySubMenu; - public bool IsMenuProduct; + public bool IsMenuRecipe; public bool IsMenuUserSetting; public bool IsMenuUserGroupEditor; public bool IsMenuIOTest; @@ -777,12 +777,10 @@ namespace INT_PT002.DataStore private DateTime m_DateExpireLogin; private Define.E_UserStatus m_Status; - private Define.E_UserGroup m_UserGroup; private bool m_IsAdmin; - private bool m_IsMainProductChange; - private bool m_IsMainWeightSetting; + private bool m_IsMainRecipeChange; private bool m_IsMainClear; private bool m_IsMainSubMenu; @@ -794,7 +792,7 @@ namespace INT_PT002.DataStore private bool m_IsMenuCheckLog; private bool m_IsMenuAlarmList; private bool m_IsMenuInformation; - private bool m_IsMenuStatus; + private bool m_IsMenuEquipmentTest; #endregion #region Constructor @@ -885,11 +883,6 @@ namespace INT_PT002.DataStore get { return this.m_Status; } set { this.m_Status = value; } } - public Define.E_UserGroup UserGroup - { - get { return this.m_UserGroup; } - set { this.m_UserGroup = value; } - } public bool IsAdmin { @@ -897,15 +890,10 @@ namespace INT_PT002.DataStore set { this.m_IsAdmin = value; } } - public bool IsMainProductChange + public bool IsMainRecipeChange { - get { return this.m_IsMainProductChange; } - set { this.m_IsMainProductChange = value; } - } - public bool IsMainWeightSetting - { - get { return this.m_IsMainWeightSetting; } - set { this.m_IsMainWeightSetting = value; } + get { return this.m_IsMainRecipeChange; } + set { this.m_IsMainRecipeChange = value; } } public bool IsMainClear { @@ -958,10 +946,10 @@ namespace INT_PT002.DataStore get { return this.m_IsMenuInformation; } set { this.m_IsMenuInformation = value; } } - public bool IsMenuStatus + public bool IsMenuEquipmentTest { - get { return this.m_IsMenuStatus; } - set { this.m_IsMenuStatus = value; } + get { return this.m_IsMenuEquipmentTest; } + set { this.m_IsMenuEquipmentTest = value; } } #endregion @@ -986,12 +974,10 @@ namespace INT_PT002.DataStore this.DateExpireLogin = DateTime.Now; this.Status = Define.E_UserStatus.None; - this.UserGroup = Define.E_UserGroup.f3_Default; this.IsAdmin = false; - this.IsMainProductChange = false; - this.IsMainWeightSetting = false; + this.IsMainRecipeChange = false; this.IsMainClear = false; this.IsMainSubMenu = false; @@ -1003,7 +989,7 @@ namespace INT_PT002.DataStore this.IsMenuCheckLog = false; this.IsMenuAlarmList = false; this.IsMenuInformation = false; - this.IsMenuStatus = false; + this.IsMenuEquipmentTest = false; } public void SetPassword(string pass) diff --git a/INT_PT002/DataStore/SystemStatus.cs b/INT_PT002/DataStore/SystemStatus.cs index 38b1cf3..cf11174 100644 --- a/INT_PT002/DataStore/SystemStatus.cs +++ b/INT_PT002/DataStore/SystemStatus.cs @@ -66,9 +66,6 @@ namespace INT_PT002.DataStore this.EquipmentColumn = 10; this.CurrentUser = new UserItem(); - this.CurrentUser.ID = ""; - this.CurrentUser.Password = ""; - this.CurrentUser.UserGroup = Define.E_UserGroup.f0_Level1; this.CurrentEquipmentMode = Define.E_EquipmentMode.Normal; this.EquipmentStatus = Define.E_EquipmentStatus.Stop; diff --git a/INT_PT002/DialogForms/DialogFormLogOn.cs b/INT_PT002/DialogForms/DialogFormLogOn.cs index 0dcaf22..2a4f401 100644 --- a/INT_PT002/DialogForms/DialogFormLogOn.cs +++ b/INT_PT002/DialogForms/DialogFormLogOn.cs @@ -196,6 +196,12 @@ namespace INT_PT002.Forms this.ParentForm.CurrentSystemStatus.CurrentUser.Status = Define.E_UserStatus.Developer; else if (userInfo.user_id == "Admin00") this.ParentForm.CurrentSystemStatus.CurrentUser.Status = Define.E_UserStatus.Admin; + else if (userInfo.menuID.fMenu[25] == true) + this.ParentForm.CurrentSystemStatus.CurrentUser.Status = Define.E_UserStatus.Level1; + else if (userInfo.menuID.fMenu[26] == true) + this.ParentForm.CurrentSystemStatus.CurrentUser.Status = Define.E_UserStatus.Level2; + else if (userInfo.menuID.fMenu[27] == true) + this.ParentForm.CurrentSystemStatus.CurrentUser.Status = Define.E_UserStatus.Level3; this.ParentForm.CurrentSystemStatus.CurrentUser.ID = userInfo.user_id; this.ParentForm.CurrentSystemStatus.CurrentUser.Password = userInfo.user_pw; @@ -217,20 +223,19 @@ namespace INT_PT002.Forms this.ParentForm.CurrentSystemStatus.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMainProductChange = userInfo.menuID.fMenu[0]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMainWeightSetting = userInfo.menuID.fMenu[1]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMainClear = userInfo.menuID.fMenu[2]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMainSubMenu = userInfo.menuID.fMenu[3]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMainRecipeChange = userInfo.menuID.fMenu[0]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMainClear = userInfo.menuID.fMenu[1]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMainSubMenu = userInfo.menuID.fMenu[2]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuProduct = userInfo.menuID.fMenu[4]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuUserSetting = userInfo.menuID.fMenu[5]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuUserGroupEditor = userInfo.menuID.fMenu[6]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuIOTest = userInfo.menuID.fMenu[7]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuEquipmentLog = userInfo.menuID.fMenu[8]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuCheckLog = userInfo.menuID.fMenu[9]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuAlarmList = userInfo.menuID.fMenu[10]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuInformation = userInfo.menuID.fMenu[11]; - this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuStatus = userInfo.menuID.fMenu[12]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuProduct = userInfo.menuID.fMenu[3]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuUserSetting = userInfo.menuID.fMenu[4]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuUserGroupEditor = userInfo.menuID.fMenu[5]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuIOTest = userInfo.menuID.fMenu[6]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuEquipmentLog = userInfo.menuID.fMenu[7]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuCheckLog = userInfo.menuID.fMenu[8]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuAlarmList = userInfo.menuID.fMenu[9]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuInformation = userInfo.menuID.fMenu[10]; + this.ParentForm.CurrentSystemStatus.CurrentUser.IsMenuEquipmentTest = userInfo.menuID.fMenu[11]; #endregion this.DialogResult = DialogResult.OK; diff --git a/INT_PT002/DialogForms/DialogFormYesNo.cs b/INT_PT002/DialogForms/DialogFormYesNo.cs index 10d631c..cccd6cc 100644 --- a/INT_PT002/DialogForms/DialogFormYesNo.cs +++ b/INT_PT002/DialogForms/DialogFormYesNo.cs @@ -27,6 +27,10 @@ namespace INT_PT002.DialogForms { InitializeComponent(); + this.smartGroupBox1.Text = ""; + this.labelMessage1.Text = ""; + this.labelMessage2.Text = ""; + if (language == Define.E_LanguageID.Korean) { this.buttonYes.ButtonText = "Yes"; diff --git a/INT_PT002/Forms/FormMain.cs b/INT_PT002/Forms/FormMain.cs index eb68365..344b61a 100644 --- a/INT_PT002/Forms/FormMain.cs +++ b/INT_PT002/Forms/FormMain.cs @@ -25,6 +25,10 @@ namespace INT_PT002.Forms private int CommunicationCheckCount; public int FlagAutomaticLogoutWarningTime; + // 로그온 색상 + public Color ColorLogOff; + public Color ColorLogOn; + // 파일 위치 private string m_PathLaunchFolder; private string m_PathSystemFileFolder; @@ -177,6 +181,9 @@ namespace INT_PT002.Forms this.PathDataInspectionFolder = this.PathDataFolder + "Inspection\\"; this.PathDataAlarmFolder = this.PathDataFolder + "Alarm\\"; + this.ColorLogOff = Color.Red; + this.ColorLogOn = Color.Green; + this.CurrentAlarmList = new AlarmList(); this.CurrentAlarmList.EventAlarmStateChange += new Define.EventHandlerAlarmStateChange(this.CurrentAlarmList_Change); @@ -287,6 +294,31 @@ namespace INT_PT002.Forms { this.smartForm1.Show(index); } + private bool UI_Invoke(ThreadStart invoker) + { + try + { + if (this.InvokeRequired) + { + if (this.IsDisposed) + return true; + + this.Invoke(invoker); + } + else + { + invoker(); + } + + return true; + + } + catch (Exception e) + { + return false; + } + + } /// /// Set Mode @@ -354,232 +386,6 @@ namespace INT_PT002.Forms } #endregion - #region UserManagerEvent - private bool UI_Invoke(ThreadStart invoker) - { - try - { - if (this.InvokeRequired) - { - if (this.IsDisposed) - return true; - - this.Invoke(invoker); - } - else - { - invoker(); - } - - return true; - - } - catch (Exception e) - { - return false; - } - - } - - private void UserManager_UserListLogoutDataEvent(int status) - { - try - { - if (status == (int)UserManager.USERMGR_LOGOUT_STATUS_OK) - { - // logout - } - else - { - // logout fail !!! - //MessageBox.Show("Logout Failed !!!!"); - } - } - catch - { - } - } - private void UserManager_UserListLoginDataEvent(int status, object data) - { - try - { - if (status == (int)UserManager.E_user_mgr_status.USER_MGR_STATUS_OK) - { - UserManager.UserMgr_user_info_t userInfo = (UserManager.UserMgr_user_info_t)data; - - //this.ChildFormMainDisplay.updatedisplayuser - - //String Message; - } - else - { - this.UI_Invoke(delegate - { - // login fail !!! - //textBox_id.Enabled = true; - //textBox_pw.Enabled = true; - //comboBox_logout_timeout.Enabled = true; - - //button_login.Text = "LOGIN"; - //Activation.IsLogin = false; - }); - } - } - catch - { - } - } - private void UserManager_UserListGetListDataEvent(object data) - { - try - { - UserManager.UserMgr_user_list_t userList = (UserManager.UserMgr_user_list_t)data; - - if (this.CurrentSystemStatus.CurrentDisplayMode == Define.E_DisplayModeStore.UserEditor) - this.ChildFormMenu.CallBackGetUserData(userList); - } - catch - { - } - } - private void UserManager_UserListLoginTimeoutDataEvent(object data) - { - try - { - UserManager.UserMgr_login_timeout_t loginTimeout = (UserManager.UserMgr_login_timeout_t)data; - - if (this.CurrentSystemStatus.CurrentDisplayMode == Define.E_DisplayModeStore.MainDisplay) - this.ChildFormMainDisplay.CallBackUserListLoginTimeoutDataEvent(loginTimeout); - } - catch (Exception e) - { - } - } - private void UserManager_UserListLockDataEvent(object data) - { - try - { - UserManager.UserMgr_user_lock_t user = (UserManager.UserMgr_user_lock_t)data; - - if (this.CurrentSystemStatus.CurrentDisplayMode == Define.E_DisplayModeStore.UserEditor) - this.ChildFormMenu.CallBackUserListLockDataEvent(user); - } - catch - { - } - } - private void UserManager_UserListDefaultSettingDataEvent(object data) - { - try - { - - } - catch - { - } - } - private void UserManager_UserListDeleteDataEvent(object data) - { - try - { - UserManager.UserMgr_user_del_t user = (UserManager.UserMgr_user_del_t)data; - this.ChildFormMenu.CallBackUserListDeleteDataEvent(user); - } - catch - { - } - } - private void UserManager_UserListModifyUserDataEvent(object data) - { - try - { - UserManager.UserMgr_user_modify_t user = (UserManager.UserMgr_user_modify_t)data; - - this.ChildFormMenu.CallBackUserModifyUserData(user); - } - catch - { - } - } - private void UserManager_UserListModifyInfoDataEvent(object data) - { - try - { - UserManager.UserMgr_user_info_t user = (UserManager.UserMgr_user_info_t)data; - - //this.ChildFormMenu.Child_User_UserEditor.CallBackUserListModifyInfoDataEvent(user); - } - catch - { - } - } - private void UserManager_UserListNewDataEvent(object data) - { - try - { - UserManager.UserMgr_user_info_t user = (UserManager.UserMgr_user_info_t)data; - - this.ChildFormMenu.CallBackUserListNewData(user); - } - catch (Exception e) - { - } - } - private void UserManager_UserListAddDataEvent(object data) - { - try - { - UserManager.UserMgr_user_add_t userAdd = (UserManager.UserMgr_user_add_t)data; - - if (userAdd.status == (int)UserManager.E_user_mgr_status.USER_MGR_STATUS_OK) - { - //for (int i = 0; i < this.CollectionUser.Count; i++) - //{ - // if (this.CollectionUser[i].ID == userAdd.user_id) - // { - // this.FlagUserListCNT++; - // this.CollectionUser[i].IsUpdate = true; - // this.CollectionUser[i].IsLockAccount = userAdd.flock_status_account == 0 ? false : true; - // this.CollectionUser[i].IsLockPassword = userAdd.flock_status_password == 0 ? false : true; - // break; - // } - //} - } - else - { - //for (int i = 0; i < this.CollectionUser.Count; i++) - //{ - // if (this.CollectionUser[i].ID == userAdd.user_id) - // { - // this.CollectionUser.RemoveAt(i); - // break; - // } - //} - - //this.SaveUserFile(this.CollectionUser); - } - } - catch - { - } - } - private void UserManager_UserListGetListNameDataEvent(object data) - { - try - { - UserManager.UserMgr_user_list_name_t name = (UserManager.UserMgr_user_list_name_t)data; - - if (name.total_count == 0) - return; - - this.ListDllUserName.Add(name.user_id); - } - catch - { - } - } - #endregion - #region SystemConfiguration File private void CreateSystemConfigurationFile() { @@ -2018,11 +1824,11 @@ namespace INT_PT002.Forms for (int i = 0; i < 2; i++) { #region StructItem - structItem.IsMainDisplayProductChange = item.IsMainDisplayProductChange; + structItem.IsMainDisplayRecipeChange = item.IsMainDisplayProductChange; structItem.IsMainDisplayClear = item.IsMainDisplayClear; structItem.IsMainDispalySubMenu = item.IsMainDisplaySubMenu; - structItem.IsMenuProduct = item.IsMenuProduct; + structItem.IsMenuRecipe = item.IsMenuRecipe; structItem.IsMenuUserSetting = item.IsMenuUserSetting; structItem.IsMenuUserGroupEditor = item.IsMenuUserGroupEditor; structItem.IsMenuIOTest = item.IsMenuIOTest; @@ -2057,11 +1863,11 @@ namespace INT_PT002.Forms for (int i = 2; i < 4; i++) { #region StructItem - structItem.IsMainDisplayProductChange = true; + structItem.IsMainDisplayRecipeChange = true; structItem.IsMainDisplayClear = true; structItem.IsMainDispalySubMenu = true; - structItem.IsMenuProduct = true; + structItem.IsMenuRecipe = true; structItem.IsMenuUserSetting = true; structItem.IsMenuUserGroupEditor = true; structItem.IsMenuIOTest = true; @@ -2113,11 +1919,11 @@ namespace INT_PT002.Forms this.CreateUserGroupFile(); #region Level1 - structItem.IsMainDisplayProductChange = item.Level1.IsMainDisplayProductChange; + structItem.IsMainDisplayRecipeChange = item.Level1.IsMainDisplayProductChange; structItem.IsMainDisplayClear = item.Level1.IsMainDisplayClear; structItem.IsMainDispalySubMenu = item.Level1.IsMainDisplaySubMenu; - structItem.IsMenuProduct = item.Level1.IsMenuProduct; + structItem.IsMenuRecipe = item.Level1.IsMenuRecipe; structItem.IsMenuUserSetting = item.Level1.IsMenuUserSetting; structItem.IsMenuUserGroupEditor = item.Level1.IsMenuUserGroupEditor; structItem.IsMenuIOTest = item.Level1.IsMenuIOTest; @@ -2150,11 +1956,11 @@ namespace INT_PT002.Forms #endregion #region Level2 - structItem.IsMainDisplayProductChange = item.Level2.IsMainDisplayProductChange; + structItem.IsMainDisplayRecipeChange = item.Level2.IsMainDisplayProductChange; structItem.IsMainDisplayClear = item.Level2.IsMainDisplayClear; structItem.IsMainDispalySubMenu = item.Level2.IsMainDisplaySubMenu; - structItem.IsMenuProduct = item.Level2.IsMenuProduct; + structItem.IsMenuRecipe = item.Level2.IsMenuRecipe; structItem.IsMenuUserSetting = item.Level2.IsMenuUserSetting; structItem.IsMenuUserGroupEditor = item.Level2.IsMenuUserGroupEditor; structItem.IsMenuIOTest = item.Level2.IsMenuIOTest; @@ -2187,11 +1993,11 @@ namespace INT_PT002.Forms #endregion #region Level3 - structItem.IsMainDisplayProductChange = item.Level3.IsMainDisplayProductChange; + structItem.IsMainDisplayRecipeChange = item.Level3.IsMainDisplayProductChange; structItem.IsMainDisplayClear = item.Level3.IsMainDisplayClear; structItem.IsMainDispalySubMenu = item.Level3.IsMainDisplaySubMenu; - structItem.IsMenuProduct = item.Level3.IsMenuProduct; + structItem.IsMenuRecipe = item.Level3.IsMenuRecipe; structItem.IsMenuUserSetting = item.Level3.IsMenuUserSetting; structItem.IsMenuUserGroupEditor = item.Level3.IsMenuUserGroupEditor; structItem.IsMenuIOTest = item.Level3.IsMenuIOTest; @@ -2224,11 +2030,11 @@ namespace INT_PT002.Forms #endregion #region Default - structItem.IsMainDisplayProductChange = item.Default.IsMainDisplayProductChange; + structItem.IsMainDisplayRecipeChange = item.Default.IsMainDisplayProductChange; structItem.IsMainDisplayClear = item.Default.IsMainDisplayClear; structItem.IsMainDispalySubMenu = item.Default.IsMainDisplaySubMenu; - structItem.IsMenuProduct = item.Default.IsMenuProduct; + structItem.IsMenuRecipe = item.Default.IsMenuRecipe; structItem.IsMenuUserSetting = item.Default.IsMenuUserSetting; structItem.IsMenuUserGroupEditor = item.Default.IsMenuUserGroupEditor; structItem.IsMenuIOTest = item.Default.IsMenuIOTest; @@ -2281,11 +2087,11 @@ namespace INT_PT002.Forms this.CreateUserGroupFile(); #region Level1 - structItem.IsMainDisplayProductChange = item.IsMainDisplayProductChange; + structItem.IsMainDisplayRecipeChange = item.IsMainDisplayProductChange; structItem.IsMainDisplayClear = item.IsMainDisplayClear; structItem.IsMainDispalySubMenu = item.IsMainDisplaySubMenu; - structItem.IsMenuProduct = item.IsMenuProduct; + structItem.IsMenuRecipe = item.IsMenuRecipe; structItem.IsMenuUserSetting = item.IsMenuUserSetting; structItem.IsMenuUserGroupEditor = item.IsMenuUserGroupEditor; structItem.IsMenuIOTest = item.IsMenuIOTest; @@ -2338,11 +2144,11 @@ namespace INT_PT002.Forms this.CreateUserGroupFile(); #region Level2 - structItem.IsMainDisplayProductChange = item.IsMainDisplayProductChange; + structItem.IsMainDisplayRecipeChange = item.IsMainDisplayProductChange; structItem.IsMainDisplayClear = item.IsMainDisplayClear; structItem.IsMainDispalySubMenu = item.IsMainDisplaySubMenu; - structItem.IsMenuProduct = item.IsMenuProduct; + structItem.IsMenuRecipe = item.IsMenuRecipe; structItem.IsMenuUserSetting = item.IsMenuUserSetting; structItem.IsMenuUserGroupEditor = item.IsMenuUserGroupEditor; structItem.IsMenuIOTest = item.IsMenuIOTest; @@ -2395,11 +2201,11 @@ namespace INT_PT002.Forms this.CreateUserGroupFile(); #region Level3 - structItem.IsMainDisplayProductChange = item.IsMainDisplayProductChange; + structItem.IsMainDisplayRecipeChange = item.IsMainDisplayProductChange; structItem.IsMainDisplayClear = item.IsMainDisplayClear; structItem.IsMainDispalySubMenu = item.IsMainDisplaySubMenu; - structItem.IsMenuProduct = item.IsMenuProduct; + structItem.IsMenuRecipe = item.IsMenuRecipe; structItem.IsMenuUserSetting = item.IsMenuUserSetting; structItem.IsMenuUserGroupEditor = item.IsMenuUserGroupEditor; structItem.IsMenuIOTest = item.IsMenuIOTest; @@ -2452,11 +2258,11 @@ namespace INT_PT002.Forms this.CreateUserGroupFile(); #region Default - structItem.IsMainDisplayProductChange = item.IsMainDisplayProductChange; + structItem.IsMainDisplayRecipeChange = item.IsMainDisplayProductChange; structItem.IsMainDisplayClear = item.IsMainDisplayClear; structItem.IsMainDispalySubMenu = item.IsMainDisplaySubMenu; - structItem.IsMenuProduct = item.IsMenuProduct; + structItem.IsMenuRecipe = item.IsMenuRecipe; structItem.IsMenuUserSetting = item.IsMenuUserSetting; structItem.IsMenuUserGroupEditor = item.IsMenuUserGroupEditor; structItem.IsMenuIOTest = item.IsMenuIOTest; @@ -2515,11 +2321,11 @@ namespace INT_PT002.Forms #region Level1 structItem = (StructUserGroupItem)this.smartFileIO.StructType.ReadBuffer((int)Define.E_UserGroup.f0_Level1); - item.Level1.IsMainDisplayProductChange = structItem.IsMainDisplayProductChange; + item.Level1.IsMainDisplayProductChange = structItem.IsMainDisplayRecipeChange; item.Level1.IsMainDisplayClear = structItem.IsMainDisplayClear; item.Level1.IsMainDisplaySubMenu = structItem.IsMainDispalySubMenu; - item.Level1.IsMenuProduct = structItem.IsMenuProduct; + item.Level1.IsMenuRecipe = structItem.IsMenuRecipe; item.Level1.IsMenuUserSetting = structItem.IsMenuUserSetting; item.Level1.IsMenuUserGroupEditor = structItem.IsMenuUserGroupEditor; item.Level1.IsMenuIOTest = structItem.IsMenuIOTest; @@ -2533,11 +2339,11 @@ namespace INT_PT002.Forms #region Level2 structItem = (StructUserGroupItem)this.smartFileIO.StructType.ReadBuffer((int)Define.E_UserGroup.f1_Level2); - item.Level2.IsMainDisplayProductChange = structItem.IsMainDisplayProductChange; + item.Level2.IsMainDisplayProductChange = structItem.IsMainDisplayRecipeChange; item.Level2.IsMainDisplayClear = structItem.IsMainDisplayClear; item.Level2.IsMainDisplaySubMenu = structItem.IsMainDispalySubMenu; - item.Level2.IsMenuProduct = structItem.IsMenuProduct; + item.Level2.IsMenuRecipe = structItem.IsMenuRecipe; item.Level2.IsMenuUserSetting = structItem.IsMenuUserSetting; item.Level2.IsMenuUserGroupEditor = structItem.IsMenuUserGroupEditor; item.Level2.IsMenuIOTest = structItem.IsMenuIOTest; @@ -2551,11 +2357,11 @@ namespace INT_PT002.Forms #region Level3 structItem = (StructUserGroupItem)this.smartFileIO.StructType.ReadBuffer((int)Define.E_UserGroup.f2_Level3); - item.Level3.IsMainDisplayProductChange = structItem.IsMainDisplayProductChange; + item.Level3.IsMainDisplayProductChange = structItem.IsMainDisplayRecipeChange; item.Level3.IsMainDisplayClear = structItem.IsMainDisplayClear; item.Level3.IsMainDisplaySubMenu = structItem.IsMainDispalySubMenu; - item.Level3.IsMenuProduct = structItem.IsMenuProduct; + item.Level3.IsMenuRecipe = structItem.IsMenuRecipe; item.Level3.IsMenuUserSetting = structItem.IsMenuUserSetting; item.Level3.IsMenuUserGroupEditor = structItem.IsMenuUserGroupEditor; item.Level3.IsMenuIOTest = structItem.IsMenuIOTest; @@ -2569,11 +2375,11 @@ namespace INT_PT002.Forms #region Default structItem = (StructUserGroupItem)this.smartFileIO.StructType.ReadBuffer((int)Define.E_UserGroup.f3_Default); - item.Default.IsMainDisplayProductChange = structItem.IsMainDisplayProductChange; + item.Default.IsMainDisplayProductChange = structItem.IsMainDisplayRecipeChange; item.Default.IsMainDisplayClear = structItem.IsMainDisplayClear; item.Default.IsMainDisplaySubMenu = structItem.IsMainDispalySubMenu; - item.Default.IsMenuProduct = structItem.IsMenuProduct; + item.Default.IsMenuRecipe = structItem.IsMenuRecipe; item.Default.IsMenuUserSetting = structItem.IsMenuUserSetting; item.Default.IsMenuUserGroupEditor = structItem.IsMenuUserGroupEditor; item.Default.IsMenuIOTest = structItem.IsMenuIOTest; @@ -2609,6 +2415,10 @@ namespace INT_PT002.Forms this.LoadRecipeFile(ref this.CurrentRecipe, this.SystemConfig.RECIPE_NUMBER - 1); // UserGroup File Load this.LoadUserGroupFile(ref this.CurrentUserGroup); + // UserManager 초기화 + this.InitializeUserManager(); + this.CurrentSystemStatus.CurrentUser.Status = Define.E_UserStatus.LogOff; + //UserManager.UserManager_GetUserListName(); // Form 생성 this.CreateForm(); @@ -2623,9 +2433,7 @@ namespace INT_PT002.Forms //DialogFormLogOn loginForm = new DialogFormLogOn( - // UserManager 초기화 - this.InitializeUserManager(); - this.CurrentSystemStatus.CurrentUser.Status = Define.E_UserStatus.LogOff; + // timer1 Get user List Name //UserManager.UserManager_GetUserListName(); this.timer1.Enabled = true; @@ -2674,12 +2482,211 @@ namespace INT_PT002.Forms { this.ChildFormMainDisplay.UpdateDisplayTime(); } - #endregion - private void timer1_Tick(object sender, EventArgs e) { this.timer1.Enabled = false; UserManager.UserManager_GetUserListName(); } + + #region UserManagerEvent + private void UserManager_UserListLogoutDataEvent(int status) + { + try + { + if (status == (int)UserManager.USERMGR_LOGOUT_STATUS_OK) + { + // logout + } + else + { + // logout fail !!! + //MessageBox.Show("Logout Failed !!!!"); + } + } + catch + { + } + } + private void UserManager_UserListLoginDataEvent(int status, object data) + { + try + { + if (status == (int)UserManager.E_user_mgr_status.USER_MGR_STATUS_OK) + { + UserManager.UserMgr_user_info_t userInfo = (UserManager.UserMgr_user_info_t)data; + + //this.ChildFormMainDisplay.updatedisplayuser + + //String Message; + } + else + { + this.UI_Invoke(delegate + { + // login fail !!! + //textBox_id.Enabled = true; + //textBox_pw.Enabled = true; + //comboBox_logout_timeout.Enabled = true; + + //button_login.Text = "LOGIN"; + //Activation.IsLogin = false; + }); + } + } + catch + { + } + } + private void UserManager_UserListGetListDataEvent(object data) + { + try + { + UserManager.UserMgr_user_list_t userList = (UserManager.UserMgr_user_list_t)data; + + if (this.CurrentSystemStatus.CurrentDisplayMode == Define.E_DisplayModeStore.UserEditor) + this.ChildFormMenu.CallBackGetUserData(userList); + } + catch + { + } + } + private void UserManager_UserListLoginTimeoutDataEvent(object data) + { + try + { + UserManager.UserMgr_login_timeout_t loginTimeout = (UserManager.UserMgr_login_timeout_t)data; + + if (this.CurrentSystemStatus.CurrentDisplayMode == Define.E_DisplayModeStore.MainDisplay) + this.ChildFormMainDisplay.CallBackUserListLoginTimeoutDataEvent(loginTimeout); + } + catch (Exception e) + { + } + } + private void UserManager_UserListLockDataEvent(object data) + { + try + { + UserManager.UserMgr_user_lock_t user = (UserManager.UserMgr_user_lock_t)data; + + if (this.CurrentSystemStatus.CurrentDisplayMode == Define.E_DisplayModeStore.UserEditor) + this.ChildFormMenu.CallBackUserListLockDataEvent(user); + } + catch + { + } + } + private void UserManager_UserListDefaultSettingDataEvent(object data) + { + try + { + + } + catch + { + } + } + private void UserManager_UserListDeleteDataEvent(object data) + { + try + { + UserManager.UserMgr_user_del_t user = (UserManager.UserMgr_user_del_t)data; + this.ChildFormMenu.CallBackUserListDeleteDataEvent(user); + } + catch + { + } + } + private void UserManager_UserListModifyUserDataEvent(object data) + { + try + { + UserManager.UserMgr_user_modify_t user = (UserManager.UserMgr_user_modify_t)data; + + this.ChildFormMenu.CallBackUserModifyUserData(user); + } + catch + { + } + } + private void UserManager_UserListModifyInfoDataEvent(object data) + { + try + { + UserManager.UserMgr_user_info_t user = (UserManager.UserMgr_user_info_t)data; + + //this.ChildFormMenu.Child_User_UserEditor.CallBackUserListModifyInfoDataEvent(user); + } + catch + { + } + } + private void UserManager_UserListNewDataEvent(object data) + { + try + { + UserManager.UserMgr_user_info_t user = (UserManager.UserMgr_user_info_t)data; + + this.ChildFormMenu.CallBackUserListNewData(user); + } + catch (Exception e) + { + } + } + private void UserManager_UserListAddDataEvent(object data) + { + try + { + UserManager.UserMgr_user_add_t userAdd = (UserManager.UserMgr_user_add_t)data; + + if (userAdd.status == (int)UserManager.E_user_mgr_status.USER_MGR_STATUS_OK) + { + //for (int i = 0; i < this.CollectionUser.Count; i++) + //{ + // if (this.CollectionUser[i].ID == userAdd.user_id) + // { + // this.FlagUserListCNT++; + // this.CollectionUser[i].IsUpdate = true; + // this.CollectionUser[i].IsLockAccount = userAdd.flock_status_account == 0 ? false : true; + // this.CollectionUser[i].IsLockPassword = userAdd.flock_status_password == 0 ? false : true; + // break; + // } + //} + } + else + { + //for (int i = 0; i < this.CollectionUser.Count; i++) + //{ + // if (this.CollectionUser[i].ID == userAdd.user_id) + // { + // this.CollectionUser.RemoveAt(i); + // break; + // } + //} + + //this.SaveUserFile(this.CollectionUser); + } + } + catch + { + } + } + private void UserManager_UserListGetListNameDataEvent(object data) + { + try + { + UserManager.UserMgr_user_list_name_t name = (UserManager.UserMgr_user_list_name_t)data; + + if (name.total_count == 0) + return; + + this.ListDllUserName.Add(name.user_id); + } + catch + { + } + } + #endregion + #endregion } } \ No newline at end of file diff --git a/INT_PT002/Forms/FormMainDisplay2.Designer.cs b/INT_PT002/Forms/FormMainDisplay2.Designer.cs index 9cb4caf..8229dc2 100644 --- a/INT_PT002/Forms/FormMainDisplay2.Designer.cs +++ b/INT_PT002/Forms/FormMainDisplay2.Designer.cs @@ -99,8 +99,7 @@ this.labelProgress1 = new SmartX.SmartLabel(); this.smartButton1 = new SmartX.SmartButton(); this.smartGroupBox1 = new SmartX.SmartGroupBox(); - this.label1 = new System.Windows.Forms.Label(); - this.labelAlarm = new SmartX.SmartLabel(); + this.labelAlarm = new System.Windows.Forms.Label(); this.labelPressure10 = new SmartX.SmartLabel(); this.labelPressure9 = new SmartX.SmartLabel(); this.labelPressure8 = new SmartX.SmartLabel(); @@ -131,6 +130,8 @@ this.buttonDisplay = new SmartX.SmartButton(); this.smartTimerAlarm = new SmartX.SmartTimer(); this.smartTimerMessageShow = new SmartX.SmartTimer(); + this.labelUserID = new SmartX.SmartLabel(); + this.labelUserLevel = new SmartX.SmartLabel(); this.smartForm1.SuspendLayout(); this.smartGroupBox1.SuspendLayout(); this.SuspendLayout(); @@ -141,6 +142,9 @@ this.smartForm1.BackGroundFillStyle = SmartXUIBase.SmartUIControlFormBase.BackGroundFillStyles.UseBackImage; this.smartForm1.BackImage = ((System.Drawing.Image)(resources.GetObject("smartForm1.BackImage"))); this.smartForm1.CenterLocation = false; + this.smartForm1.Controls.Add(this.labelCommunicationStatus); + this.smartForm1.Controls.Add(this.labelUserLevel); + this.smartForm1.Controls.Add(this.labelUserID); this.smartForm1.Controls.Add(this.smartLabel32); this.smartForm1.Controls.Add(this.smartLabel33); this.smartForm1.Controls.Add(this.smartLabel34); @@ -230,7 +234,6 @@ this.smartForm1.Controls.Add(this.labelResult2); this.smartForm1.Controls.Add(this.labelResult1); this.smartForm1.Controls.Add(this.buttonUser); - this.smartForm1.Controls.Add(this.labelCommunicationStatus); this.smartForm1.Controls.Add(this.labelStop); this.smartForm1.Controls.Add(this.labelStart); this.smartForm1.Controls.Add(this.buttonExit); @@ -1696,7 +1699,6 @@ this.smartGroupBox1.BackGround = this.smartForm1; this.smartGroupBox1.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.smartGroupBox1.BackImage = ((System.Drawing.Image)(resources.GetObject("smartGroupBox1.BackImage"))); - this.smartGroupBox1.Controls.Add(this.label1); this.smartGroupBox1.Controls.Add(this.labelAlarm); this.smartGroupBox1.FrameLineColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(110)))), ((int)(((byte)(165))))); this.smartGroupBox1.FrameLineColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(110)))), ((int)(((byte)(165))))); @@ -1711,37 +1713,15 @@ this.smartGroupBox1.Text = "smartGroupBox1"; this.smartGroupBox1.TextColor = System.Drawing.Color.White; // - // label1 - // - this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(51)))), ((int)(((byte)(53))))); - this.label1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular); - this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(23, 25); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(466, 25); - this.label1.Text = "a1_Servo emergency stop"; - // // labelAlarm // - this.labelAlarm.BackGround = this.smartGroupBox1; - this.labelAlarm.BackGroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(51)))), ((int)(((byte)(53))))); - this.labelAlarm.BorderColor = System.Drawing.Color.White; - this.labelAlarm.BorderStyle = SmartX.SmartLabel.BorderStyles.None; - this.labelAlarm.Font = new System.Drawing.Font("새굴림", 10F, System.Drawing.FontStyle.Bold); - this.labelAlarm.LineSpacing = 0F; + this.labelAlarm.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(51)))), ((int)(((byte)(53))))); + this.labelAlarm.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular); + this.labelAlarm.ForeColor = System.Drawing.Color.White; this.labelAlarm.Location = new System.Drawing.Point(3, 27); this.labelAlarm.Name = "labelAlarm"; - this.labelAlarm.OverlapOptimize = true; - this.labelAlarm.PasswordChar = '\0'; - this.labelAlarm.Radius = 3; - this.labelAlarm.RoundRectFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(49)))), ((int)(((byte)(51)))), ((int)(((byte)(53))))); - this.labelAlarm.Size = new System.Drawing.Size(496, 20); - this.labelAlarm.TabIndex = 73; - this.labelAlarm.TextColor = System.Drawing.Color.White; - this.labelAlarm.TextColorDisable = System.Drawing.Color.Gray; - this.labelAlarm.TextHAlign = SmartX.SmartLabel.TextHorAlign.Left; - this.labelAlarm.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; - this.labelAlarm.Wordwrap = false; + this.labelAlarm.Size = new System.Drawing.Size(466, 25); + this.labelAlarm.Text = "a1_Servo emergency stop"; // // labelPressure10 // @@ -2233,7 +2213,7 @@ this.labelCommunicationStatus.BorderColor = System.Drawing.Color.Lime; this.labelCommunicationStatus.BorderStyle = SmartX.SmartLabel.BorderStyles.RoundRect; this.labelCommunicationStatus.LineSpacing = 0F; - this.labelCommunicationStatus.Location = new System.Drawing.Point(880, 58); + this.labelCommunicationStatus.Location = new System.Drawing.Point(891, 58); this.labelCommunicationStatus.Name = "labelCommunicationStatus"; this.labelCommunicationStatus.OverlapOptimize = true; this.labelCommunicationStatus.PasswordChar = '\0'; @@ -2494,6 +2474,52 @@ this.smartTimerMessageShow.TimeFormStringSeparator = ":"; this.smartTimerMessageShow.Tick += new System.EventHandler(this.smartTimerMessageShow_Tick); // + // labelUserID + // + this.labelUserID.BackGround = this.smartForm1; + this.labelUserID.BackGroundColor = System.Drawing.Color.SkyBlue; + this.labelUserID.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(42)))), ((int)(((byte)(82))))); + this.labelUserID.BorderStyle = SmartX.SmartLabel.BorderStyles.None; + this.labelUserID.Font = new System.Drawing.Font("New Gulim", 10F, System.Drawing.FontStyle.Bold); + this.labelUserID.LineSpacing = 0F; + this.labelUserID.Location = new System.Drawing.Point(782, 18); + this.labelUserID.Name = "labelUserID"; + this.labelUserID.OverlapOptimize = true; + this.labelUserID.PasswordChar = '\0'; + this.labelUserID.Radius = 3; + this.labelUserID.RoundRectFillColor = System.Drawing.Color.LightBlue; + this.labelUserID.Size = new System.Drawing.Size(119, 20); + this.labelUserID.TabIndex = 267; + this.labelUserID.Text = "ABCDEFG"; + this.labelUserID.TextColor = System.Drawing.Color.White; + this.labelUserID.TextColorDisable = System.Drawing.Color.Gray; + this.labelUserID.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelUserID.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelUserID.Wordwrap = false; + // + // labelUserLevel + // + this.labelUserLevel.BackGround = this.smartForm1; + this.labelUserLevel.BackGroundColor = System.Drawing.Color.SkyBlue; + this.labelUserLevel.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(42)))), ((int)(((byte)(82))))); + this.labelUserLevel.BorderStyle = SmartX.SmartLabel.BorderStyles.None; + this.labelUserLevel.Font = new System.Drawing.Font("New Gulim", 10F, System.Drawing.FontStyle.Bold); + this.labelUserLevel.LineSpacing = 0F; + this.labelUserLevel.Location = new System.Drawing.Point(782, 44); + this.labelUserLevel.Name = "labelUserLevel"; + this.labelUserLevel.OverlapOptimize = true; + this.labelUserLevel.PasswordChar = '\0'; + this.labelUserLevel.Radius = 3; + this.labelUserLevel.RoundRectFillColor = System.Drawing.Color.LightBlue; + this.labelUserLevel.Size = new System.Drawing.Size(119, 20); + this.labelUserLevel.TabIndex = 268; + this.labelUserLevel.Text = "ABCDEFG"; + this.labelUserLevel.TextColor = System.Drawing.Color.White; + this.labelUserLevel.TextColorDisable = System.Drawing.Color.Gray; + this.labelUserLevel.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelUserLevel.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelUserLevel.Wordwrap = false; + // // FormMainDisplay2 // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); @@ -2525,7 +2551,7 @@ private SmartX.SmartLabel labelResult1; private SmartX.SmartButton buttonUser; public SmartX.SmartLabel labelCommunicationStatus; - private SmartX.SmartLabel labelAlarm; + public SmartX.SmartLabel labelSensorStatus1; private SmartX.SmartLabel labelTime; private SmartX.SmartLabel labelStop; private SmartX.SmartLabel labelStart; @@ -2546,7 +2572,7 @@ private SmartX.SmartGroupBox smartGroupBox1; private SmartX.SmartTimer smartTimerAlarm; private SmartX.SmartButton smartButton1; - private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label labelAlarm; private SmartX.SmartLabel labelProgress3sec; private SmartX.SmartLabel labelProgress4sec; private System.Windows.Forms.PictureBox pictureBoxProgress0; @@ -2604,6 +2630,8 @@ public SmartX.SmartLabel labelSbAlarm5; public SmartX.SmartLabel labelSbAlarm9; public SmartX.SmartLabel labelSbAlarm4; + private SmartX.SmartLabel labelUserLevel; + private SmartX.SmartLabel labelUserID; private SmartX.SmartLabel smartLabel32; private SmartX.SmartLabel smartLabel33; private SmartX.SmartLabel smartLabel34; diff --git a/INT_PT002/Forms/FormMainDisplay2.cs b/INT_PT002/Forms/FormMainDisplay2.cs index efdbd2b..1008a4c 100644 --- a/INT_PT002/Forms/FormMainDisplay2.cs +++ b/INT_PT002/Forms/FormMainDisplay2.cs @@ -173,6 +173,7 @@ namespace INT_PT002.Forms this.LabelProcess0_1LocationY = this.CollectionLabelProgress2[0].Location.Y; this.buttonRecipeNo.ButtonText = this.ParentForm.SystemConfig.RECIPE_NUMBER.ToString(); + this.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus.CurrentUser); } private void InitializeData() { @@ -272,47 +273,43 @@ namespace INT_PT002.Forms if (user.Status == Define.E_UserStatus.NotLogin) { id = ""; + group = ""; this.buttonRecipeNo.Enabled = true; this.buttonClear.Enabled = true; + this.buttonInspection.Enabled = true; } else if (user.Status == Define.E_UserStatus.LogOff) { id = "LogOff"; + group = ""; - //if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOff) - // this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOff; + if (this.labelUserLevel.TextColor != this.ParentForm.ColorLogOff) + this.labelUserLevel.TextColor = this.labelUserID.TextColor = this.ParentForm.ColorLogOff; - //this.buttonUser.ButtonUp(); - //this.buttonProductNo.Enabled = false; - //this.buttonClear.Enabled = false; - //this.buttonSubMenu.Enabled = false; - //this.buttonUnder.Enabled = false; - //this.buttonPass.Enabled = false; - //this.buttonOver.Enabled = false; - //this.buttonTare.Enabled = false; + this.buttonUser.ButtonUp(); + this.buttonRecipeNo.Enabled = false; + this.buttonClear.Enabled = false; + this.buttonInspection.Enabled = false; } else { id = user.ID; + group = user.Status.ToString(); - //if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn) - // this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn; + if (this.labelUserLevel.TextColor != this.ParentForm.ColorLogOn) + this.labelUserLevel.TextColor = this.labelUserID.TextColor = this.ParentForm.ColorLogOn; - //this.buttonUser.ButtonDown(); - //this.buttonProductNo.Enabled = user.IsMainProductNo; - //this.buttonClear.Enabled = user.IsMainClear; - //this.buttonSubMenu.Enabled = user.IsMainSubMenu; - //this.buttonUnder.Enabled = user.IsMainWeightSetting; - //this.buttonPass.Enabled = user.IsMainWeightSetting; - //this.buttonOver.Enabled = user.IsMainWeightSetting; - //this.buttonTare.Enabled = user.IsMainWeightSetting; + this.buttonUser.ButtonDown(); + this.buttonRecipeNo.Enabled = user.IsMainRecipeChange; + this.buttonClear.Enabled = user.IsMainClear; + this.buttonInspection.Enabled = true; } - //if (this.labelUserLevel.Text != group) - // this.labelUserLevel.Text = group; - //if (this.labelUserID.Text != id) - // this.labelUserID.Text = id; + if (this.labelUserLevel.Text != group) + this.labelUserLevel.Text = group; + if (this.labelUserID.Text != id) + this.labelUserID.Text = id; } private void Login() { @@ -336,6 +333,7 @@ namespace INT_PT002.Forms { this.ParentForm.CurrentSystemStatus.CurrentUser.Status = Define.E_UserStatus.LogOff; this.buttonUser.ButtonUp(); + this.buttonUser.ButtonText = "Login"; this.DisplayRefresh(); // Part 11 @@ -599,13 +597,13 @@ namespace INT_PT002.Forms this.CollectionLabelSbAlarm[9].Visible = alarm.CollectionIsSensorBoardError[9]; value = value.Trim(); - this.label1.Size = new Size(value.Length * 8, 20); - this.label1.Text = value; - this.label1.Location = new Point(6, 22); + this.labelAlarm.Size = new Size(value.Length * 8, 20); + this.labelAlarm.Text = value; + this.labelAlarm.Location = new Point(6, 22); - if (this.label1.Width > 548) + if (this.labelAlarm.Width > 548) { - if (this.label1.Text != "") + if (this.labelAlarm.Text != "") this.smartTimerAlarm.Start(); } } @@ -643,7 +641,6 @@ namespace INT_PT002.Forms this.labelTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } - public void DisplayRefresh() { this.ParentForm.CurrentSystemStatus.CurrentForm = Define.E_FormStore.FormMainDisplay; @@ -651,6 +648,8 @@ namespace INT_PT002.Forms this.ParentForm.SetDisplayMode(Define.E_EquipmentMode.Normal); this.buttonRecipeNo.ButtonText = this.ParentForm.CurrentRecipe.NUMBER.ToString(); + + this.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus.CurrentUser); } #endregion @@ -786,9 +785,9 @@ namespace INT_PT002.Forms private void smartTimerAlarm_Tick(object sender, EventArgs e) { - this.label1.Left = this.label1.Left - 5; - if (this.label1.Left < 0 - this.label1.Width - 20) - this.label1.Left = this.smartGroupBox1.Width - 10; + this.labelAlarm.Left = this.labelAlarm.Left - 5; + if (this.labelAlarm.Left < 0 - this.labelAlarm.Width - 20) + this.labelAlarm.Left = this.smartGroupBox1.Width - 10; } private void smartTimerMessageShow_Tick(object sender, EventArgs e) { @@ -813,12 +812,12 @@ namespace INT_PT002.Forms //value += "a6_Pressure "; value = value.Trim(); - this.label1.Size = new Size(value.Length * 8, 20); - this.label1.Text = value; + this.labelAlarm.Size = new Size(value.Length * 8, 20); + this.labelAlarm.Text = value; - if (this.label1.Width > 548) + if (this.labelAlarm.Width > 548) { - if (this.label1.Text != "") + if (this.labelAlarm.Text != "") this.smartTimerAlarm.Start(); } } @@ -837,12 +836,12 @@ namespace INT_PT002.Forms //value += "a6_Pressure "; value = value.Trim(); - this.label1.Size = new Size(value.Length * 8, 20); - this.label1.Text = value; + this.labelAlarm.Size = new Size(value.Length * 8, 20); + this.labelAlarm.Text = value; - if (this.label1.Width > 548) + if (this.labelAlarm.Width > 548) { - if (this.label1.Text != "") + if (this.labelAlarm.Text != "") this.smartTimerAlarm.Start(); } } @@ -861,12 +860,12 @@ namespace INT_PT002.Forms value += "a6_Pressure "; value = value.Trim(); - this.label1.Size = new Size(value.Length * 8, 20); - this.label1.Text = value; + this.labelAlarm.Size = new Size(value.Length * 8, 20); + this.labelAlarm.Text = value; - if (this.label1.Width > 548) + if (this.labelAlarm.Width > 548) { - if (this.label1.Text != "") + if (this.labelAlarm.Text != "") this.smartTimerAlarm.Start(); } } diff --git a/INT_PT002/Forms/FormMenu.Designer.cs b/INT_PT002/Forms/FormMenu.Designer.cs index cb35180..62886c8 100644 --- a/INT_PT002/Forms/FormMenu.Designer.cs +++ b/INT_PT002/Forms/FormMenu.Designer.cs @@ -30,6 +30,8 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMenu)); this.smartForm1 = new SmartX.SmartForm(); + this.labelStop = new SmartX.SmartLabel(); + this.labelStart = new SmartX.SmartLabel(); this.buttonUser = new SmartX.SmartButton(); this.labelUserID = new SmartX.SmartLabel(); this.labelUserLevel = new SmartX.SmartLabel(); @@ -42,11 +44,9 @@ this.buttonSystem = new SmartX.SmartButton(); this.buttonLog = new SmartX.SmartButton(); this.buttonManual = new SmartX.SmartButton(); - this.labelStop = new SmartX.SmartLabel(); this.buttonRecipe = new SmartX.SmartButton(); this.buttonHome = new SmartX.SmartButton(); this.smartGroupBox1 = new SmartX.SmartGroupBox(); - this.labelStart = new SmartX.SmartLabel(); this.smartForm1.SuspendLayout(); this.SuspendLayout(); // @@ -85,6 +85,54 @@ this.smartForm1.SpecialFunctionClickPointSize = 100; this.smartForm1.UseMainMenu = false; // + // labelStop + // + this.labelStop.BackGround = null; + this.labelStop.BackGroundColor = System.Drawing.Color.Red; + this.labelStop.BorderColor = System.Drawing.Color.Red; + this.labelStop.BorderStyle = SmartX.SmartLabel.BorderStyles.RoundRect; + this.labelStop.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold); + this.labelStop.LineSpacing = 0F; + this.labelStop.Location = new System.Drawing.Point(911, 3); + this.labelStop.Name = "labelStop"; + this.labelStop.OverlapOptimize = true; + this.labelStop.PasswordChar = '\0'; + this.labelStop.Radius = 10; + this.labelStop.RoundRectFillColor = System.Drawing.Color.Red; + this.labelStop.Size = new System.Drawing.Size(110, 30); + this.labelStop.TabIndex = 73; + this.labelStop.Text = "STOP"; + this.labelStop.TextColor = System.Drawing.Color.White; + this.labelStop.TextColorDisable = System.Drawing.Color.Gray; + this.labelStop.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelStop.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelStop.Wordwrap = false; + this.labelStop.Click += new System.EventHandler(this.labelStop_Click); + // + // labelStart + // + this.labelStart.BackGround = null; + this.labelStart.BackGroundColor = System.Drawing.Color.DarkGreen; + this.labelStart.BorderColor = System.Drawing.Color.DarkGreen; + this.labelStart.BorderStyle = SmartX.SmartLabel.BorderStyles.None; + this.labelStart.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold); + this.labelStart.LineSpacing = 0F; + this.labelStart.Location = new System.Drawing.Point(911, 3); + this.labelStart.Name = "labelStart"; + this.labelStart.OverlapOptimize = true; + this.labelStart.PasswordChar = '\0'; + this.labelStart.Radius = 10; + this.labelStart.RoundRectFillColor = System.Drawing.Color.DarkGreen; + this.labelStart.Size = new System.Drawing.Size(110, 30); + this.labelStart.TabIndex = 88; + this.labelStart.Text = "START"; + this.labelStart.TextColor = System.Drawing.Color.White; + this.labelStart.TextColorDisable = System.Drawing.Color.Gray; + this.labelStart.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelStart.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelStart.Wordwrap = false; + this.labelStart.Click += new System.EventHandler(this.labelStart_Click); + // // buttonUser // this.buttonUser.BackGround = this.smartForm1; @@ -114,7 +162,7 @@ this.buttonUser.TabIndex = 86; this.buttonUser.Text = null; this.buttonUser.TextColor = System.Drawing.Color.White; - this.buttonUser.TextColorDisable = System.Drawing.Color.Gray; + this.buttonUser.TextColorDisable = System.Drawing.Color.Gainsboro; this.buttonUser.TextDownColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); this.buttonUser.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle; this.buttonUser.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle; @@ -365,7 +413,7 @@ this.buttonSystem.TabIndex = 77; this.buttonSystem.Text = null; this.buttonSystem.TextColor = System.Drawing.Color.White; - this.buttonSystem.TextColorDisable = System.Drawing.Color.Gray; + this.buttonSystem.TextColorDisable = System.Drawing.Color.Gainsboro; this.buttonSystem.TextDownColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); this.buttonSystem.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle; this.buttonSystem.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle; @@ -400,7 +448,7 @@ this.buttonLog.TabIndex = 76; this.buttonLog.Text = null; this.buttonLog.TextColor = System.Drawing.Color.White; - this.buttonLog.TextColorDisable = System.Drawing.Color.Gray; + this.buttonLog.TextColorDisable = System.Drawing.Color.Gainsboro; this.buttonLog.TextDownColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); this.buttonLog.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle; this.buttonLog.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle; @@ -435,36 +483,12 @@ this.buttonManual.TabIndex = 75; this.buttonManual.Text = null; this.buttonManual.TextColor = System.Drawing.Color.White; - this.buttonManual.TextColorDisable = System.Drawing.Color.Gray; + this.buttonManual.TextColorDisable = System.Drawing.Color.Gainsboro; this.buttonManual.TextDownColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); this.buttonManual.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle; this.buttonManual.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle; this.buttonManual.Click += new System.EventHandler(this.buttonManual_Click); // - // labelStop - // - this.labelStop.BackGround = null; - this.labelStop.BackGroundColor = System.Drawing.Color.Red; - this.labelStop.BorderColor = System.Drawing.Color.Red; - this.labelStop.BorderStyle = SmartX.SmartLabel.BorderStyles.RoundRect; - this.labelStop.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold); - this.labelStop.LineSpacing = 0F; - this.labelStop.Location = new System.Drawing.Point(911, 3); - this.labelStop.Name = "labelStop"; - this.labelStop.OverlapOptimize = true; - this.labelStop.PasswordChar = '\0'; - this.labelStop.Radius = 10; - this.labelStop.RoundRectFillColor = System.Drawing.Color.Red; - this.labelStop.Size = new System.Drawing.Size(110, 30); - this.labelStop.TabIndex = 73; - this.labelStop.Text = "STOP"; - this.labelStop.TextColor = System.Drawing.Color.White; - this.labelStop.TextColorDisable = System.Drawing.Color.Gray; - this.labelStop.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; - this.labelStop.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; - this.labelStop.Wordwrap = false; - this.labelStop.Click += new System.EventHandler(this.labelStop_Click); - // // buttonRecipe // this.buttonRecipe.BackGround = this.smartForm1; @@ -494,7 +518,7 @@ this.buttonRecipe.TabIndex = 72; this.buttonRecipe.Text = null; this.buttonRecipe.TextColor = System.Drawing.Color.White; - this.buttonRecipe.TextColorDisable = System.Drawing.Color.Gray; + this.buttonRecipe.TextColorDisable = System.Drawing.Color.Gainsboro; this.buttonRecipe.TextDownColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); this.buttonRecipe.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle; this.buttonRecipe.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle; @@ -553,30 +577,6 @@ this.smartGroupBox1.Text = "기본 > "; this.smartGroupBox1.TextColor = System.Drawing.Color.White; // - // labelStart - // - this.labelStart.BackGround = null; - this.labelStart.BackGroundColor = System.Drawing.Color.DarkGreen; - this.labelStart.BorderColor = System.Drawing.Color.DarkGreen; - this.labelStart.BorderStyle = SmartX.SmartLabel.BorderStyles.None; - this.labelStart.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold); - this.labelStart.LineSpacing = 0F; - this.labelStart.Location = new System.Drawing.Point(911, 3); - this.labelStart.Name = "labelStart"; - this.labelStart.OverlapOptimize = true; - this.labelStart.PasswordChar = '\0'; - this.labelStart.Radius = 10; - this.labelStart.RoundRectFillColor = System.Drawing.Color.DarkGreen; - this.labelStart.Size = new System.Drawing.Size(110, 30); - this.labelStart.TabIndex = 88; - this.labelStart.Text = "START"; - this.labelStart.TextColor = System.Drawing.Color.White; - this.labelStart.TextColorDisable = System.Drawing.Color.Gray; - this.labelStart.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; - this.labelStart.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; - this.labelStart.Wordwrap = false; - this.labelStart.Click += new System.EventHandler(this.labelStart_Click); - // // FormMenu // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); diff --git a/INT_PT002/Forms/FormMenu.cs b/INT_PT002/Forms/FormMenu.cs index 04fc43b..99ebe92 100644 --- a/INT_PT002/Forms/FormMenu.cs +++ b/INT_PT002/Forms/FormMenu.cs @@ -113,9 +113,9 @@ namespace INT_PT002.Forms { string id = "", group = ""; - switch (user.UserGroup) + switch (user.Status) { - case Define.E_UserGroup.f0_Level1: + case Define.E_UserStatus.Level1: id = user.ID; group = "Level1"; @@ -125,7 +125,7 @@ namespace INT_PT002.Forms this.buttonLog.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsLogEnable; this.buttonSystem.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsSystemEnable; break; - case Define.E_UserGroup.f1_Level2: + case Define.E_UserStatus.Level2: id = user.ID; group = "Level2"; @@ -135,7 +135,7 @@ namespace INT_PT002.Forms this.buttonLog.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsLogEnable; this.buttonSystem.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsSystemEnable; break; - case Define.E_UserGroup.f2_Level3: + case Define.E_UserStatus.Level3: id = user.ID; group = "Level3"; @@ -145,7 +145,7 @@ namespace INT_PT002.Forms this.buttonLog.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsLogEnable; this.buttonSystem.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsSystemEnable; break; - case Define.E_UserGroup.f4_Developer: + case Define.E_UserStatus.Developer: id = user.ID; group = "Level4"; @@ -165,7 +165,7 @@ namespace INT_PT002.Forms this.buttonUser.Enabled = false; this.buttonManual.Enabled = false; this.buttonLog.Enabled = false; - this.buttonSystem.Enabled = true; + this.buttonSystem.Enabled = false; break; } @@ -730,16 +730,22 @@ namespace INT_PT002.Forms public void DisplayRefresh(SystemStatus status) { - //this.UpdateDisplayUser(status.CurrentUser); - this.SelectedTopMenu = Define.E_TopMenuStore.Recipe; - this.SetTopMenu(this.SelectedTopMenu); + 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); }