/// <summary> /// Initializes a new instance of the <see cref="Tag"/> class. /// </summary> public Tag() { Type = TagType.Tag; Area = string.Empty; Childs = new List <Tag>(); IsActive = true; MetaData = new TagMetaData { Comment = string.Empty, UnitForUser = string.Empty }; ValueHasChanged = false; }
/// <summary> /// Initializes a new instance of the <see cref="Tag" /> class. /// </summary> /// <param name="name">The name.</param> /// <param name="scope">The scope.</param> /// <param name="dataType">Type of the data.</param> /// <param name="adsPort">Optional ads port (Beckhoff only).</param> public Tag(string name, string scope, string dataType, int adsPort = 0, string area = "") { Type = TagType.Tag; Name = name; Scope = scope; DataType = dataType; AdsPort = adsPort; Area = area; Childs = new List <Tag>(); IsActive = true; MetaData = new TagMetaData { Comment = string.Empty, UnitForUser = string.Empty }; ValueHasChanged = false; }
public TagMetaData Parse(string rawString) { if (rawString.IsNullOrEmpty()) { return(new TagMetaData()); } var ret = new TagMetaData { Comment = GetComment(rawString), ReadPointer = TryParsePointer(rawString), EnumerationMembers = TryParseEnum(rawString) }; if (!ret.EnumerationMembers.IsNullOrEmpty()) { ret.Minimum = ret.EnumerationMembers.Min(m => m.Value); ret.Maximum = ret.EnumerationMembers.Max(m => m.Value); } return(ret); }