// Autogenerated C# message buffer code. // Source: clad/vizInterface/messageViz.clad // Full command line: victor-clad/tools/message-buffers/emitters/CSharp_emitter.py -C vizSrc -I clad/src lib/util/source/anki/clad robot/clad/src coretech/vision/clad_src coretech/common/clad_src -o generated/cladCSharp clad/vizInterface/messageViz.clad namespace Anki { namespace Vector { namespace VizInterface { public partial class RobotStateMessage { private Anki.Vector.RobotState _state; // RobotState private float _imuTemperature_degC; // float_32 private ushort[] _cliffThresholds; // uint_16[4] private ushort _videoFramePeriodMs; // uint_16 private ushort _imageProcPeriodMs; // uint_16 private byte _lockedAnimTracks; // uint_8 private byte _animTracksInUse; // uint_8 private float _batteryVolts; // float_32 private Anki.Vector.OffTreadsState _offTreadsState; // OffTreadsState private Anki.Vector.OffTreadsState _awaitingConfirmationTreadState; // OffTreadsState public Anki.Vector.RobotState state { get { return _state; } set { if (value == null) { throw new System.ArgumentNullException("state cannot be null.", "value"); } _state = value; } } public float imuTemperature_degC { get { return _imuTemperature_degC; } set { _imuTemperature_degC = value; } } public ushort[] cliffThresholds { get { return _cliffThresholds; } set { if (value == null) { throw new System.ArgumentException("cliffThresholds fixed-length array is null. Must have a length of 4.", "value"); } if (value.Length != 4) { throw new System.ArgumentException("cliffThresholds fixed-length array is the wrong size. Must have a length of 4.", "value"); } _cliffThresholds = value; } } public ushort videoFramePeriodMs { get { return _videoFramePeriodMs; } set { _videoFramePeriodMs = value; } } public ushort imageProcPeriodMs { get { return _imageProcPeriodMs; } set { _imageProcPeriodMs = value; } } public byte lockedAnimTracks { get { return _lockedAnimTracks; } set { _lockedAnimTracks = value; } } public byte animTracksInUse { get { return _animTracksInUse; } set { _animTracksInUse = value; } } public float batteryVolts { get { return _batteryVolts; } set { _batteryVolts = value; } } public Anki.Vector.OffTreadsState offTreadsState { get { return _offTreadsState; } set { _offTreadsState = value; } } public Anki.Vector.OffTreadsState awaitingConfirmationTreadState { get { return _awaitingConfirmationTreadState; } set { _awaitingConfirmationTreadState = value; } } /**** Constructors ****/ public RobotStateMessage() { this.state = new Anki.Vector.RobotState(); this.cliffThresholds = new ushort[4]; } public RobotStateMessage(Anki.Vector.RobotState state, float imuTemperature_degC, ushort[] cliffThresholds, ushort videoFramePeriodMs, ushort imageProcPeriodMs, byte lockedAnimTracks, byte animTracksInUse, float batteryVolts, Anki.Vector.OffTreadsState offTreadsState, Anki.Vector.OffTreadsState awaitingConfirmationTreadState) { this.state = state; this.imuTemperature_degC = imuTemperature_degC; this.cliffThresholds = cliffThresholds; this.videoFramePeriodMs = videoFramePeriodMs; this.imageProcPeriodMs = imageProcPeriodMs; this.lockedAnimTracks = lockedAnimTracks; this.animTracksInUse = animTracksInUse; this.batteryVolts = batteryVolts; this.offTreadsState = offTreadsState; this.awaitingConfirmationTreadState = awaitingConfirmationTreadState; } public RobotStateMessage(System.IO.Stream stream) { Unpack(stream); } public RobotStateMessage(System.IO.BinaryReader reader) { Unpack(reader); } public RobotStateMessage Initialize(Anki.Vector.RobotState state, float imuTemperature_degC, ushort[] cliffThresholds, ushort videoFramePeriodMs, ushort imageProcPeriodMs, byte lockedAnimTracks, byte animTracksInUse, float batteryVolts, Anki.Vector.OffTreadsState offTreadsState, Anki.Vector.OffTreadsState awaitingConfirmationTreadState) { this.state = state; this.imuTemperature_degC = imuTemperature_degC; this.cliffThresholds = cliffThresholds; this.videoFramePeriodMs = videoFramePeriodMs; this.imageProcPeriodMs = imageProcPeriodMs; this.lockedAnimTracks = lockedAnimTracks; this.animTracksInUse = animTracksInUse; this.batteryVolts = batteryVolts; this.offTreadsState = offTreadsState; this.awaitingConfirmationTreadState = awaitingConfirmationTreadState; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _state = new Anki.Vector.RobotState(reader); _imuTemperature_degC = reader.ReadSingle(); _cliffThresholds = new ushort[4]; for (int i = 0; i < 4; ++i) { _cliffThresholds[i] = reader.ReadUInt16(); } _videoFramePeriodMs = reader.ReadUInt16(); _imageProcPeriodMs = reader.ReadUInt16(); _lockedAnimTracks = reader.ReadByte(); _animTracksInUse = reader.ReadByte(); _batteryVolts = reader.ReadSingle(); _offTreadsState = (Anki.Vector.OffTreadsState)reader.ReadSByte(); _awaitingConfirmationTreadState = (Anki.Vector.OffTreadsState)reader.ReadSByte(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { _state.Pack(writer); writer.Write((float)_imuTemperature_degC); for (int i = 0; i < 4; ++i) { writer.Write((ushort)_cliffThresholds[i]); } writer.Write((ushort)_videoFramePeriodMs); writer.Write((ushort)_imageProcPeriodMs); writer.Write((byte)_lockedAnimTracks); writer.Write((byte)_animTracksInUse); writer.Write((float)_batteryVolts); writer.Write((sbyte)_offTreadsState); writer.Write((sbyte)_awaitingConfirmationTreadState); } public int Size { get { return 242; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(RobotStateMessage a, RobotStateMessage b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(RobotStateMessage a, RobotStateMessage b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as RobotStateMessage); } public bool Equals(RobotStateMessage p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._state.Equals(p._state) && this._imuTemperature_degC.Equals(p._imuTemperature_degC) && ArrayEquals(this._cliffThresholds,p._cliffThresholds) && this._videoFramePeriodMs.Equals(p._videoFramePeriodMs) && this._imageProcPeriodMs.Equals(p._imageProcPeriodMs) && this._lockedAnimTracks.Equals(p._lockedAnimTracks) && this._animTracksInUse.Equals(p._animTracksInUse) && this._batteryVolts.Equals(p._batteryVolts) && this._offTreadsState.Equals(p._offTreadsState) && this._awaitingConfirmationTreadState.Equals(p._awaitingConfirmationTreadState); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._state.GetHashCode(); hash = hash * 23 + this._imuTemperature_degC.GetHashCode(); hash = hash * 23 + this._videoFramePeriodMs.GetHashCode(); hash = hash * 23 + this._imageProcPeriodMs.GetHashCode(); hash = hash * 23 + this._lockedAnimTracks.GetHashCode(); hash = hash * 23 + this._animTracksInUse.GetHashCode(); hash = hash * 23 + this._batteryVolts.GetHashCode(); hash = hash * 23 + this._offTreadsState.GetHashCode(); hash = hash * 23 + this._awaitingConfirmationTreadState.GetHashCode(); return hash; } } } public partial class CurrentAnimation { private byte _tag; // uint_8 private string _animName; // string[uint_8] public byte tag { get { return _tag; } set { _tag = value; } } public string animName { get { return _animName; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("animName string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _animName = value; } } /**** Constructors ****/ public CurrentAnimation() { } public CurrentAnimation(byte tag, string animName) { this.tag = tag; this.animName = animName; } public CurrentAnimation(System.IO.Stream stream) { Unpack(stream); } public CurrentAnimation(System.IO.BinaryReader reader) { Unpack(reader); } public CurrentAnimation Initialize(byte tag, string animName) { this.tag = tag; this.animName = animName; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _tag = reader.ReadByte(); int _animName_length = (int)reader.ReadByte(); byte[] _animName_bytes = reader.ReadBytes(_animName_length); _animName = System.Text.Encoding.UTF8.GetString(_animName_bytes); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((byte)_tag); if (_animName != null) { byte[] _animName_bytes = System.Text.Encoding.UTF8.GetBytes(_animName); writer.Write((byte)_animName_bytes.Length); writer.Write(_animName_bytes); } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 1; // uint_8 result += 1; // uint_8 if (animName != null) { result += System.Text.Encoding.UTF8.GetByteCount(animName); } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(CurrentAnimation a, CurrentAnimation b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(CurrentAnimation a, CurrentAnimation b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as CurrentAnimation); } public bool Equals(CurrentAnimation p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._tag.Equals(p._tag) && this._animName.Equals(p._animName); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._tag.GetHashCode(); return hash; } } } public partial class Object { private uint _objectID; // uint_32 private Anki.Vector.VizObjectType _objectTypeID; // VizObjectType private uint _color; // uint_32 private float _x_size_m; // float_32 private float _y_size_m; // float_32 private float _z_size_m; // float_32 private float _x_trans_m; // float_32 private float _y_trans_m; // float_32 private float _z_trans_m; // float_32 private float _rot_deg; // float_32 private float _rot_axis_x; // float_32 private float _rot_axis_y; // float_32 private float _rot_axis_z; // float_32 private float[] _objParameters; // float_32[4] private string _text; // string[uint_8] public uint objectID { get { return _objectID; } set { _objectID = value; } } public Anki.Vector.VizObjectType objectTypeID { get { return _objectTypeID; } set { _objectTypeID = value; } } public uint color { get { return _color; } set { _color = value; } } public float x_size_m { get { return _x_size_m; } set { _x_size_m = value; } } public float y_size_m { get { return _y_size_m; } set { _y_size_m = value; } } public float z_size_m { get { return _z_size_m; } set { _z_size_m = value; } } public float x_trans_m { get { return _x_trans_m; } set { _x_trans_m = value; } } public float y_trans_m { get { return _y_trans_m; } set { _y_trans_m = value; } } public float z_trans_m { get { return _z_trans_m; } set { _z_trans_m = value; } } public float rot_deg { get { return _rot_deg; } set { _rot_deg = value; } } public float rot_axis_x { get { return _rot_axis_x; } set { _rot_axis_x = value; } } public float rot_axis_y { get { return _rot_axis_y; } set { _rot_axis_y = value; } } public float rot_axis_z { get { return _rot_axis_z; } set { _rot_axis_z = value; } } public float[] objParameters { get { return _objParameters; } set { if (value == null) { throw new System.ArgumentException("objParameters fixed-length array is null. Must have a length of 4.", "value"); } if (value.Length != 4) { throw new System.ArgumentException("objParameters fixed-length array is the wrong size. Must have a length of 4.", "value"); } _objParameters = value; } } public string text { get { return _text; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("text string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _text = value; } } /**** Constructors ****/ public Object() { this.objParameters = new float[4]; } public Object(uint objectID, Anki.Vector.VizObjectType objectTypeID, uint color, float x_size_m, float y_size_m, float z_size_m, float x_trans_m, float y_trans_m, float z_trans_m, float rot_deg, float rot_axis_x, float rot_axis_y, float rot_axis_z, float[] objParameters, string text) { this.objectID = objectID; this.objectTypeID = objectTypeID; this.color = color; this.x_size_m = x_size_m; this.y_size_m = y_size_m; this.z_size_m = z_size_m; this.x_trans_m = x_trans_m; this.y_trans_m = y_trans_m; this.z_trans_m = z_trans_m; this.rot_deg = rot_deg; this.rot_axis_x = rot_axis_x; this.rot_axis_y = rot_axis_y; this.rot_axis_z = rot_axis_z; this.objParameters = objParameters; this.text = text; } public Object(System.IO.Stream stream) { Unpack(stream); } public Object(System.IO.BinaryReader reader) { Unpack(reader); } public Object Initialize(uint objectID, Anki.Vector.VizObjectType objectTypeID, uint color, float x_size_m, float y_size_m, float z_size_m, float x_trans_m, float y_trans_m, float z_trans_m, float rot_deg, float rot_axis_x, float rot_axis_y, float rot_axis_z, float[] objParameters, string text) { this.objectID = objectID; this.objectTypeID = objectTypeID; this.color = color; this.x_size_m = x_size_m; this.y_size_m = y_size_m; this.z_size_m = z_size_m; this.x_trans_m = x_trans_m; this.y_trans_m = y_trans_m; this.z_trans_m = z_trans_m; this.rot_deg = rot_deg; this.rot_axis_x = rot_axis_x; this.rot_axis_y = rot_axis_y; this.rot_axis_z = rot_axis_z; this.objParameters = objParameters; this.text = text; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _objectID = reader.ReadUInt32(); _objectTypeID = (Anki.Vector.VizObjectType)reader.ReadUInt32(); _color = reader.ReadUInt32(); _x_size_m = reader.ReadSingle(); _y_size_m = reader.ReadSingle(); _z_size_m = reader.ReadSingle(); _x_trans_m = reader.ReadSingle(); _y_trans_m = reader.ReadSingle(); _z_trans_m = reader.ReadSingle(); _rot_deg = reader.ReadSingle(); _rot_axis_x = reader.ReadSingle(); _rot_axis_y = reader.ReadSingle(); _rot_axis_z = reader.ReadSingle(); _objParameters = new float[4]; for (int i = 0; i < 4; ++i) { _objParameters[i] = reader.ReadSingle(); } int _text_length = (int)reader.ReadByte(); byte[] _text_bytes = reader.ReadBytes(_text_length); _text = System.Text.Encoding.UTF8.GetString(_text_bytes); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_objectID); writer.Write((uint)_objectTypeID); writer.Write((uint)_color); writer.Write((float)_x_size_m); writer.Write((float)_y_size_m); writer.Write((float)_z_size_m); writer.Write((float)_x_trans_m); writer.Write((float)_y_trans_m); writer.Write((float)_z_trans_m); writer.Write((float)_rot_deg); writer.Write((float)_rot_axis_x); writer.Write((float)_rot_axis_y); writer.Write((float)_rot_axis_z); for (int i = 0; i < 4; ++i) { writer.Write((float)_objParameters[i]); } if (_text != null) { byte[] _text_bytes = System.Text.Encoding.UTF8.GetBytes(_text); writer.Write((byte)_text_bytes.Length); writer.Write(_text_bytes); } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 4; // uint_32 result += 4; // VizObjectType result += 4; // uint_32 result += 4; // float_32 result += 4; // float_32 result += 4; // float_32 result += 4; // float_32 result += 4; // float_32 result += 4; // float_32 result += 4; // float_32 result += 4; // float_32 result += 4; // float_32 result += 4; // float_32 result += 4 * 4; result += 1; // uint_8 if (text != null) { result += System.Text.Encoding.UTF8.GetByteCount(text); } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(Object a, Object b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(Object a, Object b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as Object); } public bool Equals(Object p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._objectID.Equals(p._objectID) && this._objectTypeID.Equals(p._objectTypeID) && this._color.Equals(p._color) && this._x_size_m.Equals(p._x_size_m) && this._y_size_m.Equals(p._y_size_m) && this._z_size_m.Equals(p._z_size_m) && this._x_trans_m.Equals(p._x_trans_m) && this._y_trans_m.Equals(p._y_trans_m) && this._z_trans_m.Equals(p._z_trans_m) && this._rot_deg.Equals(p._rot_deg) && this._rot_axis_x.Equals(p._rot_axis_x) && this._rot_axis_y.Equals(p._rot_axis_y) && this._rot_axis_z.Equals(p._rot_axis_z) && ArrayEquals(this._objParameters,p._objParameters) && this._text.Equals(p._text); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._objectID.GetHashCode(); hash = hash * 23 + this._objectTypeID.GetHashCode(); hash = hash * 23 + this._color.GetHashCode(); hash = hash * 23 + this._x_size_m.GetHashCode(); hash = hash * 23 + this._y_size_m.GetHashCode(); hash = hash * 23 + this._z_size_m.GetHashCode(); hash = hash * 23 + this._x_trans_m.GetHashCode(); hash = hash * 23 + this._y_trans_m.GetHashCode(); hash = hash * 23 + this._z_trans_m.GetHashCode(); hash = hash * 23 + this._rot_deg.GetHashCode(); hash = hash * 23 + this._rot_axis_x.GetHashCode(); hash = hash * 23 + this._rot_axis_y.GetHashCode(); hash = hash * 23 + this._rot_axis_z.GetHashCode(); return hash; } } } public partial class LineSegment { private string _identifier; // string[uint_8] private uint _color; // uint_32 private float[] _origin; // float_32[3] private float[] _dest; // float_32[3] private bool _clearPrevious; // bool public string identifier { get { return _identifier; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("identifier string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _identifier = value; } } public uint color { get { return _color; } set { _color = value; } } public float[] origin { get { return _origin; } set { if (value == null) { throw new System.ArgumentException("origin fixed-length array is null. Must have a length of 3.", "value"); } if (value.Length != 3) { throw new System.ArgumentException("origin fixed-length array is the wrong size. Must have a length of 3.", "value"); } _origin = value; } } public float[] dest { get { return _dest; } set { if (value == null) { throw new System.ArgumentException("dest fixed-length array is null. Must have a length of 3.", "value"); } if (value.Length != 3) { throw new System.ArgumentException("dest fixed-length array is the wrong size. Must have a length of 3.", "value"); } _dest = value; } } public bool clearPrevious { get { return _clearPrevious; } set { _clearPrevious = value; } } /**** Constructors ****/ public LineSegment() { this.origin = new float[3]; this.dest = new float[3]; } public LineSegment(string identifier, uint color, float[] origin, float[] dest, bool clearPrevious) { this.identifier = identifier; this.color = color; this.origin = origin; this.dest = dest; this.clearPrevious = clearPrevious; } public LineSegment(System.IO.Stream stream) { Unpack(stream); } public LineSegment(System.IO.BinaryReader reader) { Unpack(reader); } public LineSegment Initialize(string identifier, uint color, float[] origin, float[] dest, bool clearPrevious) { this.identifier = identifier; this.color = color; this.origin = origin; this.dest = dest; this.clearPrevious = clearPrevious; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { int _identifier_length = (int)reader.ReadByte(); byte[] _identifier_bytes = reader.ReadBytes(_identifier_length); _identifier = System.Text.Encoding.UTF8.GetString(_identifier_bytes); _color = reader.ReadUInt32(); _origin = new float[3]; for (int i = 0; i < 3; ++i) { _origin[i] = reader.ReadSingle(); } _dest = new float[3]; for (int i = 0; i < 3; ++i) { _dest[i] = reader.ReadSingle(); } _clearPrevious = reader.ReadBoolean(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { if (_identifier != null) { byte[] _identifier_bytes = System.Text.Encoding.UTF8.GetBytes(_identifier); writer.Write((byte)_identifier_bytes.Length); writer.Write(_identifier_bytes); } else { writer.Write((byte)0); } writer.Write((uint)_color); for (int i = 0; i < 3; ++i) { writer.Write((float)_origin[i]); } for (int i = 0; i < 3; ++i) { writer.Write((float)_dest[i]); } writer.Write((bool)_clearPrevious); } public int Size { get { int result = 0; result += 1; // uint_8 if (identifier != null) { result += System.Text.Encoding.UTF8.GetByteCount(identifier); } result += 4; // uint_32 result += 3 * 4; result += 3 * 4; result += 1; // bool return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(LineSegment a, LineSegment b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(LineSegment a, LineSegment b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as LineSegment); } public bool Equals(LineSegment p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._identifier.Equals(p._identifier) && this._color.Equals(p._color) && ArrayEquals(this._origin,p._origin) && ArrayEquals(this._dest,p._dest) && this._clearPrevious.Equals(p._clearPrevious); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._color.GetHashCode(); hash = hash * 23 + this._clearPrevious.GetHashCode(); return hash; } } } public partial class Quad { private Anki.Vector.VizQuadType _quadType; // VizQuadType private uint _quadID; // uint_32 private uint _color; // uint_32 private float _xUpperLeft; // float_32 private float _yUpperLeft; // float_32 private float _zUpperLeft; // float_32 private float _xLowerLeft; // float_32 private float _yLowerLeft; // float_32 private float _zLowerLeft; // float_32 private float _xUpperRight; // float_32 private float _yUpperRight; // float_32 private float _zUpperRight; // float_32 private float _xLowerRight; // float_32 private float _yLowerRight; // float_32 private float _zLowerRight; // float_32 public Anki.Vector.VizQuadType quadType { get { return _quadType; } set { _quadType = value; } } public uint quadID { get { return _quadID; } set { _quadID = value; } } public uint color { get { return _color; } set { _color = value; } } public float xUpperLeft { get { return _xUpperLeft; } set { _xUpperLeft = value; } } public float yUpperLeft { get { return _yUpperLeft; } set { _yUpperLeft = value; } } public float zUpperLeft { get { return _zUpperLeft; } set { _zUpperLeft = value; } } public float xLowerLeft { get { return _xLowerLeft; } set { _xLowerLeft = value; } } public float yLowerLeft { get { return _yLowerLeft; } set { _yLowerLeft = value; } } public float zLowerLeft { get { return _zLowerLeft; } set { _zLowerLeft = value; } } public float xUpperRight { get { return _xUpperRight; } set { _xUpperRight = value; } } public float yUpperRight { get { return _yUpperRight; } set { _yUpperRight = value; } } public float zUpperRight { get { return _zUpperRight; } set { _zUpperRight = value; } } public float xLowerRight { get { return _xLowerRight; } set { _xLowerRight = value; } } public float yLowerRight { get { return _yLowerRight; } set { _yLowerRight = value; } } public float zLowerRight { get { return _zLowerRight; } set { _zLowerRight = value; } } /**** Constructors ****/ public Quad() { } public Quad(Anki.Vector.VizQuadType quadType, uint quadID, uint color, float xUpperLeft, float yUpperLeft, float zUpperLeft, float xLowerLeft, float yLowerLeft, float zLowerLeft, float xUpperRight, float yUpperRight, float zUpperRight, float xLowerRight, float yLowerRight, float zLowerRight) { this.quadType = quadType; this.quadID = quadID; this.color = color; this.xUpperLeft = xUpperLeft; this.yUpperLeft = yUpperLeft; this.zUpperLeft = zUpperLeft; this.xLowerLeft = xLowerLeft; this.yLowerLeft = yLowerLeft; this.zLowerLeft = zLowerLeft; this.xUpperRight = xUpperRight; this.yUpperRight = yUpperRight; this.zUpperRight = zUpperRight; this.xLowerRight = xLowerRight; this.yLowerRight = yLowerRight; this.zLowerRight = zLowerRight; } public Quad(System.IO.Stream stream) { Unpack(stream); } public Quad(System.IO.BinaryReader reader) { Unpack(reader); } public Quad Initialize(Anki.Vector.VizQuadType quadType, uint quadID, uint color, float xUpperLeft, float yUpperLeft, float zUpperLeft, float xLowerLeft, float yLowerLeft, float zLowerLeft, float xUpperRight, float yUpperRight, float zUpperRight, float xLowerRight, float yLowerRight, float zLowerRight) { this.quadType = quadType; this.quadID = quadID; this.color = color; this.xUpperLeft = xUpperLeft; this.yUpperLeft = yUpperLeft; this.zUpperLeft = zUpperLeft; this.xLowerLeft = xLowerLeft; this.yLowerLeft = yLowerLeft; this.zLowerLeft = zLowerLeft; this.xUpperRight = xUpperRight; this.yUpperRight = yUpperRight; this.zUpperRight = zUpperRight; this.xLowerRight = xLowerRight; this.yLowerRight = yLowerRight; this.zLowerRight = zLowerRight; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _quadType = (Anki.Vector.VizQuadType)reader.ReadByte(); _quadID = reader.ReadUInt32(); _color = reader.ReadUInt32(); _xUpperLeft = reader.ReadSingle(); _yUpperLeft = reader.ReadSingle(); _zUpperLeft = reader.ReadSingle(); _xLowerLeft = reader.ReadSingle(); _yLowerLeft = reader.ReadSingle(); _zLowerLeft = reader.ReadSingle(); _xUpperRight = reader.ReadSingle(); _yUpperRight = reader.ReadSingle(); _zUpperRight = reader.ReadSingle(); _xLowerRight = reader.ReadSingle(); _yLowerRight = reader.ReadSingle(); _zLowerRight = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((byte)_quadType); writer.Write((uint)_quadID); writer.Write((uint)_color); writer.Write((float)_xUpperLeft); writer.Write((float)_yUpperLeft); writer.Write((float)_zUpperLeft); writer.Write((float)_xLowerLeft); writer.Write((float)_yLowerLeft); writer.Write((float)_zLowerLeft); writer.Write((float)_xUpperRight); writer.Write((float)_yUpperRight); writer.Write((float)_zUpperRight); writer.Write((float)_xLowerRight); writer.Write((float)_yLowerRight); writer.Write((float)_zLowerRight); } public int Size { get { return 57; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(Quad a, Quad b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(Quad a, Quad b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as Quad); } public bool Equals(Quad p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._quadType.Equals(p._quadType) && this._quadID.Equals(p._quadID) && this._color.Equals(p._color) && this._xUpperLeft.Equals(p._xUpperLeft) && this._yUpperLeft.Equals(p._yUpperLeft) && this._zUpperLeft.Equals(p._zUpperLeft) && this._xLowerLeft.Equals(p._xLowerLeft) && this._yLowerLeft.Equals(p._yLowerLeft) && this._zLowerLeft.Equals(p._zLowerLeft) && this._xUpperRight.Equals(p._xUpperRight) && this._yUpperRight.Equals(p._yUpperRight) && this._zUpperRight.Equals(p._zUpperRight) && this._xLowerRight.Equals(p._xLowerRight) && this._yLowerRight.Equals(p._yLowerRight) && this._zLowerRight.Equals(p._zLowerRight); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._quadType.GetHashCode(); hash = hash * 23 + this._quadID.GetHashCode(); hash = hash * 23 + this._color.GetHashCode(); hash = hash * 23 + this._xUpperLeft.GetHashCode(); hash = hash * 23 + this._yUpperLeft.GetHashCode(); hash = hash * 23 + this._zUpperLeft.GetHashCode(); hash = hash * 23 + this._xLowerLeft.GetHashCode(); hash = hash * 23 + this._yLowerLeft.GetHashCode(); hash = hash * 23 + this._zLowerLeft.GetHashCode(); hash = hash * 23 + this._xUpperRight.GetHashCode(); hash = hash * 23 + this._yUpperRight.GetHashCode(); hash = hash * 23 + this._zUpperRight.GetHashCode(); hash = hash * 23 + this._xLowerRight.GetHashCode(); hash = hash * 23 + this._yLowerRight.GetHashCode(); hash = hash * 23 + this._zLowerRight.GetHashCode(); return hash; } } } public partial class MemoryMapMessageVizBegin { private uint _originId; // uint_32 private Anki.Vector.ExternalInterface.MemoryMapInfo _info; // MemoryMapInfo public uint originId { get { return _originId; } set { _originId = value; } } public Anki.Vector.ExternalInterface.MemoryMapInfo info { get { return _info; } set { if (value == null) { throw new System.ArgumentNullException("info cannot be null.", "value"); } _info = value; } } /**** Constructors ****/ public MemoryMapMessageVizBegin() { this.info = new Anki.Vector.ExternalInterface.MemoryMapInfo(); } public MemoryMapMessageVizBegin(uint originId, Anki.Vector.ExternalInterface.MemoryMapInfo info) { this.originId = originId; this.info = info; } public MemoryMapMessageVizBegin(System.IO.Stream stream) { Unpack(stream); } public MemoryMapMessageVizBegin(System.IO.BinaryReader reader) { Unpack(reader); } public MemoryMapMessageVizBegin Initialize(uint originId, Anki.Vector.ExternalInterface.MemoryMapInfo info) { this.originId = originId; this.info = info; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _originId = reader.ReadUInt32(); _info = new Anki.Vector.ExternalInterface.MemoryMapInfo(reader); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_originId); _info.Pack(writer); } public int Size { get { int result = 0; result += 4; // uint_32 result += info.Size; return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(MemoryMapMessageVizBegin a, MemoryMapMessageVizBegin b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(MemoryMapMessageVizBegin a, MemoryMapMessageVizBegin b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as MemoryMapMessageVizBegin); } public bool Equals(MemoryMapMessageVizBegin p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._originId.Equals(p._originId) && this._info.Equals(p._info); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._originId.GetHashCode(); hash = hash * 23 + this._info.GetHashCode(); return hash; } } } public partial class MemoryMapMessageViz { private uint _originId; // uint_32 private Anki.Vector.ExternalInterface.MemoryMapQuadInfoFull[] _quadInfos; // MemoryMapQuadInfoFull[uint_16] public uint originId { get { return _originId; } set { _originId = value; } } public Anki.Vector.ExternalInterface.MemoryMapQuadInfoFull[] quadInfos { get { return _quadInfos; } set { if (value != null && value.Length > 65535) { throw new System.ArgumentException("quadInfos variable-length array is too long. Must be less than or equal to 65535.", "value"); } _quadInfos = value; } } /**** Constructors ****/ public MemoryMapMessageViz() { } public MemoryMapMessageViz(uint originId, Anki.Vector.ExternalInterface.MemoryMapQuadInfoFull[] quadInfos) { this.originId = originId; this.quadInfos = quadInfos; } public MemoryMapMessageViz(System.IO.Stream stream) { Unpack(stream); } public MemoryMapMessageViz(System.IO.BinaryReader reader) { Unpack(reader); } public MemoryMapMessageViz Initialize(uint originId, Anki.Vector.ExternalInterface.MemoryMapQuadInfoFull[] quadInfos) { this.originId = originId; this.quadInfos = quadInfos; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _originId = reader.ReadUInt32(); int _quadInfos_length = (int)reader.ReadUInt16(); _quadInfos = new Anki.Vector.ExternalInterface.MemoryMapQuadInfoFull[_quadInfos_length]; for (int i = 0; i < _quadInfos_length; ++i) { _quadInfos[i] = new Anki.Vector.ExternalInterface.MemoryMapQuadInfoFull(reader); } } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_originId); if (_quadInfos != null) { writer.Write((ushort)_quadInfos.Length); for (int i = 0; i < _quadInfos.Length; ++i) { if (_quadInfos[i] == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } _quadInfos[i].Pack(writer); } } else { writer.Write((ushort)0); } } public int Size { get { int result = 0; result += 4; // uint_32 result += 2; // uint_16 if (quadInfos != null) { result += quadInfos.Length * 16; // MemoryMapQuadInfoFull } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(MemoryMapMessageViz a, MemoryMapMessageViz b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(MemoryMapMessageViz a, MemoryMapMessageViz b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as MemoryMapMessageViz); } public bool Equals(MemoryMapMessageViz p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._originId.Equals(p._originId) && ArrayEquals(this._quadInfos,p._quadInfos); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._originId.GetHashCode(); return hash; } } } public partial class MemoryMapMessageVizEnd { private uint _originId; // uint_32 public uint originId { get { return _originId; } set { _originId = value; } } /**** Constructors ****/ public MemoryMapMessageVizEnd() { } public MemoryMapMessageVizEnd(uint originId) { this.originId = originId; } public MemoryMapMessageVizEnd(System.IO.Stream stream) { Unpack(stream); } public MemoryMapMessageVizEnd(System.IO.BinaryReader reader) { Unpack(reader); } public MemoryMapMessageVizEnd Initialize(uint originId) { this.originId = originId; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _originId = reader.ReadUInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_originId); } public int Size { get { return 4; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(MemoryMapMessageVizEnd a, MemoryMapMessageVizEnd b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(MemoryMapMessageVizEnd a, MemoryMapMessageVizEnd b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as MemoryMapMessageVizEnd); } public bool Equals(MemoryMapMessageVizEnd p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._originId.Equals(p._originId); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._originId.GetHashCode(); return hash; } } } public partial class EnabledVisionModes { private Anki.Vector.VisionMode[] _modes; // VisionMode[uint_16] public Anki.Vector.VisionMode[] modes { get { return _modes; } set { if (value != null && value.Length > 65535) { throw new System.ArgumentException("modes variable-length array is too long. Must be less than or equal to 65535.", "value"); } _modes = value; } } /**** Constructors ****/ public EnabledVisionModes() { } public EnabledVisionModes(Anki.Vector.VisionMode[] modes) { this.modes = modes; } public EnabledVisionModes(System.IO.Stream stream) { Unpack(stream); } public EnabledVisionModes(System.IO.BinaryReader reader) { Unpack(reader); } public EnabledVisionModes Initialize(Anki.Vector.VisionMode[] modes) { this.modes = modes; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { int _modes_length = (int)reader.ReadUInt16(); _modes = new Anki.Vector.VisionMode[_modes_length]; for (int i = 0; i < _modes_length; ++i) { _modes[i] = (Anki.Vector.VisionMode)reader.ReadUInt32(); } } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { if (_modes != null) { writer.Write((ushort)_modes.Length); for (int i = 0; i < _modes.Length; ++i) { writer.Write((uint)_modes[i]); } } else { writer.Write((ushort)0); } } public int Size { get { int result = 0; result += 2; // uint_16 if (modes != null) { result += modes.Length * 4; // VisionMode } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(EnabledVisionModes a, EnabledVisionModes b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(EnabledVisionModes a, EnabledVisionModes b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as EnabledVisionModes); } public bool Equals(EnabledVisionModes p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return ArrayEquals(this._modes,p._modes); } public override int GetHashCode() { unchecked { int hash = 17; return hash; } } } public partial class CameraQuad { private uint _color; // uint_32 private uint _topColor; // uint_32 private float _xUpperLeft; // float_32 private float _yUpperLeft; // float_32 private float _xLowerLeft; // float_32 private float _yLowerLeft; // float_32 private float _xUpperRight; // float_32 private float _yUpperRight; // float_32 private float _xLowerRight; // float_32 private float _yLowerRight; // float_32 public uint color { get { return _color; } set { _color = value; } } public uint topColor { get { return _topColor; } set { _topColor = value; } } public float xUpperLeft { get { return _xUpperLeft; } set { _xUpperLeft = value; } } public float yUpperLeft { get { return _yUpperLeft; } set { _yUpperLeft = value; } } public float xLowerLeft { get { return _xLowerLeft; } set { _xLowerLeft = value; } } public float yLowerLeft { get { return _yLowerLeft; } set { _yLowerLeft = value; } } public float xUpperRight { get { return _xUpperRight; } set { _xUpperRight = value; } } public float yUpperRight { get { return _yUpperRight; } set { _yUpperRight = value; } } public float xLowerRight { get { return _xLowerRight; } set { _xLowerRight = value; } } public float yLowerRight { get { return _yLowerRight; } set { _yLowerRight = value; } } /**** Constructors ****/ public CameraQuad() { } public CameraQuad(uint color, uint topColor, float xUpperLeft, float yUpperLeft, float xLowerLeft, float yLowerLeft, float xUpperRight, float yUpperRight, float xLowerRight, float yLowerRight) { this.color = color; this.topColor = topColor; this.xUpperLeft = xUpperLeft; this.yUpperLeft = yUpperLeft; this.xLowerLeft = xLowerLeft; this.yLowerLeft = yLowerLeft; this.xUpperRight = xUpperRight; this.yUpperRight = yUpperRight; this.xLowerRight = xLowerRight; this.yLowerRight = yLowerRight; } public CameraQuad(System.IO.Stream stream) { Unpack(stream); } public CameraQuad(System.IO.BinaryReader reader) { Unpack(reader); } public CameraQuad Initialize(uint color, uint topColor, float xUpperLeft, float yUpperLeft, float xLowerLeft, float yLowerLeft, float xUpperRight, float yUpperRight, float xLowerRight, float yLowerRight) { this.color = color; this.topColor = topColor; this.xUpperLeft = xUpperLeft; this.yUpperLeft = yUpperLeft; this.xLowerLeft = xLowerLeft; this.yLowerLeft = yLowerLeft; this.xUpperRight = xUpperRight; this.yUpperRight = yUpperRight; this.xLowerRight = xLowerRight; this.yLowerRight = yLowerRight; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _color = reader.ReadUInt32(); _topColor = reader.ReadUInt32(); _xUpperLeft = reader.ReadSingle(); _yUpperLeft = reader.ReadSingle(); _xLowerLeft = reader.ReadSingle(); _yLowerLeft = reader.ReadSingle(); _xUpperRight = reader.ReadSingle(); _yUpperRight = reader.ReadSingle(); _xLowerRight = reader.ReadSingle(); _yLowerRight = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_color); writer.Write((uint)_topColor); writer.Write((float)_xUpperLeft); writer.Write((float)_yUpperLeft); writer.Write((float)_xLowerLeft); writer.Write((float)_yLowerLeft); writer.Write((float)_xUpperRight); writer.Write((float)_yUpperRight); writer.Write((float)_xLowerRight); writer.Write((float)_yLowerRight); } public int Size { get { return 40; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(CameraQuad a, CameraQuad b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(CameraQuad a, CameraQuad b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as CameraQuad); } public bool Equals(CameraQuad p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._color.Equals(p._color) && this._topColor.Equals(p._topColor) && this._xUpperLeft.Equals(p._xUpperLeft) && this._yUpperLeft.Equals(p._yUpperLeft) && this._xLowerLeft.Equals(p._xLowerLeft) && this._yLowerLeft.Equals(p._yLowerLeft) && this._xUpperRight.Equals(p._xUpperRight) && this._yUpperRight.Equals(p._yUpperRight) && this._xLowerRight.Equals(p._xLowerRight) && this._yLowerRight.Equals(p._yLowerRight); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._color.GetHashCode(); hash = hash * 23 + this._topColor.GetHashCode(); hash = hash * 23 + this._xUpperLeft.GetHashCode(); hash = hash * 23 + this._yUpperLeft.GetHashCode(); hash = hash * 23 + this._xLowerLeft.GetHashCode(); hash = hash * 23 + this._yLowerLeft.GetHashCode(); hash = hash * 23 + this._xUpperRight.GetHashCode(); hash = hash * 23 + this._yUpperRight.GetHashCode(); hash = hash * 23 + this._xLowerRight.GetHashCode(); hash = hash * 23 + this._yLowerRight.GetHashCode(); return hash; } } } public partial class CameraRect { private uint _color; // uint_32 private float _x; // float_32 private float _y; // float_32 private float _width; // float_32 private float _height; // float_32 private bool _filled; // bool public uint color { get { return _color; } set { _color = value; } } public float x { get { return _x; } set { _x = value; } } public float y { get { return _y; } set { _y = value; } } public float width { get { return _width; } set { _width = value; } } public float height { get { return _height; } set { _height = value; } } public bool filled { get { return _filled; } set { _filled = value; } } /**** Constructors ****/ public CameraRect() { } public CameraRect(uint color, float x, float y, float width, float height, bool filled) { this.color = color; this.x = x; this.y = y; this.width = width; this.height = height; this.filled = filled; } public CameraRect(System.IO.Stream stream) { Unpack(stream); } public CameraRect(System.IO.BinaryReader reader) { Unpack(reader); } public CameraRect Initialize(uint color, float x, float y, float width, float height, bool filled) { this.color = color; this.x = x; this.y = y; this.width = width; this.height = height; this.filled = filled; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _color = reader.ReadUInt32(); _x = reader.ReadSingle(); _y = reader.ReadSingle(); _width = reader.ReadSingle(); _height = reader.ReadSingle(); _filled = reader.ReadBoolean(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_color); writer.Write((float)_x); writer.Write((float)_y); writer.Write((float)_width); writer.Write((float)_height); writer.Write((bool)_filled); } public int Size { get { return 21; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(CameraRect a, CameraRect b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(CameraRect a, CameraRect b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as CameraRect); } public bool Equals(CameraRect p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._color.Equals(p._color) && this._x.Equals(p._x) && this._y.Equals(p._y) && this._width.Equals(p._width) && this._height.Equals(p._height) && this._filled.Equals(p._filled); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._color.GetHashCode(); hash = hash * 23 + this._x.GetHashCode(); hash = hash * 23 + this._y.GetHashCode(); hash = hash * 23 + this._width.GetHashCode(); hash = hash * 23 + this._height.GetHashCode(); hash = hash * 23 + this._filled.GetHashCode(); return hash; } } } public partial class CameraLine { private uint _color; // uint_32 private float _xStart; // float_32 private float _yStart; // float_32 private float _xEnd; // float_32 private float _yEnd; // float_32 public uint color { get { return _color; } set { _color = value; } } public float xStart { get { return _xStart; } set { _xStart = value; } } public float yStart { get { return _yStart; } set { _yStart = value; } } public float xEnd { get { return _xEnd; } set { _xEnd = value; } } public float yEnd { get { return _yEnd; } set { _yEnd = value; } } /**** Constructors ****/ public CameraLine() { } public CameraLine(uint color, float xStart, float yStart, float xEnd, float yEnd) { this.color = color; this.xStart = xStart; this.yStart = yStart; this.xEnd = xEnd; this.yEnd = yEnd; } public CameraLine(System.IO.Stream stream) { Unpack(stream); } public CameraLine(System.IO.BinaryReader reader) { Unpack(reader); } public CameraLine Initialize(uint color, float xStart, float yStart, float xEnd, float yEnd) { this.color = color; this.xStart = xStart; this.yStart = yStart; this.xEnd = xEnd; this.yEnd = yEnd; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _color = reader.ReadUInt32(); _xStart = reader.ReadSingle(); _yStart = reader.ReadSingle(); _xEnd = reader.ReadSingle(); _yEnd = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_color); writer.Write((float)_xStart); writer.Write((float)_yStart); writer.Write((float)_xEnd); writer.Write((float)_yEnd); } public int Size { get { return 20; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(CameraLine a, CameraLine b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(CameraLine a, CameraLine b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as CameraLine); } public bool Equals(CameraLine p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._color.Equals(p._color) && this._xStart.Equals(p._xStart) && this._yStart.Equals(p._yStart) && this._xEnd.Equals(p._xEnd) && this._yEnd.Equals(p._yEnd); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._color.GetHashCode(); hash = hash * 23 + this._xStart.GetHashCode(); hash = hash * 23 + this._yStart.GetHashCode(); hash = hash * 23 + this._xEnd.GetHashCode(); hash = hash * 23 + this._yEnd.GetHashCode(); return hash; } } } public partial class CameraOval { private uint _color; // uint_32 private float _xCen; // float_32 private float _yCen; // float_32 private float _xRad; // float_32 private float _yRad; // float_32 public uint color { get { return _color; } set { _color = value; } } public float xCen { get { return _xCen; } set { _xCen = value; } } public float yCen { get { return _yCen; } set { _yCen = value; } } public float xRad { get { return _xRad; } set { _xRad = value; } } public float yRad { get { return _yRad; } set { _yRad = value; } } /**** Constructors ****/ public CameraOval() { } public CameraOval(uint color, float xCen, float yCen, float xRad, float yRad) { this.color = color; this.xCen = xCen; this.yCen = yCen; this.xRad = xRad; this.yRad = yRad; } public CameraOval(System.IO.Stream stream) { Unpack(stream); } public CameraOval(System.IO.BinaryReader reader) { Unpack(reader); } public CameraOval Initialize(uint color, float xCen, float yCen, float xRad, float yRad) { this.color = color; this.xCen = xCen; this.yCen = yCen; this.xRad = xRad; this.yRad = yRad; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _color = reader.ReadUInt32(); _xCen = reader.ReadSingle(); _yCen = reader.ReadSingle(); _xRad = reader.ReadSingle(); _yRad = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_color); writer.Write((float)_xCen); writer.Write((float)_yCen); writer.Write((float)_xRad); writer.Write((float)_yRad); } public int Size { get { return 20; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(CameraOval a, CameraOval b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(CameraOval a, CameraOval b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as CameraOval); } public bool Equals(CameraOval p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._color.Equals(p._color) && this._xCen.Equals(p._xCen) && this._yCen.Equals(p._yCen) && this._xRad.Equals(p._xRad) && this._yRad.Equals(p._yRad); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._color.GetHashCode(); hash = hash * 23 + this._xCen.GetHashCode(); hash = hash * 23 + this._yCen.GetHashCode(); hash = hash * 23 + this._xRad.GetHashCode(); hash = hash * 23 + this._yRad.GetHashCode(); return hash; } } } public partial class CameraText { private uint _color; // uint_32 private int _x; // int_32 private int _y; // int_32 private string _text; // string[uint_8] public uint color { get { return _color; } set { _color = value; } } public int x { get { return _x; } set { _x = value; } } public int y { get { return _y; } set { _y = value; } } public string text { get { return _text; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("text string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _text = value; } } /**** Constructors ****/ public CameraText() { } public CameraText(uint color, int x, int y, string text) { this.color = color; this.x = x; this.y = y; this.text = text; } public CameraText(System.IO.Stream stream) { Unpack(stream); } public CameraText(System.IO.BinaryReader reader) { Unpack(reader); } public CameraText Initialize(uint color, int x, int y, string text) { this.color = color; this.x = x; this.y = y; this.text = text; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _color = reader.ReadUInt32(); _x = reader.ReadInt32(); _y = reader.ReadInt32(); int _text_length = (int)reader.ReadByte(); byte[] _text_bytes = reader.ReadBytes(_text_length); _text = System.Text.Encoding.UTF8.GetString(_text_bytes); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_color); writer.Write((int)_x); writer.Write((int)_y); if (_text != null) { byte[] _text_bytes = System.Text.Encoding.UTF8.GetBytes(_text); writer.Write((byte)_text_bytes.Length); writer.Write(_text_bytes); } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 4; // uint_32 result += 4; // int_32 result += 4; // int_32 result += 1; // uint_8 if (text != null) { result += System.Text.Encoding.UTF8.GetByteCount(text); } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(CameraText a, CameraText b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(CameraText a, CameraText b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as CameraText); } public bool Equals(CameraText p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._color.Equals(p._color) && this._x.Equals(p._x) && this._y.Equals(p._y) && this._text.Equals(p._text); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._color.GetHashCode(); hash = hash * 23 + this._x.GetHashCode(); hash = hash * 23 + this._y.GetHashCode(); return hash; } } } public partial class EraseObject { private uint _objectID; // uint_32 private uint _lower_bound_id; // uint_32 private uint _upper_bound_id; // uint_32 public uint objectID { get { return _objectID; } set { _objectID = value; } } public uint lower_bound_id { get { return _lower_bound_id; } set { _lower_bound_id = value; } } public uint upper_bound_id { get { return _upper_bound_id; } set { _upper_bound_id = value; } } /**** Constructors ****/ public EraseObject() { } public EraseObject(uint objectID, uint lower_bound_id, uint upper_bound_id) { this.objectID = objectID; this.lower_bound_id = lower_bound_id; this.upper_bound_id = upper_bound_id; } public EraseObject(System.IO.Stream stream) { Unpack(stream); } public EraseObject(System.IO.BinaryReader reader) { Unpack(reader); } public EraseObject Initialize(uint objectID, uint lower_bound_id, uint upper_bound_id) { this.objectID = objectID; this.lower_bound_id = lower_bound_id; this.upper_bound_id = upper_bound_id; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _objectID = reader.ReadUInt32(); _lower_bound_id = reader.ReadUInt32(); _upper_bound_id = reader.ReadUInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_objectID); writer.Write((uint)_lower_bound_id); writer.Write((uint)_upper_bound_id); } public int Size { get { return 12; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(EraseObject a, EraseObject b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(EraseObject a, EraseObject b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as EraseObject); } public bool Equals(EraseObject p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._objectID.Equals(p._objectID) && this._lower_bound_id.Equals(p._lower_bound_id) && this._upper_bound_id.Equals(p._upper_bound_id); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._objectID.GetHashCode(); hash = hash * 23 + this._lower_bound_id.GetHashCode(); hash = hash * 23 + this._upper_bound_id.GetHashCode(); return hash; } } } public partial class EraseLineSegments { private string _identifier; // string[uint_8] public string identifier { get { return _identifier; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("identifier string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _identifier = value; } } /**** Constructors ****/ public EraseLineSegments() { } public EraseLineSegments(string identifier) { this.identifier = identifier; } public EraseLineSegments(System.IO.Stream stream) { Unpack(stream); } public EraseLineSegments(System.IO.BinaryReader reader) { Unpack(reader); } public EraseLineSegments Initialize(string identifier) { this.identifier = identifier; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { int _identifier_length = (int)reader.ReadByte(); byte[] _identifier_bytes = reader.ReadBytes(_identifier_length); _identifier = System.Text.Encoding.UTF8.GetString(_identifier_bytes); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { if (_identifier != null) { byte[] _identifier_bytes = System.Text.Encoding.UTF8.GetBytes(_identifier); writer.Write((byte)_identifier_bytes.Length); writer.Write(_identifier_bytes); } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 1; // uint_8 if (identifier != null) { result += System.Text.Encoding.UTF8.GetByteCount(identifier); } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(EraseLineSegments a, EraseLineSegments b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(EraseLineSegments a, EraseLineSegments b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as EraseLineSegments); } public bool Equals(EraseLineSegments p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._identifier.Equals(p._identifier); } public override int GetHashCode() { unchecked { int hash = 17; return hash; } } } public partial class EraseQuad { private uint _quadType; // uint_32 private uint _quadID; // uint_32 public uint quadType { get { return _quadType; } set { _quadType = value; } } public uint quadID { get { return _quadID; } set { _quadID = value; } } /**** Constructors ****/ public EraseQuad() { } public EraseQuad(uint quadType, uint quadID) { this.quadType = quadType; this.quadID = quadID; } public EraseQuad(System.IO.Stream stream) { Unpack(stream); } public EraseQuad(System.IO.BinaryReader reader) { Unpack(reader); } public EraseQuad Initialize(uint quadType, uint quadID) { this.quadType = quadType; this.quadID = quadID; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _quadType = reader.ReadUInt32(); _quadID = reader.ReadUInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_quadType); writer.Write((uint)_quadID); } public int Size { get { return 8; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(EraseQuad a, EraseQuad b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(EraseQuad a, EraseQuad b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as EraseQuad); } public bool Equals(EraseQuad p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._quadType.Equals(p._quadType) && this._quadID.Equals(p._quadID); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._quadType.GetHashCode(); hash = hash * 23 + this._quadID.GetHashCode(); return hash; } } } public partial class SetRobot { private float _x_trans_m; // float_32 private float _y_trans_m; // float_32 private float _z_trans_m; // float_32 private float _rot_rad; // float_32 private float _rot_axis_x; // float_32 private float _rot_axis_y; // float_32 private float _rot_axis_z; // float_32 private float _head_angle; // float_32 private float _lift_angle; // float_32 public float x_trans_m { get { return _x_trans_m; } set { _x_trans_m = value; } } public float y_trans_m { get { return _y_trans_m; } set { _y_trans_m = value; } } public float z_trans_m { get { return _z_trans_m; } set { _z_trans_m = value; } } public float rot_rad { get { return _rot_rad; } set { _rot_rad = value; } } public float rot_axis_x { get { return _rot_axis_x; } set { _rot_axis_x = value; } } public float rot_axis_y { get { return _rot_axis_y; } set { _rot_axis_y = value; } } public float rot_axis_z { get { return _rot_axis_z; } set { _rot_axis_z = value; } } public float head_angle { get { return _head_angle; } set { _head_angle = value; } } public float lift_angle { get { return _lift_angle; } set { _lift_angle = value; } } /**** Constructors ****/ public SetRobot() { } public SetRobot(float x_trans_m, float y_trans_m, float z_trans_m, float rot_rad, float rot_axis_x, float rot_axis_y, float rot_axis_z, float head_angle, float lift_angle) { this.x_trans_m = x_trans_m; this.y_trans_m = y_trans_m; this.z_trans_m = z_trans_m; this.rot_rad = rot_rad; this.rot_axis_x = rot_axis_x; this.rot_axis_y = rot_axis_y; this.rot_axis_z = rot_axis_z; this.head_angle = head_angle; this.lift_angle = lift_angle; } public SetRobot(System.IO.Stream stream) { Unpack(stream); } public SetRobot(System.IO.BinaryReader reader) { Unpack(reader); } public SetRobot Initialize(float x_trans_m, float y_trans_m, float z_trans_m, float rot_rad, float rot_axis_x, float rot_axis_y, float rot_axis_z, float head_angle, float lift_angle) { this.x_trans_m = x_trans_m; this.y_trans_m = y_trans_m; this.z_trans_m = z_trans_m; this.rot_rad = rot_rad; this.rot_axis_x = rot_axis_x; this.rot_axis_y = rot_axis_y; this.rot_axis_z = rot_axis_z; this.head_angle = head_angle; this.lift_angle = lift_angle; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _x_trans_m = reader.ReadSingle(); _y_trans_m = reader.ReadSingle(); _z_trans_m = reader.ReadSingle(); _rot_rad = reader.ReadSingle(); _rot_axis_x = reader.ReadSingle(); _rot_axis_y = reader.ReadSingle(); _rot_axis_z = reader.ReadSingle(); _head_angle = reader.ReadSingle(); _lift_angle = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((float)_x_trans_m); writer.Write((float)_y_trans_m); writer.Write((float)_z_trans_m); writer.Write((float)_rot_rad); writer.Write((float)_rot_axis_x); writer.Write((float)_rot_axis_y); writer.Write((float)_rot_axis_z); writer.Write((float)_head_angle); writer.Write((float)_lift_angle); } public int Size { get { return 36; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(SetRobot a, SetRobot b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(SetRobot a, SetRobot b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as SetRobot); } public bool Equals(SetRobot p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._x_trans_m.Equals(p._x_trans_m) && this._y_trans_m.Equals(p._y_trans_m) && this._z_trans_m.Equals(p._z_trans_m) && this._rot_rad.Equals(p._rot_rad) && this._rot_axis_x.Equals(p._rot_axis_x) && this._rot_axis_y.Equals(p._rot_axis_y) && this._rot_axis_z.Equals(p._rot_axis_z) && this._head_angle.Equals(p._head_angle) && this._lift_angle.Equals(p._lift_angle); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._x_trans_m.GetHashCode(); hash = hash * 23 + this._y_trans_m.GetHashCode(); hash = hash * 23 + this._z_trans_m.GetHashCode(); hash = hash * 23 + this._rot_rad.GetHashCode(); hash = hash * 23 + this._rot_axis_x.GetHashCode(); hash = hash * 23 + this._rot_axis_y.GetHashCode(); hash = hash * 23 + this._rot_axis_z.GetHashCode(); hash = hash * 23 + this._head_angle.GetHashCode(); hash = hash * 23 + this._lift_angle.GetHashCode(); return hash; } } } public partial class AppendPathSegmentLine { private uint _pathID; // uint_32 private float _x_start_m; // float_32 private float _y_start_m; // float_32 private float _z_start_m; // float_32 private float _x_end_m; // float_32 private float _y_end_m; // float_32 private float _z_end_m; // float_32 public uint pathID { get { return _pathID; } set { _pathID = value; } } public float x_start_m { get { return _x_start_m; } set { _x_start_m = value; } } public float y_start_m { get { return _y_start_m; } set { _y_start_m = value; } } public float z_start_m { get { return _z_start_m; } set { _z_start_m = value; } } public float x_end_m { get { return _x_end_m; } set { _x_end_m = value; } } public float y_end_m { get { return _y_end_m; } set { _y_end_m = value; } } public float z_end_m { get { return _z_end_m; } set { _z_end_m = value; } } /**** Constructors ****/ public AppendPathSegmentLine() { } public AppendPathSegmentLine(uint pathID, float x_start_m, float y_start_m, float z_start_m, float x_end_m, float y_end_m, float z_end_m) { this.pathID = pathID; this.x_start_m = x_start_m; this.y_start_m = y_start_m; this.z_start_m = z_start_m; this.x_end_m = x_end_m; this.y_end_m = y_end_m; this.z_end_m = z_end_m; } public AppendPathSegmentLine(System.IO.Stream stream) { Unpack(stream); } public AppendPathSegmentLine(System.IO.BinaryReader reader) { Unpack(reader); } public AppendPathSegmentLine Initialize(uint pathID, float x_start_m, float y_start_m, float z_start_m, float x_end_m, float y_end_m, float z_end_m) { this.pathID = pathID; this.x_start_m = x_start_m; this.y_start_m = y_start_m; this.z_start_m = z_start_m; this.x_end_m = x_end_m; this.y_end_m = y_end_m; this.z_end_m = z_end_m; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _pathID = reader.ReadUInt32(); _x_start_m = reader.ReadSingle(); _y_start_m = reader.ReadSingle(); _z_start_m = reader.ReadSingle(); _x_end_m = reader.ReadSingle(); _y_end_m = reader.ReadSingle(); _z_end_m = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_pathID); writer.Write((float)_x_start_m); writer.Write((float)_y_start_m); writer.Write((float)_z_start_m); writer.Write((float)_x_end_m); writer.Write((float)_y_end_m); writer.Write((float)_z_end_m); } public int Size { get { return 28; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(AppendPathSegmentLine a, AppendPathSegmentLine b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(AppendPathSegmentLine a, AppendPathSegmentLine b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as AppendPathSegmentLine); } public bool Equals(AppendPathSegmentLine p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._pathID.Equals(p._pathID) && this._x_start_m.Equals(p._x_start_m) && this._y_start_m.Equals(p._y_start_m) && this._z_start_m.Equals(p._z_start_m) && this._x_end_m.Equals(p._x_end_m) && this._y_end_m.Equals(p._y_end_m) && this._z_end_m.Equals(p._z_end_m); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._pathID.GetHashCode(); hash = hash * 23 + this._x_start_m.GetHashCode(); hash = hash * 23 + this._y_start_m.GetHashCode(); hash = hash * 23 + this._z_start_m.GetHashCode(); hash = hash * 23 + this._x_end_m.GetHashCode(); hash = hash * 23 + this._y_end_m.GetHashCode(); hash = hash * 23 + this._z_end_m.GetHashCode(); return hash; } } } public partial class AppendPathSegmentArc { private uint _pathID; // uint_32 private float _x_center_m; // float_32 private float _y_center_m; // float_32 private float _radius_m; // float_32 private float _start_rad; // float_32 private float _sweep_rad; // float_32 public uint pathID { get { return _pathID; } set { _pathID = value; } } public float x_center_m { get { return _x_center_m; } set { _x_center_m = value; } } public float y_center_m { get { return _y_center_m; } set { _y_center_m = value; } } public float radius_m { get { return _radius_m; } set { _radius_m = value; } } public float start_rad { get { return _start_rad; } set { _start_rad = value; } } public float sweep_rad { get { return _sweep_rad; } set { _sweep_rad = value; } } /**** Constructors ****/ public AppendPathSegmentArc() { } public AppendPathSegmentArc(uint pathID, float x_center_m, float y_center_m, float radius_m, float start_rad, float sweep_rad) { this.pathID = pathID; this.x_center_m = x_center_m; this.y_center_m = y_center_m; this.radius_m = radius_m; this.start_rad = start_rad; this.sweep_rad = sweep_rad; } public AppendPathSegmentArc(System.IO.Stream stream) { Unpack(stream); } public AppendPathSegmentArc(System.IO.BinaryReader reader) { Unpack(reader); } public AppendPathSegmentArc Initialize(uint pathID, float x_center_m, float y_center_m, float radius_m, float start_rad, float sweep_rad) { this.pathID = pathID; this.x_center_m = x_center_m; this.y_center_m = y_center_m; this.radius_m = radius_m; this.start_rad = start_rad; this.sweep_rad = sweep_rad; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _pathID = reader.ReadUInt32(); _x_center_m = reader.ReadSingle(); _y_center_m = reader.ReadSingle(); _radius_m = reader.ReadSingle(); _start_rad = reader.ReadSingle(); _sweep_rad = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_pathID); writer.Write((float)_x_center_m); writer.Write((float)_y_center_m); writer.Write((float)_radius_m); writer.Write((float)_start_rad); writer.Write((float)_sweep_rad); } public int Size { get { return 24; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(AppendPathSegmentArc a, AppendPathSegmentArc b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(AppendPathSegmentArc a, AppendPathSegmentArc b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as AppendPathSegmentArc); } public bool Equals(AppendPathSegmentArc p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._pathID.Equals(p._pathID) && this._x_center_m.Equals(p._x_center_m) && this._y_center_m.Equals(p._y_center_m) && this._radius_m.Equals(p._radius_m) && this._start_rad.Equals(p._start_rad) && this._sweep_rad.Equals(p._sweep_rad); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._pathID.GetHashCode(); hash = hash * 23 + this._x_center_m.GetHashCode(); hash = hash * 23 + this._y_center_m.GetHashCode(); hash = hash * 23 + this._radius_m.GetHashCode(); hash = hash * 23 + this._start_rad.GetHashCode(); hash = hash * 23 + this._sweep_rad.GetHashCode(); return hash; } } } public partial class SetPathColor { private uint _pathID; // uint_32 private uint _colorID; // uint_32 public uint pathID { get { return _pathID; } set { _pathID = value; } } public uint colorID { get { return _colorID; } set { _colorID = value; } } /**** Constructors ****/ public SetPathColor() { } public SetPathColor(uint pathID, uint colorID) { this.pathID = pathID; this.colorID = colorID; } public SetPathColor(System.IO.Stream stream) { Unpack(stream); } public SetPathColor(System.IO.BinaryReader reader) { Unpack(reader); } public SetPathColor Initialize(uint pathID, uint colorID) { this.pathID = pathID; this.colorID = colorID; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _pathID = reader.ReadUInt32(); _colorID = reader.ReadUInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_pathID); writer.Write((uint)_colorID); } public int Size { get { return 8; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(SetPathColor a, SetPathColor b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(SetPathColor a, SetPathColor b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as SetPathColor); } public bool Equals(SetPathColor p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._pathID.Equals(p._pathID) && this._colorID.Equals(p._colorID); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._pathID.GetHashCode(); hash = hash * 23 + this._colorID.GetHashCode(); return hash; } } } public partial class ErasePath { private uint _pathID; // uint_32 public uint pathID { get { return _pathID; } set { _pathID = value; } } /**** Constructors ****/ public ErasePath() { } public ErasePath(uint pathID) { this.pathID = pathID; } public ErasePath(System.IO.Stream stream) { Unpack(stream); } public ErasePath(System.IO.BinaryReader reader) { Unpack(reader); } public ErasePath Initialize(uint pathID) { this.pathID = pathID; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _pathID = reader.ReadUInt32(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_pathID); } public int Size { get { return 4; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(ErasePath a, ErasePath b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ErasePath a, ErasePath b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ErasePath); } public bool Equals(ErasePath p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._pathID.Equals(p._pathID); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._pathID.GetHashCode(); return hash; } } } public partial class SetLabel { private uint _labelID; // uint_32 private uint _colorID; // uint_32 private string _text; // string[uint_8] public uint labelID { get { return _labelID; } set { _labelID = value; } } public uint colorID { get { return _colorID; } set { _colorID = value; } } public string text { get { return _text; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("text string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _text = value; } } /**** Constructors ****/ public SetLabel() { } public SetLabel(uint labelID, uint colorID, string text) { this.labelID = labelID; this.colorID = colorID; this.text = text; } public SetLabel(System.IO.Stream stream) { Unpack(stream); } public SetLabel(System.IO.BinaryReader reader) { Unpack(reader); } public SetLabel Initialize(uint labelID, uint colorID, string text) { this.labelID = labelID; this.colorID = colorID; this.text = text; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _labelID = reader.ReadUInt32(); _colorID = reader.ReadUInt32(); int _text_length = (int)reader.ReadByte(); byte[] _text_bytes = reader.ReadBytes(_text_length); _text = System.Text.Encoding.UTF8.GetString(_text_bytes); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((uint)_labelID); writer.Write((uint)_colorID); if (_text != null) { byte[] _text_bytes = System.Text.Encoding.UTF8.GetBytes(_text); writer.Write((byte)_text_bytes.Length); writer.Write(_text_bytes); } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 4; // uint_32 result += 4; // uint_32 result += 1; // uint_8 if (text != null) { result += System.Text.Encoding.UTF8.GetByteCount(text); } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(SetLabel a, SetLabel b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(SetLabel a, SetLabel b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as SetLabel); } public bool Equals(SetLabel p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._labelID.Equals(p._labelID) && this._colorID.Equals(p._colorID) && this._text.Equals(p._text); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._labelID.GetHashCode(); hash = hash * 23 + this._colorID.GetHashCode(); return hash; } } } public partial class DockingErrorSignal { private float _x_dist; // float_32 private float _y_dist; // float_32 private float _z_dist; // float_32 private float _angle; // float_32 public float x_dist { get { return _x_dist; } set { _x_dist = value; } } public float y_dist { get { return _y_dist; } set { _y_dist = value; } } public float z_dist { get { return _z_dist; } set { _z_dist = value; } } public float angle { get { return _angle; } set { _angle = value; } } /**** Constructors ****/ public DockingErrorSignal() { } public DockingErrorSignal(float x_dist, float y_dist, float z_dist, float angle) { this.x_dist = x_dist; this.y_dist = y_dist; this.z_dist = z_dist; this.angle = angle; } public DockingErrorSignal(System.IO.Stream stream) { Unpack(stream); } public DockingErrorSignal(System.IO.BinaryReader reader) { Unpack(reader); } public DockingErrorSignal Initialize(float x_dist, float y_dist, float z_dist, float angle) { this.x_dist = x_dist; this.y_dist = y_dist; this.z_dist = z_dist; this.angle = angle; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _x_dist = reader.ReadSingle(); _y_dist = reader.ReadSingle(); _z_dist = reader.ReadSingle(); _angle = reader.ReadSingle(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((float)_x_dist); writer.Write((float)_y_dist); writer.Write((float)_z_dist); writer.Write((float)_angle); } public int Size { get { return 16; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(DockingErrorSignal a, DockingErrorSignal b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(DockingErrorSignal a, DockingErrorSignal b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as DockingErrorSignal); } public bool Equals(DockingErrorSignal p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._x_dist.Equals(p._x_dist) && this._y_dist.Equals(p._y_dist) && this._z_dist.Equals(p._z_dist) && this._angle.Equals(p._angle); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._x_dist.GetHashCode(); hash = hash * 23 + this._y_dist.GetHashCode(); hash = hash * 23 + this._z_dist.GetHashCode(); hash = hash * 23 + this._angle.GetHashCode(); return hash; } } } public partial class CameraParams { private Anki.Vision.CameraParams _cameraParams; // CameraParams public Anki.Vision.CameraParams cameraParams { get { return _cameraParams; } set { if (value == null) { throw new System.ArgumentNullException("cameraParams cannot be null.", "value"); } _cameraParams = value; } } /**** Constructors ****/ public CameraParams() { this.cameraParams = new Anki.Vision.CameraParams(); } public CameraParams(Anki.Vision.CameraParams cameraParams) { this.cameraParams = cameraParams; } public CameraParams(System.IO.Stream stream) { Unpack(stream); } public CameraParams(System.IO.BinaryReader reader) { Unpack(reader); } public CameraParams Initialize(Anki.Vision.CameraParams cameraParams) { this.cameraParams = cameraParams; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _cameraParams = new Anki.Vision.CameraParams(reader); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { _cameraParams.Pack(writer); } public int Size { get { return 20; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(CameraParams a, CameraParams b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(CameraParams a, CameraParams b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as CameraParams); } public bool Equals(CameraParams p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._cameraParams.Equals(p._cameraParams); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._cameraParams.GetHashCode(); return hash; } } } public partial class VisionMarker { private short _topLeft_x; // int_16 private short _topLeft_y; // int_16 private short _topRight_x; // int_16 private short _topRight_y; // int_16 private short _bottomRight_x; // int_16 private short _bottomRight_y; // int_16 private short _bottomLeft_x; // int_16 private short _bottomLeft_y; // int_16 private sbyte _verified; // int_8 public short topLeft_x { get { return _topLeft_x; } set { _topLeft_x = value; } } public short topLeft_y { get { return _topLeft_y; } set { _topLeft_y = value; } } public short topRight_x { get { return _topRight_x; } set { _topRight_x = value; } } public short topRight_y { get { return _topRight_y; } set { _topRight_y = value; } } public short bottomRight_x { get { return _bottomRight_x; } set { _bottomRight_x = value; } } public short bottomRight_y { get { return _bottomRight_y; } set { _bottomRight_y = value; } } public short bottomLeft_x { get { return _bottomLeft_x; } set { _bottomLeft_x = value; } } public short bottomLeft_y { get { return _bottomLeft_y; } set { _bottomLeft_y = value; } } public sbyte verified { get { return _verified; } set { _verified = value; } } /**** Constructors ****/ public VisionMarker() { } public VisionMarker(short topLeft_x, short topLeft_y, short topRight_x, short topRight_y, short bottomRight_x, short bottomRight_y, short bottomLeft_x, short bottomLeft_y, sbyte verified) { this.topLeft_x = topLeft_x; this.topLeft_y = topLeft_y; this.topRight_x = topRight_x; this.topRight_y = topRight_y; this.bottomRight_x = bottomRight_x; this.bottomRight_y = bottomRight_y; this.bottomLeft_x = bottomLeft_x; this.bottomLeft_y = bottomLeft_y; this.verified = verified; } public VisionMarker(System.IO.Stream stream) { Unpack(stream); } public VisionMarker(System.IO.BinaryReader reader) { Unpack(reader); } public VisionMarker Initialize(short topLeft_x, short topLeft_y, short topRight_x, short topRight_y, short bottomRight_x, short bottomRight_y, short bottomLeft_x, short bottomLeft_y, sbyte verified) { this.topLeft_x = topLeft_x; this.topLeft_y = topLeft_y; this.topRight_x = topRight_x; this.topRight_y = topRight_y; this.bottomRight_x = bottomRight_x; this.bottomRight_y = bottomRight_y; this.bottomLeft_x = bottomLeft_x; this.bottomLeft_y = bottomLeft_y; this.verified = verified; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _topLeft_x = reader.ReadInt16(); _topLeft_y = reader.ReadInt16(); _topRight_x = reader.ReadInt16(); _topRight_y = reader.ReadInt16(); _bottomRight_x = reader.ReadInt16(); _bottomRight_y = reader.ReadInt16(); _bottomLeft_x = reader.ReadInt16(); _bottomLeft_y = reader.ReadInt16(); _verified = reader.ReadSByte(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((short)_topLeft_x); writer.Write((short)_topLeft_y); writer.Write((short)_topRight_x); writer.Write((short)_topRight_y); writer.Write((short)_bottomRight_x); writer.Write((short)_bottomRight_y); writer.Write((short)_bottomLeft_x); writer.Write((short)_bottomLeft_y); writer.Write((sbyte)_verified); } public int Size { get { return 17; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(VisionMarker a, VisionMarker b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(VisionMarker a, VisionMarker b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as VisionMarker); } public bool Equals(VisionMarker p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._topLeft_x.Equals(p._topLeft_x) && this._topLeft_y.Equals(p._topLeft_y) && this._topRight_x.Equals(p._topRight_x) && this._topRight_y.Equals(p._topRight_y) && this._bottomRight_x.Equals(p._bottomRight_x) && this._bottomRight_y.Equals(p._bottomRight_y) && this._bottomLeft_x.Equals(p._bottomLeft_x) && this._bottomLeft_y.Equals(p._bottomLeft_y) && this._verified.Equals(p._verified); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._topLeft_x.GetHashCode(); hash = hash * 23 + this._topLeft_y.GetHashCode(); hash = hash * 23 + this._topRight_x.GetHashCode(); hash = hash * 23 + this._topRight_y.GetHashCode(); hash = hash * 23 + this._bottomRight_x.GetHashCode(); hash = hash * 23 + this._bottomRight_y.GetHashCode(); hash = hash * 23 + this._bottomLeft_x.GetHashCode(); hash = hash * 23 + this._bottomLeft_y.GetHashCode(); hash = hash * 23 + this._verified.GetHashCode(); return hash; } } } public partial class ShowObjects { private sbyte _show; // int_8 public sbyte show { get { return _show; } set { _show = value; } } /**** Constructors ****/ public ShowObjects() { } public ShowObjects(sbyte show) { this.show = show; } public ShowObjects(System.IO.Stream stream) { Unpack(stream); } public ShowObjects(System.IO.BinaryReader reader) { Unpack(reader); } public ShowObjects Initialize(sbyte show) { this.show = show; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _show = reader.ReadSByte(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((sbyte)_show); } public int Size { get { return 1; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(ShowObjects a, ShowObjects b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(ShowObjects a, ShowObjects b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as ShowObjects); } public bool Equals(ShowObjects p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._show.Equals(p._show); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._show.GetHashCode(); return hash; } } } public partial class TrackerQuad { private short _topLeft_x; // int_16 private short _topLeft_y; // int_16 private short _topRight_x; // int_16 private short _topRight_y; // int_16 private short _bottomRight_x; // int_16 private short _bottomRight_y; // int_16 private short _bottomLeft_x; // int_16 private short _bottomLeft_y; // int_16 public short topLeft_x { get { return _topLeft_x; } set { _topLeft_x = value; } } public short topLeft_y { get { return _topLeft_y; } set { _topLeft_y = value; } } public short topRight_x { get { return _topRight_x; } set { _topRight_x = value; } } public short topRight_y { get { return _topRight_y; } set { _topRight_y = value; } } public short bottomRight_x { get { return _bottomRight_x; } set { _bottomRight_x = value; } } public short bottomRight_y { get { return _bottomRight_y; } set { _bottomRight_y = value; } } public short bottomLeft_x { get { return _bottomLeft_x; } set { _bottomLeft_x = value; } } public short bottomLeft_y { get { return _bottomLeft_y; } set { _bottomLeft_y = value; } } /**** Constructors ****/ public TrackerQuad() { } public TrackerQuad(short topLeft_x, short topLeft_y, short topRight_x, short topRight_y, short bottomRight_x, short bottomRight_y, short bottomLeft_x, short bottomLeft_y) { this.topLeft_x = topLeft_x; this.topLeft_y = topLeft_y; this.topRight_x = topRight_x; this.topRight_y = topRight_y; this.bottomRight_x = bottomRight_x; this.bottomRight_y = bottomRight_y; this.bottomLeft_x = bottomLeft_x; this.bottomLeft_y = bottomLeft_y; } public TrackerQuad(System.IO.Stream stream) { Unpack(stream); } public TrackerQuad(System.IO.BinaryReader reader) { Unpack(reader); } public TrackerQuad Initialize(short topLeft_x, short topLeft_y, short topRight_x, short topRight_y, short bottomRight_x, short bottomRight_y, short bottomLeft_x, short bottomLeft_y) { this.topLeft_x = topLeft_x; this.topLeft_y = topLeft_y; this.topRight_x = topRight_x; this.topRight_y = topRight_y; this.bottomRight_x = bottomRight_x; this.bottomRight_y = bottomRight_y; this.bottomLeft_x = bottomLeft_x; this.bottomLeft_y = bottomLeft_y; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _topLeft_x = reader.ReadInt16(); _topLeft_y = reader.ReadInt16(); _topRight_x = reader.ReadInt16(); _topRight_y = reader.ReadInt16(); _bottomRight_x = reader.ReadInt16(); _bottomRight_y = reader.ReadInt16(); _bottomLeft_x = reader.ReadInt16(); _bottomLeft_y = reader.ReadInt16(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((short)_topLeft_x); writer.Write((short)_topLeft_y); writer.Write((short)_topRight_x); writer.Write((short)_topRight_y); writer.Write((short)_bottomRight_x); writer.Write((short)_bottomRight_y); writer.Write((short)_bottomLeft_x); writer.Write((short)_bottomLeft_y); } public int Size { get { return 16; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(TrackerQuad a, TrackerQuad b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(TrackerQuad a, TrackerQuad b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as TrackerQuad); } public bool Equals(TrackerQuad p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._topLeft_x.Equals(p._topLeft_x) && this._topLeft_y.Equals(p._topLeft_y) && this._topRight_x.Equals(p._topRight_x) && this._topRight_y.Equals(p._topRight_y) && this._bottomRight_x.Equals(p._bottomRight_x) && this._bottomRight_y.Equals(p._bottomRight_y) && this._bottomLeft_x.Equals(p._bottomLeft_x) && this._bottomLeft_y.Equals(p._bottomLeft_y); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._topLeft_x.GetHashCode(); hash = hash * 23 + this._topLeft_y.GetHashCode(); hash = hash * 23 + this._topRight_x.GetHashCode(); hash = hash * 23 + this._topRight_y.GetHashCode(); hash = hash * 23 + this._bottomRight_x.GetHashCode(); hash = hash * 23 + this._bottomRight_y.GetHashCode(); hash = hash * 23 + this._bottomLeft_x.GetHashCode(); hash = hash * 23 + this._bottomLeft_y.GetHashCode(); return hash; } } } public partial class FaceDetection { private ushort _x_upperLeft; // uint_16 private ushort _y_upperLeft; // uint_16 private ushort _width; // uint_16 private ushort _height; // uint_16 private bool _visualize; // bool public ushort x_upperLeft { get { return _x_upperLeft; } set { _x_upperLeft = value; } } public ushort y_upperLeft { get { return _y_upperLeft; } set { _y_upperLeft = value; } } public ushort width { get { return _width; } set { _width = value; } } public ushort height { get { return _height; } set { _height = value; } } public bool visualize { get { return _visualize; } set { _visualize = value; } } /**** Constructors ****/ public FaceDetection() { } public FaceDetection(ushort x_upperLeft, ushort y_upperLeft, ushort width, ushort height, bool visualize) { this.x_upperLeft = x_upperLeft; this.y_upperLeft = y_upperLeft; this.width = width; this.height = height; this.visualize = visualize; } public FaceDetection(System.IO.Stream stream) { Unpack(stream); } public FaceDetection(System.IO.BinaryReader reader) { Unpack(reader); } public FaceDetection Initialize(ushort x_upperLeft, ushort y_upperLeft, ushort width, ushort height, bool visualize) { this.x_upperLeft = x_upperLeft; this.y_upperLeft = y_upperLeft; this.width = width; this.height = height; this.visualize = visualize; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _x_upperLeft = reader.ReadUInt16(); _y_upperLeft = reader.ReadUInt16(); _width = reader.ReadUInt16(); _height = reader.ReadUInt16(); _visualize = reader.ReadBoolean(); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((ushort)_x_upperLeft); writer.Write((ushort)_y_upperLeft); writer.Write((ushort)_width); writer.Write((ushort)_height); writer.Write((bool)_visualize); } public int Size { get { return 9; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(FaceDetection a, FaceDetection b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(FaceDetection a, FaceDetection b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as FaceDetection); } public bool Equals(FaceDetection p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._x_upperLeft.Equals(p._x_upperLeft) && this._y_upperLeft.Equals(p._y_upperLeft) && this._width.Equals(p._width) && this._height.Equals(p._height) && this._visualize.Equals(p._visualize); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._x_upperLeft.GetHashCode(); hash = hash * 23 + this._y_upperLeft.GetHashCode(); hash = hash * 23 + this._width.GetHashCode(); hash = hash * 23 + this._height.GetHashCode(); hash = hash * 23 + this._visualize.GetHashCode(); return hash; } } } public partial class BehaviorStackDebug { private string[] _debugStrings; // string[uint_8][uint_8] public string[] debugStrings { get { return _debugStrings; } set { if (value != null && value.Length > 255) { throw new System.ArgumentException("debugStrings variable-length array is too long. Must be less than or equal to 255.", "value"); } _debugStrings = value; } } /**** Constructors ****/ public BehaviorStackDebug() { } public BehaviorStackDebug(string[] debugStrings) { this.debugStrings = debugStrings; } public BehaviorStackDebug(System.IO.Stream stream) { Unpack(stream); } public BehaviorStackDebug(System.IO.BinaryReader reader) { Unpack(reader); } public BehaviorStackDebug Initialize(string[] debugStrings) { this.debugStrings = debugStrings; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { int _debugStrings_length = (int)reader.ReadByte(); _debugStrings = new string[_debugStrings_length]; for (int i = 0; i < _debugStrings_length; ++i) { int _debugStrings_i_length = (int)reader.ReadByte(); byte[] _debugStrings_i_bytes = reader.ReadBytes(_debugStrings_i_length); _debugStrings[i] = System.Text.Encoding.UTF8.GetString(_debugStrings_i_bytes); } } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { if (_debugStrings != null) { writer.Write((byte)_debugStrings.Length); for (int i = 0; i < _debugStrings.Length; ++i) { if (_debugStrings[i] != null) { byte[] _debugStrings_i_bytes = System.Text.Encoding.UTF8.GetBytes(_debugStrings[i]); writer.Write((byte)_debugStrings_i_bytes.Length); writer.Write(_debugStrings_i_bytes); } else { writer.Write((byte)0); } } } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 1; // uint_8 if (debugStrings != null) { for (int i = 0; i < debugStrings.Length; ++i) { result += 1; // uint_8 if (debugStrings[i] != null) { result += System.Text.Encoding.UTF8.GetByteCount(debugStrings[i]); } } } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(BehaviorStackDebug a, BehaviorStackDebug b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(BehaviorStackDebug a, BehaviorStackDebug b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as BehaviorStackDebug); } public bool Equals(BehaviorStackDebug p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return ArrayEquals(this._debugStrings,p._debugStrings); } public override int GetHashCode() { unchecked { int hash = 17; return hash; } } } public partial class VisionModeDebug { private string[] _debugStrings; // string[uint_8][uint_8] public string[] debugStrings { get { return _debugStrings; } set { if (value != null && value.Length > 255) { throw new System.ArgumentException("debugStrings variable-length array is too long. Must be less than or equal to 255.", "value"); } _debugStrings = value; } } /**** Constructors ****/ public VisionModeDebug() { } public VisionModeDebug(string[] debugStrings) { this.debugStrings = debugStrings; } public VisionModeDebug(System.IO.Stream stream) { Unpack(stream); } public VisionModeDebug(System.IO.BinaryReader reader) { Unpack(reader); } public VisionModeDebug Initialize(string[] debugStrings) { this.debugStrings = debugStrings; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { int _debugStrings_length = (int)reader.ReadByte(); _debugStrings = new string[_debugStrings_length]; for (int i = 0; i < _debugStrings_length; ++i) { int _debugStrings_i_length = (int)reader.ReadByte(); byte[] _debugStrings_i_bytes = reader.ReadBytes(_debugStrings_i_length); _debugStrings[i] = System.Text.Encoding.UTF8.GetString(_debugStrings_i_bytes); } } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { if (_debugStrings != null) { writer.Write((byte)_debugStrings.Length); for (int i = 0; i < _debugStrings.Length; ++i) { if (_debugStrings[i] != null) { byte[] _debugStrings_i_bytes = System.Text.Encoding.UTF8.GetBytes(_debugStrings[i]); writer.Write((byte)_debugStrings_i_bytes.Length); writer.Write(_debugStrings_i_bytes); } else { writer.Write((byte)0); } } } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 1; // uint_8 if (debugStrings != null) { for (int i = 0; i < debugStrings.Length; ++i) { result += 1; // uint_8 if (debugStrings[i] != null) { result += System.Text.Encoding.UTF8.GetByteCount(debugStrings[i]); } } } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(VisionModeDebug a, VisionModeDebug b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(VisionModeDebug a, VisionModeDebug b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as VisionModeDebug); } public bool Equals(VisionModeDebug p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return ArrayEquals(this._debugStrings,p._debugStrings); } public override int GetHashCode() { unchecked { int hash = 17; return hash; } } } public partial class SaveImages { private Anki.Vector.ImageSendMode _mode; // ImageSendMode private string _path; // string[uint_8] public Anki.Vector.ImageSendMode mode { get { return _mode; } set { _mode = value; } } public string path { get { return _path; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("path string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _path = value; } } /**** Constructors ****/ public SaveImages() { } public SaveImages(Anki.Vector.ImageSendMode mode, string path) { this.mode = mode; this.path = path; } public SaveImages(System.IO.Stream stream) { Unpack(stream); } public SaveImages(System.IO.BinaryReader reader) { Unpack(reader); } public SaveImages Initialize(Anki.Vector.ImageSendMode mode, string path) { this.mode = mode; this.path = path; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _mode = (Anki.Vector.ImageSendMode)reader.ReadByte(); int _path_length = (int)reader.ReadByte(); byte[] _path_bytes = reader.ReadBytes(_path_length); _path = System.Text.Encoding.UTF8.GetString(_path_bytes); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((byte)_mode); if (_path != null) { byte[] _path_bytes = System.Text.Encoding.UTF8.GetBytes(_path); writer.Write((byte)_path_bytes.Length); writer.Write(_path_bytes); } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 1; // ImageSendMode result += 1; // uint_8 if (path != null) { result += System.Text.Encoding.UTF8.GetByteCount(path); } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(SaveImages a, SaveImages b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(SaveImages a, SaveImages b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as SaveImages); } public bool Equals(SaveImages p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._mode.Equals(p._mode) && this._path.Equals(p._path); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._mode.GetHashCode(); return hash; } } } public partial class SaveState { private bool _enabled; // bool private string _path; // string[uint_8] public bool enabled { get { return _enabled; } set { _enabled = value; } } public string path { get { return _path; } set { if (!string.IsNullOrEmpty(value) && System.Text.Encoding.UTF8.GetByteCount(value) > 255) { throw new System.ArgumentException("path string is too long. Must decode to less than or equal to 255 bytes.", "value"); } _path = value; } } /**** Constructors ****/ public SaveState() { } public SaveState(bool enabled, string path) { this.enabled = enabled; this.path = path; } public SaveState(System.IO.Stream stream) { Unpack(stream); } public SaveState(System.IO.BinaryReader reader) { Unpack(reader); } public SaveState Initialize(bool enabled, string path) { this.enabled = enabled; this.path = path; return this; } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { _enabled = reader.ReadBoolean(); int _path_length = (int)reader.ReadByte(); byte[] _path_bytes = reader.ReadBytes(_path_length); _path = System.Text.Encoding.UTF8.GetString(_path_bytes); } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((bool)_enabled); if (_path != null) { byte[] _path_bytes = System.Text.Encoding.UTF8.GetBytes(_path); writer.Write((byte)_path_bytes.Length); writer.Write(_path_bytes); } else { writer.Write((byte)0); } } public int Size { get { int result = 0; result += 1; // bool result += 1; // uint_8 if (path != null) { result += System.Text.Encoding.UTF8.GetByteCount(path); } return result; } } public static bool ArrayEquals(System.Collections.Generic.IList a1, System.Collections.Generic.IList a2) { if (System.Object.ReferenceEquals(a1, a2)) return true; if (System.Object.ReferenceEquals(a1, null) || System.Object.ReferenceEquals(a2, null)) return false; if (a1.Count != a2.Count) return false; for (int i = 0; i < a1.Count; i++) { if (!a1[i].Equals(a2[i])) { return false; } } return true; } public static bool operator ==(SaveState a, SaveState b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(SaveState a, SaveState b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as SaveState); } public bool Equals(SaveState p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return this._enabled.Equals(p._enabled) && this._path.Equals(p._path); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._enabled.GetHashCode(); return hash; } } } public class MessageViz { public enum Tag { ReportCloudConnectivity, // 0 StartShutdownAnim, // 1 AnimationState, // 2 AnimationAdded, // 3 AnimationStarted, // 4 AnimationEnded, // 5 AnimationEvent, // 6 TextToSpeechEvent, // 7 StreamCameraImages, // 8 DebugScreenMode, // 9 RobotAvailable, // 10 AudioStreamStatusEvent, // 11 IMURequest, // 12 IMUTemperature, // 13 CliffEvent, // 14 PotentialCliff, // 15 SetCliffDetectThresholds, // 16 SetWhiteDetectThresholds, // 17 CarryStateUpdate, // 18 ImageChunk, // 19 CameraCalibration, // 20 SetVizOrigin, // 21 RobotStateMessage, // 22 CurrentAnimation, // 23 Object, // 24 LineSegment, // 25 Quad, // 26 MemoryMapMessageVizBegin, // 27 MemoryMapMessageViz, // 28 MemoryMapMessageVizEnd, // 29 EnabledVisionModes, // 30 CameraQuad, // 31 CameraRect, // 32 CameraLine, // 33 CameraOval, // 34 CameraText, // 35 EraseObject, // 36 EraseLineSegments, // 37 EraseQuad, // 38 SetRobot, // 39 AppendPathSegmentLine, // 40 AppendPathSegmentArc, // 41 SetPathColor, // 42 ErasePath, // 43 SetLabel, // 44 DockingErrorSignal, // 45 CameraParams, // 46 VisionMarker, // 47 ShowObjects, // 48 TrackerQuad, // 49 FaceDetection, // 50 BehaviorStackDebug, // 51 VisionModeDebug, // 52 SaveImages, // 53 SaveState, // 54 INVALID = 255 }; private Tag _tag = Tag.INVALID; public Tag GetTag() { return _tag; } private object _state = null; public object GetState() { return _state; } public Anki.Vector.ReportCloudConnectivity ReportCloudConnectivity { get { if (_tag != Tag.ReportCloudConnectivity) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ReportCloudConnectivity\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.ReportCloudConnectivity)this._state; } set { _tag = (value != null) ? Tag.ReportCloudConnectivity : Tag.INVALID; _state = value; } } public Anki.Vector.StartShutdownAnim StartShutdownAnim { get { if (_tag != Tag.StartShutdownAnim) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"StartShutdownAnim\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.StartShutdownAnim)this._state; } set { _tag = (value != null) ? Tag.StartShutdownAnim : Tag.INVALID; _state = value; } } public Anki.Vector.AnimationState AnimationState { get { if (_tag != Tag.AnimationState) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"AnimationState\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.AnimationState)this._state; } set { _tag = (value != null) ? Tag.AnimationState : Tag.INVALID; _state = value; } } public Anki.Vector.AnimationAdded AnimationAdded { get { if (_tag != Tag.AnimationAdded) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"AnimationAdded\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.AnimationAdded)this._state; } set { _tag = (value != null) ? Tag.AnimationAdded : Tag.INVALID; _state = value; } } public Anki.Vector.AnimationStarted AnimationStarted { get { if (_tag != Tag.AnimationStarted) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"AnimationStarted\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.AnimationStarted)this._state; } set { _tag = (value != null) ? Tag.AnimationStarted : Tag.INVALID; _state = value; } } public Anki.Vector.AnimationEnded AnimationEnded { get { if (_tag != Tag.AnimationEnded) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"AnimationEnded\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.AnimationEnded)this._state; } set { _tag = (value != null) ? Tag.AnimationEnded : Tag.INVALID; _state = value; } } public Anki.Vector.AnimationEvent AnimationEvent { get { if (_tag != Tag.AnimationEvent) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"AnimationEvent\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.AnimationEvent)this._state; } set { _tag = (value != null) ? Tag.AnimationEvent : Tag.INVALID; _state = value; } } public Anki.Vector.TextToSpeechEvent TextToSpeechEvent { get { if (_tag != Tag.TextToSpeechEvent) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"TextToSpeechEvent\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.TextToSpeechEvent)this._state; } set { _tag = (value != null) ? Tag.TextToSpeechEvent : Tag.INVALID; _state = value; } } public Anki.Vector.StreamCameraImages StreamCameraImages { get { if (_tag != Tag.StreamCameraImages) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"StreamCameraImages\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.StreamCameraImages)this._state; } set { _tag = (value != null) ? Tag.StreamCameraImages : Tag.INVALID; _state = value; } } public Anki.Vector.DebugScreenMode DebugScreenMode { get { if (_tag != Tag.DebugScreenMode) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"DebugScreenMode\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.DebugScreenMode)this._state; } set { _tag = (value != null) ? Tag.DebugScreenMode : Tag.INVALID; _state = value; } } public Anki.Vector.RobotAvailable RobotAvailable { get { if (_tag != Tag.RobotAvailable) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"RobotAvailable\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.RobotAvailable)this._state; } set { _tag = (value != null) ? Tag.RobotAvailable : Tag.INVALID; _state = value; } } public Anki.Vector.AudioStreamStatusEvent AudioStreamStatusEvent { get { if (_tag != Tag.AudioStreamStatusEvent) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"AudioStreamStatusEvent\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.AudioStreamStatusEvent)this._state; } set { _tag = (value != null) ? Tag.AudioStreamStatusEvent : Tag.INVALID; _state = value; } } public Anki.Vector.IMURequest IMURequest { get { if (_tag != Tag.IMURequest) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"IMURequest\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.IMURequest)this._state; } set { _tag = (value != null) ? Tag.IMURequest : Tag.INVALID; _state = value; } } public Anki.Vector.RobotInterface.IMUTemperature IMUTemperature { get { if (_tag != Tag.IMUTemperature) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"IMUTemperature\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.RobotInterface.IMUTemperature)this._state; } set { _tag = (value != null) ? Tag.IMUTemperature : Tag.INVALID; _state = value; } } public Anki.Vector.CliffEvent CliffEvent { get { if (_tag != Tag.CliffEvent) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CliffEvent\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.CliffEvent)this._state; } set { _tag = (value != null) ? Tag.CliffEvent : Tag.INVALID; _state = value; } } public Anki.Vector.PotentialCliff PotentialCliff { get { if (_tag != Tag.PotentialCliff) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"PotentialCliff\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.PotentialCliff)this._state; } set { _tag = (value != null) ? Tag.PotentialCliff : Tag.INVALID; _state = value; } } public Anki.Vector.SetCliffDetectThresholds SetCliffDetectThresholds { get { if (_tag != Tag.SetCliffDetectThresholds) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"SetCliffDetectThresholds\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.SetCliffDetectThresholds)this._state; } set { _tag = (value != null) ? Tag.SetCliffDetectThresholds : Tag.INVALID; _state = value; } } public Anki.Vector.SetWhiteDetectThresholds SetWhiteDetectThresholds { get { if (_tag != Tag.SetWhiteDetectThresholds) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"SetWhiteDetectThresholds\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.SetWhiteDetectThresholds)this._state; } set { _tag = (value != null) ? Tag.SetWhiteDetectThresholds : Tag.INVALID; _state = value; } } public Anki.Vector.CarryStateUpdate CarryStateUpdate { get { if (_tag != Tag.CarryStateUpdate) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CarryStateUpdate\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.CarryStateUpdate)this._state; } set { _tag = (value != null) ? Tag.CarryStateUpdate : Tag.INVALID; _state = value; } } public Anki.Vector.ImageChunk ImageChunk { get { if (_tag != Tag.ImageChunk) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ImageChunk\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.ImageChunk)this._state; } set { _tag = (value != null) ? Tag.ImageChunk : Tag.INVALID; _state = value; } } public Anki.Vector.CameraCalibration CameraCalibration { get { if (_tag != Tag.CameraCalibration) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CameraCalibration\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.CameraCalibration)this._state; } set { _tag = (value != null) ? Tag.CameraCalibration : Tag.INVALID; _state = value; } } public Anki.Vector.SetVizOrigin SetVizOrigin { get { if (_tag != Tag.SetVizOrigin) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"SetVizOrigin\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.SetVizOrigin)this._state; } set { _tag = (value != null) ? Tag.SetVizOrigin : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.RobotStateMessage RobotStateMessage { get { if (_tag != Tag.RobotStateMessage) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"RobotStateMessage\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.RobotStateMessage)this._state; } set { _tag = (value != null) ? Tag.RobotStateMessage : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.CurrentAnimation CurrentAnimation { get { if (_tag != Tag.CurrentAnimation) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CurrentAnimation\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.CurrentAnimation)this._state; } set { _tag = (value != null) ? Tag.CurrentAnimation : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.Object Object { get { if (_tag != Tag.Object) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"Object\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.Object)this._state; } set { _tag = (value != null) ? Tag.Object : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.LineSegment LineSegment { get { if (_tag != Tag.LineSegment) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"LineSegment\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.LineSegment)this._state; } set { _tag = (value != null) ? Tag.LineSegment : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.Quad Quad { get { if (_tag != Tag.Quad) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"Quad\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.Quad)this._state; } set { _tag = (value != null) ? Tag.Quad : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.MemoryMapMessageVizBegin MemoryMapMessageVizBegin { get { if (_tag != Tag.MemoryMapMessageVizBegin) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"MemoryMapMessageVizBegin\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.MemoryMapMessageVizBegin)this._state; } set { _tag = (value != null) ? Tag.MemoryMapMessageVizBegin : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.MemoryMapMessageViz MemoryMapMessageViz { get { if (_tag != Tag.MemoryMapMessageViz) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"MemoryMapMessageViz\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.MemoryMapMessageViz)this._state; } set { _tag = (value != null) ? Tag.MemoryMapMessageViz : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.MemoryMapMessageVizEnd MemoryMapMessageVizEnd { get { if (_tag != Tag.MemoryMapMessageVizEnd) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"MemoryMapMessageVizEnd\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.MemoryMapMessageVizEnd)this._state; } set { _tag = (value != null) ? Tag.MemoryMapMessageVizEnd : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.EnabledVisionModes EnabledVisionModes { get { if (_tag != Tag.EnabledVisionModes) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"EnabledVisionModes\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.EnabledVisionModes)this._state; } set { _tag = (value != null) ? Tag.EnabledVisionModes : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.CameraQuad CameraQuad { get { if (_tag != Tag.CameraQuad) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CameraQuad\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.CameraQuad)this._state; } set { _tag = (value != null) ? Tag.CameraQuad : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.CameraRect CameraRect { get { if (_tag != Tag.CameraRect) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CameraRect\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.CameraRect)this._state; } set { _tag = (value != null) ? Tag.CameraRect : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.CameraLine CameraLine { get { if (_tag != Tag.CameraLine) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CameraLine\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.CameraLine)this._state; } set { _tag = (value != null) ? Tag.CameraLine : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.CameraOval CameraOval { get { if (_tag != Tag.CameraOval) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CameraOval\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.CameraOval)this._state; } set { _tag = (value != null) ? Tag.CameraOval : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.CameraText CameraText { get { if (_tag != Tag.CameraText) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CameraText\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.CameraText)this._state; } set { _tag = (value != null) ? Tag.CameraText : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.EraseObject EraseObject { get { if (_tag != Tag.EraseObject) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"EraseObject\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.EraseObject)this._state; } set { _tag = (value != null) ? Tag.EraseObject : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.EraseLineSegments EraseLineSegments { get { if (_tag != Tag.EraseLineSegments) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"EraseLineSegments\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.EraseLineSegments)this._state; } set { _tag = (value != null) ? Tag.EraseLineSegments : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.EraseQuad EraseQuad { get { if (_tag != Tag.EraseQuad) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"EraseQuad\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.EraseQuad)this._state; } set { _tag = (value != null) ? Tag.EraseQuad : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.SetRobot SetRobot { get { if (_tag != Tag.SetRobot) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"SetRobot\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.SetRobot)this._state; } set { _tag = (value != null) ? Tag.SetRobot : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.AppendPathSegmentLine AppendPathSegmentLine { get { if (_tag != Tag.AppendPathSegmentLine) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"AppendPathSegmentLine\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.AppendPathSegmentLine)this._state; } set { _tag = (value != null) ? Tag.AppendPathSegmentLine : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.AppendPathSegmentArc AppendPathSegmentArc { get { if (_tag != Tag.AppendPathSegmentArc) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"AppendPathSegmentArc\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.AppendPathSegmentArc)this._state; } set { _tag = (value != null) ? Tag.AppendPathSegmentArc : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.SetPathColor SetPathColor { get { if (_tag != Tag.SetPathColor) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"SetPathColor\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.SetPathColor)this._state; } set { _tag = (value != null) ? Tag.SetPathColor : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.ErasePath ErasePath { get { if (_tag != Tag.ErasePath) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ErasePath\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.ErasePath)this._state; } set { _tag = (value != null) ? Tag.ErasePath : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.SetLabel SetLabel { get { if (_tag != Tag.SetLabel) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"SetLabel\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.SetLabel)this._state; } set { _tag = (value != null) ? Tag.SetLabel : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.DockingErrorSignal DockingErrorSignal { get { if (_tag != Tag.DockingErrorSignal) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"DockingErrorSignal\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.DockingErrorSignal)this._state; } set { _tag = (value != null) ? Tag.DockingErrorSignal : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.CameraParams CameraParams { get { if (_tag != Tag.CameraParams) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"CameraParams\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.CameraParams)this._state; } set { _tag = (value != null) ? Tag.CameraParams : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.VisionMarker VisionMarker { get { if (_tag != Tag.VisionMarker) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"VisionMarker\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.VisionMarker)this._state; } set { _tag = (value != null) ? Tag.VisionMarker : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.ShowObjects ShowObjects { get { if (_tag != Tag.ShowObjects) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"ShowObjects\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.ShowObjects)this._state; } set { _tag = (value != null) ? Tag.ShowObjects : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.TrackerQuad TrackerQuad { get { if (_tag != Tag.TrackerQuad) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"TrackerQuad\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.TrackerQuad)this._state; } set { _tag = (value != null) ? Tag.TrackerQuad : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.FaceDetection FaceDetection { get { if (_tag != Tag.FaceDetection) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"FaceDetection\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.FaceDetection)this._state; } set { _tag = (value != null) ? Tag.FaceDetection : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.BehaviorStackDebug BehaviorStackDebug { get { if (_tag != Tag.BehaviorStackDebug) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"BehaviorStackDebug\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.BehaviorStackDebug)this._state; } set { _tag = (value != null) ? Tag.BehaviorStackDebug : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.VisionModeDebug VisionModeDebug { get { if (_tag != Tag.VisionModeDebug) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"VisionModeDebug\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.VisionModeDebug)this._state; } set { _tag = (value != null) ? Tag.VisionModeDebug : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.SaveImages SaveImages { get { if (_tag != Tag.SaveImages) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"SaveImages\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.SaveImages)this._state; } set { _tag = (value != null) ? Tag.SaveImages : Tag.INVALID; _state = value; } } public Anki.Vector.VizInterface.SaveState SaveState { get { if (_tag != Tag.SaveState) { throw new System.InvalidOperationException(string.Format( "Cannot access union member \"SaveState\" when a value of type {0} is stored.", _tag.ToString())); } return (Anki.Vector.VizInterface.SaveState)this._state; } set { _tag = (value != null) ? Tag.SaveState : Tag.INVALID; _state = value; } } public MessageViz Initialize(T state) { _state = state; if(typeof(T) == typeof(Anki.Vector.ReportCloudConnectivity)) { _tag = Tag.ReportCloudConnectivity; } else if(typeof(T) == typeof(Anki.Vector.StartShutdownAnim)) { _tag = Tag.StartShutdownAnim; } else if(typeof(T) == typeof(Anki.Vector.AnimationState)) { _tag = Tag.AnimationState; } else if(typeof(T) == typeof(Anki.Vector.AnimationAdded)) { _tag = Tag.AnimationAdded; } else if(typeof(T) == typeof(Anki.Vector.AnimationStarted)) { _tag = Tag.AnimationStarted; } else if(typeof(T) == typeof(Anki.Vector.AnimationEnded)) { _tag = Tag.AnimationEnded; } else if(typeof(T) == typeof(Anki.Vector.AnimationEvent)) { _tag = Tag.AnimationEvent; } else if(typeof(T) == typeof(Anki.Vector.TextToSpeechEvent)) { _tag = Tag.TextToSpeechEvent; } else if(typeof(T) == typeof(Anki.Vector.StreamCameraImages)) { _tag = Tag.StreamCameraImages; } else if(typeof(T) == typeof(Anki.Vector.DebugScreenMode)) { _tag = Tag.DebugScreenMode; } else if(typeof(T) == typeof(Anki.Vector.RobotAvailable)) { _tag = Tag.RobotAvailable; } else if(typeof(T) == typeof(Anki.Vector.AudioStreamStatusEvent)) { _tag = Tag.AudioStreamStatusEvent; } else if(typeof(T) == typeof(Anki.Vector.IMURequest)) { _tag = Tag.IMURequest; } else if(typeof(T) == typeof(Anki.Vector.RobotInterface.IMUTemperature)) { _tag = Tag.IMUTemperature; } else if(typeof(T) == typeof(Anki.Vector.CliffEvent)) { _tag = Tag.CliffEvent; } else if(typeof(T) == typeof(Anki.Vector.PotentialCliff)) { _tag = Tag.PotentialCliff; } else if(typeof(T) == typeof(Anki.Vector.SetCliffDetectThresholds)) { _tag = Tag.SetCliffDetectThresholds; } else if(typeof(T) == typeof(Anki.Vector.SetWhiteDetectThresholds)) { _tag = Tag.SetWhiteDetectThresholds; } else if(typeof(T) == typeof(Anki.Vector.CarryStateUpdate)) { _tag = Tag.CarryStateUpdate; } else if(typeof(T) == typeof(Anki.Vector.ImageChunk)) { _tag = Tag.ImageChunk; } else if(typeof(T) == typeof(Anki.Vector.CameraCalibration)) { _tag = Tag.CameraCalibration; } else if(typeof(T) == typeof(Anki.Vector.SetVizOrigin)) { _tag = Tag.SetVizOrigin; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.RobotStateMessage)) { _tag = Tag.RobotStateMessage; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.CurrentAnimation)) { _tag = Tag.CurrentAnimation; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.Object)) { _tag = Tag.Object; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.LineSegment)) { _tag = Tag.LineSegment; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.Quad)) { _tag = Tag.Quad; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.MemoryMapMessageVizBegin)) { _tag = Tag.MemoryMapMessageVizBegin; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.MemoryMapMessageViz)) { _tag = Tag.MemoryMapMessageViz; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.MemoryMapMessageVizEnd)) { _tag = Tag.MemoryMapMessageVizEnd; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.EnabledVisionModes)) { _tag = Tag.EnabledVisionModes; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.CameraQuad)) { _tag = Tag.CameraQuad; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.CameraRect)) { _tag = Tag.CameraRect; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.CameraLine)) { _tag = Tag.CameraLine; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.CameraOval)) { _tag = Tag.CameraOval; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.CameraText)) { _tag = Tag.CameraText; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.EraseObject)) { _tag = Tag.EraseObject; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.EraseLineSegments)) { _tag = Tag.EraseLineSegments; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.EraseQuad)) { _tag = Tag.EraseQuad; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.SetRobot)) { _tag = Tag.SetRobot; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.AppendPathSegmentLine)) { _tag = Tag.AppendPathSegmentLine; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.AppendPathSegmentArc)) { _tag = Tag.AppendPathSegmentArc; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.SetPathColor)) { _tag = Tag.SetPathColor; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.ErasePath)) { _tag = Tag.ErasePath; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.SetLabel)) { _tag = Tag.SetLabel; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.DockingErrorSignal)) { _tag = Tag.DockingErrorSignal; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.CameraParams)) { _tag = Tag.CameraParams; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.VisionMarker)) { _tag = Tag.VisionMarker; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.ShowObjects)) { _tag = Tag.ShowObjects; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.TrackerQuad)) { _tag = Tag.TrackerQuad; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.FaceDetection)) { _tag = Tag.FaceDetection; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.BehaviorStackDebug)) { _tag = Tag.BehaviorStackDebug; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.VisionModeDebug)) { _tag = Tag.VisionModeDebug; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.SaveImages)) { _tag = Tag.SaveImages; } else if(typeof(T) == typeof(Anki.Vector.VizInterface.SaveState)) { _tag = Tag.SaveState; } else { _state = null; _tag = Tag.INVALID; } return this; } /**** Constructors ****/ public MessageViz() { } public MessageViz(System.IO.Stream stream) { Unpack(stream); } public MessageViz(System.IO.BinaryReader reader) { Unpack(reader); } public void Unpack(System.IO.Stream stream) { System.IO.BinaryReader reader = new System.IO.BinaryReader(stream); Unpack(reader); } public void Unpack(System.IO.BinaryReader reader) { Tag newTag = (Tag)reader.ReadByte(); switch(newTag) { case Tag.ReportCloudConnectivity: ReportCloudConnectivity = new Anki.Vector.ReportCloudConnectivity(reader); break; case Tag.StartShutdownAnim: StartShutdownAnim = new Anki.Vector.StartShutdownAnim(reader); break; case Tag.AnimationState: AnimationState = new Anki.Vector.AnimationState(reader); break; case Tag.AnimationAdded: AnimationAdded = new Anki.Vector.AnimationAdded(reader); break; case Tag.AnimationStarted: AnimationStarted = new Anki.Vector.AnimationStarted(reader); break; case Tag.AnimationEnded: AnimationEnded = new Anki.Vector.AnimationEnded(reader); break; case Tag.AnimationEvent: AnimationEvent = new Anki.Vector.AnimationEvent(reader); break; case Tag.TextToSpeechEvent: TextToSpeechEvent = new Anki.Vector.TextToSpeechEvent(reader); break; case Tag.StreamCameraImages: StreamCameraImages = new Anki.Vector.StreamCameraImages(reader); break; case Tag.DebugScreenMode: DebugScreenMode = new Anki.Vector.DebugScreenMode(reader); break; case Tag.RobotAvailable: RobotAvailable = new Anki.Vector.RobotAvailable(reader); break; case Tag.AudioStreamStatusEvent: AudioStreamStatusEvent = new Anki.Vector.AudioStreamStatusEvent(reader); break; case Tag.IMURequest: IMURequest = new Anki.Vector.IMURequest(reader); break; case Tag.IMUTemperature: IMUTemperature = new Anki.Vector.RobotInterface.IMUTemperature(reader); break; case Tag.CliffEvent: CliffEvent = new Anki.Vector.CliffEvent(reader); break; case Tag.PotentialCliff: PotentialCliff = new Anki.Vector.PotentialCliff(reader); break; case Tag.SetCliffDetectThresholds: SetCliffDetectThresholds = new Anki.Vector.SetCliffDetectThresholds(reader); break; case Tag.SetWhiteDetectThresholds: SetWhiteDetectThresholds = new Anki.Vector.SetWhiteDetectThresholds(reader); break; case Tag.CarryStateUpdate: CarryStateUpdate = new Anki.Vector.CarryStateUpdate(reader); break; case Tag.ImageChunk: ImageChunk = new Anki.Vector.ImageChunk(reader); break; case Tag.CameraCalibration: CameraCalibration = new Anki.Vector.CameraCalibration(reader); break; case Tag.SetVizOrigin: SetVizOrigin = new Anki.Vector.SetVizOrigin(reader); break; case Tag.RobotStateMessage: RobotStateMessage = new Anki.Vector.VizInterface.RobotStateMessage(reader); break; case Tag.CurrentAnimation: CurrentAnimation = new Anki.Vector.VizInterface.CurrentAnimation(reader); break; case Tag.Object: Object = new Anki.Vector.VizInterface.Object(reader); break; case Tag.LineSegment: LineSegment = new Anki.Vector.VizInterface.LineSegment(reader); break; case Tag.Quad: Quad = new Anki.Vector.VizInterface.Quad(reader); break; case Tag.MemoryMapMessageVizBegin: MemoryMapMessageVizBegin = new Anki.Vector.VizInterface.MemoryMapMessageVizBegin(reader); break; case Tag.MemoryMapMessageViz: MemoryMapMessageViz = new Anki.Vector.VizInterface.MemoryMapMessageViz(reader); break; case Tag.MemoryMapMessageVizEnd: MemoryMapMessageVizEnd = new Anki.Vector.VizInterface.MemoryMapMessageVizEnd(reader); break; case Tag.EnabledVisionModes: EnabledVisionModes = new Anki.Vector.VizInterface.EnabledVisionModes(reader); break; case Tag.CameraQuad: CameraQuad = new Anki.Vector.VizInterface.CameraQuad(reader); break; case Tag.CameraRect: CameraRect = new Anki.Vector.VizInterface.CameraRect(reader); break; case Tag.CameraLine: CameraLine = new Anki.Vector.VizInterface.CameraLine(reader); break; case Tag.CameraOval: CameraOval = new Anki.Vector.VizInterface.CameraOval(reader); break; case Tag.CameraText: CameraText = new Anki.Vector.VizInterface.CameraText(reader); break; case Tag.EraseObject: EraseObject = new Anki.Vector.VizInterface.EraseObject(reader); break; case Tag.EraseLineSegments: EraseLineSegments = new Anki.Vector.VizInterface.EraseLineSegments(reader); break; case Tag.EraseQuad: EraseQuad = new Anki.Vector.VizInterface.EraseQuad(reader); break; case Tag.SetRobot: SetRobot = new Anki.Vector.VizInterface.SetRobot(reader); break; case Tag.AppendPathSegmentLine: AppendPathSegmentLine = new Anki.Vector.VizInterface.AppendPathSegmentLine(reader); break; case Tag.AppendPathSegmentArc: AppendPathSegmentArc = new Anki.Vector.VizInterface.AppendPathSegmentArc(reader); break; case Tag.SetPathColor: SetPathColor = new Anki.Vector.VizInterface.SetPathColor(reader); break; case Tag.ErasePath: ErasePath = new Anki.Vector.VizInterface.ErasePath(reader); break; case Tag.SetLabel: SetLabel = new Anki.Vector.VizInterface.SetLabel(reader); break; case Tag.DockingErrorSignal: DockingErrorSignal = new Anki.Vector.VizInterface.DockingErrorSignal(reader); break; case Tag.CameraParams: CameraParams = new Anki.Vector.VizInterface.CameraParams(reader); break; case Tag.VisionMarker: VisionMarker = new Anki.Vector.VizInterface.VisionMarker(reader); break; case Tag.ShowObjects: ShowObjects = new Anki.Vector.VizInterface.ShowObjects(reader); break; case Tag.TrackerQuad: TrackerQuad = new Anki.Vector.VizInterface.TrackerQuad(reader); break; case Tag.FaceDetection: FaceDetection = new Anki.Vector.VizInterface.FaceDetection(reader); break; case Tag.BehaviorStackDebug: BehaviorStackDebug = new Anki.Vector.VizInterface.BehaviorStackDebug(reader); break; case Tag.VisionModeDebug: VisionModeDebug = new Anki.Vector.VizInterface.VisionModeDebug(reader); break; case Tag.SaveImages: SaveImages = new Anki.Vector.VizInterface.SaveImages(reader); break; case Tag.SaveState: SaveState = new Anki.Vector.VizInterface.SaveState(reader); break; default: break; } _tag = newTag; } public void Pack(System.IO.Stream stream) { System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream); Pack(writer); } public void Pack(System.IO.BinaryWriter writer) { writer.Write((byte)GetTag()); switch(GetTag()) { case Tag.ReportCloudConnectivity: if (ReportCloudConnectivity == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ReportCloudConnectivity.Pack(writer); break; case Tag.StartShutdownAnim: if (StartShutdownAnim == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } StartShutdownAnim.Pack(writer); break; case Tag.AnimationState: if (AnimationState == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } AnimationState.Pack(writer); break; case Tag.AnimationAdded: if (AnimationAdded == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } AnimationAdded.Pack(writer); break; case Tag.AnimationStarted: if (AnimationStarted == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } AnimationStarted.Pack(writer); break; case Tag.AnimationEnded: if (AnimationEnded == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } AnimationEnded.Pack(writer); break; case Tag.AnimationEvent: if (AnimationEvent == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } AnimationEvent.Pack(writer); break; case Tag.TextToSpeechEvent: if (TextToSpeechEvent == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } TextToSpeechEvent.Pack(writer); break; case Tag.StreamCameraImages: if (StreamCameraImages == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } StreamCameraImages.Pack(writer); break; case Tag.DebugScreenMode: if (DebugScreenMode == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } DebugScreenMode.Pack(writer); break; case Tag.RobotAvailable: if (RobotAvailable == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } RobotAvailable.Pack(writer); break; case Tag.AudioStreamStatusEvent: if (AudioStreamStatusEvent == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } AudioStreamStatusEvent.Pack(writer); break; case Tag.IMURequest: if (IMURequest == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } IMURequest.Pack(writer); break; case Tag.IMUTemperature: if (IMUTemperature == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } IMUTemperature.Pack(writer); break; case Tag.CliffEvent: if (CliffEvent == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CliffEvent.Pack(writer); break; case Tag.PotentialCliff: if (PotentialCliff == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } PotentialCliff.Pack(writer); break; case Tag.SetCliffDetectThresholds: if (SetCliffDetectThresholds == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } SetCliffDetectThresholds.Pack(writer); break; case Tag.SetWhiteDetectThresholds: if (SetWhiteDetectThresholds == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } SetWhiteDetectThresholds.Pack(writer); break; case Tag.CarryStateUpdate: if (CarryStateUpdate == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CarryStateUpdate.Pack(writer); break; case Tag.ImageChunk: if (ImageChunk == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ImageChunk.Pack(writer); break; case Tag.CameraCalibration: if (CameraCalibration == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CameraCalibration.Pack(writer); break; case Tag.SetVizOrigin: if (SetVizOrigin == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } SetVizOrigin.Pack(writer); break; case Tag.RobotStateMessage: if (RobotStateMessage == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } RobotStateMessage.Pack(writer); break; case Tag.CurrentAnimation: if (CurrentAnimation == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CurrentAnimation.Pack(writer); break; case Tag.Object: if (Object == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } Object.Pack(writer); break; case Tag.LineSegment: if (LineSegment == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } LineSegment.Pack(writer); break; case Tag.Quad: if (Quad == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } Quad.Pack(writer); break; case Tag.MemoryMapMessageVizBegin: if (MemoryMapMessageVizBegin == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } MemoryMapMessageVizBegin.Pack(writer); break; case Tag.MemoryMapMessageViz: if (MemoryMapMessageViz == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } MemoryMapMessageViz.Pack(writer); break; case Tag.MemoryMapMessageVizEnd: if (MemoryMapMessageVizEnd == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } MemoryMapMessageVizEnd.Pack(writer); break; case Tag.EnabledVisionModes: if (EnabledVisionModes == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } EnabledVisionModes.Pack(writer); break; case Tag.CameraQuad: if (CameraQuad == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CameraQuad.Pack(writer); break; case Tag.CameraRect: if (CameraRect == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CameraRect.Pack(writer); break; case Tag.CameraLine: if (CameraLine == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CameraLine.Pack(writer); break; case Tag.CameraOval: if (CameraOval == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CameraOval.Pack(writer); break; case Tag.CameraText: if (CameraText == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CameraText.Pack(writer); break; case Tag.EraseObject: if (EraseObject == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } EraseObject.Pack(writer); break; case Tag.EraseLineSegments: if (EraseLineSegments == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } EraseLineSegments.Pack(writer); break; case Tag.EraseQuad: if (EraseQuad == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } EraseQuad.Pack(writer); break; case Tag.SetRobot: if (SetRobot == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } SetRobot.Pack(writer); break; case Tag.AppendPathSegmentLine: if (AppendPathSegmentLine == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } AppendPathSegmentLine.Pack(writer); break; case Tag.AppendPathSegmentArc: if (AppendPathSegmentArc == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } AppendPathSegmentArc.Pack(writer); break; case Tag.SetPathColor: if (SetPathColor == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } SetPathColor.Pack(writer); break; case Tag.ErasePath: if (ErasePath == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ErasePath.Pack(writer); break; case Tag.SetLabel: if (SetLabel == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } SetLabel.Pack(writer); break; case Tag.DockingErrorSignal: if (DockingErrorSignal == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } DockingErrorSignal.Pack(writer); break; case Tag.CameraParams: if (CameraParams == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } CameraParams.Pack(writer); break; case Tag.VisionMarker: if (VisionMarker == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } VisionMarker.Pack(writer); break; case Tag.ShowObjects: if (ShowObjects == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } ShowObjects.Pack(writer); break; case Tag.TrackerQuad: if (TrackerQuad == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } TrackerQuad.Pack(writer); break; case Tag.FaceDetection: if (FaceDetection == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } FaceDetection.Pack(writer); break; case Tag.BehaviorStackDebug: if (BehaviorStackDebug == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } BehaviorStackDebug.Pack(writer); break; case Tag.VisionModeDebug: if (VisionModeDebug == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } VisionModeDebug.Pack(writer); break; case Tag.SaveImages: if (SaveImages == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } SaveImages.Pack(writer); break; case Tag.SaveState: if (SaveState == null) { throw new System.InvalidOperationException("Arrays in messages may not have null entries."); } SaveState.Pack(writer); break; default: break; } } public int Size { get { int result = 1; // tag = byte switch(GetTag()) { case Tag.ReportCloudConnectivity: if (ReportCloudConnectivity == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ReportCloudConnectivity.Size; break; case Tag.StartShutdownAnim: if (StartShutdownAnim == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += StartShutdownAnim.Size; break; case Tag.AnimationState: if (AnimationState == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += AnimationState.Size; break; case Tag.AnimationAdded: if (AnimationAdded == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += AnimationAdded.Size; break; case Tag.AnimationStarted: if (AnimationStarted == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += AnimationStarted.Size; break; case Tag.AnimationEnded: if (AnimationEnded == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += AnimationEnded.Size; break; case Tag.AnimationEvent: if (AnimationEvent == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += AnimationEvent.Size; break; case Tag.TextToSpeechEvent: if (TextToSpeechEvent == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += TextToSpeechEvent.Size; break; case Tag.StreamCameraImages: if (StreamCameraImages == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += StreamCameraImages.Size; break; case Tag.DebugScreenMode: if (DebugScreenMode == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += DebugScreenMode.Size; break; case Tag.RobotAvailable: if (RobotAvailable == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += RobotAvailable.Size; break; case Tag.AudioStreamStatusEvent: if (AudioStreamStatusEvent == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += AudioStreamStatusEvent.Size; break; case Tag.IMURequest: if (IMURequest == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += IMURequest.Size; break; case Tag.IMUTemperature: if (IMUTemperature == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += IMUTemperature.Size; break; case Tag.CliffEvent: if (CliffEvent == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CliffEvent.Size; break; case Tag.PotentialCliff: if (PotentialCliff == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += PotentialCliff.Size; break; case Tag.SetCliffDetectThresholds: if (SetCliffDetectThresholds == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += SetCliffDetectThresholds.Size; break; case Tag.SetWhiteDetectThresholds: if (SetWhiteDetectThresholds == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += SetWhiteDetectThresholds.Size; break; case Tag.CarryStateUpdate: if (CarryStateUpdate == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CarryStateUpdate.Size; break; case Tag.ImageChunk: if (ImageChunk == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ImageChunk.Size; break; case Tag.CameraCalibration: if (CameraCalibration == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CameraCalibration.Size; break; case Tag.SetVizOrigin: if (SetVizOrigin == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += SetVizOrigin.Size; break; case Tag.RobotStateMessage: if (RobotStateMessage == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += RobotStateMessage.Size; break; case Tag.CurrentAnimation: if (CurrentAnimation == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CurrentAnimation.Size; break; case Tag.Object: if (Object == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += Object.Size; break; case Tag.LineSegment: if (LineSegment == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += LineSegment.Size; break; case Tag.Quad: if (Quad == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += Quad.Size; break; case Tag.MemoryMapMessageVizBegin: if (MemoryMapMessageVizBegin == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += MemoryMapMessageVizBegin.Size; break; case Tag.MemoryMapMessageViz: if (MemoryMapMessageViz == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += MemoryMapMessageViz.Size; break; case Tag.MemoryMapMessageVizEnd: if (MemoryMapMessageVizEnd == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += MemoryMapMessageVizEnd.Size; break; case Tag.EnabledVisionModes: if (EnabledVisionModes == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += EnabledVisionModes.Size; break; case Tag.CameraQuad: if (CameraQuad == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CameraQuad.Size; break; case Tag.CameraRect: if (CameraRect == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CameraRect.Size; break; case Tag.CameraLine: if (CameraLine == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CameraLine.Size; break; case Tag.CameraOval: if (CameraOval == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CameraOval.Size; break; case Tag.CameraText: if (CameraText == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CameraText.Size; break; case Tag.EraseObject: if (EraseObject == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += EraseObject.Size; break; case Tag.EraseLineSegments: if (EraseLineSegments == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += EraseLineSegments.Size; break; case Tag.EraseQuad: if (EraseQuad == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += EraseQuad.Size; break; case Tag.SetRobot: if (SetRobot == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += SetRobot.Size; break; case Tag.AppendPathSegmentLine: if (AppendPathSegmentLine == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += AppendPathSegmentLine.Size; break; case Tag.AppendPathSegmentArc: if (AppendPathSegmentArc == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += AppendPathSegmentArc.Size; break; case Tag.SetPathColor: if (SetPathColor == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += SetPathColor.Size; break; case Tag.ErasePath: if (ErasePath == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ErasePath.Size; break; case Tag.SetLabel: if (SetLabel == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += SetLabel.Size; break; case Tag.DockingErrorSignal: if (DockingErrorSignal == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += DockingErrorSignal.Size; break; case Tag.CameraParams: if (CameraParams == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += CameraParams.Size; break; case Tag.VisionMarker: if (VisionMarker == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += VisionMarker.Size; break; case Tag.ShowObjects: if (ShowObjects == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += ShowObjects.Size; break; case Tag.TrackerQuad: if (TrackerQuad == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += TrackerQuad.Size; break; case Tag.FaceDetection: if (FaceDetection == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += FaceDetection.Size; break; case Tag.BehaviorStackDebug: if (BehaviorStackDebug == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += BehaviorStackDebug.Size; break; case Tag.VisionModeDebug: if (VisionModeDebug == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += VisionModeDebug.Size; break; case Tag.SaveImages: if (SaveImages == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += SaveImages.Size; break; case Tag.SaveState: if (SaveState == null) { throw new System.InvalidOperationException("Messages may not have null members."); } result += SaveState.Size; break; default: // Just tag size break; } return result; } } public static bool operator ==(MessageViz a, MessageViz b) { if (System.Object.ReferenceEquals(a, null)) { return System.Object.ReferenceEquals(b, null); } return a.Equals(b); } public static bool operator !=(MessageViz a, MessageViz b) { return !(a == b); } public override bool Equals(System.Object obj) { return this.Equals(obj as MessageViz); } public bool Equals(MessageViz p) { if (System.Object.ReferenceEquals(p, null)) { return false; } return (_tag == p._tag && _state.Equals(p._state)); } public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + this._tag.GetHashCode(); hash = hash * 23 + this._state.GetHashCode(); return hash; } } } } // namespace VizInterface } // namespace Vector } // namespace Anki