142 lines
3.9 KiB
C++
142 lines
3.9 KiB
C++
#ifndef WIDGET_H
|
|
#define WIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QTimer>
|
|
#include <QMetaType>
|
|
#include <QStyleFactory>
|
|
#include <QFileDialog>
|
|
#include <qthreadpool.h>
|
|
#include <QDesktopServices>
|
|
#include <QMessageBox>
|
|
#include <QDesktopServices>
|
|
#include "CSIServer/arraytoflierunnable.h"
|
|
#include <QUdpSocket>
|
|
#include "SeriaPort/seriaport.h"
|
|
#include <QKeyEvent>
|
|
#include <QTcpServer>
|
|
|
|
|
|
namespace Ui {
|
|
class Widget;
|
|
}
|
|
|
|
class Server;
|
|
|
|
|
|
class Widget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit Widget(QWidget *parent = nullptr);
|
|
~Widget();
|
|
bool IsShanDongMode;
|
|
|
|
signals:
|
|
void sendData(QString IP, const QByteArray &data);
|
|
void SerialPort_send(QString);
|
|
void MotorRunFinish();
|
|
void StartTra();
|
|
void StopTra();
|
|
|
|
public slots:
|
|
void ReadConfigIni();
|
|
void Log(QString log );
|
|
void ShowIMG(QPixmap pix , QString IP );
|
|
QStringList GetServerIP();
|
|
|
|
|
|
private slots:
|
|
void showConnection(QString IP);
|
|
void showDisconnection(QString IP);
|
|
void ShowLiveView(qintptr id , QImage img);//live
|
|
void IMGrecvDataSlot(const QString &ip, const QByteArray &data,QString ImgName);//Save
|
|
void ClearAllLiveAndLCD();
|
|
void PathTouch(QString path);//自动补全文件夹路径 V0.1
|
|
void Delaymsec(int msec);
|
|
|
|
void SerialPort_receive(QByteArray tmpdata);
|
|
void MotorStateUpdate(int State, int Location, int Speed);
|
|
void SerialPortInit();
|
|
|
|
void on_pushButton_DebugSend_clicked();
|
|
void on_pushButton_StartLiveView_clicked();
|
|
void on_pushButton_EndLiveView_clicked();
|
|
void on_pushButton_TimerCaptureAll_clicked();
|
|
void on_pushButton_TimerStopAll_clicked();
|
|
void on_pushButton_OpenCurrentPath_clicked();
|
|
void on_pushButton_EditCurrentPath_clicked();
|
|
void on_pushButton_EditCaptureT_clicked();
|
|
void on_pushButton_CaptureOnce_clicked();
|
|
void ClearCaptureMode();//组合拍摄
|
|
void ClearCaptureModeEnd();//组合拍摄结束
|
|
void on_pushButton_ServerIpSet_clicked();
|
|
void on_pushButton_ServerIpSet2_clicked();
|
|
void on_pushButton_PreviewClear_clicked();
|
|
void on_ButtOpenSeria_clicked();
|
|
void on_pushButton_MotorSpeedEdit_clicked();
|
|
void on_ButtRflushSeria_clicked();
|
|
void on_pushButton_MotorRunOnce_clicked();
|
|
void on_pushButton_RunAll_clicked();
|
|
void StopWorkAll();
|
|
void on_checkBoxIsSendNums_stateChanged(int arg1);
|
|
void on_pushButton_RestartPiPro_clicked();
|
|
|
|
void on_checkBoxIsSendNums_2_stateChanged(int arg1);
|
|
|
|
void on_pushButton_TarnsRun_clicked();
|
|
|
|
void on_pushButton_EditCaptureT_2_clicked();
|
|
|
|
void on_pushButton_OnceCamListReload_clicked();
|
|
|
|
void on_pushButton_OnceCamListEdit_clicked();
|
|
|
|
void on_pushButton_MutiModeEdit_clicked();
|
|
|
|
protected:
|
|
void keyPressEvent(QKeyEvent *ev);//键盘事件
|
|
void closeEvent(QCloseEvent *event);// 串口关闭事件
|
|
|
|
private:
|
|
Ui::Widget *ui;
|
|
friend class Server;//友元
|
|
Server *m_server;//主服务器管理
|
|
int m_count;//当前连接Linux相机的数量
|
|
QThreadPool *MySavePool;//用作保存数据 RAM-》ROM 的IO处理
|
|
|
|
QTime FPSLastTime;//上一次接收到预览图象的时间
|
|
QTime FPSCurTime;//本次接收到预览图象的时间
|
|
|
|
QString StorePath;
|
|
QString CurrentPlantID;
|
|
QStringList Camlist;
|
|
QStringList OnceCamList;
|
|
QStringList ClearActiveCamList;
|
|
|
|
SerialPort *local_serial;
|
|
int NowLocation;
|
|
int MotorSpeed;//电机的运行速度
|
|
int MotorSpeedReal;//下位机反馈的电机的运行速度
|
|
int LastMotorDirection; //初始为0即静止 正向为1 反向为2
|
|
|
|
QTcpServer *TransporterServer;
|
|
QTcpSocket* TransporterSocket;
|
|
bool IsTransporterServerTaskReset;
|
|
QString TraIP;
|
|
QString Tra_DoorState;
|
|
QString Tra_TraState;
|
|
QString Tra_ID;
|
|
int Tra_Count;
|
|
int AllCounts;
|
|
int Tra_TimerCount;
|
|
QTimer* Tra_Timer;
|
|
|
|
QString GetMACFromIP(QString IP);
|
|
bool IsCamActive(QString Mac);
|
|
|
|
};
|
|
|
|
#endif // WIDGET_H
|