104 lines
3.1 KiB
C++
104 lines
3.1 KiB
C++
#ifndef SETTINGUIDEVTEST_H
|
|
#define SETTINGUIDEVTEST_H
|
|
|
|
#include "UiTools.h"
|
|
#include "UiConfig.h"
|
|
#include <QTimer>
|
|
#include <QGroupBox>
|
|
|
|
|
|
class settingUiDevTest : public MyWidgetWithMainStyleColor
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
enum{
|
|
enAutoTestWg,
|
|
enAutoTestRelayAndGpio,
|
|
enAutoTestRs485,
|
|
enAutoTestWifi,
|
|
enAutoTestRtc,
|
|
enAutoTestReaderUnderScreen,
|
|
enAutoTestSerial1,
|
|
//enAutoTestIdModuleInfoUpload
|
|
};
|
|
enum{
|
|
enMalTestLcd,
|
|
enMalTestMicrophone, // 麦克风测试
|
|
enMalTestSpeaker,
|
|
enMalTestTp,
|
|
enMalTestIrCam,
|
|
enMalTestIrLed,
|
|
enMalTestAuidoSwitch, // 测试外部 韦根输出、音频输出 GPIO切换功能
|
|
};
|
|
static int m_pageIndex;
|
|
|
|
explicit settingUiDevTest(int pageIndex, QWidget *parent = nullptr);
|
|
void reset();
|
|
|
|
signals:
|
|
void signalShowSettingUi();
|
|
|
|
public slots:
|
|
void slotBtnClicked();
|
|
void slotDevTestMesAddrAndProdNoText(const QString& text);
|
|
void slotDevTestPcbSeqText(const QString& text);
|
|
void slotDevTestConfigInfo(const QString& text);
|
|
void slotClosed();
|
|
|
|
protected:
|
|
void doAuidoSwitchTest();
|
|
void doMicrophoneTest();
|
|
|
|
private:
|
|
const QStringList m_autoTest = {"韦根输入输出", "继电器和GPIO", "RS485", "WIFI", "实时时钟", "屏下刷卡", "板载uart3"};//, "NFC模块上报ID", "有线网络", "4G模块"
|
|
QStringList m_malTest = {"显示屏", "麦克风", "喇叭", "触摸屏", "红外镜头", "红外补光灯"};
|
|
const QStringList m_malTestTips = {"屏幕显示白色、黑色、灰色、\n红色、绿色、蓝色,屏幕无条纹,\n无坏点,无闪烁,无色差",
|
|
"播放内容完整,声音清晰,无噪音",
|
|
"喇叭播放测试语音,声音清晰、无噪音",
|
|
"触摸屏画线无异常",
|
|
"红外镜头成像清晰",
|
|
"红外镜头画面有明暗交替变化",
|
|
"外部喇叭播放测试语音,声音清晰、无噪音",
|
|
};
|
|
const int FONT_SIZE[UiConfig::SUPPORT_SCREEN_SIZE_QUANTITY] = {30, 35, 35, 23, 23};
|
|
const QVector<unsigned> color{0xFFFFFF, 0, 0xDDDDDD, 0xFF0000, 0xFF00, 0xFF};
|
|
|
|
QGroupBox* m_gbAuto;
|
|
QPushButton* m_btnTest;
|
|
QVector<QLabel*> m_labelsAutoTestItem;
|
|
QVector<QLabel*> m_labelsAutoTestRes;
|
|
QVector<QPushButton*> m_btnsAutoTestRetest;
|
|
|
|
|
|
QGroupBox* m_gbMal;
|
|
QVector<QLabel*> m_labelsMalTestItem;
|
|
QVector<QLabel*> m_labelsMalTestRes;
|
|
QVector<QPushButton*> m_btnsMalTest;
|
|
|
|
QPushButton* m_btnNtp;
|
|
|
|
QPushButton* m_btnAgeing;
|
|
LineEditWithKeyboard* m_editAgeing;
|
|
|
|
QPushButton* m_btnRecover;
|
|
|
|
QGroupBox* m_gbDev;
|
|
QLineEdit* m_editSoftVer;
|
|
QLineEdit* m_editDevCfg;
|
|
QLineEdit* m_editMesAddrAndProdNo;
|
|
QLineEdit* m_editPcbSeq;
|
|
QLineEdit* m_editMac;
|
|
QPushButton* m_btnReboot;
|
|
|
|
QTimer* m_timer = nullptr;
|
|
PureColorPage* m_colorScreen = nullptr;
|
|
int m_colorIndex = 0;
|
|
DrawPage* m_draw = nullptr;
|
|
|
|
void showSelectionWin(int testIndex);
|
|
void refreshUiByHardwareConfig(const QString& hardware);
|
|
std::string getMesSeverIpFromText(const QString& text);
|
|
};
|
|
|
|
#endif // SETTINGUIDEVTEST_H
|