Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0
| | |
| | | System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-Hans"); |
| | | |
| | | //å¤çæªæè·çå¼å¸¸ |
| | | //Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); |
| | | Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); |
| | | //å¤çUI线ç¨å¼å¸¸ |
| | | //Application.ThreadException += Application_ThreadException; |
| | | Application.ThreadException += Application_ThreadException; |
| | | //å¤çéUI线ç¨å¼å¸¸ |
| | | //AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; |
| | | AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; |
| | | |
| | | Application.EnableVisualStyles(); |
| | | Application.SetCompatibleTextRenderingDefault(false); |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Yw.Service.Hydro.Core" Version="3.8.9" /> |
| | | <PackageReference Include="Yw.Service.Hydro.Core" Version="3.9.0" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Yw.Geometry.Core" Version="3.2.9" /> |
| | | <PackageReference Include="Yw.Service.Hydro.Core" Version="3.8.6" /> |
| | | <PackageReference Include="Yw.Service.Hydro.Core" Version="3.9.0" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | /// </summary> |
| | | public event Action<HydroVisualInfo> FlowEffectPropertyValueChangedEvent; |
| | | |
| | | #endregion äºä»¶é |
| | | #endregion |
| | | |
| | | #region 屿§èµå¼ |
| | | |
| | |
| | | set { this.hydroVisualPropertyCtrl1.SelectedObject = value; } |
| | | } |
| | | |
| | | #endregion 屿§èµå¼ |
| | | /// <summary> |
| | | /// 计ç®ç»æ |
| | | /// </summary> |
| | | public Func<HydroCalcuResult> CalcuResult { get; set; } |
| | | |
| | | #endregion |
| | | |
| | | #region 屿§æ´æ° |
| | | |
| | |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | } |
| | | |
| | | #endregion 屿§æ´æ° |
| | | #endregion |
| | | |
| | | #region äºä»¶å®ç° |
| | | |
| | |
| | | pumpViewModel.UpdateProperty(); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | }; |
| | | dlg.SetBindingData(pumpViewModel); |
| | | dlg.SetBindingData(pumpViewModel, this.CalcuResult?.Invoke()); |
| | | dlg.ShowDialog(); |
| | | } |
| | | break; |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion äºä»¶å®ç° |
| | | #endregion |
| | | |
| | | #region äºä»¶ç©¿é |
| | | |
| | |
| | | this.FlowEffectPropertyValueChangedEvent?.Invoke(vm?.Vmo); |
| | | } |
| | | |
| | | #endregion äºä»¶ç©¿é |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | var overlay = this.ShowOverlay(); |
| | | WaitFormHelper.ShowWaitForm(this.FindForm(), "æ£å¨å è½½æ¨¡åæ°æ®ï¼è¯·ç¨å..."); |
| | | //var overlay = this.ShowOverlay(); |
| | | if (!_gettingHydroInfoDict.TryAdd(key, true)) |
| | | { |
| | | _gettingHydroInfoDict[key] = true; |
| | |
| | | //var hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(relation.ModelID); |
| | | var hydroInfo = await HStation.BLL.XhsHydroInfo.GetByID(relation.ModelID); |
| | | _gettingHydroInfoDict[key] = false; |
| | | overlay.Close(); |
| | | |
| | | //overlay.Close(); |
| | | WaitFormHelper.HideWaitForm(); |
| | | return hydroInfo; |
| | | } |
| | | |
| | |
| | | using Castle.Core.Logging; |
| | | using DevExpress.CodeParser; |
| | | using DevExpress.Diagram.Core.Native; |
| | | using DevExpress.Mvvm.Native; |
| | | using DevExpress.Utils.MVVM; |
| | |
| | | } |
| | | if (_bimfaceCtrl == null) |
| | | { |
| | | var overlay = this.ShowOverlay(); |
| | | _bimfaceCtrl = new SimulationBimfaceCtrl(); |
| | | _bimfaceCtrl.Dock = DockStyle.Fill; |
| | | WaitFormHelper.ShowWaitForm(this.FindForm(), "æ£å¨å 载模åï¼è¯·ç¨å..."); |
| | | await _bimfaceCtrl.InitialData(_project, _projectSite); |
| | | _bimfaceCtrl.LoadCompletedEvent += () => |
| | | {//viewå è½½å®æäºä»¶ |
| | | overlay.Close(); |
| | | WaitFormHelper.HideWaitForm(); |
| | | this.barCkDecorator.Checked = false; |
| | | this.barCkGrading.Checked = true; |
| | | }; |
| | |
| | | _propertyCtrl = new SimulationPropertyCtrl(); |
| | | _propertyCtrl.Dock = DockStyle.Fill; |
| | | _propertyCtrl.AllowEdit = true; |
| | | _propertyCtrl.CalcuResult = () => GetCalcuResult(); |
| | | _propertyCtrl.HydroViewEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Property); |
| | |
| | | return; |
| | | } |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var allMonitorList = await monitorHelper.GetAll(); |
| | | var allMonitorList = await monitorHelper.GetAnalyseList(); |
| | | var dlg = new SetHydroMonitorAnalyseListDlg(); |
| | | dlg.ReloadDataEvent += async (list) => |
| | | { |
| | |
| | | this.docPnlBottom.Text = "çæµåæ"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | var allMontorList = await GetMonitorList(); |
| | | var allMontorList = await GetMonitorAnalyseList(); |
| | | if (allWorkingList == null || allWorkingList.Count < 1) |
| | | { |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, GetCalcuResult()); |
| | |
| | | using System.Windows.Forms; |
| | | using Yw.Geometry; |
| | | using Yw.Pump; |
| | | using Yw.Vmo; |
| | | using Yw.WinFrmUI.Phart; |
| | | |
| | | namespace HStation.WinFrmUI |
| | |
| | | |
| | | private Yw.Model.HydroModelInfo _hydroInfo = null; |
| | | private Yw.Model.HydroPumpInfo _pumpInfo = null; |
| | | private HydroCalcuResult _calcuResult = null; |
| | | private double _head = 0;// |
| | | |
| | | |
| | | /// <summary> |
| | | /// ç»å®æ°æ® |
| | | /// </summary> |
| | | public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroPumpInfo pumpInfo) |
| | | public void SetBindingData |
| | | ( |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | Yw.Model.HydroPumpInfo pumpInfo, |
| | | HydroCalcuResult calcuResult |
| | | ) |
| | | { |
| | | if (hydroInfo == null) |
| | | { |
| | |
| | | } |
| | | _hydroInfo = hydroInfo; |
| | | _pumpInfo = pumpInfo; |
| | | _calcuResult = calcuResult; |
| | | _head = _hydroInfo.GetHead(); |
| | | this.hydroSinglePumpListExtendGridCtrl1.SetBindingData(pumpInfo); |
| | | var allStateList = this.hydroSinglePumpListExtendGridCtrl1.GetStateList(); |
| | | var vm = CreateViewModel(allStateList); |
| | | this.pumpOperationChart1.SetBindingData(vm); |
| | | if (calcuResult != null) |
| | | { |
| | | var allCalcuVisualDict = calcuResult.GetVisualDict(); |
| | | var calcuVisualResult = allCalcuVisualDict?.GetValue(pumpInfo.Code) as HydroCalcuPumpResult; |
| | | if (calcuVisualResult != null) |
| | | { |
| | | if (calcuVisualResult.CalcuQ.HasValue) |
| | | { |
| | | this.txtDesignQ.EditValue = Math.Round(calcuVisualResult.CalcuQ.Value, 1); |
| | | } |
| | | if (calcuVisualResult.CalcuH.HasValue) |
| | | { |
| | | this.txtDesignH.EditValue = Math.Round(calcuVisualResult.CalcuH.Value, 2); |
| | | } |
| | | if (calcuVisualResult.CalcuQ.HasValue && calcuVisualResult.CalcuH.HasValue) |
| | | { |
| | | Design(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //ç¶ææ¹åäºä»¶ |
| | |
| | | //è®¾è®¡ç¹ |
| | | private void btnDesign_Click(object sender, EventArgs e) |
| | | { |
| | | Design(); |
| | | } |
| | | |
| | | //设计 |
| | | private void Design() |
| | | { |
| | | var qtext = this.txtDesignQ.Text.Trim(); |
| | | if (string.IsNullOrEmpty(qtext)) |
| | | { |
| | |
| | | } |
| | | var q = double.Parse(qtext); |
| | | var h = double.Parse(htext); |
| | | this.pumpOperationChart1.SetDesignPoint(q, h); |
| | | this.pumpOperationChart1.SetDesignPoint(q, h, _head); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// ç»å®æ°æ® |
| | | /// </summary> |
| | | public void SetBindingData(HydroPumpViewModel pumpViewModel) |
| | | public void SetBindingData(HydroPumpViewModel pumpViewModel, HydroCalcuResult calcuResult) |
| | | { |
| | | if (pumpViewModel == null) |
| | | { |
| | | return; |
| | | } |
| | | SetBindingData(pumpViewModel.HydroInfo, pumpViewModel.Vmo); |
| | | SetBindingData(pumpViewModel.HydroInfo, pumpViewModel.Vmo, calcuResult); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç»å®æ°æ® |
| | | /// </summary> |
| | | public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroPumpInfo pumpInfo) |
| | | public void SetBindingData |
| | | ( |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | Yw.Model.HydroPumpInfo pumpInfo, |
| | | HydroCalcuResult calcuResult |
| | | ) |
| | | { |
| | | this.simulationSinglePumpFeatCtrl1.SetBindingData(hydroInfo, pumpInfo); |
| | | this.simulationSinglePumpFeatCtrl1.SetBindingData(hydroInfo, pumpInfo, calcuResult); |
| | | } |
| | | |
| | | private void SimulationPumpFeatDlg_FormClosing(object sender, FormClosingEventArgs e) |
| | |
| | | barTxtQ.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right; |
| | | barTxtQ.Caption = "æµé:"; |
| | | barTxtQ.Edit = repositoryItemTextEdit1; |
| | | barTxtQ.EditWidth = 80; |
| | | barTxtQ.EditWidth = 100; |
| | | barTxtQ.Id = 3; |
| | | barTxtQ.Name = "barTxtQ"; |
| | | barTxtQ.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph; |
| | |
| | | barTxtH.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right; |
| | | barTxtH.Caption = "æ¬ç¨:"; |
| | | barTxtH.Edit = repositoryItemTextEdit2; |
| | | barTxtH.EditWidth = 80; |
| | | barTxtH.EditWidth = 100; |
| | | barTxtH.Id = 5; |
| | | barTxtH.Name = "barTxtH"; |
| | | barTxtH.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph; |
| | |
| | | barTxtP.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right; |
| | | barTxtP.Caption = "åç:"; |
| | | barTxtP.Edit = repositoryItemTextEdit3; |
| | | barTxtP.EditWidth = 80; |
| | | barTxtP.EditWidth = 100; |
| | | barTxtP.Id = 6; |
| | | barTxtP.Name = "barTxtP"; |
| | | barTxtP.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph; |
| | |
| | | barTxtE.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right; |
| | | barTxtE.Caption = "æç:"; |
| | | barTxtE.Edit = repositoryItemTextEdit4; |
| | | barTxtE.EditWidth = 80; |
| | | barTxtE.EditWidth = 100; |
| | | barTxtE.Id = 7; |
| | | barTxtE.Name = "barTxtE"; |
| | | barTxtE.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph; |
| | |
| | | barDockControlTop.Dock = DockStyle.Top; |
| | | barDockControlTop.Location = new Point(0, 0); |
| | | barDockControlTop.Manager = barManager1; |
| | | barDockControlTop.Size = new Size(818, 24); |
| | | barDockControlTop.Size = new Size(907, 24); |
| | | // |
| | | // barDockControlBottom |
| | | // |
| | |
| | | barDockControlBottom.Dock = DockStyle.Bottom; |
| | | barDockControlBottom.Location = new Point(0, 535); |
| | | barDockControlBottom.Manager = barManager1; |
| | | barDockControlBottom.Size = new Size(818, 0); |
| | | barDockControlBottom.Size = new Size(907, 0); |
| | | // |
| | | // barDockControlLeft |
| | | // |
| | |
| | | // |
| | | barDockControlRight.CausesValidation = false; |
| | | barDockControlRight.Dock = DockStyle.Right; |
| | | barDockControlRight.Location = new Point(818, 24); |
| | | barDockControlRight.Location = new Point(907, 24); |
| | | barDockControlRight.Manager = barManager1; |
| | | barDockControlRight.Size = new Size(0, 511); |
| | | // |
| | |
| | | pumpRunViewChart1.Location = new Point(0, 24); |
| | | pumpRunViewChart1.Margin = new Padding(2, 2, 2, 2); |
| | | pumpRunViewChart1.Name = "pumpRunViewChart1"; |
| | | pumpRunViewChart1.Size = new Size(818, 511); |
| | | pumpRunViewChart1.QEVisible = true; |
| | | pumpRunViewChart1.QPVisble = true; |
| | | pumpRunViewChart1.RunPointVisible = true; |
| | | pumpRunViewChart1.Size = new Size(907, 511); |
| | | pumpRunViewChart1.TabIndex = 4; |
| | | // |
| | | // SimulationPumpAnalyChartCtrl |
| | |
| | | Controls.Add(barDockControlBottom); |
| | | Controls.Add(barDockControlTop); |
| | | Name = "SimulationPumpAnalyChartCtrl"; |
| | | Size = new Size(818, 535); |
| | | Size = new Size(907, 535); |
| | | ((ISupportInitialize)barManager1).EndInit(); |
| | | ((ISupportInitialize)repositoryItemTextEdit1).EndInit(); |
| | | ((ISupportInitialize)repositoryItemTextEdit2).EndInit(); |
| | |
| | | public SimulationPumpAnalyChartCtrl() |
| | | { |
| | | InitializeComponent(); |
| | | this.pumpRunViewChart1.RunPointSelectedEvent += PumpRunViewChart1_RunPointSelectedEvent; |
| | | } |
| | | |
| | | private Yw.Model.HydroModelInfo _hydroInfo = null;//æ°´åä¿¡æ¯ |
| | |
| | | this.pumpRunViewChart1.SetChartAxis(); |
| | | } |
| | | |
| | | private void PumpRunViewChart1_RunPointSelectedEvent(PumpRunViewItemViewModel obj) |
| | | { |
| | | SetCurrent(obj); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | vm.CurveName = $"è£
置线"; |
| | | vm.Color = Color.Black; |
| | | |
| | | var head = _hydroInfo.GetHead(); |
| | | var pipeQ = _hydroInfo.GetPipeQ(_allCalcuResultVisualDict); |
| | | var pipeH = _hydroInfo.GetPipeHead(_allCalcuResultVisualDict); |
| | | |
| | | double startHeadValue = 0; |
| | | var startSourceMonitor = _allMonitorList? |
| | | .Matching(HydroVisualCalcuProp.CalcuHead, new List<string>() |
| | | { HStation.Xhs.Flags.æ°´æº,HStation.Xhs.Flags.å§ç«¯,HStation.Xhs.Flags.é»è®¤}); |
| | | if (startSourceMonitor == null) |
| | | { |
| | | startSourceMonitor = _allMonitorList? |
| | | .Matching(HydroVisualCalcuProp.CalcuHead, new List<string>() |
| | | { HStation.Xhs.Flags.æ°´æº,HStation.Xhs.Flags.å§ç«¯}); |
| | | } |
| | | if (startSourceMonitor != null) |
| | | { |
| | | var startSourceCalcuResult = _allCalcuResultVisualDict?.GetValue(startSourceMonitor.Relation); |
| | | if (startSourceCalcuResult != null) |
| | | { |
| | | var startHead = startSourceCalcuResult.GetCalcuValue(startSourceMonitor.PropName); |
| | | if (startHead.HasValue) |
| | | { |
| | | startHeadValue = startHead.Value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | var endSourceMonitor = _allMonitorList? |
| | | .Matching(HydroVisualCalcuProp.CalcuHead, new List<string>() |
| | | { HStation.Xhs.Flags.æ°´æº,HStation.Xhs.Flags.æ«ç«¯,HStation.Xhs.Flags.é»è®¤}); |
| | | if (endSourceMonitor == null) |
| | | { |
| | | endSourceMonitor = _allMonitorList? |
| | | .Matching(HydroVisualCalcuProp.CalcuHead, new List<string>() |
| | | { HStation.Xhs.Flags.æ°´æº,HStation.Xhs.Flags.æ«ç«¯}); |
| | | } |
| | | if (endSourceMonitor != null) |
| | | { |
| | | var endSouceCalcuResult = _allCalcuResultVisualDict?.GetValue(endSourceMonitor.Relation); |
| | | if (endSouceCalcuResult != null) |
| | | { |
| | | var endHead = endSouceCalcuResult.GetCalcuValue(endSourceMonitor.PropName); |
| | | if (endHead.HasValue) |
| | | { |
| | | vm.StartH = Math.Round(endHead.Value - startHeadValue, 2); |
| | | } |
| | | } |
| | | } |
| | | |
| | | var outPipeFlowMonitor = _allMonitorList?.Matching(HydroVisualCalcuProp.CalcuFlow, new List<string>() |
| | | { HStation.Xhs.Flags.æ»ç®¡,HStation.Xhs.Flags.åºå£,HStation.Xhs.Flags.é»è®¤}); |
| | | if (outPipeFlowMonitor == null) |
| | | { |
| | | outPipeFlowMonitor = _allMonitorList?.Matching(HydroVisualCalcuProp.CalcuFlow, new List<string>() |
| | | { HStation.Xhs.Flags.æ»ç®¡,HStation.Xhs.Flags.åºå£}); |
| | | } |
| | | if (outPipeFlowMonitor != null) |
| | | { |
| | | var outPipeFlowCalcuResult = _allCalcuResultVisualDict?.GetValue(outPipeFlowMonitor.Relation); |
| | | if (outPipeFlowCalcuResult != null) |
| | | { |
| | | var outPipeFlow = outPipeFlowCalcuResult.GetCalcuValue(outPipeFlowMonitor.PropName); |
| | | if (outPipeFlow.HasValue) |
| | | { |
| | | vm.PipeQ = Math.Round(outPipeFlow.Value, 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | var outPipeHeadMonitor = _allMonitorList?.Matching(HydroVisualCalcuProp.CalcuHead, new List<string>() |
| | | { HStation.Xhs.Flags.æ»ç®¡,HStation.Xhs.Flags.åºå£,HStation.Xhs.Flags.é»è®¤}); |
| | | if (outPipeHeadMonitor == null) |
| | | { |
| | | outPipeHeadMonitor = _allMonitorList?.Matching(HydroVisualCalcuProp.CalcuHead, new List<string>() |
| | | { HStation.Xhs.Flags.æ»ç®¡,HStation.Xhs.Flags.åºå£}); |
| | | } |
| | | |
| | | if (outPipeHeadMonitor != null) |
| | | { |
| | | var outPipeHeadCalcuResult = _allCalcuResultVisualDict?.GetValue(outPipeHeadMonitor.Relation); |
| | | if (outPipeHeadCalcuResult != null) |
| | | { |
| | | var outPipeHead = outPipeHeadCalcuResult.GetCalcuValue(outPipeHeadMonitor.PropName); |
| | | if (outPipeHead.HasValue) |
| | | { |
| | | vm.PipeH = Math.Round(outPipeHead.Value - startHeadValue, 2); |
| | | } |
| | | } |
| | | } |
| | | vm.StartH = head; |
| | | vm.PipeQ = pipeQ ?? 0; |
| | | vm.PipeH = pipeH ?? 0; |
| | | |
| | | if (_hydroInfo.Pumps != null && _hydroInfo.Pumps.Count > 0) |
| | | { |
| | |
| | | using Yw.EPAnet; |
| | | using DevExpress.Drawing.Internal.Interop; |
| | | using Yw.EPAnet; |
| | | using Yw.Hydro; |
| | | using Yw.Model; |
| | | |
| | |
| | | private const double _pipe_diameter_default = 500;//管éé»è®¤ç´å¾ |
| | | private const double _pipe_roughness_default = 110;//管éé»è®¤ç²ç³ç³»æ° |
| | | private const double _pipe_minorloss_default = 0.1;//管éé»è®¤ç²ç³ç³»æ° |
| | | //éé¨é»è®¤å±é»ç³»æ° |
| | | private const double _valve_minorloss_default = 0.3d; |
| | | |
| | | private const double _valve_minorloss_default = 0.3d; //éé¨é»è®¤å±é»ç³»æ° |
| | | private const double _resistance_minorloss_default = 9d;//é»ä»¶é»è®¤å±é»ç³»æ° |
| | | |
| | | /// <summary> |
| | | /// ä¿®å¤åæ° |
| | |
| | | } |
| | | } |
| | | |
| | | //é»ä»¶ |
| | | var allResistanceList = hydroInfo.GetAllResistances(); |
| | | if (allResistanceList != null && allResistanceList.Count > 0) |
| | | { |
| | | foreach (var resistance in allResistanceList) |
| | | { |
| | | if (resistance.MinorLoss <= 0) |
| | | { |
| | | resistance.MinorLoss = _resistance_minorloss_default; |
| | | resistance.UpdatePropStatus(nameof(resistance.MinorLoss), ePropStatus.Lack, $"å±é»ç³»æ°ç¼ºçï¼ä½¿ç¨é»è®¤å¼ã{_resistance_minorloss_default}ãä¿®å¤"); |
| | | } |
| | | var startNode = allNodes.Find(x => x.Code == resistance.StartCode); |
| | | if (startNode != null) |
| | | { |
| | | var startPipe = allLinks.Find(x => x.EndCode == startNode.Code) as Yw.Model.HydroPipeInfo; |
| | | if (startPipe != null) |
| | | { |
| | | resistance.Diameter = startPipe.Diameter; |
| | | resistance.UpdatePropStatus(nameof(resistance.Diameter), ePropStatus.Lack, $"ç´å¾ä½¿ç¨ä¸æ¸¸ç®¡éã{startPipe.Code}ãä¿®å¤"); |
| | | } |
| | | else |
| | | { |
| | | var endNode = allNodes.Find(x => x.Code == resistance.EndCode); |
| | | if (endNode != null) |
| | | { |
| | | var endPipe = allLinks.Find(x => x.StartCode == endNode.Code) as Yw.Model.HydroPipeInfo; |
| | | if (endPipe != null) |
| | | { |
| | | resistance.Diameter = endPipe.Diameter; |
| | | resistance.UpdatePropStatus(nameof(resistance.Diameter), ePropStatus.Lack, $"ç´å¾ä½¿ç¨ä¸æ¸¸ç®¡éã{endPipe.Code}ãä¿®å¤"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region è£
ç½®è®¡ç® |
| | | |
| | | /// <summary> |
| | | /// è·åæ¬ç¨ |
| | | /// </summary> |
| | | public static double GetHead(this Yw.Model.HydroModelInfo hydroInfo) |
| | | { |
| | | if (hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | double startHeadValue = 0; |
| | | var allSourceList = hydroInfo.GetAllSources(); |
| | | if (allSourceList != null && allSourceList.Count > 0) |
| | | { |
| | | var startSource = allSourceList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.æ°´æº, |
| | | Yw.Hydro.Flags.å§ç«¯, |
| | | Yw.Hydro.Flags.é»è®¤ |
| | | }); |
| | | if (startSource == null) |
| | | { |
| | | startSource = allSourceList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.æ°´æº, |
| | | Yw.Hydro.Flags.å§ç«¯ |
| | | }); |
| | | } |
| | | if (startSource != null) |
| | | { |
| | | if (startSource is HydroTankInfo tank) |
| | | { |
| | | startHeadValue = tank.PoolElev + tank.InitLevel; |
| | | } |
| | | } |
| | | } |
| | | |
| | | double endHeadValue = 0; |
| | | var allNodeList = hydroInfo.GetAllNodes(); |
| | | if (allNodeList != null && allNodeList.Count > 0) |
| | | { |
| | | var endSource = allNodeList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.æ°´æº, |
| | | Yw.Hydro.Flags.æ«ç«¯, |
| | | Yw.Hydro.Flags.é»è®¤ |
| | | }); |
| | | if (endSource == null) |
| | | { |
| | | endSource = allSourceList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.æ°´æº, |
| | | Yw.Hydro.Flags.æ«ç«¯ |
| | | }); |
| | | } |
| | | if (endSource != null) |
| | | { |
| | | if (endSource is HydroTankInfo tank) |
| | | { |
| | | endHeadValue = tank.PoolElev + tank.InitLevel; |
| | | } |
| | | else if (endSource is HydroEmitterInfo emitter) |
| | | { |
| | | endHeadValue = emitter.Elev; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return endHeadValue - startHeadValue; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæ»ç®¡æµé |
| | | /// </summary> |
| | | public static double? GetPipeQ(this Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) |
| | | { |
| | | return GetPipeQ(hydroInfo, calcuResult?.GetVisualDict()); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæ»ç®¡æµé |
| | | /// </summary> |
| | | public static double? GetPipeQ(this Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuVisualDict) |
| | | { |
| | | if (hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (allCalcuVisualDict == null || allCalcuVisualDict.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var allLinkList = hydroInfo.GetAllLinks(); |
| | | if (allLinkList == null || allLinkList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var link = allLinkList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.æ»ç®¡, |
| | | Yw.Hydro.Flags.åºå£, |
| | | Yw.Hydro.Flags.é»è®¤ |
| | | }); |
| | | if (link == null) |
| | | { |
| | | link = allLinkList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.æ»ç®¡, |
| | | Yw.Hydro.Flags.åºå£ |
| | | }); |
| | | } |
| | | if (link == null) |
| | | { |
| | | return default; |
| | | } |
| | | |
| | | var calcuVisualResult = allCalcuVisualDict.GetValue(link.Code); |
| | | if (calcuVisualResult == null) |
| | | { |
| | | return default; |
| | | } |
| | | var calcuValue = calcuVisualResult.GetCalcuValue(Yw.Hydro.VisualCalcuProp.CalcuFlow); |
| | | if (calcuValue == null) |
| | | { |
| | | return default; |
| | | } |
| | | return Math.Round(Math.Abs(calcuValue.Value), 1); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæ»ç®¡ååï¼ç»å¯¹ååï¼ |
| | | /// </summary> |
| | | public static double? GetPipeHead(this Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult) |
| | | { |
| | | return GetPipeHead(hydroInfo, calcuResult?.GetVisualDict()); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæ»ç®¡ååï¼ç»å¯¹ååï¼ |
| | | /// </summary> |
| | | public static double? GetPipeHead(this Yw.Model.HydroModelInfo hydroInfo, Dictionary<string, HydroCalcuVisualResult> allCalcuVisualDict) |
| | | { |
| | | if (hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (allCalcuVisualDict == null || allCalcuVisualDict.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var allNodeList = hydroInfo.GetAllNodes(); |
| | | if (allNodeList == null || allNodeList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var node = allNodeList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.æ»ç®¡, |
| | | Yw.Hydro.Flags.åºå£, |
| | | Yw.Hydro.Flags.é»è®¤ |
| | | }); |
| | | if (node == null) |
| | | { |
| | | node = allNodeList.Matching(new List<string>() |
| | | { |
| | | Yw.Hydro.Flags.æ»ç®¡, |
| | | Yw.Hydro.Flags.åºå£ |
| | | }); |
| | | } |
| | | if (node == null) |
| | | { |
| | | return default; |
| | | } |
| | | |
| | | var calcuVisualResult = allCalcuVisualDict.GetValue(node.Code); |
| | | if (calcuVisualResult == null) |
| | | { |
| | | return default; |
| | | } |
| | | var calcuValue = calcuVisualResult.GetCalcuValue(Yw.Hydro.VisualCalcuProp.CalcuHead); |
| | | if (calcuValue == null) |
| | | { |
| | | return default; |
| | | } |
| | | return Math.Round(calcuValue.Value, 2); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Yw.Model; |
| | | |
| | | namespace Yw.WinFrmUI |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public static class HydroParterInfoExtensions |
| | | { |
| | | /// <summary> |
| | | /// å¹é
|
| | | /// </summary> |
| | | public static HydroSourceInfo Matching(this List<HydroSourceInfo> allSourceList, List<string> flags) |
| | | { |
| | | if (allSourceList == null || allSourceList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var sourceList = allSourceList.OrderBy(x => x.Flags.Distinct().Count()).ToList(); |
| | | return sourceList.Find(x => x.Flags.ContainsC(flags)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¹é
|
| | | /// </summary> |
| | | public static HydroNodeInfo Matching(this List<HydroNodeInfo> allNodeList, List<string> flags) |
| | | { |
| | | if (allNodeList == null || allNodeList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var nodeList = allNodeList.OrderBy(x => x.Flags.Distinct().Count()).ToList(); |
| | | return nodeList.Find(x => x.Flags.ContainsC(flags)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¹é
|
| | | /// </summary> |
| | | public static HydroLinkInfo Matching(this List<HydroLinkInfo> allLinkList, List<string> flags) |
| | | { |
| | | if (allLinkList == null || allLinkList.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var linkList = allLinkList.OrderBy(x => x.Flags.Distinct().Count()).ToList(); |
| | | return linkList.Find(x => x.Flags.ContainsC(flags)); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | private void InitializeComponent() |
| | | { |
| | | components = new Container(); |
| | | ComponentResourceManager resources = new ComponentResourceManager(typeof(HydroTankListCtrl)); |
| | | DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions(); |
| | | DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject(); |
| | | DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject(); |
| | | DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject(); |
| | | DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject(); |
| | | ComponentResourceManager resources = new ComponentResourceManager(typeof(HydroTankListCtrl)); |
| | | hydroTankViewModelBindingSource = new BindingSource(components); |
| | | layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
| | | generalSearchAndSetCtrl1 = new GeneralSearchAndSetCtrl(); |
| | | gridControl1 = new DevExpress.XtraGrid.GridControl(); |
| | | gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); |
| | | colSet = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); |
| | | colDbLocked = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colCode = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colName = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colCode = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colModelType = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colHasDb = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colPoolElev = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colInitLevel = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colMinLevel = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colMaxLevel = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colDN = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colMinVol = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colCurve = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colOverFlow = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colHasDb = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colFlags = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colCalcuPress = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colCalcuHead = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colCalcuDemand = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colFlags = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colSet = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); |
| | | txtName = new DevExpress.XtraEditors.TextEdit(); |
| | | txtModelType = new DevExpress.XtraEditors.TextEdit(); |
| | | txtCode = new DevExpress.XtraEditors.TextEdit(); |
| | |
| | | // |
| | | // hydroTankViewModelBindingSource |
| | | // |
| | | hydroTankViewModelBindingSource.DataSource = typeof(HydroElbowViewModel); |
| | | hydroTankViewModelBindingSource.DataSource = typeof(HydroTankViewModel); |
| | | // |
| | | // layoutControl1 |
| | | // |
| | |
| | | // |
| | | // gridView1 |
| | | // |
| | | gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colDbLocked, colName, colCode, colModelType, colPoolElev, colInitLevel, colMinLevel, colMaxLevel, colDN, colMinVol, colCurve, colOverFlow, colHasDb, colDescription, colFlags, colCalcuPress, colCalcuHead, colCalcuDemand, colSet }); |
| | | gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colDbLocked, colName, colCode, colModelType, colPoolElev, colInitLevel, colMinLevel, colMaxLevel, colDN, colMinVol, colOverFlow, colHasDb, colDescription, colFlags, colCalcuPress, colCalcuHead, colCalcuDemand, colSet }); |
| | | gridView1.GridControl = gridControl1; |
| | | gridView1.Name = "gridView1"; |
| | | gridView1.RowCellClick += gridView1_RowCellClick; |
| | | // |
| | | // colSet |
| | | // |
| | | colSet.Caption = "设置"; |
| | | colSet.ColumnEdit = repositoryItemButtonEdit1; |
| | | colSet.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Right; |
| | | colSet.MaxWidth = 60; |
| | | colSet.MinWidth = 60; |
| | | colSet.Name = "colSet"; |
| | | colSet.Visible = true; |
| | | colSet.VisibleIndex = 18; |
| | | colSet.Width = 60; |
| | | // |
| | | // repositoryItemButtonEdit1 |
| | | // |
| | | repositoryItemButtonEdit1.AutoHeight = false; |
| | | editorButtonImageOptions1.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("editorButtonImageOptions1.SvgImage"); |
| | | editorButtonImageOptions1.SvgImageSize = new Size(20, 20); |
| | | repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", -1, true, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "设置", "set", null, DevExpress.Utils.ToolTipAnchor.Default) }); |
| | | repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1"; |
| | | repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; |
| | | // |
| | | // colDbLocked |
| | | // |
| | |
| | | colDbLocked.VisibleIndex = 0; |
| | | colDbLocked.Width = 40; |
| | | // |
| | | // colCode |
| | | // |
| | | colCode.FieldName = "Code"; |
| | | colCode.MaxWidth = 150; |
| | | colCode.MinWidth = 100; |
| | | colCode.Name = "colCode"; |
| | | colCode.Visible = true; |
| | | colCode.VisibleIndex = 2; |
| | | colCode.Width = 100; |
| | | // |
| | | // colName |
| | | // |
| | | colName.FieldName = "Name"; |
| | |
| | | colName.VisibleIndex = 1; |
| | | colName.Width = 100; |
| | | // |
| | | // colCode |
| | | // |
| | | colCode.FieldName = "Code"; |
| | | colCode.MaxWidth = 150; |
| | | colCode.MinWidth = 100; |
| | | colCode.Name = "colCode"; |
| | | colCode.Visible = true; |
| | | colCode.VisibleIndex = 2; |
| | | colCode.Width = 100; |
| | | // |
| | | // colModelType |
| | | // |
| | | colModelType.FieldName = "ModelType"; |
| | |
| | | colModelType.Visible = true; |
| | | colModelType.VisibleIndex = 3; |
| | | colModelType.Width = 100; |
| | | // |
| | | // colHasDb |
| | | // |
| | | colHasDb.FieldName = "HasDb"; |
| | | colHasDb.MaxWidth = 40; |
| | | colHasDb.MinWidth = 40; |
| | | colHasDb.Name = "colHasDb"; |
| | | colHasDb.Visible = true; |
| | | colHasDb.VisibleIndex = 12; |
| | | colHasDb.Width = 40; |
| | | // |
| | | // colPoolElev |
| | | // |
| | |
| | | colMinVol.VisibleIndex = 9; |
| | | colMinVol.Width = 100; |
| | | // |
| | | // colCurve |
| | | // |
| | | colCurve.FieldName = "Curve"; |
| | | colCurve.MaxWidth = 100; |
| | | colCurve.MinWidth = 100; |
| | | colCurve.Name = "colCurve"; |
| | | colCurve.Visible = true; |
| | | colCurve.VisibleIndex = 10; |
| | | colCurve.Width = 100; |
| | | // |
| | | // colOverFlow |
| | | // |
| | | colOverFlow.FieldName = "OverFlow"; |
| | |
| | | colOverFlow.MinWidth = 60; |
| | | colOverFlow.Name = "colOverFlow"; |
| | | colOverFlow.Visible = true; |
| | | colOverFlow.VisibleIndex = 11; |
| | | colOverFlow.VisibleIndex = 10; |
| | | colOverFlow.Width = 60; |
| | | // |
| | | // colHasDb |
| | | // |
| | | colHasDb.FieldName = "HasDb"; |
| | | colHasDb.MaxWidth = 40; |
| | | colHasDb.MinWidth = 40; |
| | | colHasDb.Name = "colHasDb"; |
| | | colHasDb.Visible = true; |
| | | colHasDb.VisibleIndex = 11; |
| | | colHasDb.Width = 40; |
| | | // |
| | | // colDescription |
| | | // |
| | | colDescription.FieldName = "Description"; |
| | | colDescription.MinWidth = 100; |
| | | colDescription.Name = "colDescription"; |
| | | colDescription.Visible = true; |
| | | colDescription.VisibleIndex = 13; |
| | | colDescription.Width = 100; |
| | | // |
| | | // colFlags |
| | | // |
| | | colFlags.FieldName = "Flags"; |
| | | colFlags.MaxWidth = 200; |
| | | colFlags.MinWidth = 100; |
| | | colFlags.Name = "colFlags"; |
| | | colFlags.Visible = true; |
| | | colFlags.VisibleIndex = 12; |
| | | colFlags.Width = 100; |
| | | // |
| | | // colCalcuPress |
| | | // |
| | |
| | | colCalcuPress.MinWidth = 100; |
| | | colCalcuPress.Name = "colCalcuPress"; |
| | | colCalcuPress.Visible = true; |
| | | colCalcuPress.VisibleIndex = 15; |
| | | colCalcuPress.VisibleIndex = 14; |
| | | colCalcuPress.Width = 100; |
| | | // |
| | | // colCalcuHead |
| | |
| | | colCalcuHead.MinWidth = 100; |
| | | colCalcuHead.Name = "colCalcuHead"; |
| | | colCalcuHead.Visible = true; |
| | | colCalcuHead.VisibleIndex = 16; |
| | | colCalcuHead.VisibleIndex = 15; |
| | | colCalcuHead.Width = 100; |
| | | // |
| | | // colCalcuDemand |
| | |
| | | colCalcuDemand.MinWidth = 110; |
| | | colCalcuDemand.Name = "colCalcuDemand"; |
| | | colCalcuDemand.Visible = true; |
| | | colCalcuDemand.VisibleIndex = 17; |
| | | colCalcuDemand.VisibleIndex = 16; |
| | | colCalcuDemand.Width = 110; |
| | | // |
| | | // colFlags |
| | | // colSet |
| | | // |
| | | colFlags.FieldName = "Flags"; |
| | | colFlags.MaxWidth = 200; |
| | | colFlags.MinWidth = 100; |
| | | colFlags.Name = "colFlags"; |
| | | colFlags.Visible = true; |
| | | colFlags.VisibleIndex = 13; |
| | | colFlags.Width = 100; |
| | | colSet.Caption = "设置"; |
| | | colSet.ColumnEdit = repositoryItemButtonEdit1; |
| | | colSet.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Right; |
| | | colSet.MaxWidth = 60; |
| | | colSet.MinWidth = 60; |
| | | colSet.Name = "colSet"; |
| | | colSet.Visible = true; |
| | | colSet.VisibleIndex = 17; |
| | | colSet.Width = 60; |
| | | // |
| | | // colDescription |
| | | // repositoryItemButtonEdit1 |
| | | // |
| | | colDescription.FieldName = "Description"; |
| | | colDescription.MinWidth = 100; |
| | | colDescription.Name = "colDescription"; |
| | | colDescription.Visible = true; |
| | | colDescription.VisibleIndex = 14; |
| | | colDescription.Width = 100; |
| | | repositoryItemButtonEdit1.AutoHeight = false; |
| | | editorButtonImageOptions1.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("editorButtonImageOptions1.SvgImage"); |
| | | editorButtonImageOptions1.SvgImageSize = new Size(20, 20); |
| | | repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", -1, true, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "设置", "set", null, DevExpress.Utils.ToolTipAnchor.Default) }); |
| | | repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1"; |
| | | repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; |
| | | // |
| | | // txtName |
| | | // |
| | |
| | | private DevExpress.XtraGrid.Columns.GridColumn colMaxLevel; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colDN; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colMinVol; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colCurve; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colOverFlow; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colCalcuPress; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colCalcuHead; |
| | |
| | | this.colMaxLevel.Visible = false; |
| | | this.colDN.Visible = false; |
| | | this.colMinVol.Visible = false; |
| | | this.colCurve.Visible = false; |
| | | this.colOverFlow.Visible = false; |
| | | this.colCalcuPress.Visible = false; |
| | | this.colCalcuHead.Visible = false; |
| | |
| | | this.colMaxLevel.Visible = true; |
| | | this.colDN.Visible = true; |
| | | this.colMinVol.Visible = true; |
| | | this.colCurve.Visible = true; |
| | | this.colOverFlow.Visible = true; |
| | | this.colCalcuPress.Visible = false; |
| | | this.colCalcuHead.Visible = false; |
| | |
| | | this.colMaxLevel.Visible = true; |
| | | this.colDN.Visible = true; |
| | | this.colMinVol.Visible = true; |
| | | this.colCurve.Visible = true; |
| | | this.colOverFlow.Visible = true; |
| | | this.colCalcuPress.Visible = true; |
| | | this.colCalcuHead.Visible = true; |
| | |
| | | this.colMaxLevel.Visible = true; |
| | | this.colDN.Visible = true; |
| | | this.colMinVol.Visible = true; |
| | | this.colCurve.Visible = true; |
| | | this.colOverFlow.Visible = true; |
| | | this.colCalcuPress.Visible = false; |
| | | this.colCalcuHead.Visible = false; |
| | |
| | | this.colMaxLevel.Visible = true; |
| | | this.colDN.Visible = true; |
| | | this.colMinVol.Visible = true; |
| | | this.colCurve.Visible = true; |
| | | this.colOverFlow.Visible = true; |
| | | this.colCalcuPress.Visible = true; |
| | | this.colCalcuHead.Visible = true; |
| | |
| | | private void InitializeComponent() |
| | | { |
| | | components = new Container(); |
| | | ComponentResourceManager resources = new ComponentResourceManager(typeof(HydroWaterboxListCtrl)); |
| | | DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions(); |
| | | DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject(); |
| | | DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject(); |
| | | DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject(); |
| | | DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject(); |
| | | ComponentResourceManager resources = new ComponentResourceManager(typeof(HydroWaterboxListCtrl)); |
| | | gridControl1 = new DevExpress.XtraGrid.GridControl(); |
| | | hydroWaterboxViewModelBindingSource = new BindingSource(components); |
| | | gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView(); |
| | |
| | | colMaxLevel = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colDN = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colMinVol = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colCurve = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colOverFlow = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colFlags = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colDescription = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colCalcuL = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colSet = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); |
| | | layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
| | |
| | | layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem(); |
| | | colCalcuL = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | colVolCurve = new DevExpress.XtraGrid.Columns.GridColumn(); |
| | | ((ISupportInitialize)gridControl1).BeginInit(); |
| | | ((ISupportInitialize)hydroWaterboxViewModelBindingSource).BeginInit(); |
| | | ((ISupportInitialize)gridView1).BeginInit(); |
| | |
| | | // |
| | | // gridView1 |
| | | // |
| | | gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colDbLocked, colCode, colName, colModelType, colHasDb, colPoolElev, colInitLevel, colMinLevel, colMaxLevel, colDN, colMinVol, colCurve, colOverFlow, colFlags, colDescription, colCalcuL, colSet }); |
| | | gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colDbLocked, colCode, colName, colModelType, colHasDb, colPoolElev, colInitLevel, colMinLevel, colMaxLevel, colDN, colMinVol, colVolCurve, colOverFlow, colFlags, colDescription, colCalcuL, colSet }); |
| | | gridView1.GridControl = gridControl1; |
| | | gridView1.Name = "gridView1"; |
| | | gridView1.RowCellClick += gridView1_RowCellClick; |
| | |
| | | colMinVol.VisibleIndex = 9; |
| | | colMinVol.Width = 90; |
| | | // |
| | | // colCurve |
| | | // |
| | | colCurve.FieldName = "Curve"; |
| | | colCurve.MaxWidth = 80; |
| | | colCurve.MinWidth = 80; |
| | | colCurve.Name = "colCurve"; |
| | | colCurve.Visible = true; |
| | | colCurve.VisibleIndex = 10; |
| | | colCurve.Width = 80; |
| | | // |
| | | // colOverFlow |
| | | // |
| | | colOverFlow.FieldName = "OverFlow"; |
| | |
| | | colOverFlow.MinWidth = 60; |
| | | colOverFlow.Name = "colOverFlow"; |
| | | colOverFlow.Visible = true; |
| | | colOverFlow.VisibleIndex = 11; |
| | | colOverFlow.VisibleIndex = 10; |
| | | colOverFlow.Width = 60; |
| | | // |
| | | // colFlags |
| | |
| | | colDescription.Visible = true; |
| | | colDescription.VisibleIndex = 14; |
| | | colDescription.Width = 100; |
| | | // |
| | | // colCalcuL |
| | | // |
| | | colCalcuL.FieldName = "CalcuL"; |
| | | colCalcuL.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Right; |
| | | colCalcuL.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("colCalcuL.ImageOptions.SvgImage"); |
| | | colCalcuL.ImageOptions.SvgImageSize = new Size(16, 16); |
| | | colCalcuL.MaxWidth = 100; |
| | | colCalcuL.MinWidth = 100; |
| | | colCalcuL.Name = "colCalcuL"; |
| | | colCalcuL.Visible = true; |
| | | colCalcuL.VisibleIndex = 15; |
| | | colCalcuL.Width = 100; |
| | | // |
| | | // colSet |
| | | // |
| | |
| | | layoutControlItem8.TextSize = new Size(0, 0); |
| | | layoutControlItem8.TextVisible = false; |
| | | // |
| | | // colCalcuL |
| | | // colVolCurve |
| | | // |
| | | colCalcuL.FieldName = "CalcuL"; |
| | | colCalcuL.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Right; |
| | | colCalcuL.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("colCalcuL.ImageOptions.SvgImage"); |
| | | colCalcuL.ImageOptions.SvgImageSize = new Size(16, 16); |
| | | colCalcuL.MaxWidth = 100; |
| | | colCalcuL.MinWidth = 100; |
| | | colCalcuL.Name = "colCalcuL"; |
| | | colCalcuL.Visible = true; |
| | | colCalcuL.VisibleIndex = 15; |
| | | colCalcuL.Width = 100; |
| | | colVolCurve.FieldName = "VolCurve"; |
| | | colVolCurve.MaxWidth = 100; |
| | | colVolCurve.MinWidth = 100; |
| | | colVolCurve.Name = "colVolCurve"; |
| | | colVolCurve.Visible = true; |
| | | colVolCurve.VisibleIndex = 11; |
| | | colVolCurve.Width = 100; |
| | | // |
| | | // HydroWaterboxListCtrl |
| | | // |
| | |
| | | private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; |
| | | private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3; |
| | | private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colCurve; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colSet; |
| | | private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit1; |
| | | private GeneralSearchAndSetCtrl generalSearchAndSetCtrl1; |
| | | private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colCalcuL; |
| | | private DevExpress.XtraGrid.Columns.GridColumn colVolCurve; |
| | | } |
| | | } |
| | |
| | | this.colMaxLevel.Visible = false; |
| | | this.colDN.Visible = false; |
| | | this.colMinVol.Visible = false; |
| | | this.colCurve.Visible = false; |
| | | this.colVolCurve.Visible = false; |
| | | this.colOverFlow.Visible = false; |
| | | this.colHasDb.Visible = false; |
| | | this.colFlags.Visible = true; |
| | |
| | | this.colMaxLevel.Visible = true; |
| | | this.colDN.Visible = true; |
| | | this.colMinVol.Visible = true; |
| | | this.colCurve.Visible = true; |
| | | this.colVolCurve.Visible = true; |
| | | this.colOverFlow.Visible = true; |
| | | this.colHasDb.Visible = true; |
| | | this.colFlags.Visible = true; |
| | |
| | | this.colMaxLevel.Visible = true; |
| | | this.colDN.Visible = true; |
| | | this.colMinVol.Visible = true; |
| | | this.colCurve.Visible = true; |
| | | this.colVolCurve.Visible = true; |
| | | this.colOverFlow.Visible = true; |
| | | this.colHasDb.Visible = true; |
| | | this.colFlags.Visible = true; |
| | |
| | | this.colMaxLevel.Visible = true; |
| | | this.colDN.Visible = true; |
| | | this.colMinVol.Visible = true; |
| | | this.colCurve.Visible = true; |
| | | this.colVolCurve.Visible = true; |
| | | this.colOverFlow.Visible = true; |
| | | this.colHasDb.Visible = true; |
| | | this.colFlags.Visible = true; |
| | |
| | | this.colMaxLevel.Visible = true; |
| | | this.colDN.Visible = true; |
| | | this.colMinVol.Visible = true; |
| | | this.colCurve.Visible = true; |
| | | this.colVolCurve.Visible = true; |
| | | this.colOverFlow.Visible = true; |
| | | this.colHasDb.Visible = true; |
| | | this.colFlags.Visible = true; |
| | |
| | | HydroCalcuResult calcuResult |
| | | ) |
| | | { |
| | | |
| | | _hydroInfo = hydroInfo; |
| | | _allMonitorList = allMonitorList; |
| | | _calcuResult = calcuResult; |
| | | InitialSingleColumns(); |
| | | InitialSingleDataTable(); |
| | | var overlay = this.ShowOverlay(); |
| | | this.bindingSource1.DataSource = _dt; |
| | | this.bindingSource1.ResetBindings(false); |
| | | this.gridView1.RefreshData(); |
| | | overlay.Close(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | List<HydroWorkingVmo> allWorkingList |
| | | ) |
| | | { |
| | | |
| | | _hydroInfo = hydroInfo; |
| | | _allMonitorList = allMonitorList; |
| | | _allWorkingList = allWorkingList; |
| | | var overlay = this.ShowOverlay(); |
| | | InitialMultiColumns(); |
| | | InitialMultiDataTable(); |
| | | this.bindingSource1.DataSource = _dt; |
| | | this.bindingSource1.ResetBindings(false); |
| | | this.gridView1.RefreshData(); |
| | | overlay.Close(); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | public HydroSingleWorkingLossCurveCtrl() |
| | | { |
| | | InitializeComponent(); |
| | | InitializeComponent(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | e.CrosshairLineElement.Color = Color.Green; |
| | | e.CrosshairLineElement.LineStyle.DashStyle = DashStyle.DashDot; |
| | | e.CrosshairLineElement.LineStyle.Thickness = 3; |
| | | |
| | | |
| | | |
| | | // Specify the back color for the crosshair argument axis label. |
| | | foreach (CrosshairAxisLabelElement axisLabelElement in e.CrosshairAxisLabelElements) |
| | | { |
| | | axisLabelElement.BackColor = Color.Blue; |
| | | axisLabelElement.Text = $"{axisLabelElement.AxisValue:N2}"; |
| | | axisLabelElement.Text = $"{axisLabelElement.AxisValue:N2}"; |
| | | |
| | | } |
| | | |
| | | |
| | | foreach (CrosshairElementGroup group in e.CrosshairElementGroups) |
| | | { |
| | | CrosshairGroupHeaderElement groupHeaderElement = group.HeaderElement; |
| | | { |
| | | CrosshairGroupHeaderElement groupHeaderElement = group.HeaderElement; |
| | | var pt = group.HeaderElement.SeriesPoints.FirstOrDefault(); |
| | | if (pt != null) |
| | | { |
| | |
| | | { |
| | | groupHeaderElement.Text = model.Name; |
| | | } |
| | | } |
| | | } |
| | | // Specify the text, text color and font for the crosshair group header element. |
| | | |
| | | groupHeaderElement.TextColor = Color.Green; |
| | | groupHeaderElement.DXFont = new DXFont("SegoeUI", 12, DXFontStyle.Bold); |
| | | groupHeaderElement.Text = group.CrosshairElements[0].AxisLabelElement.Text; |
| | | //groupHeaderElement.Text = group.CrosshairElements[0].AxisLabelElement.Text; |
| | | |
| | | foreach (var ele in group.CrosshairElements) |
| | | { |
| | |
| | | ele.AxisLabelElement.DXFont = new DXFont(this.Font.Name, 6); |
| | | //ele.AxisLabelElement.Visible = false; |
| | | } |
| | | |
| | | |
| | | |
| | | //// Obtain the first series. |
| | | //CrosshairElement element = group.CrosshairElements[0]; |
| | |
| | | //ç¼å |
| | | private static List<Color> _cache = new List<Color>() |
| | | { |
| | | Color.Red, Color.Blue, Color.Green,Color.Fuchsia,Color.Maroon,Color.Bisque, |
| | | Color.Red, Color.Blue, Color.Green,Color.Fuchsia,Color.Maroon, |
| | | Color.MidnightBlue, Color.Aquamarine,Color.DodgerBlue, Color.BurlyWood |
| | | }; |
| | | |
| | |
| | | <ItemGroup> |
| | | <PackageReference Include="DevExpress.Win.Design" Version="23.2.4" /> |
| | | <PackageReference Include="Yw.BLL.Basic.Core" Version="3.3.0" /> |
| | | <PackageReference Include="Yw.BLL.Hydro.Core" Version="3.7.1" /> |
| | | <PackageReference Include="Yw.BLL.Hydro.Core" Version="3.7.2" /> |
| | | <PackageReference Include="Yw.Pump.Core" Version="3.1.7" /> |
| | | </ItemGroup> |
| | | |