public DataPointDto Read() { if (Position != BinaryFileDao.UnknownOffset) { Reader.BaseStream.Seek(Position, SeekOrigin.Begin); } else { // Save the position of the state information Position = Reader.BaseStream.Position; } DataPointDto dto = new DataPointDto(); dto.Dao = this; dto.Empty = Reader.ReadBoolean(); if (this.timestampDao == null) { this.timestampDao = new BinaryFileDateTimeDao(this); } dto.Timestamp = this.timestampDao.Read(); dto.Value = Reader.ReadDouble(); return(dto); }
private void WriteAttributes(ArchiveDto archiveDto) { if (this.slotExpiryTimeDao == null) { this.slotExpiryTimeDao = new BinaryFileDateTimeDao(this); } this.slotExpiryTimeDao.Create(archiveDto.SlotExpiryTime); }
private void WriteAttributes() { // Title if (this.titleDao == null) { this.titleDao = new BinaryFileStringDao(this, TimeSeriesDatabase.MaxTitleLength); } this.titleDao.Create(this.dto.Title); // Start time if (this.startTimeDao == null) { this.startTimeDao = new BinaryFileDateTimeDao(this); } this.startTimeDao.Create(this.dto.StartTime); }
private void ReadAttributes() { if (Position != BinaryFileDao.UnknownOffset) { Reader.BaseStream.Seek(Position, SeekOrigin.Begin); } else { // Save the position of the attribute information Position = Reader.BaseStream.Position; } if (this.slotExpiryTimeDao == null) { this.slotExpiryTimeDao = new BinaryFileDateTimeDao(this); } this.dto.SlotExpiryTime = this.slotExpiryTimeDao.Read(); }
private void Write(ReadingDto dto) { if (Position == BinaryFileDao.UnknownOffset) { // Record where the reading has been read from Position = Writer.BaseStream.Position; } else { // Go to the location of the reading in the file Writer.BaseStream.Seek((int)Position, SeekOrigin.Begin); } Writer.Write(dto.Empty); if (this.timestampDao == null) { this.timestampDao = new BinaryFileDateTimeDao(this); } this.timestampDao.Create(dto.Timestamp); Writer.Write(dto.Value); }
public void Write(DataPointDto dto) { if (Position == BinaryFileDao.UnknownOffset) { Writer.Seek(0, SeekOrigin.End); // Record where the data point has been written Position = Writer.BaseStream.Position; } else { // Go to the location of the datum in the file Writer.BaseStream.Seek((int)Position, SeekOrigin.Begin); } Writer.Write(dto.Empty); if (this.timestampDao == null) { this.timestampDao = new BinaryFileDateTimeDao(this); } this.timestampDao.Create(dto.Timestamp); Writer.Write(dto.Value); }