コード例 #1
0
        private SensorData CreateStatusUpdateObject(SensorData originalData)
        {
            SensorData clone = originalData.Clone();

            clone.Status          = SensorStatus.Warning;
            clone.TransactionType = TransactionType.Update;
            clone.ValidationError = ValidationConstants.SensorValueOutdated;
            return(clone);
        }
コード例 #2
0
        public void AddValue(string productName, SensorData sensorData)
        {
            lock (_syncRoot)
            {
                SortedList <string, SensorData> list;

                if (!_productSensorDictionary.ContainsKey(productName))
                {
                    list = new SortedList <string, SensorData>();
                    _productSensorDictionary[productName] = list;
                }
                else
                {
                    list = _productSensorDictionary[productName];
                }

                list[sensorData.Path] = sensorData.Clone();
            }
        }