diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs | 84 |
1 files changed, 28 insertions, 56 deletions
diff --git a/Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs b/Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs index a6d2fe860..4b7534738 100644 --- a/Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs +++ b/Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItem.cs @@ -23,16 +23,16 @@ namespace Tango.PMR.DataStore { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChNEYXRhU3RvcmVJdGVtLnByb3RvEhNUYW5nby5QTVIuRGF0YVN0b3JlGg5E", - "YXRhVHlwZS5wcm90byLJAQoNRGF0YVN0b3JlSXRlbRILCgNLZXkYASABKAkS", - "LwoIRGF0YVR5cGUYAiABKA4yHS5UYW5nby5QTVIuRGF0YVN0b3JlLkRhdGFU", - "eXBlEhIKCkludDMyVmFsdWUYAyABKAUSEgoKRmxvYXRWYWx1ZRgEIAEoAhIT", - "CgtEb3VibGVWYWx1ZRgFIAEoARIUCgxCb29sZWFuVmFsdWUYBiABKAgSEwoL", - "U3RyaW5nVmFsdWUYByABKAkSEgoKQnl0ZXNWYWx1ZRgIIAEoDEIfCh1jb20u", - "dHdpbmUudGFuZ28ucG1yLmRhdGFzdG9yZWIGcHJvdG8z")); + "YXRhVHlwZS5wcm90byK8AQoNRGF0YVN0b3JlSXRlbRIvCghEYXRhVHlwZRgB", + "IAEoDjIdLlRhbmdvLlBNUi5EYXRhU3RvcmUuRGF0YVR5cGUSEgoKSW50MzJW", + "YWx1ZRgCIAEoBRISCgpGbG9hdFZhbHVlGAMgASgCEhMKC0RvdWJsZVZhbHVl", + "GAQgASgBEhQKDEJvb2xlYW5WYWx1ZRgFIAEoCBITCgtTdHJpbmdWYWx1ZRgG", + "IAEoCRISCgpCeXRlc1ZhbHVlGAcgASgMQh8KHWNvbS50d2luZS50YW5nby5w", + "bXIuZGF0YXN0b3JlYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tango.PMR.DataStore.DataTypeReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.DataStore.DataStoreItem), global::Tango.PMR.DataStore.DataStoreItem.Parser, new[]{ "Key", "DataType", "Int32Value", "FloatValue", "DoubleValue", "BooleanValue", "StringValue", "BytesValue" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.DataStore.DataStoreItem), global::Tango.PMR.DataStore.DataStoreItem.Parser, new[]{ "DataType", "Int32Value", "FloatValue", "DoubleValue", "BooleanValue", "StringValue", "BytesValue" }, null, null, null) })); } #endregion @@ -63,7 +63,6 @@ namespace Tango.PMR.DataStore { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public DataStoreItem(DataStoreItem other) : this() { - key_ = other.key_; dataType_ = other.dataType_; int32Value_ = other.int32Value_; floatValue_ = other.floatValue_; @@ -78,19 +77,8 @@ namespace Tango.PMR.DataStore { return new DataStoreItem(this); } - /// <summary>Field number for the "Key" field.</summary> - public const int KeyFieldNumber = 1; - private string key_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Key { - get { return key_; } - set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - /// <summary>Field number for the "DataType" field.</summary> - public const int DataTypeFieldNumber = 2; + public const int DataTypeFieldNumber = 1; private global::Tango.PMR.DataStore.DataType dataType_ = 0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Tango.PMR.DataStore.DataType DataType { @@ -101,7 +89,7 @@ namespace Tango.PMR.DataStore { } /// <summary>Field number for the "Int32Value" field.</summary> - public const int Int32ValueFieldNumber = 3; + public const int Int32ValueFieldNumber = 2; private int int32Value_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Int32Value { @@ -112,7 +100,7 @@ namespace Tango.PMR.DataStore { } /// <summary>Field number for the "FloatValue" field.</summary> - public const int FloatValueFieldNumber = 4; + public const int FloatValueFieldNumber = 3; private float floatValue_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public float FloatValue { @@ -123,7 +111,7 @@ namespace Tango.PMR.DataStore { } /// <summary>Field number for the "DoubleValue" field.</summary> - public const int DoubleValueFieldNumber = 5; + public const int DoubleValueFieldNumber = 4; private double doubleValue_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double DoubleValue { @@ -134,7 +122,7 @@ namespace Tango.PMR.DataStore { } /// <summary>Field number for the "BooleanValue" field.</summary> - public const int BooleanValueFieldNumber = 6; + public const int BooleanValueFieldNumber = 5; private bool booleanValue_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool BooleanValue { @@ -145,7 +133,7 @@ namespace Tango.PMR.DataStore { } /// <summary>Field number for the "StringValue" field.</summary> - public const int StringValueFieldNumber = 7; + public const int StringValueFieldNumber = 6; private string stringValue_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string StringValue { @@ -156,7 +144,7 @@ namespace Tango.PMR.DataStore { } /// <summary>Field number for the "BytesValue" field.</summary> - public const int BytesValueFieldNumber = 8; + public const int BytesValueFieldNumber = 7; private pb::ByteString bytesValue_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString BytesValue { @@ -179,7 +167,6 @@ namespace Tango.PMR.DataStore { if (ReferenceEquals(other, this)) { return true; } - if (Key != other.Key) return false; if (DataType != other.DataType) return false; if (Int32Value != other.Int32Value) return false; if (FloatValue != other.FloatValue) return false; @@ -193,7 +180,6 @@ namespace Tango.PMR.DataStore { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Key.Length != 0) hash ^= Key.GetHashCode(); if (DataType != 0) hash ^= DataType.GetHashCode(); if (Int32Value != 0) hash ^= Int32Value.GetHashCode(); if (FloatValue != 0F) hash ^= FloatValue.GetHashCode(); @@ -211,36 +197,32 @@ namespace Tango.PMR.DataStore { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } if (DataType != 0) { - output.WriteRawTag(16); + output.WriteRawTag(8); output.WriteEnum((int) DataType); } if (Int32Value != 0) { - output.WriteRawTag(24); + output.WriteRawTag(16); output.WriteInt32(Int32Value); } if (FloatValue != 0F) { - output.WriteRawTag(37); + output.WriteRawTag(29); output.WriteFloat(FloatValue); } if (DoubleValue != 0D) { - output.WriteRawTag(41); + output.WriteRawTag(33); output.WriteDouble(DoubleValue); } if (BooleanValue != false) { - output.WriteRawTag(48); + output.WriteRawTag(40); output.WriteBool(BooleanValue); } if (StringValue.Length != 0) { - output.WriteRawTag(58); + output.WriteRawTag(50); output.WriteString(StringValue); } if (BytesValue.Length != 0) { - output.WriteRawTag(66); + output.WriteRawTag(58); output.WriteBytes(BytesValue); } } @@ -248,9 +230,6 @@ namespace Tango.PMR.DataStore { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); - } if (DataType != 0) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DataType); } @@ -280,9 +259,6 @@ namespace Tango.PMR.DataStore { if (other == null) { return; } - if (other.Key.Length != 0) { - Key = other.Key; - } if (other.DataType != 0) { DataType = other.DataType; } @@ -314,35 +290,31 @@ namespace Tango.PMR.DataStore { default: input.SkipLastField(); break; - case 10: { - Key = input.ReadString(); - break; - } - case 16: { + case 8: { dataType_ = (global::Tango.PMR.DataStore.DataType) input.ReadEnum(); break; } - case 24: { + case 16: { Int32Value = input.ReadInt32(); break; } - case 37: { + case 29: { FloatValue = input.ReadFloat(); break; } - case 41: { + case 33: { DoubleValue = input.ReadDouble(); break; } - case 48: { + case 40: { BooleanValue = input.ReadBool(); break; } - case 58: { + case 50: { StringValue = input.ReadString(); break; } - case 66: { + case 58: { BytesValue = input.ReadBytes(); break; } |
