新增产测与服务器的HTTP连接及交互功能
This commit is contained in:
@@ -31,7 +31,8 @@ class ClientHandler : public QObject, public QRunnable
|
||||
public:
|
||||
explicit ClientHandler(QTcpSocket* socket, QJsonArray frontBoardOneClickTest, QJsonArray frontBoardTest,
|
||||
QJsonArray frontBoardFuncConfig, QJsonArray frontBoardDevInfoJson, QJsonArray frontBoardLicenseJson,
|
||||
QJsonArray backBoardDevInfoJson, QJsonArray getPicJson, QJsonArray getVideoJson,
|
||||
QJsonArray backBoardOneClickTest, QJsonArray backBoardTest, QJsonArray backBoardFuncConfig, QJsonArray backBoardDevInfoJson,
|
||||
QJsonArray getPicJson, QJsonArray getVideoJson,
|
||||
int clientId, QObject* parent = nullptr);
|
||||
|
||||
~ClientHandler();
|
||||
@@ -54,13 +55,17 @@ public:
|
||||
// 发送拉视频流按键
|
||||
void sendGetVideoItem(int itemIndex, int video_flag);
|
||||
// 发送License处理按键
|
||||
void sendLicenseItem(int itemIndex);
|
||||
void sendLicenseItem(int itemIndex, const QString text);
|
||||
void sendUuidItem(int itemIndex, const QString text);
|
||||
// 发送下一个功能配置 JSON 项目
|
||||
void sendFuncItem(int itemIndex, QString text);
|
||||
void sendFrontFuncItem(int itemIndex, QString text);
|
||||
void sendBackFuncItem(int itemIndex, QString text);
|
||||
// 发送下一个 JSON 项目
|
||||
void sendNextItem();
|
||||
// 处理发送单独指令
|
||||
void sendItem(int itemIndex);
|
||||
void sendFrontItem(int itemIndex);
|
||||
void sendBackItem(int itemIndex);
|
||||
//void sendLicenseItem();
|
||||
// 获取客户端的 ID
|
||||
int getClientId() const { return clientId; }
|
||||
// 获取当前客户端的地址
|
||||
@@ -75,7 +80,7 @@ public:
|
||||
QString getCurrentFuncItemLable() const;
|
||||
// 重置索引
|
||||
void resetCurrentItemIndex();
|
||||
// 处理 RingBuffer 中的数据
|
||||
void sendDataToClient(const QByteArray& data);
|
||||
//void processRingBufferData();
|
||||
void setThreadPriority(QThread::Priority priority);
|
||||
|
||||
@@ -98,6 +103,7 @@ signals:
|
||||
void selectClientDisconnected(int clientId);
|
||||
void startReadTimer(int clientId);
|
||||
void stopReadTimer(int clientId);
|
||||
void sendDataToSomeClient(int clientId, const QByteArray& data);
|
||||
|
||||
public slots:
|
||||
// 处理数据接收
|
||||
@@ -120,6 +126,9 @@ private:
|
||||
QJsonArray frontBoardFuncConfig; // 前板功能配置参数 JSON
|
||||
QJsonArray frontBoardDevInfoJson; // 前板设备信息参数 JSON
|
||||
QJsonArray frontBoardLicenseJson; // 前板license信息 JSON
|
||||
QJsonArray backBoardOneClickTest; // 后板一键功能测试 JSON
|
||||
QJsonArray backBoardTest; // 后板单项测试 JSON
|
||||
QJsonArray backBoardFuncConfig; // 后板功能配置参数 JSON
|
||||
QJsonArray backBoardDevInfoJson; // 后板设备信息参数 JSON
|
||||
QJsonArray jsonConfig; // 测试区 JSON 配置
|
||||
QJsonArray funcJsonConfig; // 功能区 JSON 配置
|
||||
@@ -129,6 +138,8 @@ private:
|
||||
int currentItemIndex; // 当前处理的测试 JSON 项目索引
|
||||
int currentFuncItemIndex; // 当前处理的功能 JSON 项目索引
|
||||
int clientId; // 新增的客户端编号
|
||||
int preVideoClientId = 0;
|
||||
int controlClientId = 1;
|
||||
int itemsProcessedCount; // 跟踪处理项目的数量
|
||||
QJsonObject currentItem; // 测试 json文件中当前发送的项
|
||||
QJsonObject currentFuncItem; // 功能 json文件中当前发送的项
|
||||
@@ -143,6 +154,8 @@ private:
|
||||
int size;
|
||||
int currentFrontBoardIndex; // 当前发送的前板设备信息项的索引
|
||||
int currentBackBoardIndex; // 当前发送的后板设备信息项的索引
|
||||
int currentLicenseIndex;
|
||||
int currentUuidIndex;
|
||||
|
||||
void checkThreadStatus();
|
||||
bool isFirstDataReceived;
|
||||
@@ -157,10 +170,6 @@ private:
|
||||
void sendDevInfoJsonItem(const QJsonObject& jsonItem, int itemIndex);
|
||||
//void sendDevInfoItem();
|
||||
|
||||
QTimer* readTimer;
|
||||
QTimer* threadStatusTimer;
|
||||
QTimer* connectionCheckTimer;
|
||||
|
||||
bool isDataStuck;
|
||||
bool dataProcessingActive;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user