public FlatReportDto TimeSeriesFlatReport(SinkAndDeviceDto sinkAndDevice, DateTime date) { var device = _deviceOperations.Get(sinkAndDevice.DeviceId); var telemetryDataSink = _telemetryDataSinkProcessor.WorkerTelemetryDataSink(sinkAndDevice.SinkName, device.NetworkId); if (telemetryDataSink == null) { return(null); } var devices = new[] { new Small { Id = device.Id, Name = device.Name } }; var telemetryDataList = ((ITelemetryDataSinkTimeSeries)telemetryDataSink).GetTimeSeries(devices.Select(d => d.Id), date.Date); return(FlatDtoConverters.TimeSeriesReport(devices, telemetryDataList)); }
public FlatReportDto CurrentDataFlatReport(SinkAndDeviceDto sinkAndDevice) { var device = _deviceOperations.Get(sinkAndDevice.DeviceId); var telemetryDataSink = _telemetryDataSinkProcessor.WorkerTelemetryDataSink(sinkAndDevice.SinkName, device.NetworkId); if (telemetryDataSink == null) { return(null); } var devices = new[] { new Small { Id = device.Id, Name = device.Name } }; var telemetryDataList = ((ITelemetryDataSinkCurrent)telemetryDataSink).GetCurrentData(devices.Select(d => d.Id)); return(FlatDtoConverters.CurrentDataReport(devices, telemetryDataList)); }