Пример #1
0
 public ActionResult GeneralPropertiesSave(VGeneralProperties model)
 {
     if (ModelState.IsValid)
     {
         Session["GeneralProperties"] = model;
         if (Request.IsAjaxRequest()) return Json("OK");
         return View(model);
     }
     if (Request.IsAjaxRequest()) return Json("FAIL");
     return View(model);
 }
Пример #2
0
 private void InitGeneralProperties(VGeneralProperties m)
 {
     m.GridPointsX = 1000;
     m.GridPointsY = 1000;
     m.TurbineDiameter = 50;
     m.TurbineHeight = 70;
     m.TurbineThrust = 0.5m;
     m.WakeDecay = 0.02m;
     m.VelocityAtHub = 9m;
     m.AirDensity = 1.225m;
     m.PowerDistance = 0.2m;
     m.RotationAngle = -48.4m;
 }
Пример #3
0
 private VGeneralProperties GetModelGeneral()
 {
     VGeneralProperties model = null;
     if (Session["GeneralProperties"] != null)
     {
         model = Session["GeneralProperties"] as VGeneralProperties;
     }
     if (model == null)
     {
         model = new VGeneralProperties();
         InitGeneralProperties(model);
         Session["GeneralProperties"] = model;
     }
     return model;
 }