若该文为原创文章,转载请注明原文出处
本文章博客地址:https://blog.csdn.net/qq21497936/article/details/111241205
长期持续带来更多项目与技术分享,咨询请加QQ:21497936、微信:yangsir198808
红胖子(红模仿)的博文大全:开发技术集合(包含Qt实用技术、树莓派、三维、OpenCV、OpenGL、ffmpeg、OSG、单片机、软硬结合等等)持续更新中…(点击传送门)

合作案例专栏:案例分享(体验Demo可下载,只定制)

需求

  1. 屏幕分辨率1920 x 1080;
  2. 白平衡、冻结、自动背光、自动光源等功能;’
  2. 拍照功能,可设置拍照路径(U盘,SD卡,内置存储);
  3. 录像功能,可设置录像路径(U盘,SD卡,内置存储);
  4. 亮度调整,摄像头光源亮度调整;
  5. 物理按键,包括拍照、录像、上下左右、菜单、默认亮度、选择等等;
  6. 定制开机界面;
  7. 照片、视频九宫格浏览控件;
  8. 照片浏览器;
  9. 视频播放器;
  10. 可查看照片、视频同时支持按键对照片和视频的操作;
  11. 对存储控件的资源浏览器控件’,并可对其复制、粘贴、删除等操作;
  12. 设置时间日期,仿苹果滑动效果;
  13. 其他各种定制控件;

注意

  受限于成本(方案整体成本,较同行业较低),不断压缩的成本,导致该产品的出现关键难点,其在于fpga上的仿arm跑linux的芯片性能等同于2011年的arm水平,经过fpga+arm+qt三方的代码优化和内存优化。’

相关博客

  《案例分享:Qt+Arm基于RV1126平台的内窥镜软硬整套解决方案(实时影像、冻结、拍照、录像、背光调整、硬件光源调整,其他产品也可使用该平台,如视频监控,物联网产品等等)》

关于定制

  支持相关的软硬shang业定制(非shang业勿扰,无ye务不讨论技术细节)

Demo

  
  
  
  
  
软件界面

  
  
  
  
  

关键代码

EndoscopeWidget.h

