示例#1
0
 public MainViewModel()
 {
     gpsService            = DependencyService.Get <IGpsService>();
     getGPSPositionCommand = ReactiveCommand.CreateFromTask(GetPositionAsync);
     getWeatherCommand     = ReactiveCommand.CreateFromTask(GetWeatherAsync);
     getWeatherCommand.IsExecuting.ToProperty(this, vm => vm.IsLoading, out isLoading);
 }
示例#2
0
        /// <summary>
        /// Starts the training
        /// </summary>
        /// <param name="enduranceDataService">Service to communicate with the peripheral.</param>
        /// <param name="gpsService">Service to get GPS coordinates from the environment.</param>
        public void Start(EnduranceDataService enduranceDataService, IGpsService gpsService)
        {
            cancellation = new CancellationTokenSource();
            Task.Factory.StartNew(() =>
            {
                laps      = new List <Lap>();
                heartRate = new HeartRate();

                enduranceDataService.StartActivitiy();
                gpsService.StartTracking();

                while (!cancellation.Token.IsCancellationRequested)
                {
                    Thread.Sleep(trainingsReadIntervalMs);

                    var nextLapDto    = enduranceDataService.GetNextRawLap();
                    var nextHeartRate = enduranceDataService.GetHeartRate();

                    var lap = new Lap(nextLapDto.LapDistance, nextLapDto.LapTime);

                    laps.Add(lap);
                    heartRate = heartRate.AddPulses(nextHeartRate.Select(h => (h.Item1, h.Item2.Pulse)).ToList());
                }

                enduranceDataService.StopActivity();
                gpsService.StopTracking();

                gpsCoordinates = gpsService.GetCoordinates().Select(c => new GpsCoordinate(c.Item1, c.Item2)).ToList();
            }
                                  );
        }
示例#3
0
 public SafetyCheckService(Repositories.IRepositories repositories, IGatewayQueuedService gatewayQueuedService, IGpsService gpsService, IInfoService infoService)
 {
     _repositories         = repositories;
     _gatewayQueuedService = gatewayQueuedService;
     _gpsService           = gpsService;
     _infoService          = infoService;
 }
 public MobileDispatchController(IDispatchService dispatchService, ITrailerService trailerService, IGpsService gpsService, IBasicSettingService basicSettingService)
 {
     this._dispatchService     = dispatchService;
     this._trailerService      = trailerService;
     this._gpsService          = gpsService;
     this._basicSettingService = basicSettingService;
 }
示例#5
0
 public CrawlerApp(IRioBusRepository riobusRepository, ILineService lineService, IUnitOfWork work, IModalService modalService, IGpsService gpsService, IItineraryService itineraryService, IDataRioRepository datarioRepository)
 {
     _riobusRepository  = riobusRepository;
     _lineService       = lineService;
     _work              = work;
     _modalService      = modalService;
     _gpsService        = gpsService;
     _itineraryService  = itineraryService;
     _datarioRepository = datarioRepository;
 }
示例#6
0
 public DataChunkService(
     Repositories.IRepositories repositories,
     IGatewayQueuedService gatewayQueuedService,
     IGpsService gpsService,
     ILoggingService loggingService)
 {
     _repositories         = repositories;
     _gatewayQueuedService = gatewayQueuedService;
     _gpsService           = gpsService;
     _loggingService       = loggingService;
 }
        public MainPageViewModel(INavigationService navigationService, IAnalyticsService analyticsService, IAppPropertiesService appPropertiesService, IGpsService gpsService)
            : base(navigationService, analyticsService, appPropertiesService)
        {
            _gpsService = gpsService ?? DependencyService.Get <IGpsService>();

            //_toolbarItemCommand = ReactiveCommand.Create(LogoutToolbarCommand);
            _navigateToPlaceSearchbarCommand = ReactiveCommand.CreateFromTask(NavigateToPlaceSearchbarAsync);
            _navigateToMoviesCommand         = ReactiveCommand.CreateFromTask(NavigateToMoviesAsync);
            _mapTappedCommand         = ReactiveCommand.Create <bool>(param => MapTappedAsync(param));
            _closeMapSelectionCommand = ReactiveCommand.Create(CloseMapSelectionModeAsync);
            _okMapSelectionCommand    = ReactiveCommand.Create(OkMapSelectionAsync);
        }
