Beispiel #1
0
        /// <summary>
        /// Transfers data from the device to the server.
        /// </summary>
        private void TransferDeviceData(DeviceLogic deviceLogic, bool allData)
        {
            // current data
            DeviceSlice currentSlice = deviceLogic.GetCurrentData(allData);

            if (!currentSlice.IsEmpty)
            {
                coreLogic.EnqueueCurrentData(currentSlice);
            }

            // historical data
            while (deviceLogic.DeviceData.DequeueSlice(out DeviceSlice historicalSlice))
            {
                coreLogic.EnqueueHistoricalData(historicalSlice);
            }

            // events
            while (deviceLogic.DeviceData.DequeueEvent(out DeviceEvent deviceEvent))
            {
                coreLogic.EnqueueEvent(deviceEvent);
            }
        }