diff --git a/INT63DC_6CH/DataStore.cs b/INT63DC_6CH/DataStore.cs index cadb45c..ac647a7 100644 --- a/INT63DC_6CH/DataStore.cs +++ b/INT63DC_6CH/DataStore.cs @@ -1554,23 +1554,15 @@ namespace INT63DC_6CH private int m_PassCount; private int m_OverCount; private int m_ExNGCount; - private double m_Weight; - private DataStore.JudgmentStatus m_JudgmentStatus; - private DataStore.WeightStatus m_Status; private int m_ProductionSpeed; - - private int PreviousTimeTickCount; - private bool m_IsStart; - private string m_WeightString; + private string m_Sign; + private DataStore.WeightStatus m_Status; + private DataStore.JudgmentStatus m_JudgmentStatus; private bool m_IsBypassMode; - - private bool m_IsOPT1; - private bool m_IsSamplingData; - private ushort m_UpdateCount; #endregion @@ -1647,26 +1639,54 @@ namespace INT63DC_6CH get { return this.m_ExNGCount; } set { this.m_ExNGCount = value; } } - public int TotalNGCount { get { return this.UnderCount + this.OverCount + this.ExNGCount; } } - public int TotalCount { get { return this.UnderCount + this.PassCount + this.OverCount + this.ExNGCount; } } + public int ProductionSpeed + { + get { return this.m_ProductionSpeed; } + set { this.m_ProductionSpeed = value; } + } /// /// 소수점 포함된 중량값 /// public double Weight { - get { return this.m_Weight; } - set { this.m_Weight = value; } - } + get + { + double ret = 0.0; + ret = Helper.StringToWeight(this.WeightString, 3); + if (this.Sign == "-") + ret *= -1; + + return ret; + } + } + /// + /// 소수점 없는 중량값 + /// + public string WeightString + { + get { return this.m_WeightString; } + set { this.m_WeightString = value; } + } + public string Sign + { + get { return this.m_Sign; } + set { this.m_Sign = value; } + } + public DataStore.WeightStatus Status + { + get { return this.m_Status; } + set { this.m_Status = value; } + } public DataStore.JudgmentStatus JudgmentStatus { get { return this.m_JudgmentStatus; } @@ -1707,47 +1727,11 @@ namespace INT63DC_6CH } } - public DataStore.WeightStatus Status - { - get { return this.m_Status; } - set { this.m_Status = value; } - } - - public int ProductionSpeed - { - get { return this.m_ProductionSpeed; } - set { this.m_ProductionSpeed = value; } - } - public bool IsStart - { - get { return this.m_IsStart; } - set { this.m_IsStart = value; } - } - - /// - /// 소수점 없는 중량값 - /// - public string WeightString - { - get { return this.m_WeightString; } - set { this.m_WeightString = value; } - } - public bool IsBypassMode { get { return m_IsBypassMode; } set { m_IsBypassMode = value; } } - - /// - /// 스틱2모드에서 데이터 전송이 되었으면 true, 안되었으면 false - /// - public bool IsOPT1 - { - get { return this.m_IsOPT1; } - set { this.m_IsOPT1 = value; } - } - /// /// 샘플링 기능 설정 후 판정데이터가 샘플링 데이터이면 true /// @@ -1756,7 +1740,6 @@ namespace INT63DC_6CH get { return this.m_IsSamplingData; } set { this.m_IsSamplingData = value; } } - public ushort UpdateCount { get { return this.m_UpdateCount; } @@ -1780,35 +1763,16 @@ namespace INT63DC_6CH this.PassCount = 0; this.OverCount = 0; this.ExNGCount = 0; - this.Weight = 0.0; - this.JudgmentStatus = DataStore.JudgmentStatus.None; + this.ProductionSpeed = 0; this.WeightString = "0"; + this.Sign = ""; + this.Status = DataStore.WeightStatus.WeightZero; + this.JudgmentStatus = DataStore.JudgmentStatus.None; + this.IsBypassMode = false; - this.IsOPT1 = false; this.IsSamplingData = false; - } - - private void ProductionSpeedCalculation() - { - int currentTimeTickCount = 0, gap = 0; - double millisecond = 0.0, speed = 0.0; - - if (this.IsStart == false) - { - this.PreviousTimeTickCount = Environment.TickCount & Int32.MaxValue; - this.IsStart = true; - } - else - { - currentTimeTickCount = Environment.TickCount & Int32.MaxValue; - gap = Math.Abs(currentTimeTickCount - this.PreviousTimeTickCount); - millisecond = gap / 1000.0; - speed = 60 / millisecond; - this.ProductionSpeed = int.Parse(string.Format("{0:f0}", speed)); - - this.PreviousTimeTickCount = Environment.TickCount; - } + this.UpdateCount = 0; } #endregion } diff --git a/INT63DC_6CH/Forms/FormMain.cs b/INT63DC_6CH/Forms/FormMain.cs index 2b9c8c7..5af47dc 100644 --- a/INT63DC_6CH/Forms/FormMain.cs +++ b/INT63DC_6CH/Forms/FormMain.cs @@ -111,7 +111,6 @@ namespace INT63DC_6CH.Forms // Collection public Collection CollectionWeightData; // 열별 중량 데이터 - public Collection CollectionWeightDataTest; // 장비테스트모드 열별 중량 데이터 private Collection CollectionGraphData; // 판정설정 그래프 데이터 private Collection CollectionIOTest_InputData; // IO Test Input 데이터 취합 private Collection CollectionIOTest_InputData1; // IO Test Input1 데이터 취합 확장보드 @@ -276,29 +275,22 @@ namespace INT63DC_6CH.Forms private void CreateCollection() { this.CollectionWeightData = new Collection(); - this.CollectionWeightDataTest = new Collection(); this.CollectionGraphData = new Collection(); this.CollectionIOTest_InputData = new Collection(); this.CollectionIOTest_InputData1 = new Collection(); this.CollectionProductName = new Collection(); this.CollectionWeightData.Clear(); - this.CollectionWeightDataTest.Clear(); this.CollectionGraphData.Clear(); this.CollectionIOTest_InputData.Clear(); this.CollectionIOTest_InputData1.Clear(); this.CollectionProductName.Clear(); for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) - { this.CollectionWeightData.Add(new WeightData()); - this.CollectionWeightDataTest.Add(new WeightData()); - } for (int i = 0; i < 100; i++) - { this.CollectionGraphData.Add(0); - } for (int i = 0; i < 16; i++) { @@ -503,7 +495,7 @@ namespace INT63DC_6CH.Forms this.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._9054_ParameterSystem, sb.ToString()); } - private void TransferProductParameter1(int productNumber) + private void TransferProductParameter(int productNumber) { StringBuilder sb = new StringBuilder(); ProductItem pItem = new ProductItem(); @@ -542,6 +534,8 @@ namespace INT63DC_6CH.Forms { this.ProductChangNumber = productNumber; + this.TransferProductParameter(this.ProductChangNumber); + this.FlagTimeoutCount = 0; this.timerTimeout.Enabled = true; } @@ -892,7 +886,6 @@ namespace INT63DC_6CH.Forms foreach (WeightData data in this.CollectionWeightData) { data.ProductionSpeed = 0; - data.IsStart = false; } if (this.ChildFormMainDisplay != null) @@ -908,9 +901,7 @@ namespace INT63DC_6CH.Forms // 운전시 중량 0 으로 Clear foreach (WeightData data in this.CollectionWeightData) - { - data.Weight = 0.0; - } + data.WeightString = "0"; if (this.ChildFormMainDisplay != null) this.ChildFormMainDisplay.UpdateEquipmentStatusDisplay(this.EquipmentStatus); @@ -934,7 +925,6 @@ namespace INT63DC_6CH.Forms foreach (WeightData data in this.CollectionWeightData) { data.ProductionSpeed = 0; - data.IsStart = false; } // Respone @@ -1131,7 +1121,6 @@ namespace INT63DC_6CH.Forms foreach (WeightData data in this.CollectionWeightData) { data.ProductionSpeed = 0; - data.IsStart = false; } if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) @@ -1234,55 +1223,35 @@ namespace INT63DC_6CH.Forms { case "Z": #region Value Assign - if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) + if (this.SystemConfig.IsWeightViewForward == true) { - if (this.SystemConfig.IsWeightViewForward == true) + for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) + if (this.EquipmentStatus == DataStore.EquipmentStatus.Stop) { - if (this.EquipmentStatus == DataStore.EquipmentStatus.Stop) - { - this.CollectionWeightData[i].Status = Helper.StringToWeightStatus(receiveData.Substring(i * 9, 2)); - this.CollectionWeightData[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 9 + 2, 7), this.SystemConfig.DecimalPlaces); - } - else - { - this.CollectionWeightData[i].Status = Helper.StringToWeightStatus(receiveData.Substring(i * 9, 2)); - } + this.CollectionWeightData[i].Status = Helper.StringToWeightStatus(receiveData.Substring(i * 10, 2)); + this.CollectionWeightData[i].Sign = receiveData.Substring(i * 10 + 2, 1); + this.CollectionWeightData[i].WeightString = receiveData.Substring(i * 10 + 3, 7); } - } - else - { - for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) + else { - if (this.EquipmentStatus == DataStore.EquipmentStatus.Stop) - { - this.CollectionWeightData[this.SystemConfig.EquipmentColumns - i].Status = Helper.StringToWeightStatus(receiveData.Substring((i-1) * 9, 2)); - this.CollectionWeightData[this.SystemConfig.EquipmentColumns - i].Weight = Helper.StringToWeight(receiveData.Substring((i - 1) * 9 + 2, 7), this.SystemConfig.DecimalPlaces); - } - else - { - this.CollectionWeightData[this.SystemConfig.EquipmentColumns - i].Status = Helper.StringToWeightStatus(receiveData.Substring((i - 1) * 9, 2)); - } + this.CollectionWeightData[i].Status = Helper.StringToWeightStatus(receiveData.Substring(i * 10, 2)); } } } - else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) + else { - if (this.SystemConfig.IsWeightViewForward == true) + for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) { - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) + if (this.EquipmentStatus == DataStore.EquipmentStatus.Stop) { - this.CollectionWeightDataTest[i].Status = Helper.StringToWeightStatus(receiveData.Substring(i * 9, 2)); - this.CollectionWeightDataTest[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 9 + 2, 7), this.SystemConfig.DecimalPlaces); + this.CollectionWeightData[this.SystemConfig.EquipmentColumns - i].Status = Helper.StringToWeightStatus(receiveData.Substring((i - 1) * 10, 2)); + this.CollectionWeightData[this.SystemConfig.EquipmentColumns - i].Sign = receiveData.Substring((i - 1) * 10 + 2, 1); + this.CollectionWeightData[this.SystemConfig.EquipmentColumns - i].WeightString = receiveData.Substring((i - 1) * 10 + 3, 7); } - } - else - { - for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) + else { - this.CollectionWeightDataTest[this.SystemConfig.EquipmentColumns - i].Status = Helper.StringToWeightStatus(receiveData.Substring((i - 1) * 9, 2)); - this.CollectionWeightDataTest[this.SystemConfig.EquipmentColumns - i].Weight = Helper.StringToWeight(receiveData.Substring((i - 1) * 9 + 2, 7), this.SystemConfig.DecimalPlaces); + this.CollectionWeightData[this.SystemConfig.EquipmentColumns - i].Status = Helper.StringToWeightStatus(receiveData.Substring((i - 1) * 10, 2)); } } } @@ -1292,11 +1261,6 @@ namespace INT63DC_6CH.Forms if (this.ChildFormMainDisplay != null) this.ChildFormMainDisplay.UpdateStopWeightDisplay(this.EquipmentStatus, this.CollectionWeightData); } - else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) - { - if (this.ChildFormEquipmentTest != null) - this.ChildFormEquipmentTest.UpdateStopWeightDisplay(this.EquipmentStatus, this.CollectionWeightDataTest); - } break; default: break; @@ -1337,181 +1301,129 @@ namespace INT63DC_6CH.Forms //this.TransferDataRespone(CommunicationCommand.StartDataCMD, lane, transactionID, transferCNT, CommunicationAddress.ACK); //Application.DoEvents(); - if (this.CurrentComRespone.TransactionID != transactionID) + //if (this.CurrentComRespone.TransactionID != transactionID) + //{ + // this.CurrentComRespone.TransactionID = transactionID; + // this.CurrentComRespone.TransferCount = transferCNT; + + if (this.SystemConfig.IsWeightViewForward == true) { - this.CurrentComRespone.TransactionID = transactionID; - this.CurrentComRespone.TransferCount = transferCNT; - - if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) + for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - #region FormEquipmentTest - if (this.SystemConfig.IsWeightViewForward == true) - { - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) - { - this.CollectionWeightDataTest[i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(i * 9, 2)); - this.CollectionWeightDataTest[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 9 + 2, 7), this.SystemConfig.DecimalPlaces); + this.CollectionWeightData[i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(i * 10, 2)); + this.CollectionWeightData[i].Sign = receiveData.Substring(i * 10 + 2, 1); + this.CollectionWeightData[i].WeightString = receiveData.Substring(i * 10 + 3, 7).Trim(); - // SamplingData Check - data = receiveData.Substring(i * 12, 2); - if (data == "sU" || data == "sO" || data == "sP" || data == "sT") - this.CollectionWeightDataTest[i].IsSamplingData = true; - else - this.CollectionWeightDataTest[i].IsSamplingData = false; - } - } + // SamplingData Check + data = receiveData.Substring(i * 10, 2); + if (data == "sU" || data == "sO" || data == "sP" || data == "sT") + this.CollectionWeightData[i].IsSamplingData = true; else - { - for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) - { - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - i].JudgmentStatus = - Helper.StringToJudgmentStatus(receiveData.Substring((i - 1) * 9, 2)); - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - i].Weight = - Helper.StringToWeight(receiveData.Substring((i - 1) * 9 + 2, 7), this.SystemConfig.DecimalPlaces); + this.CollectionWeightData[i].IsSamplingData = false; - // SamplingData Check - data = receiveData.Substring((i - 1) * 9, 2); - if (data == "sU" || data == "sO" || data == "sP" || data == "sT") - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - i].IsSamplingData = true; - else - this.CollectionWeightDataTest[this.CollectionWeightDataTest.Count - i].IsSamplingData = false; + // Weight Limit Check + if (data == "sa" || data == "sj") + { + if (weightLimit.ToString().Length == 0) + weightLimit.Append(string.Format("#{0}", i + 1)); + else + { + weightLimit.Append(", "); + weightLimit.Append(string.Format("#{0}", i + 1)); } } - #endregion + if (weightLimit.ToString().Length != 0) + this.ChildFormMainDisplay.UpdateDisplayPinchPointAlarm(weightLimit.ToString()); } - else + } + else + { + for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) { - #region FormMainDisplay - if (this.SystemConfig.IsWeightViewForward == true) - { - for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) - { - this.CollectionWeightData[i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring(i * 9, 2)); - this.CollectionWeightData[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 9 + 2, 7), this.SystemConfig.DecimalPlaces); - this.CollectionWeightData[i].WeightString = receiveData.Substring(i * 9 + 2, 7).Trim(); + this.CollectionWeightData[this.CollectionWeightData.Count - i].JudgmentStatus = Helper.StringToJudgmentStatus(receiveData.Substring((i - 1) * 10, 2)); + this.CollectionWeightData[this.CollectionWeightData.Count - i].Sign = receiveData.Substring((i - 1) * 10 + 2, 1); + this.CollectionWeightData[this.CollectionWeightData.Count - i].WeightString = receiveData.Substring((i - 1) * 10 + 3, 7).Trim(); - // SamplingData Check - data = receiveData.Substring(i * 9, 2); - if (data == "sU" || data == "sO" || data == "sP" || data == "sT") - this.CollectionWeightData[i].IsSamplingData = true; - else - this.CollectionWeightData[i].IsSamplingData = false; - - // Weight Limit Check - if (data == "sa" || data == "sj") - { - if (weightLimit.ToString().Length == 0) - weightLimit.Append(string.Format("#{0}", i + 1)); - else - { - weightLimit.Append(", "); - weightLimit.Append(string.Format("#{0}", i + 1)); - } - } - if (weightLimit.ToString().Length != 0) - this.ChildFormMainDisplay.UpdateDisplayPinchPointAlarm(weightLimit.ToString()); - } - } + // SamplingData Check + data = receiveData.Substring((i - 1) * 10, 2); + if (data == "sU" || data == "sO" || data == "sP" || data == "sT") + this.CollectionWeightData[this.CollectionWeightData.Count - i].IsSamplingData = true; else + this.CollectionWeightData[this.CollectionWeightData.Count - i].IsSamplingData = false; + + // Weight Limit Check + if (data == "sa" || data == "sj") { - for (int i = 1; i <= this.SystemConfig.EquipmentColumns; i++) + if (weightLimit.ToString().Length == 0) + weightLimit.Append(string.Format("#{0}", (this.CollectionWeightData.Count - i) + 1)); + else { - this.CollectionWeightData[this.CollectionWeightData.Count - i].JudgmentStatus = - Helper.StringToJudgmentStatus(receiveData.Substring((i - 1) * 9, 2)); - this.CollectionWeightData[this.CollectionWeightData.Count - i].Weight = - Helper.StringToWeight(receiveData.Substring((i - 1) * 9 + 2, 7), this.SystemConfig.DecimalPlaces); - this.CollectionWeightData[this.CollectionWeightData.Count - i].WeightString = receiveData.Substring((i - 1) * 9 + 2, 7).Trim(); - - // SamplingData Check - data = receiveData.Substring((i - 1) * 9, 2); - if (data == "sU" || data == "sO" || data == "sP" || data == "sT") - this.CollectionWeightData[this.CollectionWeightData.Count - i].IsSamplingData = true; - else - this.CollectionWeightData[this.CollectionWeightData.Count - i].IsSamplingData = false; - - // Weight Limit Check - if (data == "sa" || data == "sj") - { - if (weightLimit.ToString().Length == 0) - weightLimit.Append(string.Format("#{0}", (this.CollectionWeightData.Count - i) + 1)); - else - { - weightLimit.Append(", "); - weightLimit.Append(string.Format("#{0}", (this.CollectionWeightData.Count - i) + 1)); - } - } - if (weightLimit.ToString().Length != 0) - this.ChildFormMainDisplay.UpdateDisplayPinchPointAlarm(weightLimit.ToString()); + weightLimit.Append(", "); + weightLimit.Append(string.Format("#{0}", (this.CollectionWeightData.Count - i) + 1)); } } - - // 생산속도 - try - { - this.CollectionWeightData[0].ProductionSpeed = int.Parse(receiveData.Substring(receiveData.Length - 4, 4).Trim()); - } - catch - { - this.CollectionWeightData[0].ProductionSpeed = 0; - } - #endregion + if (weightLimit.ToString().Length != 0) + this.ChildFormMainDisplay.UpdateDisplayPinchPointAlarm(weightLimit.ToString()); } + } + + // 생산속도 + try + { + this.CollectionWeightData[0].ProductionSpeed = int.Parse(receiveData.Substring(receiveData.Length - 4, 4).Trim()); + } + catch + { + this.CollectionWeightData[0].ProductionSpeed = 0; + } #endregion - if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) + if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormMainDisplay) + { + #region Serial 3 + if (this.SystemConfig.Serial3Mode == 1) // OPT1 - 중량 데이터 피드백 { - #region Serial 3 - if (this.SystemConfig.Serial3Mode == 1) // OPT1 - 중량 데이터 피드백 + // V1.10.0 아남자동기 수정 + // FeedbackEmptyTransfer - 제품 안들어 올때 데이터 전송 여부 + // 중량이 0.3g 이하이면 전송 안함 (제품이 안들어 올때) <- 전체열이 0.3g이하일때 전송안함 + // V3.1.0 HRG 수정 (V1.10.0 기능 삭제) + // Empty중량설정 추가 - 판정이 Empty이면 데이터 전송 안함 + // V3.3.2 + // Empty판정이 1개라도 있으면 데이터 전송 안함 + // V8.0.0 + // Empty 중량설정 이하면 전송 안하도록 수정(바이패스 시 GRD 'P'로 전송되어, 0g 이여도 전송됨 + int cnt = 0; + foreach (WeightData weight in this.CollectionWeightData) { - // V1.10.0 아남자동기 수정 - // FeedbackEmptyTransfer - 제품 안들어 올때 데이터 전송 여부 - // 중량이 0.3g 이하이면 전송 안함 (제품이 안들어 올때) <- 전체열이 0.3g이하일때 전송안함 - // V3.1.0 HRG 수정 (V1.10.0 기능 삭제) - // Empty중량설정 추가 - 판정이 Empty이면 데이터 전송 안함 - // V3.3.2 - // Empty판정이 1개라도 있으면 데이터 전송 안함 - // V8.0.0 - // Empty 중량설정 이하면 전송 안하도록 수정(바이패스 시 GRD 'P'로 전송되어, 0g 이여도 전송됨 - int cnt = 0; - foreach (WeightData weight in this.CollectionWeightData) - { - //if (weight.JudgmentStatus == DataStore.JudgmentStatus.Empty) - // cnt++; + //if (weight.JudgmentStatus == DataStore.JudgmentStatus.Empty) + // cnt++; - if (int.Parse(weight.WeightString) < int.Parse(this.SystemConfig.EmptyWeight)) - cnt++; - } - - if (cnt == 0) - this.SerialCH3STD1(this.CollectionWeightData); + if (int.Parse(weight.WeightString) < int.Parse(this.SystemConfig.EmptyWeight)) + cnt++; } - else if (this.SystemConfig.Serial3Mode == 2) - this.SerialCH3STD2(this.CollectionWeightData); - #endregion - #region FormMainDisplay - this.DataBackup(this.CollectionWeightData); + if (cnt == 0) + this.SerialCH3STD1(this.CollectionWeightData); + } + else if (this.SystemConfig.Serial3Mode == 2) + this.SerialCH3STD2(this.CollectionWeightData); + #endregion - if (this.ChildFormMainDisplay != null) - { - this.ChildFormMainDisplay.UpdateStartWeightDisplay(this.EquipmentStatus, this.CollectionWeightData); - } - #endregion - } - else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormEquipmentTest) + #region FormMainDisplay + this.DataBackup(this.CollectionWeightData); + + if (this.ChildFormMainDisplay != null) { - #region FormEquipmentTest - if (this.ChildFormEquipmentTest != null) - this.ChildFormEquipmentTest.UpdateStartWeightDisplay(this.EquipmentStatus, this.CollectionWeightDataTest); - #endregion - } - else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormSystemSetting) - { - #region FormSystemSetting - if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateStartWeightDisplay(this.EquipmentStatus, this.CollectionWeightData); - #endregion + this.ChildFormMainDisplay.UpdateStartWeightDisplay(this.EquipmentStatus, this.CollectionWeightData); } + #endregion + } + else if (this.SystemConfig.CurrentForm == DataStore.FormStore.FormSystemSetting) + { + #region FormSystemSetting + if (this.ChildFormSystemSetting != null) + this.ChildFormSystemSetting.UpdateStartWeightDisplay(this.EquipmentStatus, this.CollectionWeightData); + #endregion } break; default: @@ -1536,8 +1448,9 @@ namespace INT63DC_6CH.Forms #region Value Assign for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - this.CollectionWeightData[i].Status = Helper.StringToWeightStatus(receiveData.Substring(i * 9, 2)); - this.CollectionWeightData[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 9 + 2, 7), this.SystemConfig.DecimalPlaces); + this.CollectionWeightData[i].Status = Helper.StringToWeightStatus(receiveData.Substring(i * 10, 2)); + this.CollectionWeightData[i].Sign = receiveData.Substring(i * 10 + 2, 1); + this.CollectionWeightData[i].WeightString = receiveData.Substring(i * 10 + 3, 7); } #endregion @@ -1561,8 +1474,9 @@ namespace INT63DC_6CH.Forms #region Value Assign for (int i = 0; i < this.SystemConfig.EquipmentColumns; i++) { - this.CollectionWeightData[i].Status = Helper.StringToWeightStatus(receiveData.Substring(i * 9, 2)); - this.CollectionWeightData[i].Weight = Helper.StringToWeight(receiveData.Substring(i * 9 + 2, 7), this.SystemConfig.DecimalPlaces); + this.CollectionWeightData[i].Status = Helper.StringToWeightStatus(receiveData.Substring(i * 10, 2)); + this.CollectionWeightData[i].Sign = receiveData.Substring(i * 10 + 2, 1); + this.CollectionWeightData[i].WeightString = receiveData.Substring(i * 10 + 3, 7); } #endregion @@ -1578,15 +1492,13 @@ namespace INT63DC_6CH.Forms // 판정설정 그래프 private int ReceiveCommandSG0(string lane, string receiveData) { - int ret = 0, temp = 20; - string time1 = ""; + int ret = 0, temp = 10; switch (lane) { case "A": #region Value Assign - this.CollectionWeightData[0].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); + this.CollectionWeightData[0].WeightString = receiveData.Substring(3, 7); for (int i = 0; i < this.CollectionGraphData.Count; i++) { @@ -1596,12 +1508,11 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[0], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[0], this.CollectionGraphData); break; case "B": #region Value Assign - this.CollectionWeightData[1].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); + this.CollectionWeightData[1].WeightString = receiveData.Substring(3, 7); for (int i = 0; i < this.CollectionGraphData.Count; i++) { @@ -1611,12 +1522,11 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[1], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[1], this.CollectionGraphData); break; case "C": #region Value Assign - this.CollectionWeightData[2].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); + this.CollectionWeightData[2].WeightString = receiveData.Substring(3, 7); for (int i = 0; i < this.CollectionGraphData.Count; i++) { @@ -1626,12 +1536,11 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[2], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[2], this.CollectionGraphData); break; case "D": #region Value Assign - this.CollectionWeightData[3].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); + this.CollectionWeightData[3].WeightString = receiveData.Substring(3, 7); for (int i = 0; i < this.CollectionGraphData.Count; i++) { @@ -1641,12 +1550,11 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[3], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[3], this.CollectionGraphData); break; case "E": #region Value Assign - this.CollectionWeightData[4].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); + this.CollectionWeightData[4].WeightString = receiveData.Substring(3, 7); for (int i = 0; i < this.CollectionGraphData.Count; i++) { @@ -1656,13 +1564,12 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[4], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[4], this.CollectionGraphData); break; case "F": #region Value Assign - this.CollectionWeightData[5].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); - + this.CollectionWeightData[5].WeightString = receiveData.Substring(3, 7); + for (int i = 0; i < this.CollectionGraphData.Count; i++) { this.CollectionGraphData[i] = int.Parse(receiveData.Substring(temp, 7)); @@ -1671,13 +1578,12 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[5], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[5], this.CollectionGraphData); break; case "G": #region Value Assign - this.CollectionWeightData[6].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); - + this.CollectionWeightData[6].WeightString = receiveData.Substring(3, 7); + for (int i = 0; i < this.CollectionGraphData.Count; i++) { this.CollectionGraphData[i] = int.Parse(receiveData.Substring(temp, 7)); @@ -1686,13 +1592,12 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[6], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[6], this.CollectionGraphData); break; case "H": #region Value Assign - this.CollectionWeightData[7].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); - + this.CollectionWeightData[7].WeightString = receiveData.Substring(3, 7); + for (int i = 0; i < this.CollectionGraphData.Count; i++) { this.CollectionGraphData[i] = int.Parse(receiveData.Substring(temp, 7)); @@ -1701,13 +1606,12 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[7], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[7], this.CollectionGraphData); break; case "I": #region Value Assign - this.CollectionWeightData[8].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); - + this.CollectionWeightData[8].WeightString = receiveData.Substring(3, 7); + for (int i = 0; i < this.CollectionGraphData.Count; i++) { this.CollectionGraphData[i] = int.Parse(receiveData.Substring(temp, 7)); @@ -1716,13 +1620,12 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[8], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[8], this.CollectionGraphData); break; case "J": #region Value Assign - this.CollectionWeightData[9].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); - + this.CollectionWeightData[9].WeightString = receiveData.Substring(3, 7); + for (int i = 0; i < this.CollectionGraphData.Count; i++) { this.CollectionGraphData[i] = int.Parse(receiveData.Substring(temp, 7)); @@ -1731,13 +1634,12 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[9], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[9], this.CollectionGraphData); break; case "K": #region Value Assign - this.CollectionWeightData[10].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); - + this.CollectionWeightData[10].WeightString = receiveData.Substring(3, 7); + for (int i = 0; i < this.CollectionGraphData.Count; i++) { this.CollectionGraphData[i] = int.Parse(receiveData.Substring(temp, 7)); @@ -1746,13 +1648,12 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[10], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[10], this.CollectionGraphData); break; case "L": #region Value Assign - this.CollectionWeightData[11].Weight = Helper.StringToWeight(receiveData.Substring(2, 7), this.SystemConfig.DecimalPlaces); - time1 = receiveData.Substring(9, 4); - + this.CollectionWeightData[11].WeightString = receiveData.Substring(3, 7); + for (int i = 0; i < this.CollectionGraphData.Count; i++) { this.CollectionGraphData[i] = int.Parse(receiveData.Substring(temp, 7)); @@ -1761,7 +1662,7 @@ namespace INT63DC_6CH.Forms #endregion if (this.ChildFormSystemSetting != null) - this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[11], this.CollectionGraphData, time1); + this.ChildFormSystemSetting.UpdateGraphDataDisplay(this.EquipmentStatus, this.CollectionWeightData[11], this.CollectionGraphData); break; default: break; @@ -4677,7 +4578,7 @@ namespace INT63DC_6CH.Forms this.CurrentProductItem.UnderRange = this.Current40000ModbusData._40018_UnderRange.ToString(); this.SaveProductFile(this.CurrentProductItem, this.SystemConfig.ProductNumber - 1); - this.TransferProductParameter1(this.SystemConfig.ProductNumber); + this.TransferProductParameter(this.SystemConfig.ProductNumber); this.Update30000ModbusData(); this.ModbusCommonDataSend(); @@ -4727,7 +4628,7 @@ namespace INT63DC_6CH.Forms this.CurrentProductItem.PassRange = this.Current40000ModbusData._40021_PassRange.ToString(); this.SaveProductFile(this.CurrentProductItem, this.SystemConfig.ProductNumber - 1); - this.TransferProductParameter1(this.SystemConfig.ProductNumber); + this.TransferProductParameter(this.SystemConfig.ProductNumber); this.Update30000ModbusData(); this.ModbusCommonDataSend(); @@ -4774,7 +4675,7 @@ namespace INT63DC_6CH.Forms this.CurrentProductItem.OverRange = this.Current40000ModbusData._40024_OverRange.ToString(); this.SaveProductFile(this.CurrentProductItem, this.SystemConfig.ProductNumber - 1); - this.TransferProductParameter1(this.SystemConfig.ProductNumber); + this.TransferProductParameter(this.SystemConfig.ProductNumber); this.Update30000ModbusData(); this.ModbusCommonDataSend(); @@ -4821,7 +4722,7 @@ namespace INT63DC_6CH.Forms this.CurrentProductItem.TareRange = this.Current40000ModbusData._40027_TareWeight.ToString(); this.SaveProductFile(this.CurrentProductItem, this.SystemConfig.ProductNumber - 1); - this.TransferProductParameter1(this.SystemConfig.ProductNumber); + this.TransferProductParameter(this.SystemConfig.ProductNumber); this.Update30000ModbusData(); this.ModbusCommonDataSend(); @@ -7042,7 +6943,8 @@ namespace INT63DC_6CH.Forms this.TrasferSystemParameter(this.SystemConfig); // User List Timer - this.timerUserList.Enabled = true; + if (this.SystemConfig.IsLogin == true) + this.timerUserList.Enabled = true; } #endregion @@ -7088,7 +6990,7 @@ namespace INT63DC_6CH.Forms this.ChildFormSystemSetting.UpdateDisplayProductChangeInfo(this.FlagTimeoutCount); } - this.TransferProductParameter1(this.SystemConfig.ProductNumber); + this.TransferProductParameter(this.SystemConfig.ProductNumber); this.FlagTimeoutCount++; } diff --git a/INT63DC_6CH/Forms/FormMain.resx b/INT63DC_6CH/Forms/FormMain.resx index 099c12f..acd494f 100644 --- a/INT63DC_6CH/Forms/FormMain.resx +++ b/INT63DC_6CH/Forms/FormMain.resx @@ -139,22 +139,22 @@ 899, 17 - 1026, 17 - - - 1155, 17 - - 17, 56 + + 146, 56 + + + 314, 56 + - 192, 56 + 489, 56 - 360, 56 + 657, 56 - 484, 56 + 781, 56 WEBPAD diff --git a/INT63DC_6CH/Forms/FormSystemSetting.cs b/INT63DC_6CH/Forms/FormSystemSetting.cs index fb7336c..ac1995b 100644 --- a/INT63DC_6CH/Forms/FormSystemSetting.cs +++ b/INT63DC_6CH/Forms/FormSystemSetting.cs @@ -429,7 +429,7 @@ namespace INT63DC_6CH.Forms if (this.labelWeightJudgment.Text != value) this.labelWeightJudgment.Text = value; } - public void UpdateGraphDataDisplay(DataStore.EquipmentStatus status, WeightData weightData, Collection values, string time1) + public void UpdateGraphDataDisplay(DataStore.EquipmentStatus status, WeightData weightData, Collection values) { int iValue = 0, temp = 0, inputValue = 0; string sValue = ""; diff --git a/INT63DC_6CH/Version.txt b/INT63DC_6CH/Version.txt index d207e16..4e50ff8 100644 Binary files a/INT63DC_6CH/Version.txt and b/INT63DC_6CH/Version.txt differ