| | |
| | | using DevExpress.XtraEditors; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | using Yw.Geometry; |
| | | using System.Data; |
| | | using Yw.Pump; |
| | | using Yw.Vmo; |
| | | using Yw.WinFrmUI.Phart; |
| | |
| | | |
| | | private HydroWorkingVmo _working = null; |
| | | private Yw.Model.HydroModelInfo _hydroInfo = null; |
| | | private List<HydroMonitorVmo> _allMonitorList = null; |
| | | private Dictionary<string, HydroCalcuVisualResult> _allCalcuResultVisualDict = null; |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData |
| | | (HydroWorkingVmo working, Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) |
| | | ( |
| | | HydroWorkingVmo working, |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | List<HydroMonitorVmo> allMonitorList, |
| | | HydroCalcuResult calcuResult |
| | | ) |
| | | { |
| | | var allCalcuResultVisualDict = calcuResult.GetVisualDict(); |
| | | SetBindingData(working, hydroInfo, allCalcuResultVisualDict); |
| | | SetBindingData(working, hydroInfo, allMonitorList, allCalcuResultVisualDict); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData |
| | | (HydroWorkingVmo working, Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuResultVisualDict) |
| | | ( |
| | | HydroWorkingVmo working, |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | List<HydroMonitorVmo> allMonitorList, |
| | | Dictionary<string, HydroCalcuVisualResult> allCalcuResultVisualDict |
| | | ) |
| | | { |
| | | _working = working; |
| | | _hydroInfo = hydroInfo; |
| | | _allMonitorList = allMonitorList; |
| | | _allCalcuResultVisualDict = allCalcuResultVisualDict; |
| | | var vm = CreateViewModel(); |
| | | SetBindingData(vm); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData(PumpWorkingViewViewModel vm) |
| | | { |
| | | this.pumpWorkingViewChart1.SetBindingData(vm); |
| | |
| | | } |
| | | this.barCkE.Checked = this.pumpWorkingViewChart1.QEVisible; |
| | | } |
| | | |
| | | |
| | | |
| | | //创建 |
| | | private PumpWorkingViewViewModel CreateViewModel() |
| | |
| | | vm.CurveName = $"装置线"; |
| | | vm.Color = Color.Black; |
| | | |
| | | vm.StartH = 2; |
| | | var head = _hydroInfo.GetHead(); |
| | | var pipeQ = _hydroInfo.GetPipeQ(_allCalcuResultVisualDict); |
| | | var pipeH = _hydroInfo.GetPipeHead(_allCalcuResultVisualDict); |
| | | |
| | | vm.StartH = head; |
| | | vm.PipeQ = pipeQ ?? 0; |
| | | vm.PipeH = pipeH ?? 0; |
| | | |
| | | if (_hydroInfo.Pumps != null && _hydroInfo.Pumps.Count > 0) |
| | | { |
| | |
| | | vmItem.E = calcuResult.CalcuE; |
| | | } |
| | | vmItem.Hz = Math.Round(pump.SpeedRatio * pump.RatedHz, 1); |
| | | vmItem.N = pump.RatedN.HasValue ? Math.Round(pump.SpeedRatio * pump.RatedN.Value, 1) : 0; |
| | | vmItem.N = pump.RatedN > 0 ? Math.Round(pump.SpeedRatio * pump.RatedN, 1) : 0; |
| | | |
| | | |
| | | var curveqh = _hydroInfo.Curves?.Find(x => x.Code == pump.CurveQH); |
| | |
| | | if (qh_pts != null && qh_pts.Count > 3) |
| | | { |
| | | var qh_run_pts = qh_pts.GetQHPointListByN(pump.RatedHz, vmItem.Hz); |
| | | vmItem.CurveQH = new CubicSpline2d(qh_run_pts); |
| | | vmItem.CurveQH = qh_run_pts; |
| | | } |
| | | } |
| | | |
| | |
| | | if (qp_pts != null && qp_pts.Count > 3) |
| | | { |
| | | var qp_run_pts = qp_pts.GetQPPointListByN(pump.RatedHz, vmItem.Hz); |
| | | vmItem.CurveQP = new CubicSpline2d(qp_run_pts); |
| | | vmItem.CurveQP = qp_run_pts; |
| | | } |
| | | } |
| | | |
| | |
| | | if (qe_pts != null && qe_pts.Count > 3) |
| | | { |
| | | var qe_run_pts = qe_pts.GetQEPointListByN(pump.RatedHz, vmItem.Hz); |
| | | vmItem.CurveQE = new CubicSpline2d(qe_run_pts); |
| | | vmItem.CurveQE = qe_run_pts; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | vm.PipeQ = vm.Items.Sum(t => t.Q); |
| | | vm.PipeH = vm.Items.Max(t => t.H); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | this.pumpWorkingViewChart1.SetChartAxis(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="fileName"></param> |
| | | public void ExportToImage(string fileName) |
| | | { |
| | | this.pumpWorkingViewChart1.ExportToImage(fileName); |
| | | } |
| | | |
| | | } |
| | | } |