1.增加整机测试工厂信息输入; 2. 增加前后板连接后自动发送获取设备版本信息指令; 3. 优化UI布局代码

This commit is contained in:
钟富强 2024-09-10 11:29:44 +08:00
parent 9a49eab4af
commit 843b2058c3
377 changed files with 197841 additions and 231069 deletions

View File

@ -78,6 +78,7 @@
<None Include="SourceCode\Json\JsonFile\backBoardTest.json" /> <None Include="SourceCode\Json\JsonFile\backBoardTest.json" />
<None Include="SourceCode\Json\JsonFile\backBoardUuid.json" /> <None Include="SourceCode\Json\JsonFile\backBoardUuid.json" />
<None Include="SourceCode\Json\JsonFile\backDevInfo.json" /> <None Include="SourceCode\Json\JsonFile\backDevInfo.json" />
<None Include="SourceCode\Json\JsonFile\factoryProductInfo.json" />
<None Include="SourceCode\Json\JsonFile\frontBoardFuncConfig.json" /> <None Include="SourceCode\Json\JsonFile\frontBoardFuncConfig.json" />
<None Include="SourceCode\Json\JsonFile\frontBoardLicense.json" /> <None Include="SourceCode\Json\JsonFile\frontBoardLicense.json" />
<None Include="SourceCode\Json\JsonFile\frontBoardOneClickTest.json" /> <None Include="SourceCode\Json\JsonFile\frontBoardOneClickTest.json" />
@ -96,6 +97,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="SourceCode\Json\readJsonFile.h" /> <ClInclude Include="SourceCode\Json\readJsonFile.h" />
<ClInclude Include="SourceCode\Widget\UI_Widget\UI_Name.h" />
<QtMoc Include="SourceCode\LicenseGenerate\LicenseConfirmWindow.h" /> <QtMoc Include="SourceCode\LicenseGenerate\LicenseConfirmWindow.h" />
<ClInclude Include="SourceCode\LicenseGenerate\LicenseGenerate.h" /> <ClInclude Include="SourceCode\LicenseGenerate\LicenseGenerate.h" />
<ClInclude Include="SourceCode\LicenseGenerate\p_code.h" /> <ClInclude Include="SourceCode\LicenseGenerate\p_code.h" />

View File

@ -208,6 +208,9 @@
<None Include="SourceCode\Json\JsonFile\backBoardUuid.json"> <None Include="SourceCode\Json\JsonFile\backBoardUuid.json">
<Filter>Json\JsonFile</Filter> <Filter>Json\JsonFile</Filter>
</None> </None>
<None Include="SourceCode\Json\JsonFile\factoryProductInfo.json">
<Filter>Json\JsonFile</Filter>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="Widget"> <Filter Include="Widget">
@ -308,6 +311,9 @@
<ClInclude Include="SourceCode\Network\mdns\qmdnsengine\include\qmdnsengine_export.h"> <ClInclude Include="SourceCode\Network\mdns\qmdnsengine\include\qmdnsengine_export.h">
<Filter>Network\mdns\qmdnsengine\include</Filter> <Filter>Network\mdns\qmdnsengine\include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="SourceCode\Widget\UI_Widget\UI_Name.h">
<Filter>Widget\UI_Widget</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="icon.rc" /> <ResourceCompile Include="icon.rc" />

View File

