public BaseViewModel(IBluetoothService bluetoothService, ISensorDataService sensorDataService, IUserDialogs userDialogs, IDataLoggingService dataLoggingService, IDeviceSlotService deviceSlotService, IMvxLog log) { _userDialogs = userDialogs; _bluetoothService = bluetoothService; _sensorDataService = sensorDataService; _deviceSlotService = deviceSlotService; _log = log; _dataLoggingService = dataLoggingService; }
/// <summary> /// Initializes a new instance of the <see cref="T:UHMS.Core.Services.SensorDataService"/> class. /// Processes incoming sensor data by handling characteristic updates by the sensor devices. /// </summary> /// <param name="log">Log.</param> public SensorDataService(IMvxLog log, IDataLoggingService dataLoggingService) { _log = log; _dataLoggingService = dataLoggingService; // Setup the data collections to be ready for new data. _dataTime = new Dictionary <int, uint>(); GraphDataBuffer = new ConcurrentDictionary <int, ConcurrentQueue <DataProfile> >(); CurrentOutputs = new List <int>(); DataErrorCount = new Dictionary <int, int> { { 0, 0 }, { 1, 0 } }; }
/// <summary> /// Initializes a new instance of the <see cref="T:UHMS.Core.Services.BluetoothService"/> class. /// </summary> /// <param name="sensorDataService">Handler for incoming sensor data.</param> /// <param name="adapter">Adapter used to manage the peripheral bluetooth connections.</param> /// <param name="bluetooth">Interface to the central bluetooth device.</param> /// <param name="userDialogs">Dialogs to manage user-oriented output to the UI.</param> /// <param name="log">Logger primarily for debugging and record purposes.</param> public BluetoothService(ISensorDataService sensorDataService, IDataLoggingService dataLoggingService, IDeviceSlotService deviceSlotService, IAdapter adapter, IBluetoothLE bluetooth, IUserDialogs userDialogs, IMvxLog log) { // Services _sensorDataService = sensorDataService; _dataLoggingService = dataLoggingService; _deviceSlotService = deviceSlotService; _adapter = adapter; _bluetooth = bluetooth; _userDialogs = userDialogs; _log = log; _log.Info("Initializing Bluetooth Service."); // Event tracker for subscribed characteristics. _characteristicEventAggregator = new ConcurrentDictionary <ICharacteristic, EventHandler <CharacteristicUpdatedEventArgs> >(); OutputData = new List <int>(); SubscribedCharacteristicsList = new List <DataType>(); }
public IphoneViewModel(IBluetoothService bluetoothService, ISensorDataService sensorDataService, IUserDialogs userDialogs, IDataLoggingService dataLoggingService, IDeviceSlotService deviceSlotService, IMvxLog log) : base(bluetoothService, sensorDataService, userDialogs, dataLoggingService, deviceSlotService, log) { BluetoothViewModel = new BluetoothViewModel(bluetoothService, deviceSlotService, userDialogs, log); VitalSignsMonitorViewModel = new VitalSignsMonitorViewModel(bluetoothService, sensorDataService, deviceSlotService, userDialogs, log); //_dataLoggingService.Open(); }
// Main View Model that connects the subviews public MainViewModel(IBluetoothService bluetoothService, ISensorDataService sensorDataService, IUserDialogs userDialogs, IDataLoggingService dataLoggingService, IDeviceSlotService deviceSlotService, IMvxLog log) : base(bluetoothService, sensorDataService, userDialogs, dataLoggingService, deviceSlotService, log) { BluetoothViewModel = new BluetoothViewModel(bluetoothService, deviceSlotService, userDialogs, log); DownloadViewModel = new DownloadViewModel(bluetoothService, deviceSlotService, dataLoggingService, userDialogs, log); VitalSignsMonitorViewModel = new VitalSignsMonitorViewModel(bluetoothService, sensorDataService, deviceSlotService, userDialogs, log); }