duheng
2025-03-31 be65218617cab71a90a9a05cf488fbb6e206b5c5
WinFrmUI/PBS.WinFrmUI.Hydro/02-quick-modeling/04-model-draw/QuickModelingModelDrawWizardPage.cs
@@ -1,4 +1,4 @@
using Hydro;
using HydroUI;
namespace PBS.WinFrmUI.Hydro
{
@@ -104,8 +104,7 @@
            _propertyForm = new PropertyForm();
            _propertyForm.Dock = DockStyle.Fill;
            this.dockPanelModelProperty.Controls.Add(_propertyForm);
            TemplateList.Init();
            GlobalObject.PropertyForm = _propertyForm;
            GlobalObject.map = _mapView;
        }
@@ -347,7 +346,7 @@
        /// </summary> 
        private void SaveModelTemplate()
        {
            if ( _vm.Facility == null)
            if (_vm.Facility == null)
            {
                TipFormHelper.ShowWarn("请选择模板");
                return;
@@ -360,7 +359,9 @@
            SaveView();
            SetZoom();
             _vm.Facility.ModelInfo = Yw.JsonHelper.Object2Json(_vm.Template);
            _vm.Template.network.CalcLinkMinorLoss();
            _vm.Facility.ModelInfo = Yw.JsonHelper.Object2Json(_vm.Template);
            this._mapView.toolStripButton_save_ButtonClick(1, new EventArgs());
        }
@@ -409,7 +410,7 @@
            var inpFilePath = openFileDlg.FileName;
            var templateFilePath = _vm.Template.FullPath;
            Global.ClearFileReadOnly(templateFilePath);
            HelperC.ClearFileReadOnly(templateFilePath);
            File.Copy(inpFilePath, templateFilePath, true);
            _vm.Template.network.BuildFromInp(templateFilePath);
@@ -616,9 +617,7 @@
            {
                return false;
            }
            _vm.Facility.ModelInfo = Yw.JsonHelper.Object2Json(_vm.Template);
            SaveModelTemplate();
            return true;
        }
@@ -666,7 +665,7 @@
            facility.ModelInfo = Yw.JsonHelper.Object2Json(_vm.Template);
            facility.ModelPath = fullPath;
            SaveModelTemplate();
            if (!await BLLFactory<BLL.Facility>.Instance.Update(facility))
            {
                TipFormHelper.ShowError("新增模型信息失败!");