ytcore.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef BPCORE_H
  2. #define BPCORE_H
  3. #include <QObject>
  4. #include <QSqlDatabase>
  5. #include <QSqlQuery>
  6. #include <QVariant>
  7. #include <QTimer>
  8. #include <QUuid>
  9. #include <Msg.h>
  10. #include <QUdpSocket>
  11. #include <QHostAddress>
  12. #include <json-c/json.h>
  13. #include <stdlib.h>
  14. #include <unistd.h>
  15. //#include "ycapi.h"
  16. #include "dbthread.h"
  17. #include "logthread.h"
  18. #include "dncommthread.h"
  19. #include "userverthread.h"
  20. #include "alarmchannel.h"
  21. class BpCore : public QObject
  22. {
  23. Q_OBJECT
  24. public:
  25. explicit BpCore(QObject *parent = 0);
  26. void db_init();
  27. void shm_init();
  28. bool shm_load();
  29. bool chk_table(QString tbname, QStringList tables);
  30. void run();
  31. void checkRemoteCmd(QByteArray data, QDateTime time, QHostAddress remote);
  32. int mk_ReportCmd(int cno,int pno, unsigned char *cmd);
  33. signals:
  34. public slots:
  35. void time_out();
  36. void dbg_log(QString txt);
  37. void log(QString txt);
  38. void recsql(QString sql);
  39. void confsql(QString sql);
  40. private:
  41. QSqlDatabase db, recdb;
  42. QTimer *timer;
  43. DBThread *dbThread;
  44. LogThread *logThread;
  45. DNCommThread *dnThread[8];
  46. UServerThread *uServerThread;
  47. QString UskyID, UskyIP;
  48. QString LocIP,GateWay,NetMask,MacAddr;
  49. quint16 UskyPort;
  50. int CHour, CMin, TMin;
  51. int aghour;
  52. bool timeoutworking;
  53. };
  54. #endif // BPCORE_H