lixiaojun
2024-12-11 d60d42b1ac40fa619dbe21b5692cbd07d772a0b1
修复水泵批量修改设置
已修改6个文件
211 ■■■■ 文件已修改
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationPumpSingleWorkingChartCtrl.cs 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/14-pipe/HydroPipeListCtrl.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/SetHydroPumpDlg.Designer.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/SetHydroPumpDlg.cs 96 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/SetHydroPumpDlg.resx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.Xhs.Core/02-project/01-import/00-core/ImportXhsProjectHelper.cs
@@ -326,7 +326,16 @@
            }
            //var bimfaceId = await Yw.WinFrmUI.BimfaceHelper.UploadFile(rvtFileInfo.FullName);//上传
            var bimfaceId = 10000894297457; //测试用例  10000884893369  10000894297457
            long bimfaceId = 0;
            if (hydroInfo.Pumps.Count > 6)
            {
                bimfaceId = 10000894297457;
            }
            else
            {
                bimfaceId = 10000884893369;
            }
            //var bimfaceId = 10000894297457; //测试用例  10000884893369  10000894297457
            if (bimfaceId < 1)
            {
                feedBackMsg?.Invoke("Revit模型文件上传失败!!!", Color.Red);
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/11-pump/04-working/SimulationPumpSingleWorkingChartCtrl.cs
@@ -97,6 +97,8 @@
            vm.CurveName = $"装置线";
            vm.Color = Color.Black;
            double startHeadValue = 0;
            var startSourceMonitor = _allMonitorList?
                .Matching(HydroVisualCalcuProp.CalcuHead, new List<string>()
                { HStation.Xhs.Flags.水源,HStation.Xhs.Flags.始端,HStation.Xhs.Flags.默认});
@@ -114,29 +116,30 @@
                    var startHead = startSourceCalcuResult.GetCalcuValue(startSourceMonitor.PropName);
                    if (startHead.HasValue)
                    {
                        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 - startHead.Value, 2);
                                }
                            }
                        }
                        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);
                    }
                }
            }
@@ -176,7 +179,7 @@
                    var outPipeHead = outPipeHeadCalcuResult.GetCalcuValue(outPipeHeadMonitor.PropName);
                    if (outPipeHead.HasValue)
                    {
                        vm.PipeH = Math.Round(outPipeHead.Value, 2);
                        vm.PipeH = Math.Round(outPipeHead.Value - startHeadValue, 2);
                    }
                }
            }
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/14-pipe/HydroPipeListCtrl.cs
@@ -328,12 +328,14 @@
            this.colLength.Visible = true;
            this.colRoughness.Visible = true;
            this.colMinorLoss.Visible = true;
            this.colCalcuFlow.Visible = false;
            this.colCalcuVelocity.Visible = false;
            this.colCalcuHeadLoss.Visible = false;
            this.colHasDb.Visible = true;
            this.colFlags.Visible = true;
            this.colDescription.Visible = true;
            this.colCalcuFlow.Visible = false;
            this.colCalcuVelocity.Visible = false;
            this.colCalcuHeadLoss.Visible = false;
            this.colCalcuMinorLoss.Visible = false;
            this.colCalcuFrictionLoss.Visible = false;
            this.colSet.Visible = true;
        }
