Quellcode durchsuchen

提升相机拍照过程中的日志级别, 由debug提升到info

niujiuru vor 3 Wochen
Ursprung
Commit
34d67506df

+ 5 - 5
dh_takephoto/takephoto.c

@@ -58,9 +58,9 @@ static void OnFrameReceived(IMV_Frame *pFrame, void *pUser) // 数据帧的回
   if(NULL == pFrame) return;
 
   // 1, 打印该帧信息
-  sw_log_debug("[%s] +++GetOneFrame+++, Width[%u], Height[%u], FrameNum[%llu], FrameLen[%u], PixelType[0x%08X]", MODULE_NAME,
-                pFrame->frameInfo.width, pFrame->frameInfo.height, pFrame->frameInfo.blockId, pFrame->frameInfo.size,
-                (unsigned int)pFrame->frameInfo.pixelFormat);
+  sw_log_info("[%s] +++GetOneFrame+++, Width[%u], Height[%u], FrameNum[%llu], FrameLen[%u], PixelType[0x%08X]", MODULE_NAME,
+              pFrame->frameInfo.width, pFrame->frameInfo.height, pFrame->frameInfo.blockId, pFrame->frameInfo.size,
+              (unsigned int)pFrame->frameInfo.pixelFormat);
 
   // 2, 自动曝光模式
   if(ctx->isExposureAuto && waitAEDone != 0)
@@ -71,7 +71,7 @@ static void OnFrameReceived(IMV_Frame *pFrame, void *pUser) // 数据帧的回
 
     struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now);
     long elapsed = (now.tv_sec - ctx->expTime0.tv_sec)*1000 + (now.tv_nsec-ctx->expTime0.tv_nsec)/(1000*1000); // 计算时间差, 单位: ms
-    sw_log_debug("[%s] +++GetOneFrame+++, 等待曝光完成, ExposureTime = %.2fus, ElapsedTime = %ldms", MODULE_NAME, curExpTime, elapsed);
+    sw_log_info("[%s] +++GetOneFrame+++, 等待曝光完成, ExposureTime = %.2fus, ElapsedTime = %ldms", MODULE_NAME, curExpTime, elapsed);
 
     if(fabsf(curExpTime - ctx->lastExpTime) <= AE_EXP_TIME_EPS_US) ctx->expStableCnt++;
     else ctx->expStableCnt = 0;
@@ -100,7 +100,7 @@ static int FrameSoftTrigger(unsigned long wParam, unsigned long lParam) // 线
 
   while(sw_thrd_isAlive(hThrd))
   {
-    sw_log_debug("[%s] 触发一次拍照", MODULE_NAME);
+    sw_log_info("[%s] 触发一次拍照", MODULE_NAME);
     ret = IMV_ExecuteCommandFeature(ctx->hCam, "TriggerSoftware");
     if(IMV_OK != ret) { sw_log_error("[%s] 触发拍照失败, errCode=%d!!", MODULE_NAME,  ret); break; }
     else tick_ms = 0;

+ 5 - 5
hk_takephoto/takephoto.c

@@ -68,9 +68,9 @@ static int PhotoProc(unsigned long wParam, unsigned long lParam) // 线程回调
   // 3, 导出图像文件
   if(MV_OK == ret)
   {
-    sw_log_debug("[%s] +++GetOneFrame+++, Width[%u], Height[%u], FrameNum[%u], FrameLen[%u], PixelType[0x%08X]", MODULE_NAME,
-                  frame.stFrameInfo.nWidth, frame.stFrameInfo.nHeight, frame.stFrameInfo.nFrameNum, frame.stFrameInfo.nFrameLen,
-                  (unsigned int)frame.stFrameInfo.enPixelType);
+    sw_log_info("[%s] +++GetOneFrame+++, Width[%u], Height[%u], FrameNum[%u], FrameLen[%u], PixelType[0x%08X]", MODULE_NAME,
+                frame.stFrameInfo.nWidth, frame.stFrameInfo.nHeight, frame.stFrameInfo.nFrameNum, frame.stFrameInfo.nFrameLen,
+                (unsigned int)frame.stFrameInfo.enPixelType);
 
     if(ctx->isExposureAuto && waitAEDone != 0)
     { // 自动曝光模式下, 等待曝光稳定或超时
@@ -80,7 +80,7 @@ static int PhotoProc(unsigned long wParam, unsigned long lParam) // 线程回调
 
       struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now);
       long elapsed = (now.tv_sec - ctx->expTime0.tv_sec)*1000 + (now.tv_nsec-ctx->expTime0.tv_nsec)/(1000*1000); // 计算时间差, 单位: ms
-      sw_log_debug("[%s] +++GetOneFrame+++, 等待曝光完成, ExposureTime = %.2fus, ElapsedTime = %ldms", MODULE_NAME, curExpTime, elapsed);
+      sw_log_info("[%s] +++GetOneFrame+++, 等待曝光完成, ExposureTime = %.2fus, ElapsedTime = %ldms", MODULE_NAME, curExpTime, elapsed);
 
       if(fabsf(curExpTime - ctx->lastExpTime) <= AE_EXP_TIME_EPS_US) ctx->expStableCnt++;
       else ctx->expStableCnt = 0;
@@ -103,7 +103,7 @@ retp1:
   switch(ret)
   {
   case MV_E_NODATA: // 无数据时, 线程继续运行
-    sw_log_debug("[%s] +++GetOneFrame+++, 无数据, 继续等待...", MODULE_NAME);
+    sw_log_info("[%s] +++GetOneFrame+++, 无数据, 继续等待...", MODULE_NAME);
     ret = 1; break;
   default: // 成功或发生其他错误,线程结束运行
     ctx->rCode = ret; sw_signal_give(ctx->hESig); ret = -1; break;

BIN
package/rtu_linux_modules_1.0.0.1.tar.gz


BIN
package/yfkj_ssh_client_1.0.0.1.tar.gz