@ -89,13 +89,13 @@
"cmd": "VIDEO_TEST", "cmd": "VIDEO_TEST",
"val": 0, "val": 0,
"lable": "开启视频", "lable": "开启视频",
"timeout": 2000 "timeout": 0
}, },
{ {
"cmd": "VIDEO_TEST", "cmd": "VIDEO_TEST",
"val": 1, "val": 1,
"lable": "关闭视频", "lable": "关闭视频",
"timeout": 2000 "timeout": 0
}, },
{ {
"cmd": "WIFI_SIGNAL_TEST", "cmd": "WIFI_SIGNAL_TEST",

View File

@ -1,19 +1,20 @@
[ [
{ {
"cmd": "GET_BACK_MAC", "cmd": "GET_BACK_MAC",
"val": 0, "val": "0",
"lable": "get_MAC_addr", "lable": "get_MAC_addr",
"timeout": 0 "timeout": 0
}, },
{ {
"cmd": "GET_BACK_UUID_SN", "cmd": "GET_BACK_UUID_SN",
"val": 0, "val": "0",
"lable": "get_UUID_SN", "lable": "get_UUID_SN",
"timeout": 0 "timeout": 0
}, },
{ {
"cmd": "WRITE_BACK_UUID_SN", "cmd": "WRITE_BACK_UUID_SN",
"val": 0, "UUID": "123",
"SN": "123",
"lable": "write_UUID_SN", "lable": "write_UUID_SN",
"timeout": 0 "timeout": 0
} }

View File

@ -0,0 +1,26 @@
[
{
"cmd": "FACTORY_ID",
"val": "1",
"lable": "工厂ID:",
"timeout": 0
},
{
"cmd": "FACTORY_LABEL",
"val": "0",
"lable": "设备出厂标签:",
"timeout": 0
},
{
"cmd": "FACTORY_BATCH",
"val": "0",
"lable": "设备出厂批次:",
"timeout": 0
},
{
"cmd": "FACTORY_DEVICE_TYPE",
"val": "0",
"lable": "设备型号:",
"timeout": 0
}
]

View File

@ -69,13 +69,13 @@
"cmd": "GET_IMG", "cmd": "GET_IMG",
"val": 0, "val": 0,
"lable": "左边镜头取图", "lable": "左边镜头取图",
"timeout": 2000 "timeout": 0
}, },
{ {
"cmd": "GET_IMG", "cmd": "GET_IMG",
"val": 1, "val": 1,
"lable": "右边镜头取图", "lable": "右边镜头取图",
"timeout": 2000 "timeout": 0
}, },
{ {
"cmd": "TOUCH_TEST", "cmd": "TOUCH_TEST",

View File

@ -142,13 +142,13 @@
{ {
"cmd": "IR_LED", "cmd": "IR_LED",
"val": 1, "val": 1,
"lable": "IR灯测试", "lable": "IR灯",
"timeout": 2000 "timeout": 2000
}, },
{ {
"cmd": "IR_LED", "cmd": "IR_LED",
"val": 0, "val": 0,
"lable": "IR灯测试", "lable": "IR灯",
"timeout": 2000 "timeout": 2000
}, },
{ {

View File

@ -78,3 +78,7 @@ QJsonArray readJson_getPic() {
QJsonArray readJson_getVideo() { QJsonArray readJson_getVideo() {
return readJsonArrayFromFile("./SourceCode/Json/JsonFile/getVideo.json"); return readJsonArrayFromFile("./SourceCode/Json/JsonFile/getVideo.json");
} }
QJsonArray readJson_factoryProductInfo() {
return readJsonArrayFromFile("./SourceCode/Json/JsonFile/factoryProductInfo.json");
}

View File

@ -19,6 +19,8 @@ QJsonArray readJson_backBoardFuncConfig();
QJsonArray readJson_backDevInfo(); QJsonArray readJson_backDevInfo();
QJsonArray readJson_backUuid(); QJsonArray readJson_backUuid();
QJsonArray readJson_factoryProductInfo();
QJsonArray readJson_testConfig(); QJsonArray readJson_testConfig();
QJsonArray readJson_funcConfig(); QJsonArray readJson_funcConfig();

View File

@ -4,7 +4,9 @@
FFmpegDecoder::FFmpegDecoder(QObject* parent) : FFmpegDecoder::FFmpegDecoder(QObject* parent) :
QThread(parent), QThread(parent),
videoLabel(nullptr), videoLabel(nullptr),
videoLabel_back(nullptr),
resolutionEdit(nullptr), resolutionEdit(nullptr),
resolutionEdit_back(nullptr),
abort(false), abort(false),
restart(false), restart(false),
formatContext(nullptr), formatContext(nullptr),
@ -24,6 +26,7 @@ FFmpegDecoder::~FFmpegDecoder()
qDebug() << "Destroying FFmpegDecoder thread"; qDebug() << "Destroying FFmpegDecoder thread";
mutex.lock(); mutex.lock();
abort = true; abort = true;
isStartVideo = false;
condition.wakeOne(); condition.wakeOne();
mutex.unlock(); mutex.unlock();
wait(); wait();
@ -34,7 +37,13 @@ FFmpegDecoder::~FFmpegDecoder()
void FFmpegDecoder::processVideo(int itemIndex) void FFmpegDecoder::processVideo(int itemIndex)
{ {
QLabel* originalLabel = this->videoLabel; QLabel* originalLabel;
if (isBackBoardOrAllBoard) {
originalLabel = this->videoLabel_back;
}
else {
originalLabel = this->videoLabel;
}
if ((FocusWindowWidth != 0) && (FocusWindowHeight != 0)) { if ((FocusWindowWidth != 0) && (FocusWindowHeight != 0)) {
qDebug() << "------ processVideo"; qDebug() << "------ processVideo";
FocusWindowDialog* dialog = nullptr; FocusWindowDialog* dialog = nullptr;
@ -54,25 +63,18 @@ void FFmpegDecoder::processVideo(int itemIndex)
qDebug() << "------ Other scaled resolutions use 480x640"; qDebug() << "------ Other scaled resolutions use 480x640";
dialog = new FocusWindowDialog(nullptr, QSize(480, 640)); dialog = new FocusWindowDialog(nullptr, QSize(480, 640));
} }
#if 0
// 将视频显示的 QLabel 切换为对话框内的 videoDisplayLabel
this->videoLabel = dialog->videoDisplayLabel;
if ((dialog->exec() == QDialog::Accepted) || (dialog->exec() == QDialog::Rejected)) {
this->videoLabel = originalLabel;
}
#else
mutex.lock(); mutex.lock();
this->videoLabelTemp = dialog->videoDisplayLabel; // 更新临时标签 this->videoLabelTemp = dialog->videoDisplayLabel;
this->videoLabelChanged = true; // 设置标志位,表示标签已更改 this->videoLabelChanged = true;
mutex.unlock(); mutex.unlock();
if ((dialog->exec() == QDialog::Accepted) || (dialog->exec() == QDialog::Rejected)) { if ((dialog->exec() == QDialog::Accepted) || (dialog->exec() == QDialog::Rejected)) {
mutex.lock(); mutex.lock();
this->videoLabelTemp = originalLabel; // 还原回原始标签 this->videoLabelTemp = originalLabel;
this->videoLabelChanged = true; // 设置标志位 this->videoLabelChanged = true;
mutex.unlock(); mutex.unlock();
} }
#endif
delete dialog; delete dialog;
} }
else { else {
@ -89,17 +91,23 @@ void FFmpegDecoder::initialize()
void FFmpegDecoder::stopFFmpegDecoder() void FFmpegDecoder::stopFFmpegDecoder()
{ {
mutex.lock(); mutex.lock();
abort = true; abort = true;
isStartVideo = false;
condition.wakeOne(); condition.wakeOne();
mutex.unlock(); mutex.unlock();
} }
void FFmpegDecoder::decodeFile(const QString& videoFilePath, QLabel* videoDisplayLabel, QLineEdit* VideoResolutionEdit) void FFmpegDecoder::decodeFile(const QString& videoFilePath, int isBackBoardOrAllBoard,
QLabel* videoDisplayLabel, QLabel* videoDisplayLabel_back,
QLineEdit* VideoResolutionEdit, QLineEdit* VideoResolutionEdit_back)
{ {
QMutexLocker locker(&mutex); QMutexLocker locker(&mutex);
this->filePath = videoFilePath; this->filePath = videoFilePath;
this->videoLabel = videoDisplayLabel; this->videoLabel = videoDisplayLabel;
this->resolutionEdit = VideoResolutionEdit; this->videoLabel_back = videoDisplayLabel_back;
this->resolutionEdit = VideoResolutionEdit;
this->resolutionEdit_back = VideoResolutionEdit_back;
this->isBackBoardOrAllBoard = isBackBoardOrAllBoard;
if (!isRunning()) { if (!isRunning()) {
qDebug() << "Starting decoder thread"; qDebug() << "Starting decoder thread";
start(NormalPriority); start(NormalPriority);
@ -112,7 +120,13 @@ void FFmpegDecoder::run()
{ {
QFile file(filePath); QFile file(filePath);
qint64 fileSize = 0; qint64 fileSize = 0;
QLabel* currentVideoLabel = videoLabel; QLabel* currentVideoLabel;
if (isBackBoardOrAllBoard) {
currentVideoLabel = videoLabel_back;
}
else {
currentVideoLabel = videoLabel;
}
while (!isInterruptionRequested()) { while (!isInterruptionRequested()) {
mutex.lock(); mutex.lock();
while (!restart && !abort) { while (!restart && !abort) {
@ -132,18 +146,19 @@ void FFmpegDecoder::run()
currentVideoLabel->setFixedSize(labelSize); currentVideoLabel->setFixedSize(labelSize);
qDebug() << "Adjusting video label size to: Width =" << labelSize.width() << ", Height =" << labelSize.height(); qDebug() << "Adjusting video label size to: Width =" << labelSize.width() << ", Height =" << labelSize.height();
} }
qDebug() << "Video label size: Width =" << labelSize.width() << ", Height =" << labelSize.height(); //qDebug() << "Video label size: Width =" << labelSize.width() << ", Height =" << labelSize.height();
if (!file.open(QIODevice::ReadOnly)) { if (!file.open(QIODevice::ReadOnly)) {
qWarning() << "Failed to open file:" << filePath; qWarning() << "Failed to open file:" << filePath;
continue; continue;
} }
if (!initializeFFmpeg(filePath)) { if (!initializeFFmpeg(filePath)) {
qDebug() << "Failed to initialize FFmpeg for file:" << filePath; //qDebug() << "Failed to initialize FFmpeg for file:" << filePath;
cleanup(); cleanup();
file.close(); file.close();
continue; continue;
} }
isStartVideo = true;
restart = false; restart = false;
while (!abort) { while (!abort) {
qint64 currentFileSize = file.size(); qint64 currentFileSize = file.size();
@ -220,7 +235,7 @@ bool FFmpegDecoder::initializeFFmpeg(const QString& filePath)
} }
if (avformat_find_stream_info(formatContext, nullptr) < 0) { if (avformat_find_stream_info(formatContext, nullptr) < 0) {
qWarning() << "Failed to retrieve stream info"; //qWarning() << "Failed to retrieve stream info";
return false; return false;
} }
@ -300,8 +315,14 @@ QImage FFmpegDecoder::avFrameToQImage(AVFrame* frame)
FocusWindowHeight = height; FocusWindowHeight = height;
} }
QString resolutionText = QString::number(width) + " x " + QString::number(height); QString resolutionText = QString::number(width) + " x " + QString::number(height);
//resolutionEdit->setText(resolutionText);
QMetaObject::invokeMethod(resolutionEdit, "setText", Qt::QueuedConnection, Q_ARG(QString, resolutionText)); if (isBackBoardOrAllBoard) {
QMetaObject::invokeMethod(resolutionEdit_back, "setText", Qt::QueuedConnection, Q_ARG(QString, resolutionText));
}
else {
QMetaObject::invokeMethod(resolutionEdit, "setText", Qt::QueuedConnection, Q_ARG(QString, resolutionText));
}
//qDebug() << "H264 video resolution: Width =" << frame->width << ", Height =" << frame->height; //qDebug() << "H264 video resolution: Width =" << frame->width << ", Height =" << frame->height;
AVPixelFormat pixFmt = (AVPixelFormat)frame->format; AVPixelFormat pixFmt = (AVPixelFormat)frame->format;

View File

@ -38,8 +38,11 @@ public:
explicit FFmpegDecoder(QObject* parent = nullptr); explicit FFmpegDecoder(QObject* parent = nullptr);
~FFmpegDecoder() override; ~FFmpegDecoder() override;
bool isStartVideo = false;
void initialize(); void initialize();
void decodeFile(const QString& videoFilePath, QLabel* videoLabel, QLineEdit* VideoResolutionEdit); void decodeFile(const QString& videoFilePath, int isBackBoardOrAllBoard, QLabel* videoLabel, QLabel* videoDisplayLabel_back,
QLineEdit* VideoResolutionEdit, QLineEdit* VideoResolutionEdit_back);
void decodeSingleFrame(const QByteArray& data, QLabel* videoLabel); // 添加 videoLabel 参数 void decodeSingleFrame(const QByteArray& data, QLabel* videoLabel); // 添加 videoLabel 参数
void FFmpegDecoder::processVideo(int itemIndex); void FFmpegDecoder::processVideo(int itemIndex);
bool initializeFFmpeg(const QString& filePath); bool initializeFFmpeg(const QString& filePath);
@ -56,12 +59,15 @@ private:
QWaitCondition condition; QWaitCondition condition;
QString filePath; QString filePath;
QLabel* videoLabel; QLabel* videoLabel;
QLabel* videoLabel_back;
QLabel* videoLabelTemp; // 临时存储新标签 QLabel* videoLabelTemp; // 临时存储新标签
QLineEdit* resolutionEdit; QLineEdit* resolutionEdit;
QLineEdit* resolutionEdit_back;
bool videoLabelChanged = false; bool videoLabelChanged = false;
bool abort; bool abort;
bool restart; bool restart;
bool isGotResolution = false; bool isGotResolution = false;
int isBackBoardOrAllBoard = 0;
AVFormatContext* formatContext; AVFormatContext* formatContext;
AVCodecContext* codecContext; AVCodecContext* codecContext;

View File

@ -75,7 +75,7 @@ void ClientHandler::resetCurrentItemIndex()
void ClientHandler::start() void ClientHandler::start()
{ {
resetCurrentItemIndex(); // 初始化计数器和索引 resetCurrentItemIndex(); // 初始化计数器和索引
sendNextItem(); //sendNextItem();
} }
// 处理客户端断开连接 // 处理客户端断开连接
@ -91,7 +91,7 @@ void ClientHandler::startReadVideoDataTimer(int client_Id)
{ {
//emit startReadTimer(clientId); //emit startReadTimer(clientId);
emit startReadTimer(client_Id); emit startReadTimer(client_Id);
//qDebug() << "------ startClientReadTimer clientId:" << clientId; qDebug() << "------ startClientReadTimer clientId:" << clientId;
} }
void ClientHandler::stopReadVideoDataTimer(int client_Id) void ClientHandler::stopReadVideoDataTimer(int client_Id)
@ -175,21 +175,40 @@ void ClientHandler::sendDataToClient(const QByteArray& data)
emit sendData(data, isBackBoardOrAllBoard); emit sendData(data, isBackBoardOrAllBoard);
} }
void ClientHandler::sendJsonItem(const QJsonArray& jsonArray, int itemIndex, const QString text, const QString& itemType) void ClientHandler::sendJsonItem(const QJsonArray& jsonArray, int itemIndex, const QString text, const QString backBoardSn, const QString& itemType)
{ {
startReadVideoDataTimer(preVideoClientId);
currentJson = jsonArray; currentJson = jsonArray;
currentJsonItem = itemIndex; currentJsonItem = itemIndex;
QMutexLocker locker(&mutex); QMutexLocker locker(&mutex);
if (itemType == "License") { if (itemType == "License") {
} }
isSingleSend = true; isSingleSend = true;
isClickedSend = true; isClickedSend = true;
isRecvImgData = false; isRecvImgData = false;
if (jsonArray == backBoardTest) {
QJsonObject tempItem = jsonArray[itemIndex].toObject();
if (tempItem["cmd"] == "VIDEO_TEST") {
if (tempItem["val"] == 0) {
isSingleSend = false;
isClickedSend = false;
isRecvVideoData = true;
isStartVideo = true;
startReadVideoDataTimer(isBackBoardOrAllBoard);
}
else if (tempItem["val"] == 1) {
isRecvVideoData = false;
isStartVideo = false;
stopReadVideoDataTimer(isBackBoardOrAllBoard);
}
}
}
if (itemType == "handleVideo") { if (itemType == "handleVideo") {
if (itemIndex == 0) { if (itemIndex == 0) {
isSingleSend = false; isSingleSend = false;
isClickedSend = false; isClickedSend = false;
} }
else { else {
stopReadVideoDataTimer(preVideoClientId); stopReadVideoDataTimer(preVideoClientId);
@ -200,12 +219,15 @@ void ClientHandler::sendJsonItem(const QJsonArray& jsonArray, int itemIndex, con
isClickedSend = false; isClickedSend = false;
isRecvImgData = true; isRecvImgData = true;
} }
//qDebug() << "itemIndex" << itemIndex; if (itemType == "Uuid") {
//qDebug() << "jsonArray.size()" << jsonArray.size();
}
qDebug() << "itemIndex" << itemIndex;
qDebug() << "jsonArray.size()" << jsonArray.size();
if (itemIndex >= 0 && itemIndex < jsonArray.size()) { if (itemIndex >= 0 && itemIndex < jsonArray.size()) {
currentItemIndex = (itemType == "test") ? itemIndex : 0; currentItemIndex = (itemType == "test") ? itemIndex : 0;
currentFuncItemIndex = (itemType == "func") ? itemIndex : 0; currentFuncItemIndex = (itemType == "func") ? itemIndex : 0;
QJsonObject currentItem = jsonArray[itemIndex].toObject(); currentItem = jsonArray[itemIndex].toObject();
if (!text.isEmpty() && currentItem.contains("val")) { if (!text.isEmpty() && currentItem.contains("val")) {
QJsonValue originalValue = currentItem["val"]; QJsonValue originalValue = currentItem["val"];
qDebug() << "text:" << text; qDebug() << "text:" << text;
@ -223,12 +245,47 @@ void ClientHandler::sendJsonItem(const QJsonArray& jsonArray, int itemIndex, con
currentItem["val"] = text; currentItem["val"] = text;
} }
} }
else if (!text.isEmpty() && currentItem.contains("UUID") && currentItem.contains("SN")) {
QJsonValue originalUUID = currentItem["UUID"];
QJsonValue originalSN = currentItem["SN"];
qDebug() << "UUID:" << text;
qDebug() << "SN:" << backBoardSn;
if (originalUUID.isDouble()) {
bool ok;
double doubleValue = text.toDouble(&ok);
if (ok) {
currentItem["UUID"] = doubleValue;
}
else {
qWarning() << "Text conversion to double failed, original value is kept.";
}
}
else if (originalUUID.isString()) {
currentItem["UUID"] = text;
}
if (originalSN.isDouble()) {
bool ok;
double doubleValue = backBoardSn.toDouble(&ok);
if (ok) {
currentItem["SN"] = doubleValue;
}
else {
qWarning() << "backBoardSn conversion to double failed, original value is kept.";
}
}
else if (originalSN.isString()) {
currentItem["SN"] = backBoardSn;
}
}
QString itemData = QJsonDocument(currentItem).toJson(); QString itemData = QJsonDocument(currentItem).toJson();
//emit sendData(itemData.toUtf8()); if (isBackBoardOrAllBoard) {
emit sendDataToSomeClient(controlClientId, itemData.toUtf8()); emit sendDataToSomeClient(isBackBoardOrAllBoard, itemData.toUtf8());
}
// 设置超时处理 else {
emit sendDataToSomeClient(controlClientId, itemData.toUtf8());
}
if (currentItem.contains("timeout")) { if (currentItem.contains("timeout")) {
qDebug() << "sendJsonItem currentItem.contains(\"timeout\")";
int timeout = currentItem.value("timeout").toInt(); int timeout = currentItem.value("timeout").toInt();
if (timeout > 0) { if (timeout > 0) {
emit startTimeout(timeout); emit startTimeout(timeout);
@ -240,13 +297,13 @@ void ClientHandler::sendJsonItem(const QJsonArray& jsonArray, int itemIndex, con
// 发送获取设备信息按键 // 发送获取设备信息按键
void ClientHandler::sendGetDevInfoItem(int itemIndex) void ClientHandler::sendGetDevInfoItem(int itemIndex)
{ {
sendJsonItem(getDevInfoJson, itemIndex, "", "devInfo"); sendJsonItem(getDevInfoJson, itemIndex, "", "", "devInfo");
} }
// 发送取图按键 // 发送取图按键
void ClientHandler::sendGetPicItem(int itemIndex, int GetPicCamIndex) void ClientHandler::sendGetPicItem(int itemIndex, int GetPicCamIndex)
{ {
sendJsonItem(getPicJson, itemIndex, QString::number(GetPicCamIndex), "getPic"); sendJsonItem(getPicJson, itemIndex, QString::number(GetPicCamIndex), "", "getPic");
} }
// 发送拉视频按键 // 发送拉视频按键
@ -254,122 +311,162 @@ void ClientHandler::sendGetVideoItem(int itemIndex, int GetVideoCamIndex)
{ {
qDebug() << "sendGetVideoItem itemIndex:" << itemIndex; qDebug() << "sendGetVideoItem itemIndex:" << itemIndex;
if(isBackBoardOrAllBoard) { if(isBackBoardOrAllBoard) {
sendJsonItem(getVideoJson, itemIndex, QString::number(GetVideoCamIndex), "handleVideo"); sendJsonItem(getVideoJson, itemIndex, QString::number(GetVideoCamIndex), "", "handleVideo");
} }
else { else {
sendJsonItem(getVideoJson, itemIndex, QString::number(GetVideoCamIndex), "handleVideo"); sendJsonItem(getVideoJson, itemIndex, QString::number(GetVideoCamIndex), "", "handleVideo");
} }
} }
// 发送License处理按键 // 发送License处理按键
void ClientHandler::sendLicenseItem(int itemIndex, const QString text) void ClientHandler::sendLicenseItem(int itemIndex, const QString text)
{ {
if (itemIndex < 0 || itemIndex >= frontBoardLicenseJson.size()) { if (isBackBoardOrAllBoard != 0) {
qDebug() << "Invalid itemIndex"; emit HandleInvalidOperate("当前连接的是后板或整机,请勿操作前板页面的按键!!!");
return; return;
} }
sendJsonItem(frontBoardLicenseJson, itemIndex, text, "License"); else {
if (itemIndex < 0 || itemIndex >= frontBoardLicenseJson.size()) {
qDebug() << "Invalid itemIndex";
return;
}
sendJsonItem(frontBoardLicenseJson, itemIndex, text, "", "License");
}
} }
void ClientHandler::sendUuidItem(int itemIndex, const QString text) void ClientHandler::sendUuidItem(int itemIndex, const QString backBoardUuid, const QString backBoardSn)
{ {
qDebug() << "ClientHandler::sendUuidItem itemIndex:" << itemIndex;
if (isBackBoardOrAllBoard == 0) {
emit HandleInvalidOperate("当前连接的是前板,请勿操作后板或整机页面的按键!!!");
return;
}
else {
if (itemIndex < 0 || itemIndex >= backBoardUuidJson.size()) {
qDebug() << "Invalid itemIndex";
return;
}
sendJsonItem(backBoardUuidJson, itemIndex, backBoardUuid, backBoardSn, "Uuid");
}
} }
// 发送单独一个功能配置 JSON 项目
void ClientHandler::sendFrontFuncItem(int itemIndex, const QString text) void ClientHandler::sendFrontFuncItem(int itemIndex, const QString text)
{ {
//qDebug() << "sendFuncItem Text:" << text; if (isBackBoardOrAllBoard != 0) {
sendJsonItem(frontBoardFuncConfig, itemIndex, text, "func"); emit HandleInvalidOperate("当前连接的是后板或整机,请勿操作前板页面的按键!!!");
return;
}
else {
//qDebug() << "sendFuncItem Text:" << text;
sendJsonItem(frontBoardFuncConfig, itemIndex, text, "", "func");
}
} }
void ClientHandler::sendBackFuncItem(int itemIndex, const QString text) void ClientHandler::sendBackFuncItem(int itemIndex, const QString text)
{ {
//qDebug() << "sendFuncItem Text:" << text; if (isBackBoardOrAllBoard == 0) {
sendJsonItem(backBoardFuncConfig, itemIndex, text, "func"); emit HandleInvalidOperate("当前连接的是前板,请勿操作后板或整机页面的按键!!!");
return;
}
else {
//qDebug() << "sendFuncItem Text:" << text;
sendJsonItem(backBoardFuncConfig, itemIndex, text, "", "func");
}
} }
// 发送单独一个测试配置 JSON 项目
void ClientHandler::sendFrontItem(int itemIndex) void ClientHandler::sendFrontItem(int itemIndex)
{ {
QString text = ""; if (isBackBoardOrAllBoard != 0) {
QJsonObject currentItem = frontBoardTest[itemIndex].toObject(); emit HandleInvalidOperate("当前连接的是后板或整机,请勿操作前板页面的按键!!!");
if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "IMG_ENROLL") { return;
ImageEnrollWindow dialog; }
if (dialog.exec() == QDialog::Accepted) { else {
text = dialog.getFilePath(); QString text = "";
QByteArray imageData = dialog.getImageData(); QJsonObject currentItem = frontBoardTest[itemIndex].toObject();
if (!imageData.isEmpty()) { if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "IMG_ENROLL") {
text = QString::fromUtf8(imageData); ImageEnrollWindow dialog;
if (dialog.exec() == QDialog::Accepted) {
text = dialog.getFilePath();
QByteArray imageData = dialog.getImageData();
if (!imageData.isEmpty()) {
text = QString::fromUtf8(imageData);
}
}
else {
return;
} }
} }
else { else if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "DEL_USER") {
return; DelUserWindow dialog;
} if (dialog.exec() == QDialog::Accepted) {
} QString userInput = dialog.getUserInput();
else if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "DEL_USER") { if (!userInput.isEmpty() && currentItem.contains("val")) {
DelUserWindow dialog; text = userInput;
if (dialog.exec() == QDialog::Accepted) { }
QString userInput = dialog.getUserInput(); }
if (!userInput.isEmpty() && currentItem.contains("val")) { else {
text = userInput; return;
} }
} }
else { else if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "PASSWD_ENROLL") {
return; PasswordEnrollWindow dialog;
if (dialog.exec() == QDialog::Accepted) {
text = dialog.getPassword();
}
else {
return;
}
} }
sendJsonItem(frontBoardTest, itemIndex, text, "", "test");
} }
else if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "PASSWD_ENROLL") {
PasswordEnrollWindow dialog;
if (dialog.exec() == QDialog::Accepted) {
text = dialog.getPassword();
}
else {
return;
}
}
sendJsonItem(frontBoardTest, itemIndex, text, "test");
} }
void ClientHandler::sendBackItem(int itemIndex) void ClientHandler::sendBackItem(int itemIndex)
{ {
QString text = ""; if (isBackBoardOrAllBoard == 0) {
QJsonObject currentItem = backBoardTest[itemIndex].toObject(); emit HandleInvalidOperate("当前连接的是前板,请勿操作后板或整机页面的按键!!!");
if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "IMG_ENROLL") { return;
ImageEnrollWindow dialog; }
if (dialog.exec() == QDialog::Accepted) { else {
text = dialog.getFilePath(); QString text = "";
QByteArray imageData = dialog.getImageData(); QJsonObject currentItem = backBoardTest[itemIndex].toObject();
if (!imageData.isEmpty()) { if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "IMG_ENROLL") {
text = QString::fromUtf8(imageData); ImageEnrollWindow dialog;
if (dialog.exec() == QDialog::Accepted) {
text = dialog.getFilePath();
QByteArray imageData = dialog.getImageData();
if (!imageData.isEmpty()) {
text = QString::fromUtf8(imageData);
}
}
else {
return;
} }
} }
else { else if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "DEL_USER") {
return; DelUserWindow dialog;
} if (dialog.exec() == QDialog::Accepted) {
} QString userInput = dialog.getUserInput();
else if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "DEL_USER") { if (!userInput.isEmpty() && currentItem.contains("val")) {
DelUserWindow dialog; text = userInput;
if (dialog.exec() == QDialog::Accepted) { }
QString userInput = dialog.getUserInput(); }
if (!userInput.isEmpty() && currentItem.contains("val")) { else {
text = userInput; return;
} }
} }
else { else if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "PASSWD_ENROLL") {
return; PasswordEnrollWindow dialog;
if (dialog.exec() == QDialog::Accepted) {
text = dialog.getPassword();
}
else {
return;
}
} }
isRecvVideoData = false;
sendJsonItem(backBoardTest, itemIndex, text, "", "test");
} }
else if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "PASSWD_ENROLL") {
PasswordEnrollWindow dialog;
if (dialog.exec() == QDialog::Accepted) {
text = dialog.getPassword();
}
else {
return;
}
}
sendJsonItem(backBoardTest, itemIndex, text, "test");
} }
void ClientHandler::sendDevInfoJsonItem(const QJsonObject& jsonItem, int itemIndex) void ClientHandler::sendDevInfoJsonItem(const QJsonObject& jsonItem, int itemIndex)
@ -381,7 +478,13 @@ void ClientHandler::sendDevInfoJsonItem(const QJsonObject& jsonItem, int itemInd
QString itemData = QJsonDocument(jsonItem).toJson(); QString itemData = QJsonDocument(jsonItem).toJson();
//emit sendData(itemData.toUtf8()); //emit sendData(itemData.toUtf8());
emit sendDataToSomeClient(controlClientId, itemData.toUtf8()); if (isBackBoardOrAllBoard) {
emit sendDataToSomeClient(isBackBoardOrAllBoard, itemData.toUtf8());
}
else {
emit sendDataToSomeClient(controlClientId, itemData.toUtf8());
}
if (jsonItem.contains("timeout")) { if (jsonItem.contains("timeout")) {
int timeout = jsonItem.value("timeout").toInt(); int timeout = jsonItem.value("timeout").toInt();
@ -396,58 +499,60 @@ void ClientHandler::sendDevInfoJsonItem(const QJsonObject& jsonItem, int itemInd
void ClientHandler::sendDevInfoItem() void ClientHandler::sendDevInfoItem()
{ {
// 前板 if (isBackBoardOrAllBoard) {
if (1) { currentJson = backBoardDevInfoJson;
qDebug() << "frontBoardDevInfoJson.size()" << frontBoardDevInfoJson.size(); currentJsonItem = currentBackBoardIndex;
if (currentFrontBoardIndex < frontBoardDevInfoJson.size()) { if (currentBackBoardIndex < backBoardDevInfoJson.size()) {
sendDevInfoJsonItem(frontBoardDevInfoJson[currentFrontBoardIndex].toObject(), 1); sendDevInfoJsonItem(backBoardDevInfoJson[currentBackBoardIndex++].toObject(), 1);
currentFrontBoardIndex ++;
} }
else else
isPowerOnSend = false; isPowerOnSend = false;
} }
// 后板
else { else {
if (currentBackBoardIndex < backBoardDevInfoJson.size()) { currentJson = frontBoardDevInfoJson;
sendDevInfoJsonItem(backBoardDevInfoJson[currentBackBoardIndex ++].toObject(), 1); currentJsonItem = currentFrontBoardIndex;
if (currentFrontBoardIndex < frontBoardDevInfoJson.size()) {
sendDevInfoJsonItem(frontBoardDevInfoJson[currentFrontBoardIndex].toObject(), 1);
currentFrontBoardIndex++;
} }
else else
isPowerOnSend = false; isPowerOnSend = false;
} }
} }
// 发送下一个 JSON 项目 void ClientHandler::sendNextItem(QJsonArray& currentOneClickedItem)
void ClientHandler::sendNextItem()
{ {
//qDebug() << "------> start mutex " << __FUNCTION__; QMutexLocker locker(&mutex);
QMutexLocker locker(&mutex);
isClickedSend = true; isClickedSend = true;
qDebug() << "------> locker(&mutex) :" << itemsProcessedCount; //qDebug() << "------> locker(&mutex) :" << itemsProcessedCount;
if (currentItemIndex < frontBoardOneClickTest.size()) { //qDebug() << "------> currentItemIndex :" << currentItemIndex;
currentJson = frontBoardOneClickTest; //qDebug() << "------> currentOneClickedItem.size() :" << currentOneClickedItem.size();
if (currentItemIndex < currentOneClickedItem.size()) {
currentJson = currentOneClickedItem;
currentJsonItem = currentItemIndex; currentJsonItem = currentItemIndex;
currentItem = currentOneClickedItem[currentItemIndex].toObject();
currentItem = frontBoardOneClickTest[currentItemIndex].toObject();
QString itemData = QJsonDocument(currentItem).toJson(); QString itemData = QJsonDocument(currentItem).toJson();
//qDebug() << "Sending item index:" << currentItemIndex << "data:" << itemData; //qDebug() << "Sending item index:" << currentItemIndex << "data:" << itemData;
if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "DEL_USER") { if (currentItem.contains("cmd") && currentItem["cmd"].toString() == "DEL_USER") {
DelUserWindow dialog; DelUserWindow dialog;
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
//qDebug() << "用户确认删除,关闭窗口";
QString userInput = dialog.getUserInput(); QString userInput = dialog.getUserInput();
if (!userInput.isEmpty() && currentItem.contains("val")) { if (!userInput.isEmpty() && currentItem.contains("val")) {
currentItem["val"] = userInput; currentItem["val"] = userInput;
itemData = QJsonDocument(currentItem).toJson(); itemData = QJsonDocument(currentItem).toJson();
} }
} }
} }
//emit sendData(itemData.toUtf8()); if (isBackBoardOrAllBoard) {
emit sendDataToSomeClient(controlClientId, itemData.toUtf8()); emit sendDataToSomeClient(isBackBoardOrAllBoard, itemData.toUtf8());
}
else {
emit sendDataToSomeClient(controlClientId, itemData.toUtf8());
}
if (currentItem.contains("timeout")) { if (currentItem.contains("timeout")) {
int timeout = currentItem.value("timeout").toInt(); int timeout = currentItem.value("timeout").toInt();
if (timeout > 0) { if (timeout > 0) {
qDebug() << "------> sendNextItem :" << itemsProcessedCount;
emit startTimeout(timeout); emit startTimeout(timeout);
} }
} }
@ -458,12 +563,11 @@ void ClientHandler::sendNextItem()
else if (isManualSend) { else if (isManualSend) {
emit allItemsProcessed(getClientAddress(), itemsProcessedCount); emit allItemsProcessed(getClientAddress(), itemsProcessedCount);
// 处理完毕后重置标记 // 处理完毕后重置标记
isManualSend = false; isManualSend = false;
isClickedSend = false; isClickedSend = false;
// 重置索引,可以再次一键功能测试 // 重置索引
resetCurrentItemIndex(); resetCurrentItemIndex();
} }
//qDebug() << "------> end mutex " << __FUNCTION__;
} }
void ClientHandler::RNDISClient1Data(QByteArray& data) { void ClientHandler::RNDISClient1Data(QByteArray& data) {
@ -570,7 +674,16 @@ void ClientHandler::setThreadPriority(QThread::Priority priority) {
} }
} }
// 处理数据接收 void ClientHandler::onPicRecvFinished()
{
if (currentJson != getPicJson && currentJson != frontBoardTest) {
currentItemIndex ++;
itemsProcessedCount ++;
qDebug() << "------> onPicRecvFinished " << __FUNCTION__;
sendNextItem(currentJson);
}
}
void ClientHandler::onDataReceived() void ClientHandler::onDataReceived()
{ {
//qDebug() << "isRecvVideoData:" << isRecvVideoData; //qDebug() << "isRecvVideoData:" << isRecvVideoData;
@ -578,8 +691,10 @@ void ClientHandler::onDataReceived()
//qDebug() << "isClickedSend:" << isClickedSend; //qDebug() << "isClickedSend:" << isClickedSend;
//qDebug() << "isSingleSend:" << isSingleSend; //qDebug() << "isSingleSend:" << isSingleSend;
//qDebug() << "isRecvImgData:" << isRecvImgData; //qDebug() << "isRecvImgData:" << isRecvImgData;
/*if (!isRecvVideoData &&
(isRecvImgData || isPowerOnSend || isClickedSend || (isSingleSend && (currentItemIndex < frontBoardTest.size())))) {*/
if (!isRecvVideoData && if (!isRecvVideoData &&
(isRecvImgData || isPowerOnSend || isClickedSend || (isSingleSend && (currentItemIndex < frontBoardTest.size())))) { (isRecvImgData || isPowerOnSend || isClickedSend || (isSingleSend && (currentItemIndex < currentJson.size())))) {
QByteArray allData; QByteArray allData;
while (socket->bytesAvailable() > 0) { while (socket->bytesAvailable() > 0) {
qint64 bytesAvailableBefore = socket->bytesAvailable(); qint64 bytesAvailableBefore = socket->bytesAvailable();
@ -593,59 +708,72 @@ void ClientHandler::onDataReceived()
qint64 bytesAvailableAfter = socket->bytesAvailable(); qint64 bytesAvailableAfter = socket->bytesAvailable();
} }
} }
getCurrentItemLable();
if ((currentItem.contains("timeout")) || (currentFuncItem.contains("timeout"))) { if ((currentItem.contains("timeout")) || (currentFuncItem.contains("timeout"))) {
emit startTimeout(0); emit startTimeout(0);
} }
QJsonObject currentTempItem = currentJson[currentItemIndex].toObject();
if (!allData.isEmpty()) { if (!allData.isEmpty()) {
emit dataReceived(getClientAddress(), allData, 0xFF, currentItemIndex, currentFuncItemIndex, getCurrentItemLable(), "", currentJson, currentJsonItem); emit dataReceived(getClientAddress(), allData, 0xFF, currentItemIndex, currentFuncItemIndex, getCurrentItemLable(), "", currentJson, currentJsonItem);
if (!isSingleSend && !isPowerOnSend) { if (!isSingleSend && !isPowerOnSend && (currentTempItem["cmd"] != "GET_IMG")) {
currentItemIndex ++; currentItemIndex ++;
itemsProcessedCount ++; itemsProcessedCount ++;
} }
} }
if (isSingleSend) { if (isSingleSend) {
isSingleSend = false; if (currentTempItem["cmd"] != "GET_IMG") {
isSingleSend = false;
}
isClickedSend = false; isClickedSend = false;
} }
else if (isPowerOnSend && currentFrontBoardIndex < frontBoardDevInfoJson.size()) { else if (isPowerOnSend) {
sendDevInfoItem(); if (isBackBoardOrAllBoard) {
if (currentBackBoardIndex < backBoardDevInfoJson.size()) {
sendDevInfoItem();
}
else {
qDebug() << "All items processed in onDataReceived.";
emit allItemsProcessed(getClientAddress(), currentBackBoardIndex);
isPowerOnSend = false;
}
}
else {
if (currentFrontBoardIndex < frontBoardDevInfoJson.size()) {
sendDevInfoItem();
}
else {
qDebug() << "All items processed in onDataReceived.";
emit allItemsProcessed(getClientAddress(), currentFrontBoardIndex);
isPowerOnSend = false;
}
}
} }
else if (isPowerOnSend && currentBackBoardIndex < backBoardDevInfoJson.size()) { else if (isClickedSend && (currentItemIndex < currentJson.size())) {
sendDevInfoItem(); // 判断是否是取图或者其他会接收很多数据的指令
} if (currentTempItem["cmd"] != "GET_IMG") {
/*else if (isPowerOnSend) { sendNextItem(currentJson);
qDebug() << "All items processed in onDataReceived."; }
emit allItemsProcessed(getClientAddress(), currentFrontBoardIndex);
isPowerOnSend = false;
}*/
else if (isClickedSend && (currentItemIndex < frontBoardOneClickTest.size())) {
//qDebug() << "-------- start sendNextItem";
sendNextItem();
} }
else if(isClickedSend) { else if(isClickedSend) {
//qDebug() << "All items processed in onDataReceived.";
emit allItemsProcessed(getClientAddress(), itemsProcessedCount); emit allItemsProcessed(getClientAddress(), itemsProcessedCount);
isClickedSend = false; isClickedSend = false;
//resetCurrentItemIndex(); //resetCurrentItemIndex();
} }
//qDebug() << "" << __FUNCTION__ << "------> itemsProcessedCount " << itemsProcessedCount;
} }
// 接收视频流数据 isRecvVideoData 置 0
else if (isRecvVideoData && (!dataProcessingActive)) { else if (isRecvVideoData && (!dataProcessingActive)) {
dataProcessingActive = true; dataProcessingActive = true;
if (!isStartVideo) { if ((isBackBoardOrAllBoard == 0) && !isStartVideo) {
isRecvVideoData = false; isRecvVideoData = false;
} }
QTimer::singleShot(0, this, &ClientHandler::processPendingData); QTimer::singleShot(0, this, &ClientHandler::processPendingData);
} }
else if(!isRecvVideoData && !isRecvImgData){ else if(!isRecvVideoData && !isRecvImgData){
if (preVideoClientId == clientId) { if (preVideoClientId == clientId) {
qDebug() << "-----------------" << preVideoClientId << "isRecvVideoData:" << isRecvVideoData; qDebug() << "-----------------" << preVideoClientId << "isRecvVideoData:" << isRecvVideoData;
} }
socket->readAll(); socket->readAll();
//QByteArray data = socket->readAll(); //QByteArray data = socket->readAll();
//qDebug() << "Received data:" << data; //qDebug() << "--------- socket->readAll()" ;
} }
} }
@ -673,7 +801,7 @@ void ClientHandler::processPendingData()
<< "at" << QDateTime::currentDateTime().toString(Qt::ISODate) << "at" << QDateTime::currentDateTime().toString(Qt::ISODate)
<< "bytesAvailable after read:" << bytesAvailableAfter; */ << "bytesAvailable after read:" << bytesAvailableAfter; */
if (isFirstDataReceived) { if ((isBackBoardOrAllBoard == 0) && isFirstDataReceived) {
RNDISFirstData(buffer); RNDISFirstData(buffer);
isFirstDataReceived = false; isFirstDataReceived = false;
} }
@ -725,17 +853,12 @@ void ClientHandler::processPendingData()
} }
} }
// 处理超时
void ClientHandler::onTimeout() void ClientHandler::onTimeout()
{ {
//qDebug() << "------> start mutex " << __FUNCTION__;
{ {
QMutexLocker locker(&mutex); QMutexLocker locker(&mutex);
// 获取当前项的 "data" 字段 emit statusUpdated(getClientAddress(), false, currentJson, currentJsonItem);
//QString itemData = currentItem.value("data").toString(); qDebug() << "isSingleSend:" << isSingleSend << "isPowerOnSend:" << isPowerOnSend;
//emit statusUpdated(socket->peerAddress().toString(), currentItemIndex, false, itemData);
emit statusUpdated(getClientAddress(), currentItemIndex + 1, currentFuncItemIndex + 1,
false, getCurrentItemLable(), getCurrentFuncItemLable(), currentJson, currentJsonItem);
if (!isSingleSend && !isPowerOnSend) { if (!isSingleSend && !isPowerOnSend) {
currentItemIndex ++; currentItemIndex ++;
itemsProcessedCount ++; itemsProcessedCount ++;
@ -744,23 +867,51 @@ void ClientHandler::onTimeout()
if (isSingleSend) { if (isSingleSend) {
isSingleSend = false; isSingleSend = false;
} }
else if (isPowerOnSend && currentFrontBoardIndex < frontBoardDevInfoJson.size()) { else if (isClickedSend) {
sendDevInfoItem(); if (isBackBoardOrAllBoard) {
} if (currentItemIndex < backBoardOneClickTest.size()) {
else if (isClickedSend && (currentItemIndex < frontBoardOneClickTest.size())) { sendNextItem(currentJson);
//qDebug() << "------> onTimeout"; }
sendNextItem(); else if (currentItemIndex >= backBoardOneClickTest.size()) {
} qDebug() << "All backBoardOneClickTest items processed in onTimeout().";
else if(isClickedSend) { emit allItemsProcessed(getClientAddress(), itemsProcessedCount);
qDebug() << "All items processed in onTimeout."; }
emit allItemsProcessed(getClientAddress(), itemsProcessedCount); }
//resetCurrentItemIndex(); else {
if (currentItemIndex < frontBoardOneClickTest.size()) {
sendNextItem(currentJson);
}
else if (currentItemIndex >= frontBoardOneClickTest.size()) {
qDebug() << "All frontBoardOneClickTest items processed in onTimeout().";
emit allItemsProcessed(getClientAddress(), itemsProcessedCount);
}
}
} }
else if (isPowerOnSend) { else if (isPowerOnSend) {
qDebug() << "All items processed in onTimeout."; if (isBackBoardOrAllBoard) {
emit allItemsProcessed(getClientAddress(), currentFrontBoardIndex); if (currentBackBoardIndex < backBoardDevInfoJson.size()) {
//resetCurrentItemIndex(); sendDevInfoItem();
}
else {
qDebug() << "All items processed in onTimeout.";
emit allItemsProcessed(getClientAddress(), currentBackBoardIndex);
currentFrontBoardIndex = 0;
currentBackBoardIndex = 0;
isPowerOnSend = false;
}
}
else {
if (currentFrontBoardIndex < frontBoardDevInfoJson.size()) {
sendDevInfoItem();
}
else {
qDebug() << "All items processed in onTimeout.";
emit allItemsProcessed(getClientAddress(), currentFrontBoardIndex);
currentFrontBoardIndex = 0;
currentBackBoardIndex = 0;
isPowerOnSend = false;
}
}
} }
//qDebug() << "------> end mutex " << __FUNCTION__;
qDebug() << "" << __FUNCTION__ << "------> itemsProcessedCount " << itemsProcessedCount; qDebug() << "" << __FUNCTION__ << "------> itemsProcessedCount " << itemsProcessedCount;
} }

View File

@ -25,6 +25,7 @@
#include "DelUserWindows.h" #include "DelUserWindows.h"
#define TEST_TCP_MOVE_TO_MAIN 0 #define TEST_TCP_MOVE_TO_MAIN 0
#define GET_PIC_DATA_SIZE (480 * 640 * 1.5)
class ClientHandler : public QObject, public QRunnable class ClientHandler : public QObject, public QRunnable
{ {
@ -59,7 +60,7 @@ public:
void run() override; void run() override;
// 开始处理客户端 // 开始处理客户端
void start(); void start();
void sendJsonItem(const QJsonArray& jsonArray, int itemIndex, const QString text, const QString& itemType); void sendJsonItem(const QJsonArray& jsonArray, int itemIndex, const QString text, const QString backBoardSn, const QString& itemType);
// 发送获取设备信息按键 // 发送获取设备信息按键
void sendGetDevInfoItem(int itemIndex); void sendGetDevInfoItem(int itemIndex);
// 发送取图按键 // 发送取图按键
@ -68,12 +69,12 @@ public:
void sendGetVideoItem(int itemIndex, int GetVideoCamIndex); void sendGetVideoItem(int itemIndex, int GetVideoCamIndex);
// 发送License处理按键 // 发送License处理按键
void sendLicenseItem(int itemIndex, const QString text); void sendLicenseItem(int itemIndex, const QString text);
void sendUuidItem(int itemIndex, const QString text); void sendUuidItem(int itemIndex, const QString uuid, const QString sn);
// 发送下一个功能配置 JSON 项目 // 发送下一个功能配置 JSON 项目
void sendFrontFuncItem(int itemIndex, QString text); void sendFrontFuncItem(int itemIndex, QString text);
void sendBackFuncItem(int itemIndex, QString text); void sendBackFuncItem(int itemIndex, QString text);
// 发送下一个 JSON 项目 // 发送下一个 JSON 项目
void sendNextItem(); void sendNextItem(QJsonArray& currentOneClickedItem);
// 处理发送单独指令 // 处理发送单独指令
void sendFrontItem(int itemIndex); void sendFrontItem(int itemIndex);
void sendBackItem(int itemIndex); void sendBackItem(int itemIndex);
@ -105,9 +106,8 @@ signals:
// 数据发送信号 // 数据发送信号
void sendData(const QByteArray& data, int isBoardType); void sendData(const QByteArray& data, int isBoardType);
// 状态更新信号 // 状态更新信号
void statusUpdated(const QString& client, int itemIndex, int funcItemIndex, void statusUpdated(const QString& client, bool success, const QJsonArray& jsonArray, int itemJsonIndex);
bool success, const QString& itemData, const QString& funcItemData, void HandleInvalidOperate(const QString& text);
const QJsonArray& jsonArray, int itemJsonIndex);
// 客户端断开连接信号 // 客户端断开连接信号
void clientDisconnected(ClientHandler* handler); void clientDisconnected(ClientHandler* handler);
// json文件配置项发送完毕 // json文件配置项发送完毕
@ -132,6 +132,7 @@ public slots:
void onDisconnected(); void onDisconnected();
//void onSocketError(QAbstractSocket::SocketError socketError); //void onSocketError(QAbstractSocket::SocketError socketError);
void onTimeoutRead(); void onTimeoutRead();
void onPicRecvFinished();
void checkConnectionStatus(); // 定期检查连接状态 void checkConnectionStatus(); // 定期检查连接状态
void processPendingData(); void processPendingData();
void startReadVideoDataTimer(int client_Id); void startReadVideoDataTimer(int client_Id);

View File

@ -69,7 +69,12 @@
#define GET_BACK_V851_VERSION 0x0450 #define GET_BACK_V851_VERSION 0x0450
#define GET_BACK_806_VERSION 0x0451 #define GET_BACK_806_VERSION 0x0451
#define GET_BACK_HW_VERSION 0x0452 #define GET_BACK_HW_VERSION 0x0452
#define GET_BACK_SN 0x0453
#define GET_BACK_UID 0x0454 #define GET_BACK_MAC 0x0470
#define WRITE_BACK_UID_SN 0x0471
#define VIDEO_TEST 0x050A
#endif #endif

View File

@ -2,7 +2,8 @@
#include "RecvDataHandler.h" #include "RecvDataHandler.h"
#include "../Network/ClientHandler.h" #include "../Network/ClientHandler.h"
DataHandler::DataHandler(QLabel* videoLabel, QLineEdit* VideoResolutionEdit, QSize labelSize, QMap<QString, QLineEdit*>* devInfoLineEdits, DataHandler::DataHandler(QLabel* videoLabel, QLabel* video_Label_back, QLineEdit* VideoResolutionEdit, QLineEdit* VideoResolutionEdit_back,
QSize labelSize, QMap<QString, QLineEdit*>* devInfoLineEdits, int isBackBoardOrAllBoard,
QJsonArray frontBoardOneClickTest, QJsonArray frontBoardTest, QJsonArray frontBoardFuncConfig, QJsonArray frontBoardOneClickTest, QJsonArray frontBoardTest, QJsonArray frontBoardFuncConfig,
QJsonArray frontBoardDevInfoJson, QJsonArray frontBoardLicenseJson, QJsonArray frontBoardDevInfoJson, QJsonArray frontBoardLicenseJson,
QJsonArray backBoardOneClickTest, QJsonArray backBoardTest, QJsonArray backBoardFuncConfig, QJsonArray backBoardOneClickTest, QJsonArray backBoardTest, QJsonArray backBoardFuncConfig,
@ -10,9 +11,12 @@ DataHandler::DataHandler(QLabel* videoLabel, QLineEdit* VideoResolutionEdit, QSi
QJsonArray getPicJson, QJsonArray getVideoJson, QObject* parent) QJsonArray getPicJson, QJsonArray getVideoJson, QObject* parent)
: QObject(parent), : QObject(parent),
videoLabel(videoLabel), videoLabel(videoLabel),
video_Label_back(video_Label_back),
VideoResolutionEdit(VideoResolutionEdit), VideoResolutionEdit(VideoResolutionEdit),
VideoResolutionEdit_back(VideoResolutionEdit_back),
labelSize(labelSize), labelSize(labelSize),
devInfoLineEdits(devInfoLineEdits), devInfoLineEdits(devInfoLineEdits),
isBackBoardOrAllBoard(isBackBoardOrAllBoard),
frontBoardOneClickTest(frontBoardOneClickTest), frontBoardTest(frontBoardTest), frontBoardOneClickTest(frontBoardOneClickTest), frontBoardTest(frontBoardTest),
frontBoardFuncConfig(frontBoardFuncConfig), frontBoardDevInfoJson(frontBoardDevInfoJson), frontBoardFuncConfig(frontBoardFuncConfig), frontBoardDevInfoJson(frontBoardDevInfoJson),
frontBoardLicenseJson(frontBoardLicenseJson), frontBoardLicenseJson(frontBoardLicenseJson),
@ -22,7 +26,7 @@ DataHandler::DataHandler(QLabel* videoLabel, QLineEdit* VideoResolutionEdit, QSi
buffer(new QByteArray()), picBuffer(new QByteArray()), buffer(new QByteArray()), picBuffer(new QByteArray()),
ffmpegDecoder(new FFmpegDecoder()) // 初始化FFmpeg解码器 ffmpegDecoder(new FFmpegDecoder()) // 初始化FFmpeg解码器
{ {
ffmpegDecoder->initialize(); // 初始化解码器 //ffmpegDecoder->initialize(); // 初始化解码器
clearAllRecvData(); clearAllRecvData();
initializeMsgIdToCmdMap(); initializeMsgIdToCmdMap();
qDebug() << "DataHandler thread created"; qDebug() << "DataHandler thread created";
@ -81,8 +85,9 @@ void DataHandler::showVideo(const QString& client, const QByteArray& valData)
} }
if (!start_run) { if (!start_run) {
ffmpegDecoder->initialize(); // 初始化解码器
start_run = 1; start_run = 1;
ffmpegDecoder->decodeFile(h264filePath, videoLabel, VideoResolutionEdit); ffmpegDecoder->decodeFile(h264filePath, isBackBoardOrAllBoard, videoLabel, video_Label_back, VideoResolutionEdit, VideoResolutionEdit_back);
} }
//ffmpegDecoder->decodeFile(filePath_1, videoLabel); //ffmpegDecoder->decodeFile(filePath_1, videoLabel);
} }
@ -150,26 +155,23 @@ void DataHandler::handleData(const QString& client, const QByteArray& recv
/*for (int i = 0; i < 19; i++) { /*for (int i = 0; i < 19; i++) {
qDebug() << "buffer->at(" << i << "):" << QString::number(static_cast<unsigned char>(buffer->at(i)), 16).toUpper(); qDebug() << "buffer->at(" << i << "):" << QString::number(static_cast<unsigned char>(buffer->at(i)), 16).toUpper();
}*/ }*/
// 去掉前面 11 字节
QByteArray data = buffer->mid(11, dataSize); QByteArray data = buffer->mid(11, dataSize);
//QByteArray data = buffer->mid(10, dataSize); QString hexString = QString::fromUtf8(data.toHex().data());
QString hexString = QString::fromUtf8(data.toHex().data());
QByteArray actual_data = hexStringToByteArray(hexString); QByteArray actual_data = hexStringToByteArray(hexString);
buffer->remove(0, totalSize); // 移除已处理的数据 buffer->remove(0, totalSize); // 移除已处理的数据
if(msg_id != 0x0040 && msg_id != START_VIDEO && msg_id != GET_IMG) { if(msg_id != 0x0040 && msg_id != START_VIDEO && msg_id != GET_IMG && msg_id != VIDEO_TEST &&
msg_id != STOP_VIDEO) {
qDebug() << "--- msg_id:" << msg_id; qDebug() << "--- msg_id:" << msg_id;
qDebug() << "--- clientLastMsgId.value(client, 0):" << clientLastMsgId.value(client, 0); qDebug() << "--- clientLastMsgId.value(client, 0):" << clientLastMsgId.value(client, 0);
// 同一个client仅当 msg_id 不连续为 0x11/0x21 或第一次处理时才执行 emit statusUpdated
if ((msg_id != 0x0011 || clientLastMsgId.value(client, 0) != 0x0011) && if ((msg_id != 0x0011 || clientLastMsgId.value(client, 0) != 0x0011) &&
(msg_id != 0x0021 || clientLastMsgId.value(client, 0) != 0x0021) && (msg_id != 0x0021 || clientLastMsgId.value(client, 0) != 0x0021) &&
(msg_id != START_VIDEO || clientLastMsgId.value(client, 0) != START_VIDEO)) { (msg_id != START_VIDEO || clientLastMsgId.value(client, 0) != START_VIDEO)) {
//qDebug() << "Emitting statusUpdated for client:" << client << "with msg_id:" << QString::number(msg_id, 16).toUpper(); //qDebug() << "Emitting statusUpdated for client:" << client << "with msg_id:" << QString::number(msg_id, 16).toUpper();
emit statusUpdated(client, currentRecvItemIndex + 1, currentRecvFuncItemIndex + 1, emit statusUpdated(client, true, jsonArray, itemJsonIndex);
true, itemData, funcItemData, jsonArray, itemJsonIndex);
} }
clientLastMsgId[client] = msg_id; clientLastMsgId[client] = msg_id;
} }
handleCmd(msg_id, client, actual_data); handleCmd(msg_id, client, actual_data, jsonArray, itemJsonIndex);
} }
else { else {
break; // 数据还不完整,等待下一次接收 break; // 数据还不完整,等待下一次接收
@ -191,80 +193,56 @@ void DataHandler::initializeMsgIdToCmdMap() {
msgIdToCmdMap[GET_BACK_V851_VERSION] = "GET_BACK_V851_VERSION"; msgIdToCmdMap[GET_BACK_V851_VERSION] = "GET_BACK_V851_VERSION";
msgIdToCmdMap[GET_BACK_806_VERSION] = "GET_BACK_806_VERSION"; msgIdToCmdMap[GET_BACK_806_VERSION] = "GET_BACK_806_VERSION";
msgIdToCmdMap[GET_BACK_HW_VERSION] = "GET_BACK_HW_VERSION"; msgIdToCmdMap[GET_BACK_HW_VERSION] = "GET_BACK_HW_VERSION";
msgIdToCmdMap[GET_BACK_SN] = "GET_BACK_SN";
msgIdToCmdMap[GET_BACK_UID] = "GET_BACK_UID";
} }
void DataHandler::handleCmd(int msg_id, const QString& client, QByteArray actual_data) void DataHandler::handleCmd(int msg_id, const QString& client, QByteArray actual_data, const QJsonArray& jsonArray, int itemJsonIndex)
{ {
if (msg_id < 0x0400) { if (msg_id < 0x0400) {
handleFrontCmd(msg_id, client, actual_data); handleFrontCmd(msg_id, client, actual_data, jsonArray, itemJsonIndex);
} }
else if (msg_id < 0x0500) { else if (msg_id < 0x0500) {
handleDevInfo(msg_id, client, actual_data); handleDevInfo(msg_id, client, actual_data);
} }
else if (msg_id < 0x0800) { else if (msg_id < 0x0800) {
handleBackCmd(msg_id, client, actual_data); handleBackCmd(msg_id, client, actual_data, jsonArray, itemJsonIndex);
} }
} }
void DataHandler::handleFrontCmd(int msg_id, const QString& client, QByteArray actual_data) void DataHandler::handleFrontCmd(int msg_id, const QString& client, QByteArray actual_data, const QJsonArray& jsonArray, int itemJsonIndex)
{ {
switch (msg_id) { switch (msg_id) {
case FACE_ENROLL_SINGLE: case FACE_ENROLL_SINGLE:
{ {}
}
break; break;
case FACE_ENROLL: case FACE_ENROLL:
{ {}
}
break; break;
case HAND_ENROLL: case HAND_ENROLL:
{ {}
}
break; break;
case FACE_VERIFY: case FACE_VERIFY:
{ {}
}
break; break;
case HAND_VERIFY: case HAND_VERIFY:
{ {}
}
break; break;
case DEL_USER: case DEL_USER:
{ {}
}
break; break;
case DEL_ALLUSER: case DEL_ALLUSER:
{ {}
}
break; break;
case GET_USER: case GET_USER:
{ {}
}
break; break;
case GET_ALLUSER: case GET_ALLUSER:
{ {}
}
break; break;
case PASSWD_ENROLL: case PASSWD_ENROLL:
{ {}
}
break; break;
case IMG_ENROLL: case IMG_ENROLL:
{ {}
}
break; break;
case GET_IMG: case GET_IMG:
{ {
@ -272,14 +250,16 @@ void DataHandler::handleFrontCmd(int msg_id, const QString& client, QByteArray a
int width = (static_cast<unsigned char>(actual_data[3]) << 8) | static_cast<unsigned char>(actual_data[2]); int width = (static_cast<unsigned char>(actual_data[3]) << 8) | static_cast<unsigned char>(actual_data[2]);
int height = (static_cast<unsigned char>(actual_data[5]) << 8) | static_cast<unsigned char>(actual_data[4]); int height = (static_cast<unsigned char>(actual_data[5]) << 8) | static_cast<unsigned char>(actual_data[4]);
int format = static_cast<unsigned char>(actual_data[6]); int format = static_cast<unsigned char>(actual_data[6]);
qint32 picSize = width * height * 1.5; qint32 picSize = width * height * 1.5;
QByteArray yuvData = actual_data.mid(7); QByteArray yuvData = actual_data.mid(7);
qDebug() << "showPic width * height * 1.5:" << picSize; qDebug() << "showPic width * height * 1.5:" << picSize;
qDebug() << "showPic picBuffer.size():" << picBuffer->size(); qDebug() << "showPic picBuffer.size():" << picBuffer->size();
if (yuvData.size() + picBuffer->size() == picSize) { if (yuvData.size() + picBuffer->size() == picSize) {
emit picRecvFinished();
picBuffer->append(yuvData); picBuffer->append(yuvData);
showPic(labelSize, lens_n, width, height, format, picBuffer); showPic(labelSize, lens_n, width, height, format, picBuffer);
QJsonObject currentTempItem = jsonArray[itemJsonIndex].toObject();
emit statusUpdated(client, true, jsonArray, itemJsonIndex);
picBuffer->remove(0, picSize); picBuffer->remove(0, picSize);
} }
else if (yuvData.size() + picBuffer->size() > picSize) { else if (yuvData.size() + picBuffer->size() > picSize) {
@ -295,173 +275,130 @@ void DataHandler::handleFrontCmd(int msg_id, const QString& client, QByteArray a
break; break;
case START_VIDEO: case START_VIDEO:
{ {
if (!isStartVideo) {
isStartVideo = ffmpegDecoder->isStartVideo;
if (isStartVideo) {
emit statusUpdated(client, true, getVideoJson, 0);
}
}
showVideo(client, actual_data); showVideo(client, actual_data);
} }
break; break;
case STOP_VIDEO: case STOP_VIDEO:
{ {
isStartVideo = false;
emit statusUpdated(client, true, jsonArray, itemJsonIndex);
qDebug() << "--- STOP_VIDEO Current path: " << QDir::currentPath();
QString filePath = QDir::currentPath() + "/add1.h264";
if (QFile::exists(filePath)) {
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
qDebug() << "File add1.h264 cleared successfully.";
}
else {
qDebug() << "Failed to clear file add1.h264:" << file.errorString();
}
}
else {
qDebug() << "File add1.h264 does not exist.";
}
} }
break; break;
case TOUCH_TEST: case TOUCH_TEST:
{ {}
}
break; break;
case MIC_TEST: case MIC_TEST:
{ {}
}
break; break;
case SPK_TEST: case SPK_TEST:
{ {}
}
break; break;
case RADAR_TEST: case RADAR_TEST:
{ {}
}
break; break;
case NFC_TEST: case NFC_TEST:
{ {}
}
break; break;
case PR_SWITCH: case PR_SWITCH:
{ {}
}
break; break;
case PS_TEST: case PS_TEST:
{ {}
}
break; break;
case BACKLIGHT: case BACKLIGHT:
{ {}
}
break; break;
case IR_LED: case IR_LED:
{ {}
}
break; break;
case UART_TEST: case UART_TEST:
{ {}
}
break; break;
case PIR_TEST: case PIR_TEST:
{ {}
}
break; break;
case FACE_VERIFY_THRES: case FACE_VERIFY_THRES:
{ {}
}
break; break;
case FACE_THRES_LEVEL: case FACE_THRES_LEVEL:
{ {}
}
break; break;
case FACE_LIVE_THRES: case FACE_LIVE_THRES:
{ {}
}
break; break;
case FACE_ACC_THRES: case FACE_ACC_THRES:
{ {}
}
break; break;
case FACE_ACC_LEVEL: case FACE_ACC_LEVEL:
{ {}
}
break; break;
case FACE_DIS_RANGE: case FACE_DIS_RANGE:
{ {}
}
break; break;
case FACE_ANGLE_RANGE: case FACE_ANGLE_RANGE:
{ {}
}
break; break;
case HAND_VERIFY_THRES: case HAND_VERIFY_THRES:
{ {}
}
break; break;
case HANS_THRES_LEVEL: case HANS_THRES_LEVEL:
{ {}
}
break; break;
case HAND_LIVE_THRES: case HAND_LIVE_THRES:
{ {}
}
break; break;
case USER_MAX_NUM: case USER_MAX_NUM:
{ {}
}
break; break;
case ADMI_USER_MAX_NUM: case ADMI_USER_MAX_NUM:
{ {}
}
break; break;
case FACE_REPEAT: case FACE_REPEAT:
{ {}
}
break; break;
case HAND_REPEAT: case HAND_REPEAT:
{ {}
}
break; break;
case SET_IP: case SET_IP:
{ {}
}
break; break;
case SET_PORT: case SET_PORT:
{ {}
}
break; break;
case SET_VOLUME: case SET_VOLUME:
{ {}
}
break; break;
case SET_BACKLIGHT: case SET_BACKLIGHT:
{ {}
}
break; break;
case SET_RADAR_DIS: case SET_RADAR_DIS:
{ {}
}
break; break;
case SET_UART_BARTRATE: case SET_UART_BARTRATE:
{ {}
}
break; break;
case SET_LOG_LEVEL: case SET_LOG_LEVEL:
{ {}
}
break; break;
default: default:
{} {}
@ -471,6 +408,8 @@ void DataHandler::handleFrontCmd(int msg_id, const QString& client, QByteArray a
void DataHandler::handleDevInfo(int msg_id, const QString& client, QByteArray actual_data) void DataHandler::handleDevInfo(int msg_id, const QString& client, QByteArray actual_data)
{ {
qDebug() << "actual_data.size(): " << actual_data.size();
qDebug() << "actual_data: " << QString::fromUtf8(actual_data.toHex().data());
switch (msg_id) { switch (msg_id) {
case GET_FRONT_V851_VERSION: case GET_FRONT_V851_VERSION:
case GET_FRONT_MCU_VERSION: case GET_FRONT_MCU_VERSION:
@ -481,8 +420,8 @@ void DataHandler::handleDevInfo(int msg_id, const QString& client, QByteArray ac
case GET_BACK_V851_VERSION: case GET_BACK_V851_VERSION:
case GET_BACK_806_VERSION: case GET_BACK_806_VERSION:
case GET_BACK_HW_VERSION: case GET_BACK_HW_VERSION:
case GET_BACK_SN: /*case GET_BACK_SN:
case GET_BACK_UID: case GET_BACK_UID:*/
{ {
// aa55aa5503041d00000048464d3231305f4b3431343234395f423230323031305f41302e302e38 // aa55aa5503041d00000048464d3231305f4b3431343234395f423230323031305f41302e302e38
qDebug() << "GET_DEV_INFO"; qDebug() << "GET_DEV_INFO";
@ -502,8 +441,6 @@ void DataHandler::handleDevInfo(int msg_id, const QString& client, QByteArray ac
qDebug() << "GET_FRONT_HW_INFO"; qDebug() << "GET_FRONT_HW_INFO";
QStringList hexList; QStringList hexList;
QString dataStr; QString dataStr;
qDebug() << "actual_data.size(): " << actual_data.size();
qDebug() << "actual_data: " << QString::fromUtf8(actual_data.toHex().data());
if (actual_data.size() == PIX_HARDWARE_INFO_BYTES) { if (actual_data.size() == PIX_HARDWARE_INFO_BYTES) {
for (int i = 0; i < actual_data.size(); ++i) { for (int i = 0; i < actual_data.size(); ++i) {
hexList << QString("0x%1").arg(static_cast<unsigned char>(actual_data[i]), 2, 16, QLatin1Char('0')).toUpper().replace("0X", "0x"); hexList << QString("0x%1").arg(static_cast<unsigned char>(actual_data[i]), 2, 16, QLatin1Char('0')).toUpper().replace("0X", "0x");
@ -511,15 +448,26 @@ void DataHandler::handleDevInfo(int msg_id, const QString& client, QByteArray ac
dataStr = hexList.join(", "); dataStr = hexList.join(", ");
} }
else else
dataStr = "前板发送的HW INFO 数据大小不正确"; dataStr = "前板发送的 HW INFO 数据大小不正确";
QString displayText = dataStr; QString displayText = dataStr;
//licenseHwInfoEdit->setPlainText(displayText); //licenseHwInfoEdit->setPlainText(displayText);
emit updateLicenseHwInfoEdit(displayText); emit updateLicenseHwInfoEdit(displayText);
} }
break; break;
case WRITE_FRONT_LICENSE: case GET_BACK_MAC:
{ {
qDebug() << "WRITE_FRONT_LICENSE"; qDebug() << "GET_BACK_MAC";
QString dataStr;
if (actual_data.size() == BACK_MAC_ADDRESS_LEN) {
for (int i = 0; i < actual_data.size(); ++i) {
char ch = static_cast<unsigned char>(actual_data[i]);
dataStr.append(ch);
}
}
else
dataStr = "后板发送的 MAC addr 数据大小不正确";
QString displayText = dataStr;
emit updateUuidHwInfoEdit(displayText);
} }
break; break;
default: default:
@ -527,9 +475,51 @@ void DataHandler::handleDevInfo(int msg_id, const QString& client, QByteArray ac
} }
} }
void DataHandler::handleBackCmd(int msg_id, const QString& client, QByteArray actual_data) void DataHandler::handleBackCmd(int msg_id, const QString& client, QByteArray actual_data, const QJsonArray& jsonArray, int itemJsonIndex)
{ {
switch (msg_id) { switch (msg_id) {
case VIDEO_TEST:
{
if (!isStartVideo) {
isStartVideo = ffmpegDecoder->isStartVideo;
if (isStartVideo) {
emit statusUpdated(client, true, jsonArray, itemJsonIndex);
}
}
QJsonObject jsonObject = jsonArray[itemJsonIndex].toObject();
if (jsonObject["val"] == 0) {
showVideo(client, actual_data);
}
else if (jsonObject["val"] == 1) {
isStartVideo = false;
emit statusUpdated(client, true, jsonArray, itemJsonIndex);
qDebug() << "--- STOP_VIDEO";
qDebug() << "Current path: " << QDir::currentPath();
QString filePath = QDir::currentPath() + "/add1.h264";
if (QFile::exists(filePath)) {
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
qDebug() << "File add1.h264 cleared successfully.";
}
else {
qDebug() << "Failed to clear file add1.h264:" << file.errorString();
}
}
else {
qDebug() << "File add1.h264 does not exist.";
}
if (ffmpegDecoder) {
ffmpegDecoder->stopFFmpegDecoder();
ffmpegDecoder->requestInterruption();
ffmpegDecoder->wait(); // 等待解码器线程完成
delete ffmpegDecoder;
ffmpegDecoder = nullptr;
}
}
}
break;
default:
{}
break;
} }
} }

View File

@ -28,12 +28,15 @@
#define YUV420 1 #define YUV420 1
#define YUV422 2 #define YUV422 2
#define BACK_MAC_ADDRESS_LEN 11
class DataHandler : public QObject class DataHandler : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DataHandler(QLabel* videoLabel, QLineEdit* VideoResolutionEdit, QSize labelSize, QMap<QString, QLineEdit*>* devInfoLineEdits, explicit DataHandler(QLabel* videoLabel, QLabel* video_Label_back, QLineEdit* VideoResolutionEdit, QLineEdit* VideoResolutionEdit_back,
QSize labelSize, QMap<QString, QLineEdit*>* devInfoLineEdits, int isBackBoardOrAllBoard,
QJsonArray frontBoardOneClickTest, QJsonArray frontBoardTest, QJsonArray frontBoardFuncConfig, QJsonArray frontBoardOneClickTest, QJsonArray frontBoardTest, QJsonArray frontBoardFuncConfig,
QJsonArray frontBoardDevInfoJson, QJsonArray frontBoardLicenseJson, QJsonArray frontBoardDevInfoJson, QJsonArray frontBoardLicenseJson,
QJsonArray backBoardOneClickTest, QJsonArray backBoardTest, QJsonArray backBoardFuncConfig, QJsonArray backBoardOneClickTest, QJsonArray backBoardTest, QJsonArray backBoardFuncConfig,
@ -46,14 +49,14 @@ public slots:
int currentRecvFuncItemIndex, const QString& itemData, const QString& funcItemData, int currentRecvFuncItemIndex, const QString& itemData, const QString& funcItemData,
const QJsonArray& jsonArray, int itemJsonIndex); const QJsonArray& jsonArray, int itemJsonIndex);
signals: signals:
void statusUpdated(const QString& clientAddress, int currentItemIndex, int currentFuncItemIndex, void statusUpdated(const QString& clientAddress, bool success, const QJsonArray& jsonArray, int itemJsonIndex);
bool success, const QString& currentItemLabel, const QString& currentFuncItemLabel,
const QJsonArray& jsonArray, int itemJsonIndex);
void updateLicenseHwInfoEdit(const QString& text); void updateLicenseHwInfoEdit(const QString& text);
void updateUuidHwInfoEdit(const QString& text);
void updateLeftLensImage(const QPixmap& pixmap); void updateLeftLensImage(const QPixmap& pixmap);
void updateRightLensImage(const QPixmap& pixmap); void updateRightLensImage(const QPixmap& pixmap);
void updateVideoLabel(const QPixmap& pixmap); void updateVideoLabel(const QPixmap& pixmap);
void updateVideoResolution(const QString& resolutionText); void updateVideoResolution(const QString& resolutionText);
void picRecvFinished();
private: private:
QJsonArray frontBoardOneClickTest; // 前板一键功能测试 JSON QJsonArray frontBoardOneClickTest; // 前板一键功能测试 JSON
QJsonArray frontBoardTest; // 前板单项测试 JSON QJsonArray frontBoardTest; // 前板单项测试 JSON
@ -71,12 +74,15 @@ private:
//QLabel* leftLens_m_imageLabel; //QLabel* leftLens_m_imageLabel;
//QLabel* rightLens_m_imageLabel; //QLabel* rightLens_m_imageLabel;
QLabel* videoLabel; QLabel* videoLabel;
QLineEdit* VideoResolutionEdit; QLabel* video_Label_back;
QLineEdit* VideoResolutionEdit;
QLineEdit* VideoResolutionEdit_back;
//QTextEdit* licenseHwInfoEdit; //QTextEdit* licenseHwInfoEdit;
QByteArray allRecvData; // 完整的一帧数据 QByteArray allRecvData; // 完整的一帧数据
int remain = 0; int remain = 0;
int start_run = 0; int start_run = 0;
long dataLen = 0; long dataLen = 0;
int isBackBoardOrAllBoard = 0;
FFmpegDecoder* ffmpegDecoder; FFmpegDecoder* ffmpegDecoder;
QByteArray* buffer; QByteArray* buffer;
QByteArray* picBuffer; QByteArray* picBuffer;
@ -84,15 +90,16 @@ private:
QMap<QString, QLineEdit*>* devInfoLineEdits; QMap<QString, QLineEdit*>* devInfoLineEdits;
QMap<int, QString> msgIdToCmdMap; QMap<int, QString> msgIdToCmdMap;
QSize labelSize; QSize labelSize;
bool isStartVideo = false;
// 如果接收十六进制数据,转为二进制 // 如果接收十六进制数据,转为二进制
QByteArray hexStringToByteArray(const QString& hexString); QByteArray hexStringToByteArray(const QString& hexString);
void showVideo(const QString& client, const QByteArray& valData); void showVideo(const QString& client, const QByteArray& valData);
void clearAllRecvData(); void clearAllRecvData();
void handleCmd(int msg_id, const QString& client, QByteArray actual_data); void handleCmd(int msg_id, const QString& client, QByteArray actual_data, const QJsonArray& jsonArray, int itemJsonIndex);
void handleFrontCmd(int msg_id, const QString& client, QByteArray actual_data); void handleFrontCmd(int msg_id, const QString& client, QByteArray actual_data, const QJsonArray& jsonArray, int itemJsonIndex);
void handleDevInfo(int msg_id, const QString& client, QByteArray actual_data); void handleDevInfo(int msg_id, const QString& client, QByteArray actual_data);
void handleBackCmd(int msg_id, const QString& client, QByteArray actual_data); void handleBackCmd(int msg_id, const QString& client, QByteArray actual_data, const QJsonArray& jsonArray, int itemJsonIndex);
void initializeMsgIdToCmdMap(); void initializeMsgIdToCmdMap();
void updateLineEdit(int msg_id, const QByteArray& actual_data); void updateLineEdit(int msg_id, const QByteArray& actual_data);
void showPic(QSize labelSize, int lens_n, void showPic(QSize labelSize, int lens_n,

View File

@ -27,13 +27,19 @@ MainWidget::MainWidget(QWidget* parent) :
multicastTimer(new QTimer(this)) multicastTimer(new QTimer(this))
#endif #endif
{ {
leftLens_imageLabel = new QLabel(this); leftLens_imageLabel = new QLabel(this);
rightLens_imageLabel = new QLabel(this); rightLens_imageLabel = new QLabel(this);
videoLabel = new QLabel(this); leftLens_imageLabel_back = new QLabel(this);
frontFuncConfigLineEdit = new QLineEdit(this); rightLens_imageLabel_back = new QLabel(this);
backFuncConfigLineEdit = new QLineEdit(this); leftLens_imageLabel_all = new QLabel(this);
licenseHwInfoEdit = new QTextEdit(this); rightLens_imageLabel_all = new QLabel(this);
UuidHwInfoEdit = new QTextEdit(this); videoLabel = new QLabel(this);
video_Label_back = new QLabel(this);
video_Label_all = new QLabel(this);
frontFuncConfigLineEdit = new QLineEdit(this);
backFuncConfigLineEdit = new QLineEdit(this);
licenseHwInfoEdit = new QTextEdit(this);
UuidHwInfoEdit = new QTextEdit(this);
setupUI(); setupUI();
// 打印线程池状态信息 // 打印线程池状态信息
@ -84,14 +90,7 @@ MainWidget::MainWidget(QWidget* parent) :
} }
} }
}); });
QThread* thread = new QThread(this); QThread* thread = new QThread(this);
#if TEST_TCP_MOVE_TO_MAIN
ClientHandler* handler = new ClientHandler(socket, frontBoardOneClickTest, frontBoardTest, frontBoardFuncConfig,
frontBoardDevInfoJson, frontBoardLicenseJson,
backBoardOneClickTest, backBoardTest, backBoardFuncConfig, backBoardDevInfoJson,
backBoardUuidJson, getPicJson, getVideoJson, clientId, isBackBoardOrAllBoard, nullptr);
#else
ClientHandler* handler = new ClientHandler(frontBoardOneClickTest, frontBoardTest, frontBoardFuncConfig, ClientHandler* handler = new ClientHandler(frontBoardOneClickTest, frontBoardTest, frontBoardFuncConfig,
frontBoardDevInfoJson, frontBoardLicenseJson, frontBoardDevInfoJson, frontBoardLicenseJson,
backBoardOneClickTest, backBoardTest, backBoardFuncConfig, backBoardDevInfoJson, backBoardOneClickTest, backBoardTest, backBoardFuncConfig, backBoardDevInfoJson,
@ -101,9 +100,9 @@ MainWidget::MainWidget(QWidget* parent) :
// 将 socket 移动到新的线程中 // 将 socket 移动到新的线程中
socket->moveToThread(thread); socket->moveToThread(thread);
// 将 socket 传递到 handler // 将 socket 传递到 handler
handler->initialize(socket); handler->initialize(socket);
#endif DataHandler* dataHandler = new DataHandler(videoLabel, video_Label_back, VideoResolutionEdit, VideoResolutionEdit_back,
DataHandler* dataHandler = new DataHandler(videoLabel, VideoResolutionEdit, leftLens_imageLabel->size(), &devInfoLineEdits, leftLens_imageLabel->size(), &devInfoLineEdits, isBackBoardOrAllBoard,
frontBoardOneClickTest, frontBoardTest, frontBoardFuncConfig, frontBoardOneClickTest, frontBoardTest, frontBoardFuncConfig,
frontBoardDevInfoJson, frontBoardLicenseJson, frontBoardDevInfoJson, frontBoardLicenseJson,
backBoardOneClickTest, backBoardTest, backBoardFuncConfig, backBoardDevInfoJson, backBoardOneClickTest, backBoardTest, backBoardFuncConfig, backBoardDevInfoJson,
@ -111,34 +110,8 @@ MainWidget::MainWidget(QWidget* parent) :
// 将 ClientHandler 和 DataHandler 移到线程池中的线程 // 将 ClientHandler 和 DataHandler 移到线程池中的线程
handler->moveToThread(thread); handler->moveToThread(thread);
dataHandler->moveToThread(thread); dataHandler->moveToThread(thread);
#if TEST_TCP_MOVE_TO_MAIN connect(handler, &ClientHandler::sendData, handler, &ClientHandler::onSendData, Qt::QueuedConnection);
// 将sendData信号连接到主线程中的槽上 connect(handler, &ClientHandler::startTimeout, this, [this, clientId](int timeout) {
connect(handler, &ClientHandler::sendData, this, [socket](const QByteArray& data, int isBoardType) {
/*socket->write(data);
socket->flush();*/
//qDebug() << "---------------------data.size():" << data.size();
QByteArray prefix;
QDataStream stream(&prefix, QIODevice::WriteOnly);
stream.setByteOrder(QDataStream::LittleEndian);
stream << quint32(0x55AA55AA);
if (isBoardType != 0) {
stream << quint16(0x0421);
}
else {
stream << quint16(0x0420);
}
stream << quint32(data.size());
prefix.append(data);
qDebug() << "Sending data:" << prefix.toHex();
socket->write(prefix);
socket->flush();
});
#else
connect(handler, &ClientHandler::sendData, handler, &ClientHandler::onSendData, Qt::QueuedConnection);
#endif
connect(handler, &ClientHandler::startTimeout, this, [this, clientId](int timeout) {
this->onStartTimeout(clientId, timeout); this->onStartTimeout(clientId, timeout);
}); });
@ -146,13 +119,15 @@ MainWidget::MainWidget(QWidget* parent) :
clients_1[clientId] = handler; clients_1[clientId] = handler;
clientThreads[clientId] = thread; clientThreads[clientId] = thread;
connect(handler, &ClientHandler::statusUpdated, this, &MainWidget::onStatusUpdated); connect(handler, &ClientHandler::statusUpdated, this, &MainWidget::onStatusUpdated);
connect(handler, &ClientHandler::HandleInvalidOperate, this, &MainWidget::onHandleInvalidOperate);
connect(handler, &ClientHandler::clientDisconnected, this, &MainWidget::onClientDisconnected); connect(handler, &ClientHandler::clientDisconnected, this, &MainWidget::onClientDisconnected);
connect(handler, &ClientHandler::allItemsProcessed, this, &MainWidget::onAllItemsProcessed); connect(handler, &ClientHandler::allItemsProcessed, this, &MainWidget::onAllItemsProcessed);
connect(handler, &ClientHandler::selectClientDisconnected, this, &MainWidget::onDisconnectClient); connect(handler, &ClientHandler::selectClientDisconnected, this, &MainWidget::onDisconnectClient);
dataHandlers[clientId] = dataHandler; dataHandlers[clientId] = dataHandler;
connect(handler, &ClientHandler::dataReceived, dataHandler, &DataHandler::handleData); connect(handler, &ClientHandler::dataReceived, dataHandler, &DataHandler::handleData);
connect(dataHandler, &DataHandler::statusUpdated, this, &MainWidget::onStatusUpdated); connect(dataHandler, &DataHandler::picRecvFinished, handler, &ClientHandler::onPicRecvFinished);
connect(dataHandler, &DataHandler::statusUpdated, this, &MainWidget::onStatusUpdated);
// 当线程结束时删除 handler // 当线程结束时删除 handler
connect(thread, &QThread::finished, this, [=]() { connect(thread, &QThread::finished, this, [=]() {
onThreadFinished(thread, handler, dataHandler); onThreadFinished(thread, handler, dataHandler);
@ -160,6 +135,9 @@ MainWidget::MainWidget(QWidget* parent) :
connect(dataHandler, &DataHandler::updateLicenseHwInfoEdit, this, [this](const QString& text) { connect(dataHandler, &DataHandler::updateLicenseHwInfoEdit, this, [this](const QString& text) {
licenseHwInfoEdit->setPlainText(text); licenseHwInfoEdit->setPlainText(text);
}); });
connect(dataHandler, &DataHandler::updateUuidHwInfoEdit, this, [this](const QString& text) {
UuidHwInfoEdit->setPlainText(text);
});
connect(dataHandler, &DataHandler::updateLeftLensImage, leftLens_imageLabel, &QLabel::setPixmap); connect(dataHandler, &DataHandler::updateLeftLensImage, leftLens_imageLabel, &QLabel::setPixmap);
connect(dataHandler, &DataHandler::updateRightLensImage, rightLens_imageLabel, &QLabel::setPixmap); connect(dataHandler, &DataHandler::updateRightLensImage, rightLens_imageLabel, &QLabel::setPixmap);
@ -181,6 +159,9 @@ MainWidget::MainWidget(QWidget* parent) :
clientReadTimers[clientId] = readTimer; clientReadTimers[clientId] = readTimer;
connect(handler, &ClientHandler::sendDataToSomeClient, this, &MainWidget::sendDataToClient); connect(handler, &ClientHandler::sendDataToSomeClient, this, &MainWidget::sendDataToClient);
if (connectedClientsCount == 1) {
handler->sendDevInfoItem();
}
} }
}); });
@ -276,7 +257,7 @@ void MainWidget::onClientDisconnected(ClientHandler* handler)
int clientId = handler->getClientId(); int clientId = handler->getClientId();
qDebug() << " preVideoClientId :" << handler->preVideoClientId; qDebug() << " preVideoClientId :" << handler->preVideoClientId;
qDebug() << " clientId :" << clientId; qDebug() << " clientId :" << clientId;
if (handler->preVideoClientId == clientId) { if ((isBackBoardOrAllBoard != 0) || (handler->preVideoClientId == clientId)) {
qDebug() << "Current path: " << QDir::currentPath(); qDebug() << "Current path: " << QDir::currentPath();
QString filePath = QDir::currentPath() + "/add1.h264"; QString filePath = QDir::currentPath() + "/add1.h264";
if (QFile::exists(filePath)) { if (QFile::exists(filePath)) {
@ -344,13 +325,13 @@ void MainWidget::updateServerButtonText()
} }
} }
// 设置 UI
void MainWidget::setupUI() void MainWidget::setupUI()
{ {
startServerButton = new QPushButton("开始监听\n(Start Listening...)", this); // 左侧部分 UI 元素
startServerButton = new QPushButton(QString(START_LISTENING), this);
startServerButton->setFixedSize(190, 70); startServerButton->setFixedSize(190, 70);
sendAllButton = new QPushButton("一键功能测试", this); sendAllButton = new QPushButton(QString(ONE_CLICKED_TEST), this);
sendAllButton->setFixedSize(190, 70); sendAllButton->setFixedSize(190, 70);
sendAllButton->setEnabled(false); sendAllButton->setEnabled(false);
@ -395,72 +376,41 @@ void MainWidget::setupUI()
leftContainer->setLayout(leftLayout); leftContainer->setLayout(leftLayout);
leftContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); leftContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
// 前板 QTabWidget* mainTabWidget = new QTabWidget(this);
QGroupBox* frontDeviceInfoGroupBox = createFrontDeviceInfoGroupBox();
QGroupBox* frontLicenseGroupBox = createLicenseGroupBox();
QHBoxLayout* frontGroupBoxLayout = new QHBoxLayout; VideoResolutionEdit = new QLineEdit(this);
frontGroupBoxLayout->addWidget(frontDeviceInfoGroupBox, 1); VideoResolutionEdit_back = new QLineEdit(this);
frontGroupBoxLayout->addWidget(frontLicenseGroupBox, 1); VideoResolutionEdit_all = new QLineEdit(this);
QTabWidget* frontTabWidget = new QTabWidget(this); // 添加前板、后板、整机的布局
frontTabWidget->setFixedSize(900, 315); addDeviceAreaTab(mainTabWidget, QString(FRONT_BOARD_NAME),
QWidget* frontFunctionTestTab = createFunctionTestTab(frontBoardTest, "frontBoardTest"); createFrontDeviceInfoGroupBox(), createLicenseGroupBox(),
QWidget* frontFunctionConfigTab = createFunctionConfigTab(frontBoardFuncConfig, "frontBoardFuncConfig"); frontBoardTest, frontBoardFuncConfig, "frontBoardTest", "frontBoardFuncConfig",
frontTabWidget->addTab(frontFunctionTestTab, "前板测试项"); QString(FRONT_TEST_ITEM), QString(FRONT_CONFID_ITEM), leftLens_imageLabel, rightLens_imageLabel,
frontTabWidget->addTab(frontFunctionConfigTab, "前板配置项"); videoLabel, VideoResolutionEdit);
QTabWidget* mainTabWidget = new QTabWidget(this); addDeviceAreaTab(mainTabWidget, QString(BACK_BOARD_NAME),
QWidget* frontDevAreaTab = new QWidget(this); createBackDeviceInfoGroupBox(), createBackConnectServerGroupBox(),
QVBoxLayout* frontDevLayout = new QVBoxLayout(frontDevAreaTab); backBoardTest, backBoardFuncConfig, "backBoardTest", "backBoardFuncConfig",
frontDevLayout->addLayout(frontGroupBoxLayout); QString(BACK_TEST_ITEM), QString(BACK_CONFID_ITEM), leftLens_imageLabel_back, rightLens_imageLabel_back,
frontDevLayout->addWidget(frontTabWidget, 2, Qt::AlignTop | Qt::AlignLeft); video_Label_back, VideoResolutionEdit_back);
mainTabWidget->addTab(frontDevAreaTab, "前 板");
// 后板 addAllDeviceAreaTab(mainTabWidget, QString(ALL_BOARD_NAME), leftLens_imageLabel_all, rightLens_imageLabel_all, video_Label_all, VideoResolutionEdit_all);
QGroupBox* backDeviceInfoGroupBox1 = createBackDeviceInfoGroupBox();
QGroupBox* BackConnectServerGroupBox = createBackConnectServerGroupBox();
QHBoxLayout* backGroupBoxLayout = new QHBoxLayout;
backGroupBoxLayout->addWidget(backDeviceInfoGroupBox1, 1);
backGroupBoxLayout->addWidget(BackConnectServerGroupBox, 1);
QTabWidget* backTabWidget = new QTabWidget(this);
backTabWidget->setFixedSize(900, 315);
QWidget* backFunctionTestTab = createFunctionTestTab(backBoardTest, "backBoardTest");
QWidget* backFunctionConfigTab = createFunctionConfigTab(backBoardFuncConfig, "backBoardFuncConfig");
backTabWidget->addTab(backFunctionTestTab, "后板测试项");
backTabWidget->addTab(backFunctionConfigTab, "后板配置项");
QWidget* backDevAreaTab = new QWidget(this);
QVBoxLayout* backDevLayout = new QVBoxLayout(backDevAreaTab);
backDevLayout->addLayout(backGroupBoxLayout);
backDevLayout->addWidget(backTabWidget, 2, Qt::AlignTop | Qt::AlignLeft);
mainTabWidget->addTab(backDevAreaTab, "后 板");
// 整机
QWidget* allDevAreaTab = new QWidget(this);
QVBoxLayout* allDevLayout = new QVBoxLayout(allDevAreaTab);
mainTabWidget->addTab(allDevAreaTab, "整 机");
QTabWidget* tabWidget_media = new QTabWidget(this);
QWidget* imageDisplayTab = createImageDisplayTab();
QWidget* videoDisplayTab = createVideoDisplayTab();
tabWidget_media->addTab(imageDisplayTab, "图像显示区");
tabWidget_media->addTab(videoDisplayTab, "视频显示区");
// 右侧主布局
QVBoxLayout* rightVerticalLayout = new QVBoxLayout; QVBoxLayout* rightVerticalLayout = new QVBoxLayout;
rightVerticalLayout->addWidget(mainTabWidget, 5); rightVerticalLayout->addWidget(mainTabWidget, 5);
rightVerticalLayout->addWidget(tabWidget_media, 4);
// 主布局
QHBoxLayout* mainLayout = new QHBoxLayout; QHBoxLayout* mainLayout = new QHBoxLayout;
mainLayout->addWidget(leftContainer, 1, Qt::AlignTop | Qt::AlignLeft); mainLayout->addWidget(leftContainer, 1, Qt::AlignTop | Qt::AlignLeft);
mainLayout->addLayout(rightVerticalLayout, 3); mainLayout->addLayout(rightVerticalLayout, 3);
setLayout(mainLayout); setLayout(mainLayout);
setWindowTitle("SL100 工厂产测工具 - V0.0.5"); setWindowTitle(QString(TOOL_VERSION));
resize(1340, 900); resize(SL100_FACTORY_TOOL_W, SL100_FACTORY_TOOL_H);
// 信号槽连接
connect(startServerButton, &QPushButton::clicked, this, &MainWidget::onStartServerClicked); connect(startServerButton, &QPushButton::clicked, this, &MainWidget::onStartServerClicked);
connect(sendAllButton, &QPushButton::clicked, this, &MainWidget::onSendAllClicked); connect(sendAllButton, &QPushButton::clicked, this, &MainWidget::onSendAllClicked);
connect(statusListWidget, &QListWidget::itemChanged, this, &MainWidget::scrollToBottom); connect(statusListWidget, &QListWidget::itemChanged, this, &MainWidget::scrollToBottom);
@ -542,7 +492,7 @@ QString calculateSignature(const QMap<QString, QString>& params, const QString&
// 3. 构造 BaseString // 3. 构造 BaseString
//QString baseString = params["batch"] + params["label"] + params["model"] + params["request_id"] + params["timestamp"] + params["factory_id"]; //QString baseString = params["batch"] + params["label"] + params["model"] + params["request_id"] + params["timestamp"] + params["factory_id"];
QString baseString = "240830SL100LabelSL100" + request_id + timestamp + "TEST"; QString baseString = "1TEST_SL100_20240826SL100" + request_id + timestamp + "TEST";
qDebug() << "baseString:" << baseString; qDebug() << "baseString:" << baseString;
// 4. 构造 stringToSign // 4. 构造 stringToSign
@ -555,8 +505,8 @@ QString calculateSignature(const QMap<QString, QString>& params, const QString&
// 请求头 // 请求头
void prepareRequestHeaders(QNetworkRequest& request, const QString& sign, const QString& request_id) { void prepareRequestHeaders(QNetworkRequest& request, const QString& sign, const QString& request_id) {
request.setRawHeader("factory_id", "TEST"); request.setRawHeader("factory_id", "TEST");
request.setRawHeader("label", "SL100Label"); request.setRawHeader("label", "TEST_SL100_20240826");
request.setRawHeader("batch", QString::number(240830).toUtf8()); request.setRawHeader("batch", QString::number(1).toUtf8());
request.setRawHeader("model", "SL100"); request.setRawHeader("model", "SL100");
request.setRawHeader("timestamp", QString::number(QDateTime::currentSecsSinceEpoch()).toUtf8()); request.setRawHeader("timestamp", QString::number(QDateTime::currentSecsSinceEpoch()).toUtf8());
request.setRawHeader("request_id", request_id.toUtf8()); request.setRawHeader("request_id", request_id.toUtf8());
@ -598,7 +548,7 @@ void sendPostRequest(HttpClient* httpClient, const QUrl& url, const QMap<QString
// GET 获取 UUID // GET 获取 UUID
void MainWidget::FactoryToolSendGetUuidToHttpServer(const QString& mac_addr) { void MainWidget::FactoryToolSendGetUuidToHttpServer(const QString& mac_addr) {
QUrl url("http://admin.hassecurity.cn/v1/getUuid"); QUrl url("http://admin.hassecurity.cn/v1/getUuid");
QMap<QString, QString> params = { QMap<QString, QString> params = {
{"label", "TEST_SL100_20240826"}, {"label", "TEST_SL100_20240826"},
{"model", "SL100"}, {"model", "SL100"},
{"batch", "1"}, {"batch", "1"},
@ -780,6 +730,8 @@ void MainWidget::readJsonConfig()
backBoardDevInfoJson = readJson_backDevInfo(); backBoardDevInfoJson = readJson_backDevInfo();
backBoardUuidJson = readJson_backUuid(); backBoardUuidJson = readJson_backUuid();
factoryProductInfo = readJson_factoryProductInfo();
testJsonConfig = readJson_testConfig(); testJsonConfig = readJson_testConfig();
funcJsonConfig = readJson_funcConfig(); funcJsonConfig = readJson_funcConfig();
@ -989,26 +941,6 @@ void MainWidget::onLicenseButtonClicked()
} }
} }
else { else {
#if 0
if (jsonObject["lable"].toString() == "write_license") {
QString hwInfoText = licenseHwInfoEdit->toPlainText();
dataStr = hwInfoText.remove(","); // 去掉所有的逗号
QByteArray dataByteArray = QByteArray::fromHex(dataStr.toUtf8());
memcpy(hardware_info, dataByteArray.data(), qMin(dataByteArray.size(), PIX_HARDWARE_INFO_BYTES));
qDebug() << "hardware_info:" << QByteArray(reinterpret_cast<char*>(hardware_info), PIX_HARDWARE_INFO_BYTES).toHex();
licenseGenerate(hardware_info, license_info);
QString licenseInfoStr;
printf("License is\n");
for (int j = 0; j < PIX_LICENCE_BYTES; ++j) {
printf("0x%02x, ", license_info[j]);
licenseInfoStr.append(QString::asprintf("0x%02x, ", license_info[j]));
}
printf("\n");
licenseHwInfoEdit->setPlainText(licenseInfoStr);
dataStr = QByteArray(reinterpret_cast<char*>(license_info), PIX_LICENCE_BYTES).toHex();
qDebug() << "license_info:" << dataStr;
}
#else
if (jsonObject["lable"].toString() == "write_license") { if (jsonObject["lable"].toString() == "write_license") {
QString licenseInfoText = licenseHwInfoEdit->toPlainText(); QString licenseInfoText = licenseHwInfoEdit->toPlainText();
qDebug() << "licenseInfoText:" << licenseInfoText; qDebug() << "licenseInfoText:" << licenseInfoText;
@ -1025,7 +957,6 @@ void MainWidget::onLicenseButtonClicked()
dataStr = dataByteArray.toBase64(); dataStr = dataByteArray.toBase64();
qDebug() << "Base64 Encoded:" << dataStr; qDebug() << "Base64 Encoded:" << dataStr;
} }
#endif
for (ClientHandler* handler : clients) { for (ClientHandler* handler : clients) {
handler->sendLicenseItem(index, dataStr); handler->sendLicenseItem(index, dataStr);
} }
@ -1052,25 +983,75 @@ void MainWidget::onUuidButtonClicked()
QString sendToHttpServerDataStr = UuidHwInfoEdit->toPlainText(); QString sendToHttpServerDataStr = UuidHwInfoEdit->toPlainText();
qDebug() << "sendToHttpServerDataStr:" << sendToHttpServerDataStr; qDebug() << "sendToHttpServerDataStr:" << sendToHttpServerDataStr;
// 测试随机生成8-12位字符串 // 测试随机生成8-12位字符串
sendToHttpServerDataStr = generateRandomRequestID(8, 13); // sendToHttpServerDataStr = generateRandomRequestID(8, 13);
FactoryToolSendGetUuidToHttpServer(sendToHttpServerDataStr); FactoryToolSendGetUuidToHttpServer(sendToHttpServerDataStr);
while (isRequestSuccessful == 0) { while (isRequestSuccessful == 0) {
QCoreApplication::processEvents(); // 防止阻塞UI线程 QCoreApplication::processEvents(); // 防止阻塞UI线程
} }
qDebug() << "isRequestSuccessful:" << isRequestSuccessful; qDebug() << "isRequestSuccessful:" << isRequestSuccessful;
if (isRequestSuccessful == 2) { if (isRequestSuccessful == 2) {
UuidHwInfoEdit->setPlainText("服务器没有回复UUID和SN !!!");
isRequestSuccessful = 0;
return; return;
} }
else if (isRequestSuccessful == 1) { else if (isRequestSuccessful == 1) {
if (licenseDataArray.contains("uuid") && licenseDataArray.contains("sn")) {
QString backBoardUuid = licenseDataArray["uuid"].toString();
QString backBoardSn = licenseDataArray["sn"].toString();
QString displayText = QString("UUID:\n%1\nSN:\n%2").arg(backBoardUuid).arg(backBoardSn);
UuidHwInfoEdit->setPlainText(displayText);
qDebug() << "HTTP Server backBoardUuid is:" << backBoardUuid;
qDebug() << "HTTP Server backBoardSn is:" << backBoardSn;
isRequestSuccessful = 0;
return;
}
else {
qDebug() << "The UUID and SN are not found from the HTTP server!!!";
UuidHwInfoEdit->setPlainText("服务器没有回复UUID和SN !!!");
isRequestSuccessful = 0;
return;
}
} }
} }
else { else {
QString backBoardUuid = "";
QString backBoardSn = "";
if (jsonObject["lable"].toString() == "write_UUID_SN") { if (jsonObject["lable"].toString() == "write_UUID_SN") {
QString UUIDAndSNInfoText = UuidHwInfoEdit->toPlainText();
QStringList lines = UUIDAndSNInfoText.split("\n");
bool isUuidSection = false;
bool isSnSection = false;
for (const QString& line : lines) {
QString trimmedLine = line.trimmed();
if (trimmedLine == "UUID:") {
isUuidSection = true;
isSnSection = false;
continue;
}
if (trimmedLine == "SN:") {
isUuidSection = false;
isSnSection = true;
continue;
}
if (isUuidSection) {
if (!backBoardUuid.isEmpty()) {
backBoardUuid += "\n";
}
backBoardUuid += trimmedLine;
}
if (isSnSection) {
if (!backBoardSn.isEmpty()) {
backBoardSn += "\n";
}
backBoardSn += trimmedLine;
}
}
qDebug() << "UuidHwInfoEdit backBoardUuid is:" << backBoardUuid;
qDebug() << "UuidHwInfoEdit backBoardSn is:" << backBoardSn;
} }
qDebug() << "onUuidButtonClicked index:" << index;
for (ClientHandler* handler : clients) { for (ClientHandler* handler : clients) {
handler->sendUuidItem(index, ""); handler->sendUuidItem(index, backBoardUuid, backBoardSn);
} }
} }
} }
@ -1191,7 +1172,7 @@ void MainWidget::onSendGetPicClicked()
} }
else { else {
if (lastClickedGetPicCamIndex == -1) { if (lastClickedGetPicCamIndex == -1) {
QListWidgetItem* listItem = new QListWidgetItem(QString("Please select IR or RGB lens to get image!!!"), statusListWidget); QListWidgetItem* listItem = new QListWidgetItem(QString("Please select \"左边镜头\" or \"右边镜头\" to get image!!!"), statusListWidget);
listItem->setBackground(Qt::red); listItem->setBackground(Qt::red);
} }
else { else {
@ -1227,47 +1208,135 @@ void MainWidget::onSendGetVideoClicked()
{ {
if (connectedClientsCount) { if (connectedClientsCount) {
QPushButton* button = qobject_cast<QPushButton*>(sender()); QPushButton* button = qobject_cast<QPushButton*>(sender());
int itemIndex = button->property("getVideoIndex").toInt(); int itemIndex = -1;
if (button) {
if (itemIndex < 4) { if (button->property(FRONT_BOARD_VIDEO_BUTTON_INDEX_PROPERTY).isValid()) {
button->setStyleSheet("background-color: green;"); itemIndex = button->property(FRONT_BOARD_VIDEO_BUTTON_INDEX_PROPERTY).toInt();
if (lastClickedGetVideoCamIndex != -1 && lastClickedGetVideoCamIndex != itemIndex) { if (itemIndex < 4) {
getVideoButtons[lastClickedGetVideoCamIndex]->setStyleSheet("");
if (lastClickedGetVideoDevIndex != -1) {
getVideoButtons[lastClickedGetVideoDevIndex - 2]->setStyleSheet("");
}
}
lastClickedGetVideoCamIndex = itemIndex;
}
else {
if (lastClickedGetVideoCamIndex == -1) {
QListWidgetItem* listItem = new QListWidgetItem(QString("Please select lens to get video!!!"), statusListWidget);
listItem->setBackground(Qt::red);
}
else {
if (itemIndex - 8 >= connectedClientsCount) {
QListWidgetItem* listItem = new QListWidgetItem(QString("This device is not connected !!!").arg(itemIndex - 6), statusListWidget);
listItem->setBackground(Qt::red);
}
else {
button->setStyleSheet("background-color: green;"); button->setStyleSheet("background-color: green;");
if (lastClickedGetVideoDevIndex != -1 && lastClickedGetVideoDevIndex != itemIndex) { if (lastClickedGetVideoCamIndex != -1 && lastClickedGetVideoCamIndex != itemIndex) {
//qDebug() << "itemIndex:" << itemIndex; getVideoButtons[lastClickedGetVideoCamIndex]->setStyleSheet("");
getVideoButtons[lastClickedGetVideoDevIndex - 2]->setStyleSheet(""); if (lastClickedGetVideoDevIndex != -1) {
} getVideoButtons[lastClickedGetVideoDevIndex - 2]->setStyleSheet("");
lastClickedGetVideoDevIndex = itemIndex; }
//QMutexLocker locker(&mutex); }
for (ClientHandler* handler : clients) { lastClickedGetVideoCamIndex = itemIndex;
if (handler->getClientId() == handler->controlClientId) { }
qDebug() << "lens number:" << lastClickedGetVideoCamIndex; else {
handler->sendGetVideoItem(itemIndex - 7, lastClickedGetVideoCamIndex); if (lastClickedGetVideoCamIndex == -1) {
break; QListWidgetItem* listItem = new QListWidgetItem(QString("Please select lens to get video!!!"), statusListWidget);
listItem->setBackground(Qt::red);
}
else {
if (itemIndex - 8 >= connectedClientsCount) {
QListWidgetItem* listItem = new QListWidgetItem(QString("This device is not connected !!!").arg(itemIndex - 6), statusListWidget);
listItem->setBackground(Qt::red);
}
else {
button->setStyleSheet("background-color: green;");
if (lastClickedGetVideoDevIndex != -1 && lastClickedGetVideoDevIndex != itemIndex) {
//qDebug() << "itemIndex:" << itemIndex;
getVideoButtons[lastClickedGetVideoDevIndex - 2]->setStyleSheet("");
}
lastClickedGetVideoDevIndex = itemIndex;
//QMutexLocker locker(&mutex);
for (ClientHandler* handler : clients) {
if ((isBackBoardOrAllBoard) || (handler->getClientId() == handler->controlClientId)) {
qDebug() << "lens number:" << lastClickedGetVideoCamIndex;
handler->sendGetVideoItem(itemIndex - 7, lastClickedGetVideoCamIndex);
break;
}
}
getVideoButtons[FOCUS_WINDOWS_BUTTON]->setEnabled(true);
} }
} }
getVideoButtons[FOCUS_WINDOWS_BUTTON]->setEnabled(true);
} }
} }
} else if (button->property(BACK_BOARD_VIDEO_BUTTON_INDEX_PROPERTY).isValid()) {
itemIndex = button->property(BACK_BOARD_VIDEO_BUTTON_INDEX_PROPERTY).toInt();
if (itemIndex < 4) {
button->setStyleSheet("background-color: green;");
if (lastClickedGetVideoCamIndex != -1 && lastClickedGetVideoCamIndex != itemIndex) {
getBackVideoButtons[lastClickedGetVideoCamIndex]->setStyleSheet("");
if (lastClickedGetVideoDevIndex != -1) {
getBackVideoButtons[lastClickedGetVideoDevIndex - 2]->setStyleSheet("");
}
}
lastClickedGetVideoCamIndex = itemIndex;
}
else {
if (lastClickedGetVideoCamIndex == -1) {
QListWidgetItem* listItem = new QListWidgetItem(QString("Please select lens to get video!!!"), statusListWidget);
listItem->setBackground(Qt::red);
}
else {
if (itemIndex - 8 >= connectedClientsCount) {
QListWidgetItem* listItem = new QListWidgetItem(QString("This device is not connected !!!").arg(itemIndex - 6), statusListWidget);
listItem->setBackground(Qt::red);
}
else {
button->setStyleSheet("background-color: green;");
if (lastClickedGetVideoDevIndex != -1 && lastClickedGetVideoDevIndex != itemIndex) {
//qDebug() << "itemIndex:" << itemIndex;
getBackVideoButtons[lastClickedGetVideoDevIndex - 2]->setStyleSheet("");
}
lastClickedGetVideoDevIndex = itemIndex;
//QMutexLocker locker(&mutex);
for (ClientHandler* handler : clients) {
if ((isBackBoardOrAllBoard) || (handler->getClientId() == handler->controlClientId)) {
qDebug() << "lens number:" << lastClickedGetVideoCamIndex;
handler->sendGetVideoItem(itemIndex - 7, lastClickedGetVideoCamIndex);
break;
}
}
getBackVideoButtons[FOCUS_WINDOWS_BUTTON]->setEnabled(true);
}
}
}
}
else if (button->property(ALL_BOARD_VIDEO_BUTTON_INDEX_PROPERTY).isValid()) {
itemIndex = button->property(ALL_BOARD_VIDEO_BUTTON_INDEX_PROPERTY).toInt();
if (itemIndex < 4) {
button->setStyleSheet("background-color: green;");
if (lastClickedGetVideoCamIndex != -1 && lastClickedGetVideoCamIndex != itemIndex) {
getAllVideoButtons[lastClickedGetVideoCamIndex]->setStyleSheet("");
if (lastClickedGetVideoDevIndex != -1) {
getAllVideoButtons[lastClickedGetVideoDevIndex - 2]->setStyleSheet("");
}
}
lastClickedGetVideoCamIndex = itemIndex;
}
else {
if (lastClickedGetVideoCamIndex == -1) {
QListWidgetItem* listItem = new QListWidgetItem(QString("Please select lens to get video!!!"), statusListWidget);
listItem->setBackground(Qt::red);
}
else {
if (itemIndex - 8 >= connectedClientsCount) {
QListWidgetItem* listItem = new QListWidgetItem(QString("This device is not connected !!!").arg(itemIndex - 6), statusListWidget);
listItem->setBackground(Qt::red);
}
else {
button->setStyleSheet("background-color: green;");
if (lastClickedGetVideoDevIndex != -1 && lastClickedGetVideoDevIndex != itemIndex) {
//qDebug() << "itemIndex:" << itemIndex;
getAllVideoButtons[lastClickedGetVideoDevIndex - 2]->setStyleSheet("");
}
lastClickedGetVideoDevIndex = itemIndex;
//QMutexLocker locker(&mutex);
for (ClientHandler* handler : clients) {
if ((isBackBoardOrAllBoard) || (handler->getClientId() == handler->controlClientId)) {
qDebug() << "lens number:" << lastClickedGetVideoCamIndex;
handler->sendGetVideoItem(itemIndex - 7, lastClickedGetVideoCamIndex);
break;
}
}
getAllVideoButtons[FOCUS_WINDOWS_BUTTON]->setEnabled(true);
}
}
}
}
}
} }
else { else {
QListWidgetItem* listItem = new QListWidgetItem(QString("No device is connected !!!"), statusListWidget); QListWidgetItem* listItem = new QListWidgetItem(QString("No device is connected !!!"), statusListWidget);
@ -1311,8 +1380,11 @@ void MainWidget::onSendAllClicked()
// 重置索引 // 重置索引
handler->resetCurrentItemIndex(); handler->resetCurrentItemIndex();
if (handler->getClientId() == handler->controlClientId) { if (handler->getClientId() == handler->controlClientId) {
handler->sendNextItem(); handler->sendNextItem(frontBoardOneClickTest);
//handler->sendDevInfoItem(); break;
}
else if (isBackBoardOrAllBoard) {
handler->sendNextItem(backBoardOneClickTest);
break; break;
} }
} }
@ -1339,7 +1411,7 @@ void MainWidget::onSendFrontFuncItemClicked()
QPushButton* button = qobject_cast<QPushButton*>(sender()); QPushButton* button = qobject_cast<QPushButton*>(sender());
int itemIndex = button->property("frontBoardFuncConfig").toInt(); int itemIndex = button->property("frontBoardFuncConfig").toInt();
for (ClientHandler* handler : clients) { for (ClientHandler* handler : clients) {
if (handler->getClientId() == handler->controlClientId) { if ((isBackBoardOrAllBoard) || (handler->getClientId() == handler->controlClientId)) {
QString text = frontFuncConfigLineEdit->text(); QString text = frontFuncConfigLineEdit->text();
qDebug() << "Text in frontFuncConfigLineEdit:" << text; qDebug() << "Text in frontFuncConfigLineEdit:" << text;
handler->sendFrontFuncItem(itemIndex, text); handler->sendFrontFuncItem(itemIndex, text);
@ -1381,7 +1453,7 @@ void MainWidget::onSendFrontItemClicked()
QPushButton* button = qobject_cast<QPushButton*>(sender()); QPushButton* button = qobject_cast<QPushButton*>(sender());
int itemIndex = button->property("frontBoardTest").toInt(); int itemIndex = button->property("frontBoardTest").toInt();
for (ClientHandler* handler : clients) { for (ClientHandler* handler : clients) {
if (handler->getClientId() == handler->controlClientId) { if ((isBackBoardOrAllBoard) || (handler->getClientId() == handler->controlClientId)) {
handler->sendFrontItem(itemIndex); handler->sendFrontItem(itemIndex);
break; break;
} }
@ -1412,50 +1484,18 @@ void MainWidget::onSendBackItemClicked()
} }
} }
// 处理状态更新信号 void MainWidget::onStatusUpdated(const QString& client, bool success, const QJsonArray& jsonArray, int itemJsonIndex)
void MainWidget::onStatusUpdated(const QString& client, int itemIndex, int FuncItemIndex,
bool success, const QString& itemData, const QString& funcItemData,
const QJsonArray& jsonArray, int itemJsonIndex)
{ {
int clientId = -1; int clientId = -1;
QString label; QString label;
// 遍历所有的 ClientHandler找到匹配的 client
for (ClientHandler* handler : clients) { for (ClientHandler* handler : clients) {
if (handler->getClientAddress() == client) { if (handler->getClientAddress() == client) {
clientId = handler->getClientId(); clientId = handler->getClientId();
QString lable = handler->getCurrentItemLable(); QString lable = handler->getCurrentItemLable();
lable = handler->getCurrentFuncItemLable(); lable = handler->getCurrentFuncItemLable();
break; break;
} }
else }
{
//qDebug() << "" << __FUNCTION__ << "handler->getClientAddress() != client" ;
}
}
//qDebug() << "itemIndex :" << itemIndex;
//qDebug() << "FuncItemIndex:" << FuncItemIndex;
//if (itemIndex > 0) {
// QListWidgetItem* listItem = new QListWidgetItem(QString("device ID: %1 - Item %2: %3 ---> %4")
// .arg(clientId)
// .arg(itemIndex)
// .arg(itemData) // data 字段
// .arg(success ? "OK" : "NG"), statusListWidget);
// listItem->setBackground(success ? Qt::green : Qt::red);
// statusListWidget->addItem(listItem);
//}
//else if (FuncItemIndex > 0) {
// QListWidgetItem* listItem = new QListWidgetItem(QString("device ID: %1 - funcItem %2: %3 ---> %4")
// .arg(clientId)
// .arg(FuncItemIndex)
// .arg(funcItemData) // data 字段
// .arg(success ? "OK" : "NG"), statusListWidget);
// listItem->setBackground(success ? Qt::green : Qt::red);
// statusListWidget->addItem(listItem);
//}
qDebug() << "itemJsonIndex :" << itemJsonIndex; qDebug() << "itemJsonIndex :" << itemJsonIndex;
if (itemJsonIndex >= 0 && itemJsonIndex < jsonArray.size()) { if (itemJsonIndex >= 0 && itemJsonIndex < jsonArray.size()) {
QJsonObject jsonObject = jsonArray.at(itemJsonIndex).toObject(); QJsonObject jsonObject = jsonArray.at(itemJsonIndex).toObject();
@ -1467,7 +1507,7 @@ void MainWidget::onStatusUpdated(const QString& client, int itemIndex, int FuncI
QListWidgetItem* listItem = new QListWidgetItem(QString("device ID: %1 - Item %2: %3 ---> %4") QListWidgetItem* listItem = new QListWidgetItem(QString("device ID: %1 - Item %2: %3 ---> %4")
.arg(clientId) .arg(clientId)
.arg(itemJsonIndex + 1) .arg(itemJsonIndex + 1)
.arg(label) // data 字段 .arg(label)
.arg(success ? "OK" : "NG"), statusListWidget); .arg(success ? "OK" : "NG"), statusListWidget);
listItem->setBackground(success ? Qt::green : Qt::red); listItem->setBackground(success ? Qt::green : Qt::red);
statusListWidget->addItem(listItem); statusListWidget->addItem(listItem);
@ -1504,3 +1544,12 @@ void MainWidget::onAllItemsProcessed(const QString& client, int itemsProcessedCo
statusListWidget->scrollToBottom(); statusListWidget->scrollToBottom();
} }
void MainWidget::onHandleInvalidOperate(const QString& text)
{
QListWidgetItem* listItem = new QListWidgetItem(QString("%1")
.arg(text), statusListWidget);
listItem->setBackground(Qt::red);
statusListWidget->addItem(listItem);
statusListWidget->scrollToBottom();
}

View File

@ -44,6 +44,7 @@
#include <QMessageAuthenticationCode> #include <QMessageAuthenticationCode>
#include <QCoreApplication> #include <QCoreApplication>
#include "./UI_Widget/UI_Name.h"
#include "../Json/readJsonFile.h" #include "../Json/readJsonFile.h"
#include "../RecvDataHandler/RecvDataHandler.h" #include "../RecvDataHandler/RecvDataHandler.h"
#include "../LicenseGenerate/LicenseGenerate.h" #include "../LicenseGenerate/LicenseGenerate.h"
@ -64,6 +65,9 @@
#define START_MDNS 1 #define START_MDNS 1
#define FOCUS_WINDOWS_BUTTON 4 // 大窗口播放视频的按键编号 #define FOCUS_WINDOWS_BUTTON 4 // 大窗口播放视频的按键编号
#define TCP_CONNECT_PORT 12412 // TCP监听的端口 #define TCP_CONNECT_PORT 12412 // TCP监听的端口
#define GET_PIC_DATA_SIZE (480 * 640 * 1.5)
#define NEW_MAP 1
class MainWidget : public QWidget class MainWidget : public QWidget
{ {
@ -105,9 +109,7 @@ private slots:
// 处理数据接收信号 // 处理数据接收信号
//void onDataReceived(const QString& client, const QByteArray& data); //void onDataReceived(const QString& client, const QByteArray& data);
// 处理状态更新信号 // 处理状态更新信号
void onStatusUpdated(const QString& client, int itemIndex, int funcItemIndex, void onStatusUpdated(const QString& client, bool success, const QJsonArray& jsonArray, int itemJsonIndex);
bool success, const QString& itemData, const QString& funcItemData,
const QJsonArray& jsonArray, int itemJsonIndex);
// 处理所有项目处理完毕信号 // 处理所有项目处理完毕信号
void onAllItemsProcessed(const QString& client, int itemsProcessedCount); void onAllItemsProcessed(const QString& client, int itemsProcessedCount);
// 处理客户端断开连接 // 处理客户端断开连接
@ -138,18 +140,34 @@ private:
void readJsonConfig(); void readJsonConfig();
// 设置 UI // 设置 UI
void setupUI(); void setupUI();
#if NEW_MAP
void addDeviceAreaTab(QTabWidget* mainTabWidget, const QString& tabName,
QGroupBox* deviceInfoGroupBox, QGroupBox* licenseGroupBox,
const QJsonArray& boardTest, const QJsonArray& boardFuncConfig,
const QString& boardTestName, const QString& boardFuncConfigName,
const QString& boardTestTitle, const QString& boardConfigTitle,
QLabel* leftLensLabel, QLabel* rightLensLabel, QLabel* videoLabel,
QLineEdit* VideoResolutionEdit_type);
void addAllDeviceAreaTab(QTabWidget* mainTabWidget, const QString& tabName,
QLabel* leftLensLabel, QLabel* rightLensLabel, QLabel* videoLabel,
QLineEdit* VideoResolutionEdit_type);
QTabWidget* createMediaTabWidget(QLabel* leftLensLabel, QLabel* rightLensLabel, QLabel* videoLabel,
QLineEdit* VideoResolutionEdit_type, const QString& tabName);
#endif
QGroupBox* createLicenseGroupBox(); QGroupBox* createLicenseGroupBox();
QGroupBox* createFrontDeviceInfoGroupBox(); QGroupBox* createFrontDeviceInfoGroupBox();
QGroupBox* createBackDeviceInfoGroupBox(); QGroupBox* createBackDeviceInfoGroupBox();
QWidget* createFunctionTestTab(const QJsonArray& BoardFuncTest, const QString& propertyName); QWidget* createFunctionTestTab(const QJsonArray& BoardFuncTest, const QString& propertyName);
QWidget* createFunctionConfigTab(const QJsonArray& BoardFuncConfig, const QString& propertyName); QWidget* createFunctionConfigTab(const QJsonArray& BoardFuncConfig, const QString& propertyName);
QWidget* createImageDisplayTab(); QWidget* createImageDisplayTab(QLabel* leftLensLabel, QLabel* rightLensLabel);
QWidget* createVideoDisplayTab(); QWidget* createVideoDisplayTab(QLabel* videoLabel, QLineEdit* VideoResolutionEdit_type, const QString& tabName);
QGroupBox* createBackConnectServerGroupBox(); QGroupBox* createBackConnectServerGroupBox();
// 保存日志到文件 // 保存日志到文件
void saveStatusListToFile(const QString& filePath); void saveStatusListToFile(const QString& filePath);
// 用于更新按键文本的函数 // 用于更新按键文本的函数
void updateServerButtonText(); void updateServerButtonText();
void onHandleInvalidOperate(const QString& text);
void onDisconnectClient(int clientId); void onDisconnectClient(int clientId);
void setupTimerForThreadPoolInfo(); void setupTimerForThreadPoolInfo();
void sendDataToClient(int clientId, const QByteArray& data); void sendDataToClient(int clientId, const QByteArray& data);
@ -172,6 +190,7 @@ private:
QJsonArray backBoardFuncConfig; // 后板功能配置参数 JSON QJsonArray backBoardFuncConfig; // 后板功能配置参数 JSON
QJsonArray backBoardDevInfoJson; // 后板设备信息参数 JSON QJsonArray backBoardDevInfoJson; // 后板设备信息参数 JSON
QJsonArray backBoardUuidJson; // 后板UUID JSON QJsonArray backBoardUuidJson; // 后板UUID JSON
QJsonArray factoryProductInfo; // 整机:工厂生产信息
QJsonArray testJsonConfig; // 功能测试区 JSON 配置 QJsonArray testJsonConfig; // 功能测试区 JSON 配置
QJsonArray funcJsonConfig; // 功能配置区 JSON 配置 QJsonArray funcJsonConfig; // 功能配置区 JSON 配置
QJsonArray getDevInfoJson; // 获取设备信息 JSON 配置 QJsonArray getDevInfoJson; // 获取设备信息 JSON 配置
@ -199,19 +218,30 @@ private:
QVector<QPushButton*> funcItemButtons; // 功能配置项目按键集合 QVector<QPushButton*> funcItemButtons; // 功能配置项目按键集合
QVector<QPushButton*> getPicButtons; // 保存两个取图的摄像头的按键的指针 QVector<QPushButton*> getPicButtons; // 保存两个取图的摄像头的按键的指针
QVector<QPushButton*> getVideoButtons; // 保存拉视频设备的按键的指针 QVector<QPushButton*> getVideoButtons; // 保存拉视频设备的按键的指针
QVector<QPushButton*> getBackVideoButtons;
QVector<QPushButton*> getAllVideoButtons;
QList<ClientHandler*> clients; // 客户端处理器集合 QList<ClientHandler*> clients; // 客户端处理器集合
QMap<int, QTimer*> clientTimers; // 每个客户端的定时器 QMap<int, QTimer*> clientTimers; // 每个客户端的定时器
QMap<QString, QLineEdit*> devInfoLineEdits;// msg_id 和对应的 QLineEdit 的映射关系 QMap<QString, QLineEdit*> devInfoLineEdits;// msg_id 和对应的 QLineEdit 的映射关系
QMap<QString, QLineEdit*> productInfoLineEdits;
QCheckBox* saveCheckBox; // 保存文件复选框 QCheckBox* saveCheckBox; // 保存文件复选框
QPushButton* selectFileButton; // Save Log 按键 QPushButton* selectFileButton; // Save Log 按键
QPushButton* clearLogButton; // clear Log 按键 QPushButton* clearLogButton; // clear Log 按键
QLineEdit* filePathLineEdit; // 文件路径显示 QLineEdit* filePathLineEdit; // 文件路径显示
QLineEdit* VideoResolutionEdit; // 视频分辨率显示 QLineEdit* VideoResolutionEdit; // 视频分辨率显示
QLineEdit* VideoResolutionEdit_back; // 视频分辨率显示
QLineEdit* VideoResolutionEdit_all; // 视频分辨率显示
//QLineEdit* frameRateEdit; // 视频帧率显示 //QLineEdit* frameRateEdit; // 视频帧率显示
QLabel* leftLens_imageLabel; // 左边镜头图像显示 QLabel* leftLens_imageLabel; // 前板左边镜头图像显示
QLabel* rightLens_imageLabel; // 右边镜头图像显示 QLabel* rightLens_imageLabel; // 前板右边镜头图像显示
QLabel* videoLabel; // 视频显示 QLabel* leftLens_imageLabel_back; // 后板左边镜头图像显示
QLabel* rightLens_imageLabel_back; // 后板右边镜头图像显示
QLabel* leftLens_imageLabel_all; // 整机左边镜头图像显示
QLabel* rightLens_imageLabel_all; // 整机右边镜头图像显示
QLabel* videoLabel; // 前板视频显示
QLabel* video_Label_back; // 后板视频显示
QLabel* video_Label_all; // 整机视频显示
QLineEdit* frontFuncConfigLineEdit; // 前板功能配置编辑框 QLineEdit* frontFuncConfigLineEdit; // 前板功能配置编辑框
QLineEdit* backFuncConfigLineEdit; // 后板功能配置编辑框 QLineEdit* backFuncConfigLineEdit; // 后板功能配置编辑框
QTextEdit* licenseHwInfoEdit; // 获取license的硬件信息 QTextEdit* licenseHwInfoEdit; // 获取license的硬件信息

View File

@ -0,0 +1,42 @@
// UI_Name.h
#ifndef UI_NAME_H
#define UI_NAME_H
#define SL100_FACTORY_TOOL_W 1340
#define SL100_FACTORY_TOOL_H 900
#define START_LISTENING "开始监听\n(Start Listening...)"
#define ONE_CLICKED_TEST "一键功能测试"
#define TOOL_VERSION "SL100 工厂产测工具 - V0.0.7"
#define FRONT_BOARD_NAME "前 板"
#define BACK_BOARD_NAME "后 板"
#define ALL_BOARD_NAME "整 机"
#define FRONT_BOARD_TEST "前板测试项"
#define IMAGE_DISPLAYAREA "图像显示区"
#define VIDEO_DISPLAYAREA "视频显示区"
#define RESOLUTION_EDIT "分辨率:"
#define LEFT_LENS "左边镜头"
#define RIGHT_LENS "右边镜头"
#define CAT_EYE_LENS_RGB "猫眼镜头(RGB)"
#define CAT_EYE_LENS_IR "猫眼镜头(IR)"
#define BIG_WINDOW_PRE_VIDEO "大窗口播放视频"
#define IMAGE_DISPLAY_TAB "图像显示区"
#define VIDEO_DISPLAY_TAB "视频显示区"
#define INPUT_CONFIG_PARA "请输入配置参数..."
#define FRONT_TEST_ITEM "前板测试项"
#define FRONT_CONFID_ITEM "前板配置项"
#define FRONT_DEVICE_INFO "前板设备信息"
#define FRONT_TUYU_LICENSE "算法 license"
#define BACK_TEST_ITEM "后板测试项"
#define BACK_CONFID_ITEM "后板配置项"
#define BACK_GET_UUID_SN "后板获取 UUID/SN"
#define BACK_DEVICE_INFO "后板设备信息"
#define ALL_BOARD "整机设备信息"
#define ALL_PRODUCT_INFO "工厂生产信息"
#define FRONT_BOARD_VIDEO_BUTTON_INDEX_PROPERTY "getVideoIndex"
#define BACK_BOARD_VIDEO_BUTTON_INDEX_PROPERTY "BackGetVideoIndex"
#define ALL_BOARD_VIDEO_BUTTON_INDEX_PROPERTY "AllGetVideoIndex"
#endif

View File

@ -2,7 +2,7 @@
QGroupBox* MainWidget::createLicenseGroupBox() QGroupBox* MainWidget::createLicenseGroupBox()
{ {
QGroupBox* groupBox = new QGroupBox("算法 license", this); QGroupBox* groupBox = new QGroupBox(QString(FRONT_TUYU_LICENSE), this);
QHBoxLayout* buttonRowLayout = new QHBoxLayout; QHBoxLayout* buttonRowLayout = new QHBoxLayout;
for (int i = 0; i < frontBoardLicenseJson.size(); ++i) { for (int i = 0; i < frontBoardLicenseJson.size(); ++i) {
@ -29,9 +29,8 @@ QGroupBox* MainWidget::createLicenseGroupBox()
QGroupBox* MainWidget::createFrontDeviceInfoGroupBox() QGroupBox* MainWidget::createFrontDeviceInfoGroupBox()
{ {
QGroupBox* frontDeviceInfoGroupBox = new QGroupBox("前板设备信息", this); QGroupBox* frontDeviceInfoGroupBox = new QGroupBox(QString(FRONT_DEVICE_INFO), this);
QFormLayout* formLayout = new QFormLayout(frontDeviceInfoGroupBox); QFormLayout* formLayout = new QFormLayout(frontDeviceInfoGroupBox);
for (const QJsonValue& value : frontBoardDevInfoJson) { for (const QJsonValue& value : frontBoardDevInfoJson) {
QJsonObject item = value.toObject(); QJsonObject item = value.toObject();
QString label = item["lable"].toString(); QString label = item["lable"].toString();
@ -43,19 +42,17 @@ QGroupBox* MainWidget::createFrontDeviceInfoGroupBox()
formLayout->addRow(itemLabel, itemLineEdit); formLayout->addRow(itemLabel, itemLineEdit);
devInfoLineEdits[cmd] = itemLineEdit; devInfoLineEdits[cmd] = itemLineEdit;
} }
return frontDeviceInfoGroupBox; return frontDeviceInfoGroupBox;
} }
QGroupBox* MainWidget::createBackDeviceInfoGroupBox() QGroupBox* MainWidget::createBackDeviceInfoGroupBox()
{ {
QGroupBox* backDeviceInfoGroupBox = new QGroupBox("后板设备信息", this); QGroupBox* backDeviceInfoGroupBox = new QGroupBox(QString(BACK_DEVICE_INFO), this);
QFormLayout* formLayout = new QFormLayout(backDeviceInfoGroupBox); QFormLayout* formLayout = new QFormLayout(backDeviceInfoGroupBox);
for (const QJsonValue& value : backBoardDevInfoJson) { for (const QJsonValue& value : backBoardDevInfoJson) {
QJsonObject item = value.toObject(); QJsonObject item = value.toObject();
QString label = item["lable"].toString(); QString label = item["lable"].toString();
QString cmd = item["cmd"].toString(); QString cmd = item["cmd"].toString();
QLabel* itemLabel = new QLabel(label, this); QLabel* itemLabel = new QLabel(label, this);
QLineEdit* itemLineEdit = new QLineEdit(this); QLineEdit* itemLineEdit = new QLineEdit(this);
itemLineEdit->setReadOnly(true); itemLineEdit->setReadOnly(true);
@ -63,13 +60,12 @@ QGroupBox* MainWidget::createBackDeviceInfoGroupBox()
formLayout->addRow(itemLabel, itemLineEdit); formLayout->addRow(itemLabel, itemLineEdit);
devInfoLineEdits[cmd] = itemLineEdit; devInfoLineEdits[cmd] = itemLineEdit;
} }
return backDeviceInfoGroupBox; return backDeviceInfoGroupBox;
} }
QGroupBox* MainWidget::createBackConnectServerGroupBox() QGroupBox* MainWidget::createBackConnectServerGroupBox()
{ {
QGroupBox* BackConnectServerGroupBox = new QGroupBox("后板获取UUID", this); QGroupBox* BackConnectServerGroupBox = new QGroupBox(QString(BACK_GET_UUID_SN), this);
QHBoxLayout* frontDeviceInfoLayout = new QHBoxLayout; QHBoxLayout* frontDeviceInfoLayout = new QHBoxLayout;
for (int i = 0; i < backBoardUuidJson.size(); ++i) { for (int i = 0; i < backBoardUuidJson.size(); ++i) {
@ -141,11 +137,11 @@ QWidget* MainWidget::createFunctionConfigTab(const QJsonArray& BoardFuncConfig,
QWidget* functionConfigTab = new QWidget(this); QWidget* functionConfigTab = new QWidget(this);
QVBoxLayout* functionConfigLayout = new QVBoxLayout(functionConfigTab); QVBoxLayout* functionConfigLayout = new QVBoxLayout(functionConfigTab);
if (propertyName == "frontBoardFuncConfig") { if (propertyName == "frontBoardFuncConfig") {
frontFuncConfigLineEdit->setPlaceholderText("请输入配置参数..."); frontFuncConfigLineEdit->setPlaceholderText(QString(INPUT_CONFIG_PARA));
functionConfigLayout->addWidget(frontFuncConfigLineEdit); functionConfigLayout->addWidget(frontFuncConfigLineEdit);
} }
else if (propertyName == "backBoardFuncConfig") { else if (propertyName == "backBoardFuncConfig") {
backFuncConfigLineEdit->setPlaceholderText("请输入配置参数..."); backFuncConfigLineEdit->setPlaceholderText(QString(INPUT_CONFIG_PARA));
functionConfigLayout->addWidget(backFuncConfigLineEdit); functionConfigLayout->addWidget(backFuncConfigLineEdit);
} }
@ -186,7 +182,7 @@ QWidget* MainWidget::createFunctionConfigTab(const QJsonArray& BoardFuncConfig,
return functionConfigTab; return functionConfigTab;
} }
QWidget* MainWidget::createImageDisplayTab() QWidget* MainWidget::createImageDisplayTab(QLabel* leftLensLabel, QLabel* rightLensLabel)
{ {
QWidget* imageDisplayTab = new QWidget(this); QWidget* imageDisplayTab = new QWidget(this);
QVBoxLayout* imageDisplayLayout = new QVBoxLayout(imageDisplayTab); QVBoxLayout* imageDisplayLayout = new QVBoxLayout(imageDisplayTab);
@ -197,7 +193,7 @@ QWidget* MainWidget::createImageDisplayTab()
for (int j = 0; j < 2; ++j) { for (int j = 0; j < 2; ++j) {
QPushButton* button; QPushButton* button;
if (i == 0 && j == 0) { if (i == 0 && j == 0) {
button = new QPushButton(QString("IR"), this); button = new QPushButton(QString(LEFT_LENS), this);
button->setFixedSize(73, 50); button->setFixedSize(73, 50);
imageButtonsRowLayout->addWidget(button); imageButtonsRowLayout->addWidget(button);
button->setProperty("getPicIndex", i * 2 + j); button->setProperty("getPicIndex", i * 2 + j);
@ -206,7 +202,7 @@ QWidget* MainWidget::createImageDisplayTab()
continue; continue;
} }
else if (i == 0 && j == 1) { else if (i == 0 && j == 1) {
button = new QPushButton(QString("RGB"), this); button = new QPushButton(QString(RIGHT_LENS), this);
button->setFixedSize(73, 50); button->setFixedSize(73, 50);
imageButtonsRowLayout->addWidget(button); imageButtonsRowLayout->addWidget(button);
button->setProperty("getPicIndex", i * 2 + j); button->setProperty("getPicIndex", i * 2 + j);
@ -215,7 +211,7 @@ QWidget* MainWidget::createImageDisplayTab()
continue; continue;
} }
button = new QPushButton(QString("Device %1").arg(i * 2 + j - 1), this); button = new QPushButton(QString("Device %1\n取图").arg(i * 2 + j - 1), this);
button->setFixedSize(73, 50); button->setFixedSize(73, 50);
imageButtonsRowLayout->addWidget(button); imageButtonsRowLayout->addWidget(button);
button->setProperty("getPicIndex", i * 2 + j); button->setProperty("getPicIndex", i * 2 + j);
@ -226,10 +222,12 @@ QWidget* MainWidget::createImageDisplayTab()
} }
QHBoxLayout* lensesLayout = new QHBoxLayout; QHBoxLayout* lensesLayout = new QHBoxLayout;
leftLens_imageLabel = new QLabel(this); //leftLens_imageLabel = new QLabel(this);
rightLens_imageLabel = new QLabel(this); //rightLens_imageLabel = new QLabel(this);
lensesLayout->addWidget(leftLens_imageLabel); //lensesLayout->addWidget(leftLens_imageLabel);
lensesLayout->addWidget(rightLens_imageLabel); //lensesLayout->addWidget(rightLens_imageLabel);
lensesLayout->addWidget(leftLensLabel);
lensesLayout->addWidget(rightLensLabel);
QHBoxLayout* imageAndButtonsLayout = new QHBoxLayout; QHBoxLayout* imageAndButtonsLayout = new QHBoxLayout;
imageAndButtonsLayout->addLayout(imageButtonsColumnLayout, 1); imageAndButtonsLayout->addLayout(imageButtonsColumnLayout, 1);
@ -239,12 +237,23 @@ QWidget* MainWidget::createImageDisplayTab()
return imageDisplayTab; return imageDisplayTab;
} }
QWidget* MainWidget::createVideoDisplayTab() QWidget* MainWidget::createVideoDisplayTab(QLabel* video_Label, QLineEdit* VideoResolutionEdit_type, const QString& tabName)
{ {
QWidget* videoDisplayTab = new QWidget(this); QWidget* videoDisplayTab = new QWidget(this);
QVBoxLayout* videoDisplayLayout = new QVBoxLayout(videoDisplayTab); QVBoxLayout* videoDisplayLayout = new QVBoxLayout(videoDisplayTab);
QVBoxLayout* videoButtonsColumnLayout = new QVBoxLayout; QVBoxLayout* videoButtonsColumnLayout = new QVBoxLayout;
const char* videoIndexProperty;
if (tabName == QString(FRONT_BOARD_NAME)) {
videoIndexProperty = FRONT_BOARD_VIDEO_BUTTON_INDEX_PROPERTY;
}
else if (tabName == QString(BACK_BOARD_NAME)) {
videoIndexProperty = BACK_BOARD_VIDEO_BUTTON_INDEX_PROPERTY;
}
else if(tabName == QString(ALL_BOARD_NAME)) {
videoIndexProperty = ALL_BOARD_VIDEO_BUTTON_INDEX_PROPERTY;
}
for (int i = 0; i < 6; ++i) { for (int i = 0; i < 6; ++i) {
QHBoxLayout* videoButtonsRowLayout = new QHBoxLayout; QHBoxLayout* videoButtonsRowLayout = new QHBoxLayout;
@ -252,52 +261,92 @@ QWidget* MainWidget::createVideoDisplayTab()
QPushButton* button; QPushButton* button;
if (i == 0 && j == 0) { if (i == 0 && j == 0) {
button = new QPushButton(QString("猫眼镜头(IR)"), this); button = new QPushButton(QString(CAT_EYE_LENS_IR), this);
button->setFixedSize(110, 50); button->setFixedSize(110, 50);
videoButtonsRowLayout->addWidget(button); videoButtonsRowLayout->addWidget(button);
button->setProperty("getVideoIndex", i * 2 + j); button->setProperty(videoIndexProperty, i * 2 + j);
connect(button, &QPushButton::clicked, this, &MainWidget::onSendGetVideoClicked); connect(button, &QPushButton::clicked, this, &MainWidget::onSendGetVideoClicked);
getVideoButtons.append(button); if (tabName == QString(FRONT_BOARD_NAME)) {
getVideoButtons.append(button);
}
else if (tabName == QString(BACK_BOARD_NAME)) {
getBackVideoButtons.append(button);
}
else if (tabName == QString(ALL_BOARD_NAME)) {
getAllVideoButtons.append(button);
}
continue; continue;
} }
else if (i == 0 && j == 1) { else if (i == 0 && j == 1) {
button = new QPushButton(QString("猫眼镜头(RGB)"), this); button = new QPushButton(QString(CAT_EYE_LENS_RGB), this);
button->setFixedSize(110, 50); button->setFixedSize(110, 50);
videoButtonsRowLayout->addWidget(button); videoButtonsRowLayout->addWidget(button);
button->setProperty("getVideoIndex", i * 2 + j); button->setProperty(videoIndexProperty, i * 2 + j);
connect(button, &QPushButton::clicked, this, &MainWidget::onSendGetVideoClicked); connect(button, &QPushButton::clicked, this, &MainWidget::onSendGetVideoClicked);
getVideoButtons.append(button); if (tabName == QString(FRONT_BOARD_NAME)) {
getVideoButtons.append(button);
}
else if (tabName == QString(BACK_BOARD_NAME)) {
getBackVideoButtons.append(button);
}
else if (tabName == QString(ALL_BOARD_NAME)) {
getAllVideoButtons.append(button);
}
continue; continue;
} }
if (tabName != QString(BACK_BOARD_NAME)) {
if (i == 1 && j == 0) { if (i == 1 && j == 0) {
button = new QPushButton(QString("左边镜头"), this); button = new QPushButton(QString(LEFT_LENS), this);
button->setFixedSize(110, 50); button->setFixedSize(110, 50);
videoButtonsRowLayout->addWidget(button); videoButtonsRowLayout->addWidget(button);
button->setProperty("getVideoIndex", i * 2 + j); button->setProperty(videoIndexProperty, i * 2 + j);
connect(button, &QPushButton::clicked, this, &MainWidget::onSendGetVideoClicked); connect(button, &QPushButton::clicked, this, &MainWidget::onSendGetVideoClicked);
getVideoButtons.append(button); if (tabName == QString(FRONT_BOARD_NAME)) {
continue; getVideoButtons.append(button);
}
else if (tabName == QString(BACK_BOARD_NAME)) {
getBackVideoButtons.append(button);
}
else if (tabName == QString(ALL_BOARD_NAME)) {
getAllVideoButtons.append(button);
}
continue;
}
else if (i == 1 && j == 1) {
button = new QPushButton(QString(RIGHT_LENS), this);
button->setFixedSize(110, 50);
videoButtonsRowLayout->addWidget(button);
button->setProperty(videoIndexProperty, i * 2 + j);
connect(button, &QPushButton::clicked, this, &MainWidget::onSendGetVideoClicked);
if (tabName == QString(FRONT_BOARD_NAME)) {
getVideoButtons.append(button);
}
else if (tabName == QString(BACK_BOARD_NAME)) {
getBackVideoButtons.append(button);
}
else if (tabName == QString(ALL_BOARD_NAME)) {
getAllVideoButtons.append(button);
}
continue;
}
} }
else if (i == 1 && j == 1) {
button = new QPushButton(QString("右边镜头"), this);
button->setFixedSize(110, 50);
videoButtonsRowLayout->addWidget(button);
button->setProperty("getVideoIndex", i * 2 + j);
connect(button, &QPushButton::clicked, this, &MainWidget::onSendGetVideoClicked);
getVideoButtons.append(button);
continue;
}
if (i == 2 && j == 0) { if (i == 2 && j == 0) {
button = new QPushButton(QString("大窗口播放视频"), this); button = new QPushButton(QString(BIG_WINDOW_PRE_VIDEO), this);
button->setFixedSize(224, 50); button->setFixedSize(224, 50);
button->setEnabled(false); button->setEnabled(false);
videoButtonsRowLayout->addWidget(button); videoButtonsRowLayout->addWidget(button);
button->setProperty("getVideoIndex", i * 2 + j); button->setProperty(videoIndexProperty, i * 2 + j);
connect(button, &QPushButton::clicked, this, &MainWidget::onOpenFocusWindowClicked); connect(button, &QPushButton::clicked, this, &MainWidget::onOpenFocusWindowClicked);
getVideoButtons.append(button); if (tabName == QString(FRONT_BOARD_NAME)) {
break; // 跳出内层循环,只添加一个按键 getVideoButtons.append(button);
}
else if (tabName == QString(BACK_BOARD_NAME)) {
getBackVideoButtons.append(button);
}
else if (tabName == QString(ALL_BOARD_NAME)) {
getAllVideoButtons.append(button);
}
break;
} }
if (i >= 3 && i <= 5) { if (i >= 3 && i <= 5) {
@ -312,28 +361,30 @@ QWidget* MainWidget::createVideoDisplayTab()
button->setFixedSize(110, 50); button->setFixedSize(110, 50);
videoButtonsRowLayout->addWidget(button); videoButtonsRowLayout->addWidget(button);
button->setProperty("getVideoIndex", i * 2 + j + 1); button->setProperty(videoIndexProperty, i * 2 + j + 1);
connect(button, &QPushButton::clicked, this, &MainWidget::onSendGetVideoClicked); connect(button, &QPushButton::clicked, this, &MainWidget::onSendGetVideoClicked);
getVideoButtons.append(button); if (tabName == QString(FRONT_BOARD_NAME)) {
getVideoButtons.append(button);
}
else if (tabName == QString(BACK_BOARD_NAME)) {
getBackVideoButtons.append(button);
}
else if (tabName == QString(ALL_BOARD_NAME)) {
getAllVideoButtons.append(button);
}
} }
videoButtonsColumnLayout->addLayout(videoButtonsRowLayout); videoButtonsColumnLayout->addLayout(videoButtonsRowLayout);
} }
QHBoxLayout* videoAndButtonsLayout = new QHBoxLayout; QHBoxLayout* videoAndButtonsLayout = new QHBoxLayout;
QFormLayout* formLayout = new QFormLayout; QFormLayout* formLayout = new QFormLayout;
QLabel* VideoResolution = new QLabel("分辨率:"); QLabel* VideoResolution = new QLabel(QString(RESOLUTION_EDIT));
VideoResolutionEdit = new QLineEdit; VideoResolutionEdit_type->setFixedWidth(120);
VideoResolutionEdit->setFixedWidth(120); formLayout->addRow(VideoResolution, VideoResolutionEdit_type);
formLayout->addRow(VideoResolution, VideoResolutionEdit); video_Label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
/*QLabel* frameRate = new QLabel("帧率:");
frameRateEdit = new QLineEdit;
frameRateEdit->setFixedWidth(120);
formLayout->addRow(frameRate, frameRateEdit);*/
videoLabel = new QLabel(this);
videoLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
videoAndButtonsLayout->addLayout(videoButtonsColumnLayout); videoAndButtonsLayout->addLayout(videoButtonsColumnLayout);
videoAndButtonsLayout->addLayout(formLayout); videoAndButtonsLayout->addLayout(formLayout);
videoAndButtonsLayout->addWidget(videoLabel); videoAndButtonsLayout->addWidget(video_Label);
videoAndButtonsLayout->setStretch(0, 1); videoAndButtonsLayout->setStretch(0, 1);
videoAndButtonsLayout->setStretch(1, 1); videoAndButtonsLayout->setStretch(1, 1);
videoAndButtonsLayout->setStretch(2, 1); videoAndButtonsLayout->setStretch(2, 1);
@ -342,4 +393,79 @@ QWidget* MainWidget::createVideoDisplayTab()
return videoDisplayTab; return videoDisplayTab;
} }
// 创建设备区域布局(前板或后板)
void MainWidget::addDeviceAreaTab(QTabWidget* mainTabWidget, const QString& tabName,
QGroupBox* deviceInfoGroupBox, QGroupBox* licenseGroupBox,
const QJsonArray& boardTest, const QJsonArray& boardFuncConfig,
const QString& boardTestName, const QString& boardFuncConfigName,
const QString& boardTestTitle, const QString& boardConfigTitle,
QLabel* leftLensLabel, QLabel* rightLensLabel, QLabel* video_Label,
QLineEdit* VideoResolutionEdit_type)
{
QHBoxLayout* groupBoxLayout = new QHBoxLayout;
groupBoxLayout->addWidget(deviceInfoGroupBox, 1);
groupBoxLayout->addWidget(licenseGroupBox, 1);
QTabWidget* boardTabWidget = new QTabWidget(this);
boardTabWidget->setFixedSize(900, 315);
QWidget* functionTestTab = createFunctionTestTab(boardTest, boardTestName);
QWidget* functionConfigTab = createFunctionConfigTab(boardFuncConfig, boardFuncConfigName);
boardTabWidget->addTab(functionTestTab, boardTestTitle);
boardTabWidget->addTab(functionConfigTab, boardConfigTitle);
QTabWidget* mediaTabWidget = createMediaTabWidget(leftLensLabel, rightLensLabel, video_Label, VideoResolutionEdit_type, tabName);
QWidget* devAreaTab = new QWidget(this);
QVBoxLayout* devLayout = new QVBoxLayout(devAreaTab);
devLayout->addLayout(groupBoxLayout);
devLayout->addWidget(boardTabWidget, 2, Qt::AlignTop | Qt::AlignLeft);
devLayout->addWidget(mediaTabWidget, 3);
mainTabWidget->addTab(devAreaTab, tabName);
}
// 创建整机区域布局
void MainWidget::addAllDeviceAreaTab(QTabWidget* mainTabWidget, const QString& tabName,
QLabel* leftLensLabel, QLabel* rightLensLabel, QLabel* video_Label,
QLineEdit* VideoResolutionEdit_type)
{
QHBoxLayout* groupBoxLayout = new QHBoxLayout;
QGroupBox* allDeviceInfoGroupBox = new QGroupBox(QString(ALL_BOARD), this);
QGroupBox* allProductInfoGroupBox = new QGroupBox(QString(ALL_PRODUCT_INFO), this);
QFormLayout* formLayout = new QFormLayout(allProductInfoGroupBox);
for (const QJsonValue& value : factoryProductInfo) {
QJsonObject item = value.toObject();
QString label = item["lable"].toString();
QString cmd = item["cmd"].toString();
QLabel* itemLabel = new QLabel(label, this);
QLineEdit* itemLineEdit = new QLineEdit(this);
itemLineEdit->setReadOnly(false);
formLayout->addRow(itemLabel, itemLineEdit);
productInfoLineEdits[cmd] = itemLineEdit;
}
groupBoxLayout->addWidget(allProductInfoGroupBox, 1);
groupBoxLayout->addWidget(allDeviceInfoGroupBox, 1);
QTabWidget* mediaTabWidget = createMediaTabWidget(leftLensLabel, rightLensLabel, video_Label, VideoResolutionEdit_type, tabName);
QWidget* allDevAreaTab = new QWidget(this);
QVBoxLayout* allDevLayout = new QVBoxLayout(allDevAreaTab);
allDevLayout->addLayout(groupBoxLayout, 5);
allDevLayout->addWidget(mediaTabWidget, 3);
mainTabWidget->addTab(allDevAreaTab, tabName);
}
// 创建媒体显示区的 tabWidget
QTabWidget* MainWidget::createMediaTabWidget(QLabel* leftLensLabel, QLabel* rightLensLabel, QLabel* video_Label,
QLineEdit* VideoResolutionEdit_type, const QString& tabName)
{
QTabWidget* tabWidget_media = new QTabWidget(this);
if (tabName != QString(BACK_BOARD_NAME)){
QWidget* imageDisplayTab = createImageDisplayTab(leftLensLabel, rightLensLabel);
tabWidget_media->addTab(imageDisplayTab, IMAGE_DISPLAY_TAB);
}
QWidget* videoDisplayTab = createVideoDisplayTab(video_Label, VideoResolutionEdit_type, tabName);
tabWidget_media->addTab(videoDisplayTab, VIDEO_DISPLAY_TAB);
return tabWidget_media;
}

View File

@ -0,0 +1,34 @@
device ID: 1 - Item 2: 停止视频 ---> OK
device ID: 1 - Item 2: 停止视频 ---> OK
device ID: 1 - Item 2: 停止视频 ---> OK
device ID: 1 - Item 2: 停止视频 ---> OK
device ID: 1 - Item 1: 人脸单角度注册 ---> NG
device ID: 1 - Item 23: IR灯关 ---> OK
device ID: 1 - Item 24: 串口测试 ---> NG
device ID: 1 - Item 1: get_hw_info ---> OK
device ID: 1 - Item 1: 人脸单角度注册 ---> NG
device ID: 1 - Item 2: 人脸多角度注册 ---> NG
device ID: 1 - Item 3: 掌静脉注册 ---> NG
device ID: 1 - Item 4: 人脸识别 ---> NG
device ID: 1 - Item 5: 掌静脉识别 ---> NG
device ID: 1 - Item 6: 删除用户 ---> NG
device ID: 1 - Item 7: 删除所有用户 ---> NG
device ID: 1 - Item 8: 获取用户 ---> NG
device ID: 1 - Item 9: 获取所有用户 ---> NG
device ID: 1 - Item 10: 密码注册 ---> NG
device ID: 1 - Item 11: 图片注册 ---> NG
device ID: 1 - Item 12: 左边镜头取图 ---> OK
device ID: 1 - Item 13: 右边镜头取图 ---> OK
device ID: 1 - Item 14: 前触摸屏测试 ---> NG
device ID: 1 - Item 15: MIC测试 ---> NG
device ID: 1 - Item 16: SPK测试 ---> NG
device ID: 1 - Item 17: 雷达测试 ---> NG
device ID: 1 - Item 18: NFC测试 ---> NG
device ID: 1 - Item 19: 防撬开关 ---> NG
device ID: 1 - Item 20: 光敏测试 ---> NG
device ID: 1 - Item 21: 前屏背光测试 ---> NG
device ID: 1 - Item 22: IR灯开 ---> OK
device ID: 1 - Item 23: IR灯关 ---> OK
device ID: 1 - Item 24: 串口测试 ---> NG
device ID: 1 - Item 25: PIR测试 ---> NG
device ID:-1 ---> All 25 items test completed !!!

View File

@ -0,0 +1,18 @@
device ID: 1 - Item 1: V851测试SPK ---> NG
device ID: 1 - Item 2: 806测试SPK ---> NG
device ID: 1 - Item 3: MIC测试 ---> NG
device ID: 1 - Item 4: 开锁测试 ---> NG
device ID: 1 - Item 5: 关锁测试 ---> NG
device ID: 1 - Item 6: 开锁按键测试 ---> NG
device ID: 1 - Item 7: 关锁按键测试 ---> NG
device ID: 1 - Item 8: 猫眼按键测试 ---> NG
device ID: 1 - Item 9: 后屏背光测试 ---> NG
device ID: 1 - Item 10: 后触摸屏测试 ---> NG
device ID: 1 - Item 11: 开猫眼测试 ---> NG
device ID: 1 - Item 12: 串口测试 ---> NG
device ID: 1 - Item 13: 开启视频 ---> NG
device ID: 1 - Item 14: 关闭视频 ---> NG
device ID: 1 - Item 15: wifi信号测试 ---> NG
device ID: 1 - Item 16: 进入配网测试 ---> NG
device ID: 1 - Item 17: 联网测试 ---> NG
device ID:-1 ---> All 17 items test completed !!!

View File

@ -0,0 +1,26 @@
device ID: 1 - Item 1: 人脸单角度注册 ---> NG
device ID: 1 - Item 2: 人脸多角度注册 ---> NG
device ID: 1 - Item 3: 掌静脉注册 ---> NG
device ID: 1 - Item 4: 人脸识别 ---> NG
device ID: 1 - Item 5: 掌静脉识别 ---> NG
device ID: 1 - Item 6: 删除用户 ---> NG
device ID: 1 - Item 7: 删除所有用户 ---> NG
device ID: 1 - Item 8: 获取用户 ---> NG
device ID: 1 - Item 9: 获取所有用户 ---> NG
device ID: 1 - Item 10: 密码注册 ---> NG
device ID: 1 - Item 11: 图片注册 ---> NG
device ID: 1 - Item 12: 左边镜头取图 ---> OK
device ID: 1 - Item 13: 右边镜头取图 ---> OK
device ID: 1 - Item 14: 前触摸屏测试 ---> NG
device ID: 1 - Item 15: MIC测试 ---> NG
device ID: 1 - Item 16: SPK测试 ---> NG
device ID: 1 - Item 17: 雷达测试 ---> NG
device ID: 1 - Item 18: NFC测试 ---> NG
device ID: 1 - Item 19: 防撬开关 ---> NG
device ID: 1 - Item 20: 光敏测试 ---> NG
device ID: 1 - Item 21: 前屏背光测试 ---> NG
device ID: 1 - Item 22: IR灯开 ---> OK
device ID: 1 - Item 23: IR灯关 ---> OK
device ID: 1 - Item 24: 串口测试 ---> NG
device ID: 1 - Item 25: PIR测试 ---> NG
device ID:-1 ---> All 25 items test completed !!!

View File

@ -0,0 +1,26 @@
device ID: 1 - Item 1: 人脸单角度注册 ---> NG
device ID: 1 - Item 2: 人脸多角度注册 ---> NG
device ID: 1 - Item 3: 掌静脉注册 ---> NG
device ID: 1 - Item 4: 人脸识别 ---> NG
device ID: 1 - Item 5: 掌静脉识别 ---> NG
device ID: 1 - Item 6: 删除用户 ---> NG
device ID: 1 - Item 7: 删除所有用户 ---> NG
device ID: 1 - Item 8: 获取用户 ---> NG
device ID: 1 - Item 9: 获取所有用户 ---> NG
device ID: 1 - Item 10: 密码注册 ---> NG
device ID: 1 - Item 11: 图片注册 ---> NG
device ID: 1 - Item 12: 左边镜头取图 ---> OK
device ID: 1 - Item 13: 右边镜头取图 ---> OK
device ID: 1 - Item 14: 前触摸屏测试 ---> NG
device ID: 1 - Item 15: MIC测试 ---> NG
device ID: 1 - Item 16: SPK测试 ---> NG
device ID: 1 - Item 17: 雷达测试 ---> NG
device ID: 1 - Item 18: NFC测试 ---> NG
device ID: 1 - Item 19: 防撬开关 ---> NG
device ID: 1 - Item 20: 光敏测试 ---> NG
device ID: 1 - Item 21: 前屏背光测试 ---> NG
device ID: 1 - Item 22: IR灯开 ---> OK
device ID: 1 - Item 23: IR灯关 ---> OK
device ID: 1 - Item 24: 串口测试 ---> NG
device ID: 1 - Item 25: PIR测试 ---> NG
device ID:-1 ---> All 25 items test completed !!!

View File

@ -0,0 +1,6 @@
device ID: 1 - Item 1: 前板V851版本: ---> NG
device ID: 1 - Item 2: 前板MCU版本: ---> NG
device ID: 1 - Item 3: 前板硬件版本: ---> NG
device ID: 1 - Item 4: 算法版本: ---> NG
device ID: 1 - Item 5: SN号: ---> NG
device ID:-1 ---> All 5 items test completed !!!

View File

@ -0,0 +1,4 @@
device ID: 1 - Item 1: 后板V851版本: ---> NG
device ID: 1 - Item 2: 后板806版本: ---> NG
device ID: 1 - Item 3: 后板硬件版本: ---> NG
device ID:-1 ---> All 3 items test completed !!!

View File

@ -0,0 +1,4 @@
device ID: 1 - Item 1: 后板V851版本: ---> NG
device ID: 1 - Item 2: 后板806版本: ---> NG
device ID: 1 - Item 3: 后板硬件版本: ---> NG
device ID:-1 ---> All 3 items test completed !!!

View File

@ -0,0 +1,4 @@
device ID: 1 - Item 1: 后板V851版本: ---> NG
device ID: 1 - Item 2: 后板806版本: ---> NG
device ID: 1 - Item 3: 后板硬件版本: ---> NG
device ID:-1 ---> All 3 items test completed !!!

View File

@ -0,0 +1,6 @@
device ID: 1 - Item 1: 前板V851版本: ---> NG
device ID: 1 - Item 2: 前板MCU版本: ---> NG
device ID: 1 - Item 3: 前板硬件版本: ---> NG
device ID: 1 - Item 4: 算法版本: ---> NG
device ID: 1 - Item 5: SN号: ---> NG
device ID:-1 ---> All 5 items test completed !!!

View File

@ -0,0 +1,6 @@
device ID: 1 - Item 1: 前板V851版本: ---> NG
device ID: 1 - Item 2: 前板MCU版本: ---> NG
device ID: 1 - Item 3: 前板硬件版本: ---> NG
device ID: 1 - Item 4: 算法版本: ---> NG
device ID: 1 - Item 5: SN号: ---> NG
device ID:-1 ---> All 5 items test completed !!!

View File

@ -0,0 +1,6 @@
device ID: 1 - Item 1: 前板V851版本: ---> NG
device ID: 1 - Item 2: 前板MCU版本: ---> NG
device ID: 1 - Item 3: 前板硬件版本: ---> NG
device ID: 1 - Item 4: 算法版本: ---> NG
device ID: 1 - Item 5: SN号: ---> NG
device ID:-1 ---> All 5 items test completed !!!

View File

@ -0,0 +1,32 @@
device ID: 1 - Item 1: 前板V851版本: ---> NG
device ID: 1 - Item 2: 前板MCU版本: ---> NG
device ID: 1 - Item 3: 前板硬件版本: ---> NG
device ID: 1 - Item 4: 算法版本: ---> NG
device ID: 1 - Item 5: SN号: ---> NG
device ID:-1 ---> All 5 items test completed !!!
device ID: 1 - Item 1: 人脸单角度注册 ---> NG
device ID: 1 - Item 2: 人脸多角度注册 ---> NG
device ID: 1 - Item 3: 掌静脉注册 ---> NG
device ID: 1 - Item 4: 人脸识别 ---> NG
device ID: 1 - Item 5: 掌静脉识别 ---> NG
device ID: 1 - Item 6: 删除用户 ---> NG
device ID: 1 - Item 7: 删除所有用户 ---> NG
device ID: 1 - Item 8: 获取用户 ---> NG
device ID: 1 - Item 9: 获取所有用户 ---> NG
device ID: 1 - Item 10: 密码注册 ---> NG
device ID: 1 - Item 11: 图片注册 ---> NG
device ID: 1 - Item 12: 左边镜头取图 ---> OK
device ID: 1 - Item 13: 右边镜头取图 ---> OK
device ID: 1 - Item 14: 前触摸屏测试 ---> NG
device ID: 1 - Item 15: MIC测试 ---> NG
device ID: 1 - Item 16: SPK测试 ---> NG
device ID: 1 - Item 17: 雷达测试 ---> NG
device ID: 1 - Item 18: NFC测试 ---> NG
device ID: 1 - Item 19: 防撬开关 ---> NG
device ID: 1 - Item 20: 光敏测试 ---> NG
device ID: 1 - Item 21: 前屏背光测试 ---> NG
device ID: 1 - Item 22: IR灯开 ---> OK
device ID: 1 - Item 23: IR灯关 ---> OK
device ID: 1 - Item 24: 串口测试 ---> NG
device ID: 1 - Item 25: PIR测试 ---> NG
device ID:-1 ---> All 25 items test completed !!!

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Some files were not shown because too many files have changed in this diff Show More