Example #1
0
 public void MergeFrom(StupidIoTDevice other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.Id.Length != 0)
     {
         Id = other.Id;
     }
     if (other.StatusMessage.Length != 0)
     {
         StatusMessage = other.StatusMessage;
     }
     if (other.SelfCheckPassed != false)
     {
         SelfCheckPassed = other.SelfCheckPassed;
     }
     if (other.ServiceModeEnabled != false)
     {
         ServiceModeEnabled = other.ServiceModeEnabled;
     }
     if (other.UptimeInSeconds != 0UL)
     {
         UptimeInSeconds = other.UptimeInSeconds;
     }
     if (other.pressure_ != null)
     {
         if (pressure_ == null)
         {
             Pressure = new global::ProgrammingChallenge2.Codecs.Matthid.Protobuf.StupidPhysicalValue();
         }
         Pressure.MergeFrom(other.Pressure);
     }
     if (other.temperature_ != null)
     {
         if (temperature_ == null)
         {
             Temperature = new global::ProgrammingChallenge2.Codecs.Matthid.Protobuf.StupidPhysicalValue();
         }
         Temperature.MergeFrom(other.Temperature);
     }
     if (other.distance_ != null)
     {
         if (distance_ == null)
         {
             Distance = new global::ProgrammingChallenge2.Codecs.Matthid.Protobuf.StupidPhysicalValue();
         }
         Distance.MergeFrom(other.Distance);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Example #2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    Name = input.ReadString();
                    break;
                }

                case 18: {
                    Id = input.ReadString();
                    break;
                }

                case 26: {
                    StatusMessage = input.ReadString();
                    break;
                }

                case 32: {
                    SelfCheckPassed = input.ReadBool();
                    break;
                }

                case 40: {
                    ServiceModeEnabled = input.ReadBool();
                    break;
                }

                case 48: {
                    UptimeInSeconds = input.ReadUInt64();
                    break;
                }

                case 58: {
                    if (pressure_ == null)
                    {
                        Pressure = new global::ProgrammingChallenge2.Codecs.Matthid.Protobuf.StupidPhysicalValue();
                    }
                    input.ReadMessage(Pressure);
                    break;
                }

                case 66: {
                    if (temperature_ == null)
                    {
                        Temperature = new global::ProgrammingChallenge2.Codecs.Matthid.Protobuf.StupidPhysicalValue();
                    }
                    input.ReadMessage(Temperature);
                    break;
                }

                case 74: {
                    if (distance_ == null)
                    {
                        Distance = new global::ProgrammingChallenge2.Codecs.Matthid.Protobuf.StupidPhysicalValue();
                    }
                    input.ReadMessage(Distance);
                    break;
                }
                }
            }
        }