using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace DPumpHydr.WinFrmUI.Volute { public partial class MainViewPage { ctrlSectionBundleInfo _ctrlSectionBundleInfo = null; ctrlSectionShapeInfo18 _ctrlSectionShapeInfo18 = null; ViewModel.SectionBundleInfo _sectionBundleInfo = null; /// /// /// /// private bool SaveParaStep2() { string error_info; var sectionBaseInfo = _ctrlSectionBundleInfo.GetBindingData(out error_info); if (sectionBaseInfo == null) { MessageBox.Show(error_info); return false; } _sectionBundleInfo = sectionBaseInfo; return true; } /// /// /// /// private void EnterStep2(long last_step_id) { if (_hdrBaseInfo == null || _geomBaseInfo == null) return; this._occDesign2dCtrl.RemoveThicknessBody(); this._occDesign2dCtrl.RemoveWaterBody(); this._occDesign2dCtrl.RemoveSectCurve910(); this._occDesign2dCtrl.RemoveMidCurve(); this._occDesign2dCtrl.SetAllSectionCurveVisible(true); this._occDesign2dCtrl.FitView(); this._occDesign3dCtrl.RemoveThicknessBody(); this._occDesign3dCtrl.RemoveWaterBody(); this._occDesign3dCtrl.RemoveSectCurve910(); this._occDesign3dCtrl.RemoveMidCurve(); this._occDesign3dCtrl.SetAllSectionCurveVisible(true); this._occDesign3dCtrl.FitView(); CreateSectionStepCtrl(); _isHaveCreateWaterBody3d = false; DPumpHydr.ViewModel.eWizardStepDiretion step_direction = DPumpHydr.ViewModel.eWizardStepDiretion.前进; if (last_step_id > this._stepTreeDockPanel.Step_ID_Section18_Full) step_direction = DPumpHydr.ViewModel.eWizardStepDiretion.后退; _ctrlSectionBundleInfo.ShowPage(_hdrBaseInfo, _geomBaseInfo, step_direction,true); DockStepParaCtrl(_ctrlSectionBundleInfo); this._sectAreaDockPanel.RefreshControl(); this._sectAreaDockPanel.Visible = true; } private void CreateSectionStepCtrl() { if (_ctrlSectionBundleInfo == null) { _ctrlSectionBundleInfo = new ctrlSectionBundleInfo(); _ctrlSectionBundleInfo.Name = "ctrlSectionBaseInfo"; _ctrlSectionBundleInfo.OnRefreshShape += RefreshSectShapeWhole18; _ctrlSectionBundleInfo.OnHightLightSectCurve += HightLightSectCurve; _ctrlSectionBundleInfo.OnNextStep += () => { GoNextStep(); }; } } /// /// 更新1-8 /// /// private List RefreshSectShapeWhole18(ViewModel.SectionBundleInfo bundle) { var ret = this._occDesign3dCtrl.RefreshAllSectShape18(bundle); this._occDesign2dCtrl.RefreshAllSectShape18(bundle); this._sectAreaDockPanel.SetArea18(bundle); if (ret == null || ret.Count() == 0) { this._sectionBundleInfo = bundle; } return ret; } /// /// 高亮某个截面 /// /// private void HightLightSectCurve(int sectIndex) { this._occDesign2dCtrl.HightLightSectCurve(sectIndex); this._occDesign3dCtrl.HightLightSectCurve(sectIndex); } //更新单个断面 private void RefreshSectShapeSingle18(ViewModel.SectionShapePara para) { this._sectionBundleInfo.FromSectionShapePara(para); this._occDesign3dCtrl.RefreshSingleSectShape18(para); this._occDesign2dCtrl.RefreshSingleSectShape18(para); this._sectAreaDockPanel.SetArea18(para); } } }