From f57ef0a2a49cce867454fa928780340b82d2834a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Tue, 19 Mar 2024 21:44:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=AD=98=E5=82=A8Plc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Forms/SystemSetting/ParaSettingForm.cs | 35 +++++++++++++++++++ .../ExtendedControls/MyParaControl.cs | 35 +++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/ProductionSystem/Forms/SystemSetting/ParaSettingForm.cs b/ProductionSystem/Forms/SystemSetting/ParaSettingForm.cs index eb5c575..e50f30c 100644 --- a/ProductionSystem/Forms/SystemSetting/ParaSettingForm.cs +++ b/ProductionSystem/Forms/SystemSetting/ParaSettingForm.cs @@ -82,6 +82,8 @@ namespace ProductionSystem.Forms.SystemSetting myparaControls[j].MaxText = paraConfig.MaxVal?.ToString(); myparaControls[j].MinText = paraConfig.MinVal?.ToString(); myparaControls[j].CkIsActiveChecked = paraConfig.IsMust; + myparaControls[j].WaitTime = paraConfig.WaitTime.ToString(); + myparaControls[j].TestTime = paraConfig.TestTime.ToString(); } } } @@ -299,6 +301,39 @@ namespace ProductionSystem.Forms.SystemSetting } #endregion + + #region 下限值 + var waitTimeTxt = myparaControls[j].WaitTime.Trim(); + if (!string.IsNullOrEmpty(waitTimeTxt)) + { + bool minParseResult = decimal.TryParse(waitTimeTxt, out decimal minVal); + if (minParseResult) + { + t_ParaConfig.WaitTime = Convert.ToInt32(minVal); + } + else + { + errorMsg += $"下限值:【{waitTimeTxt}】格式错误!"; + } + } + #endregion + + #region 下限值 + var testTimeTxt = myparaControls[j].TestTime.Trim(); + if (!string.IsNullOrEmpty(testTimeTxt)) + { + bool minParseResult = decimal.TryParse(testTimeTxt, out decimal minVal); + if (minParseResult) + { + t_ParaConfig.TestTime = Convert.ToInt32(minVal); + } + else + { + errorMsg += $"下限值:【{testTimeTxt}】格式错误!"; + } + } + #endregion + if (!string.IsNullOrEmpty(errorMsg)) { errorMsg.Insert(0, groupControls[i].Text); diff --git a/ProductionSystem_UserControl/ExtendedControls/MyParaControl.cs b/ProductionSystem_UserControl/ExtendedControls/MyParaControl.cs index 9a168a0..07ea74f 100644 --- a/ProductionSystem_UserControl/ExtendedControls/MyParaControl.cs +++ b/ProductionSystem_UserControl/ExtendedControls/MyParaControl.cs @@ -104,6 +104,41 @@ namespace ProductionSystem_UserControl.ExtendedControls + + private string _waitTime = ""; + + public string WaitTime + { + get + { + return this.txtWaitTime.Text; + } + set + { + _waitTestText = value; + txtWaitTime.Text = _waitTime; + } + } + + + + private string _testTime = ""; + + public string TestTime + { + get + { + return this.txtTestTime.Text; + } + set + { + _testTime = value; + txtTestTime.Text = _testTime; + } + } + + + private string _waitTimeText = ""; [Category("自定义属性"), Description("等待时间")] public string WaitTimeText