Innovenergy_trunk/csharp/lib/Wireformat/cs/Device.cs

465 lines
17 KiB
C#

// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: VictronV1/Device.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace InnovEnergy.WireFormat.VictronV1 {
/// <summary>Holder for reflection information generated from VictronV1/Device.proto</summary>
public static partial class DeviceReflection {
#region Descriptor
/// <summary>File descriptor for VictronV1/Device.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static DeviceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChZWaWN0cm9uVjEvRGV2aWNlLnByb3RvGiFWaWN0cm9uVjEvQmF0dGVyeVN0",
"YXR1czQ4VEwucHJvdG8iOAoFUGhhc2USDwoHdm9sdGFnZRgBIAEoAhIPCgdj",
"dXJyZW50GAIgASgCEg0KBXBvd2VyGAMgASgCIn4KBkRldmljZRIZCgR0eXBl",
"GAEgASgOMgsuRGV2aWNlVHlwZRIWCgZwaGFzZXMYBCADKAsyBi5QaGFzZRIY",
"CgdkZXZpY2VzGAUgAygLMgcuRGV2aWNlEicKC2JhdHRlcnlEYXRhGAogASgL",
"MhIuQmF0dGVyeVN0YXR1czQ4VEwq5wEKCkRldmljZVR5cGUSEQoNVW5rbm93",
"bkRldmljZRAAEggKBEdyaWQQARIJCgVTaG9yZRACEgsKB0FjSW5CdXMQAxIM",
"CghBY091dEJ1cxAEEgkKBUFjQnVzEAUSCQoFRGNCdXMQBhIMCghJbnZlcnRl",
"chAHEhIKDkJhdHRlcnk0OFRMMjAwEAgSDgoKUHZJbnZlcnRlchAJEggKBE1w",
"cHQQChINCglHZW5lcmF0b3IQCxIKCgZBY0xvYWQQDBIKCgZEY0xvYWQQDRIK",
"CgZMb3NzZXMQDhIRCg1CYXR0ZXJ5SGVhdGVyEA9CI6oCIElubm92RW5lcmd5",
"LldpcmVGb3JtYXQuVmljdHJvblYxYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::InnovEnergy.WireFormat.VictronV1.BatteryStatus48TLReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::InnovEnergy.WireFormat.VictronV1.DeviceType), }, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::InnovEnergy.WireFormat.VictronV1.Phase), global::InnovEnergy.WireFormat.VictronV1.Phase.Parser, new[]{ "Voltage", "Current", "Power" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::InnovEnergy.WireFormat.VictronV1.Device), global::InnovEnergy.WireFormat.VictronV1.Device.Parser, new[]{ "Type", "Phases", "Devices", "BatteryData" }, null, null, null)
}));
}
#endregion
}
#region Enums
public enum DeviceType {
[pbr::OriginalName("UnknownDevice")] UnknownDevice = 0,
[pbr::OriginalName("Grid")] Grid = 1,
[pbr::OriginalName("Shore")] Shore = 2,
[pbr::OriginalName("AcInBus")] AcInBus = 3,
[pbr::OriginalName("AcOutBus")] AcOutBus = 4,
[pbr::OriginalName("AcBus")] AcBus = 5,
[pbr::OriginalName("DcBus")] DcBus = 6,
[pbr::OriginalName("Inverter")] Inverter = 7,
[pbr::OriginalName("Battery48TL200")] Battery48Tl200 = 8,
[pbr::OriginalName("PvInverter")] PvInverter = 9,
[pbr::OriginalName("Mppt")] Mppt = 10,
[pbr::OriginalName("Generator")] Generator = 11,
[pbr::OriginalName("AcLoad")] AcLoad = 12,
[pbr::OriginalName("DcLoad")] DcLoad = 13,
[pbr::OriginalName("Losses")] Losses = 14,
[pbr::OriginalName("BatteryHeater")] BatteryHeater = 15,
}
#endregion
#region Messages
public sealed partial class Phase : pb::IMessage<Phase> {
private static readonly pb::MessageParser<Phase> _parser = new pb::MessageParser<Phase>(() => new Phase());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Phase> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::InnovEnergy.WireFormat.VictronV1.DeviceReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Phase() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Phase(Phase other) : this() {
voltage_ = other.voltage_;
current_ = other.current_;
power_ = other.power_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Phase Clone() {
return new Phase(this);
}
/// <summary>Field number for the "voltage" field.</summary>
public const int VoltageFieldNumber = 1;
private float voltage_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float Voltage {
get { return voltage_; }
set {
voltage_ = value;
}
}
/// <summary>Field number for the "current" field.</summary>
public const int CurrentFieldNumber = 2;
private float current_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float Current {
get { return current_; }
set {
current_ = value;
}
}
/// <summary>Field number for the "power" field.</summary>
public const int PowerFieldNumber = 3;
private float power_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float Power {
get { return power_; }
set {
power_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Phase);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Phase other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Voltage, other.Voltage)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Current, other.Current)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Power, other.Power)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Voltage != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Voltage);
if (Current != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Current);
if (Power != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Power);
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Voltage != 0F) {
output.WriteRawTag(13);
output.WriteFloat(Voltage);
}
if (Current != 0F) {
output.WriteRawTag(21);
output.WriteFloat(Current);
}
if (Power != 0F) {
output.WriteRawTag(29);
output.WriteFloat(Power);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Voltage != 0F) {
size += 1 + 4;
}
if (Current != 0F) {
size += 1 + 4;
}
if (Power != 0F) {
size += 1 + 4;
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Phase other) {
if (other == null) {
return;
}
if (other.Voltage != 0F) {
Voltage = other.Voltage;
}
if (other.Current != 0F) {
Current = other.Current;
}
if (other.Power != 0F) {
Power = other.Power;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 13: {
Voltage = input.ReadFloat();
break;
}
case 21: {
Current = input.ReadFloat();
break;
}
case 29: {
Power = input.ReadFloat();
break;
}
}
}
}
}
public sealed partial class Device : pb::IMessage<Device> {
private static readonly pb::MessageParser<Device> _parser = new pb::MessageParser<Device>(() => new Device());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Device> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::InnovEnergy.WireFormat.VictronV1.DeviceReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Device() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Device(Device other) : this() {
type_ = other.type_;
phases_ = other.phases_.Clone();
devices_ = other.devices_.Clone();
batteryData_ = other.batteryData_ != null ? other.batteryData_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Device Clone() {
return new Device(this);
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 1;
private global::InnovEnergy.WireFormat.VictronV1.DeviceType type_ = 0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::InnovEnergy.WireFormat.VictronV1.DeviceType Type {
get { return type_; }
set {
type_ = value;
}
}
/// <summary>Field number for the "phases" field.</summary>
public const int PhasesFieldNumber = 4;
private static readonly pb::FieldCodec<global::InnovEnergy.WireFormat.VictronV1.Phase> _repeated_phases_codec
= pb::FieldCodec.ForMessage(34, global::InnovEnergy.WireFormat.VictronV1.Phase.Parser);
private readonly pbc::RepeatedField<global::InnovEnergy.WireFormat.VictronV1.Phase> phases_ = new pbc::RepeatedField<global::InnovEnergy.WireFormat.VictronV1.Phase>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::InnovEnergy.WireFormat.VictronV1.Phase> Phases {
get { return phases_; }
}
/// <summary>Field number for the "devices" field.</summary>
public const int DevicesFieldNumber = 5;
private static readonly pb::FieldCodec<global::InnovEnergy.WireFormat.VictronV1.Device> _repeated_devices_codec
= pb::FieldCodec.ForMessage(42, global::InnovEnergy.WireFormat.VictronV1.Device.Parser);
private readonly pbc::RepeatedField<global::InnovEnergy.WireFormat.VictronV1.Device> devices_ = new pbc::RepeatedField<global::InnovEnergy.WireFormat.VictronV1.Device>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::InnovEnergy.WireFormat.VictronV1.Device> Devices {
get { return devices_; }
}
/// <summary>Field number for the "batteryData" field.</summary>
public const int BatteryDataFieldNumber = 10;
private global::InnovEnergy.WireFormat.VictronV1.BatteryStatus48TL batteryData_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::InnovEnergy.WireFormat.VictronV1.BatteryStatus48TL BatteryData {
get { return batteryData_; }
set {
batteryData_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Device);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Device other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Type != other.Type) return false;
if(!phases_.Equals(other.phases_)) return false;
if(!devices_.Equals(other.devices_)) return false;
if (!object.Equals(BatteryData, other.BatteryData)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Type != 0) hash ^= Type.GetHashCode();
hash ^= phases_.GetHashCode();
hash ^= devices_.GetHashCode();
if (batteryData_ != null) hash ^= BatteryData.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Type != 0) {
output.WriteRawTag(8);
output.WriteEnum((int) Type);
}
phases_.WriteTo(output, _repeated_phases_codec);
devices_.WriteTo(output, _repeated_devices_codec);
if (batteryData_ != null) {
output.WriteRawTag(82);
output.WriteMessage(BatteryData);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Type != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
}
size += phases_.CalculateSize(_repeated_phases_codec);
size += devices_.CalculateSize(_repeated_devices_codec);
if (batteryData_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(BatteryData);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Device other) {
if (other == null) {
return;
}
if (other.Type != 0) {
Type = other.Type;
}
phases_.Add(other.phases_);
devices_.Add(other.devices_);
if (other.batteryData_ != null) {
if (batteryData_ == null) {
batteryData_ = new global::InnovEnergy.WireFormat.VictronV1.BatteryStatus48TL();
}
BatteryData.MergeFrom(other.BatteryData);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
type_ = (global::InnovEnergy.WireFormat.VictronV1.DeviceType) input.ReadEnum();
break;
}
case 34: {
phases_.AddEntriesFrom(input, _repeated_phases_codec);
break;
}
case 42: {
devices_.AddEntriesFrom(input, _repeated_devices_codec);
break;
}
case 82: {
if (batteryData_ == null) {
batteryData_ = new global::InnovEnergy.WireFormat.VictronV1.BatteryStatus48TL();
}
input.ReadMessage(batteryData_);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code