Example #1
0
        private void LoadTags(TagConfigDatabase tagConfigDatabase)
        {
            var tagGroups = tagConfigDatabase.GetDisctinctTagGroupNames();

            foreach (var groupName in tagGroups)
            {
                TagGroup currentTagGroup;
                if (!_tagGroups.TryGetValue(groupName, out currentTagGroup))
                {
                    currentTagGroup = new TagGroup(groupName);
                    _tagGroups.TryAdd(groupName, currentTagGroup);
                }

                var tagRecords = tagConfigDatabase.GetTags(groupName);
                foreach (var tr in tagRecords)
                {
                    Tag tag = new Tag(tr.TagName);
                    currentTagGroup.Config.SendIntervalSeconds = tr.SendingInterval;
                    currentTagGroup.Tags.TryAdd(tag.Name, tag);
                }
            }
        }