#ifndef ENDOSCOPEWIDGET_H
#define ENDOSCOPEWIDGET_H#include <QWidget>
#include <QButtonGroup>
#include <QThread>
#include <QLabel>#ifdef LINUX
#include "X264Manager.h"
extern "C" {#include "fpga_comm_app.h"#include "common.h"
}#endif#ifndef LINUX#define LOCAL_DIR       ("local")
#define USB1_DIR        ("usb1")        // usb
#define USB2_DIR        ("usb2")        // usb默认路径
#endif#define PICTURE_DIR     ("Picture")
#define VIDEO_DIR       ("Video")#define DEBUG_X264_SRC   (1)    // 1 - 模拟数据源测试x264, 0 - 使用fpga数据源操作x264库
#define DEBUG_SAVE_PATH  (1)    // 1 - 存储到应用目录下(arm、pc均可用), 0 - 存储到U盘(必须在arm上)#define MKDIR_USE_SHELL  (1)    // 1 - 使用mkdir创建目录, 0 - 使用qt自带的创建目录(建议使用1)#define SKIP_FRAMES      (0)    // 1 - 是跳帧编码, 0 - 不跳帧
#define SKIP_NUM         (0)    // 跳帧时有用,当前帧数 % SKIP_NUM== 0时跳帧#define X264_USE_THREAD  (0)    // 1 - x264编码使用另外的线程(需要拷贝缓存), 0 - 主线程直接调用#define CFG_FILE         ("cfg") // 配置文件namespace Ui {
class EndoscopeWidget;
}class EndoscopeWidget : public QWidget
{Q_OBJECT
public:enum LANGUAGE_TYPE {        // 语言类型LANGUAGE_TYPE_CHINESE_SIMPLE = 0x00,LANGUAGE_TYPE_ENGLISH,LANGUAGE_TYPE_CHINESE_TRADITION};enum SAVE_LOCATION {        // 存储位置SAVE_LOCATION_LOCAL = 0x00,SAVE_LOCATION_USB1,SAVE_LOCATION_USB2};enum FUNCTION_TYPE {        // 功能类型FUNCTION_TYPE_NO_USE = 0x00,FUNCTION_TYPE_PHTOTO,FUNCTION_TYPE_RECORD,FUNCTION_TYPE_FREEZE,FUNCTION_TYPE_WHITE_BALANCE_CORRECT};public:explicit EndoscopeWidget(QWidget *parent = 0);~EndoscopeWidget();signals:void signal_recvYuv(QByteArray byteArray);protected:void addFont();                                             // 添加字体void loadCfg();                                             // 加载配置文件void saveCfg();                                             // 存储配置文件void updateDate();                                          // 更新日期void updateLocateState();                                   // 更新本地local位置使能void mkdir(QString currentDir);                             // 切换存储的时候需要创建文件夹protected:void paintEvent(QPaintEvent *event);void resizeEvent(QResizeEvent *event);protected slots:void slot_labelInfoTimeOut();protected slots:void slot_backgroundLightBrightnessValueChanged(int value);void slot_lightSourceBrightnessValueChanged(int value);protected slots:void slot_dateChanged();                                    // 日期改变更新void slot_languageButtonClicked(QAbstractButton *pBtn);     // 语言按钮(中文简体、English、中文繁体)void slot_locateLocationClicked(QAbstractButton *pBtn);     // 存储位置(本机、USB1,USB2)void slot_key1ButtonClicked(QAbstractButton *pBtn);         // 按键一功能(不用、拍照、录像、冻结、白平衡校正)void slot_key2ButtonClicked(QAbstractButton *pBtn);         // 按键二功能(不用、拍照、录像、冻结、白平衡校正)void slot_doubleClickedVideoFile(QString filePath);         // 双击选中视频文件private slots:                                                  // 左侧菜单void on_pushButton_photograph_clicked();                    // 拍照void on_pushButton_record_clicked(bool checked);            // 录像void on_pushButton_freezeScreen_clicked(bool checked);      // 冻结void on_pushButton_whiteBalanceCorrect_clicked();           // 白平衡校正void on_pushButton_defaultLight_clicked();                  // 默认亮度void on_pushButton_photoSee_clicked();                      // 图片查看private slots:                                                  // 右侧菜单void on_pushButton_lightSourceSet_clicked();                // 光源亮度设置void on_pushButton_dateSet_clicked();                       // 时间日期设置void on_pushButton_languageSet_clicked();                   // 语言设置void on_pushButton_key1Set_clicked();                       // 按键一设置void on_pushButton_key2Set_clicked();                       // 按键二设置void on_pushButton_backgroundLightSet_clicked();            // 背光亮度设置void on_pushButton_photoVideoSet_clicked();                 // 照片/录像文件设置void on_pushButton_set_clicked(bool checked);               // 设置返回private slots:                                                  // 文件操作:左侧操作图片菜单void on_pushButton_delete_clicked();                        // 文件操作:删除void on_pushButton_selectAll_clicked();                     // 文件操作:选择所有void on_pushButton_copy_clicked();                          // 文件操作:复制void on_pushButton_paste_clicked();                         // 文件操作:粘贴void on_pushButton_back_clicked();                          // 文件操作:返回private slots:void on_pushButton_startPlay_clicked();                     // 播放器:播放void on_pushButton_pause_clicked();                         // 播放器:暂停void on_pushButton_resume_clicked();                        // 播放器:恢复void on_pushButton_stop_clicked();                          // 播放器:停止void on_pushButton_playerBack_clicked();                    // 播放器:返回private:Ui::EndoscopeWidget *ui;QList<QString> _listCopyFile;                               // 复制的文件列表QButtonGroup _buttonGroupLanguage;                          // 语言选择QButtonGroup _buttonGroupKey1Function;                      // 按键1功能QButtonGroup _buttonGroupKey2Function;                      // 按键2功能QButtonGroup _buttonLocation;                               // 存储位置QString _filePath;                                          // 播放地址bool _isLoopSaveImageIndex;int _imageIndex;                                            // 当天拍照的序号(从0开始)bool _isLoopSaveVideoIndex;int _videoIndex;                                            // 当天录像的序号(从0开始)QString _cfgFile;                                           // 配置文件LANGUAGE_TYPE _language;                                    // 当前语言SAVE_LOCATION _saveLocation;                                // 当前存储位置FUNCTION_TYPE _key1Function;                                // 按键1功能FUNCTION_TYPE _key2Function;                                // 按键2功能int _backgroundLightBrightness;                             // 背光亮度int _lightSourceBrightness;                                 // 光源亮度QString _storeDir;QString _photoDir;                                          // 辅助变量:当前拍照文件夹QString _videoDir;                                          // 辅助变量:当前视频文件夹QString _fileName;                                          // 辅助变量:存储文件名称#ifdef LINUXstatic QThread *_pX264ManagerThread;                        // x264视频编码线程static X264Manager *_pX264Manager;                          // x264管理类static int _index;
private:QTimer *_pTimer;
protected slots:void slot_timeOut();
public:static bool _recording;static int fpga_com_read_record_data_handler_t(char *buffer, int length);
#endifQTimer *_pTimerInfo;                                        // 计时器用于显示QLabel *_pLabelRecIcon;                                     // 图标QLabel *_pLabelRecord;                                      // 图标QLabel *_pLabelInfo;                                        // 提示Label};#endif // ENDOSCOPEWIDGET_H

EndoscopeWidget.cpp

#include "EndoscopeWidget.h"
#include "ui_EndoscopeWidget.h"#include <QStyleOption>
#include <QPaintEvent>
#include <QPainter>
#include <QDebug>
#include <QDate>
#include <QFontDatabase>
#include <QButtonGroup>
#include <QProcess>
#include <QMessageBox>
#include "DateTime2Widget.h"//#include "JpegManager.h"#ifdef LINUX
QThread *EndoscopeWidget::_pX264ManagerThread = 0;
X264Manager *EndoscopeWidget::_pX264Manager = 0;
bool EndoscopeWidget::_recording = false;
int EndoscopeWidget::_index = 0;
#endifEndoscopeWidget::EndoscopeWidget(QWidget *parent) :QWidget(parent),ui(new Ui::EndoscopeWidget),_imageIndex(1),_isLoopSaveImageIndex(false),_videoIndex(1),_cfgFile(CFG_FILE),                     // 配置文件_language(LANGUAGE_TYPE_CHINESE_SIMPLE),// 默认语言(未加载配置文件之前)_saveLocation(SAVE_LOCATION_LOCAL),     // 默认存储在本地(未加载配置文件之前)_key1Function(FUNCTION_TYPE_NO_USE),    // 默认按键1无功能(未加载配置文件之前)_key2Function(FUNCTION_TYPE_NO_USE),    // 默认按键2无功能(未加载配置文件之前)_backgroundLightBrightness(3),_lightSourceBrightness(9),_pLabelRecIcon(0),_pLabelRecord(0),_pLabelInfo(0),_pTimerInfo(0),
#ifdef LINUX_pTimer(0),
#endif_isLoopSaveVideoIndex(false)
{ui->setupUi(this);// 加载配置文件loadCfg();// 加入自带的字体 “Roboto-Condensed”addFont();// rec图标和提示信息{_pLabelRecIcon = new QLabel(this);_pLabelRecIcon->setStyleSheet("border-image: url(:/images/recIcon.png);");_pLabelRecIcon->show();_pLabelRecord = new QLabel(this);_pLabelRecord->setStyleSheet("border-image: url(:/images/rec.png);");_pLabelRecord->show();_pLabelInfo = new QLabel(this);_pLabelInfo->setStyleSheet("font: 14px \"思源黑体\"; color: rgb(210,210,210);");_pLabelInfo->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);_pLabelInfo->hide();_pTimerInfo = new QTimer();_pTimerInfo->setInterval(1500);connect(_pTimerInfo, SIGNAL(timeout()), this, SLOT(slot_labelInfoTimeOut()));}// 初始化图像控件的默认存储地址(无需加载){
//        ui->widget_camera->setPhotoDir(QString("%1/%2").arg(LOCAL_DIR).arg(PICTURE_DIR));
//        ui->widget_camera->setRecordDir(QString("%1/%2").arg(LOCAL_DIR).arg(VIDEO_DIR));}// 初始化按钮(拍照、录像、触屏冻结、白平衡校正、默认亮度、照片查看){// 初始化按钮的图标区域int iconWidth = 60;int iconHeight = 60;int iconCenterX = 46;int iconCenterY = 63;QRect iconRect(iconCenterX - iconWidth / 2, iconCenterY - iconHeight / 2, iconWidth, iconHeight);// 初始化按钮的文字区域int textWidht = 236;int textheight = 60;int textCenterX = 168;int textCenterY = 63;QRect textRect(textCenterX - textWidht / 2, textCenterY - textheight / 2, textWidht, textheight);// 初始化按钮的字体QFont font = QFont();font.setFamily("思源黑体 CN Normal");font.setPixelSize(36);// 拍照ui->pushButton_photograph->setIconPixmap(QPixmap(":/images/photograph.png"));ui->pushButton_photograph->setIconPixmapPressed(QPixmap(":/images/photograph_pressed.png"));ui->pushButton_photograph->setIconPixmapDisable(QPixmap(":/images/photograph_disabled.png"));ui->pushButton_photograph->setIconPixmapRect(iconRect);ui->pushButton_photograph->setText(tr("拍照"));ui->pushButton_photograph->setTextRect(textRect);ui->pushButton_photograph->setFont(font);// 录像ui->pushButton_record->setIconPixmap(QPixmap(":/images/record.png"));ui->pushButton_record->setIconPixmapPressed(QPixmap(":/images/record_pressed.png"));ui->pushButton_record->setIconPixmapDisable(QPixmap(":/images/record_disabled.png"));ui->pushButton_record->setIconPixmapRect(iconRect);ui->pushButton_record->setText(tr("录像"));ui->pushButton_record->setTextRect(textRect);ui->pushButton_record->setFont(font);// 触屏冻结ui->pushButton_freezeScreen->setIconPixmap(QPixmap(":/images/freezeScreen.png"));ui->pushButton_freezeScreen->setIconPixmapPressed(QPixmap(":/images/freezeScreen_pressed.png"));ui->pushButton_freezeScreen->setIconPixmapDisable(QPixmap(":/images/freezeScreen_disabled.png"));ui->pushButton_freezeScreen->setIconPixmapRect(iconRect);ui->pushButton_freezeScreen->setText(tr("触屏冻结"));ui->pushButton_freezeScreen->setTextRect(textRect);ui->pushButton_freezeScreen->setFont(font);// 白平衡校正ui->pushButton_whiteBalanceCorrect->setIconPixmap(QPixmap(":/images/whiteBalanceCorrect.png"));ui->pushButton_whiteBalanceCorrect->setIconPixmapPressed(QPixmap(":/images/whiteBalanceCorrect_pressed.png"));ui->pushButton_whiteBalanceCorrect->setIconPixmapDisable(QPixmap(":/images/whiteBalanceCorrect_disabled.png"));ui->pushButton_whiteBalanceCorrect->setIconPixmapRect(iconRect);ui->pushButton_whiteBalanceCorrect->setText(tr("白平衡校正"));ui->pushButton_whiteBalanceCorrect->setTextRect(textRect);ui->pushButton_whiteBalanceCorrect->setFont(font);// 默认亮度ui->pushButton_defaultLight->setIconPixmap(QPixmap(":/images/defaultLight.png"));ui->pushButton_defaultLight->setIconPixmapPressed(QPixmap(":/images/defaultLight_pressed.png"));ui->pushButton_defaultLight->setIconPixmapDisable(QPixmap(":/images/defaultLight_disabled.png"));ui->pushButton_defaultLight->setIconPixmapRect(iconRect);ui->pushButton_defaultLight->setText(tr("默认亮度"));ui->pushButton_defaultLight->setTextRect(textRect);ui->pushButton_defaultLight->setFont(font);// 照片查看ui->pushButton_photoSee->setIconPixmap(QPixmap(":/images/photoSee.png"));ui->pushButton_photoSee->setIconPixmapPressed(QPixmap(":/images/photoSee_pressed.png"));ui->pushButton_photoSee->setIconPixmapDisable(QPixmap(":/images/photoSee_disabled.png"));ui->pushButton_photoSee->setIconPixmapRect(iconRect);ui->pushButton_photoSee->setText(tr("照片查看"));ui->pushButton_photoSee->setTextRect(textRect);ui->pushButton_photoSee->setFont(font);}// 初始化按钮(删除、复制、粘贴、选择、返回){int iconWidth2 = 40;int iconHeight2 = 40;int iconCenterX2 = 80;int iconCenterY2 = 63;QRect iconRect2(iconCenterX2 - iconWidth2 / 2, iconCenterY2 - iconHeight2 / 2, iconWidth2, iconHeight2);// 初始化按钮的文字区域int textWidht = 236;int textheight = 60;int textCenterX = 170;int textCenterY = 63;QRect textRect(textCenterX - textWidht / 2, textCenterY - textheight / 2, textWidht, textheight);// 初始化按钮的字体QFont font = QFont();font.setFamily("思源黑体 CN Normal");font.setPixelSize(32);// 删除ui->pushButton_delete->setIconPixmap(QPixmap(":/images/delete.png"));ui->pushButton_delete->setIconPixmapPressed(QPixmap(":/images/delete_pressed.png"));ui->pushButton_delete->setIconPixmapDisable(QPixmap(":/images/delete_disabled.png"));ui->pushButton_delete->setIconPixmapRect(iconRect2);ui->pushButton_delete->setText(tr("删 除"));ui->pushButton_delete->setTextRect(textRect);ui->pushButton_delete->setFont(font);// 全选ui->pushButton_selectAll->setIconPixmap(QPixmap(":/images/selectAll.png"));ui->pushButton_selectAll->setIconPixmapPressed(QPixmap(":/images/selectAll_pressed.png"));ui->pushButton_selectAll->setIconPixmapDisable(QPixmap(":/images/selectAll_disabled.png"));ui->pushButton_selectAll->setIconPixmapRect(iconRect2);ui->pushButton_selectAll->setText(tr("全 选"));ui->pushButton_selectAll->setTextRect(textRect);ui->pushButton_selectAll->setFont(font);// 复制ui->pushButton_copy->setIconPixmap(QPixmap(":/images/copy.png"));ui->pushButton_copy->setIconPixmapPressed(QPixmap(":/images/copy_pressed.png"));ui->pushButton_copy->setIconPixmapDisable(QPixmap(":/images/copy_disabled.png"));ui->pushButton_copy->setIconPixmapRect(iconRect2);ui->pushButton_copy->setText(tr("复 制"));ui->pushButton_copy->setTextRect(textRect);ui->pushButton_copy->setFont(font);// 粘贴ui->pushButton_paste->setIconPixmap(QPixmap(":/images/paste.png"));ui->pushButton_paste->setIconPixmapPressed(QPixmap(":/images/paste_pressed.png"));ui->pushButton_paste->setIconPixmapDisable(QPixmap(":/images/paste_disabled.png"));ui->pushButton_paste->setIconPixmapRect(iconRect2);ui->pushButton_paste->setText(tr("粘 贴"));ui->pushButton_paste->setTextRect(textRect);ui->pushButton_paste->setFont(font);// 返回ui->pushButton_back->setIconPixmap(QPixmap(":/images/back.png"));ui->pushButton_back->setIconPixmapPressed(QPixmap(":/images/back_pressed.png"));ui->pushButton_back->setIconPixmapDisable(QPixmap(":/images/delete_disabled.png"));ui->pushButton_back->setIconPixmapRect(iconRect2);ui->pushButton_back->setText(tr("返 回"));ui->pushButton_back->setTextRect(textRect);ui->pushButton_back->setFont(font);}// 初始化按钮(播放、暂停、恢复、停止、返回){// 初始化按钮的文字区域int textWidht = 236;int textheight = 60;int textCenterX = 170;int textCenterY = 63;QRect textRect(textCenterX - textWidht / 2, textCenterY - textheight / 2, textWidht, textheight);// 初始化按钮的字体QFont font = QFont();font.setFamily("思源黑体 CN Normal");font.setPixelSize(32);// 播放ui->pushButton_startPlay->setText(tr("播 放"));ui->pushButton_startPlay->setTextRect(textRect);ui->pushButton_startPlay->setFont(font);// 暂停ui->pushButton_pause->setText(tr("暂 停"));ui->pushButton_pause->setTextRect(textRect);ui->pushButton_pause->setFont(font);// 恢复ui->pushButton_resume->setText(tr("恢 复"));ui->pushButton_resume->setTextRect(textRect);ui->pushButton_resume->setFont(font);// 停止ui->pushButton_stop->setText(tr("停 止"));ui->pushButton_stop->setTextRect(textRect);ui->pushButton_stop->setFont(font);// 返回ui->pushButton_playerBack->setText(tr("返 回"));ui->pushButton_playerBack->setTextRect(textRect);ui->pushButton_playerBack->setFont(font);}// 初始化按钮(设置){int iconWidth2 = 34;int iconHeight2 = 34;int iconCenterX2 = 256;int iconCenterY2 = 46;QRect iconRect2(iconCenterX2 - iconWidth2 / 2, iconCenterY2 - iconHeight2 / 2, iconWidth2, iconHeight2);// 初始化按钮的文字区域QRect textRect = ui->pushButton_set->rect();// 初始化按钮的字体QFont font = QFont();font.setFamily("思源黑体 CN Normal");font.setPixelSize(36);ui->pushButton_set->setIconPixmap(QPixmap(":/images/back.png"));ui->pushButton_set->setIconPixmapPressed(QPixmap(":/images/back_pressed.png"));ui->pushButton_set->setIconPixmapDisable(QPixmap(":/images/back_pressed.png"));ui->pushButton_set->setIconPixmapRect(iconRect2);ui->pushButton_set->setText(tr("设置选项"));ui->pushButton_set->setTextRect(textRect);ui->pushButton_set->setFont(font);}// 初始化各区域显示界面{ui->stackedWidget_leftKeys->setCurrentIndex(0);ui->stackedWidget_center->setCurrentIndex(0);ui->stackedWidget_rightKeys->setCurrentIndex(0);}// 用于模拟,打开usb摄像头{ui->widget_camera->open(0);}// 背景亮度改为4级(0,1,2,3)(默认为9级,0~8){QFont font = ui->widget_backgroundLightSlider->getFont();font.setFamily("思源黑体 CN Normal");font.setPixelSize(32);ui->widget_backgroundLightSlider->setAddPixmap(QPixmap(":/images/add.png"));ui->widget_backgroundLightSlider->setAddPixmapPressed(QPixmap(":/images/add_pressed.png"));ui->widget_backgroundLightSlider->setDecPixmap(QPixmap(":/images/dec.png"));ui->widget_backgroundLightSlider->setDecPixmapPressed(QPixmap(":/images/dec_pressed.png"));ui->widget_backgroundLightSlider->setFont(font);ui->widget_backgroundLightSlider->setMinValue(0);ui->widget_backgroundLightSlider->setMaxValue(3);ui->widget_backgroundLightSlider->setValue(_backgroundLightBrightness);ui->widget_backgroundLightSlider->setBackgroundPixmap(QPixmap(":/sliderWidget/images/background.png"));connect(ui->widget_backgroundLightSlider, SIGNAL(signal_valueChanged(int)),this, SLOT(slot_backgroundLightBrightnessValueChanged(int)));}// 光源亮度9级别(0,1,2,3,4,5,6,7,8,9){QFont font = ui->widget_backgroundLightSlider->getFont();font.setFamily("思源黑体 CN Normal");font.setPixelSize(32);ui->widget_lightSourceSlider->setAddPixmap(QPixmap(":/images/add.png"));ui->widget_lightSourceSlider->setAddPixmapPressed(QPixmap(":/images/add_pressed.png"));ui->widget_lightSourceSlider->setDecPixmap(QPixmap(":/images/dec.png"));ui->widget_lightSourceSlider->setDecPixmapPressed(QPixmap(":/images/dec_pressed.png"));ui->widget_lightSourceSlider->setFont(font);ui->widget_lightSourceSlider->setMinValue(0);ui->widget_lightSourceSlider->setMaxValue(9);ui->widget_lightSourceSlider->setValue(_lightSourceBrightness);ui->widget_lightSourceSlider->setBackgroundPixmap(QPixmap(":/sliderWidget/images/ligthSourceBackground.png"));connect(ui->widget_lightSourceSlider, SIGNAL(signal_valueChanged(int)),this, SLOT(slot_lightSourceBrightnessValueChanged(int)));}// 语言选择{_buttonGroupLanguage.addButton(ui->pushButton_chineseSimple);_buttonGroupLanguage.addButton(ui->pushButton_english);_buttonGroupLanguage.addButton(ui->pushButton_chineseTradition);connect(&_buttonGroupLanguage, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(slot_languageButtonClicked(QAbstractButton*)));switch (_language){case LANGUAGE_TYPE_CHINESE_SIMPLE:ui->pushButton_chineseSimple->setChecked(true);break;case LANGUAGE_TYPE_ENGLISH:ui->pushButton_english->setChecked(true);break;case LANGUAGE_TYPE_CHINESE_TRADITION:ui->pushButton_chineseTradition->setChecked(true);break;default:break;}}// 按键1和2的功能{// 按键1的功能按钮{ui->pushButton_key1NoUse->setText(tr("不使用"));ui->pushButton_key1Photo->setText(tr("拍照"));ui->pushButton_key1Record->setText(tr("录像"));ui->pushButton_key1Freeze->setText(tr("冻结"));ui->pushButton_key1WhiteBalanceCorrect->setText(tr("白平衡校准"));_buttonGroupKey1Function.addButton(ui->pushButton_key1NoUse);_buttonGroupKey1Function.addButton(ui->pushButton_key1Photo);_buttonGroupKey1Function.addButton(ui->pushButton_key1Record);_buttonGroupKey1Function.addButton(ui->pushButton_key1Freeze);_buttonGroupKey1Function.addButton(ui->pushButton_key1WhiteBalanceCorrect);connect(&_buttonGroupKey1Function, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(slot_key1ButtonClicked(QAbstractButton*)));switch (_key1Function){case FUNCTION_TYPE_NO_USE:ui->pushButton_key1NoUse->setChecked(true);break;case FUNCTION_TYPE_PHTOTO:ui->pushButton_key1Photo->setChecked(true);break;case FUNCTION_TYPE_RECORD:ui->pushButton_key1Record->setChecked(true);break;case FUNCTION_TYPE_FREEZE:ui->pushButton_key1Freeze->setChecked(true);break;case FUNCTION_TYPE_WHITE_BALANCE_CORRECT:ui->pushButton_key1WhiteBalanceCorrect->setChecked(true);break;default:break;}}// 按键2的功能按钮{ui->pushButton_key2NoUse->setText(tr("不使用"));ui->pushButton_key2Photo->setText(tr("拍照"));ui->pushButton_key2Record->setText(tr("录像"));ui->pushButton_key2Freeze->setText(tr("冻结"));ui->pushButton_key2WhiteBalanceCorrect->setText(tr("白平衡校准"));_buttonGroupKey2Function.addButton(ui->pushButton_key2NoUse);_buttonGroupKey2Function.addButton(ui->pushButton_key2Photo);_buttonGroupKey2Function.addButton(ui->pushButton_key2Record);_buttonGroupKey2Function.addButton(ui->pushButton_key2Freeze);_buttonGroupKey2Function.addButton(ui->pushButton_key2WhiteBalanceCorrect);connect(&_buttonGroupKey2Function, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(slot_key2ButtonClicked(QAbstractButton*)));switch (_key1Function){case FUNCTION_TYPE_NO_USE:ui->pushButton_key2NoUse->setChecked(true);break;case FUNCTION_TYPE_PHTOTO:ui->pushButton_key2Photo->setChecked(true);break;case FUNCTION_TYPE_RECORD:ui->pushButton_key2Record->setChecked(true);break;case FUNCTION_TYPE_FREEZE:ui->pushButton_key2Freeze->setChecked(true);break;case FUNCTION_TYPE_WHITE_BALANCE_CORRECT:ui->pushButton_key2WhiteBalanceCorrect->setChecked(true);break;default:break;}}}// 存储位置选择{// 存储位置选择{ui->label_locateLocal->setText(tr("本机"));ui->label_locateUsb1->setText(tr("USB1"));ui->label_locateUsb2->setText(tr("USB2"));ui->label_locateLocal->setParent(ui->pushButton_locateLocal);ui->label_locateUsb1->setParent(ui->pushButton_locateUsb1);ui->label_locateUsb2->setParent(ui->pushButton_locateUsb2);ui->label_locateLocal->move(0, 0);ui->label_locateUsb1->move(0, 0);ui->label_locateUsb2->move(0, 0);ui->label_locateLocalStore->setText(QString("%1MB%2").arg(320).arg(tr("剩余")));ui->label_locateUsb1Store->setText(QString("%1MB%2").arg(320).arg(tr("剩余")));ui->label_locateUsb2Store->setText(QString("%1MB%2").arg(0).arg(tr("剩余")));ui->label_locateLocalStore->setParent(ui->pushButton_locateLocal);ui->label_locateUsb1Store->setParent(ui->pushButton_locateUsb1);ui->label_locateUsb2Store->setParent(ui->pushButton_locateUsb2);ui->label_locateLocalStore->move(ui->pushButton_locateLocal->width() / 2, 0);ui->label_locateUsb1Store->move(ui->pushButton_locateUsb1->width() / 2, 0);ui->label_locateUsb2Store->move(ui->pushButton_locateUsb2->width() / 2, 0);_buttonLocation.addButton(ui->pushButton_locateLocal);_buttonLocation.addButton(ui->pushButton_locateUsb1);_buttonLocation.addButton(ui->pushButton_locateUsb2);connect(&_buttonLocation, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(slot_locateLocationClicked(QAbstractButton*)));switch (_saveLocation){case SAVE_LOCATION_LOCAL:ui->pushButton_locateLocal->setChecked(true);break;case SAVE_LOCATION_USB1:ui->pushButton_locateUsb1->setChecked(true);break;case SAVE_LOCATION_USB2:ui->pushButton_locateUsb2->setChecked(true);break;default:break;}}// 更新一下路径updateLocateState();}// 文件浏览器信号{ui->widget_resourceBrowser->setCols(4);ui->widget_resourceBrowser->setRows(4);connect(ui->widget_resourceBrowser, SIGNAL(signal_doubleClickedVideoFile(QString)), this, SLOT(slot_doubleClickedVideoFile(QString)));}// 时间控件关联日期控件{ui->widget_time->setBackgroundPixmap(QPixmap(":/images/timeBackground.png"));connect(ui->widget_time, SIGNAL(signal_dateChanged()), this, SLOT(slot_dateChanged()));}// 日期控件初始化{QFont font = ui->widget_dateSet->getFont();font.setPixelSize(44);ui->widget_dateSet->setFont(font);ui->widget_dateSet->setBackgroundPixmap(QPixmap(":/images/setTimeBackground.png"));}// 时间控件初始化{QFont font = ui->widget_timeSet->getFont();font.setPixelSize(32);ui->widget_timeSet->setFont(font);ui->widget_timeSet->setBackgroundPixmap(QPixmap(":/images/setTimeBackground.png"));}// 刷新日期updateDate();#ifdef LINUX// 注册录像回调函数
//    fpga_comm_init(&fpga_com_read_record_data_handler_t);fpga_comm_init(0);// 初始化编码进程{
//        _pX264ManagerThread = new QThread();_pX264Manager = new X264Manager();connect(this, SIGNAL(signal_recvYuv(QByteArray)), _pX264Manager, SLOT(slot_recvYuv(QByteArray)), Qt::QueuedConnection);
//        _pX264Manager->moveToThread(_pX264ManagerThread);
//        _pX264ManagerThread->start();}
#endif}EndoscopeWidget::~EndoscopeWidget()
{delete ui;
}
...
#endif

若该文为原创文章,转载请注明原文出处
本文章博客地址:https://blog.csdn.net/qq21497936/article/details/111241205

案例分享:Qt+Arm+Fpga医疗肾镜(又名内窥镜)(实时影像、冻结、拍照、白平衡、九宫格、录像、背光调整、硬件光源调整、光源手动自动调整、物理按键)相关推荐

  1. 产品分享:Qt+Arm基于RV1126平台的内窥镜软硬整套解决方案(实时影像、冻结、拍照、录像、背光调整、硬件光源调整,其他产品也可使用该平台,如视频监控,物联网产品等等)

    ​若该文为原创文章,转载请注明原文出处 本文章博客地址:[https://hpzwl.blog.csdn.net/article/details/118887440 长期持续带来更多项目与技术分享,咨 ...

  2. 案例分享:Qt高频fpga采集数据压力位移速度加速度分析系统(通道配置、电压转换、采样频率、通道补偿、定时采集、距离采集,导出excel、自动XY轴、隐藏XY轴、隐藏显示通道,文件回放等等)

    若该文为原创文章,转载请注明原文出处 本文章博客地址:https://hpzwl.blog.csdn.net/article/details/120345072 红胖子(红模仿)的博文大全:开发技术集 ...

  3. 案例分享:Qt+RV1126+PLC医疗血浆采集仪(中英文输入、西门子PLC、数据库存储,各种数据统计,数值监测,电子秤操作,记录查询,全局报警等等)

    若该文为原创文章,转载请注明原文出处 本文章博客地址:https://blog.csdn.net/qq21497936/article/details/122057435 长期持续项目技术分享,Sha ...

  4. 案例分享:Qt激光加工焊接设备信息化软件研发(西门子PLC,mysql数据库,用户权限控制,界面设计,参数定制,播放器,二维图,期限控制,参数调试等)

    若该文为原创文章,转载请注明原文出处 本文章博客地址:https://hpzwl.blog.csdn.net/article/details/127669684 长期持续项目技术分享,有专业Qt需求请 ...

  5. 案例分享:Qt工程机械真空激光焊接系统软件产品定制(西门子PLC,mysql数据库,用户权限控制,界面配置,参数定制,播放器,二维图标,rgv小车,期限控制,参数调试等)

    若该文为原创文章,转载请注明原文出处 本文章博客地址:https://hpzwl.blog.csdn.net/article/details/127214512 长期持续项目技术分享,有需求请回博客首 ...

  6. 案例分享:医疗流式细胞术数据文件(.fcs)导出excel表工具

    若该文为原创文章,转载请注明原文出处 本文章博客地址:https://blog.csdn.net/qq21497936/article/details/109473140 各位读者,知识无穷而人力有穷 ...

  7. 案例分享:Qt便携式致病菌快速检测仪(账号管理、实验过程、二维图表、历史数据、通讯管理、实验报告、中英文等等)

    若该文为原创文章,转载请注明原文出处 本文章博客地址:https://blog.csdn.net/qq21497936/article/details/115574041 长期持续带来更多项目与技术分 ...

  8. 案例分享:Qt多通道数据采集系统(通道配置、电压转换、采样频率、通道补偿值、定时采集、导出excel和图表、自动XY轴、隐藏XY轴、实时隐藏显示通道)

    若该文为原创文章,转载请注明原文出处 本文章博客地址:https://blog.csdn.net/qq21497936/article/details/110941614 长期持续带来更多项目与技术分 ...

  9. 案例分享:Qt + 树莓派3B+ 智能笔筒系统

    若该文为原创文章,转载请注明原文出处 本文章博客地址:https://blog.csdn.net/qq21497936/article/details/114293412 长期持续带来更多项目与技术分 ...

最新文章

  1. Jenkins使用Publish Over FTP Plugin插件上传FTP详解
  2. 当你用Python爬取网站遇到反爬,你应该这样做,轻松解决反爬问题
  3. 扬帆起航 继续前行1 nginx+lua+template+cache
  4. Winform中使用Timer实现滚动字幕效果(附代码下载)
  5. IT是产品、IT是服务、IT是能力
  6. (38)FPGA面试题Verilog设计计数器
  7. SSH应用之BBS之路-2、Hibernate配置
  8. 手把手教你如何用 TensorFlow 实现基于 DNN 的文本分类
  9. python报错:Exception Value:can only concatenate str (not bytes) to str
  10. linux下载安装花生壳
  11. html右下角图片广告,HTML580用纯JS实现右下角广告代码
  12. 想转行学IT,到底要不要去培训机构?
  13. Linux Bridge实现
  14. QQ抢车位外挂(续)
  15. 如何把psd格式转为html,将psd转化为HTML网页详情讲解
  16. 实验2014051901:opencv操作摄像头
  17. G 蛋白偶联受体与小分子化合物的相互作用
  18. 对敏捷管理模式核心价值的解读
  19. 计算机应用 期刊 多久给消息,计算机应用 审稿流程 - 论文投稿 - 小木虫 - 学术 科研 互动社区...
  20. 35岁后遭遇中年失业,除了送快递和开网约车,还能干什么工作?

热门文章

  1. PHP推荐简单采集微博文章信息自用
  2. 电脑插上耳机没声音 解决方法
  3. 语c语言描写,1:语c是什么.还有一些常识.(?)
  4. 天下武功,唯快不破 - O'Reilly Velocity China 2011 PPT汇总
  5. 医疗险十大常见误区,你中了几个?
  6. 随机画五十个圆python_随的解释|随的意思|汉典“随”字的基本解释
  7. Linux内存uncache区域拷贝优化
  8. C predefined macros __FILE__,__LINE__,__func__
  9. Parallels Desktop 16 已损坏,无法打开,您应该推出磁盘映像。怎么解决?
  10. android获取设备的型号,Android获取手机设备信息