hlp:640x480-小屏vx4齿轮泵代码提交
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
#ifndef MODBUSSERIAL_H
|
||||
#define MODBUSSERIAL_H
|
||||
#include <QThread>
|
||||
//#include <QObject>
|
||||
#include "../SysPara.h"
|
||||
#include <stdint.h>
|
||||
#include <QMutex>
|
||||
#include <QTimer>
|
||||
//#include <QTcpServer>
|
||||
|
||||
#define PRINT_START_COMMAND 0x01
|
||||
#define PRINT_PAUSE_COMMAND 0x02
|
||||
#define PRINT_STOP_COMMAND 0x03
|
||||
#define UPDATE_QRCODE 0x04
|
||||
#define NULL_COMMAND 0x00
|
||||
//enum {
|
||||
// TCP,
|
||||
// TCP_PI,
|
||||
// RTU
|
||||
//};
|
||||
//enum ThreadState
|
||||
//{
|
||||
// STOPPED,
|
||||
// RUNNING,
|
||||
// SHUTDOWN
|
||||
//};
|
||||
|
||||
class ModbusSerial:public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ModbusSerial(ModbusPrintParas *mPara, const ModbusPrintStatus* mStatus);
|
||||
~ModbusSerial();
|
||||
|
||||
uint16_t* input_registers;
|
||||
uint16_t* holding_registers;
|
||||
uint8_t modbus_up_QRCODE;
|
||||
// QThread serial_thread;
|
||||
|
||||
// enum ThreadState Serial_PollThreadState;
|
||||
// enum ThreadState Serial_GetPollingThreadState();
|
||||
// void Serial_SetPollingThreadState( enum ThreadState eNewState );
|
||||
qint32 getModbusStatus();
|
||||
|
||||
|
||||
Q_SIGNALS:
|
||||
void updateQRcode();
|
||||
void startPrint();
|
||||
void pausePrint();
|
||||
void stopPrint();
|
||||
void openFile(QString,bool);
|
||||
void faultResume();
|
||||
void writeCalendar();
|
||||
void mbLineAndCharSpace(int lineSpace, int charSpace);
|
||||
|
||||
public slots:
|
||||
//void processCommands();
|
||||
qint32 processCommands(qint32 index);
|
||||
// void vPollingThread();
|
||||
|
||||
private:
|
||||
QTimer* modbus_timer;
|
||||
qint32 modbus_status;
|
||||
uint16_t port_num;
|
||||
// QMutex modbusThreadMutex;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user