duheng
2025-03-20 bc0ed5b6cfda6c72c06f451b77da8518c41ab210
WinFrmUI/PBS.WinFrmUI.Hydro/01-model-template/00-core/ModelTemplatePage.cs
@@ -50,7 +50,7 @@
            _propertyForm = new PropertyForm();
            _propertyForm.Dock = DockStyle.Fill;
            this.dockPanelProperty.Controls.Add(_propertyForm);
            this.dockPanelModelProperty.Controls.Add(_propertyForm);
            GlobalObject.PropertyForm = _propertyForm;
            GlobalObject.map = _mapView;
@@ -101,6 +101,7 @@
            template.network = new MapViewNetWork();
            template.network.BuildFromInp(Path.Combine(Directory.GetCurrentDirectory(), _template.filePath));
            _mapView.SetData(template);
        }
@@ -139,6 +140,7 @@
            temp.BackGroundPoint1 = new PointF(0, 0);
            _mapView._Template = temp;
            _mapView.SetMapInvalidate();
        }
        #region Event
@@ -316,6 +318,7 @@
                _template.view.zoom = _mapView.zoom;
                _template.view.rotation = _mapView.Rotation;
                _template.view.rotationF = _mapView.RotationF;
            }
        }
@@ -339,17 +342,6 @@
            if (_template == null)
            {
                return;
                //if (_template == null)
                //{
                //    _template = new Template()
                //    {
                //        ID = _modelTemplate.ID.ToString(),
                //        Name = _modelTemplate.Name,
                //        Type = _modelTemplate.TemplateType,
                //        filePath = _modelTemplate.ModelPath,
                //    };
                //    _template.network = new MapViewNetWork();
                //}
            }
            var openFileDlg = new OpenFileDialog();
            openFileDlg.Filter = "INP文件|*.inp";
@@ -366,6 +358,7 @@
            _template.network.BuildFromInp(templateFilePath);
            _mapView.SetData(_template);
        }
@@ -484,6 +477,7 @@
            _mapView.SetMapInvalidate();
        }
        private void barBtnFrontView_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            SetFrontView();
@@ -521,6 +515,7 @@
        #endregion
    }
}