123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #ifndef PLATFORM_H
- #define PLATFORM_H
- #include <common/boost.h>
- #include <istream>
- #include <stdlib.h>
- #include <string.h>
- #include <vector>
- #include <fstream>
- #include <qtimer.h>
- #include "dataformat.h"
- //#include <control/can.h>
- //#include <control/control_status.h>
- //#include <common/lidar.h>
- #include <common/car_status.h>
- #include <QtNetwork/QTcpSocket>
- #include <QFile>
- #include <QtNetwork/QNetworkRequest>
- #include <QtNetwork/QNetworkAccessManager>
- #include <QUrl>
- #include <QtNetwork/QNetworkReply>
- #include <QByteArray>
- //#include <QMessageBox>
- #include <QFileInfo>
- #include <QDir>
- #define SRV_ADDR_ "123.127.164.44"
- #define SRV_PORT_ 5602
- using namespace std;
- namespace iv {
- namespace platform {
- class Client
- {
- public:
- Client();
- ~Client();
- double srclng;
- double srclat;
- double deslng;
- double deslat;
- void start();
- void run();
- void stop();
- void Heartdetect();
- int PackagetHeadInfo(unsigned char commendID, int dataLen);
- bool CarCheckin(int count);//车辆登入0x01
- void RealtimeInfo();//实时信息上报0x01
- void SupplementInfo();//补发信息上报0x03
- bool CarCheckout(int count);//车辆登出0x04
- void Heartbeat();//发送心跳 0x07
- void TerminalCheckTime();//终端校时0x08
- void CarStatusInfo();//车身状态数据0x09
- void DriveDataLowInfo();//驾驶行为数据 低频 0x0A
- void DriveDataHighInfo();//驾驶行为数据 高频 0x0B
- void SenserConfig();
- void CarControlInfo(char recvBuf[]);
- void LongdistanceDriveInfo(char recvBuf[]);
- void AppointmentDispatchInfo(char recvBuf[]);
- void PlatformtToInfo(char recvBuf[]);
- void RoutePlaningInfo(char recvBuf[]);
- void CarCallSwitch();
- void Receive();//接收数据
- char BCCEncode(char sbuf[],int len);//计算校验
- bool BCCDecode(char sbuf[], int len);
- void ReadStation(char *filepath);
- private:
- QTcpSocket *socket;
- bool is_checkin ;
- bool is_receive;
- int heartdetect;
- int heartdetect_last;
- int checkInOutNum;
- bool is_order;
- bool is_going;
- bool is_stopnext;
- bool is_stopend;
- bool is_stopmid;
- bool is_endnow;
- bool is_endbegin;
- bool is_reorder;
- bool is_keepgoing;
- iv::platform::CarStatus carStatusInfo;
- iv::platform::DataPackageHead packageDataHead;
- };
- }
- }
- #endif // PLATFORM_H
|