123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using UnityEngine;
- namespace CSVReader
- {
- public abstract class AbstractUnitCSVReader
- {
- protected readonly object LockObject;
- //BIN-Inhalte: int ID - double timestamp - 3x float coodrinates - 3x float rotation - 2x uint colors - int EntityType - int SensorID
- /// <summary>
- /// The Length of one dataline.
- /// int ID - double timestamp - 3x float coodrinates - 3x float rotation - 3x float head rotation - 2x uint colors - int EntityType - int SensorID
- /// </summary>
- protected readonly int ROWLENGTHINBYTES = 3 * sizeof(int) + sizeof(double) + 9 * sizeof(float) + 2 * sizeof(uint);
- /// <summary>
- /// The Binary reader on the file.
- /// </summary>
- protected BinaryReader Reader;
- /// <summary>
- /// Whether the Binaryreader was initialized correctly
- /// </summary>
- protected bool Defined = false;
- protected double ChunkStartTimestamp = double.NaN;
- protected double ChunkEndTimestamp = double.NaN;
- protected AbstractUnitCSVReader()
- {
- LockObject = new object();
- }
- protected abstract InputObject ParseObject();
- protected abstract double GetTimeAtRelativeOffset(long shift);
- protected abstract double GetTimeAtAbsolutPosition(long offset);
- protected abstract bool TestNewPosition(long newPos);
- protected abstract bool TestBinaryReader();
- protected abstract bool IsStep(double newTime, double targetTime, int jumpdirection, bool forward);
- }
- }
|