@@ -355,11 +357,11 @@
            this.colHasDb.Visible = true;
            this.colFlags.Visible = true;
            this.colDescription.Visible = true;
            this.colCalcuFlow.Visible = true;
            this.colCalcuVelocity.Visible = true;
            this.colCalcuHeadLoss.Visible = true;
            this.colCalcuMinorLoss.Visible = true;
            this.colCalcuFrictionLoss.Visible = true;
            this.colCalcuMinorLoss.Visible = true;
            this.colCalcuHeadLoss.Visible = true;
            this.colCalcuVelocity.Visible = true;
            this.colCalcuFlow.Visible = true;
            this.colSet.Visible = true;
        }
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/SetHydroPumpDlg.Designer.cs
@@ -28,8 +28,8 @@
        /// </summary>
        private void InitializeComponent()
        {
            components = new Container();
            layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
            generalOkAndCancelCtrl1 = new GeneralOkAndCancelCtrl();
            txtRatedN = new DevExpress.XtraEditors.TextEdit();
            txtRatedP = new DevExpress.XtraEditors.TextEdit();
            txtRatedH = new DevExpress.XtraEditors.TextEdit();
@@ -43,8 +43,6 @@
            layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
            layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
            layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
            dxErrorProvider1 = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(components);
            generalOkAndCancelCtrl1 = new GeneralOkAndCancelCtrl();
            layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
            ((ISupportInitialize)layoutControl1).BeginInit();
            layoutControl1.SuspendLayout();
@@ -61,7 +59,6 @@
            ((ISupportInitialize)layoutControlItem5).BeginInit();
            ((ISupportInitialize)layoutControlItem6).BeginInit();
            ((ISupportInitialize)layoutControlItem7).BeginInit();
            ((ISupportInitialize)dxErrorProvider1).BeginInit();
            ((ISupportInitialize)layoutControlItem2).BeginInit();
            SuspendLayout();
            // 
@@ -83,6 +80,17 @@
            layoutControl1.TabIndex = 1;
            layoutControl1.Text = "layoutControl1";
            // 
            // generalOkAndCancelCtrl1
            //
            generalOkAndCancelCtrl1.ButtonCancelMaxSize = new Size(100, 26);
            generalOkAndCancelCtrl1.ButtonCancelMinSize = new Size(100, 26);
            generalOkAndCancelCtrl1.ButtonOkMaxSize = new Size(100, 26);
            generalOkAndCancelCtrl1.ButtonOkMinSize = new Size(100, 26);
            generalOkAndCancelCtrl1.Location = new Point(12, 84);
            generalOkAndCancelCtrl1.Name = "generalOkAndCancelCtrl1";
            generalOkAndCancelCtrl1.Size = new Size(441, 29);
            generalOkAndCancelCtrl1.TabIndex = 9;
            //
            // txtRatedN
            // 
            txtRatedN.Location = new Point(298, 60);
@@ -101,7 +109,7 @@
            // 
            txtRatedP.Location = new Point(76, 60);
            txtRatedP.Name = "txtRatedP";
            txtRatedP.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.False;
            txtRatedP.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
            txtRatedP.Properties.DisplayFormat.FormatString = "{0}kW";
            txtRatedP.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
            txtRatedP.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
@@ -143,7 +151,7 @@
            // 
            txtCurrentHz.Location = new Point(298, 12);
            txtCurrentHz.Name = "txtCurrentHz";
            txtCurrentHz.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.False;
            txtCurrentHz.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
            txtCurrentHz.Properties.DisplayFormat.FormatString = "{0}hz";
            txtCurrentHz.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
            txtCurrentHz.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
@@ -157,6 +165,7 @@
            // 
            imgCmbLinkStatus.Location = new Point(76, 12);
            imgCmbLinkStatus.Name = "imgCmbLinkStatus";
            imgCmbLinkStatus.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
            imgCmbLinkStatus.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) });
            imgCmbLinkStatus.Size = new Size(154, 20);
            imgCmbLinkStatus.StyleController = layoutControl1;
@@ -227,21 +236,6 @@
            layoutControlItem7.Text = "额定转速:";
            layoutControlItem7.TextSize = new Size(52, 14);
            // 
            // dxErrorProvider1
            //
            dxErrorProvider1.ContainerControl = this;
            //
            // generalOkAndCancelCtrl1
            //
            generalOkAndCancelCtrl1.ButtonCancelMaxSize = new Size(100, 26);
            generalOkAndCancelCtrl1.ButtonCancelMinSize = new Size(100, 26);
            generalOkAndCancelCtrl1.ButtonOkMaxSize = new Size(100, 26);
            generalOkAndCancelCtrl1.ButtonOkMinSize = new Size(100, 26);
            generalOkAndCancelCtrl1.Location = new Point(12, 84);
            generalOkAndCancelCtrl1.Name = "generalOkAndCancelCtrl1";
            generalOkAndCancelCtrl1.Size = new Size(441, 29);
            generalOkAndCancelCtrl1.TabIndex = 9;
            //
            // layoutControlItem2
            // 
            layoutControlItem2.Control = generalOkAndCancelCtrl1;
@@ -276,7 +270,6 @@
            ((ISupportInitialize)layoutControlItem5).EndInit();
            ((ISupportInitialize)layoutControlItem6).EndInit();
            ((ISupportInitialize)layoutControlItem7).EndInit();
            ((ISupportInitialize)dxErrorProvider1).EndInit();
            ((ISupportInitialize)layoutControlItem2).EndInit();
            ResumeLayout(false);
        }
@@ -285,7 +278,6 @@
        private DevExpress.XtraLayout.LayoutControl layoutControl1;
        private DevExpress.XtraLayout.LayoutControlGroup Root;
        private DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider dxErrorProvider1;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/SetHydroPumpDlg.cs
