Exemplo n.º 1
0
        private async void CaptureDevices()
        {
            for (; ;)
            {
                var devices = _deviceService.GetAllDevices();

                foreach (var deviceId in _configuration.DevicesToCapture)
                {
                    var device = devices.FirstOrDefault(d => d.Id == deviceId);

                    if (device != null)
                    {
                        _dataStorage.Store(deviceId, Convert.ToDouble(device.Value));
                    }
                }

                await Task.Delay(_configuration.CaptureInterval);
            }
        }
 private void LogItem(LogItem logItem)
 {
     _dataStorage.Store("Log", logItem, i => i.DateTime);
 }