Пример #1
0
 protected static string InitProjectDir(VNewCase newProject, string projectDir)
 {
     var dir = Path.Combine(newProject.CaseDir, projectDir);
     if (Directory.Exists(dir)) return dir;
     Directory.CreateDirectory(dir);
     return dir;
 }
        //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;
        }
Пример #5
0
 protected string InitCaseDir(VNewCase newProject)
 {
     if (Directory.Exists(newProject.CaseDir)) return newProject.CaseDir;
     Directory.CreateDirectory(newProject.CaseDir);
     return newProject.CaseDir;
 }
Пример #6
0
 public abstract VCase Initialize(VNewCase newProject);