Changeset 99 in pacpussensors for trunk/Ladybug/LadybugComponent.cpp
- Timestamp:
- Oct 15, 2015, 2:47:01 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ladybug/LadybugComponent.cpp
r98 r99 32 32 // Construct the factory 33 33 static ComponentFactory<LadybugComponent> sFactory("LadybugComponent"); 34 static const size_t kMaxFilepathLength = 128;35 34 36 35 /* *Constructor*/ … … 57 56 lbTotalNumberOfImagesWritten = 0; 58 57 lbNumOfFrames = 0; 59 60 if (lbSaveJPGImages)61 {62 try63 {64 QString dbtFileName_ = "Camera_1.dbt";65 mDbtImage1.open(dbtFileName_.toStdString(), WriteMode, FILE_DBT_UNKNOWN, kMaxFilepathLength);66 } catch (DbiteException & e) {67 LOG_ERROR("error opening dbt file: " << e.what());68 }69 70 try71 {72 QString dbtFileName_ = "Camera_2.dbt";73 mDbtImage1.open(dbtFileName_.toStdString(), WriteMode, FILE_DBT_UNKNOWN, kMaxFilepathLength);74 } catch (DbiteException & e) {75 LOG_ERROR("error opening dbt file: " << e.what());76 }77 78 try79 {80 QString dbtFileName_ = "Camera_3.dbt";81 mDbtImage1.open(dbtFileName_.toStdString(), WriteMode, FILE_DBT_UNKNOWN, kMaxFilepathLength);82 } catch (DbiteException & e) {83 LOG_ERROR("error opening dbt file: " << e.what());84 }85 86 try87 {88 QString dbtFileName_ = "Camera_4.dbt";89 mDbtImage1.open(dbtFileName_.toStdString(), WriteMode, FILE_DBT_UNKNOWN, kMaxFilepathLength);90 } catch (DbiteException & e) {91 LOG_ERROR("error opening dbt file: " << e.what());92 }93 94 try95 {96 QString dbtFileName_ = "Camera_5.dbt";97 mDbtImage1.open(dbtFileName_.toStdString(), WriteMode, FILE_DBT_UNKNOWN, kMaxFilepathLength);98 } catch (DbiteException & e) {99 LOG_ERROR("error opening dbt file: " << e.what());100 }101 102 try103 {104 QString dbtFileName_ = "Camera_6.dbt";105 mDbtImage1.open(dbtFileName_.toStdString(), WriteMode, FILE_DBT_UNKNOWN, kMaxFilepathLength);106 } catch (DbiteException & e) {107 LOG_ERROR("error opening dbt file: " << e.what());108 }109 }110 111 if (lbSavePanoImage)112 {113 try114 {115 QString dbtFileName_ = "CameraPano.dbt";116 mDbtImage1.open(dbtFileName_.toStdString(), WriteMode, FILE_DBT_UNKNOWN, kMaxFilepathLength);117 } catch (DbiteException & e) {118 LOG_ERROR("error opening dbt file: " << e.what());119 }120 }121 122 58 THREAD_ALIVE = true; 123 59 start(); … … 130 66 printf (" \n*** Stopping Activity ***\n"); 131 67 LadybugError error; 132 133 // Close DBT files134 if (lbSaveJPGImages) {135 mDbtImage1.close();136 mDbtImage2.close();137 mDbtImage3.close();138 mDbtImage4.close();139 mDbtImage5.close();140 mDbtImage6.close();141 }142 143 if (lbSavePanoImage) {144 mDbtImagePano.close();145 }146 68 147 69 lbIsRecording = false; … … 222 144 CreateImageBuffers(); 223 145 224 // Timestamp225 road_time_t timestamp = 0;226 road_timerange_t tr = 0;227 228 146 while (THREAD_ALIVE) 229 147 { 230 231 148 lbCurrentTime = GetTickCount(); // road_time_t timestamp = road_time(); // ui64 ; unit microsec ; Orig 01/01/1970 00:00 232 149 lbFrameCount++; … … 241 158 242 159 error = ladybugGrabImage( lbContext, &image ); 243 timestamp= road_time(); // timestamp160 // t = road_time(); // timestamp 244 161 HandleError(error); 245 162 … … 328 245 HandleError(error); 329 246 330 331 // Use it to trigger the camera with the gps signal332 247 /*// Initialize Trigger 333 248 error = ladybugGetTriggerModeInfo( lbContext, &triggerModeInfo ); … … 441 356 HandleError(error); 442 357 443 if (uiCamera == 0)444 {445 try {446 mDbtImage1.writeRecord(time, tr, (char *) processedImage.pData, kMaxFilepathLength);447 } catch (DbiteException & e) {448 LOG_ERROR("error writing data: " << e.what());449 }450 } else if (uiCamera == 1) {451 try {452 mDbtImage2.writeRecord(time, tr, (char *) processedImage.pData, kMaxFilepathLength);453 } catch (DbiteException & e) {454 LOG_ERROR("error writing data: " << e.what());455 }456 }else if (uiCamera == 2) {457 try {458 mDbtImage3.writeRecord(time, tr, (char *) processedImage.pData, kMaxFilepathLength);459 } catch (DbiteException & e) {460 LOG_ERROR("error writing data: " << e.what());461 }462 }else if (uiCamera == 3) {463 try {464 mDbtImage4.writeRecord(time, tr, (char *) processedImage.pData, kMaxFilepathLength);465 } catch (DbiteException & e) {466 LOG_ERROR("error writing data: " << e.what());467 }468 }else if (uiCamera == 4) {469 try {470 mDbtImage5.writeRecord(time, tr, (char *) processedImage.pData, kMaxFilepathLength);471 } catch (DbiteException & e) {472 LOG_ERROR("error writing data: " << e.what());473 }474 }else if (uiCamera == 5) {475 try {476 mDbtImage6.writeRecord(time, tr, (char *) processedImage.pData, kMaxFilepathLength);477 } catch (DbiteException & e) {478 LOG_ERROR("error writing data: " << e.what());479 }480 }481 482 358 //printf("Saved camera %u image to %s.\n", uiCamera, pszOutputFilePath); 483 359 … … 525 401 error = ladybugSaveImage(lbContext, &processedImage, pszOutputFilePath, LADYBUG_FILEFORMAT_JPG); 526 402 HandleError(error); 527 528 try {529 mDbtImagePano.writeRecord(time, tr, (char *) processedImage.pData, kMaxFilepathLength);530 } catch (DbiteException & e) {531 LOG_ERROR("error writing data: " << e.what());532 }533 403 534 404 }
Note:
See TracChangeset
for help on using the changeset viewer.