void SetValue(NetValueObject obj, string name, float val) { NetValueObject.ValueControllerCtl c = obj.GetValue(name); string value = val.ToString(); if (val < 0) { value = "auto"; } if (c != null) { c.value = value; } }
public void UpdateValuesObject(NetValueObject obj) { if (_gainValue == null) { _gainValue = obj.GetValue("Camera.Gain"); } else { SetValue(_gainValue, GainValue); } if (_brightnessValue == null) { _brightnessValue = obj.GetValue("Camera.Brightness"); } else { SetValue(_brightnessValue, BrightnessValue); } if (_contrastValue == null) { _contrastValue = obj.GetValue("Camera.Contrast"); } else { SetValue(_contrastValue, ContrastValue); } if (_saturationValue == null) { _saturationValue = obj.GetValue("Camera.Saturation"); } else { SetValue(_saturationValue, SaturationValue); } if (_wbValue == null) { _wbValue = obj.GetValue("Camera.WhiteBalance"); } else { SetValue(_wbValue, WhiteBalanceValue); } if (_gammaValue == null) { _gammaValue = obj.GetValue("Camera.Gamma"); } else { SetValue(_gammaValue, GammaValue); } if (_expValue == null) { _expValue = obj.GetValue("Camera.Exposure"); } else { SetValue(_expValue, ExposureValue); } }