public Simulator(double seconds, int timeFrame)
        {
            var failistObject = DataAccessor.DeserializeData();

            Plane           = failistObject.IdPlanes[new Random().Next(0, failistObject.IdPlanes.Length)];
            PlaneType       = failistObject.TypePlane[new Random().Next(0, failistObject.TypePlane.Length)];
            SecondsDuration = seconds;
            TimeFrame       = timeFrame;
            FailureXes      = new List <IdFailureX>(failistObject.IdFailureX);
        }
        public Simulator(List <IdFailureX> idFailureXes, IdPlane idPlane, double seconds, int timeFrame)
        {
            var failistObject = DataAccessor.DeserializeData();

            TimeFrame       = timeFrame;
            Plane           = idPlane;
            PlaneType       = failistObject.TypePlane[new Random().Next(0, failistObject.TypePlane.Length)];
            FailureXes      = idFailureXes;
            SecondsDuration = seconds;
            TimeFrame       = timeFrame;
        }
Esempio n. 3
0
 public ActionResult AddTypePlane(TypePlane tp)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tp).State = EntityState.Added;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View("Index", tp));
     }
 }
Esempio n. 4
0
        public ActionResult AddTypePlane()
        {
            TypePlane tp = new TypePlane();

            return(View(tp));
        }