From 39b79e238f6eab3d79b4e96d79353354771f27b0 Mon Sep 17 00:00:00 2001 From: sj84 Date: Tue, 29 Aug 2023 11:38:01 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8,=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=EC=84=A4=EC=A0=95,=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EB=B0=B1=EC=97=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- INT69DC_7C/DataStore.cs | 48 +- .../DialogForms/DialogFormLogOn.Designer.cs | 86 +- INT69DC_7C/DialogForms/DialogFormLogOn.cs | 166 +- INT69DC_7C/DialogForms/DialogFormLogOn1.cs | 2 +- INT69DC_7C/DialogForms/DialogFormMessage.cs | 16 +- INT69DC_7C/DialogForms/DialogFormYesNo.cs | 15 +- INT69DC_7C/Forms/FormDataBackup.Designer.cs | 84 +- INT69DC_7C/Forms/FormDataBackup_Part11.cs | 2 +- INT69DC_7C/Forms/FormMain.cs | 1737 +++++++++-------- INT69DC_7C/Forms/FormMainDisplay.Designer.cs | 1 + INT69DC_7C/Forms/FormMainDisplay.cs | 371 ++-- INT69DC_7C/Forms/FormMenu.cs | 59 +- INT69DC_7C/Forms/FormOptionSetting.cs | 2 + INT69DC_7C/Forms/FormUserEditor.cs | 33 +- INT69DC_7C/Forms/FormUserEditor.designer.cs | 1 + INT69DC_7C/Part11_UserManager/UserItem.cs | 41 +- .../Part11_UserManager/UserManager.Define.cs | 3 + INT69DC_7C/Part11_UserManager/UserManager.cs | 12 + INT69DC_7C/Version.txt | 1 + 19 files changed, 1529 insertions(+), 1151 deletions(-) diff --git a/INT69DC_7C/DataStore.cs b/INT69DC_7C/DataStore.cs index cd654a7..5da8b9f 100644 --- a/INT69DC_7C/DataStore.cs +++ b/INT69DC_7C/DataStore.cs @@ -1611,8 +1611,10 @@ namespace INT69DC_7C private bool m_IsADCError; private bool m_IsBypassMode; - private bool m_IsOPT1; - private bool m_IsOPT2; + private bool m_IsUpdate_COM3; + private bool m_IsUpdate_Ethernet; + private bool m_IsUpdate1; + private bool m_IsUpdate_DataBackup; private int m_ContinuousNG; private bool m_IsContinuousNG; @@ -1838,21 +1840,39 @@ namespace INT69DC_7C /// /// 스틱2모드에서 데이터 갱신이 되었으면 true, 안되었으면 false + /// COM3 사용 /// - public bool IsOPT1 + public bool IsUpdate_COM3 { - get { return this.m_IsOPT1; } - set { this.m_IsOPT1 = value; } + get { return this.m_IsUpdate_COM3; } + set { this.m_IsUpdate_COM3 = value; } } /// /// 스틱2모드에서 데이터 갱신이 되었으면 true, 안되었으면 false - /// Alarm Total Pass Count 에서 사용 - /// 추후에 IsOPT1과 통합하여 코드 정리 할것 (V 10.11.0) + /// Ethernet 사용 /// - public bool IsOPT2 + public bool IsUpdate_Ethernet { - get { return this.m_IsOPT2; } - set { this.m_IsOPT2 = value; } + get { return this.m_IsUpdate_Ethernet; } + set { this.m_IsUpdate_Ethernet = value; } + } + /// + /// 스틱2모드에서 데이터 갱신이 되었으면 true, 안되었으면 false + /// Alarm Total Pass Count 에서 사용 + /// + public bool IsUpdate_ATPC + { + get { return this.m_IsUpdate1; } + set { this.m_IsUpdate1 = value; } + } + /// + /// 스틱2모드에서 데이터 갱신이 되었으면 true, 안되었으면 false + /// Databackup 사용 + /// + public bool IsUpdate_DataBackup + { + get { return this.m_IsUpdate_DataBackup; } + set { this.m_IsUpdate_DataBackup = value; } } /// @@ -1899,8 +1919,10 @@ namespace INT69DC_7C this.WeightString = "0"; this.IsADCError = false; this.IsBypassMode = false; - this.IsOPT1 = false; - this.IsOPT2 = false; + this.IsUpdate_COM3 = false; + this.IsUpdate_Ethernet = false; + this.IsUpdate_ATPC = false; + this.IsUpdate_DataBackup = false; this.IsContinuousNG = false; this.ContinuousNG = 0; this.UpdateCount = 0; @@ -4119,7 +4141,7 @@ namespace INT69DC_7C for (int i = 0; i < datas.Count; i++) { - if (datas[i].IsOPT2 == true) + if (datas[i].IsUpdate_ATPC == true) { if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Pass) this.CurrentTotalPass++; diff --git a/INT69DC_7C/DialogForms/DialogFormLogOn.Designer.cs b/INT69DC_7C/DialogForms/DialogFormLogOn.Designer.cs index 0f71aa5..6025315 100644 --- a/INT69DC_7C/DialogForms/DialogFormLogOn.Designer.cs +++ b/INT69DC_7C/DialogForms/DialogFormLogOn.Designer.cs @@ -40,6 +40,9 @@ this.smartButtonIUser11 = new SmartX.SmartButton(); this.smartButtonUser22 = new SmartX.SmartButton(); this.smartButtonUser33 = new SmartX.SmartButton(); + this.labelTitle2 = new SmartX.SmartLabel(); + this.labelTitle3 = new SmartX.SmartLabel(); + this.labelTitle1 = new SmartX.SmartLabel(); ((System.ComponentModel.ISupportInitialize)(this.smartForm1)).BeginInit(); this.SuspendLayout(); // @@ -95,7 +98,7 @@ // textBoxID // this.textBoxID.Font = new System.Drawing.Font("Arial", 20F, System.Drawing.FontStyle.Regular); - this.textBoxID.Location = new System.Drawing.Point(277, 76); + this.textBoxID.Location = new System.Drawing.Point(287, 76); this.textBoxID.MaxLength = 20; this.textBoxID.Name = "textBoxID"; this.textBoxID.Size = new System.Drawing.Size(218, 37); @@ -106,7 +109,7 @@ // textBoxPassword // this.textBoxPassword.Font = new System.Drawing.Font("Arial", 20F, System.Drawing.FontStyle.Regular); - this.textBoxPassword.Location = new System.Drawing.Point(277, 121); + this.textBoxPassword.Location = new System.Drawing.Point(287, 121); this.textBoxPassword.MaxLength = 20; this.textBoxPassword.Name = "textBoxPassword"; this.textBoxPassword.PasswordChar = '*'; @@ -189,7 +192,7 @@ this.smartButton1.DownImage = null; this.smartButton1.GroupID = 0; this.smartButton1.InitVisible = true; - this.smartButton1.Location = new System.Drawing.Point(512, 30); + this.smartButton1.Location = new System.Drawing.Point(516, 160); this.smartButton1.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.smartButton1.Name = "smartButton1"; this.smartButton1.NestedClickEventPrevent = false; @@ -221,7 +224,7 @@ this.smartButtonAdmin.DownImage = null; this.smartButtonAdmin.GroupID = 0; this.smartButtonAdmin.InitVisible = true; - this.smartButtonAdmin.Location = new System.Drawing.Point(593, 30); + this.smartButtonAdmin.Location = new System.Drawing.Point(597, 160); this.smartButtonAdmin.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.smartButtonAdmin.Name = "smartButtonAdmin"; this.smartButtonAdmin.NestedClickEventPrevent = false; @@ -253,7 +256,7 @@ this.smartButtonIUser11.DownImage = null; this.smartButtonIUser11.GroupID = 0; this.smartButtonIUser11.InitVisible = true; - this.smartButtonIUser11.Location = new System.Drawing.Point(173, 30); + this.smartButtonIUser11.Location = new System.Drawing.Point(177, 160); this.smartButtonIUser11.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.smartButtonIUser11.Name = "smartButtonIUser11"; this.smartButtonIUser11.NestedClickEventPrevent = false; @@ -285,7 +288,7 @@ this.smartButtonUser22.DownImage = null; this.smartButtonUser22.GroupID = 0; this.smartButtonUser22.InitVisible = true; - this.smartButtonUser22.Location = new System.Drawing.Point(254, 30); + this.smartButtonUser22.Location = new System.Drawing.Point(258, 160); this.smartButtonUser22.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.smartButtonUser22.Name = "smartButtonUser22"; this.smartButtonUser22.NestedClickEventPrevent = false; @@ -317,7 +320,7 @@ this.smartButtonUser33.DownImage = null; this.smartButtonUser33.GroupID = 0; this.smartButtonUser33.InitVisible = true; - this.smartButtonUser33.Location = new System.Drawing.Point(335, 30); + this.smartButtonUser33.Location = new System.Drawing.Point(339, 160); this.smartButtonUser33.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; this.smartButtonUser33.Name = "smartButtonUser33"; this.smartButtonUser33.NestedClickEventPrevent = false; @@ -337,12 +340,78 @@ this.smartButtonUser33.UpImage = null; this.smartButtonUser33.Click += new System.EventHandler(this.smartButtonUser33_Click); // + // labelTitle2 + // + this.labelTitle2.BackColor = System.Drawing.Color.White; + this.labelTitle2.BackPictureBox = null; + this.labelTitle2.BackPictureBox1 = null; + this.labelTitle2.BackPictureBox2 = null; + this.labelTitle2.BorderColor = System.Drawing.Color.Black; + this.labelTitle2.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.labelTitle2.Font = new System.Drawing.Font("Arial", 16F, System.Drawing.FontStyle.Bold); + this.labelTitle2.ForeColor = System.Drawing.SystemColors.Control; + this.labelTitle2.InitVisible = true; + this.labelTitle2.LineSpacing = 0F; + this.labelTitle2.Location = new System.Drawing.Point(131, 76); + this.labelTitle2.Name = "labelTitle2"; + this.labelTitle2.Size = new System.Drawing.Size(150, 37); + this.labelTitle2.TabIndex = 19; + this.labelTitle2.Text = "ID"; + this.labelTitle2.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelTitle2.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelTitle2.Wordwrap = false; + // + // labelTitle3 + // + this.labelTitle3.BackColor = System.Drawing.Color.White; + this.labelTitle3.BackPictureBox = null; + this.labelTitle3.BackPictureBox1 = null; + this.labelTitle3.BackPictureBox2 = null; + this.labelTitle3.BorderColor = System.Drawing.Color.Black; + this.labelTitle3.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.labelTitle3.Font = new System.Drawing.Font("Arial", 16F, System.Drawing.FontStyle.Bold); + this.labelTitle3.ForeColor = System.Drawing.SystemColors.Control; + this.labelTitle3.InitVisible = true; + this.labelTitle3.LineSpacing = 0F; + this.labelTitle3.Location = new System.Drawing.Point(131, 121); + this.labelTitle3.Name = "labelTitle3"; + this.labelTitle3.Size = new System.Drawing.Size(150, 37); + this.labelTitle3.TabIndex = 20; + this.labelTitle3.Text = "Confirmation"; + this.labelTitle3.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelTitle3.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelTitle3.Wordwrap = false; + // + // labelTitle1 + // + this.labelTitle1.BackColor = System.Drawing.Color.White; + this.labelTitle1.BackPictureBox = null; + this.labelTitle1.BackPictureBox1 = null; + this.labelTitle1.BackPictureBox2 = null; + this.labelTitle1.BorderColor = System.Drawing.Color.Black; + this.labelTitle1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.labelTitle1.Font = new System.Drawing.Font("Arial", 20F, System.Drawing.FontStyle.Bold); + this.labelTitle1.ForeColor = System.Drawing.SystemColors.Control; + this.labelTitle1.InitVisible = true; + this.labelTitle1.LineSpacing = 0F; + this.labelTitle1.Location = new System.Drawing.Point(131, 33); + this.labelTitle1.Name = "labelTitle1"; + this.labelTitle1.Size = new System.Drawing.Size(500, 37); + this.labelTitle1.TabIndex = 21; + this.labelTitle1.Text = "User Login"; + this.labelTitle1.TextHAlign = SmartX.SmartLabel.TextHorAlign.Middle; + this.labelTitle1.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; + this.labelTitle1.Wordwrap = false; + // // DialogFormLogOn // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(710, 470); this.ControlBox = false; + this.Controls.Add(this.labelTitle1); + this.Controls.Add(this.labelTitle3); + this.Controls.Add(this.labelTitle2); this.Controls.Add(this.smartButtonUser33); this.Controls.Add(this.smartButtonUser22); this.Controls.Add(this.smartButtonIUser11); @@ -375,5 +444,8 @@ private SmartX.SmartButton smartButtonIUser11; private SmartX.SmartButton smartButtonUser22; private SmartX.SmartButton smartButtonUser33; + private SmartX.SmartLabel labelTitle2; + private SmartX.SmartLabel labelTitle3; + private SmartX.SmartLabel labelTitle1; } } \ No newline at end of file diff --git a/INT69DC_7C/DialogForms/DialogFormLogOn.cs b/INT69DC_7C/DialogForms/DialogFormLogOn.cs index 0018177..aff33e4 100644 --- a/INT69DC_7C/DialogForms/DialogFormLogOn.cs +++ b/INT69DC_7C/DialogForms/DialogFormLogOn.cs @@ -17,14 +17,18 @@ namespace INT69DC_7C.DialogForms { #region Field private FormMain m_ParentForm; + private bool IsLoginMode; + private bool IsChangePassword; #endregion #region Constructor - public DialogFormLogOn(FormMain parent) + public DialogFormLogOn(FormMain parent, bool login, bool changePass) { InitializeComponent(); this.ParentForm = parent; + this.IsLoginMode = login; + this.IsChangePassword = changePass; this.InitializeDesign(); this.InitializeControl(); @@ -90,6 +94,19 @@ namespace INT69DC_7C.DialogForms } private void InitializeControl() { + if (this.IsChangePassword == false) + { + this.labelTitle1.Text = "User Loigin"; + this.labelTitle2.Text = "ID"; + this.labelTitle3.Text = "Password"; + } + else + { + this.labelTitle1.Text = "Change Password"; + this.labelTitle2.Text = "New PW"; + this.labelTitle3.Text = "Confirmation"; + } + this.textBoxID.Text = ""; this.textBoxPassword.Text = ""; @@ -104,14 +121,9 @@ namespace INT69DC_7C.DialogForms { } - #endregion - #region Event Handler - private void buttonLogOn_Click(object sender, EventArgs e) + private void LogOn() { - // Automatic Logout Reset - this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); - UserManager.UserMgr_user_info_t userInfo = new UserManager.UserMgr_user_info_t(); if (this.textBoxID.Text == "") @@ -133,7 +145,7 @@ namespace INT69DC_7C.DialogForms UserManager.UserManager_UserLoginDirect(this.textBoxID.Text, this.textBoxPassword.Text, ref userInfo); - if (userInfo.status == 0 ) + if (userInfo.status == 0) { //MessageBox.Show("로그인 성공"); @@ -159,26 +171,14 @@ namespace INT69DC_7C.DialogForms this.ParentForm.SystemConfig.CurrentUser.DateRegister = time; time = DateTime.ParseExact(userInfo.login_date.GetDateTime(), "yyyyMMddHHmmss", null); this.ParentForm.SystemConfig.CurrentUser.DateLogin = time; - - if (this.ParentForm.SystemConfig.CurrentUser.Group == DataStore.UserGroup.Admin - || this.ParentForm.SystemConfig.CurrentUser.Group == DataStore.UserGroup.Developer) - { - this.ParentForm.SystemConfig.CurrentUser.DateExpireRegister = DateTime.Now; - this.ParentForm.SystemConfig.CurrentUser.DateExpireLogin = DateTime.Now; - } - else - { - time = DateTime.ParseExact(userInfo.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.ParentForm.SystemConfig.CurrentUser.DateExpireRegister = time; - time = DateTime.ParseExact(userInfo.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null); - this.ParentForm.SystemConfig.CurrentUser.DateExpireLogin = time; - } + time = DateTime.ParseExact(userInfo.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateExpireRegister = time; + time = DateTime.ParseExact(userInfo.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateExpireLogin = time; this.ParentForm.SystemConfig.CurrentUser.IsLockAccount = userInfo.flock_status_account == 0 ? false : true; this.ParentForm.SystemConfig.CurrentUser.IsLockPassword = userInfo.flock_status_password == 0 ? false : true; - this.ParentForm.SystemConfig.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true; - this.ParentForm.SystemConfig.CurrentUser.ActiveLevel = userInfo.active_level; #endregion @@ -193,11 +193,129 @@ namespace INT69DC_7C.DialogForms // 비밀번호 만료 시 if (userInfo.status == 15) { + this.ParentForm.ChildFormMainDisplay.ChangeID = this.textBoxID.Text; this.DialogResult = DialogResult.Abort; this.Close(); } } } + private void ChangePassword() + { + int ret = 0; + string id = "", pass = ""; + UserManager.UserMgr_user_info_t userInfo = new UserManager.UserMgr_user_info_t(); + + if (this.textBoxID.Text == "") + { + // New Password : 6~20자 입력 하세요 + DialogFormMessage myMsg = new DialogFormMessage(null, 9, this.ParentForm.SystemConfig.Language); + myMsg.ShowDialog(); + + return; + } + if (this.textBoxPassword.Text == "") + { + // New Password Confirmation : 6~20자 입력 하세요 + DialogFormMessage myMsg = new DialogFormMessage(null, 9, this.ParentForm.SystemConfig.Language); + myMsg.ShowDialog(); + + return; + } + if (this.textBoxID.Text.Equals(this.textBoxPassword.Text) == false) + { + // 비밀번호를 확인하세요 + DialogFormMessage myMsg = new DialogFormMessage(null, 14, this.ParentForm.SystemConfig.Language); + myMsg.ShowDialog(); + + return; + } + + if (this.IsLoginMode == true) + { + id = this.ParentForm.SystemConfig.CurrentUser.ID; + pass = this.textBoxID.Text; + + Console.WriteLine(string.Format("UserManager_UserModifyPW : {0}, {1}", id, pass)); + ret = UserManager.UserManager_UserModifyPWDirect(id, pass); + } + else + { + id = this.ParentForm.ChildFormMainDisplay.ChangeID; + pass = this.textBoxID.Text; + + Console.WriteLine(string.Format("UserManager_UserModifyPW : {0}, {1}", id, pass)); + ret = UserManager.UserManager_UserModifyPWDirect(id, pass); + } + + // 비밀번호 변경이 완료 되면 로그인 시도 + if (ret == 0) + { + UserManager.UserManager_UserLoginDirect(id, pass, ref userInfo); + + if (userInfo.status == 0) + { + //MessageBox.Show("로그인 성공"); + + #region 로그인 성공 + if (userInfo.active_level == 1) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Level1; + else if (userInfo.active_level == 2) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Level2; + else if (userInfo.active_level == 3) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Level3; + else if (userInfo.active_level == 9) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Admin; + else if (userInfo.active_level == 10) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Developer; + + this.ParentForm.SystemConfig.CurrentUser.ID = userInfo.user_id; + this.ParentForm.SystemConfig.CurrentUser.Password = userInfo.user_pw; + + this.ParentForm.SystemConfig.CurrentUser.ExpireAccount = userInfo.expire_period_account; + this.ParentForm.SystemConfig.CurrentUser.ExpirePassword = userInfo.expire_period_pw; + + DateTime time = DateTime.ParseExact(userInfo.register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateRegister = time; + time = DateTime.ParseExact(userInfo.login_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateLogin = time; + time = DateTime.ParseExact(userInfo.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateExpireRegister = time; + time = DateTime.ParseExact(userInfo.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateExpireLogin = time; + + this.ParentForm.SystemConfig.CurrentUser.IsLockAccount = userInfo.flock_status_account == 0 ? false : true; + this.ParentForm.SystemConfig.CurrentUser.IsLockPassword = userInfo.flock_status_password == 0 ? false : true; + this.ParentForm.SystemConfig.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true; + this.ParentForm.SystemConfig.CurrentUser.ActiveLevel = userInfo.active_level; + #endregion + + this.DialogResult = DialogResult.OK; + this.Close(); + } + else + { + DialogFormMessage myMsg = new DialogFormMessage(null, ret, this.ParentForm.SystemConfig.Language); + myMsg.ShowDialog(); + } + } + else + { + // 비밀번호 변경 실패 시 메시지?? + } + } + #endregion + + #region Event Handler + private void buttonLogOn_Click(object sender, EventArgs e) + { + // Automatic Logout Reset + this.ParentForm.ChildFormMainDisplay.Part11AutomaticLogoutReset(); + + if (this.IsChangePassword == false) + this.LogOn(); + else + this.ChangePassword(); + } private void buttonCancel_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; diff --git a/INT69DC_7C/DialogForms/DialogFormLogOn1.cs b/INT69DC_7C/DialogForms/DialogFormLogOn1.cs index 2af40ac..3990331 100644 --- a/INT69DC_7C/DialogForms/DialogFormLogOn1.cs +++ b/INT69DC_7C/DialogForms/DialogFormLogOn1.cs @@ -165,7 +165,7 @@ namespace INT69DC_7C.DialogForms this.SuccessLogin(this.UserInfo); - sValue = this.ParentForm.ChildFormMainDisplay.DisplayExpireOfPassword(this.ParentForm.SystemConfig.CurrentUser.Group); + //sValue = this.ParentForm.ChildFormMainDisplay.DisplayExpireOfPassword(this.ParentForm.SystemConfig.CurrentUser.Group); if (sValue != "-") { int intExpireDate = int.Parse(sValue); diff --git a/INT69DC_7C/DialogForms/DialogFormMessage.cs b/INT69DC_7C/DialogForms/DialogFormMessage.cs index 78b900e..254d3b3 100644 --- a/INT69DC_7C/DialogForms/DialogFormMessage.cs +++ b/INT69DC_7C/DialogForms/DialogFormMessage.cs @@ -1086,11 +1086,11 @@ namespace INT69DC_7C.DialogForms break; case 16: this.labelErrorCode.Text = "Error 04_16"; - this.labelMessage1.Text = "접근 권한을 설정해 주십시오"; + this.labelMessage1.Text = ""; break; case 17: this.labelErrorCode.Text = "Error 04_17"; - this.labelMessage1.Text = "비밀번호가 동일하지 않습니다"; + this.labelMessage1.Text = ""; break; case 18: this.labelErrorCode.Text = "Error 04_18"; @@ -1173,11 +1173,11 @@ namespace INT69DC_7C.DialogForms break; case 16: this.labelErrorCode.Text = "Error 04_16"; - this.labelMessage1.Text = "Please set the access right"; + this.labelMessage1.Text = ""; break; case 17: this.labelErrorCode.Text = "Error 04_17"; - this.labelMessage1.Text = "Passwords are not the same"; + this.labelMessage1.Text = ""; break; case 18: this.labelErrorCode.Text = "Error 04_18"; @@ -1262,11 +1262,11 @@ namespace INT69DC_7C.DialogForms break; case 16: this.labelErrorCode.Text = "错误 04_16"; - this.labelMessage1.Text = "请设置访问权限"; + this.labelMessage1.Text = ""; break; case 17: this.labelErrorCode.Text = "错误 04_17"; - this.labelMessage1.Text = "密码不一样"; + this.labelMessage1.Text = ""; break; case 18: this.labelErrorCode.Text = "错误 04_18"; @@ -1435,11 +1435,11 @@ namespace INT69DC_7C.DialogForms break; case 16: this.labelErrorCode.Text = "Fehler 04_16"; - this.labelMessage1.Text = "Bitte legen Sie Zugriffsrechte fest"; + this.labelMessage1.Text = ""; break; case 17: this.labelErrorCode.Text = "Fehler 04_17"; - this.labelMessage1.Text = "Passwörter sind nicht gleich"; + this.labelMessage1.Text = ""; break; case 18: this.labelErrorCode.Text = "Fehler 04_18"; diff --git a/INT69DC_7C/DialogForms/DialogFormYesNo.cs b/INT69DC_7C/DialogForms/DialogFormYesNo.cs index 2b4af34..ab1afb6 100644 --- a/INT69DC_7C/DialogForms/DialogFormYesNo.cs +++ b/INT69DC_7C/DialogForms/DialogFormYesNo.cs @@ -409,9 +409,9 @@ namespace INT69DC_7C.DialogForms switch (ok) { case 2: - this.labelErrorCode.Text = "비밀번호 만료"; + this.labelErrorCode.Text = "로그인"; if (int.Parse(msg) == 0) - this.labelMessage1.Text = "비밀번호 만료일입니다."; + this.labelMessage1.Text = "비밀번호가 만료되었습니다."; else this.labelMessage1.Text = string.Format("비밀번호 만료 {0}일 전입니다.", msg); this.labelMessage2.Text = "비밀번호를 변경하시겠습니까?"; @@ -428,11 +428,11 @@ namespace INT69DC_7C.DialogForms switch (ok) { case 2: - this.labelErrorCode.Text = "Password expiration"; + this.labelErrorCode.Text = "Login"; if (int.Parse(msg) == 0) - this.labelMessage1.Text = "Today is the password expiration date."; + this.labelMessage1.Text = "Password has expired."; else - this.labelMessage1.Text = string.Format("{0} days before password expires", msg); + this.labelMessage1.Text = string.Format("{0} days before password expiration.", msg); this.labelMessage2.Text = "Do you want to change the password?"; break; case 31: @@ -443,14 +443,13 @@ namespace INT69DC_7C.DialogForms break; } break; - break; case DataStore.LanguageID.Chinese: switch (ok) { case 2: - this.labelErrorCode.Text = "密码过期"; + this.labelErrorCode.Text = "登录"; if (int.Parse(msg) == 0) - this.labelMessage1.Text = "今天是密码过期日期."; + this.labelMessage1.Text = "密码已过期."; else this.labelMessage1.Text = string.Format("密码过期前{0}天", msg); this.labelMessage2.Text = "您要更改密码吗?"; diff --git a/INT69DC_7C/Forms/FormDataBackup.Designer.cs b/INT69DC_7C/Forms/FormDataBackup.Designer.cs index 1254c52..d55b652 100644 --- a/INT69DC_7C/Forms/FormDataBackup.Designer.cs +++ b/INT69DC_7C/Forms/FormDataBackup.Designer.cs @@ -35,13 +35,13 @@ this.labelTitle = new SmartX.SmartLabel(); this.labelStaticSaveFile = new SmartX.SmartLabel(); this.labelStaticBackupEnable = new SmartX.SmartLabel(); - this.buttonUSBID = new SmartX.SmartButton(); this.listBoxDataList = new System.Windows.Forms.ListBox(); this.labelFileCount = new SmartX.SmartLabel(); this.labelStaticWarning1 = new SmartX.SmartLabel(); this.labelStaticWarning2 = new SmartX.SmartLabel(); this.radioButtonDisable = new System.Windows.Forms.RadioButton(); this.radioButtonEnable = new System.Windows.Forms.RadioButton(); + this.buttonUSBID = new SmartX.SmartButton(); ((System.ComponentModel.ISupportInitialize)(this.smartForm1)).BeginInit(); this.SuspendLayout(); // @@ -129,7 +129,7 @@ this.labelTitle.BackPictureBox2 = null; this.labelTitle.BorderColor = System.Drawing.Color.Black; this.labelTitle.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.labelTitle.Font = new System.Drawing.Font("새굴림", 35F, System.Drawing.FontStyle.Bold); + this.labelTitle.Font = new System.Drawing.Font("New Gulim", 35F, System.Drawing.FontStyle.Bold); this.labelTitle.InitVisible = true; this.labelTitle.LineSpacing = 0F; this.labelTitle.Location = new System.Drawing.Point(199, 7); @@ -148,7 +148,7 @@ this.labelStaticSaveFile.BackPictureBox2 = null; this.labelStaticSaveFile.BorderColor = System.Drawing.Color.Black; this.labelStaticSaveFile.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.labelStaticSaveFile.Font = new System.Drawing.Font("새굴림", 20F, System.Drawing.FontStyle.Bold); + this.labelStaticSaveFile.Font = new System.Drawing.Font("New Gulim", 20F, System.Drawing.FontStyle.Bold); this.labelStaticSaveFile.InitVisible = true; this.labelStaticSaveFile.LineSpacing = 0F; this.labelStaticSaveFile.Location = new System.Drawing.Point(151, 306); @@ -167,7 +167,7 @@ this.labelStaticBackupEnable.BackPictureBox2 = null; this.labelStaticBackupEnable.BorderColor = System.Drawing.Color.Black; this.labelStaticBackupEnable.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.labelStaticBackupEnable.Font = new System.Drawing.Font("새굴림", 20F, System.Drawing.FontStyle.Bold); + this.labelStaticBackupEnable.Font = new System.Drawing.Font("New Gulim", 20F, System.Drawing.FontStyle.Bold); this.labelStaticBackupEnable.InitVisible = true; this.labelStaticBackupEnable.LineSpacing = 0F; this.labelStaticBackupEnable.Location = new System.Drawing.Point(151, 213); @@ -179,39 +179,6 @@ this.labelStaticBackupEnable.TextVAlign = SmartX.SmartLabel.TextVerAlign.Middle; this.labelStaticBackupEnable.Wordwrap = false; // - // buttonUSBID - // - this.buttonUSBID.BackPictureBox = null; - this.buttonUSBID.BackPictureBox1 = null; - this.buttonUSBID.BackPictureBox2 = null; - this.buttonUSBID.ButtonColor = System.Drawing.Color.Gray; - this.buttonUSBID.ButtonImageAutoSize = true; - this.buttonUSBID.ColorKeySamplePosition = new System.Drawing.Point(0, 0); - this.buttonUSBID.DisableImage = null; - this.buttonUSBID.DownImage = ((System.Drawing.Image)(resources.GetObject("buttonUSBID.DownImage"))); - this.buttonUSBID.Font = new System.Drawing.Font("Arial", 25F, System.Drawing.FontStyle.Bold); - this.buttonUSBID.GroupID = 0; - this.buttonUSBID.InitVisible = true; - this.buttonUSBID.Location = new System.Drawing.Point(125, 117); - this.buttonUSBID.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; - this.buttonUSBID.Name = "buttonUSBID"; - this.buttonUSBID.NestedClickEventPrevent = false; - this.buttonUSBID.OutlinePixel = 1; - this.buttonUSBID.RepeatInterval = 200; - this.buttonUSBID.RepeatIntervalAccelerate = null; - this.buttonUSBID.SafeInterval = 200; - this.buttonUSBID.Size = new System.Drawing.Size(326, 73); - this.buttonUSBID.SpecialFunction = SmartX.SmartButton.SPECIALFUNC.NONE; - this.buttonUSBID.TabIndex = 23; - this.buttonUSBID.Text = "1"; - this.buttonUSBID.TextColor = System.Drawing.Color.Black; - this.buttonUSBID.TextDownColor = System.Drawing.Color.White; - this.buttonUSBID.TextHAlign = SmartX.SmartButton.TextHorAlign.Right; - this.buttonUSBID.TextLocation = new System.Drawing.Point(-60, 0); - this.buttonUSBID.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle; - this.buttonUSBID.UpImage = ((System.Drawing.Image)(resources.GetObject("buttonUSBID.UpImage"))); - this.buttonUSBID.Click += new System.EventHandler(this.buttonUSBID_Click); - // // listBoxDataList // this.listBoxDataList.Font = new System.Drawing.Font("Tahoma", 15F, System.Drawing.FontStyle.Regular); @@ -246,7 +213,7 @@ this.labelStaticWarning1.BackPictureBox2 = null; this.labelStaticWarning1.BorderColor = System.Drawing.Color.Black; this.labelStaticWarning1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.labelStaticWarning1.Font = new System.Drawing.Font("새굴림", 18F, System.Drawing.FontStyle.Bold); + this.labelStaticWarning1.Font = new System.Drawing.Font("New Gulim", 18F, System.Drawing.FontStyle.Bold); this.labelStaticWarning1.ForeColor = System.Drawing.Color.Red; this.labelStaticWarning1.InitVisible = true; this.labelStaticWarning1.LineSpacing = 0F; @@ -266,7 +233,7 @@ this.labelStaticWarning2.BackPictureBox2 = null; this.labelStaticWarning2.BorderColor = System.Drawing.Color.Black; this.labelStaticWarning2.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.labelStaticWarning2.Font = new System.Drawing.Font("새굴림", 13F, System.Drawing.FontStyle.Bold); + this.labelStaticWarning2.Font = new System.Drawing.Font("New Gulim", 13F, System.Drawing.FontStyle.Bold); this.labelStaticWarning2.InitVisible = true; this.labelStaticWarning2.LineSpacing = 0F; this.labelStaticWarning2.Location = new System.Drawing.Point(151, 465); @@ -281,7 +248,7 @@ // radioButtonDisable // this.radioButtonDisable.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(208)))), ((int)(((byte)(208))))); - this.radioButtonDisable.Font = new System.Drawing.Font("새굴림", 20F, System.Drawing.FontStyle.Bold); + this.radioButtonDisable.Font = new System.Drawing.Font("New Gulim", 20F, System.Drawing.FontStyle.Bold); this.radioButtonDisable.Location = new System.Drawing.Point(715, 213); this.radioButtonDisable.Name = "radioButtonDisable"; this.radioButtonDisable.Size = new System.Drawing.Size(150, 50); @@ -292,7 +259,7 @@ // radioButtonEnable // this.radioButtonEnable.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(208)))), ((int)(((byte)(208))))); - this.radioButtonEnable.Font = new System.Drawing.Font("새굴림", 20F, System.Drawing.FontStyle.Bold); + this.radioButtonEnable.Font = new System.Drawing.Font("New Gulim", 20F, System.Drawing.FontStyle.Bold); this.radioButtonEnable.Location = new System.Drawing.Point(510, 213); this.radioButtonEnable.Name = "radioButtonEnable"; this.radioButtonEnable.Size = new System.Drawing.Size(150, 50); @@ -300,6 +267,39 @@ this.radioButtonEnable.Text = "Enable"; this.radioButtonEnable.Click += new System.EventHandler(this.radioButtonEnable_Click); // + // buttonUSBID + // + this.buttonUSBID.BackPictureBox = null; + this.buttonUSBID.BackPictureBox1 = null; + this.buttonUSBID.BackPictureBox2 = null; + this.buttonUSBID.ButtonColor = System.Drawing.Color.Gray; + this.buttonUSBID.ButtonImageAutoSize = true; + this.buttonUSBID.ColorKeySamplePosition = new System.Drawing.Point(0, 0); + this.buttonUSBID.DisableImage = null; + this.buttonUSBID.DownImage = ((System.Drawing.Image)(resources.GetObject("buttonUSBID.DownImage"))); + this.buttonUSBID.Font = new System.Drawing.Font("Arial", 25F, System.Drawing.FontStyle.Bold); + this.buttonUSBID.GroupID = 0; + this.buttonUSBID.InitVisible = true; + this.buttonUSBID.Location = new System.Drawing.Point(125, 117); + this.buttonUSBID.Mode = SmartX.SmartButton.BUTTONMODE.NORMAL; + this.buttonUSBID.Name = "buttonUSBID"; + this.buttonUSBID.NestedClickEventPrevent = false; + this.buttonUSBID.OutlinePixel = 1; + this.buttonUSBID.RepeatInterval = 200; + this.buttonUSBID.RepeatIntervalAccelerate = null; + this.buttonUSBID.SafeInterval = 200; + this.buttonUSBID.Size = new System.Drawing.Size(326, 73); + this.buttonUSBID.SpecialFunction = SmartX.SmartButton.SPECIALFUNC.NONE; + this.buttonUSBID.TabIndex = 23; + this.buttonUSBID.Text = "1"; + this.buttonUSBID.TextColor = System.Drawing.Color.Black; + this.buttonUSBID.TextDownColor = System.Drawing.Color.White; + this.buttonUSBID.TextHAlign = SmartX.SmartButton.TextHorAlign.Right; + this.buttonUSBID.TextLocation = new System.Drawing.Point(-60, 0); + this.buttonUSBID.TextVAlign = SmartX.SmartButton.TextVerAlign.Middle; + this.buttonUSBID.UpImage = ((System.Drawing.Image)(resources.GetObject("buttonUSBID.UpImage"))); + this.buttonUSBID.Click += new System.EventHandler(this.buttonUSBID_Click); + // // FormDataBackup // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); @@ -334,12 +334,12 @@ private SmartX.SmartLabel labelTitle; private SmartX.SmartLabel labelStaticSaveFile; private SmartX.SmartLabel labelStaticBackupEnable; - public SmartX.SmartButton buttonUSBID; private System.Windows.Forms.ListBox listBoxDataList; private SmartX.SmartLabel labelFileCount; private SmartX.SmartLabel labelStaticWarning1; private SmartX.SmartLabel labelStaticWarning2; private System.Windows.Forms.RadioButton radioButtonDisable; private System.Windows.Forms.RadioButton radioButtonEnable; + public SmartX.SmartButton buttonUSBID; } } \ No newline at end of file diff --git a/INT69DC_7C/Forms/FormDataBackup_Part11.cs b/INT69DC_7C/Forms/FormDataBackup_Part11.cs index bc2cce2..f0b2c7c 100644 --- a/INT69DC_7C/Forms/FormDataBackup_Part11.cs +++ b/INT69DC_7C/Forms/FormDataBackup_Part11.cs @@ -496,7 +496,7 @@ namespace INT69DC_7C.Forms if (monthCNT != 0) { for (int j = 0; j < monthCNT; j++) - { + { dayCNT = tree.Nodes[i].Nodes[j].Nodes.Count; if (dayCNT != 0) { diff --git a/INT69DC_7C/Forms/FormMain.cs b/INT69DC_7C/Forms/FormMain.cs index de92b84..c3e0dfe 100644 --- a/INT69DC_7C/Forms/FormMain.cs +++ b/INT69DC_7C/Forms/FormMain.cs @@ -668,7 +668,7 @@ namespace INT69DC_7C.Forms for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT2 == true || datas[i].IsBypassMode == true) + if (datas[i].IsUpdate_ATPC == true || datas[i].IsBypassMode == true) value++; } @@ -678,7 +678,7 @@ namespace INT69DC_7C.Forms this.SerialCH3OPT2IntegratedTransmission(datas); foreach (WeightData data in this.CollectionWeightData) - data.IsOPT2 = false; + data.IsUpdate_ATPC = false; } } private bool IntegratedCheck(Collection datas) @@ -688,7 +688,7 @@ namespace INT69DC_7C.Forms for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT2 == true || datas[i].IsBypassMode == true) + if (datas[i].IsUpdate_ATPC == true || datas[i].IsBypassMode == true) value++; } @@ -829,8 +829,10 @@ namespace INT69DC_7C.Forms for (int i = 0; i < byteData.Length; i++) collection.Add(byteData[i]); } - private void UpdateWeightDataWhenOperating(int index, string receiveData) + private void UpdateWeightData(int index, string receiveData) { + int index2 = 0; + if (this.SystemConfig.IsWeightViewForward == true) { this.CollectionWeightData[index].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); @@ -842,7 +844,7 @@ namespace INT69DC_7C.Forms } else { - int index2 = this.CollectionWeightData.Count - (index + 1); + index2 = this.CollectionWeightData.Count - (index + 1); this.CollectionWeightData[index2].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); this.CollectionWeightData[index2].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); @@ -852,6 +854,25 @@ namespace INT69DC_7C.Forms this.Update30000ModbusData(index2); } } + private void UpdateWeightDataTest(int index, string receiveData) + { + int index2 = 0; + + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightDataTest[index].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); + this.CollectionWeightDataTest[index].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); + this.CollectionWeightDataTest[index].ADCValue = receiveData.Substring(7, 5); + } + else + { + index2 = this.CollectionWeightDataTest.Count - (index + 1); + + this.CollectionWeightDataTest[index2].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); + this.CollectionWeightDataTest[index2].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); + this.CollectionWeightDataTest[index2].ADCValue = receiveData.Substring(7, 5); + } + } public int TransferData(string command, string id) { @@ -1697,28 +1718,15 @@ namespace INT69DC_7C.Forms #region 1열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(0, receiveData); - } + this.UpdateWeightData(0, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[0].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[0].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[0].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 1].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 1].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 1].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(0, receiveData); #endregion + if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -1743,10 +1751,12 @@ namespace INT69DC_7C.Forms } } } + #endregion + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[0], 1); + this.TrackingInspectionData(this.CollectionWeightData[0], 1); this.ChildFormMainDisplay.UpdateStartWeightDisplay1(this.EquipmentStatus, this.CollectionWeightData[0]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay1(this.EquipmentStatus, this.CollectionFeedbackStatus[0]); } @@ -1755,31 +1765,50 @@ namespace INT69DC_7C.Forms switch (this.SystemConfig.EquipmentColumns) { case 7: - this.DataBackup(this.CollectionWeightData[6], 7); + this.TrackingInspectionData(this.CollectionWeightData[6], 7); this.ChildFormMainDisplay.UpdateStartWeightDisplay7(this.EquipmentStatus, this.CollectionWeightData[6]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay7(this.EquipmentStatus, this.CollectionFeedbackStatus[6]); break; case 8: - this.DataBackup(this.CollectionWeightData[7], 8); + this.TrackingInspectionData(this.CollectionWeightData[7], 8); this.ChildFormMainDisplay.UpdateStartWeightDisplay8(this.EquipmentStatus, this.CollectionWeightData[7]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay8(this.EquipmentStatus, this.CollectionFeedbackStatus[7]); break; case 10: - this.DataBackup(this.CollectionWeightData[9], 10); + this.TrackingInspectionData(this.CollectionWeightData[9], 10); this.ChildFormMainDisplay.UpdateStartWeightDisplay10(this.EquipmentStatus, this.CollectionWeightData[9]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay10(this.EquipmentStatus, this.CollectionFeedbackStatus[9]); break; case 12: - this.DataBackup(this.CollectionWeightData[11], 12); + this.TrackingInspectionData(this.CollectionWeightData[11], 12); this.ChildFormMainDisplay.UpdateStartWeightDisplay12(this.EquipmentStatus, this.CollectionWeightData[11]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay12(this.EquipmentStatus, this.CollectionFeedbackStatus[11]); break; default: break; } - } + } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[0].IsUpdate_COM3 = true; + this.CollectionWeightData[0].IsUpdate_ATPC = true; + this.CollectionWeightData[0].IsUpdate_Ethernet = true; + this.CollectionWeightData[0].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 1].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 1].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 1].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 1].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -1802,27 +1831,13 @@ namespace INT69DC_7C.Forms this.StartThreadMessage1(); } } - } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[0].IsOPT1 = true; - this.CollectionWeightData[0].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 1].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 1].IsOPT2 = true; - } + } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 - if (this.SystemConfig.EthernetMode == 1) + if (this.SystemConfig.EthernetMode == 1) { #region OPT2 if (this.SystemConfig.IsIntegratedTransmission == true) @@ -1843,7 +1858,7 @@ namespace INT69DC_7C.Forms else etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[this.CollectionWeightData.Count - 1], this.CollectionWeightData.Count); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } #endregion @@ -1879,7 +1894,7 @@ namespace INT69DC_7C.Forms #region Modus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(0), this.SystemConfig.ModbusTcpStartAddress + (1 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) @@ -1907,11 +1922,11 @@ namespace INT69DC_7C.Forms #endregion } #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -2038,17 +2053,21 @@ namespace INT69DC_7C.Forms #endregion } #endregion - } + } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; - } + } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay1(this.EquipmentStatus, this.CollectionWeightDataTest[0]); else @@ -2070,7 +2089,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -2078,28 +2098,14 @@ namespace INT69DC_7C.Forms #region 2열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(1, receiveData); - } + this.UpdateWeightData(1, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[1].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[1].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[1].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 2].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 2].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 2].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(1, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -2124,10 +2130,12 @@ namespace INT69DC_7C.Forms } } } + #endregion + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[1], 2); + this.TrackingInspectionData(this.CollectionWeightData[1], 2); this.ChildFormMainDisplay.UpdateStartWeightDisplay2(this.EquipmentStatus, this.CollectionWeightData[1]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay2(this.EquipmentStatus, this.CollectionFeedbackStatus[1]); } @@ -2136,22 +2144,22 @@ namespace INT69DC_7C.Forms switch (this.SystemConfig.EquipmentColumns) { case 7: - this.DataBackup(this.CollectionWeightData[5], 6); + this.TrackingInspectionData(this.CollectionWeightData[5], 6); this.ChildFormMainDisplay.UpdateStartWeightDisplay6(this.EquipmentStatus, this.CollectionWeightData[5]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay6(this.EquipmentStatus, this.CollectionFeedbackStatus[5]); break; case 8: - this.DataBackup(this.CollectionWeightData[6], 7); + this.TrackingInspectionData(this.CollectionWeightData[6], 7); this.ChildFormMainDisplay.UpdateStartWeightDisplay7(this.EquipmentStatus, this.CollectionWeightData[6]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay7(this.EquipmentStatus, this.CollectionFeedbackStatus[6]); break; case 10: - this.DataBackup(this.CollectionWeightData[8], 9); + this.TrackingInspectionData(this.CollectionWeightData[8], 9); this.ChildFormMainDisplay.UpdateStartWeightDisplay9(this.EquipmentStatus, this.CollectionWeightData[8]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay9(this.EquipmentStatus, this.CollectionFeedbackStatus[8]); break; case 12: - this.DataBackup(this.CollectionWeightData[10], 11); + this.TrackingInspectionData(this.CollectionWeightData[10], 11); this.ChildFormMainDisplay.UpdateStartWeightDisplay11(this.EquipmentStatus, this.CollectionWeightData[10]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay11(this.EquipmentStatus, this.CollectionFeedbackStatus[10]); break; @@ -2159,8 +2167,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[1].IsUpdate_COM3 = true; + this.CollectionWeightData[1].IsUpdate_ATPC = true; + this.CollectionWeightData[1].IsUpdate_Ethernet = true; + this.CollectionWeightData[1].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 2].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 2].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 2].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 2].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -2184,37 +2211,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[1].IsOPT1 = true; - this.CollectionWeightData[1].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 2].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 2].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[1], 2); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[1], 2, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) @@ -2222,20 +2235,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(1), this.SystemConfig.ModbusTcpStartAddress + (2 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[1], 2, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -2363,16 +2376,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay2(this.EquipmentStatus, this.CollectionWeightDataTest[1]); else @@ -2394,7 +2411,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -2402,28 +2420,14 @@ namespace INT69DC_7C.Forms #region 3열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(2, receiveData); - } + this.UpdateWeightData(2, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[2].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[2].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[2].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 3].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 3].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 3].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(2, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -2448,10 +2452,12 @@ namespace INT69DC_7C.Forms } } } + #endregion + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[2], 3); + this.TrackingInspectionData(this.CollectionWeightData[2], 3); this.ChildFormMainDisplay.UpdateStartWeightDisplay3(this.EquipmentStatus, this.CollectionWeightData[2]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay3(this.EquipmentStatus, this.CollectionFeedbackStatus[2]); } @@ -2460,22 +2466,22 @@ namespace INT69DC_7C.Forms switch (this.SystemConfig.EquipmentColumns) { case 7: - this.DataBackup(this.CollectionWeightData[4], 5); + this.TrackingInspectionData(this.CollectionWeightData[4], 5); this.ChildFormMainDisplay.UpdateStartWeightDisplay5(this.EquipmentStatus, this.CollectionWeightData[4]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay5(this.EquipmentStatus, this.CollectionFeedbackStatus[4]); break; case 8: - this.DataBackup(this.CollectionWeightData[5], 6); + this.TrackingInspectionData(this.CollectionWeightData[5], 6); this.ChildFormMainDisplay.UpdateStartWeightDisplay6(this.EquipmentStatus, this.CollectionWeightData[5]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay6(this.EquipmentStatus, this.CollectionFeedbackStatus[5]); break; case 10: - this.DataBackup(this.CollectionWeightData[7], 8); + this.TrackingInspectionData(this.CollectionWeightData[7], 8); this.ChildFormMainDisplay.UpdateStartWeightDisplay8(this.EquipmentStatus, this.CollectionWeightData[7]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay8(this.EquipmentStatus, this.CollectionFeedbackStatus[7]); break; case 12: - this.DataBackup(this.CollectionWeightData[9], 10); + this.TrackingInspectionData(this.CollectionWeightData[9], 10); this.ChildFormMainDisplay.UpdateStartWeightDisplay10(this.EquipmentStatus, this.CollectionWeightData[9]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay10(this.EquipmentStatus, this.CollectionFeedbackStatus[9]); break; @@ -2483,8 +2489,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[2].IsUpdate_COM3 = true; + this.CollectionWeightData[2].IsUpdate_ATPC = true; + this.CollectionWeightData[2].IsUpdate_Ethernet = true; + this.CollectionWeightData[2].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 3].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 3].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 3].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 3].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -2508,37 +2533,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[2].IsOPT1 = true; - this.CollectionWeightData[2].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 3].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 3].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[2], 3); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[2], 3, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) @@ -2546,20 +2557,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(2), this.SystemConfig.ModbusTcpStartAddress + (3 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[2], 3, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -2687,16 +2698,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay3(this.EquipmentStatus, this.CollectionWeightDataTest[2]); else @@ -2718,7 +2733,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -2726,28 +2742,14 @@ namespace INT69DC_7C.Forms #region 4열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(3, receiveData); - } + this.UpdateWeightData(3, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[3].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[3].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[3].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 4].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 4].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 4].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(3, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -2772,10 +2774,12 @@ namespace INT69DC_7C.Forms } } } + #endregion + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[3], 4); + this.TrackingInspectionData(this.CollectionWeightData[3], 4); this.ChildFormMainDisplay.UpdateStartWeightDisplay4(this.EquipmentStatus, this.CollectionWeightData[3]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay4(this.EquipmentStatus, this.CollectionFeedbackStatus[3]); } @@ -2784,22 +2788,22 @@ namespace INT69DC_7C.Forms switch (this.SystemConfig.EquipmentColumns) { case 7: - this.DataBackup(this.CollectionWeightData[3], 4); + this.TrackingInspectionData(this.CollectionWeightData[3], 4); this.ChildFormMainDisplay.UpdateStartWeightDisplay4(this.EquipmentStatus, this.CollectionWeightData[3]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay4(this.EquipmentStatus, this.CollectionFeedbackStatus[3]); break; case 8: - this.DataBackup(this.CollectionWeightData[4], 5); + this.TrackingInspectionData(this.CollectionWeightData[4], 5); this.ChildFormMainDisplay.UpdateStartWeightDisplay5(this.EquipmentStatus, this.CollectionWeightData[4]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay5(this.EquipmentStatus, this.CollectionFeedbackStatus[4]); break; case 10: - this.DataBackup(this.CollectionWeightData[6], 7); + this.TrackingInspectionData(this.CollectionWeightData[6], 7); this.ChildFormMainDisplay.UpdateStartWeightDisplay7(this.EquipmentStatus, this.CollectionWeightData[6]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay7(this.EquipmentStatus, this.CollectionFeedbackStatus[6]); break; case 12: - this.DataBackup(this.CollectionWeightData[8], 9); + this.TrackingInspectionData(this.CollectionWeightData[8], 9); this.ChildFormMainDisplay.UpdateStartWeightDisplay9(this.EquipmentStatus, this.CollectionWeightData[8]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay9(this.EquipmentStatus, this.CollectionFeedbackStatus[8]); break; @@ -2807,8 +2811,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[3].IsUpdate_COM3 = true; + this.CollectionWeightData[3].IsUpdate_ATPC = true; + this.CollectionWeightData[3].IsUpdate_Ethernet = true; + this.CollectionWeightData[3].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 4].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 4].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 4].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 4].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -2832,37 +2855,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[3].IsOPT1 = true; - this.CollectionWeightData[3].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 4].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 4].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[3], 4); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[3], 4, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) // Modbus @@ -2870,20 +2879,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(3), this.SystemConfig.ModbusTcpStartAddress + (4 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[3], 4, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -3011,16 +3020,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay4(this.EquipmentStatus, this.CollectionWeightDataTest[3]); else @@ -3042,7 +3055,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -3050,28 +3064,14 @@ namespace INT69DC_7C.Forms #region 5열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(4, receiveData); - } + this.UpdateWeightData(4, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[4].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[4].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[4].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 5].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 5].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 5].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(4, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -3096,10 +3096,12 @@ namespace INT69DC_7C.Forms } } } + #endregion + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[4], 5); + this.TrackingInspectionData(this.CollectionWeightData[4], 5); this.ChildFormMainDisplay.UpdateStartWeightDisplay5(this.EquipmentStatus, this.CollectionWeightData[4]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay5(this.EquipmentStatus, this.CollectionFeedbackStatus[4]); } @@ -3108,22 +3110,22 @@ namespace INT69DC_7C.Forms switch (this.SystemConfig.EquipmentColumns) { case 7: - this.DataBackup(this.CollectionWeightData[2], 3); + this.TrackingInspectionData(this.CollectionWeightData[2], 3); this.ChildFormMainDisplay.UpdateStartWeightDisplay3(this.EquipmentStatus, this.CollectionWeightData[2]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay3(this.EquipmentStatus, this.CollectionFeedbackStatus[2]); break; case 8: - this.DataBackup(this.CollectionWeightData[3], 4); + this.TrackingInspectionData(this.CollectionWeightData[3], 4); this.ChildFormMainDisplay.UpdateStartWeightDisplay4(this.EquipmentStatus, this.CollectionWeightData[3]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay4(this.EquipmentStatus, this.CollectionFeedbackStatus[3]); break; case 10: - this.DataBackup(this.CollectionWeightData[5], 6); + this.TrackingInspectionData(this.CollectionWeightData[5], 6); this.ChildFormMainDisplay.UpdateStartWeightDisplay6(this.EquipmentStatus, this.CollectionWeightData[5]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay6(this.EquipmentStatus, this.CollectionFeedbackStatus[5]); break; case 12: - this.DataBackup(this.CollectionWeightData[7], 8); + this.TrackingInspectionData(this.CollectionWeightData[7], 8); this.ChildFormMainDisplay.UpdateStartWeightDisplay8(this.EquipmentStatus, this.CollectionWeightData[7]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay8(this.EquipmentStatus, this.CollectionFeedbackStatus[7]); break; @@ -3131,8 +3133,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[4].IsUpdate_COM3 = true; + this.CollectionWeightData[4].IsUpdate_ATPC = true; + this.CollectionWeightData[4].IsUpdate_Ethernet = true; + this.CollectionWeightData[4].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 5].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 5].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 5].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 5].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -3156,37 +3177,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[4].IsOPT1 = true; - this.CollectionWeightData[4].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 5].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 5].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[4], 5); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[4], 5, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) @@ -3194,20 +3201,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(4), this.SystemConfig.ModbusTcpStartAddress + (5 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[4], 5, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -3335,16 +3342,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay5(this.EquipmentStatus, this.CollectionWeightDataTest[4]); else @@ -3366,7 +3377,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -3374,28 +3386,14 @@ namespace INT69DC_7C.Forms #region 6열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(5, receiveData); - } + this.UpdateWeightData(5, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[5].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[5].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[5].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 6].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 6].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 6].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(5, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -3420,10 +3418,12 @@ namespace INT69DC_7C.Forms } } } + #endregion + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[5], 6); + this.TrackingInspectionData(this.CollectionWeightData[5], 6); this.ChildFormMainDisplay.UpdateStartWeightDisplay6(this.EquipmentStatus, this.CollectionWeightData[5]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay6(this.EquipmentStatus, this.CollectionFeedbackStatus[5]); } @@ -3432,22 +3432,22 @@ namespace INT69DC_7C.Forms switch (this.SystemConfig.EquipmentColumns) { case 7: - this.DataBackup(this.CollectionWeightData[1], 2); + this.TrackingInspectionData(this.CollectionWeightData[1], 2); this.ChildFormMainDisplay.UpdateStartWeightDisplay2(this.EquipmentStatus, this.CollectionWeightData[1]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay2(this.EquipmentStatus, this.CollectionFeedbackStatus[1]); break; case 8: - this.DataBackup(this.CollectionWeightData[2], 3); + this.TrackingInspectionData(this.CollectionWeightData[2], 3); this.ChildFormMainDisplay.UpdateStartWeightDisplay3(this.EquipmentStatus, this.CollectionWeightData[2]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay3(this.EquipmentStatus, this.CollectionFeedbackStatus[2]); break; case 10: - this.DataBackup(this.CollectionWeightData[4], 5); + this.TrackingInspectionData(this.CollectionWeightData[4], 5); this.ChildFormMainDisplay.UpdateStartWeightDisplay5(this.EquipmentStatus, this.CollectionWeightData[4]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay5(this.EquipmentStatus, this.CollectionFeedbackStatus[4]); break; case 12: - this.DataBackup(this.CollectionWeightData[6], 7); + this.TrackingInspectionData(this.CollectionWeightData[6], 7); this.ChildFormMainDisplay.UpdateStartWeightDisplay7(this.EquipmentStatus, this.CollectionWeightData[6]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay7(this.EquipmentStatus, this.CollectionFeedbackStatus[6]); break; @@ -3455,8 +3455,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[5].IsUpdate_COM3 = true; + this.CollectionWeightData[5].IsUpdate_ATPC = true; + this.CollectionWeightData[5].IsUpdate_Ethernet = true; + this.CollectionWeightData[5].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 6].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 6].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 6].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 6].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -3480,37 +3499,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[5].IsOPT1 = true; - this.CollectionWeightData[5].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 6].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 6].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[5], 6); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[5], 6, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) @@ -3518,20 +3523,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(5), this.SystemConfig.ModbusTcpStartAddress + (6 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[5], 6, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -3659,16 +3664,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay6(this.EquipmentStatus, this.CollectionWeightDataTest[5]); else @@ -3690,7 +3699,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -3698,28 +3708,14 @@ namespace INT69DC_7C.Forms #region 7열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(6, receiveData); - } + this.UpdateWeightData(6, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[6].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[6].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[6].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 7].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 7].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 7].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(6, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -3743,11 +3739,13 @@ namespace INT69DC_7C.Forms this.ChildFormMainDisplay.UpdateAlarmMessage1Display(); } } - } + } + #endregion + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[6], 7); + this.TrackingInspectionData(this.CollectionWeightData[6], 7); this.ChildFormMainDisplay.UpdateStartWeightDisplay7(this.EquipmentStatus, this.CollectionWeightData[6]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay7(this.EquipmentStatus, this.CollectionFeedbackStatus[6]); } @@ -3756,22 +3754,22 @@ namespace INT69DC_7C.Forms switch (this.SystemConfig.EquipmentColumns) { case 7: - this.DataBackup(this.CollectionWeightData[0], 1); + this.TrackingInspectionData(this.CollectionWeightData[0], 1); this.ChildFormMainDisplay.UpdateStartWeightDisplay1(this.EquipmentStatus, this.CollectionWeightData[0]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay1(this.EquipmentStatus, this.CollectionFeedbackStatus[0]); break; case 8: - this.DataBackup(this.CollectionWeightData[1], 2); + this.TrackingInspectionData(this.CollectionWeightData[1], 2); this.ChildFormMainDisplay.UpdateStartWeightDisplay2(this.EquipmentStatus, this.CollectionWeightData[1]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay2(this.EquipmentStatus, this.CollectionFeedbackStatus[1]); break; case 10: - this.DataBackup(this.CollectionWeightData[3], 4); + this.TrackingInspectionData(this.CollectionWeightData[3], 4); this.ChildFormMainDisplay.UpdateStartWeightDisplay4(this.EquipmentStatus, this.CollectionWeightData[3]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay4(this.EquipmentStatus, this.CollectionFeedbackStatus[3]); break; case 12: - this.DataBackup(this.CollectionWeightData[5], 6); + this.TrackingInspectionData(this.CollectionWeightData[5], 6); this.ChildFormMainDisplay.UpdateStartWeightDisplay6(this.EquipmentStatus, this.CollectionWeightData[5]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay6(this.EquipmentStatus, this.CollectionFeedbackStatus[5]); break; @@ -3779,8 +3777,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[6].IsUpdate_COM3 = true; + this.CollectionWeightData[6].IsUpdate_ATPC = true; + this.CollectionWeightData[6].IsUpdate_Ethernet = true; + this.CollectionWeightData[6].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 7].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 7].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 7].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 7].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -3804,37 +3821,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[6].IsOPT1 = true; - this.CollectionWeightData[6].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 7].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 7].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[6], 7); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[6], 7, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) @@ -3842,20 +3845,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(6), this.SystemConfig.ModbusTcpStartAddress + (7 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[6], 7, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -3983,16 +3986,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay7(this.EquipmentStatus, this.CollectionWeightDataTest[6]); else @@ -4014,7 +4021,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -4022,28 +4030,14 @@ namespace INT69DC_7C.Forms #region 8열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(7, receiveData); - } + this.UpdateWeightData(7, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[7].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[7].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[7].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 8].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 8].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 8].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(7, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -4067,11 +4061,13 @@ namespace INT69DC_7C.Forms this.ChildFormMainDisplay.UpdateAlarmMessage1Display(); } } - } + } + #endregion + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[7], 8); + this.TrackingInspectionData(this.CollectionWeightData[7], 8); this.ChildFormMainDisplay.UpdateStartWeightDisplay8(this.EquipmentStatus, this.CollectionWeightData[7]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay8(this.EquipmentStatus, this.CollectionFeedbackStatus[7]); } @@ -4082,17 +4078,17 @@ namespace INT69DC_7C.Forms case 7: break; case 8: - this.DataBackup(this.CollectionWeightData[0], 1); + this.TrackingInspectionData(this.CollectionWeightData[0], 1); this.ChildFormMainDisplay.UpdateStartWeightDisplay1(this.EquipmentStatus, this.CollectionWeightData[0]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay1(this.EquipmentStatus, this.CollectionFeedbackStatus[0]); break; case 10: - this.DataBackup(this.CollectionWeightData[2], 3); + this.TrackingInspectionData(this.CollectionWeightData[2], 3); this.ChildFormMainDisplay.UpdateStartWeightDisplay3(this.EquipmentStatus, this.CollectionWeightData[2]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay3(this.EquipmentStatus, this.CollectionFeedbackStatus[2]); break; case 12: - this.DataBackup(this.CollectionWeightData[4], 5); + this.TrackingInspectionData(this.CollectionWeightData[4], 5); this.ChildFormMainDisplay.UpdateStartWeightDisplay5(this.EquipmentStatus, this.CollectionWeightData[4]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay5(this.EquipmentStatus, this.CollectionFeedbackStatus[4]); break; @@ -4100,8 +4096,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[7].IsUpdate_COM3 = true; + this.CollectionWeightData[7].IsUpdate_ATPC = true; + this.CollectionWeightData[7].IsUpdate_Ethernet = true; + this.CollectionWeightData[7].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 8].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 8].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 8].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 8].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -4125,37 +4140,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[7].IsOPT1 = true; - this.CollectionWeightData[7].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 8].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 8].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[7], 8); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[7], 8, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) @@ -4163,20 +4164,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(7), this.SystemConfig.ModbusTcpStartAddress + (8 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[7], 8, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -4304,16 +4305,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay8(this.EquipmentStatus, this.CollectionWeightDataTest[7]); else @@ -4334,7 +4339,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -4342,28 +4348,14 @@ namespace INT69DC_7C.Forms #region 9열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(8, receiveData); - } + this.UpdateWeightData(8, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[8].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[8].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[8].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 9].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 9].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 9].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(8, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -4387,11 +4379,13 @@ namespace INT69DC_7C.Forms this.ChildFormMainDisplay.UpdateAlarmMessage1Display(); } } - } + } + #endregion + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[8], 9); + this.TrackingInspectionData(this.CollectionWeightData[8], 9); this.ChildFormMainDisplay.UpdateStartWeightDisplay9(this.EquipmentStatus, this.CollectionWeightData[8]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay9(this.EquipmentStatus, this.CollectionFeedbackStatus[8]); } @@ -4404,12 +4398,12 @@ namespace INT69DC_7C.Forms case 8: break; case 10: - this.DataBackup(this.CollectionWeightData[1], 2); + this.TrackingInspectionData(this.CollectionWeightData[1], 2); this.ChildFormMainDisplay.UpdateStartWeightDisplay2(this.EquipmentStatus, this.CollectionWeightData[1]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay2(this.EquipmentStatus, this.CollectionFeedbackStatus[1]); break; case 12: - this.DataBackup(this.CollectionWeightData[3], 4); + this.TrackingInspectionData(this.CollectionWeightData[3], 4); this.ChildFormMainDisplay.UpdateStartWeightDisplay4(this.EquipmentStatus, this.CollectionWeightData[3]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay4(this.EquipmentStatus, this.CollectionFeedbackStatus[3]); break; @@ -4417,8 +4411,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[8].IsUpdate_COM3 = true; + this.CollectionWeightData[8].IsUpdate_ATPC = true; + this.CollectionWeightData[8].IsUpdate_Ethernet = true; + this.CollectionWeightData[8].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 9].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 9].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 9].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 9].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -4442,37 +4455,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[8].IsOPT1 = true; - this.CollectionWeightData[8].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 9].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 9].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[8], 9); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[8], 9, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) @@ -4480,20 +4479,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(8), this.SystemConfig.ModbusTcpStartAddress + (9 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[8], 9, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -4621,16 +4620,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay9(this.EquipmentStatus, this.CollectionWeightDataTest[8]); else @@ -4650,7 +4653,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -4658,28 +4662,14 @@ namespace INT69DC_7C.Forms #region 10열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(9, receiveData); - } + this.UpdateWeightData(9, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[9].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[9].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[9].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 10].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 10].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 10].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(9, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -4704,10 +4694,12 @@ namespace INT69DC_7C.Forms } } } - + #endregion + + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[9], 10); + this.TrackingInspectionData(this.CollectionWeightData[9], 10); this.ChildFormMainDisplay.UpdateStartWeightDisplay10(this.EquipmentStatus, this.CollectionWeightData[9]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay10(this.EquipmentStatus, this.CollectionFeedbackStatus[9]); } @@ -4720,12 +4712,12 @@ namespace INT69DC_7C.Forms case 8: break; case 10: - this.DataBackup(this.CollectionWeightData[0], 1); + this.TrackingInspectionData(this.CollectionWeightData[0], 1); this.ChildFormMainDisplay.UpdateStartWeightDisplay1(this.EquipmentStatus, this.CollectionWeightData[0]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay1(this.EquipmentStatus, this.CollectionFeedbackStatus[0]); break; case 12: - this.DataBackup(this.CollectionWeightData[2], 3); + this.TrackingInspectionData(this.CollectionWeightData[2], 3); this.ChildFormMainDisplay.UpdateStartWeightDisplay3(this.EquipmentStatus, this.CollectionWeightData[2]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay3(this.EquipmentStatus, this.CollectionFeedbackStatus[2]); break; @@ -4733,8 +4725,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[9].IsUpdate_COM3 = true; + this.CollectionWeightData[9].IsUpdate_ATPC = true; + this.CollectionWeightData[9].IsUpdate_Ethernet = true; + this.CollectionWeightData[9].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 10].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 10].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 10].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 10].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -4758,37 +4769,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[9].IsOPT1 = true; - this.CollectionWeightData[9].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 10].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 10].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[9], 10); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[9], 10, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) @@ -4796,20 +4793,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(9), this.SystemConfig.ModbusTcpStartAddress + (10 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[9], 10, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -4937,16 +4934,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay10(this.EquipmentStatus, this.CollectionWeightDataTest[9]); else @@ -4966,7 +4967,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -4974,28 +4976,14 @@ namespace INT69DC_7C.Forms #region 11열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(10, receiveData); - } + this.UpdateWeightData(10, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[10].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[10].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[10].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 11].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 11].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 11].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(10, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -5020,10 +5008,12 @@ namespace INT69DC_7C.Forms } } } - + #endregion + + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[10], 11); + this.TrackingInspectionData(this.CollectionWeightData[10], 11); this.ChildFormMainDisplay.UpdateStartWeightDisplay11(this.EquipmentStatus, this.CollectionWeightData[10]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay11(this.EquipmentStatus, this.CollectionFeedbackStatus[10]); } @@ -5038,7 +5028,7 @@ namespace INT69DC_7C.Forms case 10: break; case 12: - this.DataBackup(this.CollectionWeightData[1], 2); + this.TrackingInspectionData(this.CollectionWeightData[1], 2); this.ChildFormMainDisplay.UpdateStartWeightDisplay2(this.EquipmentStatus, this.CollectionWeightData[1]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay2(this.EquipmentStatus, this.CollectionFeedbackStatus[1]); break; @@ -5046,8 +5036,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[10].IsUpdate_COM3 = true; + this.CollectionWeightData[10].IsUpdate_ATPC = true; + this.CollectionWeightData[10].IsUpdate_Ethernet = true; + this.CollectionWeightData[10].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 11].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 11].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 11].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 11].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -5071,37 +5080,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[10].IsOPT1 = true; - this.CollectionWeightData[10].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 11].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 11].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[10], 11); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[10], 11, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) @@ -5109,20 +5104,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(10), this.SystemConfig.ModbusTcpStartAddress + (11 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[10], 11, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -5250,16 +5245,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay11(this.EquipmentStatus, this.CollectionWeightDataTest[10]); else @@ -5278,7 +5277,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -5286,28 +5286,14 @@ namespace INT69DC_7C.Forms #region 12열 #region Value Assign if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) - { - this.UpdateWeightDataWhenOperating(11, receiveData); - } + this.UpdateWeightData(11, receiveData); else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightDataTest[11].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[11].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[11].ADCValue = receiveData.Substring(7, 5); - } - else - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 12].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(0, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 12].Weight = Helper.StringToWeight(receiveData.Substring(2, 5), this.SystemConfig.DecimalPlaces); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - 12].ADCValue = receiveData.Substring(7, 5); - } - } + this.UpdateWeightDataTest(11, receiveData); #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -5332,10 +5318,12 @@ namespace INT69DC_7C.Forms } } } + #endregion + #region 화면 갱신, 데이터 백업 if (this.SystemConfig.IsWeightViewForward == true) { - this.DataBackup(this.CollectionWeightData[11], 12); + this.TrackingInspectionData(this.CollectionWeightData[11], 12); this.ChildFormMainDisplay.UpdateStartWeightDisplay12(this.EquipmentStatus, this.CollectionWeightData[11]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay12(this.EquipmentStatus, this.CollectionFeedbackStatus[11]); } @@ -5350,7 +5338,7 @@ namespace INT69DC_7C.Forms case 10: break; case 12: - this.DataBackup(this.CollectionWeightData[0], 1); + this.TrackingInspectionData(this.CollectionWeightData[0], 1); this.ChildFormMainDisplay.UpdateStartWeightDisplay1(this.EquipmentStatus, this.CollectionWeightData[0]); this.ChildFormMainDisplay.UpdateFeedbackDataDisplay1(this.EquipmentStatus, this.CollectionFeedbackStatus[0]); break; @@ -5358,8 +5346,27 @@ namespace INT69DC_7C.Forms break; } } + #endregion - // 입력센서 연속 입력 시 정지 + #region 통합 전송하기 위한 데이터 체크 + // 중량 갱신이 되었는지 체크 + if (this.SystemConfig.IsWeightViewForward == true) + { + this.CollectionWeightData[11].IsUpdate_COM3 = true; + this.CollectionWeightData[11].IsUpdate_ATPC = true; + this.CollectionWeightData[11].IsUpdate_Ethernet = true; + this.CollectionWeightData[11].IsUpdate_DataBackup = true; + } + else + { + this.CollectionWeightData[this.CollectionWeightData.Count - 12].IsUpdate_COM3 = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 12].IsUpdate_ATPC = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 12].IsUpdate_Ethernet = true; + this.CollectionWeightData[this.CollectionWeightData.Count - 12].IsUpdate_DataBackup = true; + } + #endregion + + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { if (this.SystemConfig.IsWeightViewForward == true) @@ -5383,37 +5390,23 @@ namespace INT69DC_7C.Forms } } } - - #region 통합 전송하기 위한 데이터 체크 - // 중량 갱신이 되었는지 체크 - if (this.SystemConfig.IsWeightViewForward == true) - { - this.CollectionWeightData[11].IsOPT1 = true; - this.CollectionWeightData[11].IsOPT2 = true; - } - else - { - this.CollectionWeightData[this.CollectionWeightData.Count - 12].IsOPT1 = true; - this.CollectionWeightData[this.CollectionWeightData.Count - 12].IsOPT2 = true; - } #endregion - // 이더넷 + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData[11], 12); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData[11], 12, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) // Modbus @@ -5421,20 +5414,20 @@ namespace INT69DC_7C.Forms #region Modbus byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(11), this.SystemConfig.ModbusTcpStartAddress + (12 * 50) + 140); - this.EthernetWeightDataForModbus(etherByteData); + this.EthernetWeightDataForModbus(etherByteData); #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData[11], 12, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -5463,7 +5456,7 @@ namespace INT69DC_7C.Forms // EquipmentColumns 수 만큼 중량이 들어왔는지 체크 후 데이터 전송하는 함수(EquipmentColumns 갯수가 다 들어아야 데이터 전송함) this.UartCom3WeightDataTransfer(this.CollectionWeightData); - } + } #endregion } else if (this.SystemConfig.Serial3Mode == 2) // OPT2 - 중량 데이터 피드백 @@ -5562,16 +5555,20 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion - // Alarm Total Pass Count + #region ATPC(Alarm Total Pass Count) if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) { if (this.timerTimeOutOPT2.Enabled == false) this.timerTimeOutOPT2.Enabled = true; } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { + #region FormEquipmentTest if (this.SystemConfig.IsWeightViewForward == true) this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay12(this.EquipmentStatus, this.CollectionWeightDataTest[11]); else @@ -5590,7 +5587,8 @@ namespace INT69DC_7C.Forms default: break; } - } + } + #endregion } #endregion break; @@ -5607,6 +5605,8 @@ namespace INT69DC_7C.Forms this.CollectionWeightData[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 12 + 2, 5), this.SystemConfig.DecimalPlaces); this.CollectionWeightData[i].WeightString = receiveData.Substring(i * 12 + 2, 5); this.CollectionWeightData[i].ADCValue = receiveData.Substring(i * 12 + 7, 5); + + this.Update30000ModbusData(i); } } else @@ -5617,6 +5617,8 @@ namespace INT69DC_7C.Forms this.CollectionWeightData[this.CollectionWeightData.Count - i].Weight = Helper.StringToWeight(receiveData.Substring((i - 1) * 12 + 2, 5), this.SystemConfig.DecimalPlaces); this.CollectionWeightData[this.CollectionWeightData.Count - i].WeightString = receiveData.Substring((i - 1) * 12 + 2, 5); this.CollectionWeightData[this.CollectionWeightData.Count - i].ADCValue = receiveData.Substring((i - 1) * 12 + 7, 5); + + this.Update30000ModbusData(this.CollectionWeightData.Count - i); } } } @@ -5644,10 +5646,8 @@ namespace INT69DC_7C.Forms #endregion if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) { - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) - this.Update30000ModbusData(i); - - // 이중진입 + #region FormMainDisplay + #region 이중진입 if (this.CurrentOptionParameterItem.DoubleEnter == "1") { // 이중진입(상한 판정시 하한설정값에 두배이면 이중) 이면 STOP @@ -5664,41 +5664,14 @@ namespace INT69DC_7C.Forms } } } + #endregion - // 연속NG 체크 - if (this.SystemConfig.IsAlarmContinuousNGEnable == true) - { - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) - { - if (this.CollectionWeightData[i].IsContinuousNG == true) - { - this.CollectionWeightData[i].ContinuousNG++; - - if (this.CollectionWeightData[i].ContinuousNG >= this.SystemConfig.AlarmContinuousNG) - { - //this.CollectionWeightData[i].ContinuousNG = 0; - this.TransferData(CommunicationCommand.AlarmPulseNG, CommunicationID.MainBoard); - this.ChildFormMainDisplay.UpdateAlarmMessage3Display(true); - } - } - } - } - - // Total Pass Count 체크 - if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) - { - result = this.CurrentAlarmTotalPassCnt.SetCountStic1(this.CollectionWeightData); - - if (result == true) - this.TransferData(CommunicationCommand.AlarmPulseNG, CommunicationID.MainBoard); - - this.ChildFormMainDisplay.UpdateAlarmTotalPassCountDisplay(this.CurrentAlarmTotalPassCnt); - } - - this.DataBackup(this.CollectionWeightData); + #region 화면 갱신, 데이터 백업 + this.TrackingInspectionData(this.CollectionWeightData); this.ChildFormMainDisplay.UpdateStartWeightDisplay(this.EquipmentStatus, this.CollectionWeightData); + #endregion - // 입력센서 연속 입력 시 정지 + #region 입력센서 연속 입력 시 정지 if (this.SystemConfig.IsEmergencyStopEntrySensorError == true) { foreach (WeightData data in this.CollectionWeightData) @@ -5713,22 +5686,23 @@ namespace INT69DC_7C.Forms } } } + #endregion + #region 이더넷 if (this.SystemConfig.IsEthernetEnable == true) { - #region 이더넷 if (this.SystemConfig.EthernetMode == 1) { #region OPT2 etherStringData = this.Protocol_OPT2(this.SystemConfig, this.CollectionWeightData); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 2) { #region OPT3 etherStringData = this.Protocol_OPT3(this.SystemConfig, this.CollectionWeightData, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion } else if (this.SystemConfig.EthernetMode == 3) @@ -5739,20 +5713,20 @@ namespace INT69DC_7C.Forms byte[] etherByteData = this.Modbus.WriteMultipleRegisterTCP( this.Protocol_Modbus_Client_Write_Lane_Data(i), this.SystemConfig.ModbusTcpStartAddress + ((i + 1) * 50) + 140); this.EthernetWeightDataForModbus(etherByteData); - } + } #endregion } else if (this.SystemConfig.EthernetMode == 4) { #region OPT5 etherStringData = this.Protocol_OPT5(this.SystemConfig, this.CollectionWeightData, this.CurrentProductItem); - this.SendEthernetData(etherStringData); + this.SendEthernetData(etherStringData); #endregion - } - #endregion + } } + #endregion - // Serial 3 Mode + #region Serial3 if (this.SystemConfig.Serial3Mode == 1) // OPT1 - ABFood 통신 피드백 { #region Serial3 Mode1 @@ -5825,11 +5799,46 @@ namespace INT69DC_7C.Forms } #endregion } + #endregion + #region ACNC(Alarm Continuous Ng Count) + if (this.SystemConfig.IsAlarmContinuousNGEnable == true) + { + for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) + { + if (this.CollectionWeightData[i].IsContinuousNG == true) + { + this.CollectionWeightData[i].ContinuousNG++; + + if (this.CollectionWeightData[i].ContinuousNG >= this.SystemConfig.AlarmContinuousNG) + { + //this.CollectionWeightData[i].ContinuousNG = 0; + this.TransferData(CommunicationCommand.AlarmPulseNG, CommunicationID.MainBoard); + this.ChildFormMainDisplay.UpdateAlarmMessage3Display(true); + } + } + } + } + #endregion + + #region ATPC(Alarm Total Pass Count) + if (this.SystemConfig.IsAlarmTotalPassCntEnable == true) + { + result = this.CurrentAlarmTotalPassCnt.SetCountStic1(this.CollectionWeightData); + + if (result == true) + this.TransferData(CommunicationCommand.AlarmPulseNG, CommunicationID.MainBoard); + + this.ChildFormMainDisplay.UpdateAlarmTotalPassCountDisplay(this.CurrentAlarmTotalPassCnt); + } + #endregion + #endregion } else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) { - this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay(this.EquipmentStatus, this.CollectionWeightDataTest); + #region FormEquipmentTest + this.ChildFormEquipmentTest.UpdateUpdateStartWeightDisplay(this.EquipmentStatus, this.CollectionWeightDataTest); + #endregion } #endregion break; @@ -7777,203 +7786,6 @@ namespace INT69DC_7C.Forms } #endregion - #region Data Backup - private void DataBackup(Collection items) - { - bool fileCheck = false, directoryCheck = false; - string fullFilePath = ""; - StreamWriter sw; - - this.RemoveUsbBackupFile(); - - if (this.SystemConfig.IsDataBackup == true) - { - fullFilePath = string.Format("{0}{1:yyyyMMdd}-{2}_{3}.csv", this.PathDataBackupFolder, DateTime.Now, this.SystemConfig.ProductNumber, this.SystemConfig.UsbID); - - DirectoryInfo di = new DirectoryInfo(this.PathDataBackupFolder); - directoryCheck = di.Exists; - // 폴더 체크 - if (directoryCheck == false) - di.Create(); - - FileInfo fileInfo = new FileInfo(fullFilePath); - fileCheck = fileInfo.Exists; - - sw = new StreamWriter(fullFilePath, true, Encoding.UTF8); - - if (fileCheck == false) - { - sw.Write("Date"); - sw.Write(","); - sw.Write("Time"); - sw.Write(","); - sw.Write("P_No"); - sw.Write(","); - sw.Write("Name"); - sw.Write(","); - sw.Write("Lot"); - sw.Write(","); - sw.Write("UnderRange"); - sw.Write(","); - sw.Write("PassRange"); - sw.Write(","); - sw.Write("OverRange"); - sw.Write(","); - sw.Write("TareRange"); - - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) - { - sw.Write(","); - sw.Write(string.Format("#{0}_Weight", i + 1)); - sw.Write(","); - sw.Write("Grade"); - } - - sw.WriteLine(); - } - - sw.Write(string.Format("{0:yyyy-MM-dd}", DateTime.Now)); - sw.Write(","); - sw.Write(string.Format("{0:HH:mm:ss}", DateTime.Now)); - sw.Write(","); - sw.Write(this.CurrentProductItem.Number); - sw.Write(","); - sw.Write(this.CurrentProductItem.Name); - sw.Write(","); - sw.Write(this.CurrentProductItem.LotNo); - sw.Write(","); - sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.UnderRange, this.SystemConfig.DecimalPlaces)); - sw.Write(","); - sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.PassRange, this.SystemConfig.DecimalPlaces)); - sw.Write(","); - sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.OverRange, this.SystemConfig.DecimalPlaces)); - sw.Write(","); - sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.TareRange, this.SystemConfig.DecimalPlaces)); - - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) - { - sw.Write(","); - sw.Write(Helper.DoubleToString(items[i].Weight, this.SystemConfig.DecimalPlaces)); - sw.Write(","); - sw.Write(items[i].JudgmentStatus); - } - - sw.WriteLine(); - sw.Close(); - } - } - private void DataBackup(WeightData item, int line) - { - bool fileCheck = false, directoryCheck = false; - string fullFilePath = ""; - StreamWriter sw; - - this.RemoveUsbBackupFile(); - - if (this.SystemConfig.IsDataBackup == true) - { - fullFilePath = string.Format("{0}{1:yyyyMMdd}-{2}_{3}_{4}Lane.csv", this.PathDataBackupFolder, DateTime.Now, this.SystemConfig.ProductNumber, this.SystemConfig.UsbID, line); - - DirectoryInfo di = new DirectoryInfo(this.PathDataBackupFolder); - directoryCheck = di.Exists; - // 폴더 체크 - if (directoryCheck == false) - di.Create(); - - FileInfo fileInfo = new FileInfo(fullFilePath); - fileCheck = fileInfo.Exists; - - sw = new StreamWriter(fullFilePath, true, Encoding.UTF8); - - if (fileCheck == false) - { - sw.Write("Date"); - sw.Write(","); - sw.Write("Time"); - sw.Write(","); - sw.Write("P_No"); - sw.Write(","); - sw.Write("Name"); - sw.Write(","); - sw.Write("Lot"); - sw.Write(","); - sw.Write("UnderRange"); - sw.Write(","); - sw.Write("PassRange"); - sw.Write(","); - sw.Write("OverRange"); - sw.Write(","); - sw.Write("TareRange"); - sw.Write(","); - sw.Write("Weight"); - sw.Write(","); - sw.Write("Grade"); - - sw.WriteLine(); - } - - sw.Write(string.Format("{0:yyyy-MM-dd}", DateTime.Now)); - sw.Write(","); - sw.Write(string.Format("{0:HH:mm:ss}", DateTime.Now)); - sw.Write(","); - sw.Write(this.CurrentProductItem.Number); - sw.Write(","); - sw.Write(this.CurrentProductItem.Name); - sw.Write(","); - sw.Write(this.CurrentProductItem.LotNo); - sw.Write(","); - sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.UnderRange, this.SystemConfig.DecimalPlaces)); - sw.Write(","); - sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.PassRange, this.SystemConfig.DecimalPlaces)); - sw.Write(","); - sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.OverRange, this.SystemConfig.DecimalPlaces)); - sw.Write(","); - sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.TareRange, this.SystemConfig.DecimalPlaces)); - sw.Write(","); - sw.Write(Helper.DoubleToString(item.Weight, this.SystemConfig.DecimalPlaces)); - sw.Write(","); - sw.Write(item.JudgmentStatus); - sw.WriteLine(); - - sw.Close(); - } - } - - private void RemoveUsbBackupFile() - { - bool directoryCheck = false; - - try - { - string dday = string.Format("{0:yyyyMMdd}", DateTime.Now.AddDays(-180)) + ".csv"; - - DirectoryInfo dir = new DirectoryInfo(this.PathDataBackupFolder); - - directoryCheck = dir.Exists; - // 폴더 체크 - if (directoryCheck == false) - dir.Create(); - - FileInfo[] files = dir.GetFiles(); - foreach (FileInfo subfile in files) - { - if (subfile.Name.StartsWith("20")) // 날짜 비교하여 10일 지난화일은 삭제함 - { - if (subfile.Name.CompareTo(dday) < 0) - { - subfile.Delete(); - } - } - } - } - catch - { - - } - - } - #endregion - #region FeedbackSystem1 private void SetFeedbackSystem1(int lane, WeightData data) { @@ -8569,7 +8381,7 @@ namespace INT69DC_7C.Forms { for (int i = 0; i < system.EquipmentColumns; i++) { - if (datas[i].IsOPT1 == true) + if (datas[i].IsUpdate_COM3 == true) { if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) sb.Append("U"); @@ -8592,7 +8404,7 @@ namespace INT69DC_7C.Forms { for (int i = 1; i <= system.EquipmentColumns; i++) { - if (datas[datas.Count - i].IsOPT1 == true) + if (datas[datas.Count - i].IsUpdate_COM3 == true) { if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) sb.Append("U"); @@ -8719,7 +8531,7 @@ namespace INT69DC_7C.Forms { for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT1 == true) + if (datas[i].IsUpdate_COM3 == true) { if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) sb.Append("U"); @@ -8742,7 +8554,7 @@ namespace INT69DC_7C.Forms { for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) { - if (datas[datas.Count - i].IsOPT1 == true) + if (datas[datas.Count - i].IsUpdate_COM3 == true) { if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) sb.Append("U"); @@ -8877,7 +8689,7 @@ namespace INT69DC_7C.Forms { for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT1 == true) + if (datas[i].IsUpdate_COM3 == true) { if (datas[i].JudgmentStatus == DataStore.JudgmentStatus.Under) sb.Append("U"); @@ -8900,7 +8712,7 @@ namespace INT69DC_7C.Forms { for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) { - if (datas[datas.Count - i].IsOPT1 == true) + if (datas[datas.Count - i].IsUpdate_COM3 == true) { if (datas[datas.Count - i].JudgmentStatus == DataStore.JudgmentStatus.Under) sb.Append("U"); @@ -10547,7 +10359,7 @@ namespace INT69DC_7C.Forms { if (this.SystemConfig.EquipmentMode == 2) { - if (this.CollectionWeightData[i].IsOPT1 == true) + if (this.CollectionWeightData[i].IsUpdate_COM3 == true) { if (this.CollectionWeightData[i].IsADCError == true) { @@ -10641,7 +10453,7 @@ namespace INT69DC_7C.Forms } foreach (WeightData data in this.CollectionWeightData) - data.IsOPT1 = false; + data.IsUpdate_COM3 = false; #endregion } else @@ -10777,7 +10589,7 @@ namespace INT69DC_7C.Forms } foreach (WeightData data in this.CollectionWeightData) - data.IsOPT1 = false; + data.IsUpdate_COM3 = false; if (this.EquipmentStatus == DataStore.EquipmentStatus.Stop) { @@ -10969,7 +10781,7 @@ namespace INT69DC_7C.Forms for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT1 == true || datas[i].IsBypassMode == true) + if (datas[i].IsUpdate_COM3 == true || datas[i].IsBypassMode == true) value++; } @@ -11001,7 +10813,7 @@ namespace INT69DC_7C.Forms for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT1 == true || datas[i].IsBypassMode == true) + if (datas[i].IsUpdate_COM3 == true || datas[i].IsBypassMode == true) value++; } @@ -11011,7 +10823,7 @@ namespace INT69DC_7C.Forms this.SerialCH3OPT2IntegratedTransmission(datas); foreach (WeightData data in this.CollectionWeightData) - data.IsOPT1 = false; + data.IsUpdate_COM3 = false; } } #endregion @@ -11035,7 +10847,7 @@ namespace INT69DC_7C.Forms for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT1 == true || datas[i].IsBypassMode == true) + if (datas[i].IsUpdate_COM3 == true || datas[i].IsBypassMode == true) value++; } @@ -11045,7 +10857,7 @@ namespace INT69DC_7C.Forms this.SerialCH3OPT3IntegratedTransmission(datas); foreach (WeightData data in this.CollectionWeightData) - data.IsOPT1 = false; + data.IsUpdate_COM3 = false; } } #endregion @@ -11422,7 +11234,7 @@ namespace INT69DC_7C.Forms for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT1 == true || datas[i].IsBypassMode == true) + if (datas[i].IsUpdate_COM3 == true || datas[i].IsBypassMode == true) value++; } @@ -11432,7 +11244,7 @@ namespace INT69DC_7C.Forms this.SerialCH3OPT5IntegratedTransmission(datas); foreach (WeightData data in this.CollectionWeightData) - data.IsOPT1 = false; + data.IsUpdate_COM3 = false; } } #endregion @@ -11466,7 +11278,7 @@ namespace INT69DC_7C.Forms for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT1 == true || datas[i].IsBypassMode == true) + if (datas[i].IsUpdate_Ethernet == true || datas[i].IsBypassMode == true) value++; } @@ -11476,7 +11288,7 @@ namespace INT69DC_7C.Forms this.EthernetOPT2IntegratedTransmission(datas); foreach (WeightData data in this.CollectionWeightData) - data.IsOPT1 = false; + data.IsUpdate_Ethernet = false; } } #endregion @@ -11492,7 +11304,7 @@ namespace INT69DC_7C.Forms for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT1 == true || datas[i].IsBypassMode == true) + if (datas[i].IsUpdate_Ethernet == true || datas[i].IsBypassMode == true) value++; } @@ -11502,7 +11314,7 @@ namespace INT69DC_7C.Forms this.EthernetOPT3IntegratedTransmission(datas); foreach (WeightData data in this.CollectionWeightData) - data.IsOPT1 = false; + data.IsUpdate_Ethernet = false; } } #endregion @@ -11518,7 +11330,7 @@ namespace INT69DC_7C.Forms for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - if (datas[i].IsOPT1 == true || datas[i].IsBypassMode == true) + if (datas[i].IsUpdate_Ethernet == true || datas[i].IsBypassMode == true) value++; } @@ -11528,7 +11340,7 @@ namespace INT69DC_7C.Forms this.EthernetOPT5IntegratedTransmission(datas); foreach (WeightData data in this.CollectionWeightData) - data.IsOPT1 = false; + data.IsUpdate_Ethernet = false; } } #endregion @@ -11794,6 +11606,236 @@ namespace INT69DC_7C.Forms #endregion + #region Tracking Inspection data + private void GetTrackingInspectionFolderPath(ref string folder, ref string fileName) + { + DateTime time = DateTime.Now; + + if (this.SystemConfig.IsPart11 == false) + { + folder = this.PathDataBackupFolder; + fileName = string.Format("{0:yyyyMMdd}-{1}", time, this.SystemConfig.ProductNumber); + } + else + { + folder = string.Format("{0}{1}\\{2}\\", this.PathDataInspectionFolder, time.Year, time.Month); + fileName = string.Format("I{0:yyyyMMdd}-{1}.csv", time, this.SystemConfig.ProductNumber); + } + } + private void GetTrackingInspectionFolderPath(ref string folder, ref string fileName, int lane) + { + string ret = ""; + DateTime time = DateTime.Now; + + if (this.SystemConfig.IsPart11 == false) + { + ret = string.Format("{0}{1:yyyyMMdd}-{2}_{3}Lane.csv", this.PathDataBackupFolder, DateTime.Now, this.SystemConfig.ProductNumber, lane); + folder = this.PathDataBackupFolder; + fileName = string.Format("{0:yyyyMMdd}-{1}_{2}Lane.csv", time, this.SystemConfig.ProductNumber, lane); + } + else + { + folder = string.Format("{0}{1}\\{2}\\", this.PathDataInspectionFolder, time.Year, time.Month); + fileName = string.Format("I{0:yyyyMMdd}-{1}_{2}Lane.csv", time, this.SystemConfig.ProductNumber, lane); + } + } + private void TrackingInspectionData(Collection items) + { + bool fileCheck = false, directoryCheck = false; + string fullFilePath = "", folderPath = "", fileName = ""; + StreamWriter sw; + + if (this.SystemConfig.IsDataBackup == true) + { + this.GetTrackingInspectionFolderPath(ref folderPath, ref fileName); + fullFilePath = string.Format("{0}{1}", folderPath, fileName); + + DirectoryInfo di = new DirectoryInfo(folderPath); + directoryCheck = di.Exists; + // 폴더 체크 + if (directoryCheck == false) + di.Create(); + + FileInfo fileInfo = new FileInfo(fullFilePath); + fileCheck = fileInfo.Exists; + + sw = new StreamWriter(fullFilePath, true, Encoding.UTF8); + + if (fileCheck == false) + { + this.RemoveInspectionDataFile(); + + sw.Write("Date"); + sw.Write(","); + sw.Write("Time"); + sw.Write(","); + sw.Write("P_No"); + sw.Write(","); + sw.Write("Name"); + sw.Write(","); + sw.Write("Lot"); + sw.Write(","); + sw.Write("UnderRange"); + sw.Write(","); + sw.Write("PassRange"); + sw.Write(","); + sw.Write("OverRange"); + sw.Write(","); + sw.Write("TareRange"); + + for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) + { + sw.Write(","); + sw.Write(string.Format("#{0}_Weight", i + 1)); + sw.Write(","); + sw.Write(string.Format("#{0}_Grade", i + 1)); + } + + sw.WriteLine(); + } + + sw.Write(string.Format("{0:yyyy-MM-dd}", DateTime.Now)); + sw.Write(","); + sw.Write(string.Format("{0:HH:mm:ss}", DateTime.Now)); + sw.Write(","); + sw.Write(this.CurrentProductItem.Number); + sw.Write(","); + sw.Write(this.CurrentProductItem.Name); + sw.Write(","); + sw.Write(this.CurrentProductItem.LotNo); + sw.Write(","); + sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.UnderRange, this.SystemConfig.DecimalPlaces)); + sw.Write(","); + sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.PassRange, this.SystemConfig.DecimalPlaces)); + sw.Write(","); + sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.OverRange, this.SystemConfig.DecimalPlaces)); + sw.Write(","); + sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.TareRange, this.SystemConfig.DecimalPlaces)); + + for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) + { + sw.Write(","); + sw.Write(Helper.DoubleToString(items[i].Weight, this.SystemConfig.DecimalPlaces)); + sw.Write(","); + sw.Write(items[i].JudgmentStatus); + } + sw.WriteLine(); + sw.Close(); + } + } + private void TrackingInspectionData(WeightData item, int lane) + { + bool fileCheck = false, directoryCheck = false; + string fullFilePath = "", folderPath = "", fileName = ""; + StreamWriter sw; + + if (this.SystemConfig.IsDataBackup == true) + { + this.GetTrackingInspectionFolderPath(ref folderPath, ref fileName, lane); + fullFilePath = string.Format("{0}{1}", folderPath, fileName); + + DirectoryInfo di = new DirectoryInfo(folderPath); + directoryCheck = di.Exists; + // 폴더 체크 + if (directoryCheck == false) + di.Create(); + + FileInfo fileInfo = new FileInfo(fullFilePath); + fileCheck = fileInfo.Exists; + + sw = new StreamWriter(fullFilePath, true, Encoding.UTF8); + + if (fileCheck == false) + { + this.RemoveInspectionDataFile(); + + sw.Write("Date"); + sw.Write(","); + sw.Write("Time"); + sw.Write(","); + sw.Write("P_No"); + sw.Write(","); + sw.Write("Name"); + sw.Write(","); + sw.Write("Lot"); + sw.Write(","); + sw.Write("UnderRange"); + sw.Write(","); + sw.Write("PassRange"); + sw.Write(","); + sw.Write("OverRange"); + sw.Write(","); + sw.Write("TareRange"); + sw.Write(","); + sw.Write("Weight"); + sw.Write(","); + sw.Write("Grade"); + + sw.WriteLine(); + } + + sw.Write(string.Format("{0:yyyy-MM-dd}", DateTime.Now)); + sw.Write(","); + sw.Write(string.Format("{0:HH:mm:ss}", DateTime.Now)); + sw.Write(","); + sw.Write(this.CurrentProductItem.Number); + sw.Write(","); + sw.Write(this.CurrentProductItem.Name); + sw.Write(","); + sw.Write(this.CurrentProductItem.LotNo); + sw.Write(","); + sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.UnderRange, this.SystemConfig.DecimalPlaces)); + sw.Write(","); + sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.PassRange, this.SystemConfig.DecimalPlaces)); + sw.Write(","); + sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.OverRange, this.SystemConfig.DecimalPlaces)); + sw.Write(","); + sw.Write(Helper.StringToDecimalPlaces(this.CurrentProductItem.TareRange, this.SystemConfig.DecimalPlaces)); + sw.Write(","); + sw.Write(Helper.DoubleToString(item.Weight, this.SystemConfig.DecimalPlaces)); + sw.Write(","); + sw.Write(item.JudgmentStatus); + sw.WriteLine(); + + sw.Close(); + } + } + private void TrackingInspectionDataIntegratedCheck() + { + } + private void RemoveInspectionDataFile() + { + bool directoryCheck = false; + + try + { + string dday = string.Format("{0:yyyyMMdd}", DateTime.Now.AddDays(-180)) + ".csv"; + + DirectoryInfo dir = new DirectoryInfo(this.PathDataInspectionFolder); + + directoryCheck = dir.Exists; + // 폴더 체크 + if (directoryCheck == false) + dir.Create(); + + FileInfo[] files = dir.GetFiles(); + foreach (FileInfo subfile in files) + { + if (subfile.Name.StartsWith("20")) // 날짜 비교하여 10일 지난화일은 삭제함 + { + if (subfile.Name.CompareTo(dday) < 0) + { + subfile.Delete(); + } + } + } + } + catch + { + + } + } + #endregion #region Tracking History data public void SetTrackingHistoryData(DataStore.TrackingOperation type, string detail) { @@ -12329,7 +12371,7 @@ namespace INT69DC_7C.Forms } foreach (WeightData data in this.CollectionWeightData) - data.IsOPT1 = false; + data.IsUpdate_COM3 = false; } private void timerTimeOutOPT_Ethernet_Tick(object sender, EventArgs e) { @@ -12362,7 +12404,7 @@ namespace INT69DC_7C.Forms this.ChildFormMainDisplay.UpdateAlarmTotalPassCountDisplay(this.CurrentAlarmTotalPassCnt); foreach (WeightData data in this.CollectionWeightData) - data.IsOPT2 = false; + data.IsUpdate_ATPC = false; } private void timerUserList_Tick(object sender, EventArgs e) { @@ -12497,7 +12539,10 @@ namespace INT69DC_7C.Forms { UserManager.UserMgr_user_info_t user = (UserManager.UserMgr_user_info_t)data; - this.ChildFormUserEditor.CallBackUserListModifyInfoDataEvent(user); + if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormUserEditor) + this.ChildFormUserEditor.CallBackUserListModifyInfoDataEvent(user); + //else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) + //this.ChildFormMainDisplay.CallBackUserListModifyInfoDataEvent(user); } catch { diff --git a/INT69DC_7C/Forms/FormMainDisplay.Designer.cs b/INT69DC_7C/Forms/FormMainDisplay.Designer.cs index dba5591..eff6e08 100644 --- a/INT69DC_7C/Forms/FormMainDisplay.Designer.cs +++ b/INT69DC_7C/Forms/FormMainDisplay.Designer.cs @@ -165,6 +165,7 @@ this.smartForm1.Size = new System.Drawing.Size(1024, 768); this.smartForm1.SpecialFunctionClickPointSize = 100; this.smartForm1.SuspendLayoutInterval = 0; + this.smartForm1.Click += new System.EventHandler(this.smartForm1_Click); // // buttonProductNo // diff --git a/INT69DC_7C/Forms/FormMainDisplay.cs b/INT69DC_7C/Forms/FormMainDisplay.cs index 3f42d86..dabe4c6 100644 --- a/INT69DC_7C/Forms/FormMainDisplay.cs +++ b/INT69DC_7C/Forms/FormMainDisplay.cs @@ -23,6 +23,7 @@ namespace INT69DC_7C.Forms #region Field private int FlagTimeoutCount; private int SubmenuIndex; + public string ChangeID; private FormMain m_ParentForm; @@ -595,6 +596,7 @@ namespace INT69DC_7C.Forms this.FlagTimeoutCount = 0; this.SubmenuIndex = 0; + this.ChangeID = ""; this.ColorButtonAccessTrue = Color.Black; this.ColorButtonAccessFalse = Color.DimGray; @@ -882,9 +884,173 @@ namespace INT69DC_7C.Forms else this.buttonFeedback.ButtonUp(); } + 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 PasswordExpirationCheck(UserItem user) + { + int expiryDay = 0; + + // 만료일 -10 일때 메시지 띄우기 + expiryDay = user.GetPasswordExpiryDday(); + if (expiryDay >= -10) + { + Console.WriteLine("password : " + expiryDay.ToString()); + DialogFormYesNo myDlg = new DialogFormYesNo(this.ParentForm.SystemConfig.Language, 2, expiryDay.ToString()); + if (myDlg.ShowDialog() == DialogResult.Yes) + { + // 비밀 번호 변경 띄우기 + DialogFormLogOn logOn = new DialogFormLogOn(this.ParentForm, true, true); + if (logOn.ShowDialog() == DialogResult.OK) + { + + } + } + } + } + private void DirectLogin(string id, string pass) + { + UserManager.UserMgr_user_info_t userInfo = new UserManager.UserMgr_user_info_t(); + + UserManager.UserManager_UserLoginDirect(id, pass, ref userInfo); + Console.WriteLine(string.Format("status : {0}", userInfo.status)); + Console.WriteLine("ID : " + id); + Console.WriteLine("pass : " + pass); + + if (userInfo.status == 0) + { + #region 로그인 성공 + if (userInfo.active_level == 1) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Level1; + else if (userInfo.active_level == 2) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Level2; + else if (userInfo.active_level == 3) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Level3; + else if (userInfo.active_level == 9) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Admin; + else if (userInfo.active_level == 10) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Developer; + + this.ParentForm.SystemConfig.CurrentUser.ID = userInfo.user_id; + this.ParentForm.SystemConfig.CurrentUser.Password = userInfo.user_pw; + + this.ParentForm.SystemConfig.CurrentUser.ExpireAccount = userInfo.expire_period_account; + this.ParentForm.SystemConfig.CurrentUser.ExpirePassword = userInfo.expire_period_pw; + + Console.WriteLine(userInfo.register_date.GetDateTime()); + Console.WriteLine(userInfo.login_date.GetDateTime()); + Console.WriteLine(userInfo.expire_account_date.GetDateTime()); + Console.WriteLine(userInfo.expire_register_date.GetDateTime()); + + DateTime time = DateTime.ParseExact(userInfo.register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateRegister = time; + time = DateTime.ParseExact(userInfo.login_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateLogin = time; + time = DateTime.ParseExact(userInfo.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateExpireRegister = time; + time = DateTime.ParseExact(userInfo.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateExpireLogin = time; + + this.ParentForm.SystemConfig.CurrentUser.IsLockAccount = userInfo.flock_status_account == 0 ? false : true; + this.ParentForm.SystemConfig.CurrentUser.IsLockPassword = userInfo.flock_status_password == 0 ? false : true; + + this.ParentForm.SystemConfig.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true; + + this.ParentForm.SystemConfig.CurrentUser.ActiveLevel = userInfo.active_level; + #endregion + + this.UI_Invoke(delegate + { + this.UpdateDisplayUser(this.ParentForm.SystemConfig.CurrentUser); + }); + } + } + + private void Login() + { + DialogResult result; + + DialogFormLogOn logOn = new DialogFormLogOn(this.ParentForm, false, false); + result = logOn.ShowDialog(); + + if (result == DialogResult.OK) + { + if (this.ParentForm.SystemConfig.CurrentUser.Group == DataStore.UserGroup.Level1 || + this.ParentForm.SystemConfig.CurrentUser.Group == DataStore.UserGroup.Level2 || + this.ParentForm.SystemConfig.CurrentUser.Group == DataStore.UserGroup.Level3) + { + // 비밀번호 만료일 10일 미만 체크 후 비밀번호 변경 + this.PasswordExpirationCheck(this.ParentForm.SystemConfig.CurrentUser); + } + + this.buttonUser.ButtonDown(); + this.UpdateDisplayUser(this.ParentForm.SystemConfig.CurrentUser); + + // Part 11 + if (this.ParentForm.SystemConfig.IsPart11 == true) + this.ParentForm.SetTrackingHistoryData(DataStore.TrackingOperation.Login, ""); + } + else if (result == DialogResult.Abort) + { + + // 비밀 번호 변경 띄우기 + DialogFormLogOn logOn1 = new DialogFormLogOn(this.ParentForm, false, true); + if (logOn1.ShowDialog() == DialogResult.OK) + { + this.buttonUser.ButtonDown(); + this.UpdateDisplayUser(this.ParentForm.SystemConfig.CurrentUser); + } + else + this.buttonUser.ButtonUp(); + } + else + { + this.buttonUser.ButtonUp(); + } + } + public void Logout() + { + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.LogOut; + this.buttonUser.ButtonUp(); + this.DisplayRefresh(); + this.ChangeID = ""; + + // Part 11 + if (this.ParentForm.SystemConfig.IsPart11 == true) + this.ParentForm.SetTrackingHistoryData(DataStore.TrackingOperation.Logout, ""); + } + public void Part11AutomaticLogoutReset() + { + UserManager.UserManager_AutoLogoutTimeoutReset(); + } + public void UpdateDisplayUser(UserItem user) { - string id = "", group = "", expireDate = ""; + string id = "", group = "", expirePW = ""; + int expireDate = 0; + Color colorExpirePW = this.ParentForm.ColorLogOff; switch (user.Group) { @@ -1061,45 +1227,35 @@ namespace INT69DC_7C.Forms { if (this.ParentForm.SystemConfig.IsPart11 == true) { - expireDate = this.DisplayExpireOfPassword(user.Group); - if (expireDate != "-") + expireDate = user.GetPasswordExpiryDday(); + if (expireDate == 9999) { - int intExpireDate = int.Parse(expireDate); - - if (intExpireDate == 0) - { - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOff; - this.labelExpireOfPassword.Text = "D-0"; - } - else if (intExpireDate < 0) - { - if (intExpireDate * -1 > this.ParentForm.SystemConfig.CurrentUser.ExpirePassword) - expireDate = "-" + (this.ParentForm.SystemConfig.CurrentUser.ExpirePassword - 1).ToString(); - - this.labelExpireOfPassword.Text = "D" + expireDate; - if (intExpireDate >= -10) - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOff; - else - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOn; - } - else - { - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOn; - this.labelExpireOfPassword.Text = "D+" + expireDate; - } + // Administrator or Developer + colorExpirePW = this.ParentForm.ColorLogOn; + expirePW = "-"; } else { - // Administrator or Developer - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOn; - this.labelExpireOfPassword.Text = "-"; + if (expireDate >= -10) + { + colorExpirePW = this.ParentForm.ColorLogOff; + if (expireDate > 0) + expirePW = string.Format("D+{0}", expireDate); + else + expirePW = string.Format("D{0}", expireDate); + } + else + { + colorExpirePW = this.ParentForm.ColorLogOn; + expirePW = string.Format("D{0}", expireDate); + } } } else { // Part11 미사용 - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOn; - this.labelExpireOfPassword.Text = "-"; + colorExpirePW = this.ParentForm.ColorLogOn; + expirePW = "-"; } } @@ -1107,93 +1263,11 @@ namespace INT69DC_7C.Forms this.labelUserLevel.Text = group; if (this.labelUserID.Text != id) this.labelUserID.Text = id; + if (this.labelExpireOfPassword.ForeColor != colorExpirePW) + this.labelExpireOfPassword.ForeColor = colorExpirePW; + if (this.labelExpireOfPassword.Text != expirePW) + this.labelExpireOfPassword.Text = expirePW; } - - private void Login() - { - DialogResult result; - - DialogFormLogOn logOn = new DialogFormLogOn(this.ParentForm); - result = logOn.ShowDialog(); - - if (result == DialogResult.OK) - { - this.UpdateDisplayUser(this.ParentForm.SystemConfig.CurrentUser); - //this.DisplayRefresh(); - this.buttonUser.ButtonDown(); - //this.ParentForm.TimerAutomaticLogout(true, this.ParentForm.SystemConfig.AutomaticLogout); - - // Part 11 - if (this.ParentForm.SystemConfig.IsPart11 == true) - this.ParentForm.SetTrackingHistoryData(DataStore.TrackingOperation.Login, ""); - - // 만료일 -10 일때 메시지 띄우기 - } - else if (result == DialogResult.Abort) - { - // 비밀 번호 변경 띄우기 - } - else - { - this.buttonUser.ButtonUp(); - } - } - public void Logout() - { - this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.LogOut; - this.buttonUser.ButtonUp(); - this.DisplayRefresh(); - - // Part 11 - if (this.ParentForm.SystemConfig.IsPart11 == true) - this.ParentForm.SetTrackingHistoryData(DataStore.TrackingOperation.Logout, ""); - } - public void Part11AutomaticLogoutReset() - { - UserManager.UserManager_AutoLogoutTimeoutReset(); - } - public string DisplayExpireOfPassword(DataStore.UserGroup group) - { - string ret = ""; - - if (group == DataStore.UserGroup.Admin || group == DataStore.UserGroup.Developer) - ret = "-"; - else - { - //TimeSpan resultTime = DateTime.Now - this.ParentForm.CurrentSystemStatus.CurrentUser.DateExpireRegister; - TimeSpan dayDiff = DateTime.Now.Date - this.ParentForm.SystemConfig.CurrentUser.DateExpireRegister.Date; - ret = dayDiff.Days.ToString(); - } - - return ret; - } - - 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; - } - - } - public void UpdateCurrentProductDisplay(DataStore.EquipmentStatus status, ProductItem pItem,JudgmentSetItem jItem, Collection weightDatas) { string value = ""; @@ -2310,6 +2384,56 @@ namespace INT69DC_7C.Forms }); } } + public void CallBackUserListModifyInfoDataEvent(UserManager.UserMgr_user_info_t userInfo) + { + Console.WriteLine("status : " + userInfo.status.ToString()); + Console.WriteLine("ID : " + userInfo.user_id); + Console.WriteLine("pass : " + userInfo.user_pw); + if (userInfo.status == 0) + { + Console.WriteLine("Group : " + this.ParentForm.SystemConfig.CurrentUser.Group.ToString()); + if (this.ParentForm.SystemConfig.CurrentUser.Group == DataStore.UserGroup.LogOut) + { + Console.WriteLine("DirectLogin"); + this.DirectLogin(userInfo.user_id, userInfo.user_pw); + } + else + { + if (userInfo.active_level == 1) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Level1; + else if (userInfo.active_level == 2) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Level2; + else if (userInfo.active_level == 3) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Level3; + else if (userInfo.active_level == 9) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Admin; + else if (userInfo.active_level == 10) + this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Developer; + + this.ParentForm.SystemConfig.CurrentUser.ID = userInfo.user_id; + this.ParentForm.SystemConfig.CurrentUser.Password = userInfo.user_pw; + + this.ParentForm.SystemConfig.CurrentUser.ExpireAccount = userInfo.expire_period_account; + this.ParentForm.SystemConfig.CurrentUser.ExpirePassword = userInfo.expire_period_pw; + + DateTime time = DateTime.ParseExact(userInfo.register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateRegister = time; + time = DateTime.ParseExact(userInfo.login_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateLogin = time; + time = DateTime.ParseExact(userInfo.expire_account_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateExpireRegister = time; + time = DateTime.ParseExact(userInfo.expire_register_date.GetDateTime(), "yyyyMMddHHmmss", null); + this.ParentForm.SystemConfig.CurrentUser.DateExpireLogin = time; + + this.ParentForm.SystemConfig.CurrentUser.IsLockAccount = userInfo.flock_status_account == 0 ? false : true; + this.ParentForm.SystemConfig.CurrentUser.IsLockPassword = userInfo.flock_status_password == 0 ? false : true; + + this.ParentForm.SystemConfig.CurrentUser.IsAdmin = userInfo.fadmin == 0 ? false : true; + + this.ParentForm.SystemConfig.CurrentUser.ActiveLevel = userInfo.active_level; + } + } + } public void DisplayRefresh() { @@ -2972,13 +3096,7 @@ namespace INT69DC_7C.Forms if (this.ParentForm.SystemConfig.CurrentUser.Group == DataStore.UserGroup.LogOut) { - this.Login(); - - //10 전 - // 메시지 띄우기 (변경할래?) yes no - - // 만료 - // 비밀번호 창 띄우기 + this.Login(); } else { @@ -3849,5 +3967,10 @@ namespace INT69DC_7C.Forms this.ParentForm.Dispose(); this.ParentForm.Close(); } + + private void smartForm1_Click(object sender, EventArgs e) + { + + } } } \ No newline at end of file diff --git a/INT69DC_7C/Forms/FormMenu.cs b/INT69DC_7C/Forms/FormMenu.cs index 3af675b..2c20a60 100644 --- a/INT69DC_7C/Forms/FormMenu.cs +++ b/INT69DC_7C/Forms/FormMenu.cs @@ -292,7 +292,9 @@ namespace INT69DC_7C.Forms public void UpdateDisplayUser(UserItem user) { - string id = "", group = "", expireDate = ""; + string id = "", group = "", expirePW = ""; + int expireDate = 0; + Color colorExpirePW = this.ParentForm.ColorLogOff; switch (user.Group) { @@ -514,45 +516,36 @@ namespace INT69DC_7C.Forms { if (this.ParentForm.SystemConfig.IsPart11 == true) { - expireDate = this.ParentForm.ChildFormMainDisplay.DisplayExpireOfPassword(user.Group); - if (expireDate != "-") + expireDate = user.GetPasswordExpiryDday(); + if (expireDate == 9999) { - int intExpireDate = int.Parse(expireDate); - - if (intExpireDate == 0) - { - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOff; - this.labelExpireOfPassword.Text = "D-0"; - } - else if (intExpireDate < 0) - { - if (intExpireDate * -1 > this.ParentForm.SystemConfig.CurrentUser.ExpirePassword) - expireDate = "-" + (this.ParentForm.SystemConfig.CurrentUser.ExpirePassword - 1).ToString(); - - this.labelExpireOfPassword.Text = "D" + expireDate; - if (intExpireDate >= -10) - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOff; - else - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOn; - } - else - { - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOn; - this.labelExpireOfPassword.Text = "D+" + expireDate; - } + // Administrator or Developer + colorExpirePW = this.ParentForm.ColorLogOn; + expirePW = "-"; + } else { - // Administrator or Developer - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOn; - this.labelExpireOfPassword.Text = "-"; + if (expireDate >= -10) + { + colorExpirePW = this.ParentForm.ColorLogOff; + if (expireDate > 0) + expirePW = string.Format("D+{0}", expireDate); + else + expirePW = string.Format("D{0}", expireDate); + } + else + { + colorExpirePW = this.ParentForm.ColorLogOn; + expirePW = string.Format("D{0}", expireDate); + } } } else { // Part11 미사용 - this.labelExpireOfPassword.ForeColor = this.ParentForm.ColorLogOn; - this.labelExpireOfPassword.Text = "-"; + colorExpirePW = this.ParentForm.ColorLogOn; + expirePW = "-"; } } @@ -560,6 +553,10 @@ namespace INT69DC_7C.Forms this.labelUserID.Text = id; if (this.labelUserLevel.Text != group) this.labelUserLevel.Text = group; + if (this.labelExpireOfPassword.ForeColor != colorExpirePW) + this.labelExpireOfPassword.ForeColor = colorExpirePW; + if (this.labelExpireOfPassword.Text != expirePW) + this.labelExpireOfPassword.Text = expirePW; } public void DisplayRefresh() diff --git a/INT69DC_7C/Forms/FormOptionSetting.cs b/INT69DC_7C/Forms/FormOptionSetting.cs index 11c305c..4da9ccd 100644 --- a/INT69DC_7C/Forms/FormOptionSetting.cs +++ b/INT69DC_7C/Forms/FormOptionSetting.cs @@ -173,11 +173,13 @@ namespace INT69DC_7C.Forms { this.ParentForm.SystemConfig.IsPart11 = true; this.ParentForm.SystemConfig.IsLogin = true; + this.ParentForm.SystemConfig.IsDataBackup = true; } else { this.ParentForm.SystemConfig.IsPart11 = false; this.ParentForm.SystemConfig.IsLogin = false; + this.ParentForm.SystemConfig.IsDataBackup = false; } this.ParentForm.SaveSystemConfigurationFile(this.ParentForm.SystemConfig); diff --git a/INT69DC_7C/Forms/FormUserEditor.cs b/INT69DC_7C/Forms/FormUserEditor.cs index ca598d5..b29e765 100644 --- a/INT69DC_7C/Forms/FormUserEditor.cs +++ b/INT69DC_7C/Forms/FormUserEditor.cs @@ -261,26 +261,10 @@ namespace INT69DC_7C.Forms msg.ShowDialog(); return; } - - if (this.labelExpiryDateOfAccount.Text == "000") - { - DialogFormMessage msg = new DialogFormMessage(null, 16, this.ParentForm.SystemConfig.Language); - msg.ShowDialog(); - - return; - } - - if (this.labelExpiryDateOfPassword.Text == "00") - { - DialogFormMessage msg = new DialogFormMessage(null, 16, this.ParentForm.SystemConfig.Language); - msg.ShowDialog(); - - return; - } #endregion item.ID = this.labelID.Text; - item.SetPassword(this.labelPassword.Text); + item.Password = this.labelPassword.Text; item.ExpireAccount = int.Parse(this.labelExpiryDateOfAccount.Text); item.ExpirePassword = int.Parse(this.labelExpiryDateOfPassword.Text); @@ -551,6 +535,11 @@ namespace INT69DC_7C.Forms if (this.SelectedUserItem.Group == DataStore.UserGroup.Admin || this.SelectedUserItem.Group == DataStore.UserGroup.Developer) { + Console.WriteLine(item.register_date.GetDateTime()); + Console.WriteLine(item.login_date.GetDateTime()); + Console.WriteLine(item.expire_account_date.GetDateTime()); + Console.WriteLine(item.expire_register_date.GetDateTime()); + this.SelectedUserItem.DateRegister = DateTime.Now; this.SelectedUserItem.DateLogin = DateTime.Now; this.SelectedUserItem.DateExpireRegister = DateTime.Now; @@ -597,6 +586,12 @@ namespace INT69DC_7C.Forms if (this.SelectedUserItem.Group == DataStore.UserGroup.Admin || this.SelectedUserItem.Group == DataStore.UserGroup.Developer) { + Console.WriteLine(item.register_date.GetDateTime()); + Console.WriteLine(item.login_date.GetDateTime()); + Console.WriteLine(item.expire_account_date.GetDateTime()); + Console.WriteLine(item.expire_register_date.GetDateTime()); + + this.SelectedUserItem.DateRegister = DateTime.Now; this.SelectedUserItem.DateLogin = DateTime.Now; this.SelectedUserItem.DateExpireRegister = DateTime.Now; @@ -652,8 +647,8 @@ namespace INT69DC_7C.Forms { this.labelExpiryDateOfAccount.Text = item.ExpireAccount.ToString(); this.labelExpiryDateOfPassword.Text = item.ExpirePassword.ToString(); - 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.labelExpiryDateOfAccount2.Text = string.Format("{0:yyyy/MM/dd} ~ {1:yyyy/MM/dd}", item.DateLogin, item.DateExpireRegister); + this.labelExpiryDateOfPassword2.Text = string.Format("{0:yyyy/MM/dd} ~ {1:yyyy/MM/dd}", item.DateRegister, item.DateExpireLogin); this.labelStatusExpiryAccount.Visible = item.IsLockAccount; this.labelStatusExpiryPassword.Visible = item.IsLockPassword; diff --git a/INT69DC_7C/Forms/FormUserEditor.designer.cs b/INT69DC_7C/Forms/FormUserEditor.designer.cs index d2af797..2bb408c 100644 --- a/INT69DC_7C/Forms/FormUserEditor.designer.cs +++ b/INT69DC_7C/Forms/FormUserEditor.designer.cs @@ -1053,6 +1053,7 @@ this.buttonNew.Size = new System.Drawing.Size(100, 50); this.buttonNew.SpecialFunction = SmartX.SmartButton.SPECIALFUNC.NONE; this.buttonNew.TabIndex = 188; + this.buttonNew.Text = "!"; this.buttonNew.TextColor = System.Drawing.Color.Black; this.buttonNew.TextDownColor = System.Drawing.Color.White; this.buttonNew.TextHAlign = SmartX.SmartButton.TextHorAlign.Middle; diff --git a/INT69DC_7C/Part11_UserManager/UserItem.cs b/INT69DC_7C/Part11_UserManager/UserItem.cs index bd1722a..884af9e 100644 --- a/INT69DC_7C/Part11_UserManager/UserItem.cs +++ b/INT69DC_7C/Part11_UserManager/UserItem.cs @@ -12,9 +12,6 @@ namespace INT69DC_7C.Part11_UserManager #region Field private string m_ID; private string m_Password; - private string m_PreviousPassword1; - private string m_PreviousPassword2; - private string m_PreviousPassword3; private int m_ExpireAccount; private int m_ExpirePassword; @@ -52,21 +49,6 @@ namespace INT69DC_7C.Part11_UserManager get { return this.m_Password; } set { this.m_Password = value; } } - public string PreviousPassword1 - { - get { return this.m_PreviousPassword1; } - set { this.m_PreviousPassword1 = value; } - } - public string PreviousPassword2 - { - get { return this.m_PreviousPassword2; } - set { this.m_PreviousPassword2 = value; } - } - public string PreviousPassword3 - { - get { return this.m_PreviousPassword3; } - set { this.m_PreviousPassword3 = value; } - } public int ExpireAccount { @@ -136,10 +118,6 @@ namespace INT69DC_7C.Part11_UserManager this.ID = "-"; this.Password = "-"; - this.PreviousPassword1 = "-"; - this.PreviousPassword2 = "-"; - this.PreviousPassword3 = "-"; - this.ExpireAccount = 0; this.ExpirePassword = 0; @@ -155,12 +133,21 @@ namespace INT69DC_7C.Part11_UserManager this.ActiveLevel = 1; } - public void SetPassword(string pass) + public int GetPasswordExpiryDday() { - this.PreviousPassword3 = this.PreviousPassword2; - this.PreviousPassword2 = this.PreviousPassword1; - this.PreviousPassword1 = pass; - this.Password = pass; + int ret = 0; + DateTime timeNow = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); + TimeSpan dayDiff; + + if (this.Group == DataStore.UserGroup.Admin || this.Group == DataStore.UserGroup.Developer) + ret = 9999; + else + { + dayDiff = timeNow.Date - this.DateExpireLogin.Date; + ret = dayDiff.Days; + } + + return ret; } #endregion } diff --git a/INT69DC_7C/Part11_UserManager/UserManager.Define.cs b/INT69DC_7C/Part11_UserManager/UserManager.Define.cs index 8676727..bca150e 100644 --- a/INT69DC_7C/Part11_UserManager/UserManager.Define.cs +++ b/INT69DC_7C/Part11_UserManager/UserManager.Define.cs @@ -125,6 +125,9 @@ namespace INT69DC_7C.Part11_UserManager [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] private static extern int DLL_UserMgr_UserModifyPW(IntPtr user_id, IntPtr user_pw); + [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] + private static extern int DLL_UserMgr_UserModifyPWDirect(IntPtr user_id, IntPtr user_pw); + [DllImport(PathDll, CallingConvention = CallingConvention.Winapi)] private static extern int DLL_UserMgr_UserModifyID(IntPtr user_org_id, IntPtr user_new_id); diff --git a/INT69DC_7C/Part11_UserManager/UserManager.cs b/INT69DC_7C/Part11_UserManager/UserManager.cs index 659802f..e7636e5 100644 --- a/INT69DC_7C/Part11_UserManager/UserManager.cs +++ b/INT69DC_7C/Part11_UserManager/UserManager.cs @@ -136,6 +136,18 @@ namespace INT69DC_7C.Part11_UserManager DLL_UserMgr_UserModifyPW(pID, pPW); } + public static int UserManager_UserModifyPWDirect(String sID, String sNewPW) + { + int ret = 0; + + IntPtr pID = Marshal.StringToBSTR(sID.ToString()); + IntPtr pPW = Marshal.StringToBSTR(sNewPW.ToString()); + + ret = DLL_UserMgr_UserModifyPWDirect(pID, pPW); + + return ret; + } + public static void UserManager_UserModifyID(String sID, String sNewID) { IntPtr pID = Marshal.StringToBSTR(sID.ToString()); diff --git a/INT69DC_7C/Version.txt b/INT69DC_7C/Version.txt index 896bdf6..79546ff 100644 --- a/INT69DC_7C/Version.txt +++ b/INT69DC_7C/Version.txt @@ -21,6 +21,7 @@ - Framework : SmartX Framework V3.1.1(update: 2019.03.21) - Part 11 INT99DC_7C V3.0.2 + ƽ 2忡 @ Ver 10.13.0 by LSJ - 2023.08.07