コード例 #1
0
        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()));
        }
コード例 #2
0
        //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"));
        }