From 2538101febc78f525945da72c7cdcb2589f9e6ea Mon Sep 17 00:00:00 2001 From: tx <123456> Date: 星期四, 10 四月 2025 17:37:33 +0800 Subject: [PATCH] 添加无产品测试 --- TProduct.WinFrmUI/TProduct.WinFrmUI.TPump/MainPage性能测试/FeatTestIngMainPage_Setting.cs | 68 ++++++++++++++++++---------------- 1 files changed, 36 insertions(+), 32 deletions(-) diff --git "a/TProduct.WinFrmUI/TProduct.WinFrmUI.TPump/MainPage\346\200\247\350\203\275\346\265\213\350\257\225/FeatTestIngMainPage_Setting.cs" "b/TProduct.WinFrmUI/TProduct.WinFrmUI.TPump/MainPage\346\200\247\350\203\275\346\265\213\350\257\225/FeatTestIngMainPage_Setting.cs" index e4c2b76..86f171d 100644 --- "a/TProduct.WinFrmUI/TProduct.WinFrmUI.TPump/MainPage\346\200\247\350\203\275\346\265\213\350\257\225/FeatTestIngMainPage_Setting.cs" +++ "b/TProduct.WinFrmUI/TProduct.WinFrmUI.TPump/MainPage\346\200\247\350\203\275\346\265\213\350\257\225/FeatTestIngMainPage_Setting.cs" @@ -35,39 +35,29 @@ MessageBox.Show("杩樻湭璁剧疆item鍙傛暟"); return; } - if (pump == null) - { - MessageBox.Show("杩樻湭璁剧疆pump鍙傛暟"); - return; - } - if (part == null) - { - MessageBox.Show("杩樻湭璁剧疆part鍙傛暟"); - return; - } - if (string.IsNullOrEmpty(pump.RatedParas)) - { - MessageBox.Show("杩樻湭璁剧疆娉电殑棰濆畾鍙傛暟"); - return; - } this._workBenchInfo = workBench; this._testItem = item; this._currentPump = pump; this._currentPart = part; - this._ratedParas = TProduct.Model.RatedParas4Pump.ToModel(pump.RatedParas); - if (_currentPump.MotorMainID.HasValue && _currentPump.MotorMainID > 0) + if (_currentPump != null) { - _currentMotor = new BLL.ProductMotor().GetExByProductID((long)_currentPump.MotorMainID); + this._ratedParas = TProduct.Model.RatedParas4Pump.ToModel(pump.RatedParas); + if (_currentPump.MotorMainID.HasValue && _currentPump.MotorMainID > 0) + { + _currentMotor = new BLL.ProductMotor().GetExByProductID((long)_currentPump.MotorMainID); + } + this._currentPumpSeries = new BLL.ProductSeries().GetByID(this._currentPump.SeriesID); + if (this._currentPumpSeries == null) + { + MessageBox.Show("褰撳墠娉靛搴旂郴鍒楁湭鎵惧埌"); + return; + } } - this._currentPumpSeries = new BLL.ProductSeries().GetByID(this._currentPump.SeriesID); - if (this._currentPumpSeries == null) - { - MessageBox.Show("褰撳墠娉靛搴旂郴鍒楁湭鎵惧埌"); - return; - } + + if (TProduct.CorpSetting.PumpTest.IsRefreshAdditionInfo) { @@ -82,10 +72,14 @@ ribbonPageGroup寮�鍋滄満.Visible = false; bsiOperateInfo.Caption = ""; - this._isInnerMotor = _currentPumpSeries.IsInnerMotor == 1 ? true : false; + if(_currentPumpSeries != null) + { + this._isInnerMotor = _currentPumpSeries.IsInnerMotor == 1 ? true : false; - //鍒濆鍖栨搷浣滄彁绀� - InitialNoticeList(); + //鍒濆鍖栨搷浣滄彁绀� + InitialNoticeList(); + } + @@ -112,9 +106,9 @@ _monitorValveIngRecordHelper = new MonitorValveIngRecordHelper(); _monitorValveIngRecordHelper.Initial( TProduct.Model.eProductType.Pump, - this._currentPumpSeries.ID, - this._currentPump.ID, - this._currentPart.ID, + this._currentPumpSeries == null ? 0 : this._currentPumpSeries.ID, + this._currentPump == null ? 0 : this._currentPump.ID, + this._currentPart == null ? 0 : this._currentPart.ID, this._testItem, this._workBenchInfo, this._allMonitorPointList); @@ -167,8 +161,17 @@ //閫氳鏃ュ織(鏀惧湪鏈�鍚�) InitialLinkLogCtrl(); - bbiPumpName.Caption = string.Format("娉礗D:{0},鍨嬪彿:{1}", pump.ID, pump.Name); - TProduct.LogHelper.Test(string.Format("寮�濮嬭繘琛屾�ц兘娴嬭瘯,娉靛瀷鍙�:{0}", pump.Name)); + if(pump == null) + { + bbiPumpName.Caption = string.Format("娉礗D:{0},鍨嬪彿:{1}", 0, "鏈煡"); + TProduct.LogHelper.Test(string.Format("寮�濮嬭繘琛屾�ц兘娴嬭瘯,娉靛瀷鍙�:{0}", "鏈煡")); + } + else + { + bbiPumpName.Caption = string.Format("娉礗D:{0},鍨嬪彿:{1}", pump.ID, pump.Name); + TProduct.LogHelper.Test(string.Format("寮�濮嬭繘琛屾�ц兘娴嬭瘯,娉靛瀷鍙�:{0}", pump.Name)); + } + } /// <summary> @@ -178,6 +181,7 @@ private void InitialNoticeList() { bbi娉ㄦ剰浜嬮」.Enabled = false; + if (this._currentPumpSeries == null) { return; } var productStyle = new BLL.ProductStyle().GetByID(this._currentPumpSeries.ProductStyleID); if (productStyle == null) return; -- Gitblit v1.9.3