diff --git a/lib/components/object/objectEventReport.cpp b/lib/components/object/objectEventReport.cpp index e0b0b82e..d35cec0a 100644 --- a/lib/components/object/objectEventReport.cpp +++ b/lib/components/object/objectEventReport.cpp @@ -478,6 +478,20 @@ bool objectEventReport::loadReport(struct tm* LTM){ return true; }; +bool objectEventReport::getReportBase(CSTR path, struct tm* LTM) { + if ( path == NULL ) return false; + sprintf(path, "%s/%04d/%02d/%02d/%02d%02d%02d", + m_pStorageProvider->getStorageBase(), + LTM->tm_year + 1900, + LTM->tm_mon + 1, + LTM->tm_mday, + LTM->tm_hour, + LTM->tm_min, + LTM->tm_sec + ); + return true; +} + vectorPeportsList *objectEventReport::getLoaddedReports(void) { if(m_vLoaddedReports.size()){ return &m_vLoaddedReports; diff --git a/lib/components/object/objectEventReport.h b/lib/components/object/objectEventReport.h index 514cabe6..6096c59d 100644 --- a/lib/components/object/objectEventReport.h +++ b/lib/components/object/objectEventReport.h @@ -66,10 +66,11 @@ class objectEventReport : public basicEventHandler { static objectEventReport *getInstance(void); virtual ~objectEventReport(void); virtual void dispatchEvent( basicEvent *Evt); - bool loadReportList( struct tm *LTM); - bool loadReport( struct tm *LTM); + bool loadReportList( struct tm *LTM); + bool loadReport( struct tm *LTM); vectorPeportsList * getLoaddedReports(void); vectorReport * getLoaddedReport(void); + bool getReportBase(CSTR path, struct tm* LTM); private: static objectEventReport *_instance; protected: diff --git a/lib/data/pathfinder/pathfinderDataStream.cpp b/lib/data/pathfinder/pathfinderDataStream.cpp new file mode 100644 index 00000000..32dfa121 --- /dev/null +++ b/lib/data/pathfinder/pathfinderDataStream.cpp @@ -0,0 +1,26 @@ +#include "pathfinderDataStream.h" +pathfinderDataStream::pathfinderDataStream( char *Name){ + m_pFID = NULL; + if( Name != NULL ){ + pathfinderDataStream::open( Name ); + }; +}; + +pathfinderDataStream::~pathfinderDataStream(){ + if( m_pFID!= NULL ) pathfinderDataStream::close(); +}; + +bool pathfinderDataStream::open( char *Name ){ + if( m_pFID!= NULL ) return false; + m_pFID = fopen( Name, "ab+" ); + if( m_pFID == NULL ) return false; + strncpy( m_pName, Name, MAX_PATH ); + return true; +}; + +bool pathfinderDataStream::close(){ + if( m_pFID == NULL ) return false; + fclose( m_pFID ); + m_pFID = NULL; + return true; +}; \ No newline at end of file diff --git a/lib/data/pathfinder/pathfinderDataStream.h b/lib/data/pathfinder/pathfinderDataStream.h new file mode 100644 index 00000000..690db54e --- /dev/null +++ b/lib/data/pathfinder/pathfinderDataStream.h @@ -0,0 +1,34 @@ +#ifndef __PATHFINDER_DATA_STREAM_HEADER__ +#define __PATHFINDER_DATA_STREAM_HEADER__ + +#define PF_GPS_DATA 01 +#define PF_LGS_DATA 02 +#define PF_GYRO_DATA 03 +#define PF_ADNS_DATA 04 +#define PF_MUI_DATA 05 +#define PF_MAG_DATA 06 +#define PF_ALT_DATA 07 +#define PF_AXEL_DATA 08 + + +class pathfinderDataStream{ + FILE * m_pFID; + char m_pName[MAX_PATH]; + public: + explicit pathfinderDataStream( char *Name = NULL ); + ~pathfinderDataStream(); + bool putGPS( float Lat, float Lon, float Alt ); + bool putLGS( int Angle, int Range ); + bool putLGS( int *Ranges, int Size ); + bool putGYRO( float X, float Y, float Z ); + bool putAXEL( float X, float Y, float Z ); + bool putMUI( float X, float Y, float Z ); + bool putADNS( float X, float Y ); + bool putMAG( float X ); + bool putImage( char *ImageName ); + bool open( char *Name ); + bool close(); +}; + + +#endif \ No newline at end of file diff --git a/lib/gui/controls/ReportRecordWidget.cpp b/lib/gui/controls/ReportRecordWidget.cpp index d9554285..69e2885b 100644 --- a/lib/gui/controls/ReportRecordWidget.cpp +++ b/lib/gui/controls/ReportRecordWidget.cpp @@ -44,15 +44,17 @@ reportRecordWidget::~reportRecordWidget(){ }; }; -bool reportRecordWidget::setReport( REPORT_RECORD *ptr ){ +bool reportRecordWidget::setReport(CSTR base, REPORT_RECORD *ptr ){ if (ptr != NULL) { if (ptr->media_count) { + char tBuffer[MAX_PATH]; if (videoIn != NULL) { delete(videoIn); }; videoIn = new videoAVLIBSource(); videoIn->attachDestination(this); - videoIn->_open(ptr->media_names[0]); + sprintf(tBuffer, "%s/%s", base, ptr->media_names[0]); + videoIn->_open( tBuffer,false,01,01, 640,480, true ); videoIn->init(); setError(false, ""); } else { diff --git a/lib/gui/controls/ReportRecordWidget.h b/lib/gui/controls/ReportRecordWidget.h index f0d5a436..68f0a785 100644 --- a/lib/gui/controls/ReportRecordWidget.h +++ b/lib/gui/controls/ReportRecordWidget.h @@ -26,7 +26,7 @@ class reportRecordWidget: public QWidget, public basicMediaDestination{ virtual void render(QPainter* painter); bool init(void); virtual void pushFrame(cv::Mat* Frame, void* src = NULL); - bool setReport(REPORT_RECORD *ptr); + bool setReport(CSTR base, REPORT_RECORD *ptr); public slots: void renderLater(); void renderNow(); diff --git a/lib/gui/dialogs/ReportsManagerDialog.cpp b/lib/gui/dialogs/ReportsManagerDialog.cpp index 024c52bf..436063be 100644 --- a/lib/gui/dialogs/ReportsManagerDialog.cpp +++ b/lib/gui/dialogs/ReportsManagerDialog.cpp @@ -102,7 +102,7 @@ void guiReportsManagerDialog::selectReportDate() { selectedTM.tm_year = sd.year() - 1900; selectedTM.tm_mon = sd.month() - 1; selectedTM.tm_mday = sd.day(); - m_pReportRecView->setReport(NULL); + m_pReportRecView->setReport(NULL, NULL); if (m_pSystemReport->loadReportList(&selectedTM)) { selectedReportList = m_pSystemReport->getLoaddedReports(); if (selectedReportList ) { @@ -255,7 +255,10 @@ void guiReportsManagerDialog::selectRecord(const QModelIndex& idx) { REPORT_RECORD * cRecord; if (selectedReport != NULL) { if (selectedReport->size() > id) { - m_pReportRecView->setReport( selectedReport->at(id)); - } else m_pReportRecView->setReport( NULL ); - } else m_pReportRecView->setReport(NULL); + char tBase[MAX_PATH]; + if(m_pSystemReport->getReportBase(tBase, &selectedTM)) { + m_pReportRecView->setReport(tBase, selectedReport->at(id)); + }; + } else m_pReportRecView->setReport( NULL, NULL ); + } else m_pReportRecView->setReport(NULL, NULL); }; \ No newline at end of file