| | |
| | | this.hydroParterPropertyCtrl1.PropertyValueChangedEvent += HydroParterPropertyCtrl1_PropertyValueChangedEvent; |
| | | this.hydroParterPropertyCtrl1.PropertyValueChangingEvent += HydroParterPropertyCtrl1_PropertyValueChangingEvent; |
| | | this.hydroParterPropertyCtrl1.MatchingDbEvent += HydroParterPropertyCtrl1_MatchingDbEvent; |
| | | this.hydroParterPropertyCtrl1.SetCurveEvent += HydroParterPropertyCtrl1_SetCurveEvent; |
| | | this.hydroParterPropertyCtrl1.SetPatternEvent += HydroParterPropertyCtrl1_SetPatternEvent; |
| | | this.hydroParterPropertyCtrl1.BlinkLinkParterEvent += HydroParterPropertyCtrl1_BlinkLinkParterEvent; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 强调连接组件事件 |
| | |
| | | this.hydroParterPropertyCtrl1.UpdateRows(); |
| | | } |
| | | |
| | | //查看曲线 |
| | | private void HydroParterPropertyCtrl1_ViewCurveEvent(Yw.Model.HydroParterInfo parterInfo, string curveType) |
| | | //选择曲线 |
| | | private bool HydroParterPropertyCtrl1_SetCurveEvent(HydroParterPropertyViewModel propViewModel, string curveType) |
| | | { |
| | | var hydroInfo = _hydroInfoFunc?.Invoke(); |
| | | if (hydroInfo == null) |
| | | { |
| | | return; |
| | | return false; |
| | | } |
| | | switch (curveType) |
| | | { |
| | | case Yw.WinFrmUI.HydroCurve.Pump: |
| | | { |
| | | var pumpInfo = parterInfo as Yw.Model.HydroPumpInfo; |
| | | var curveqh = hydroInfo.Curves?.Find(x => x.Code == pumpInfo.CurveQH); |
| | | if (curveqh == null) |
| | | { |
| | | return; |
| | | } |
| | | var pumpId = string.IsNullOrEmpty(pumpInfo.DbId) ? 0 : Convert.ToInt64(pumpInfo.DbId); |
| | | var curveId = string.IsNullOrEmpty(curveqh.DbId) ? 0 : Convert.ToInt64(curveqh.DbId); |
| | | var speedRatio = pumpInfo.SpeedRatio; |
| | | var dlg = new PumpPerform2dViewDlg(); |
| | | dlg.SetBindingData(pumpId, curveId, speedRatio); |
| | | dlg.ShowDialog(); |
| | | } |
| | | break; |
| | | |
| | | case Yw.WinFrmUI.HydroCurve.Valve: |
| | | { |
| | | } |
| | | break; |
| | | |
| | | default: break; |
| | | } |
| | | } |
| | | |
| | | //选择曲线 |
| | | private bool HydroParterPropertyCtrl1_SetCurveEvent(HydroParterPropertyViewModel propViewModel, string curveType) |
| | | { |
| | | switch (curveType) |
| | | { |
| | | case Yw.WinFrmUI.HydroCurve.Pump: |
| | | { |
| | | var hydroInfo = _hydroInfoFunc?.Invoke(); |
| | | if (hydroInfo == null) |
| | | { |
| | | return false; |
| | | } |
| | | var pumpInfo = hydroInfo.Pumps?.Find(x => x.Code == propViewModel.Code); |
| | | |
| | | var input = AssetsMatchingParasHelper.Create(hydroInfo, pumpInfo, _allHydroCalcuResultListFunc?.Invoke()); |
| | | var dlg = new PumpSingleMatchingDlg(); |
| | | dlg.SetBindingData(input); |
| | | dlg.ReloadDataEvent += (rhs) => |
| | | if (pumpInfo == null) |
| | | { |
| | | var bol = AssetsMatchingParasHelper.Apply(hydroInfo, rhs); |
| | | if (bol) |
| | | { |
| | | TipFormHelper.ShowSucceed("匹配成功"); |
| | | } |
| | | else |
| | | { |
| | | TipFormHelper.ShowWarn("匹配失败"); |
| | | } |
| | | }; |
| | | break; |
| | | } |
| | | var input = AssetsMatchingParasHelper.Create(hydroInfo, pumpInfo, _allHydroCalcuResultListFunc?.Invoke()); |
| | | var dlg = new SinglePumpAnalyDlg(); |
| | | dlg.SetBindindData(input); |
| | | //dlg.ReloadDataEvent += (output) => |
| | | //{ |
| | | // bol = AssetsMatchingParasHelper.Apply(hydroInfo, output); |
| | | // if (bol) |
| | | // { |
| | | // propertyViewModel.UpdateProperty(pumpInfo, hydroInfo.GetAllParters()); |
| | | // } |
| | | //}; |
| | | dlg.ShowDialog(); |
| | | return true; |
| | | } |
| | |
| | | } |
| | | |
| | | var input = AssetsMatchingParasHelper.Create(hydroInfo, pumpInfo, _allHydroCalcuResultListFunc?.Invoke()); |
| | | if (string.IsNullOrEmpty(pumpInfo.DbId)) |
| | | var dlg = new PumpSingleMatchingDlg(); |
| | | dlg.SetBindingData(input); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | var dlg = new PumpSingleMatchingDlg(); |
| | | dlg.SetBindingData(input); |
| | | dlg.ReloadDataEvent += (output) => |
| | | bol = AssetsMatchingParasHelper.Apply(hydroInfo, output); |
| | | if (bol) |
| | | { |
| | | bol = AssetsMatchingParasHelper.Apply(hydroInfo, output); |
| | | if (bol) |
| | | { |
| | | propertyViewModel.UpdateProperty(pumpInfo, hydroInfo.GetAllParters()); |
| | | } |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new SinglePumpAnalyDlg(); |
| | | dlg.SetBindindData(input); |
| | | //dlg.ReloadDataEvent += (output) => |
| | | //{ |
| | | // bol = AssetsMatchingParasHelper.Apply(hydroInfo, output); |
| | | // if (bol) |
| | | // { |
| | | // propertyViewModel.UpdateProperty(pumpInfo, hydroInfo.GetAllParters()); |
| | | // } |
| | | //}; |
| | | dlg.ShowDialog(); |
| | | } |
| | | propertyViewModel.UpdateProperty(pumpInfo, hydroInfo.GetAllParters()); |
| | | } |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | break; |
| | | case Yw.Hydro.ParterCatalog.Valve://阀门 |