public void Read(ref BinaryReader br) { int StartPos = (int)br.BaseStream.Position; m_Signature = br.ReadChars(4); m_HeaderSize = br.ReadInt32(); m_TagClass[0] = br.ReadUInt32(); m_TagClass[1] = br.ReadUInt32(); m_TagClass[2] = br.ReadUInt32(); m_TagRevision = br.ReadInt32(); GameVersion = (MapfileVersion)br.ReadInt32(); TagSize = br.ReadInt32(); AttachmentsSize = br.ReadInt32(); RawType = (RawDataType)br.ReadInt32(); switch (m_TagRevision) //schema { case 1: break; } int delta = m_HeaderSize - ((int)br.BaseStream.Position - StartPos); br.BaseStream.Position += delta; }
public Sensor(string description, RawDataType rawType, IRawValueConverter converter, int address, DataReader reader) { Description = description; Register = address; DataReader = reader; Converter = converter; _rawType = rawType; }
public void Read(byte[] buffer) { for (int i = 0; i < 4; i++) { m_Signature[i] = BitConverter.ToChar(buffer, i); } m_HeaderSize = BitConverter.ToInt32(buffer, 4); m_TagClass[0] = BitConverter.ToUInt32(buffer, 8); m_TagClass[1] = BitConverter.ToUInt32(buffer, 12); m_TagClass[2] = BitConverter.ToUInt32(buffer, 16); m_TagRevision = BitConverter.ToInt32(buffer, 20); GameVersion = (MapfileVersion)BitConverter.ToInt32(buffer, 24); TagSize = BitConverter.ToInt32(buffer, 28); AttachmentsSize = BitConverter.ToInt32(buffer, 32); RawType = (RawDataType)BitConverter.ToInt32(buffer, 36); }
abstract public T CreateFromRawData(RawDataType data);