| | |
| | | using HStation.WinFrmUI.Xhs; |
| | | using HStation.WinFrmUI.PhartRelation; |
| | | using HStation.WinFrmUI.Xhs; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | |
| | | { |
| | | InitializeComponent(); |
| | | |
| | | this.hydroParterPropertyCtrl1.SelectCurveEvent += HydroParterPropertyCtrl1_SelectCurveEvent; |
| | | this.hydroParterPropertyCtrl1.SelectPatternEvent += HydroParterPropertyCtrl1_SelectPatternEvent; |
| | | this.hydroParterPropertyCtrl1.ViewCurveEvent += HydroParterPropertyCtrl1_ViewCurveEvent; |
| | | this.hydroParterPropertyCtrl1.SetCurveEvent += HydroParterPropertyCtrl1_SetCurveEvent; |
| | | this.hydroParterPropertyCtrl1.SetPatternEvent += HydroParterPropertyCtrl1_SetPatternEvent; |
| | | this.hydroParterPropertyCtrl1.PropertyValueChangedEvent += HydroParterPropertyCtrl1_PropertyValueChangedEvent; |
| | | this.hydroParterPropertyCtrl1.PropertyValueChangingEvent += HydroParterPropertyCtrl1_PropertyValueChangingEvent; |
| | | this.hydroParterPropertyCtrl1.MatchingDbEvent += HydroParterPropertyCtrl1_MatchingDbEvent; |
| | |
| | | public void InitialData(Func<Yw.Model.HydroModelInfo> hydroInfoFunc) |
| | | { |
| | | _hydroInfoFunc = hydroInfoFunc; |
| | | this.hydroParterPropertyCtrl1.InitialData(hydroInfoFunc); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | this.hydroParterPropertyCtrl1.UpdateRows(); |
| | | } |
| | | |
| | | //查看曲线 |
| | | private void HydroParterPropertyCtrl1_ViewCurveEvent(Yw.Model.HydroParterInfo parterInfo, string curveType) |
| | | { |
| | | var hydroInfo = _hydroInfoFunc?.Invoke(); |
| | | if (hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | 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 ?? 1; |
| | | var dlg = new PumpPerform2dViewDlg(); |
| | | dlg.SetBindingData(pumpId, curveId, speedRatio); |
| | | dlg.ShowDialog(); |
| | | } |
| | | break; |
| | | case Yw.WinFrmUI.HydroCurve.Valve: |
| | | { |
| | | |
| | | } |
| | | break; |
| | | default: break; |
| | | } |
| | | } |
| | | |
| | | //选择曲线 |
| | | private bool HydroParterPropertyCtrl1_SelectCurveEvent(HydroParterPropertyViewModel propViewModel, string curveType) |
| | | private bool HydroParterPropertyCtrl1_SetCurveEvent(HydroParterPropertyViewModel propViewModel, string curveType) |
| | | { |
| | | switch (curveType) |
| | | { |
| | |
| | | var pumpInfo = hydroInfo.Pumps?.Find(x => x.Code == propViewModel.Code); |
| | | |
| | | var input = AssetsMatchingParasHelper.Create(hydroInfo, pumpInfo); |
| | | var dlg = new PumpMainCurveChoiceDlg(); |
| | | var dlg = new PumpSingleMatchingDlg(); |
| | | dlg.SetBindingData(input); |
| | | dlg.ReloadDataEvent += (rhs) => |
| | | { |
| | |
| | | } |
| | | |
| | | //选择模式 |
| | | private bool HydroParterPropertyCtrl1_SelectPatternEvent(HydroParterPropertyViewModel propViewModel, string patternType) |
| | | private bool HydroParterPropertyCtrl1_SetPatternEvent(HydroParterPropertyViewModel propViewModel, string patternType) |
| | | { |
| | | switch (patternType) |
| | | { |
| | |
| | | { |
| | | var pumpInfo = hydroInfo.Pumps?.Find(x => x.Code == parter.Code); |
| | | var input = AssetsMatchingParasHelper.Create(hydroInfo, pumpInfo); |
| | | var dlg = new PumpMainCurveChoiceDlg(); |
| | | var dlg = new PumpSingleMatchingDlg(); |
| | | dlg.SetBindingData(input); |
| | | dlg.ReloadDataEvent += (rhs) => |
| | | { |
| | |
| | | dlg.ShowDialog(); |
| | | } |
| | | break; |
| | | |
| | | case Yw.Hydro.ParterCatalog.Valve://阀门 |
| | | { |
| | | var valveInfo = hydroInfo.Valves?.Find(x => x.Code == parter.Code); |
| | | var input = AssetsMatchingParasHelper.Create(hydroInfo, valveInfo); |
| | | var dlg = new ValveMainCurveChoiceDlg(); |
| | | var dlg = new ValveSingleMatchingDlg(); |
| | | dlg.SetBindingData(input); |
| | | dlg.ReloadDataEvent += (rhs) => |
| | | { |
| | |
| | | dlg.ShowDialog(); |
| | | } |
| | | break; |
| | | |
| | | case Yw.Hydro.ParterCatalog.Pipe://管道 |
| | | { |
| | | |
| | | } |
| | | break; |
| | | |
| | | case Yw.Hydro.ParterCatalog.Elbow://弯头 |
| | | { |
| | | var elbowInfo = hydroInfo.Elbows?.Find(x => x.Code == parter.Code); |
| | |
| | | dlg.ShowDialog(); |
| | | } |
| | | break; |
| | | |
| | | case Yw.Hydro.ParterCatalog.Threelink://三通 |
| | | { |
| | | } |
| | | break; |
| | | |
| | | case Yw.Hydro.ParterCatalog.Fourlink://四通 |
| | | { |
| | | |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |