/// <summary> /// FileVersion.Current - need 42 bytes /// </summary> /// <param name="bytes"></param> /// <param name="offset"></param> /// <param name="version"></param> public SchedulePoint(byte[] bytes, int offset = 0, FileVersion version = FileVersion.Current) : base(bytes, offset, version) { offset += BasePoint.GetSize(FileVersion); switch (FileVersion) { case FileVersion.Current: Control = (OffOn)bytes.ToByte(ref offset); AutoManual = (AutoManual)bytes.ToByte(ref offset); Override1Control = (OffOn)bytes.ToByte(ref offset); Override2Control = (OffOn)bytes.ToByte(ref offset); Off = bytes.ToByte(ref offset); Unused = bytes.ToByte(ref offset); var T3000PointSize = T3000Point.GetSize(FileVersion); Override1Point = new T3000Point(bytes.ToBytes(ref offset, T3000PointSize), 0, FileVersion); Override2Point = new T3000Point(bytes.ToBytes(ref offset, T3000PointSize), 0, FileVersion); break; default: throw new FileVersionNotImplementedException(FileVersion); } CheckOffset(offset, GetSize(FileVersion)); }
/// <summary> /// FileVersion.Current - Need 28 bytes /// </summary> /// <param name="bytes"></param> /// <param name="offset"></param> /// <param name="version"></param> public ControllerPoint(byte[] bytes, int offset = 0, FileVersion version = FileVersion.Current) : base(version) { switch (FileVersion) { case FileVersion.Current: Input = new T3000Point(bytes.ToBytes(ref offset, 3), 0, FileVersion); InputValue = bytes.ToInt32(ref offset); Value = bytes.ToInt32(ref offset); SetPoint = new T3000Point(bytes.ToBytes(ref offset, 3), 0, FileVersion); SetPointValue = bytes.ToFloat(ref offset); Unit = (Unit)bytes.ToByte(ref offset); AutoManual = (AutoManual)bytes.ToByte(ref offset); Action = (DirectReverse)bytes.ToByte(ref offset); Periodicity = (Periodicity)bytes.ToByte(ref offset); IsSample = bytes.ToByte(ref offset); PropHigh = bytes.ToByte(ref offset); Proportional = bytes.ToByte(ref offset); Reset = bytes.ToByte(ref offset); Bias = bytes.ToByte(ref offset); Rate = bytes.ToByte(ref offset) / 100.0; break; default: throw new FileVersionNotImplementedException(FileVersion); } CheckOffset(offset, GetSize(FileVersion)); }