예제 #1
0
 protected string InitCaseDir(VNewCase newProject)
 {
     if (Directory.Exists(newProject.CaseDir))
     {
         return(newProject.CaseDir);
     }
     Directory.CreateDirectory(newProject.CaseDir);
     return(newProject.CaseDir);
 }
예제 #2
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);
        }
예제 #3
0
        //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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
 public abstract VCase Initialize(VNewCase newProject);