Beispiel #1
0
 internal TcAdsSymbolInfo(AdsParseSymbols symbolParser, TcAdsSymbolInfo parent, int subIndex, AdsSymbolEntry symbolEntry, TcAdsDataType typeEntry) : this(symbolParser, parent, subIndex)
 {
     if (symbolEntry == null)
     {
         throw new ArgumentNullException("symbolEntry");
     }
     this.indexGroup  = symbolEntry.indexGroup;
     this.indexOffset = symbolEntry.indexOffset;
     this.size        = symbolEntry.size;
     this.dataTypeId  = (AdsDatatypeId)symbolEntry.dataType;
     if (typeEntry != null)
     {
         this.typeEntryFlags = typeEntry.Flags;
     }
     if (this.typeEntryFlags.HasFlag(AdsDataTypeFlags.None | AdsDataTypeFlags.Static))
     {
         this.indexGroup  = 0xf019;
         this.indexOffset = 0;
     }
     this.flags        = symbolEntry.flags;
     this.instancePath = symbolEntry.name;
     this.shortName    = symbolEntry.name;
     this.typeName     = symbolEntry.type;
     this.comment      = symbolEntry.comment;
     this.dataType     = typeEntry;
     if (((symbolEntry.array != null) || (typeEntry == null)) || !typeEntry.IsArray)
     {
         this.arrayInfo = symbolEntry.array;
     }
     else
     {
         this.arrayInfo = typeEntry.Dimensions.ToArray();
         if (typeEntry.Size != this.size)
         {
             this.size = (uint)typeEntry.Size;
         }
     }
     if (symbolEntry.attributes != null)
     {
         this.attributes = new TypeAttributeCollection(symbolEntry.attributes).AsReadOnly();
     }
     else
     {
         this.attributes = null;
     }
 }
Beispiel #2
0
 internal TcAdsSymbolInfo(AdsParseSymbols symbolParser, TcAdsSymbolInfo parent, int subIndex, TcAdsDataType typeEntry) : this(symbolParser, parent, subIndex)
 {
     if (typeEntry == null)
     {
         throw new ArgumentNullException("typeEntry");
     }
     this.indexGroup     = (uint)parent.IndexGroup;
     this.indexOffset    = (uint)parent.IndexOffset;
     this.size           = (uint)typeEntry.Size;
     this.dataTypeId     = typeEntry.DataTypeId;
     this.typeEntryFlags = typeEntry.Flags;
     this.flags          = DataTypeFlagConverter.Convert(typeEntry.Flags);
     this.instancePath   = parent.Name;
     this.shortName      = parent.ShortName;
     this.typeName       = typeEntry.Name;
     this.comment        = typeEntry.Comment;
     this.dataType       = typeEntry;
     this.arrayInfo      = typeEntry.ArrayInfo;
     this.attributes     = typeEntry.Attributes;
 }