//private static void InitAblPisoSolver(VNewCase newProject, VCase vCase)
        //{
        //    var d = new AblPisoSolver();
        //    var pdir = InitProjectDir(newProject, d.Name);
        //    var proj = new VProject
        //    {
        //        DisplayName = d.Name,
        //        ProjectDir = pdir,
        //        ProjectDescriptor = d,
        //    };
        //    proj.Initialize();
        //    vCase.Items.Add(proj);
        //}

        //private static void InitAblGeometryAndMesh(VNewProject newProject, VCase vCase)
        //{
        //    var d = new AblGeometryAndMesh();
        //    var pdir = InitProjectDir(newProject, d.Name);
        //    var proj = new VProject
        //    {
        //        Name = d.Name,
        //        ProjectDir = pdir,
        //        ProjectDescriptor = d,
        //    };
        //    proj.Initialize();
        //    proj.GetState().Save();
        //    vCase.Items.Add(proj);
        //}

        //private static void InitWindPlant(VNewCase newProject, VCase vCase)
        //{
        //    var d = new WindPlantPisoSolver();
        //    var pdir = InitProjectDir(newProject, d.Name);
        //    var proj = new VProject
        //    {
        //        DisplayName = d.Name,
        //        ProjectDir = pdir,
        //        ProjectDescriptor = d,
        //    };
        //    proj.Initialize();
        //    vCase.Items.Add(proj);
        //}

        private static void InitMesoWind(VNewCase newProject, VCase vCase)
        {
            var d = new MesoWindProjectDescriptor();
            var pdir = InitProjectDir(newProject, d.Name);
            var proj = new VProject
            {
                DisplayName = d.Name,
                ProjectDir = pdir,
                ProjectDescriptor = d,
                ProjectModel = d.CreateProjectModel()
            };
            proj.Initialize();
            vCase.Items.Add(proj);
        }
        public override VCase Initialize(VNewCase newProject)
        {
            var vCase = new VCase();
            vCase.Name = newProject.CaseName;
            vCase.CaseDir = InitCaseDir(newProject);

            InitSowfaNormal(newProject, vCase);
            //InitAblPisoSolver(newProject, vCase);
            //InitWindPlant(newProject, vCase);
            InitMesoWind(newProject, vCase);
            InitWindWave(newProject, vCase);

            CaseHandler.Write(vCase);
            return vCase;
        }
        public override VCase Initialize(VNewCase newProject)
        {
            var vCase = new VCase();
            vCase.Name = newProject.CaseName;
            vCase.CaseDir = InitCaseDir(newProject);
            
            var pdir = InitProjectDir(newProject, newProject.ProjectDescriptor.Name);
            var proj = new VProject
            {
                DisplayName = newProject.ProjectDescriptor.Name,
                ProjectDir = pdir,
                ProjectDescriptor = newProject.ProjectDescriptor,
                ProjectModel = newProject.ProjectDescriptor.CreateProjectModel()
            };
            proj.Initialize();
            vCase.Items.Add(proj);

            CaseHandler.Write(vCase);
            return vCase;
        }
        public override VCase Initialize(VNewCase newProject)
        {
            var vCase = new VCase();

            vCase.Name    = newProject.CaseName;
            vCase.CaseDir = InitCaseDir(newProject);

            var pdir = InitProjectDir(newProject, newProject.ProjectDescriptor.Name);
            var proj = new VProject
            {
                DisplayName       = newProject.ProjectDescriptor.Name,
                ProjectDir        = pdir,
                ProjectDescriptor = newProject.ProjectDescriptor,
                ProjectModel      = newProject.ProjectDescriptor.CreateProjectModel()
            };

            proj.Initialize();
            vCase.Items.Add(proj);

            CaseHandler.Write(vCase);
            return(vCase);
        }
 public void Reset()
 {
     _case = null;
     _items.Clear();
 }
 public void SetCaseModel(VCase vCase)
 {
     _case = vCase;
 }
示例#7
0
        private void StartNewDialog()
        {
            var dlg = new NewCaseDialog2();
            dlg.Owner = this;
            var result = dlg.ShowDialog();
            if (result == null) return;
            if (!result.Value) return;
            try
            {
                DemountEnvironment();

                _case = dlg.Model
                    .ProjectDescriptor
                    .CaseInitializer
                    .Initialize(dlg.Model);

                MountEnvironment();
            }
            catch (Exception ex)
            {
                DemountEnvironment();
                //MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#8
0
        private void DemountEnvironment()
        {
            caseExplorerTree.Reset();

            foreach (var documentPanel in _openDocuments.Values)
            {
                dockLayoutManager1.DockController.RemoveItem(documentPanel);
            }
            _openDocuments.Clear();
            _panelInfos.Clear();

            bbFileClose.IsEnabled = false;
            bbFileSave.IsEnabled = false;
            bbFileSaveAll.IsEnabled = false;
            bbToolsSettings.IsEnabled = false;

            _case = null;
        }