private void cbFpls_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (cbFpls.Items.Count > 0 && cbFpls.SelectedValue != null)
            {
                FlightPlanDatabase.FpdApi fd = new FlightPlanDatabase.FpdApi();
                FlightPlanDatabase.ApiDataTypes.FlightPlanDetails planDetail = fd.getPlan(cbFpls.SelectedValue.ToString().Split(' ').First());
                //FMSControl.CustomFPL.waypoints.Clear();
                List <FMS.fplDetails> fpl = new List <FMS.fplDetails>();
                pApiFpl = new Fds.IFAPI.APIFlightPlan();
                List <Fds.IFAPI.APIWaypoint> apiWpts = new List <Fds.IFAPI.APIWaypoint>();

                foreach (FlightPlanDatabase.ApiDataTypes.Node wpt in planDetail.route.nodes)
                {
                    Fds.IFAPI.APIWaypoint apiWpt = new Fds.IFAPI.APIWaypoint();
                    apiWpt.Name      = wpt.ident;
                    apiWpt.Code      = wpt.name;
                    apiWpt.Latitude  = wpt.lat;
                    apiWpt.Longitude = wpt.lon;
                    apiWpts.Add(apiWpt);

                    FMS.fplDetails n = new FMS.fplDetails();
                    n.WaypointName = wpt.ident;
                    n.Altitude     = wpt.alt;

                    //FMSControl.CustomFPL.waypoints.Add(n);
                    fpl.Add(n);
                }

                pApiFpl.Waypoints = apiWpts.ToArray();

                FmsFpl = fpl;
            }
        }
        private void loadFpdFplFromId(string id)
        {
            FlightPlanDatabase.FpdApi fd = new FlightPlanDatabase.FpdApi();
            FlightPlanDatabase.ApiDataTypes.FlightPlanDetails planDetail = fd.getPlan(id);
            //FMSControl.CustomFPL.waypoints.Clear();
            List <FMS.fplDetails> fpl = new List <FMS.fplDetails>();

            pApiFpl = new Fds.IFAPI.APIFlightPlan();
            List <Fds.IFAPI.APIWaypoint> apiWpts = new List <Fds.IFAPI.APIWaypoint>();

            foreach (FlightPlanDatabase.ApiDataTypes.Node wpt in planDetail.route.nodes)
            {
                Fds.IFAPI.APIWaypoint apiWpt = new Fds.IFAPI.APIWaypoint();
                apiWpt.Name      = wpt.ident;
                apiWpt.Code      = wpt.name;
                apiWpt.Latitude  = wpt.lat;
                apiWpt.Longitude = wpt.lon;
                apiWpts.Add(apiWpt);

                FMS.fplDetails n = new FMS.fplDetails();
                n.WaypointName = wpt.ident;
                n.Altitude     = wpt.alt;

                //FMSControl.CustomFPL.waypoints.Add(n);
                fpl.Add(n);
            }

            pApiFpl.Waypoints = apiWpts.ToArray();

            FmsFpl = fpl;
        }
        private void loadFpdFplFromId(string id)
        {
            FlightPlanDatabase.FpdApi fd = new FlightPlanDatabase.FpdApi();
            FlightPlanDatabase.ApiDataTypes.FlightPlanDetails planDetail = fd.getPlan(id);
            //FMSControl.CustomFPL.waypoints.Clear();
            List<FMS.fplDetails> fpl = new List<FMS.fplDetails>();
            pApiFpl = new Fds.IFAPI.APIFlightPlan();
            List<Fds.IFAPI.APIWaypoint> apiWpts = new List<Fds.IFAPI.APIWaypoint>();

            foreach (FlightPlanDatabase.ApiDataTypes.Node wpt in planDetail.route.nodes)
            {
                Fds.IFAPI.APIWaypoint apiWpt = new Fds.IFAPI.APIWaypoint();
                apiWpt.Name = wpt.ident;
                apiWpt.Code = wpt.name;
                apiWpt.Latitude = wpt.lat;
                apiWpt.Longitude = wpt.lon;
                apiWpts.Add(apiWpt);

                FMS.fplDetails n = new FMS.fplDetails();
                n.WaypointName = wpt.ident;
                n.Altitude = wpt.alt;

                //FMSControl.CustomFPL.waypoints.Add(n);
                fpl.Add(n);
            }

            pApiFpl.Waypoints = apiWpts.ToArray();

            FmsFpl = fpl;
        }