Ejemplo n.º 1
0
        public async Task <bool> SetExposure(float exposureTime, CancellationToken ct)
        {
            int exposure = (int)(exposureTime * 1000000);
            //Exposure time, registers from props.txt
            var rez = await _cameraHelper.SetConfigRegisterAsync(263268, exposure);

            return(rez > 0);
        }
        private async Task CorrectGainAsync(TakeParams acquireParams)
        {
            //lower gain limit
            var P1 = (int)acquireParams.MinGain;

            //high gain limit
            var P2 = acquireParams.MaxGain;

            //from props.txt
            var gain = (P1 == 226) ? (2048 - 2048 * Math.Exp(-acquireParams.AnalogGain * Math.Log(10) / 20)) : (acquireParams.AnalogGain * 10 + P2);

            //set gain, 131108 register from props.txt
            var rez = await _cameraHelper.SetConfigRegisterAsync(131108, (int)gain);

            gain = await _cameraHelper.GetBlocksSizeAsync(131108);
        }