更新与前板的使用串口连接

This commit is contained in:
2025-02-14 11:06:28 +08:00
parent d2bccd9c49
commit aa3e8c8223
301 changed files with 5373 additions and 512 deletions

View File

@@ -176,7 +176,7 @@ void DataHandler::handleData(const QString& client, const QByteArray& recv
(msg_id != 0x0021 || clientLastMsgId.value(client, 0) != 0x0021) &&
(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();
emit statusUpdated(client, success, jsonArray, itemJsonIndex);
emit statusUpdated(1, client, success, jsonArray, itemJsonIndex);
}
clientLastMsgId[client] = msg_id;
}
@@ -330,7 +330,7 @@ void DataHandler::handleFrontCmd(int msg_id, const QString& client, QByteArray a
picBuffer->append(yuvData);
showPic(labelSize, lens_n, width, height, format, picBuffer);
QJsonObject currentTempItem = jsonArray[itemJsonIndex].toObject();
emit statusUpdated(client, true, jsonArray, itemJsonIndex);
emit statusUpdated(-1, client, true, jsonArray, itemJsonIndex);
picBuffer->remove(0, picSize);
}
else if (yuvData.size() + picBuffer->size() > picSize) {
@@ -349,7 +349,7 @@ void DataHandler::handleFrontCmd(int msg_id, const QString& client, QByteArray a
if (!isStartVideo) {
isStartVideo = ffmpegDecoder->isStartVideo;
if (isStartVideo) {
emit statusUpdated(client, true, getVideoJson, 0);
emit statusUpdated(-1, client, true, getVideoJson, 0);
}
}
showVideo(client, actual_data);
@@ -358,7 +358,7 @@ void DataHandler::handleFrontCmd(int msg_id, const QString& client, QByteArray a
case STOP_VIDEO:
{
isStartVideo = false;
emit statusUpdated(client, true, jsonArray, itemJsonIndex);
emit statusUpdated(-1, client, true, jsonArray, itemJsonIndex);
/*qDebug() << "--- STOP_VIDEO Current path: " << QDir::currentPath();
QString filePath = QDir::currentPath() + "/add1.h264";
if (QFile::exists(filePath)) {
@@ -554,7 +554,7 @@ void DataHandler::handleBackCmd(int msg_id, const QString& client, QByteArray ac
if (!isStartVideo) {
isStartVideo = ffmpegDecoder->isStartVideo;
if (isStartVideo) {
emit statusUpdated(client, true, jsonArray, itemJsonIndex);
emit statusUpdated(1, client, true, jsonArray, itemJsonIndex);
}
}
QJsonObject jsonObject = jsonArray[itemJsonIndex].toObject();
@@ -563,7 +563,7 @@ void DataHandler::handleBackCmd(int msg_id, const QString& client, QByteArray ac
}
else if (jsonObject["val"] == 1) {
isStartVideo = false;
emit statusUpdated(client, true, jsonArray, itemJsonIndex);
emit statusUpdated(1, client, true, jsonArray, itemJsonIndex);
qDebug() << "--- STOP_VIDEO";
if (ffmpegDecoder) {