public string getPositionFromFile() { WebSimulatorModel model = WebSimulatorModel.getInstance(); Tuple <double, double> position = model.getPositionFromFile(); if (position == null) { model.disconnect(); return(ToXML("200,200")); //failure/end } return(ToXML(position.Item1.ToString() + "," + position.Item2.ToString())); }
//loads flight data from database and presents them on map public ActionResult loadFlightData(string filename, int perSec) { WebSimulatorModel model = WebSimulatorModel.getInstance(); if (!model.loadFlightDetails(filename)) { return(View("Error")); } Tuple <double, double> position = model.getPositionFromFile(); if (position == null) { return(View("Error")); } ViewBag.beginLon = position.Item1; ViewBag.beginLat = position.Item2; ViewBag.refreshRate = perSec; return(View("LoadedFromFileView")); }