Beispiel #1
0
        private void HandleStartRecordingCommand()
        {
            if (_recorder.IsRecording)
            {
                Log.Debug("Ignoring start recording command since recorder already running");
                return;
            }

            if (!Settings.CalibrationDone)
            {
                Log.Debug("Ignoring start recording command since device is not calibrated");
                return;
            }

            Log.Debug("Executing start recording command");

            _sensors.StartSensing();
            _recorder.Start();

            //Ensure GPS information is refreshed before signaling recording
            OnPropertyChanged(() => LocationSensorStatus);
            SensorStatusUpdated.Raise(this);

            OnPropertyChanged(() => IsRecording);
            RecordingStatusUpdated.Raise(this);

            //Starting a new recording regenerates session information
            OnPropertyChanged(() => CurrentVehicleType);
            OnPropertyChanged(() => CurrentAnchorageType);
            OnPropertyChanged(() => TrackId);
        }
Beispiel #2
0
        private void HandleLocationSensorStatusChanged(object sender, LocationSensorStatusChangedEventArgs e)
        {
            if (e.PreviousStatus == LocationSensorStatus.Fixing && e.CurrentStatus == LocationSensorStatus.Working)
            {
                UserLog.Add(UserLog.Icon.None, LogStrings.GpsFix);
            }
            else if (e.PreviousStatus == LocationSensorStatus.Working && e.CurrentStatus == LocationSensorStatus.Fixing)
            {
                UserLog.Add(UserLog.Icon.None, LogStrings.GpsFixLost);
            }
            else if (e.CurrentStatus == LocationSensorStatus.Disabled)
            {
                UserLog.Add(UserLog.Icon.None, LogStrings.GpsDisabled);
            }

            OnPropertyChanged(() => LocationSensorStatus);
            SensorStatusUpdated.Raise(this);
        }