Several changes - updated string to route to include coordinates - updated model for flight sim to only contain the closest point - User model now tracks route status... departure etc

This commit is contained in:
2022-02-18 20:38:45 +00:00
parent 10af903706
commit 5316df08a5
9 changed files with 58 additions and 23 deletions

View File

@ -28,11 +28,13 @@ namespace EFB.Controllers
if(user == null) return RedirectToAction("Index", "Home");
//Retrieve the user's latest sim position and construct it into FlightsimModel
if (user.Route == null) return RedirectToAction("Index", "Route");
SimPositionModel latestPosition = await Mongo.GetLatestData(user.EMail);
// RouteModel route = RouteModel.StringToRoute();
RouteModel route = await RouteModel.StringToRoute(user.Departure, user.Arrival, user.Cruise, user.Route);
return View(new FlightsimModel(latestPosition, null));
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]

View File

@ -144,7 +144,7 @@ namespace EFB.Controllers
foreach (var item in responsePoll.Result)
{
if (item.Command == "fpl" || item.Command == "solution")
if (item.Command == "notvalid" || item.Command == "solution")
{
collected = true;
routeString = item.FlightPlan;
@ -177,6 +177,7 @@ namespace EFB.Controllers
user.Route = finalRoute;
user.Departure = departure;
user.Arrival = arrival;
user.Cruise = cruise;
HttpContext.Session.SetObject("User", user);
return RedirectToAction("Index", "Route");