Esempio n. 1
0
        public PulsationAnalyzePage()
        {
            InitializeComponent();

            Bluetooth = DependencyService.Get <Bluetooth>();

#if DEBUG
            _impulseInvoker = new MockImpulseInvoker();
#endif

            _vm    = new DeviceDataViewModel();
            _ddp   = DeviceDataProvider.GetProvider;
            _timer = new StoppableTimer(TimeSpan.FromMilliseconds(Constants.UPDATE_INTERVAL), TimerTick);
            FirstChanelSeries.ItemsSource  = _vm.FirstChanelSeriesData;
            SecondChanelSeries.ItemsSource = _vm.SecondChanelSeriesData;
            _jsonKeeper = new JsonDataKeeper <DeviceDataViewModel>();
        }
Esempio n. 2
0
        // Sends realtime data
        public MainAppVM(ISubscriptionService subscriptionService)
        {
            _subService = subscriptionService;
            _subService.Subscribe(OnData);
            Devices = new List <SensorData>();

            var DeviceData = new DeviceDataProvider();
            var data       = DeviceData.GetData();
            var devices    = data.Documents.GroupBy(e => e.deviceId);

            foreach (var device in devices)
            {
                Devices.Add(device.FirstOrDefault());
            }

            _timer = new Timer(state =>
            {
                Changed(nameof(ServerTime));
                PushUpdates();
            }, null, 0, 1000);
        }