duheng
2024-10-23 085da0012271d1178d8de33113e862a35d2ba7d1
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-pump/PumpFullInfoViewDlg.cs
@@ -105,34 +105,6 @@
            this.popupMenu1.ShowPopup(MousePosition);
        }
        private void bbi导出安装图_ItemClick(object sender, ItemClickEventArgs e)
        {
        }
        private void bbi导出性能曲线_ItemClick(object sender, ItemClickEventArgs e)
        {
        }
        private void bbi下载BIM文件_ItemClick(object sender, ItemClickEventArgs e)
        {
        }
        private void bbi导出属性表_ItemClick(object sender, ItemClickEventArgs e)
        {
        }
        private void navBtn选型报告_ElementClick(object sender, DevExpress.XtraBars.Navigation.NavElementEventArgs e)
        {
        }
        private void navBtn手机页面_ElementClick(object sender, DevExpress.XtraBars.Navigation.NavElementEventArgs e)
        {
        }
        private void navBtn寿命成本计算_ElementClick(object sender, DevExpress.XtraBars.Navigation.NavElementEventArgs e)
        {
        }
        #region 最大最小按钮操作
        private void tileNavPane1_MouseDown(object sender, MouseEventArgs e)
@@ -358,6 +330,53 @@
        //表格编辑
        private void BarButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            var dlg = new Yw.WinFrmUI.Phart.ImportPumpPerform2dByExcelDlg();
            dlg.ReloadDataEvent += async (other_name, qh, qe, qp) =>
            {
                var bol = await Import(other_name, qh, qe, qp);
                return bol;
            };
            dlg.ShowDialog();
        }
        //泵型号属性编辑
        private void BarBtnEditProp_ItemClick(object sender, ItemClickEventArgs e)
        {
            var dlg = new EditPumpPartPropDlg();
            dlg.SetBindingData(PumpPropViewCtrl.GetPumpMainVmo());
            dlg.ShowDialog();
            this.pumpFullInfoCtrl1.RefreshPropData();
        }
        //泵型号重新匹配
        private void BarBtnRefreshMatching_ItemClick(object sender, ItemClickEventArgs e)
        {
            var dlg = new PumpSingleMatchingDlg();
            dlg.SetBindingData(_pumpMatchingView);
            dlg.ReloadDataEvent += (matching) =>
            {
                _pumpMatchingView = matching;
                ReloadDataEvent.Invoke(_pumpMatchingView);
                this.SetBindindData(_pumpMatchingView);
            };
            dlg.ShowDialog();
        }
        //单点编辑
        private void BarButtonItemOnePoint_ItemClick(object sender, ItemClickEventArgs e)
        {
            var dlg = new Yw.WinFrmUI.Phart.ImportPumpPerform2dByOnePointDlg();
            dlg.ReloadDataEvent += async (other_name, qh, qe, qp) =>
            {
                var bol = await Import(other_name, qh, qe, qp);
                return bol;
            };
            dlg.ShowDialog();
        }
        //曲线编辑
        private void BarButtonItemEdit_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (_xhs_phart_diagram_ex_std_dto == null)
            {
                return;
@@ -416,38 +435,71 @@
                    graph_qe,
                    graph_qp,
                };
                Yw.Geometry.Point2d point2D = new Yw.Geometry.Point2d();
                var bol = await _bll_ex.Update(_xhs_phart_diagram_ex_std_dto);
                if (bol)
                {
                    // var pump_main = await new BLL.AssetsPumpMain().GetByID(_PumpId);
                    //    this.pumpFullInfoCtrl1.InitChart(_pump_main, _xhs_phart_diagram_ex_std_dto);
                }
                return bol;
            };
            dlg.ShowDialog();
        }
        //泵型号属性编辑
        private void BarBtnEditProp_ItemClick(object sender, ItemClickEventArgs e)
        //图片编辑
        private void BarButtonItemPicture_ItemClick(object sender, ItemClickEventArgs e)
        {
            var dlg = new EditPumpPartPropDlg();
            dlg.SetBindingData(PumpPropViewCtrl.GetPumpMainVmo());
            dlg.ShowDialog();
            this.pumpFullInfoCtrl1.RefreshPropData();
        }
        //泵型号重新匹配
        private void BarBtnRefreshMatching_ItemClick(object sender, ItemClickEventArgs e)
        // 导入
        private async Task<bool> Import(string other_name, Yw.Pump.CurveQH qh, Yw.Pump.CurveQE qe, Yw.Pump.CurveQP qp)
        {
            var dlg = new PumpSingleMatchingDlg();
            dlg.SetBindingData(_pumpMatchingView);
            dlg.ReloadDataEvent += (matching) =>
            if (_PumpId < 1)
            {
                _pumpMatchingView = matching;
                ReloadDataEvent.Invoke(_pumpMatchingView);
                this.SetBindindData(_pumpMatchingView);
                XtraMessageBox.Show("PumpMain is null!");
                return false;
            }
            var input = new Vmo.XhsPumpMainPhartMappingExtensions();
            input.PumpMainID = _PumpId;
            input.Importance = 0;
            input.OtherName = other_name;
            input.Diagram = new Vmo.PhartDiagramExGraphList()
            {
                DiagramType = HStation.PhartRelation.eDiagramType.Feat,
                Name = other_name,
                GraphList = new List<Vmo.PhartGraph>()
                {
                    new ()
                    {
                        Name = other_name+"-QH",
                        GeometryStyle=  HStation.PhartRelation.eGeometryStyle.FeatCurve,
                        GraphType= HStation.PhartRelation.eGraphType.PumpQH,
                        GeometryInfo=qh.ToDbString()
                    },
                    new ()
                    {
                        Name = other_name+"-QE",
                        GeometryStyle= HStation.PhartRelation.eGeometryStyle.FeatCurve,
                        GraphType= HStation.PhartRelation.eGraphType.PumpQE,
                        GeometryInfo=qe.ToDbString()
                    },
                    new ()
                    {
                        Name = other_name+"-QP",
                        GeometryStyle=  HStation.PhartRelation.eGeometryStyle.FeatCurve,
                        GraphType= HStation.PhartRelation.eGraphType.PumpQP,
                        GeometryInfo=qp.ToDbString()
                    },
                }
            };
            dlg.ShowDialog();
            var mapping_id = await _bll_ex.Insert(input);
            if (mapping_id < 1)
            {
                return false;
            }
            var xhs_phart_diagram_ex_std_dto = await _bll_ex.GetByID(mapping_id);
            return true;
        }
    }
}