You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.5 KiB
C++
68 lines
1.5 KiB
C++
#ifndef LP_SERIAL_STATION_H
|
|
#define LP_SERIAL_STATION_H
|
|
|
|
#include "lp_serial_manager.h"
|
|
#include "commonDefine.h"
|
|
|
|
#define SINGLECHIP_COM "SinglechipCom"
|
|
#define CODESCAN_COM_LEFT "CodeScan_Left"
|
|
#define CODESCAN_COM_RIGHT "CodeScan_Right"
|
|
|
|
struct CodeScanResults
|
|
{
|
|
eSideID sdID;
|
|
QByteArray ResData;
|
|
};
|
|
|
|
enum EmptyResult
|
|
{
|
|
emExist = 1,
|
|
emEmpty
|
|
};
|
|
|
|
class lpSerialStation : public QObject, public lp_singleton<lpSerialStation>
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
lpSerialStation();
|
|
~lpSerialStation();
|
|
|
|
bool loadParameters(const QString& filePath);
|
|
void openComs();
|
|
void closeComs();
|
|
|
|
Q_SLOT void onControlSideLight(int cmdData);
|
|
|
|
Q_SLOT void onStartEmptyPlaceCheck(QString streetName);
|
|
Q_SLOT void onStopEmptyPlaceCheck();
|
|
Q_SLOT void onNewCodeScanResults(int, QSharedPointer<QByteArray>);
|
|
|
|
signals:
|
|
void sgNewEmptyCheckResults(const QMap<QString, int>&);
|
|
|
|
void sgMonitorSensorTriggerStart(int sideId);
|
|
void sgMonitorSensorTriggerStop(int sideId);
|
|
|
|
private:
|
|
Q_SLOT void onOpen();
|
|
Q_SLOT void onDataReceive(const QString& sn, QSharedPointer<LpSerialFrame> data_ptr_);
|
|
Q_SLOT void onStateChanged(const QString&, SerialErrorType);
|
|
private:
|
|
//QQueue<CodeScanResults> m_CodeScanResQ;
|
|
QQueue<QString> m_queueCodeLeft;
|
|
QQueue<QString> m_queueCodeRight;
|
|
bool m_bStartEmptyCheck{ false };
|
|
QMap<QString, int> m_mapEmptyLeft;
|
|
QMap<QString, int> m_mapEmptyRight;
|
|
QString m_strStreetName;
|
|
|
|
QThread* m_pobjThread;
|
|
QMap<QString, SerialParam> m_commDeviceMap;
|
|
};
|
|
#endif // !LP_SERIAL_STATION_H
|
|
|
|
|
|
|
|
|