240717班级,工业化控制系统,煤矿相关行业,昆仑系统
lzz
2024-11-07 edd4466fdad20fcf50a7c30569ba7ce11f262914
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef LOGQUERY_H
#define LOGQUERY_H
 
#include <QMainWindow>
#include "common.h"
#include <QTcpSocket>
#pragma execution_character_set("utf-8")
 
 
namespace Ui {
class LogQuery;
}
 
class LogQuery : public QMainWindow
{
    Q_OBJECT
 
public:
    explicit LogQuery(QWidget *parent = 0);
    explicit LogQuery(QTcpSocket *client,QWidget *parent = 0);
    ~LogQuery();
 
private slots:
    void on_pushButton_search_clicked();
 
    void queryResSlot(LogQueryRes *res);
 
    void on_pushButton_up_clicked();
 
    void on_pushButton_down_clicked();
 
    void onComboBoxIndexChanged(int index);
 
private:
    void displayCurrentPage();
    Ui::LogQuery *ui;
    QTcpSocket *m_client;
 
    QVector<ParsedLog> logs;
 
    int currentPage = 1;    // 当前页码,从1开始
    int totalPages = 1;     // 总页数
    const int logsPerPage = 10;   // 每页显示的日志数量
 
    void initializeRequestData(LogQueryReq* req);//初始化请求数据
    void updatePageLabel();
};
 
#endif // LOGQUERY_H