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

            coreLogic.EnqueueCurrentData(allData ?
                                         deviceData.GetCurrentData() :
                                         deviceData.GetModifiedData());

            while (deviceData.DequeueSlice(out DeviceSlice deviceSlice))
            {
                coreLogic.EnqueueHistoricalData(deviceSlice);
            }

            while (deviceData.DequeueEvent(out DeviceEvent deviceEvent))
            {
                coreLogic.EnqueueEvent(deviceEvent);
            }
        }
Beispiel #2
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);
            }
        }