更新与前板的使用串口连接
This commit is contained in:
@@ -106,14 +106,14 @@ QString ClientHandler::getCurrentFuncItemData() const
|
||||
{
|
||||
QString data = currentFuncItem.value("val").toString();
|
||||
qDebug() << "Getting current funcItem val:" << data;
|
||||
return data; // 返回当前项的 "data" 字段
|
||||
return data; // 返回当前项的 "val" 字段
|
||||
}
|
||||
|
||||
QString ClientHandler::getCurrentItemLable() const
|
||||
{
|
||||
QString lable = currentItem.value("lable").toString();
|
||||
qDebug() << "Getting current item lable:" << lable;
|
||||
return lable; // 返回当前项的 "data" 字段
|
||||
return lable; // 返回当前项的 "lable" 字段
|
||||
}
|
||||
|
||||
QString ClientHandler::getCurrentFuncItemLable() const
|
||||
@@ -475,8 +475,6 @@ void ClientHandler::sendDevInfoJsonItem(const QJsonObject& jsonItem, int itemInd
|
||||
else {
|
||||
emit sendDataToSomeClient(controlClientId, itemData.toUtf8());
|
||||
}
|
||||
|
||||
|
||||
if (jsonItem.contains("timeout")) {
|
||||
int timeout = jsonItem.value("timeout").toInt();
|
||||
if (timeout > 0) {
|
||||
@@ -553,7 +551,7 @@ void ClientHandler::sendNextItem(QJsonArray& currentOneClickedItem)
|
||||
}
|
||||
}
|
||||
else if (isManualSend) {
|
||||
emit allItemsProcessed(getClientAddress(), itemsProcessedCount);
|
||||
emit allItemsProcessed(isBackBoardOrAllBoard, getClientAddress(), itemsProcessedCount);
|
||||
// 处理完毕后重置标记
|
||||
isManualSend = false;
|
||||
isClickedSend = false;
|
||||
@@ -582,7 +580,6 @@ void ClientHandler::RNDISClient3Data(QByteArray& data) {
|
||||
}
|
||||
|
||||
void ClientHandler::RNDISClient4Data(QByteArray& data) {
|
||||
//qDebug() << " RNDISClient4Data size:" << data.size();
|
||||
//qDebug() << " RNDISClient4Data size:" << data.size();
|
||||
isRecvVideoData = false;
|
||||
isStartVideo = false;
|
||||
@@ -679,10 +676,10 @@ void ClientHandler::onPicRecvFinished()
|
||||
void ClientHandler::onDataReceived()
|
||||
{
|
||||
//qDebug() << "isRecvVideoData:" << isRecvVideoData;
|
||||
//qDebug() << "isPowerOnSend:" << isPowerOnSend;
|
||||
//qDebug() << "isClickedSend:" << isClickedSend;
|
||||
//qDebug() << "isSingleSend:" << isSingleSend;
|
||||
//qDebug() << "isRecvImgData:" << isRecvImgData;
|
||||
//qDebug() << "isPowerOnSend: " << isPowerOnSend;
|
||||
//qDebug() << "isClickedSend: " << isClickedSend;
|
||||
//qDebug() << "isSingleSend: " << isSingleSend;
|
||||
//qDebug() << "isRecvImgData: " << isRecvImgData;
|
||||
if (!isRecvVideoData &&
|
||||
(isRecvImgData || isPowerOnSend || isClickedSend || (isSingleSend && (currentItemIndex < currentJson.size())))) {
|
||||
QByteArray allData;
|
||||
@@ -726,7 +723,7 @@ void ClientHandler::onDataReceived()
|
||||
}
|
||||
else {
|
||||
qDebug() << "All items processed in onDataReceived.";
|
||||
emit allItemsProcessed(getClientAddress(), currentBackBoardIndex);
|
||||
emit allItemsProcessed(isBackBoardOrAllBoard, getClientAddress(), currentBackBoardIndex);
|
||||
isPowerOnSend = false;
|
||||
}
|
||||
}
|
||||
@@ -736,7 +733,7 @@ void ClientHandler::onDataReceived()
|
||||
}
|
||||
else {
|
||||
qDebug() << "All items processed in onDataReceived.";
|
||||
emit allItemsProcessed(getClientAddress(), currentFrontBoardIndex);
|
||||
emit allItemsProcessed(isBackBoardOrAllBoard, getClientAddress(), currentFrontBoardIndex);
|
||||
isPowerOnSend = false;
|
||||
}
|
||||
}
|
||||
@@ -748,7 +745,7 @@ void ClientHandler::onDataReceived()
|
||||
}
|
||||
}
|
||||
else if(isClickedSend) {
|
||||
emit allItemsProcessed(getClientAddress(), itemsProcessedCount);
|
||||
emit allItemsProcessed(isBackBoardOrAllBoard, getClientAddress(), itemsProcessedCount);
|
||||
isClickedSend = false;
|
||||
//resetCurrentItemIndex();
|
||||
}
|
||||
@@ -850,7 +847,7 @@ void ClientHandler::onTimeout()
|
||||
{
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
emit statusUpdated(getClientAddress(), false, currentJson, currentJsonItem);
|
||||
emit statusUpdated(isBackBoardOrAllBoard, getClientAddress(), false, currentJson, currentJsonItem);
|
||||
//qDebug() << "isSingleSend:" << isSingleSend << "isPowerOnSend:" << isPowerOnSend;
|
||||
if (!isSingleSend && !isPowerOnSend) {
|
||||
currentItemIndex ++;
|
||||
@@ -866,7 +863,7 @@ void ClientHandler::onTimeout()
|
||||
sendNextItem(currentJson);
|
||||
}
|
||||
else if (currentItemIndex >= backBoardOneClickTest.size()) {
|
||||
emit allItemsProcessed(getClientAddress(), itemsProcessedCount);
|
||||
emit allItemsProcessed(isBackBoardOrAllBoard, getClientAddress(), itemsProcessedCount);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -874,7 +871,7 @@ void ClientHandler::onTimeout()
|
||||
sendNextItem(currentJson);
|
||||
}
|
||||
else if (currentItemIndex >= frontBoardOneClickTest.size()) {
|
||||
emit allItemsProcessed(getClientAddress(), itemsProcessedCount);
|
||||
emit allItemsProcessed(isBackBoardOrAllBoard, getClientAddress(), itemsProcessedCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -884,7 +881,7 @@ void ClientHandler::onTimeout()
|
||||
sendDevInfoItem();
|
||||
}
|
||||
else {
|
||||
emit allItemsProcessed(getClientAddress(), currentBackBoardIndex);
|
||||
emit allItemsProcessed(isBackBoardOrAllBoard, getClientAddress(), currentBackBoardIndex);
|
||||
currentFrontBoardIndex = 0;
|
||||
currentBackBoardIndex = 0;
|
||||
isPowerOnSend = false;
|
||||
@@ -895,7 +892,7 @@ void ClientHandler::onTimeout()
|
||||
sendDevInfoItem();
|
||||
}
|
||||
else {
|
||||
emit allItemsProcessed(getClientAddress(), currentFrontBoardIndex);
|
||||
emit allItemsProcessed(isBackBoardOrAllBoard, getClientAddress(), currentFrontBoardIndex);
|
||||
currentFrontBoardIndex = 0;
|
||||
currentBackBoardIndex = 0;
|
||||
isPowerOnSend = false;
|
||||
|
||||
Reference in New Issue
Block a user