示例#1
0
        /// <summary>
        /// 解析拍照控制命令
        /// </summary>
        /// <param name="takePicture">拍照实体</param>
        /// <param name="instructionLen">解析后的命令长度</param>
        /// <param name="instruction">命令</param>
        public override byte[] ParseShootInstructionControl(TakePictureControl takePicture)
        {
            YaXunShootPara shootPara = new YaXunShootPara();
            //亮度使用默认值
            shootPara.Brightness = 0x08;
            //对比度使用默认值
            shootPara.Contract = 0x08;
            //色调使用默认值
            shootPara.Tone = 0x08;
            //蓝色饱和度使用默认值
            shootPara.BlueSaturation = 0x08;
            //红色饱和度
            shootPara.RedSaturation = 0x08;
            //图片分辨率使用最小
            shootPara.PicResolution = 0x02;
            //图片质量,默认为0x02,为中等
            shootPara.PicQuality = 0x02;
            //单次抓拍张数
            shootPara.PicCount = (byte)takePicture.Data.PictureCount;
            //摄相头编号
            shootPara.PicCameraId = takePicture.Data.CameraId;

            //终端号
            string terminalNum = takePicture.GPSCode.Substring(4);

            //构建发送数据
            return RealTimeShootPicture(terminalNum, shootPara);
        }
示例#2
0
        /// <summary>
        /// 实时抓拍:参数个数(1)+(参数类型(1)+ 参数长度(1)+ 参数(N))* M
        /// </summary>
        /// <returns></returns>
        /// <param name="terminalNum">终端号</param>
        /// <param name="para">拍照参数</param>
        public byte[] RealTimeShootPicture(string terminalNum, YaXunShootPara para)
        {
            //全部拍照参数都发送,只是部分参数使用默认值
            byte[] buffer = new byte[20];
            //参数个数
            buffer[0] = 0x05;
            //参数类型:图片分辨率
            buffer[1] = 0x01;
            buffer[2] = 0x01;
            buffer[3] = para.PicResolution;

            //参数类型:摄像头编号
            buffer[4] = 0x02;
            buffer[5] = 0x01;
            buffer[6] = para.PicCameraId;

            //参数类型:图片质量
            buffer[7] = 0x03;
            buffer[8] = 0x01;
            buffer[9] = para.PicQuality;

            //参数类型:单次抓拍张数
            buffer[10] = 0x04;
            buffer[11] = 0x01;
            buffer[12] = para.PicCount;

            //参数类型:图像增强配置
            buffer[13] = 0x06;
            buffer[14] = 0x05;
            //亮度
            buffer[15] = para.Brightness;
            //对比度
            buffer[16] = para.Contract;
            //色调
            buffer[17] = para.Tone;
            //蓝色饱和度
            buffer[18] = para.BlueSaturation;
            //红色饱和度
            buffer[19] = para.RedSaturation;

            //构造发送帧
            return BuildSubmitData(buffer, terminalNum, BusinessType.TakePicture, DataType.TakeShootReq);
        }