コード例 #1
0
        public ActionResult Display(string ip, int port)
        {
            System.Net.IPAddress p;
            if (System.Net.IPAddress.TryParse(ip, out p) == false)
            {
                // Load Travel
                ViewBag.Filename  = ip;
                ViewBag.Frequency = port;

                return(View("LoadTravel"));
            }
            //get it by the else
            else
            {
                // Display
                InfoModel infoModel = InfoModel.Instance;
                infoModel.Connect(ip, port);

                ViewBag.Coordinate = infoModel.GetCoordinate();

                infoModel.Disconnect();

                return(View());
            }
        }
コード例 #2
0
        public string GetStringRudderThrottle(string ip, int port)
        {
            InfoModel infoModel = InfoModel.Instance;

            infoModel.Connect(ip, port);

            Coordinate coordinate = infoModel.GetRudderThrottle();

            infoModel.Disconnect();

            return(coordinate.Longitude.ToString() + " " + coordinate.Latitude.ToString());
        }