示例#8
0
 public ImageUploadService(
     Repositories.IRepositories repositories,
     IGpsService gpsService,
     ILoggingService loggingService,
     IReachability reachability,
     IHttpService httpService)
 {
     _repositories   = repositories;
     _gpsService     = gpsService;
     _loggingService = loggingService;
     _reachability   = reachability;
     _httpService    = httpService;
 }
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());

            Xamarin.FormsMaps.Init(this, bundle);

            gpsService = Xamarin.Forms.DependencyService.Get <IGpsService>();
        }
示例#10
0
        public NewMovementPageViewModel(IDialogService dialogService, IGpsService gpsService, INavigationService navigationService, IDbService dbService, IStorageService storageService) : base(navigationService, dbService, storageService)
        {
            this.dialogService = dialogService;
            this.gpsService    = gpsService;

            saveCommand        = new DelegateCommand(SaveExecute, SaveCanExecute);
            kindChangedCommand = new DelegateCommand(KindChangedExecute);

            LoadKinds();
            LoadBankAccounts();

            movement.PropertyChanged += delegate
            {
                saveCommand.RaiseCanExecuteChanged();
            };
        }
示例#11
0
 public BusStopRepository(IGpsService gpsService)
 {
     try
     {
         CreateDatabaseFile();
         _gpsService = gpsService;
         _gpsService.LocationChanged = LocationChanged;
         _gpsService.Start();
         ThreadPool.QueueUserWorkItem(o =>
         {
             GetHandShake();
             //GetBusStopList();
         });
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.ToString());
         throw;
     }
 }
示例#12
0
 public GpsController(IGpsService gpsService, ICommonService commonService)
 {
     this._gpsService    = gpsService;
     this._commonService = commonService;
 }
示例#13
0
 public SanntidView()
 {
     _sanntid = TinyIoCContainer.Current.Resolve<Realtime>();
     _gpsService = TinyIoCContainer.Current.Resolve<IGpsService>();
 }
示例#14
0
 public ModalApp(IModalService modalService, IGpsService gpsService)
 {
     _modalService = modalService;
     _gpsService   = gpsService;
 }
示例#15
0
 public MapDetailViewModel(IGpsService gpsService)
 {
     this.gpsService = gpsService;
     SetupCommands();
 }
示例#16
0
 public GpsController(IGpsService gpsService, ILoginService loginService)
 {
     this.gpsService   = gpsService;
     this.loginService = loginService;
 }
示例#17
0
 public Application(IGpsService gpsService)
 {
     _gpsSvc = gpsService;
 }
示例#18
0
 public GeoService(IGpsService gpsService)
 {
     GpsService = gpsService;
 }
示例#19
0
 public MainViewModel(IGpsService gps, HeritagePropertyService service, INavigation navigation)
 {
     this.Navigation = navigation;
     this.GpsService = gps;
     this.HeritagePropertyService = service;
 }
示例#20
0
 public MapViewModel()
 {
     gpsService            = DependencyService.Get <IGpsService>();
     getGPSPositionCommand = ReactiveCommand.CreateFromTask(GetPositionAsync);
 }
 public TrainingService(ITrainingRepository trainingRepository, IGpsService gpsService)
 {
     this.trainingRepository = trainingRepository;
     this.gpsService         = gpsService;
 }
 public MainViewModel(IGpsService gps, HeritagePropertyService service, INavigation navigation)
 {
     this.Navigation = navigation;
     this.GpsService = gps;
     this.HeritagePropertyService = service;
 }