public AltitudeAngelService(
            IMessagesService messagesService,
            IMissionPlanner missionPlanner,
            FlightDataService flightDataService
            )
        {
            _messagesService = messagesService;
            _missionPlanner = missionPlanner;
            _flightDataService = flightDataService;
            IsSignedIn = new ObservableProperty<bool>(false);
            WeatherReport = new ObservableProperty<WeatherInfo>();
            SentTelemetry = new ObservableProperty<Unit>();

            CreateClient((url, apiUrl, state) =>
                new AltitudeAngelClient(url, apiUrl, state,
                    (authUrl, existingState) => new AltitudeAngelHttpHandlerFactory(authUrl, existingState)));

            _disposer.Add(_missionPlanner.FlightDataMap
                .MapChanged
                .Throttle(TimeSpan.FromSeconds(1))
                .Subscribe(i => UpdateMapData(_missionPlanner.FlightDataMap)));

            _disposer.Add(_missionPlanner.FlightPlanningMap
              .MapChanged
              .Throttle(TimeSpan.FromSeconds(1))
              .Subscribe(i => UpdateMapData(_missionPlanner.FlightPlanningMap)));

            try
            {
                var list = JsonConvert.DeserializeObject<List<string>>(_missionPlanner.LoadSetting("AAWings.Filters"));

                FilteredOut.AddRange(list.Distinct());
            } catch
            {

            }

            TryConnect();
        }
Exemplo n.º 2
0
        public AltitudeAngelService(
            IMessagesService messagesService,
            IMissionPlanner missionPlanner,
            FlightDataService flightDataService
            )
        {
            _messagesService = messagesService;
            _missionPlanner = missionPlanner;
            _flightDataService = flightDataService;
            IsSignedIn = new ObservableProperty<bool>(false);
            WeatherReport = new ObservableProperty<WeatherInfo>();
            SentTelemetry = new ObservableProperty<Unit>();

            CreateClient((url, apiUrl, state) =>
                new AltitudeAngelClient(url, apiUrl, state,
                    (authUrl, existingState) => new AltitudeAngelHttpHandlerFactory(authUrl, existingState)));

            _disposer.Add(_missionPlanner.FlightDataMap
                .MapChanged
                .Throttle(TimeSpan.FromSeconds(1))
                .Subscribe(i => UpdateMapData(_missionPlanner.FlightDataMap)));

            TryConnect();
        }