@@ -17,32 +17,32 @@
        public event Action<List<Yw.Model.HydroPumpInfo>> ReloadDataEvent;
        //所有部件列表
        private List<Yw.Model.HydroPumpInfo> _allParterList = null;
        private List<Yw.Model.HydroPumpInfo> _allVisualList = null;
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(Yw.Model.HydroPumpInfo parter)
        public void SetBindingData(Yw.Model.HydroPumpInfo visual)
        {
            var allParterList = parter == null ? null : new List<Model.HydroPumpInfo>() { parter };
            SetBindingData(allParterList);
            var allVisualList = visual == null ? null : new List<Model.HydroPumpInfo>() { visual };
            SetBindingData(allVisualList);
        }
        /// <summary>
        /// 绑定数据
        /// </summary>
        public void SetBindingData(List<Yw.Model.HydroPumpInfo> allParterList)
        public void SetBindingData(List<Yw.Model.HydroPumpInfo> allVisualList)
        {
            _allParterList = allParterList;
            if (_allParterList != null && _allParterList.Count == 1)
            _allVisualList = allVisualList;
            if (_allVisualList != null && _allVisualList.Count == 1)
            {
                var parter = _allParterList.First();
                this.imgCmbLinkStatus.EditValue = parter.LinkStatus;
                this.txtCurrentHz.EditValue = Math.Round(parter.RatedHz * parter.SpeedRatio, 1);
                this.txtRatedQ.EditValue = parter.RatedQ;
                this.txtRatedH.EditValue = parter.RatedH;
                this.txtRatedP.EditValue = parter.RatedP;
                this.txtRatedN.EditValue = parter.RatedN;
                var visual = _allVisualList.First();
                this.imgCmbLinkStatus.EditValue = visual.LinkStatus;
                this.txtCurrentHz.EditValue = Math.Round(visual.RatedHz * visual.SpeedRatio, 1);
                this.txtRatedQ.EditValue = visual.RatedQ;
                this.txtRatedH.EditValue = visual.RatedH;
                this.txtRatedP.EditValue = visual.RatedP;
                this.txtRatedN.EditValue = visual.RatedN;
            }
        }
@@ -56,55 +56,47 @@
            this.imgCmbLinkStatus.Properties.EndUpdate();
        }
        //验证
        private bool Valid()
        {
            this.dxErrorProvider1.ClearErrors();
            if (this.imgCmbLinkStatus.EditValue == null)
            {
                this.dxErrorProvider1.SetError(this.imgCmbLinkStatus, "必选项");
                return false;
            }
            if (this.txtCurrentHz.EditValue == null)
            {
                this.dxErrorProvider1.SetError(this.txtCurrentHz, "必填项");
                return false;
            }
            if (this.txtRatedP.EditValue == null)
            {
                this.dxErrorProvider1.SetError(this.txtRatedP, "必填项");
                return false;
            }
            return true;
        }
        //确定
        private void GeneralOkAndCancelCtrl1_OkEvent()
        {
            if (_allParterList == null || _allParterList.Count < 1)
            if (_allVisualList == null || _allVisualList.Count < 1)
            {
                return;
            }
            if (!Valid())
            {
                return;
            }
            var linkStatus = this.imgCmbLinkStatus.EditValue.ToString();
            var currentHz = double.Parse(this.txtCurrentHz.EditValue.ToString());
            var linkStatus = this.imgCmbLinkStatus.EditValue?.ToString();
            double? currentHz = this.txtCurrentHz.EditValue == null ? null : double.Parse(this.txtCurrentHz.EditValue.ToString());
            double? ratedQ = this.txtRatedQ.EditValue == null ? null : double.Parse(this.txtRatedQ.EditValue.ToString());
            double? ratedH = this.txtRatedH.EditValue == null ? null : double.Parse(this.txtRatedH.EditValue.ToString());
            var ratedP = double.Parse(this.txtRatedP.EditValue.ToString());
            double? ratedP = this.txtRatedP.EditValue == null ? null : double.Parse(this.txtRatedP.EditValue.ToString());
            double? ratedN = this.txtRatedN.EditValue == null ? null : double.Parse(this.txtRatedN.EditValue.ToString());
            _allParterList.ForEach(x =>
            _allVisualList.ForEach(x =>
            {
                x.LinkStatus = linkStatus;
                x.SpeedRatio = currentHz / x.RatedHz;
                x.RatedQ = ratedQ;
                x.RatedH = ratedH;
                x.RatedP = ratedP;
                x.RatedN = ratedN;
                if (!string.IsNullOrEmpty(linkStatus))
                {
                    x.LinkStatus = linkStatus;
                }
                if (currentHz.HasValue)
                {
                    x.SpeedRatio = currentHz.Value / x.RatedHz;
                }
                if (ratedQ.HasValue)
                {
                    x.RatedQ = ratedQ.Value;
                }
                if (ratedH.HasValue)
                {
                    x.RatedH = ratedH.Value;
                }
                if (ratedP.HasValue)
                {
                    x.RatedP = ratedP.Value;
                }
                if (ratedN.HasValue)
                {
                    x.RatedN = ratedN.Value;
                }
            });
            this.ReloadDataEvent?.Invoke(_allParterList);
            this.ReloadDataEvent?.Invoke(_allVisualList);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-visual/16-pump/SetHydroPumpDlg.resx
@@ -117,7 +117,4 @@
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <metadata name="dxErrorProvider1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    <value>17, 17</value>
  </metadata>
</root>