1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #ifndef BPCORE_H
- #define BPCORE_H
- #include <QObject>
- #include <QSqlDatabase>
- #include <QSqlQuery>
- #include <QVariant>
- #include <QTimer>
- #include <QUuid>
- #include <Msg.h>
- #include <QUdpSocket>
- #include <QHostAddress>
- #include <json-c/json.h>
- #include <stdlib.h>
- #include <unistd.h>
- //#include "ycapi.h"
- #include "dbthread.h"
- #include "logthread.h"
- #include "dncommthread.h"
- #include "userverthread.h"
- #include "alarmchannel.h"
- class BpCore : public QObject
- {
- Q_OBJECT
- public:
- explicit BpCore(QObject *parent = 0);
- void db_init();
- void shm_init();
- bool shm_load();
- bool chk_table(QString tbname, QStringList tables);
- void run();
- void checkRemoteCmd(QByteArray data, QDateTime time, QHostAddress remote);
- int mk_ReportCmd(int cno,int pno, unsigned char *cmd);
- signals:
- public slots:
- void time_out();
- void dbg_log(QString txt);
- void log(QString txt);
- void recsql(QString sql);
- void confsql(QString sql);
- private:
- QSqlDatabase db, recdb;
- QTimer *timer;
- DBThread *dbThread;
- LogThread *logThread;
- DNCommThread *dnThread[8];
- UServerThread *uServerThread;
- QString UskyID, UskyIP;
- QString LocIP,GateWay,NetMask,MacAddr;
- quint16 UskyPort;
- int CHour, CMin, TMin;
- int aghour;
- bool timeoutworking;
- };
- #endif // BPCORE_H
|