Ejemplo n.º 1
0
        public TimeSeriesReportDto TimeSeriesStructuredReport(SinkAndNetworkDto sinkAndNetwork, DateTime date)
        {
            var telemetryDataSink = _telemetryDataSinkProcessor.WorkerTelemetryDataSink(sinkAndNetwork.SinkName, sinkAndNetwork.NetworkId);

            if (telemetryDataSink == null)
            {
                return(null);
            }

            var devices           = _networkOperations.ListDevices(sinkAndNetwork.NetworkId);
            var telemetryDataList = ((ITelemetryDataSinkTimeSeries)telemetryDataSink).GetTimeSeries(devices.Select(d => d.Id), date.Date);

            return(StructuredDtoConverters.TimeSeriesReport(devices, telemetryDataList));
        }
Ejemplo n.º 2
0
        public TimeSeriesReportDto TimeSeriesStructuredReport(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(StructuredDtoConverters.TimeSeriesReport(devices, telemetryDataList));
        }