| | |
| | | using Hydro; |
| | | using HydroUI; |
| | | |
| | | namespace PBS.WinFrmUI.Hydro |
| | | { |
| | |
| | | _propertyForm = new PropertyForm(); |
| | | _propertyForm.Dock = DockStyle.Fill; |
| | | this.dockPanelModelProperty.Controls.Add(_propertyForm); |
| | | |
| | | TemplateList.Init(); |
| | | |
| | | GlobalObject.PropertyForm = _propertyForm; |
| | | GlobalObject.map = _mapView; |
| | | } |
| | |
| | | /// </summary> |
| | | private void SaveModelTemplate() |
| | | { |
| | | if ( _vm.Facility == null) |
| | | if (_vm.Facility == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择模板"); |
| | | return; |
| | |
| | | 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()); |
| | | |
| | | } |
| | |
| | | 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); |
| | | |
| | |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | _vm.Facility.ModelInfo = Yw.JsonHelper.Object2Json(_vm.Template); |
| | | |
| | | SaveModelTemplate(); |
| | | return true; |
| | | } |
| | | |
| | |
| | | |
| | | facility.ModelInfo = Yw.JsonHelper.Object2Json(_vm.Template); |
| | | facility.ModelPath = fullPath; |
| | | |
| | | SaveModelTemplate(); |
| | | if (!await BLLFactory<BLL.Facility>.Instance.Update(facility)) |
| | | { |
| | | TipFormHelper.ShowError("新增模型信息失败!"); |