123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #ifndef MAINWINDOW_H
- #define MAINWINDOW_H
- #include <QMainWindow>
- #include <QTcpServer>
- #include <QLabel>
- #include "decition.pb.h"
- #include "modulecomm.h"
- #include <QTime>
- namespace Ui {
- class MainWindow;
- }
- class MainWindow : public QMainWindow
- {
- Q_OBJECT
- private:
- Ui::MainWindow *ui;
- QLabel *LabListen;//状态栏标签
- QLabel *LabSocketState;//状态栏标签
- QTcpServer *tcpServer; //TCP服务器
- QTcpSocket *tcpSocket;//TCP通讯的Socket
- void * mPS_decitionSend;
- QString getLocalIP();//获取本机IP地址
- QString getHostIp();
- void shareControllData(iv::brain::decition);
- protected:
- void closeEvent(QCloseEvent *event);
- public:
- explicit MainWindow(QWidget *parent = 0);
- ~MainWindow();
- private slots:
- //自定义槽函数
- void onNewConnection();//QTcpServer的newConnection()信号
- void onSocketStateChange(QAbstractSocket::SocketState socketState);
- void onClientConnected(); //Client Socket connected
- void onClientDisconnected();//Client Socket disconnected
- void onSocketReadyRead();//读取socket传入的数据
- //UI生成的
- void on_actStart_triggered();
- void on_actStop_triggered();
- void on_actClear_triggered();
- void on_btnSend_clicked();
- void on_actHostInfo_triggered();
- };
- #endif // MAINWINDOW_H
|