OutilModbus/Sources/LazerProbeSimulator.h
2022-06-13 09:16:01 -04:00

40 lines
665 B
C++

#ifndef LAZERPROBESIMULATOR_H
#define LAZERPROBESIMULATOR_H
#include <QObject>
#include "qextserialport.h"
#include <QTimer>
#include <QByteArray>
class CLazerProbeSimulator : public QObject
{
Q_OBJECT
#define LAZER_PROBE_HEADER_MASK 0xFC
#define LAZER_PROBE_DATA_NIBBLE_MASK 0x03
public:
CLazerProbeSimulator();
~CLazerProbeSimulator();
bool EnableProbe(bool Enable);
bool SetProbeCurRange(int Range);
private:
QextSerialPort *mLaserProbeSerialPort;
QTimer *mTxTimer;
quint8 mHeader;
char mTxBuf[3];
quint32 mValue;
public slots:
void ProbeTxTimerExpired(void);
};
#endif // LAZERPROBESIMULATORESIMULATOR_H