main.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #ifndef MAIN_H
  2. #define MAIN_H
  3. #include <QApplication>
  4. #include <FelgoApplication>
  5. #include <QQmlApplicationEngine>
  6. #include <QtQml>
  7. #include <QQuickItem>
  8. #include <QTabBar>
  9. #include <QDebug>
  10. #include <QGeoPositionInfo>
  11. #include <QGeoPositionInfoSource>
  12. #include <QGeoSatelliteInfoSource>
  13. #include <QGeoCoordinate>
  14. #include <QString>
  15. #include <QtCore>
  16. #include <QDir>
  17. #include <QFileInfo>
  18. #include <QtCore/private/qandroidextras_p.h>
  19. #include <QThread>
  20. #include <QStandardPaths>
  21. #include <qjniobject.h>
  22. #include <QtTextToSpeech/QTextToSpeech>
  23. #include <QtMultimedia/QMediaPlayer>
  24. #include <QAudioOutput>
  25. //JSON
  26. #include <QJsonDocument>
  27. #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE
  28. #include <spdlog/spdlog.h>
  29. #include <spdlog/logger.h>
  30. #include <spdlog/sinks/rotating_file_sink.h>
  31. #include <spdlog/sinks/stdout_color_sinks.h>
  32. #include <spdlog/sinks/android_sink.h> // Include the Android sink
  33. #define LOG(...) SPDLOG_LOGGER_INFO(spdlog::get("console"), __VA_ARGS__);SPDLOG_LOGGER_INFO(spdlog::get("my_logger"), __VA_ARGS__)
  34. #define WARN(...) SPDLOG_LOGGER_WARN(spdlog::get("console"), __VA_ARGS__);SPDLOG_LOGGER_WARN(spdlog::get("my_logger"), __VA_ARGS__)
  35. #define SPD_ERROR(...) SPDLOG_LOGGER_ERROR(spdlog::get("console"), __VA_ARGS__);SPDLOG_LOGGER_ERROR(spdlog::get("my_logger"), __VA_ARGS__)
  36. #define DEBUG(...) SPDLOG_LOGGER_DEBUG(spdlog::get("console"), __VA_ARGS__);SPDLOG_LOGGER_DEBUG(spdlog::get("my_logger"), __VA_ARGS__)
  37. #define APP_VERSION "2.3"
  38. using namespace std;
  39. #pragma pack(push,4) //保存对齐状态设定为4字节对齐
  40. //全局变量类继承自QObject,用于qml访问
  41. class param
  42. {
  43. public:
  44. //explicit param();
  45. //db表Q_DECL_ALIGN(1)
  46. static QString table_mqtt;
  47. static QString table_mqtt_other;
  48. static QString table_ftp;
  49. static QString table_ftp_other;
  50. static QString table_location;
  51. static QString table_camera;
  52. static QString table_mqtt_historydata;
  53. //type
  54. static QString dtype;
  55. static QString imei;
  56. //mqtt
  57. static QString mqtt_main_ip;
  58. static QString mqtt_other_ip;
  59. static int mqtt_main_port;
  60. static int mqtt_other_port;
  61. static int mqtt_main_keepalive;
  62. static int mqtt_other_keepalive;
  63. static int mqtt_main_qos;
  64. static int mqtt_other_qos;
  65. static QString mqtt_main_clientid;
  66. static QString mqtt_other_clientid;
  67. static QString mqtt_main_uid;
  68. static QString mqtt_other_uid;
  69. static QString mqtt_main_pwd;
  70. static QString mqtt_other_pwd;
  71. static QString mqtt_main_sub;
  72. static QString mqtt_other_sub;
  73. static QString mqtt_main_pub;
  74. static QString mqtt_other_pub;
  75. static QString mqtt_main_offline;
  76. static QString mqtt_other_offline;
  77. static int dat_f_main; //数据上传间隔,单位。分钟
  78. static int dat_f_other;
  79. //ftp
  80. static QString ftp_main_ip;
  81. static QString ftp_other_ip;
  82. static int ftp_main_port;
  83. static int ftp_other_port;
  84. static QString ftp_main_dir;
  85. static QString ftp_other_dir;
  86. static QString ftp_main_uid;
  87. static QString ftp_other_uid;
  88. static QString ftp_main_pwd;
  89. static QString ftp_other_pwd;
  90. static int ftp_main_mode; //主动模式? 被动模式
  91. static int ftp_other_mode; //主动模式? 被动模式
  92. //location
  93. static QString gps_state;
  94. static QString lbs_lat;
  95. static QString lbs_lng;
  96. static QString gps_lat;
  97. static QString gps_lng;
  98. static QString gps_elevation;
  99. //camera&photo
  100. static QString camera_type; //相机类型
  101. static QString stitch_mode; //拼接模式
  102. static int stitch_photonum; //拼接数量
  103. static int photo_width; //图片宽度
  104. static int photo_height; //图片高度
  105. static int camera_tc; //已采集图片数量
  106. static QStringList ptlist; //存放图片路径
  107. static QStringList ptlist_res; //存放图片拼接结果路径
  108. //网络
  109. static bool net_alive;
  110. static QString net_name;
  111. static QString net_description;
  112. static QString net_mac;
  113. static QString net_ipv4;
  114. static int datupload_remain;
  115. private:
  116. };
  117. #pragma pack(pop)
  118. #endif // MAIN_H