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 CurrentDataReportDto CurrentDataStructuredReport(SinkAndNetworkDto sinkAndNetwork)
        {
            var telemetryDataSink = _telemetryDataSinkProcessor.WorkerTelemetryDataSink(sinkAndNetwork.SinkName, sinkAndNetwork.NetworkId);

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

            var devices           = _networkOperations.ListDevices(sinkAndNetwork.NetworkId);
            var telemetryDataList = ((ITelemetryDataSinkCurrent)telemetryDataSink).GetCurrentData(devices.Select(d => d.Id));

            return(StructuredDtoConverters.CurrentDataReport(devices, telemetryDataList));
        }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 4
0
        public CurrentDataReportDto CurrentDataStructuredReport(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(StructuredDtoConverters.CurrentDataReport(devices, telemetryDataList));
        }