Example #1
0
        protected override void ParseLine(string lineText)
        {
            var fields = lineText.SplitByChar(',');

            var deviceData = new Data.DeviceData()
            {
                DeviceNumber = DeviceNumber,
                CollectorId  = CollectorId,
                Values       = fields,
            };

            var cacheObjectValue = GetCacheObjectValue();

            if (cacheObjectValue != null && !cacheObjectValue.Exists(x => x == deviceData.Key))
            {
                UploadDeviceData.Add(deviceData);
            }
        }
Example #2
0
        protected override void ParseLine(string lineText)
        {
            var fields = lineText.SplitByChar(',');

            if (fields.Length >= 6 && (fields[0] == "C01" || fields[0].StartsWith("B")))
            {
                var deviceData = new Data.DeviceData()
                {
                    DeviceNumber = DeviceNumber,
                    CollectorId  = CollectorId,
                    Values       = fields.Skip(1).ToArray(),
                };

                var cacheObjectValue = GetCacheObjectValue();
                if (cacheObjectValue != null && !cacheObjectValue.Exists(x => x == deviceData.Key))
                {
                    UploadDeviceData.Add(deviceData);
                }
            }
        }