コード例 #1
0
ファイル: Config.cs プロジェクト: zakirIndia/simulator
 public void MergeFrom(Config other)
 {
     if (other == null)
     {
         return;
     }
     if (other.CameraDev.Length != 0)
     {
         CameraDev = other.CameraDev;
     }
     if (other.FrameId.Length != 0)
     {
         FrameId = other.FrameId;
     }
     if (other.PixelFormat.Length != 0)
     {
         PixelFormat = other.PixelFormat;
     }
     if (other.IoMethod != 0)
     {
         IoMethod = other.IoMethod;
     }
     if (other.Width != 0)
     {
         Width = other.Width;
     }
     if (other.Height != 0)
     {
         Height = other.Height;
     }
     if (other.FrameRate != 0)
     {
         FrameRate = other.FrameRate;
     }
     if (other.Monochrome != false)
     {
         Monochrome = other.Monochrome;
     }
     if (other.Brightness != 0)
     {
         Brightness = other.Brightness;
     }
     if (other.Contrast != 0)
     {
         Contrast = other.Contrast;
     }
     if (other.Saturation != 0)
     {
         Saturation = other.Saturation;
     }
     if (other.Sharpness != 0)
     {
         Sharpness = other.Sharpness;
     }
     if (other.Gain != 0)
     {
         Gain = other.Gain;
     }
     if (other.AutoFocus != false)
     {
         AutoFocus = other.AutoFocus;
     }
     if (other.Focus != 0)
     {
         Focus = other.Focus;
     }
     if (other.AutoExposure != false)
     {
         AutoExposure = other.AutoExposure;
     }
     if (other.Exposure != 0)
     {
         Exposure = other.Exposure;
     }
     if (other.AutoWhiteBalance != false)
     {
         AutoWhiteBalance = other.AutoWhiteBalance;
     }
     if (other.WhiteBalance != 0)
     {
         WhiteBalance = other.WhiteBalance;
     }
     if (other.BytesPerPixel != 0)
     {
         BytesPerPixel = other.BytesPerPixel;
     }
     if (other.TriggerInternal != 0)
     {
         TriggerInternal = other.TriggerInternal;
     }
     if (other.TriggerFps != 0)
     {
         TriggerFps = other.TriggerFps;
     }
     if (other.ChannelName.Length != 0)
     {
         ChannelName = other.ChannelName;
     }
     if (other.DeviceWaitMs != 0)
     {
         DeviceWaitMs = other.DeviceWaitMs;
     }
     if (other.SpinRate != 0)
     {
         SpinRate = other.SpinRate;
     }
     if (other.OutputType != 0)
     {
         OutputType = other.OutputType;
     }
     if (other.compressConf_ != null)
     {
         if (compressConf_ == null)
         {
             compressConf_ = new global::Apollo.Drivers.Camera.Config.Config.Types.CompressConfig();
         }
         CompressConf.MergeFrom(other.CompressConf);
     }
 }
コード例 #2
0
ファイル: Config.cs プロジェクト: zakirIndia/simulator
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    input.SkipLastField();
                    break;

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

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

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

                case 32: {
                    ioMethod_ = (global::Apollo.Drivers.Camera.Config.IOMethod)input.ReadEnum();
                    break;
                }

                case 40: {
                    Width = input.ReadUInt32();
                    break;
                }

                case 48: {
                    Height = input.ReadUInt32();
                    break;
                }

                case 56: {
                    FrameRate = input.ReadUInt32();
                    break;
                }

                case 64: {
                    Monochrome = input.ReadBool();
                    break;
                }

                case 72: {
                    Brightness = input.ReadInt32();
                    break;
                }

                case 80: {
                    Contrast = input.ReadInt32();
                    break;
                }

                case 88: {
                    Saturation = input.ReadInt32();
                    break;
                }

                case 96: {
                    Sharpness = input.ReadInt32();
                    break;
                }

                case 104: {
                    Gain = input.ReadInt32();
                    break;
                }

                case 112: {
                    AutoFocus = input.ReadBool();
                    break;
                }

                case 120: {
                    Focus = input.ReadInt32();
                    break;
                }

                case 128: {
                    AutoExposure = input.ReadBool();
                    break;
                }

                case 136: {
                    Exposure = input.ReadInt32();
                    break;
                }

                case 144: {
                    AutoWhiteBalance = input.ReadBool();
                    break;
                }

                case 152: {
                    WhiteBalance = input.ReadInt32();
                    break;
                }

                case 160: {
                    BytesPerPixel = input.ReadUInt32();
                    break;
                }

                case 168: {
                    TriggerInternal = input.ReadUInt32();
                    break;
                }

                case 176: {
                    TriggerFps = input.ReadUInt32();
                    break;
                }

                case 186: {
                    ChannelName = input.ReadString();
                    break;
                }

                case 192: {
                    DeviceWaitMs = input.ReadUInt32();
                    break;
                }

                case 200: {
                    SpinRate = input.ReadUInt32();
                    break;
                }

                case 208: {
                    outputType_ = (global::Apollo.Drivers.Camera.Config.OutputType)input.ReadEnum();
                    break;
                }

                case 218: {
                    if (compressConf_ == null)
                    {
                        compressConf_ = new global::Apollo.Drivers.Camera.Config.Config.Types.CompressConfig();
                    }
                    input.ReadMessage(compressConf_);
                    break;
                }
                }
            }
        }