예제 #1
0
파일: CommLine.cs 프로젝트: jdsxhz/scada-v6
        /// <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);
            }
        }
예제 #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);
            }
        }