You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.6 KiB

7 years ago
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
7 years ago
​
​
​
7 years ago
​
​
  1. #ifndef __OBJECTEVENTREPORT_H_INCL__
  2. #define __OBJECTEVENTREPORT_H_INCL__
  3. #include <time.h>
  4. #ifdef __linux__
  5. #include <sys/types.h>
  6. #include <dirent.h>
  7. #endif
  8. #include <vector>
  9. #include "../base/basicFunctionality.h"
  10. #include "../base/basicEventHandler.h"
  11. #include "../../data/storage/storageProvider.h"
  12. #include "../base/basicSettings.h"
  13. #include "../base/basicReportRecord.h"
  14. #include "../base/basicCamera.h"
  15. typedef struct S_REPORT_RECORD {
  16. uint32_t chunk_size; //4
  17. uint32_t ms; //4
  18. uint16_t ums; //2
  19. uint8_t cls_id; //1
  20. uint8_t type; //1
  21. uint32_t src; //4
  22. uint8_t media_type; //1
  23. uint8_t media_count; //1
  24. uint16_t data_size; //2
  25. //----------------------------------- 20 bytes = Fixed Size Header
  26. void * data;
  27. uint8_t media_allocated;
  28. char ** media_names;
  29. uint32_t * media_markers;
  30. }REPORT_RECORD;
  31. typedef struct S_REPORT_LIST_RECORD{
  32. char text[CTEXT];
  33. char path[CTEXT];
  34. }REPORT_LIST_RECORD;
  35. #define REPORT_RECORD_HEADER_SIZE 20
  36. //typedef std::vector<REPORT_LIST_RECORD *> vectorPeportsList;
  37. typedef std::vector<char *> vectorPeportsList;
  38. typedef std::vector<REPORT_RECORD*> vectorReport;
  39. class mediaVideoSourceManager;
  40. /**
  41. * TODO: Add class description
  42. *
  43. * @author Gagua
  44. */
  45. class objectEventReport : public basicEventHandler {
  46. private:
  47. storageProvider * m_pStorageProvider;
  48. basicSettings * m_pSettingsEngine;
  49. mediaVideoSourceManager * m_pMediaManager;
  50. char m_pReportFileName[MAX_PATH];
  51. bool saveReportRecord(REPORT_RECORD *Record);
  52. bool getMedia(REPORT_RECORD* Record);
  53. bool prefill(basicEvent* Evt, REPORT_RECORD* Record);
  54. bool utilize(REPORT_RECORD* Record);
  55. REPORT_RECORD * loadReportRecord(FILE* FD);
  56. vectorPeportsList m_vLoaddedReports;
  57. vectorReport m_vReport;
  58. public:
  59. static objectEventReport *getInstance(void);
  60. virtual ~objectEventReport(void);
  61. virtual void dispatchEvent( basicEvent *Evt);
  62. bool loadReportList( struct tm *LTM);
  63. bool loadReport( struct tm *LTM);
  64. vectorPeportsList * getLoaddedReports(void);
  65. vectorReport * getLoaddedReport(void);
  66. bool getReportBase(CSTR path, struct tm* LTM);
  67. private:
  68. static objectEventReport *_instance;
  69. protected:
  70. objectEventReport(void);
  71. };
  72. #endif // __OBJECTEVENTREPORT_H_INCL__