zhunk 3 months atrás
parent
commit
2f48103d58
73 changed files with 9253 additions and 3157 deletions
  1. 109 93
      Lib/mvs/Includes/CameraParams.h
  2. 920 1106
      Lib/mvs/Includes/MvCameraControl.h
  3. 138 141
      Lib/mvs/Includes/PixelType.h
  4. BIN
      Lib/mvs/MvCameraControl.jar
  5. BIN
      Lib/mvs/arm64-v8a/Custom/libCppUnit_gcc49_v3_0.so
  6. BIN
      Lib/mvs/arm64-v8a/Custom/libGCBase_gcc49_v3_0.so
  7. BIN
      Lib/mvs/arm64-v8a/Custom/libGenApi_gcc49_v3_0.so
  8. BIN
      Lib/mvs/arm64-v8a/Custom/libLog_gcc49_v3_0.so
  9. BIN
      Lib/mvs/arm64-v8a/Custom/libMVGigEVisionSDK.so
  10. BIN
      Lib/mvs/arm64-v8a/Custom/libMathParser_gcc49_v3_0.so
  11. BIN
      Lib/mvs/arm64-v8a/Custom/libMediaProcess.so
  12. BIN
      Lib/mvs/arm64-v8a/Custom/libMvCameraControl.so
  13. BIN
      Lib/mvs/arm64-v8a/Custom/libMvCameraControlWrapper.so
  14. BIN
      Lib/mvs/arm64-v8a/Custom/libMvUsb3vTL.so
  15. BIN
      Lib/mvs/arm64-v8a/Custom/libNodeMapData_gcc49_v3_0.so
  16. BIN
      Lib/mvs/arm64-v8a/Custom/libXmlParser_gcc49_v3_0.so
  17. BIN
      Lib/mvs/arm64-v8a/MvCameraControl.jar
  18. BIN
      Lib/mvs/arm64-v8a/libCppUnit_gcc49_v3_0.so
  19. BIN
      Lib/mvs/arm64-v8a/libGCBase_gcc49_v3_0.so
  20. BIN
      Lib/mvs/arm64-v8a/libGenApi_gcc49_v3_0.so
  21. BIN
      Lib/mvs/arm64-v8a/libLog_gcc49_v3_0.so
  22. BIN
      Lib/mvs/arm64-v8a/libMVGigEVisionSDK.so
  23. BIN
      Lib/mvs/arm64-v8a/libMathParser_gcc49_v3_0.so
  24. BIN
      Lib/mvs/arm64-v8a/libMediaProcess.so
  25. BIN
      Lib/mvs/arm64-v8a/libMvCameraControl.so
  26. BIN
      Lib/mvs/arm64-v8a/libMvCameraControlWrapper.so
  27. BIN
      Lib/mvs/arm64-v8a/libMvUsb3vTL.so
  28. BIN
      Lib/mvs/arm64-v8a/libNodeMapData_gcc49_v3_0.so
  29. BIN
      Lib/mvs/arm64-v8a/libXmlParser_gcc49_v3_0.so
  30. 3 1
      app_bzy_armhf_7/CMakeLists.txt
  31. 7 0
      app_bzy_armhf_7/android/AndroidManifest.xml
  32. 1 0
      app_bzy_armhf_7/android/build.gradle
  33. BIN
      app_bzy_armhf_7/android/libs/WifBaseServiceLib_v2.2.0_release.aar
  34. 1 1
      app_bzy_armhf_7/android/res/values/strings.xml
  35. 2 1
      app_bzy_armhf_7/android/src/com/yfkj/bzyv1/MyQtActivity.java
  36. 179 0
      app_bzy_armhf_7/android/src/com/yfkj/bzyv1/WifServiceBridge.java
  37. 30 0
      app_bzy_armhf_7/docs/Readme.md
  38. 4 1
      app_bzy_armhf_7/header/TreeModel.h
  39. 1 0
      app_bzy_armhf_7/header/m_json.h
  40. 107 8
      app_bzy_armhf_7/header/m_opencv.h
  41. 1 1
      app_bzy_armhf_7/header/main.h
  42. 4 0
      app_bzy_armhf_7/header/mserial.h
  43. 217 0
      app_bzy_armhf_7/header/wif_service.h
  44. 18 0
      app_bzy_armhf_7/main.cpp
  45. 3 1
      app_bzy_armhf_7/qml/model/DataModel.qml
  46. 130 135
      app_bzy_armhf_7/qml/pages/HomePage.qml
  47. 9 0
      app_bzy_armhf_7/qml/pages/LocalNotificationPage.qml
  48. 137 18
      app_bzy_armhf_7/qml/pages/PhotostitcherPage.qml
  49. 447 253
      app_bzy_armhf_7/qml/pages/TestPage.qml
  50. 66 3
      app_bzy_armhf_7/src/TreeModel.cpp
  51. 31 10
      app_bzy_armhf_7/src/cameramanager.cpp
  52. 22 0
      app_bzy_armhf_7/src/m_json.cpp
  53. 2133 273
      app_bzy_armhf_7/src/m_opencv.cpp
  54. 6 1
      app_bzy_armhf_7/src/mserial.cpp
  55. 459 0
      app_bzy_armhf_7/src/wif_service.cpp
  56. 2 9
      q6_felgo_iot/CMakeLists.txt
  57. 16 16
      q6_felgo_iot/CMakeLists.txt.user
  58. 13 0
      q6_felgo_iot/docs/Readme.md
  59. 4 1
      q6_felgo_iot/header/TreeModel.h
  60. 31 1
      q6_felgo_iot/header/cameramanager.h
  61. 131 3
      q6_felgo_iot/header/m_opencv.h
  62. 1 1
      q6_felgo_iot/header/main.h
  63. 1 0
      q6_felgo_iot/header/mqtthandler.h
  64. 0 35
      q6_felgo_iot/header/mserial.h
  65. 87 19
      q6_felgo_iot/qml/pages/HomePage.qml
  66. 136 18
      q6_felgo_iot/qml/pages/PhotostitcherPage.qml
  67. 1054 812
      q6_felgo_iot/qml/pages/TestPage.qml
  68. 65 2
      q6_felgo_iot/src/TreeModel.cpp
  69. 297 8
      q6_felgo_iot/src/cameramanager.cpp
  70. 2218 61
      q6_felgo_iot/src/m_opencv.cpp
  71. 5 0
      q6_felgo_iot/src/main.cpp
  72. 7 0
      q6_felgo_iot/src/mqtthandler.cpp
  73. 0 124
      q6_felgo_iot/src/mserial.cpp

+ 109 - 93
Lib/mvs/Includes/CameraParams.h

@@ -326,91 +326,6 @@ typedef struct _MV_CC_IMAGE_
 
 }MV_CC_IMAGE;
 
-typedef enum _MV_FRAME_EXTRA_INFO_TYPE_
-{
-    MV_FRAME_EXTRA_NO_INFO    = 0x0000,
-    MV_FRAME_EXTRA_SUBIMAGES  = 0x0001, // 子图
-    MV_FRAME_EXTRA_MULTIPARTS = 0x0002, // 多部分
-}MV_FRAME_EXTRA_INFO_TYPE;
-
-// ZONE方向(自上而下或者自下而上)
-typedef enum _MV_GIGE_ZONE_DIRECTION_
-{
-    MV_GIGE_PART_ZONE_TOP_DOWN = 0,
-    MV_GIGE_PART_ZONE_BOTTOM_UP = 1,
-} MV_GIGE_ZONE_DIRECTION;
-
-typedef struct _MV_GIGE_ZONE_INFO_
-{
-    MV_GIGE_ZONE_DIRECTION enDirection; // 解析方向 (0: 自上向下,1:自下向上)
-    union
-    {
-        unsigned char* pZoneAddr; // 起始地址
-        uint64_t       nAlign;    // 对齐
-    } stZone;
-    uint64_t nLength;           // 数据长度
-
-    unsigned int nReserved[6];  // 保留
-} MV_GIGE_ZONE_INFO;
-
-typedef union _MV_GIGE_MULRI_PART_DATA_INFO_
-{
-    // (data_type ≤ 0x0009) MV_MULTI_PART_DATA_TYPE
-    struct
-    {
-        unsigned int nSizeX;
-        unsigned int nSizeY;
-        unsigned int nOffsetX;
-        unsigned int nOffsetY;
-        unsigned short nPaddingX;
-    } stGeneral;
-
-    // (data_type == 0x000B or data_type == 0x000C) MV_MULTI_PART_DATA_TYPE
-    struct
-    {
-        unsigned char nJpegFlag;
-        unsigned int nTimestampTickFrequencyHigh;
-        unsigned int nTimestampTickFrequencyLow;
-        unsigned int nJpegDataFormat;
-    } stJpeg;
-
-    // 若是自定义类型则保留原始未解析数据,否则清空该字段
-    unsigned char pDataTypeSpecific[24];
-} MV_GIGE_PART_DATA_INFO;
-
-// 枚举类型
-typedef enum _MV_GIGE_MULTI_PART_DATA_TYPE_
-{
-    MV_GIGE_DT_2D_IMAGE_1_PLANAR = 0x0001,
-    MV_GIGE_DT_2D_IMAGE_2_PLANAR = 0x0002,
-    MV_GIGE_DT_2D_IMAGE_3_PLANAR = 0x0003,
-    MV_GIGE_DT_2D_IMAGE_4_PLANAR = 0x0004,
-    MV_GIGE_DT_3D_IMAGE_1_PLANAR = 0x0005,
-    MV_GIGE_DT_3D_IMAGE_2_PLANAR = 0x0006,
-    MV_GIGE_DT_3D_IMAGE_3_PLANAR = 0x0007,
-    MV_GIGE_DT_3D_IMAGE_4_PLANAR = 0x0008,
-    MV_GIGE_DT_CONFIDENCE_MAP = 0x0009,
-    MV_GIGE_DT_CHUNK_DATA = 0x000A,
-    MV_GIGE_DT_JPEG_IMAGE = 0x000B,
-    MV_GIGE_DT_JPEG2000_IMAGE = 0x000C,
-}MV_GIGE_MULTI_PART_DATA_TYPE;
-
-// MULTI_PART传输方式的缓存图像节点信息
-typedef struct _MV_GIGE_MULTI_PART_INFO_
-{
-    MV_GIGE_MULTI_PART_DATA_TYPE enDataType;         // 数据类型 MV_MULTI_PART_DATA_TYPE
-    unsigned int                 nDataFormat;        // 数据格式(例如像素格式)
-    unsigned int                 nSourceID;          // 图像源ID
-    unsigned int                 nRegionID;          // 区域ID
-    unsigned int                 nDataPurposeID;     // 目的ID
-    unsigned int                 nZones;             // 当前Part所包含的Zone区域数目
-    MV_GIGE_ZONE_INFO*           pZoneInfo;          // Zone信息
-    uint64_t                     nLength;            // 数据长度
-    unsigned char*               pPartAddr;             // 当前Part的起始数据地址
-    MV_GIGE_PART_DATA_INFO       stDataTypeSpecific;  // 数据类型携带的特定数据
-
-    unsigned int                 nReserved[8];       // 保留
-}MV_GIGE_MULTI_PART_INFO;
 
 /// \~chinese 输出帧的信息              \~english Output Frame Information
 typedef struct _MV_FRAME_OUT_INFO_EX_
@@ -465,18 +380,16 @@ typedef struct _MV_FRAME_OUT_INFO_EX_
     unsigned int            nExtendWidth;                           ///< [OUT] \~chinese 图像宽(扩展变量)       \~english Image Width
     unsigned int            nExtendHeight;                          ///< [OUT] \~chinese 图像高(扩展变量)       \~english Image Height
 
-    uint64_t                nFrameLenEx;                            ///< [OUT] \~chinese 帧的长度               \~english The Length of Frame
-
-    unsigned int            nExtraType;                             ///< [OUT] \~chinese 判断携带的额外信息的类型:子图(SubImageList)还是多图(MultiPartArray) MV_FRAME_EXTRA_INFO_TYPE类型
+	uint64_t                nFrameLenEx;                            ///< [OUT] \~chinese 帧的长度               \~english The Length of Frame
 
-    unsigned int            nSubImageNum;                           ///< [OUT] \~chinese 图像缓存中的子图(多图)个数  \~english Sub Image(MulitiPart) Number
+    unsigned int            nReserved1;                             ///< [OUT] \~chinese 保留,用于对齐         \~english Reserved
 
+    unsigned int            nSubImageNum;                           ///< [OUT] \~chinese 图像缓存中的子图个数
     union
     {
-        MV_CC_IMAGE* pstSubImage;                                   ///< [OUT] \~chinese 子图信息 \~english Sub image info
-        MV_GIGE_MULTI_PART_INFO* pstPartInfo;                       ///< [OUT] \~chinese 图像部分信息 \~english Image Parts Information
-        int64_t      nAligning;                                     ///< [OUT] \~chinese 校准 \~english Aligning
-    } SubImageList;
+        MV_CC_IMAGE*        pstSubImage;                            ///< [OUT] \~chinese 子图信息               \~english Sub image info
+        int64_t             nAligning;                              ///< [OUT] \~chinese 校准                   \~english Aligning
+    }SubImageList;
 
     union
     {
@@ -1438,4 +1351,107 @@ typedef struct _MV_CAML_SERIAL_PORT_LIST_
     unsigned int                  nRes[4];                               ///<\~chinese 预留                             \~english Reserved
 }MV_CAML_SERIAL_PORT_LIST;
 
+/// \~chinese 六轴色彩调整参数 (RGBYCM 六个颜色轴)  \~english Six-axis color adjustment parameter (RGBYCM)
+typedef struct _MV_CC_SIX_AXIS_PARAM_T_
+{
+    float   fHueR;                                  ///< [IN]  \~chinese R 色调         \~english R Hue
+    float   fSatR;                                  ///< [IN]  \~chinese R 饱和度       \~english R Saturation
+    float   fHueG;                                  ///< [IN]  \~chinese G 色调         \~english G Hue
+    float   fSatG;                                  ///< [IN]  \~chinese G 饱和度       \~english G Saturation
+    float   fHueB;                                  ///< [IN]  \~chinese B 色调         \~english B Hue
+    float   fSatB;                                  ///< [IN]  \~chinese B 饱和度       \~english B Saturation
+    float   fHueC;                                  ///< [IN]  \~chinese C 色调         \~english C Hue
+    float   fSatC;                                  ///< [IN]  \~chinese C 饱和度       \~english C Saturation
+    float   fHueM;                                  ///< [IN]  \~chinese M 色调         \~english M Hue
+    float   fSatM;                                  ///< [IN]  \~chinese M 饱和度       \~english M Saturation
+    float   fHueY;                                  ///< [IN]  \~chinese Y 色调         \~english Y Hue
+    float   fSatY;                                  ///< [IN]  \~chinese Y 饱和度       \~english Y Saturation
+    unsigned int    nRes[8];                        ///<       \~chinese 预留           \~english Reserved
+} MV_CC_SIX_AXIS_PARAM;
+
+/// \~chinese CCM校正参数               \~english CCM correction parameter
+typedef struct _MV_CC_CCM_CORRECT_PARAM_T_
+{
+    enum MvGvspPixelType    enPixelType;            ///< [IN]  \~chinese 像素格式               \~english Pixel format
+    unsigned int            nWidth;                 ///< [IN]  \~chinese 图像宽度               \~english Image width
+    unsigned int            nHeight;                ///< [IN]  \~chinese 图像高度               \~english Image height
+    unsigned char*          pSrcBuf;                ///< [IN]  \~chinese 输入图像数据           \~english Input image data
+    unsigned int            nSrcBufLen;             ///< [IN]  \~chinese 输入数据长度           \~english Input data length
+    unsigned char*          pDstBuf;                ///< [OUT] \~chinese 输出图像数据           \~english Output image data
+    unsigned int            nDstBufSize;            ///< [IN]  \~chinese 输出缓冲区大小         \~english Output buffer size
+    unsigned int            nDstBufLen;             ///< [OUT] \~chinese 输出数据长度           \~english Output data length
+
+    MV_CC_CCM_PARAM_EX      stCCMParam;             ///< [IN]  \~chinese CCM参数(不使能时bCCMEnable=false) \~english CCM parameter
+    MV_CC_GAMMA_PARAM       stGammaParam;           ///< [IN]  \~chinese Gamma参数(不使能时enGammaType=NONE) \~english Gamma parameter
+
+    unsigned int            nRes[32];               ///<       \~chinese 保留字节               \~english Reserved
+} MV_CC_CCM_CORRECT_PARAM;
+
+/// \~chinese 超级调色盘校正参数         \~english Super palette correction parameter
+typedef struct _MV_CC_SIX_AXIS_CORRECT_PARAM_T_
+{
+    enum MvGvspPixelType    enPixelType;            ///< [IN]  \~chinese 像素格式               \~english Pixel format
+    unsigned int            nWidth;                 ///< [IN]  \~chinese 图像宽度               \~english Image width
+    unsigned int            nHeight;                ///< [IN]  \~chinese 图像高度               \~english Image height
+    unsigned char*          pSrcBuf;                ///< [IN]  \~chinese 输入图像数据           \~english Input image data
+    unsigned int            nSrcBufLen;             ///< [IN]  \~chinese 输入数据长度           \~english Input data length
+    unsigned char*          pDstBuf;                ///< [OUT] \~chinese 输出图像数据           \~english Output image data
+    unsigned int            nDstBufSize;            ///< [IN]  \~chinese 输出缓冲区大小         \~english Output buffer size
+    unsigned int            nDstBufLen;             ///< [OUT] \~chinese 输出数据长度           \~english Output data length
+
+    MV_CC_CCM_PARAM_EX      stCCMParam;             ///< [IN]  \~chinese CCM参数               \~english CCM parameter
+    MV_CC_GAMMA_PARAM       stGammaParam;           ///< [IN]  \~chinese Gamma参数             \~english Gamma parameter
+    MV_CC_SIX_AXIS_PARAM    stSixAxis;              ///< [IN]  \~chinese 六轴色彩调整参数       \~english Six-axis color adjustment param
+
+    unsigned int            nRes[8];                ///<       \~chinese 保留字节               \~english Reserved
+} MV_CC_SIX_AXIS_CORRECT_PARAM;
+
+#define MV_CC_LCE_DETAIL_SCALE_MIN          0       ///< \~chinese 纹理比例系数最小值    \~english Min detail scale
+#define MV_CC_LCE_DETAIL_SCALE_MAX          1280    ///< \~chinese 纹理比例系数最大值    \~english Max detail scale
+#define MV_CC_LCE_DETAIL_SCALE_DEFAULT      128     ///< \~chinese 纹理比例系数默认值    \~english Default detail scale
+#define MV_CC_LCE_BRIGHTNESS_CTRL_MIN       0       ///< \~chinese 提亮系数最小值        \~english Min brightness control ratio
+#define MV_CC_LCE_BRIGHTNESS_CTRL_MAX       256     ///< \~chinese 提亮系数最大值        \~english Max brightness control ratio
+#define MV_CC_LCE_BRIGHTNESS_CTRL_DEFAULT   50      ///< \~chinese 提亮系数默认值        \~english Default brightness control ratio
+
+/// \~chinese 局部对比度增强参数         \~english Local contrast enhance parameter
+typedef struct _MV_CC_LCE_PARAM_T_
+{
+    enum MvGvspPixelType    enPixelType;            ///< [IN]  \~chinese 像素格式               \~english Pixel format
+    unsigned int            nWidth;                 ///< [IN]  \~chinese 图像宽度               \~english Image width
+    unsigned int            nHeight;                ///< [IN]  \~chinese 图像高度               \~english Image height
+    unsigned char*          pSrcBuf;                ///< [IN]  \~chinese 输入图像数据           \~english Input image data
+    unsigned int            nSrcBufLen;             ///< [IN]  \~chinese 输入数据长度           \~english Input data length
+    unsigned char*          pDstBuf;                ///< [OUT] \~chinese 输出图像数据           \~english Output image data
+    unsigned int            nDstBufSize;            ///< [IN]  \~chinese 输出缓冲区大小         \~english Output buffer size
+    unsigned int            nDstBufLen;             ///< [OUT] \~chinese 输出数据长度           \~english Output data length
+
+    unsigned int            nDetailScale;           ///< [IN]  \~chinese 纹理图像比例系数(128x), 默认128 \~english Detail scale factor, default 128
+    unsigned int            nBrightnessCtrlRatio;   ///< [IN]  \~chinese 提亮控制系数比率, 默认50 \~english Brightness control ratio, default 50
+
+    unsigned int            nRes[32];               ///<       \~chinese 保留字节               \~english Reserved
+} MV_CC_LCE_PARAM;
+
+#define MV_CC_SUPER_BINNING_SCALE_MIN       200     ///< \~chinese 缩放比例最小值        \~english Min super binning scale
+#define MV_CC_SUPER_BINNING_SCALE_MAX       2800    ///< \~chinese 缩放比例最大值        \~english Max super binning scale
+#define MV_CC_SUPER_BINNING_SCALE_DEFAULT   1000    ///< \~chinese 缩放比例默认值        \~english Default super binning scale
+
+/// \~chinese 超级像素合并参数           \~english Super binning parameter
+typedef struct _MV_CC_SUPER_BINNING_PARAM_T_
+{
+    enum MvGvspPixelType    enPixelType;            ///< [IN]  \~chinese 像素格式               \~english Pixel format
+    unsigned int            nWidth;                 ///< [IN]  \~chinese 输入图像宽度           \~english Input image width
+    unsigned int            nHeight;                ///< [IN]  \~chinese 输入图像高度           \~english Input image height
+    unsigned char*          pSrcBuf;                ///< [IN]  \~chinese 输入图像数据           \~english Input image data
+    unsigned int            nSrcBufLen;             ///< [IN]  \~chinese 输入数据长度           \~english Input data length
+    unsigned char*          pDstBuf;                ///< [OUT] \~chinese 输出图像数据           \~english Output image data
+    unsigned int            nDstBufSize;            ///< [IN]  \~chinese 输出缓冲区大小         \~english Output buffer size
+    unsigned int            nDstBufLen;             ///< [OUT] \~chinese 输出数据长度           \~english Output data length
+
+    unsigned int            nDstWidth;              ///< [OUT] \~chinese 输出图像宽度           \~english Output image width
+    unsigned int            nDstHeight;             ///< [OUT] \~chinese 输出图像高度           \~english Output image height
+
+    unsigned int            nScale;                 ///< [IN]  \~chinese 缩放比例(1/1000), 默认1000 \~english Scale factor(1/1000), default 1000
+
+    unsigned int            nRes[32];               ///<       \~chinese 保留字节               \~english Reserved
+} MV_CC_SUPER_BINNING_PARAM;
 #endif /* _MV_CAMERA_PARAMS_H_ */

File diff suppressed because it is too large
+ 920 - 1106
Lib/mvs/Includes/MvCameraControl.h


+ 138 - 141
Lib/mvs/Includes/PixelType.h

@@ -24,172 +24,169 @@
 #define MV_GVSP_PIX_ID_MASK                             0x0000FFFF
 #define MV_GVSP_PIX_COUNT                               0x46 // next Pixel ID available
 
-/// \addtogroup 像素格式定义
-///@{
-
-///< \~chinese 图片格式定义
 enum MvGvspPixelType
 {
     // Undefined pixel type
 #ifdef WIN32
-	PixelType_Gvsp_Undefined                =   0xFFFFFFFF,     ///< 未定义的像素类型
+	PixelType_Gvsp_Undefined                =   0xFFFFFFFF, 
 
 #else
-	PixelType_Gvsp_Undefined                =   -1,             ///< 未定义的像素类型
+	PixelType_Gvsp_Undefined                =   -1, 
 
 #endif
     // Mono buffer format defines
-    PixelType_Gvsp_Mono1p                   = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(1) | 0x0037),                  ///< Mono1p
-    PixelType_Gvsp_Mono2p                   = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(2) | 0x0038),                  ///< Mono2p
-    PixelType_Gvsp_Mono4p                   = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(4) | 0x0039),                  ///< Mono4p
-    PixelType_Gvsp_Mono8                    = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0001),                  ///< Mono8
-    PixelType_Gvsp_Mono8_Signed             = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0002),                  ///< Mono8_Signed
-    PixelType_Gvsp_Mono10                   = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0003),                 ///< Mono10
-    PixelType_Gvsp_Mono10_Packed            = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0004),                 ///< Mono10_Packed
-    PixelType_Gvsp_Mono12                   = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0005),                 ///< Mono12
-    PixelType_Gvsp_Mono12_Packed            = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0006),                 ///< Mono12_Packed
-    PixelType_Gvsp_Mono14                   = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0025),                 ///< Mono14
-    PixelType_Gvsp_Mono16                   = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0007),                 ///< Mono16
+    PixelType_Gvsp_Mono1p                   =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(1) | 0x0037),
+    PixelType_Gvsp_Mono2p                   =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(2) | 0x0038),
+    PixelType_Gvsp_Mono4p                   =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(4) | 0x0039),
+    PixelType_Gvsp_Mono8                    =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0001),
+    PixelType_Gvsp_Mono8_Signed             =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8)  | 0x0002),    
+    PixelType_Gvsp_Mono10                   =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0003),
+    PixelType_Gvsp_Mono10_Packed            =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0004),
+    PixelType_Gvsp_Mono12                   =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0005),
+    PixelType_Gvsp_Mono12_Packed            =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0006),
+    PixelType_Gvsp_Mono14                   =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0025),
+    PixelType_Gvsp_Mono16                   =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0007),
 
     // Bayer buffer format defines 
-    PixelType_Gvsp_BayerGR8                 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0008),                  ///< BayerGR8
-    PixelType_Gvsp_BayerRG8                 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0009),                  ///< BayerRG8
-    PixelType_Gvsp_BayerGB8                 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000A),                  ///< BayerGB8
-    PixelType_Gvsp_BayerBG8                 = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000B),                  ///< BayerBG8
-    PixelType_Gvsp_BayerRBGG8               = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0046),                  ///< BayerRBGG8
-    PixelType_Gvsp_BayerGR10                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000C),                 ///< BayerGR10
-    PixelType_Gvsp_BayerRG10                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000D),                 ///< BayerRG10
-    PixelType_Gvsp_BayerGB10                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000E),                 ///< BayerGB10
-    PixelType_Gvsp_BayerBG10                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000F),                 ///< BayerBG10
-    PixelType_Gvsp_BayerGR12                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0010),                 ///< BayerGR12
-    PixelType_Gvsp_BayerRG12                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0011),                 ///< BayerRG12
-    PixelType_Gvsp_BayerGB12                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0012),                 ///< BayerGB12
-    PixelType_Gvsp_BayerBG12                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0013),                 ///< BayerBG12
-    PixelType_Gvsp_BayerGR10_Packed         = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0026),                 ///< BayerGR10_Packed
-    PixelType_Gvsp_BayerRG10_Packed         = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0027),                 ///< BayerRG10_Packed
-    PixelType_Gvsp_BayerGB10_Packed         = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0028),                 ///< BayerGB10_Packed
-    PixelType_Gvsp_BayerBG10_Packed         = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0029),                 ///< BayerBG10_Packed
-    PixelType_Gvsp_BayerGR12_Packed         = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002A),                 ///< BayerGR12_Packed
-    PixelType_Gvsp_BayerRG12_Packed         = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002B),                 ///< BayerRG12_Packed
-    PixelType_Gvsp_BayerGB12_Packed         = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002C),                 ///< BayerGB12_Packed
-    PixelType_Gvsp_BayerBG12_Packed         = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002D),                 ///< BayerBG12_Packed
-    PixelType_Gvsp_BayerGR16                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x002E),                 ///< BayerGR16
-    PixelType_Gvsp_BayerRG16                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x002F),                 ///< BayerRG16
-    PixelType_Gvsp_BayerGB16                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0030),                 ///< BayerGB16
-    PixelType_Gvsp_BayerBG16                = (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0031),                 ///< BayerBG16
+    PixelType_Gvsp_BayerGR8                 =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0008),
+    PixelType_Gvsp_BayerRG8                 =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0009),
+    PixelType_Gvsp_BayerGB8                 =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000A),
+    PixelType_Gvsp_BayerBG8                 =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000B),
+    PixelType_Gvsp_BayerRBGG8               =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0046),
+    PixelType_Gvsp_BayerGR10                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000C),
+    PixelType_Gvsp_BayerRG10                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000D),
+    PixelType_Gvsp_BayerGB10                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000E),
+    PixelType_Gvsp_BayerBG10                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000F),
+    PixelType_Gvsp_BayerGR12                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0010),
+    PixelType_Gvsp_BayerRG12                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0011),
+    PixelType_Gvsp_BayerGB12                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0012),
+    PixelType_Gvsp_BayerBG12                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0013),
+    PixelType_Gvsp_BayerGR10_Packed         =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0026),
+    PixelType_Gvsp_BayerRG10_Packed         =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0027),
+    PixelType_Gvsp_BayerGB10_Packed         =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0028),
+    PixelType_Gvsp_BayerBG10_Packed         =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0029),
+    PixelType_Gvsp_BayerGR12_Packed         =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002A),
+    PixelType_Gvsp_BayerRG12_Packed         =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002B),
+    PixelType_Gvsp_BayerGB12_Packed         =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002C),
+    PixelType_Gvsp_BayerBG12_Packed         =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002D),
+    PixelType_Gvsp_BayerGR16                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x002E),
+    PixelType_Gvsp_BayerRG16                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x002F),
+    PixelType_Gvsp_BayerGB16                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0030),
+    PixelType_Gvsp_BayerBG16                =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0031),
 
     // RGB Packed buffer format defines 
-    PixelType_Gvsp_RGB8_Packed              =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0014),                  ///< RGB8_Packed
-    PixelType_Gvsp_BGR8_Packed              =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0015),                  ///< BGR8_Packed
-    PixelType_Gvsp_RGBA8_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0016),                  ///< RGBA8_Packed
-    PixelType_Gvsp_BGRA8_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0017),                  ///< BGRA8_Packed
-    PixelType_Gvsp_RGB10_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0018),                  ///< RGB10_Packed
-    PixelType_Gvsp_BGR10_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0019),                  ///< BGR10_Packed
-    PixelType_Gvsp_RGB12_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x001A),                  ///< RGB12_Packed
-    PixelType_Gvsp_BGR12_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x001B),                  ///< BGR12_Packed
-    PixelType_Gvsp_RGB16_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0033),                  ///< RGB16_Packed
-    PixelType_Gvsp_BGR16_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x004B),                  ///< BGR16_Packed
-    PixelType_Gvsp_RGBA16_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0064),                  ///< RGBA16_Packed
-    PixelType_Gvsp_BGRA16_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0051),                  ///< BGRA16_Packed
-    PixelType_Gvsp_RGB10V1_Packed           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x001C),                  ///< RGB10V1_Packed
-    PixelType_Gvsp_RGB10V2_Packed           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x001D),                  ///< RGB10V2_Packed
-    PixelType_Gvsp_RGB12V1_Packed           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(36) | 0X0034),                  ///< RGB12V1_Packed
-    PixelType_Gvsp_RGB565_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0035),                  ///< RGB565_Packed
-    PixelType_Gvsp_BGR565_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0X0036),                  ///< BGR565_Packed
+    PixelType_Gvsp_RGB8_Packed              =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0014),
+    PixelType_Gvsp_BGR8_Packed              =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0015),
+    PixelType_Gvsp_RGBA8_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0016),
+    PixelType_Gvsp_BGRA8_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0017),
+    PixelType_Gvsp_RGB10_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0018),
+    PixelType_Gvsp_BGR10_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0019),
+    PixelType_Gvsp_RGB12_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x001A),
+    PixelType_Gvsp_BGR12_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x001B),
+    PixelType_Gvsp_RGB16_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0033),
+    PixelType_Gvsp_BGR16_Packed             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x004B),
+    PixelType_Gvsp_RGBA16_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0064),
+    PixelType_Gvsp_BGRA16_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0051),
+    PixelType_Gvsp_RGB10V1_Packed           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x001C),
+    PixelType_Gvsp_RGB10V2_Packed           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x001D),
+    PixelType_Gvsp_RGB12V1_Packed           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(36) | 0X0034),
+    PixelType_Gvsp_RGB565_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0035),
+    PixelType_Gvsp_BGR565_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0X0036),
 
     // YUV Packed buffer format defines 
-    PixelType_Gvsp_YUV411_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x001E),                  ///< YUV411_Packed
-    PixelType_Gvsp_YUV422_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x001F),                  ///< YUV422_Packed
-    PixelType_Gvsp_YUV422_YUYV_Packed       =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0032),                  ///< YUV422_YUYV_Packed
-    PixelType_Gvsp_YUV444_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0020),                  ///< YUV444_Packed
-    PixelType_Gvsp_YCBCR8_CBYCR             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x003A),                  ///< YCBCR8_CBYCR
-    PixelType_Gvsp_YCBCR422_8               =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x003B),                  ///< YCBCR422_8
-    PixelType_Gvsp_YCBCR422_8_CBYCRY        =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0043),                  ///< YCBCR422_8_CBYCRY
-    PixelType_Gvsp_YCBCR411_8_CBYYCRYY      =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x003C),                  ///< YCBCR411_8_CBYYCRYY
-    PixelType_Gvsp_YCBCR601_8_CBYCR         =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x003D),                  ///< YCBCR601_8_CBYCR
-    PixelType_Gvsp_YCBCR601_422_8           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x003E),                  ///< YCBCR601_422_8
-    PixelType_Gvsp_YCBCR601_422_8_CBYCRY    =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0044),                  ///< YCBCR601_422_8_CBYCRY
-    PixelType_Gvsp_YCBCR601_411_8_CBYYCRYY  =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x003F),                  ///< YCBCR601_411_8_CBYYCRYY
-    PixelType_Gvsp_YCBCR709_8_CBYCR         =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0040),                  ///< YCBCR709_8_CBYCR
-    PixelType_Gvsp_YCBCR709_422_8           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0041),                  ///< YCBCR709_422_8
-    PixelType_Gvsp_YCBCR709_422_8_CBYCRY    =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0045),                  ///< YCBCR709_422_8_CBYCRY
-    PixelType_Gvsp_YCBCR709_411_8_CBYYCRYY  =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x0042),                  ///< YCBCR709_411_8_CBYYCRYY
+    PixelType_Gvsp_YUV411_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x001E),
+    PixelType_Gvsp_YUV422_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x001F),
+    PixelType_Gvsp_YUV422_YUYV_Packed       =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0032),
+    PixelType_Gvsp_YUV444_Packed            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0020),
+    PixelType_Gvsp_YCBCR8_CBYCR             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x003A),
+    PixelType_Gvsp_YCBCR422_8               =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x003B),
+    PixelType_Gvsp_YCBCR422_8_CBYCRY        =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0043),
+    PixelType_Gvsp_YCBCR411_8_CBYYCRYY      =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x003C),
+    PixelType_Gvsp_YCBCR601_8_CBYCR         =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x003D),
+    PixelType_Gvsp_YCBCR601_422_8           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x003E),
+    PixelType_Gvsp_YCBCR601_422_8_CBYCRY    =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0044),
+    PixelType_Gvsp_YCBCR601_411_8_CBYYCRYY  =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x003F),
+    PixelType_Gvsp_YCBCR709_8_CBYCR         =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0040),
+    PixelType_Gvsp_YCBCR709_422_8           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0041),
+    PixelType_Gvsp_YCBCR709_422_8_CBYCRY    =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0045),
+    PixelType_Gvsp_YCBCR709_411_8_CBYYCRYY  =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x0042),
 
     // YUV420
-    PixelType_Gvsp_YUV420SP_NV12            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x8001),                  ///< YUV420SP_NV12
-    PixelType_Gvsp_YUV420SP_NV21            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x8002),                  ///< YUV420SP_NV21
+    PixelType_Gvsp_YUV420SP_NV12            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x8001),
+    PixelType_Gvsp_YUV420SP_NV21            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(12) | 0x8002),
 
     // RGB Planar buffer format defines 
-    PixelType_Gvsp_RGB8_Planar              =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0021),                  ///< RGB8_Planar
-    PixelType_Gvsp_RGB10_Planar             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0022),                  ///< RGB10_Planar
-    PixelType_Gvsp_RGB12_Planar             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0023),                  ///< RGB12_Planar
-    PixelType_Gvsp_RGB16_Planar             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0024),                  ///< RGB16_Planar
+    PixelType_Gvsp_RGB8_Planar              =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0021),
+    PixelType_Gvsp_RGB10_Planar             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0022),
+    PixelType_Gvsp_RGB12_Planar             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0023),
+    PixelType_Gvsp_RGB16_Planar             =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0024),
 
     // 自定义的图片格式
-    PixelType_Gvsp_Jpeg                     =   (MV_GVSP_PIX_CUSTOM | MV_PIXEL_BIT_COUNT(24) | 0x0001),                  ///< Jpeg
-
-    PixelType_Gvsp_Coord3D_ABC32f           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(96) | 0x00C0),                  ///< 0x026000C0X
-    PixelType_Gvsp_Coord3D_ABC32f_Planar    =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(96) | 0x00C1),                  ///< 0x026000C1X
-
-    PixelType_Gvsp_Coord3D_AC32f            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(40) | 0x00C2),      ///< 该值被废弃,请参考PixelType_Gvsp_Coord3D_AC32f_64; the value is discarded
-    PixelType_Gvsp_COORD3D_DEPTH_PLUS_MASK  =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(28) | 0x0001),     ///< 该值被废弃; the value is discarded    (已放入Chunkdata)
-
-    PixelType_Gvsp_Coord3D_ABC32            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(96) | 0x3001),          ///< Coord3D_ABC32
-    PixelType_Gvsp_Coord3D_AB32f            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x3002),          ///< Coord3D_AB32f
-    PixelType_Gvsp_Coord3D_AB32             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x3003),          ///< Coord3D_AB32
-    PixelType_Gvsp_Coord3D_AC32f_64         =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x00C2),                               ///< Coord3D_AC32f_64
-    PixelType_Gvsp_Coord3D_AC32f_Planar     =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x00C3),                               ///< Coord3D_AC32f_Planar
-    PixelType_Gvsp_Coord3D_AC32             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x3004),          ///< Coord3D_AC32
-    PixelType_Gvsp_Coord3D_A32f             =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x00BD),                                ///< Coord3D_A32f
-    PixelType_Gvsp_Coord3D_A32              =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x3005),           ///< Coord3D_A32
-    PixelType_Gvsp_Coord3D_C32f             =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x00BF),                                ///< Coord3D_C32f
-    PixelType_Gvsp_Coord3D_C32              =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x3006),           ///< Coord3D_C32
-    PixelType_Gvsp_Coord3D_ABC16            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x00B9),                               ///< Coord3D_ABC16
-    PixelType_Gvsp_Coord3D_C16              =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x00B8),                                ///< Coord3D_C16
-
-    PixelType_Gvsp_Float32                  =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x0001),  //0x81200001
+    PixelType_Gvsp_Jpeg                     =   (MV_GVSP_PIX_CUSTOM | MV_PIXEL_BIT_COUNT(24) | 0x0001),
+
+    PixelType_Gvsp_Coord3D_ABC32f           =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(96) | 0x00C0),//0x026000C0
+    PixelType_Gvsp_Coord3D_ABC32f_Planar    =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(96) | 0x00C1),//0x026000C1
+
+    // 该值被废弃,请参考PixelType_Gvsp_Coord3D_AC32f_64; the value is discarded
+    PixelType_Gvsp_Coord3D_AC32f            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(40) | 0x00C2),
+    // 该值被废弃; the value is discarded    (已放入Chunkdata)
+    PixelType_Gvsp_COORD3D_DEPTH_PLUS_MASK  =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(28) | 0x0001),
+
+    PixelType_Gvsp_Coord3D_ABC32            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(96) | 0x3001),//0x82603001
+    PixelType_Gvsp_Coord3D_AB32f            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x3002),//0x82403002
+    PixelType_Gvsp_Coord3D_AB32             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x3003),//0x82403003
+    PixelType_Gvsp_Coord3D_AC32f_64         =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x00C2),//0x024000C2
+    PixelType_Gvsp_Coord3D_AC32f_Planar     =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x00C3),//0x024000C3
+    PixelType_Gvsp_Coord3D_AC32             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x3004),//0x82403004
+    PixelType_Gvsp_Coord3D_A32f             =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x00BD),//0x012000BD
+    PixelType_Gvsp_Coord3D_A32              =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x3005),//0x81203005
+    PixelType_Gvsp_Coord3D_C32f             =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x00BF),//0x012000BF
+    PixelType_Gvsp_Coord3D_C32              =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x3006),//0x81203006
+    PixelType_Gvsp_Coord3D_ABC16            =   (MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x00B9),//0x023000B9
+    PixelType_Gvsp_Coord3D_C16              =   (MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x00B8),//0x011000B8
+
+    PixelType_Gvsp_Float32                  =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(32) | 0x0001),//0x81200001
 
     //无损压缩像素格式定义
-    PixelType_Gvsp_HB_Mono8                    =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0001),         ///< HB_Mono8
-    PixelType_Gvsp_HB_Mono10                   =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0003),        ///< HB_Mono10
-    PixelType_Gvsp_HB_Mono10_Packed            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0004),        ///< HB_Mono10_Packed
-    PixelType_Gvsp_HB_Mono12                   =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0005),        ///< HB_Mono12
-    PixelType_Gvsp_HB_Mono12_Packed            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0006),        ///< HB_Mono12_Packed
-    PixelType_Gvsp_HB_Mono16                   =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0007),        ///< HB_Mono16
-    PixelType_Gvsp_HB_BayerGR8                 =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0008),         ///< HB_BayerGR8
-    PixelType_Gvsp_HB_BayerRG8                 =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0009),         ///< HB_BayerRG8
-    PixelType_Gvsp_HB_BayerGB8                 =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000A),         ///< HB_BayerGB8
-    PixelType_Gvsp_HB_BayerBG8                 =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000B),         ///< HB_BayerBG8
-    PixelType_Gvsp_HB_BayerRBGG8               =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0046),         ///< HB_BayerRBGG8
-    PixelType_Gvsp_HB_BayerGR10                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000C),        ///< HB_BayerGR10
-    PixelType_Gvsp_HB_BayerRG10                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000D),        ///< HB_BayerRG10
-    PixelType_Gvsp_HB_BayerGB10                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000E),        ///< HB_BayerGB10
-    PixelType_Gvsp_HB_BayerBG10                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000F),        ///< HB_BayerBG10
-    PixelType_Gvsp_HB_BayerGR12                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0010),        ///< HB_BayerGR12
-    PixelType_Gvsp_HB_BayerRG12                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0011),        ///< HB_BayerRG12
-    PixelType_Gvsp_HB_BayerGB12                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0012),        ///< HB_BayerGB12
-    PixelType_Gvsp_HB_BayerBG12                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0013),        ///< HB_BayerBG12
-    PixelType_Gvsp_HB_BayerGR10_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0026),        ///< HB_BayerGR10_Packed
-    PixelType_Gvsp_HB_BayerRG10_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0027),        ///< HB_BayerRG10_Packed
-    PixelType_Gvsp_HB_BayerGB10_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0028),        ///< HB_BayerGB10_Packed
-    PixelType_Gvsp_HB_BayerBG10_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0029),        ///< HB_BayerBG10_Packed
-    PixelType_Gvsp_HB_BayerGR12_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002A),        ///< HB_BayerGR12_Packed
-    PixelType_Gvsp_HB_BayerRG12_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002B),        ///< HB_BayerRG12_Packed
-    PixelType_Gvsp_HB_BayerGB12_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002C),        ///< HB_BayerGB12_Packed
-    PixelType_Gvsp_HB_BayerBG12_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002D),        ///< HB_BayerBG12_Packed
-    PixelType_Gvsp_HB_YUV422_Packed            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x001F),       ///< HB_YUV422_Packed
-    PixelType_Gvsp_HB_YUV422_YUYV_Packed       =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0032),       ///< HB_YUV422_YUYV_Packed
-    PixelType_Gvsp_HB_RGB8_Packed              =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0014),       ///< HB_RGB8_Packed
-    PixelType_Gvsp_HB_BGR8_Packed              =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0015),       ///< HB_BGR8_Packed
-    PixelType_Gvsp_HB_RGBA8_Packed             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0016),       ///< HB_RGBA8_Packed
-    PixelType_Gvsp_HB_BGRA8_Packed             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0017),       ///< HB_BGRA8_Packed
-    PixelType_Gvsp_HB_RGB16_Packed             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0033),       ///< HB_RGB16_Packed
-    PixelType_Gvsp_HB_BGR16_Packed             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x004B),       ///< HB_BGR16_Packed
-    PixelType_Gvsp_HB_RGBA16_Packed            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0064),       ///< HB_RGBA16_Packed
-    PixelType_Gvsp_HB_BGRA16_Packed            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0051),       ///< HB_BGRA16_Packed
+    PixelType_Gvsp_HB_Mono8                    =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0001),
+    PixelType_Gvsp_HB_Mono10                   =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0003),
+    PixelType_Gvsp_HB_Mono10_Packed            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0004),
+    PixelType_Gvsp_HB_Mono12                   =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0005),
+    PixelType_Gvsp_HB_Mono12_Packed            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0006),
+    PixelType_Gvsp_HB_Mono16                   =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0007),
+    PixelType_Gvsp_HB_BayerGR8                 =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0008),
+    PixelType_Gvsp_HB_BayerRG8                 =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0009),
+    PixelType_Gvsp_HB_BayerGB8                 =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000A),
+    PixelType_Gvsp_HB_BayerBG8                 =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x000B),
+    PixelType_Gvsp_HB_BayerRBGG8               =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(8) | 0x0046),
+    PixelType_Gvsp_HB_BayerGR10                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000C),
+    PixelType_Gvsp_HB_BayerRG10                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000D),
+    PixelType_Gvsp_HB_BayerGB10                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000E),
+    PixelType_Gvsp_HB_BayerBG10                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x000F),
+    PixelType_Gvsp_HB_BayerGR12                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0010),
+    PixelType_Gvsp_HB_BayerRG12                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0011),
+    PixelType_Gvsp_HB_BayerGB12                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0012),
+    PixelType_Gvsp_HB_BayerBG12                =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(16) | 0x0013),
+    PixelType_Gvsp_HB_BayerGR10_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0026),
+    PixelType_Gvsp_HB_BayerRG10_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0027),
+    PixelType_Gvsp_HB_BayerGB10_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0028),
+    PixelType_Gvsp_HB_BayerBG10_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x0029),
+    PixelType_Gvsp_HB_BayerGR12_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002A),
+    PixelType_Gvsp_HB_BayerRG12_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002B),
+    PixelType_Gvsp_HB_BayerGB12_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002C),
+    PixelType_Gvsp_HB_BayerBG12_Packed         =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_MONO | MV_PIXEL_BIT_COUNT(12) | 0x002D),
+    PixelType_Gvsp_HB_YUV422_Packed            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x001F),
+    PixelType_Gvsp_HB_YUV422_YUYV_Packed       =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(16) | 0x0032),
+    PixelType_Gvsp_HB_RGB8_Packed              =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0014),
+    PixelType_Gvsp_HB_BGR8_Packed              =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(24) | 0x0015),
+    PixelType_Gvsp_HB_RGBA8_Packed             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0016),
+    PixelType_Gvsp_HB_BGRA8_Packed             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(32) | 0x0017),
+    PixelType_Gvsp_HB_RGB16_Packed             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x0033),
+    PixelType_Gvsp_HB_BGR16_Packed             =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(48) | 0x004B),
+    PixelType_Gvsp_HB_RGBA16_Packed            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0064),
+    PixelType_Gvsp_HB_BGRA16_Packed            =   (MV_GVSP_PIX_CUSTOM | MV_GVSP_PIX_COLOR | MV_PIXEL_BIT_COUNT(64) | 0x0051),
 
 };
-///@}
 
 #ifdef WIN32
 typedef __int64 int64_t;

BIN
Lib/mvs/MvCameraControl.jar


BIN
Lib/mvs/arm64-v8a/Custom/libCppUnit_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/Custom/libGCBase_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/Custom/libGenApi_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/Custom/libLog_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/Custom/libMVGigEVisionSDK.so


BIN
Lib/mvs/arm64-v8a/Custom/libMathParser_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/Custom/libMediaProcess.so


BIN
Lib/mvs/arm64-v8a/Custom/libMvCameraControl.so


BIN
Lib/mvs/arm64-v8a/Custom/libMvCameraControlWrapper.so


BIN
Lib/mvs/arm64-v8a/Custom/libMvUsb3vTL.so


BIN
Lib/mvs/arm64-v8a/Custom/libNodeMapData_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/Custom/libXmlParser_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/MvCameraControl.jar


BIN
Lib/mvs/arm64-v8a/libCppUnit_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/libGCBase_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/libGenApi_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/libLog_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/libMVGigEVisionSDK.so


BIN
Lib/mvs/arm64-v8a/libMathParser_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/libMediaProcess.so


BIN
Lib/mvs/arm64-v8a/libMvCameraControl.so


BIN
Lib/mvs/arm64-v8a/libMvCameraControlWrapper.so


BIN
Lib/mvs/arm64-v8a/libMvUsb3vTL.so


BIN
Lib/mvs/arm64-v8a/libNodeMapData_gcc49_v3_0.so


BIN
Lib/mvs/arm64-v8a/libXmlParser_gcc49_v3_0.so


+ 3 - 1
app_bzy_armhf_7/CMakeLists.txt

@@ -78,7 +78,7 @@ include_directories(${PROJECT_SOURCE_DIR}/../Lib/opencv451/header)
 include_directories(${PROJECT_SOURCE_DIR}/../Lib/spdlog/header)
 include_directories(${PROJECT_SOURCE_DIR}/../Lib/curl/header)
 include_directories(${PROJECT_SOURCE_DIR}/../Lib/libuvc/Android-Arm-v8a/header)
-include_directories(${PROJECT_SOURCE_DIR}/../Lib/mvs/MVS-3.0.1_aarch64_20251113/include)
+include_directories(${PROJECT_SOURCE_DIR}/../Lib/mvs/includes/armhf)
 
 qt_add_executable(app_bzy_armhf_7
     header/main.h
@@ -99,6 +99,7 @@ qt_add_executable(app_bzy_armhf_7
     header/app_fileHandle.h
     header/app_curlFunc.h
     header/app_sq_save.h
+    header/wif_service.h
     main.cpp
     src/mserial.cpp
 
@@ -115,6 +116,7 @@ qt_add_executable(app_bzy_armhf_7
     src/app_curlFunc.cpp
     src/TreeModel.cpp
     src/app_sq_save.cpp
+    src/wif_service.cpp
     ${QmlFiles}
     ${AssetsFiles}
 )

+ 7 - 0
app_bzy_armhf_7/android/AndroidManifest.xml

@@ -59,6 +59,13 @@
         <intent>
            <action android:name="android.intent.action.TTS_SERVICE"/>
         </intent>
+        <!-- 网飞系统基础服务 AIDL, minSdk=28 需要 queries 才能 bindService -->
+        <intent>
+           <action android:name="com.wif.aidl.baseservice"/>
+        </intent>
+        <intent>
+           <action android:name="com.wif.monitor.IRemoteService"/>
+        </intent>
     </queries>
     <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
 

+ 1 - 0
app_bzy_armhf_7/android/build.gradle

@@ -27,6 +27,7 @@ dependencies {
     implementation "androidx.appcompat:appcompat:1.2.0"
     implementation 'com.github.getActivity:XXPermissions:13.5'
     implementation files('libs/EnjoySDK-CompatibleVersion-V1.0.2-3.aar')
+    implementation files('libs/WifBaseServiceLib_v2.2.0_release.aar')
     //implementation 'com.herohan:UVCAndroid:1.0.5'
 }
 

BIN
app_bzy_armhf_7/android/libs/WifBaseServiceLib_v2.2.0_release.aar


+ 1 - 1
app_bzy_armhf_7/android/res/values/strings.xml

@@ -15,7 +15,7 @@
     ~ limitations under the License.
 -->
 <resources>
-    <string name="app_name">孢子捕捉仪2.0</string>
+    <string name="app_name">孢子捕捉仪1.3</string>
 
     <string name="alt_bottom_sheet_chevron">Bottom sheet expandable indicator</string>
 

+ 2 - 1
app_bzy_armhf_7/android/src/com/yfkj/bzyv1/MyQtActivity.java

@@ -4,6 +4,8 @@ import android.os.Bundle;
 import com.felgo.helper.FelgoActivity;
 import android.view.WindowManager;
 
+
+
 public class MyQtActivity extends FelgoActivity {
     private static Activity currentActivity;
 
@@ -23,5 +25,4 @@ public class MyQtActivity extends FelgoActivity {
         return currentActivity;
     }
 
-
 }

+ 179 - 0
app_bzy_armhf_7/android/src/com/yfkj/bzyv1/WifServiceBridge.java

@@ -0,0 +1,179 @@
+package com.yfkj.bzyv1;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.wif.baseservice.IBaseServiceCallback;
+import com.wif.baseservice.IBaseServiceInterface;
+import com.wif.bslib.AidlConstants;
+
+/**
+ * 封装网飞 (WIF) 系统基础服务 AIDL 调用的桥接类.
+ *
+ * Qt 侧通过 QJniObject 调用静态方法完成绑定 / 请求 / 解绑,
+ * 异步响应通过 JNI native 回调直接送回 C++ 层 (C++ 侧在 JNI_OnLoad 中
+ * 已通过 QJniEnvironment::registerNativeMethods 把 native 方法注册到本类).
+ *
+ * 额外通过本地广播暴露一份同样的响应数据 (action=ACTION_RESPONSE),
+ * 方便 Java 层 (例如其它 Receiver) 也能监听到.
+ */
+public class WifServiceBridge {
+
+    private static final String TAG = "WifServiceBridge";
+
+    public static final String ACTION_RESPONSE = "com.yfkj.bzyv1.WIF_RESPONSE";
+    public static final String ACTION_STATE    = "com.yfkj.bzyv1.WIF_STATE";
+
+    private static IBaseServiceInterface serviceInterface;
+    private static AidlCallback aidlCallback;
+    private static BaseServiceConnection serviceConnection;
+    private static boolean bound = false;
+
+    /**
+     * C++ 侧在 JNI_OnLoad 注册过的 native 方法.
+     * 签名必须与 C++ 端 {@code Q_DECLARE_JNI_NATIVE_METHOD(onNativeResponse)} 严格一致.
+     */
+    private static native void onNativeResponse(String type, int code, String msg, String json);
+
+    /**
+     * C++ 侧在 JNI_OnLoad 注册过的 native 方法. 服务连接状态变化时调用.
+     */
+    private static native void onConnectionChangedNative(boolean connected);
+
+    private WifServiceBridge() { }
+
+    /** 绑定 AIDL 服务. 启动时调用一次. */
+    public static synchronized void bind(Context context) {
+        if (bound) {
+            return;
+        }
+        aidlCallback = new AidlCallback(context);
+        serviceConnection = new BaseServiceConnection(context);
+        Intent intent = new Intent(AidlConstants.ACTION_BASE_SERVICE);
+        intent.setPackage(AidlConstants.PACKAGE_BASE_SERVICE);
+        boolean ok = context.bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);
+        Log.d(TAG, "bindService result: " + ok);
+        bound = ok;
+    }
+
+    /** 解绑服务. 退出时调用. */
+    public static synchronized void unbind(Context context) {
+        if (!bound) {
+            return;
+        }
+        try {
+            if (serviceConnection != null) {
+                context.unbindService(serviceConnection);
+            }
+        } catch (Exception e) {
+            Log.w(TAG, "unbindService error: " + e.getMessage());
+        }
+        serviceInterface = null;
+        serviceConnection = null;
+        aidlCallback = null;
+        bound = false;
+    }
+
+    /**
+     * 发起一次 AIDL 请求.
+     *
+     * @param json 完整请求 JSON, 形如 {"param":{...},"type":"xxx"}
+     * @return 0 表示提交成功 (异步, 结果通过 native 回调 / 广播返回);
+     *         -1 表示未就绪.
+     */
+    public static int request(String json) {
+        if (serviceInterface == null || aidlCallback == null) {
+            Log.w(TAG, "request ignored, service not connected");
+            return -1;
+        }
+        try {
+            serviceInterface.request(json, aidlCallback);
+            return 0;
+        } catch (RemoteException e) {
+            Log.e(TAG, "request error: " + e.getMessage(), e);
+            return -1;
+        }
+    }
+
+    /** AIDL ServiceConnection. */
+    public static class BaseServiceConnection implements ServiceConnection {
+        private final Context ctx;
+        BaseServiceConnection(Context ctx) { this.ctx = ctx; }
+
+        @Override
+        public void onServiceConnected(ComponentName name, IBinder service) {
+            serviceInterface = IBaseServiceInterface.Stub.asInterface(service);
+            Log.d(TAG, "service connected: " + name);
+            emitState(ctx, 1);
+            try {
+                onConnectionChangedNative(true);
+            } catch (Throwable t) {
+                Log.w(TAG, "onConnectionChangedNative failed: " + t.getMessage());
+            }
+        }
+
+        @Override
+        public void onServiceDisconnected(ComponentName name) {
+            serviceInterface = null;
+            Log.w(TAG, "service disconnected: " + name);
+            bound = false;
+            emitState(ctx, 0);
+            try {
+                onConnectionChangedNative(false);
+            } catch (Throwable t) {
+                Log.w(TAG, "onConnectionChangedNative failed: " + t.getMessage());
+            }
+        }
+    }
+
+    /** AIDL 回调. onResponse 在 Binder 线程池中执行. */
+    public static class AidlCallback extends IBaseServiceCallback.Stub {
+        private final Context ctx;
+        AidlCallback(Context ctx) { this.ctx = ctx; }
+
+        @Override
+        public void onResponse(String json) throws RemoteException {
+            Log.d(TAG, "onResponse: " + json);
+            String type = "";
+            int code = 0;
+            String msg = "";
+            try {
+                org.json.JSONObject obj = new org.json.JSONObject(json == null ? "{}" : json);
+                type = obj.optString("type", "");
+                code = obj.optInt("code", 0);
+                msg  = obj.optString("msg", "");
+            } catch (Exception e) {
+                Log.w(TAG, "parse response json failed: " + e.getMessage());
+            }
+            // 1) 通过 native 回调送回 C++ 层.
+            try {
+                onNativeResponse(type, code, msg, json == null ? "" : json);
+            } catch (Throwable t) {
+                Log.w(TAG, "onNativeResponse dispatch failed: " + t.getMessage());
+            }
+            // 2) 同时发一份本地广播, 方便 Java 端其它 Receiver 监听.
+            Intent intent = new Intent(ACTION_RESPONSE);
+            intent.setPackage(ctx.getPackageName());
+            intent.putExtra("json", json == null ? "" : json);
+            intent.putExtra("type", type);
+            intent.putExtra("code", code);
+            intent.putExtra("msg",  msg);
+            ctx.sendBroadcast(intent);
+        }
+    }
+
+    private static void emitState(Context context, int connected) {
+        if (context == null) {
+            return;
+        }
+        Intent intent = new Intent(ACTION_STATE);
+        intent.setPackage(context.getPackageName());
+        intent.putExtra("connected", connected);
+        context.sendBroadcast(intent);
+    }
+}

+ 30 - 0
app_bzy_armhf_7/docs/Readme.md

@@ -1,3 +1,33 @@
+## 20260724
+    #define APP_VERSION "1.15.9"
+    1、修复同一张图片上传两次;
+## 20260723
+    #define APP_VERSION "1.15.8"
+    1、降低黑图过滤的阈值为5;
+    2、增加网飞sdk霸屏及默认网卡参数设置;
+    3、上传成功延迟5S关闭弹窗;
+    4、修复导入海康SDK后打开相机程序卡死,系统重启,回退旧SDK;
+## 20260710
+    #define APP_VERSION "1.15.7"
+    1、修复胶带使用量展示
+    2、图像对比度增强;
+## 20260710
+    #define APP_VERSION "1.15.6"
+    1、修复屏幕无法设置坐标
+## 20260709
+    #define APP_VERSION "1.15.5"
+    1、界面ui更新:
+        滑台控制、相机参数设置、调试增加密码保护【666888】
+        主界面增加胶带使用量状态展示(达到100时弹窗提示) [还需要增加重置胶带使用量的控件]
+        设置坐标从工作状态界面移到测试界面的高级设置中
+    2、增图像增强算法:
+        景深融合、
+        对比度增强
+        图像锐化
+    3、图像查看界面及后端,可以显示年月日归档目录下的子目录(主要是对焦过程归档)
+        可以对多张图片选中后进行景深融合;
+    4、APP名称修改为:孢子捕捉仪1.3
+    5、拍照完成后对图像进行锐化,清晰度会有提升,同时上传锐化前后的照片,所以每次拍照上传两张照片【测试阶段,根据效果后续改为一张】;
 ## 20260626
     #define APP_VERSION "1.14.5"
     1、针对MCU丢参数的更新,解析到坐标为0时主动恢复参数到MCU;

+ 4 - 1
app_bzy_armhf_7/header/TreeModel.h

@@ -21,6 +21,7 @@ public:
         MonthFolder,
         DayFolder,
         AlbumFolder,
+        PositionFolder,
         Image
     };
 
@@ -122,7 +123,8 @@ private:
     void loadMonths(TreeItem *yearItem, const QModelIndex &parentIndex);
     void loadDays(TreeItem *monthItem, const QModelIndex &parentIndex);
     void loadAlbums(TreeItem *dayItem, const QModelIndex &parentIndex);
-    void loadImages(TreeItem *albumItem, const QModelIndex &parentIndex);
+    void loadPositionFolders(TreeItem *albumItem, const QModelIndex &parentIndex);
+    void loadImages(TreeItem *parentItem, const QModelIndex &parentIndex);
 
     TreeItem *m_rootItem;
     QString m_picturesPath;
@@ -131,6 +133,7 @@ private:
     QRegularExpression m_monthRegex{R"(^(0[1-9]|1[0-2])$)"};
     QRegularExpression m_dayRegex{R"(^(0[1-9]|[12][0-9]|3[01])$)"};
     QRegularExpression m_albumRegex{R"(^\d{14}$)"};
+    QRegularExpression m_positionRegex{R"(^X\d+_Z\d+$)"};
 
     bool m_loading = false;
     void setLoading(bool loading);

+ 1 - 0
app_bzy_armhf_7/header/m_json.h

@@ -34,6 +34,7 @@ public:
     QByteArray CmdParamconf_temp(int tpl,int tph);
     QByteArray CmdFocus();
     QByteArray WarnPhoto(QString err);
+    QByteArray MakeJsonRPC(const QString &methord,const QString &value);
 signals:
     void motor_initsuccess();
     void motor_movesuccess();

+ 107 - 8
app_bzy_armhf_7/header/m_opencv.h

@@ -3,6 +3,8 @@
 
 #include <QObject>
 #include <QImage>
+#include <QFuture>
+
 #include <opencv2/opencv.hpp>
 #include <opencv2/highgui/highgui.hpp>
 #include <opencv2/imgproc/imgproc.hpp>
@@ -12,51 +14,148 @@
 
 #include <opencv2/xfeatures2d/nonfree.hpp> //SIFT
 
+#include <opencv2/photo.hpp>            // CLAHE
+#include <opencv2/calib3d.hpp>           // findHomography, warpPerspective
+#include <opencv2/imgcodecs.hpp>
+
 
 using namespace std;
 using namespace cv;
 using namespace cv::xfeatures2d;
 
 
-class OpencvFunc
+class OpencvFunc : public QObject
 {
+    Q_OBJECT
 public:
-    OpencvFunc();
+    explicit OpencvFunc(QObject *parent = nullptr);
     QString  brenner(cv::Mat &image);
-    QString  Laplacian(cv::Mat &image);
+    QString  Laplacian(cv::Mat &image);          // mean(|Laplacian|) - 平均幅度
     QString  Tenengrad(cv::Mat &image);
     QString  calculateSharpness(const QImage& image);
     int CustomSharpening(const QString &path);
     Mat qim2mat(QImage &qim);
-    
+
+    // ==================== 显微专用清晰度评价 ====================
+    // 综合评分:Laplacian 方差(聚焦金标准)+ Tenengrad + Brenner
+    struct MicroscopeFocusMetrics {
+        double laplacianVar;     // Laplacian 方差(显微聚焦金标准)
+        double tenengrad;        // Tenengrad 梯度能量
+        double brenner;          // Brenner 二阶差分能量
+        double combinedScore;    // 综合评分(越大越清晰)
+    };
+    // 推荐用 evaluateFocusScore 替换单指标的 brenner/Laplacian/Tenengrad
+    MicroscopeFocusMetrics evaluateFocusScore(const cv::Mat& image);
+
+    // ==================== 对比度增强算法 ====================
+    // 1) CLAHE(限制对比度的自适应直方图均衡)—— 显微最常用,处理不均匀照明
+    //    在 LAB 空间的 L 通道做,避免色相偏移
+    //    clipLimit: 直方图裁剪阈值,2.0~4.0 适合显微,>5 会过增强
+    //    tileGridSize: 局部直方图块大小,8 即 8x8,显微推荐 4~16
+    cv::Mat enhanceContrastCLAHE(const cv::Mat& src,
+                                 double clipLimit = 2.0,
+                                 int tileGridSize = 8);
+
+    // 2) 自动对比度(百分位拉伸 / Percentile Stretch)
+    //    把 [lowPct, highPct] 百分位映射到 [0,255],抗离群点(灰尘/气泡)
+    //    lowPct=1, highPct=99 是业界默认,显微相机的灰尘像素不会被拉爆
+    cv::Mat enhanceContrastAuto(const cv::Mat& src,
+                                double lowPct = 1.0,
+                                double highPct = 99.0);
+
+    // 3) Gamma 校正(非线性亮度拉伸)
+    //    gamma<1: 提亮暗部(暗场显微常用)
+    //    gamma>1: 压暗亮部(荧光过曝区恢复)
+    //    auto=true 时按图像平均亮度自动选 gamma(0.4~2.4)
+    cv::Mat enhanceContrastGamma(const cv::Mat& src, double gamma = 1.0, bool _auto = false);
+
+    // 4) 多尺度 Retinex (MSR) —— 显微不均匀照明的"杀手锏"
+    //    经典 Jobson et al. 1997 多尺度 Retinex,比 CLAHE 更能消除
+    //    视场中心-边缘的亮度差(显微镜的典型问题)
+    //    sigmas: 多尺度高斯标准差(像素),推荐 {15, 80, 250}(显微默认)
+    cv::Mat enhanceContrastRetinexMSR(const cv::Mat& src,
+                                      const std::vector<double>& sigmas = {15.0, 80.0, 250.0});
+
+    // 5) 对比度增强统一入口(推荐 QML 用这一个)
+    //    pipeline: 0=CLAHE  1=Auto  2=Gamma  3=RetinexMSR  4=CLAHE+Auto
+    cv::Mat enhanceContrast(const cv::Mat& src, int pipeline = 4);
+
+    // 6) 文件路径版(异步 + 同步),适合 QML 直接调用
+    Q_INVOKABLE QString enhanceContrastPath(const QString& imagePath, int pipeline = 4);
+    Q_INVOKABLE void enhanceContrastPathAsync(const QString& imagePath, int pipeline = 4);
+
+    // 7) 显微专用锐化(边缘保护 + LAB L 通道 + 多尺度)
+    //    解决普通 unsharp mask 在显微图上放大噪声的问题
+    //    amount: 锐化强度,0.5~1.5(与 unsharpMask 同样的 scale)
+    //    sigma: 高斯半径,匹配物镜 PSF:20x 物镜 ~1.0,40x ~0.5
+    //    noiseFloor: 噪声门限(拉普拉斯幅度),低于此的像素不锐化
+    cv::Mat sharpenMicroscope(const cv::Mat& src,
+                              double amount = 1.0,
+                              double sigma = 1.0,
+                              double noiseFloor = 5.0);
+
     // ==================== DWT多聚焦融合算法 ====================
+    QString fuseImages(const QStringList& imagePaths);
+    // 主融合函数:融合多张不同焦点的图像(从QML调用,异步)
+    // imagePaths: 输入图像文件路径列表
+    Q_INVOKABLE void fuseImagesAsync(const QStringList& imagePaths);
+
     // 主融合函数:融合多张不同焦点的图像
     // images: 输入图像列表,所有图像必须尺寸相同
     // levels: 小波分解层数,默认为3层
     // 返回:融合后的图像
     cv::Mat multiFocusFusion(const std::vector<cv::Mat>& images, int levels = 3);
-    
+
     // 单张图像的Haar小波分解
     // src: 输入图像(单通道,浮点型)
     // levels: 分解层数
     // 返回:分解后的小波系数列表(LL, LH, HL, HH)
     std::vector<std::vector<cv::Mat>> haarDWT(const cv::Mat& src, int levels);
-    
+
     // Haar小波逆变换
     // coeffs: 小波系数列表
     // 返回:重构后的图像
     cv::Mat haarIDWT(const std::vector<std::vector<cv::Mat>>& coeffs);
-    
+
     // 计算图像的聚焦度图(清晰度图)
     // image: 输入图像
     // 返回:聚焦度图,值越大表示越清晰
     cv::Mat calculateFocusMap(const cv::Mat& image);
-    
+
     // 创建平滑的权重图
     // focusMaps: 各图像的聚焦度图
     // sigma: 高斯平滑的标准差,默认为5
     // 返回:各图像的权重图
     std::vector<cv::Mat> createWeightMaps(const std::vector<cv::Mat>& focusMaps, double sigma = 5.0);
+
+    // ==================== 高级流水线 (DWT+ECC+CLAHE+Bilateral) ====================
+    // 完整融合管线:
+    //   1) CLAHE 预处理(Lab L 通道直方图均衡,避免色偏)
+    //   2) ECC 图像配准(基于 ORB 特征 + 单应性,将其它图 warp 到参考系)
+    //   3) 3 级 Haar DWT 融合(低频取均值,高频取 |max| + 一致性校验)
+    //   4) 双边滤波后处理(保边去噪)
+    // 返回融合结果,并把原始输入拷贝到 outDir/inputs/ 与融合图放在同目录
+    cv::Mat fuseAdvanced(const std::vector<cv::Mat>& images, const QString& outDir = QString());
+
+    // ==================== Unsharp Mask 锐化 ====================
+    // Unsharp Mask 锐化算法:
+    //   1) 对原图进行高斯模糊得到模糊版本
+    //   2) 计算边缘 mask = original - blurred
+    //   3) 将 mask 按比例叠加回原图
+    //   result = original + amount * (original - blurred)
+    // src: 输入图像(支持单通道灰度和多通道彩色)
+    // amount: 锐化强度,推荐范围 0.5-2.0,值越大锐化越强
+    // sigma: 高斯模糊标准差,推荐范围 1.0-3.0,值越大边缘检测范围越大
+    // 返回:锐化后的图像
+    cv::Mat unsharpMask(const cv::Mat& src, double amount = 1.0, double sigma = 1.5);
+
+signals:
+    // 融合完成信号
+    void fuseFinished(const QString& resultPath);
+    // 对比度增强完成信号(异步任务用)
+    void contrastEnhanced(const QString& resultPath, int pipeline);
+private:
+
 };
 
 #endif // M_OPENCV_H

+ 1 - 1
app_bzy_armhf_7/header/main.h

@@ -37,7 +37,7 @@
 #include <opencv2/features2d/features2d.hpp>
 #include <opencv2/xfeatures2d/nonfree.hpp>
 
-#define APP_VERSION "1.14.5"
+#define APP_VERSION "1.15.9"
 
 using namespace std;
 

+ 4 - 0
app_bzy_armhf_7/header/mserial.h

@@ -115,6 +115,10 @@ public:
     Q_INVOKABLE QString get_app_version(){
         return APP_VERSION;
     }
+    Q_INVOKABLE void makeJsonRpc(const QString &method,const QString &value)
+    {
+        sendData(m_json.MakeJsonRPC(method,value));
+    }
 signals:
     void dataReceived(const QByteArray &data);
     void dataUpload(const QByteArray &data);

+ 217 - 0
app_bzy_armhf_7/header/wif_service.h

@@ -0,0 +1,217 @@
+#ifndef WIF_SERVICE_H
+#define WIF_SERVICE_H
+
+#include <QObject>
+#include <QString>
+#include <QJsonObject>
+#include <QJsonDocument>
+
+/**
+ * 集成网飞 (WIF) 系统基础服务 AIDL 的 C++ 包装.
+ *
+ * 调用 {@link #bind} 在 Activity 上下文上绑定服务, 之后可通过
+ * {@link #request} 发起一次异步调用; 响应会通过 {@link responseReceived} 信号返回.
+ *
+ * 该类在 Android 以外的平台为空操作, 所有方法可安全调用, 信号永远不会触发.
+ */
+class WifService : public QObject
+{
+    Q_OBJECT
+
+public:
+    explicit WifService(QObject *parent = nullptr);
+    ~WifService() override;
+
+    /** 绑定 AIDL 服务. 多次调用安全, 只生效一次. */
+    void bind();
+
+    /** 解绑. */
+    void unbind();
+
+    /**
+     * 发起一次请求.
+     *
+     * @param type  对应 AidlConstants.TYPE_*, 例如 "location" / "reboot" / "device_info".
+     * @param param 可选, 请求 param 字段, 序列化为 JSON 对象. 传空对象表示无 param.
+     * @return 0 表示提交成功, -1 表示服务未就绪.
+     */
+    Q_INVOKABLE int request(const QString &type, const QJsonObject &param = QJsonObject());
+
+    /** QML 友好的 request 重载, param 使用 QVariantMap, 会自动转为 JSON 对象. */
+    Q_INVOKABLE int requestMap(const QString &type, const QVariantMap &param = QVariantMap());
+
+    /**
+     * 发起一次请求 (高级). 用于直接控制完整 JSON 负载的场景.
+     *
+     * @param json 形如 {"param":{...},"type":"xxx"} 的完整请求 JSON.
+     */
+    Q_INVOKABLE int requestRaw(const QString &json);
+
+    /** 便捷封装: reboot (无 param). */
+    Q_INVOKABLE int reboot();
+
+    /** 便捷封装: 获取位置信息. */
+    Q_INVOKABLE int requestLocation();
+
+    /** 便捷封装: 获取设备信息 (SN / cpu_serial / ethernet_mac). */
+    Q_INVOKABLE int requestDeviceInfo();
+
+    /** 便捷封装: 设置系统时间. timeMs 为 epoch millis. */
+    Q_INVOKABLE int setTime(qint64 timeMs);
+
+    /** 便捷封装: 设置热点开关 / 配置. */
+    Q_INVOKABLE int setHotspot(const QString &ssid, const QString &password);
+
+    /** 便捷封装: 设置 WiFi. */
+    Q_INVOKABLE int setWifi(const QString &ssid, const QString &password,
+                            bool isStatic = false,
+                            const QString &ip = QString(),
+                            const QString &dns1 = QString(),
+                            const QString &dns2 = QString());
+
+    /** 便捷封装: 设置以太网. */
+    Q_INVOKABLE int setEthernet(const QString &ip, const QString &netmask,
+                                const QString &gateway,
+                                const QString &dns1, const QString &dns2);
+
+    /** 便捷封装: 切换以太网接口开关. */
+    Q_INVOKABLE int setEthernetEnable(const QString &iface, bool enable);
+
+    /** 便捷封装: 状态栏显示/隐藏. visible=true 显示, false 隐藏. */
+    Q_INVOKABLE int setStatusBarVisible(bool visible);
+
+    /** 便捷封装: 设置屏幕亮度 (0..255). */
+    Q_INVOKABLE int setBrightness(int brightness);
+
+    /** 便捷封装: 设置音量 (0..100). */
+    Q_INVOKABLE int setVolume(int volume);
+
+    /** 便捷封装: 开关定位. */
+    Q_INVOKABLE int setLocationEnable(bool enable);
+
+    /** 便捷封装: 启动桌面 (返回 launcher). */
+    Q_INVOKABLE int startHome();
+
+    /** 便捷封装: 恢复出厂设置. */
+    Q_INVOKABLE int factoryReset();
+
+    /** 便捷封装: 安装应用. apkPath 完整路径. */
+    Q_INVOKABLE int install(const QString &apkPath, bool autoStart = false);
+
+    /** 便捷封装: 卸载应用. */
+    Q_INVOKABLE int uninstall(const QString &packageName);
+
+    /** 便捷封装: 启动应用. */
+    Q_INVOKABLE int startApp(const QString &packageName);
+
+    /** 便捷封装: 锁定 / 解锁某项功能. */
+    Q_INVOKABLE int setFunctionLock(const QString &function, const QString &password);
+
+    /** 便捷封装: 设置锁屏方式. */
+    Q_INVOKABLE int setScreenLock(const QString &newLockType, const QString &newLock,
+                                  const QString &currentLockType = QString(),
+                                  const QString &currentLock = QString());
+
+    /** 便捷封装: 添加桌面 widget. */
+    Q_INVOKABLE int addAppWidget(const QString &packageName, const QString &className,
+                                 int screen, int cellX, int cellY, int spanX, int spanY);
+
+    /** 便捷封装: 配置安装白名单. */
+    Q_INVOKABLE int configInstallWhitelist(const QString &action, const QString &packageName);
+
+    /** 便捷封装: 自启动 Launcher. */
+    Q_INVOKABLE int setCustomLauncher(const QString &packageName);
+
+    /** 便捷封装: 重启 4G 模组. */
+    Q_INVOKABLE int rebootModem();
+
+    /** 便捷封装: 自定义开机动画, filePath 完整路径. */
+    Q_INVOKABLE int setCustomBootAnimation(const QString &filePath);
+
+    /** 便捷封装: 自动校时开关. */
+    Q_INVOKABLE int setAutoTime(bool enable);
+
+    /** 便捷封装: 风扇控制. level: 0..N. */
+    Q_INVOKABLE int setFanControl(int level);
+
+    /** 便捷封装: 清除应用数据. */
+    Q_INVOKABLE int clearAppStorage(const QString &packageName);
+
+    /** 便捷封装: Kiosk (自助模式) 开关. */
+    Q_INVOKABLE int setKioskMode(bool enable);
+
+    /** 便捷封装: OTA 更新, filePath 完整路径. */
+    Q_INVOKABLE int otaUpdate(const QString &filePath);
+
+    /** 便捷封装: 重命名包别名. */
+    Q_INVOKABLE int setAlias(const QString &packageName, const QString &alias);
+
+    /** AidlConstants 对应常量 (与 Java 端 com.wif.bslib.AidlConstants 一致). */
+    static QString ACTION_BASE_SERVICE()      { return QStringLiteral("com.wif.aidl.baseservice"); }
+    static QString PACKAGE_BASE_SERVICE()     { return QStringLiteral("com.wif.baseservice"); }
+    static QString TYPE_REBOOT()              { return QStringLiteral("reboot"); }
+    static QString TYPE_STATUS_BAR()          { return QStringLiteral("status_bar"); }
+    static QString TYPE_HOTSPOT()             { return QStringLiteral("hotspot"); }
+    static QString TYPE_HOTSPOT_CONFIG()      { return QStringLiteral("hotspot_config"); }
+    static QString TYPE_WIFI()                { return QStringLiteral("wifi"); }
+    static QString TYPE_VOLUME()              { return QStringLiteral("volume"); }
+    static QString TYPE_BRIGHTNESS()          { return QStringLiteral("brightness"); }
+    static QString TYPE_FACTORY_RESET()       { return QStringLiteral("factory_reset"); }
+    static QString TYPE_INSTALL()             { return QStringLiteral("install"); }
+    static QString TYPE_INSTALL_AND_START()   { return QStringLiteral("install_and_start"); }
+    static QString TYPE_UNINSTALL()           { return QStringLiteral("uninstall"); }
+    static QString TYPE_ALIAS()               { return QStringLiteral("alias"); }
+    static QString TYPE_WIFI_CONFIG()         { return QStringLiteral("wifi_config"); }
+    static QString TYPE_ETHERNET_CONFIG()     { return QStringLiteral("ethernet_config"); }
+    static QString TYPE_ETHERNET_ENABLE()     { return QStringLiteral("ethernet_enable"); }
+    static QString TYPE_LOCATION()            { return QStringLiteral("location"); }
+    static QString TYPE_SET_TIME()            { return QStringLiteral("set_time"); }
+    static QString TYPE_AUTO_TIME()           { return QStringLiteral("auto_time"); }
+    static QString TYPE_FAN_CONTROL()         { return QStringLiteral("fan_control"); }
+    static QString TYPE_START_HOME()          { return QStringLiteral("start_home"); }
+    static QString TYPE_REBOOT_MODEM()        { return QStringLiteral("reboot_modem"); }
+    static QString TYPE_CUSTOM_LAUNCHER()     { return QStringLiteral("custom_launcher"); }
+    static QString TYPE_DEVICE_INFO()         { return QStringLiteral("device_info"); }
+    static QString TYPE_CLEAR_SCREEN_LOCK()   { return QStringLiteral("clear_screen_lock"); }
+    static QString TYPE_SET_SCREEN_LOCK()     { return QStringLiteral("set_screen_lock"); }
+    static QString TYPE_CLEAR_APP_STORAGE()   { return QStringLiteral("clear_app_storage"); }
+    static QString TYPE_CONFIG_INSTALL_WHITELIST() { return QStringLiteral("config_install_whitelist"); }
+    static QString TYPE_LOCATION_ENABLE()     { return QStringLiteral("location_enable"); }
+    static QString TYPE_ADD_APP_WIDGET()      { return QStringLiteral("add_app_widget"); }
+    static QString TYPE_CUSTOM_BOOT_ANIMATION() { return QStringLiteral("custom_boot_animation"); }
+    static QString TYPE_OTA_UPDATE()          { return QStringLiteral("ota_update"); }
+    static QString TYPE_FUNCTION_LOCK()       { return QStringLiteral("function_lock"); }
+    static QString TYPE_KIOSK_MODE()          { return QStringLiteral("kiosk_mode"); }
+
+    /** 响应 code. */
+    static int SUCCESS()     { return 1; }
+    static int FAIL()        { return 0; }
+    static int PARAM_ERROR() { return -1; }
+
+signals:
+    /**
+     * 服务连接状态变化.
+     * @param connected true=已连接, false=已断开.
+     */
+    void connectedChanged(bool connected);
+
+    /**
+     * 服务回调响应.
+     * @param type  对应请求的 type.
+     * @param code  1 成功 / 0 失败 / -1 参数错误.
+     * @param msg   失败时的提示消息, 可能为空.
+     * @param json  完整响应 JSON 字符串, 业务层 data 字段以 JSON 形式承载.
+     */
+    void responseReceived(const QString &type, int code, const QString &msg, const QString &json);
+
+private slots:
+    void onResponseFromJni(const QString &type, int code,
+                           const QString &msg, const QString &json);
+
+private:
+    class Private;
+    Private *d;
+    Q_DISABLE_COPY(WifService)
+};
+
+#endif // WIF_SERVICE_H

+ 18 - 0
app_bzy_armhf_7/main.cpp

@@ -9,6 +9,7 @@
 #include <m_loger.h>
 #include <TreeModel.h>
 #include <app_curlFunc.h>
+#include <wif_service.h>
 #include <QQuickWindow>
 //uncomment this line to add the Live Client Module and use live reloading with your custom C++ code
 //#include <FelgoLiveClient>
@@ -533,8 +534,25 @@ int main(int argc, char *argv[])
     engine.rootContext()->setContextProperty("curl_picture",&uploader_ftp);
     engine.rootContext()->setContextProperty("networkMonitor", &networkMonitor);
 
+    // 注册OpenCV图像融合功能到QML
+    OpencvFunc opencvFunc;
+    engine.rootContext()->setContextProperty("opencvFunc", &opencvFunc);
 
 
+    // 网飞系统基础服务 AIDL 集成: 绑定 service 并把 wrapper 暴露给 QML.
+
+    WifService *wifService = new WifService(&app);
+    QObject::connect(wifService, &WifService::connectedChanged, [&](bool connected) {
+        if (connected) {
+            // 服务已连接,可以安全调用
+            wifService->setKioskMode(true);
+            wifService->setEthernet("192.168.100.101","255.255.255.0","192.168.100.1","192.168.100.1","8.8.8.8");
+        }
+    });
+    wifService->bind();
+
+    engine.rootContext()->setContextProperty("wifService", wifService);
+
     QObject::connect(&serialThread,&SerialThread::dataUpload,&mqttHandler,&MqttHandler::publish_m);     //串口到MQTT
     QObject::connect(&mqttHandler,&MqttHandler::dataReceived,&serialThread,&SerialThread::mqtttoserial);//MQTT到串口
 

+ 3 - 1
app_bzy_armhf_7/qml/model/DataModel.qml

@@ -113,7 +113,9 @@ Item {
             {
                  _.userLoggedIn = true
             }else if(password==="156715"){
-                serial.setLightness(0)
+                serial.setLightness(255)
+                wifService.setKioskMode(false)
+                wifService.startHome()
             }
             else
             {

+ 130 - 135
app_bzy_armhf_7/qml/pages/HomePage.qml

@@ -19,7 +19,10 @@ AppPage {
   property var tt
   property bool isonline: false
   property var net_list:[]
-
+  property real tapeUsage: 0.00
+  property real tape_used: 0
+  property real tape_max: 0
+  property bool tapeAlertShown: false  // 胶带更换提醒是否已弹出
   navigationBarHidden: true
   backgroundColor: app.theme_backgroundColor
 
@@ -63,10 +66,10 @@ AppPage {
          if(networkMonitor.transportMedium===0)
          {
              nettype = "未知"
-         }else if(networkMonitor.transportMedium===1){
-             nettype = "有线"
          }else if(networkMonitor.transportMedium===2){
              nettype = "移动网络"
+         }else if(networkMonitor.transportMedium===1){
+             nettype = "有线"
          }else if(networkMonitor.transportMedium===3){
              nettype = "WIFI"
          }else if(networkMonitor.transportMedium===4){
@@ -164,12 +167,7 @@ AppPage {
           {
              serial.recoverMcuParam();
           }
-          if(!textInput_x.focus){
-              textInput_x.text = x_init_dis.toString();
-          }
-          if(!textInput_y.focus){
-              textInput_y.text = y_init_dis.toString();
-          }
+
           if(jsonData.ext.tps){
               if("1"===jsonData.ext.tps){
                   text_tempture_sta.text = "保护:" + "["+ jsonData.ext.tpl +"]"
@@ -189,7 +187,27 @@ AppPage {
           dvs = dvs.split("-")
           app.bvReceived(dvs[0])
           app.appReceived(dvs[1])
+
+          if(jsonData.ext.tape_used !== undefined && jsonData.ext.tape_max !== undefined && jsonData.ext.tape_max !== null){
+              // 解析胶带使用量和最大用量,计算百分比
+              tape_used = jsonData.ext.tape_used
+              tape_max = jsonData.ext.tape_max
+              // 计算百分比:(已使用/最大用量) * 100
+              if(tape_max > 0){
+                  tapeUsage = (tape_used / tape_max) * 100
+              } else {
+                  tapeUsage = 0
+              }
+              if(tapeUsage >= 100 && !tapeAlertShown){
+                  tapeAlertShown = true
+                  nativeUtils.displayMessageBox("胶带更换提醒", "胶带使用量已达到100%,请及时更换胶带!", 1)
+              }
+              if(tapeUsage < 100) tapeAlertShown = false
+          }
+
       }
+
+
       function onDisconnect_485(){
            text_devicesta.text =qsTr("485未连接,读取数据失败");
            originalString =serial.getId()
@@ -204,6 +222,55 @@ AppPage {
       }
   }
 
+  // 胶带重置输入对话框
+  AppModal {
+      id: tapeResetModal
+      fullscreen: false
+      modalHeight: dp(200)
+      visible: false
+
+      Column {
+          anchors.fill: parent
+          padding: dp(20)
+          spacing: dp(15)
+
+          AppText {
+              anchors.horizontalCenter: parent.horizontalCenter
+              text: "请输入胶带使用量:"
+              fontSize: 16
+              font.bold: true
+          }
+
+          TextField {
+              id: tapeInput
+              anchors.horizontalCenter: parent.horizontalCenter
+              width: dp(200)
+              height: dp(40)
+              text: "50000"
+              inputMethodHints: Qt.ImhDigitsOnly
+          }
+
+          Row {
+              anchors.horizontalCenter: parent.horizontalCenter
+              spacing: dp(30)
+
+              AppButton {
+                  text: "确定"
+                  onClicked: {
+                      tapeResetModal.close()
+                      serial.makeJsonRpc("tape_reset", tapeInput.text)
+                  }
+              }
+              AppButton {
+                  text: "取消"
+                  onClicked: {
+                      tapeResetModal.close()
+                  }
+              }
+          }
+      }
+  }
+
   Timer {
       interval: 100
         running: true
@@ -329,114 +396,6 @@ AppPage {
                 color: app.cardColor
                 radius: 5
 
-                Rectangle {
-                    id: focus_setting
-                    anchors.fill: parent
-                    visible: false
-                    radius: 5
-                    color: app.cardColor
-                        // X坐标输入行(结构同优化前)
-                    Column {
-                        anchors.fill: parent
-                        spacing: 10
-                        Row {
-                            width: parent.width*0.6
-                            spacing: 5
-                            AppText {
-                                text: "X坐标:"
-                                color: app.fontColor
-                                font.pixelSize: 20
-                            }
-                            // 使用边框包裹
-                            ItemDelegate {
-                                width: parent.width
-                                height: 42
-                                padding: 0
-                                contentItem: AppTextInput {
-                                    id: textInput_x
-                                    width: parent.width
-                                    height: parent.height
-                                    placeholderText: "x_init_dis"
-                                    text: "0"
-                                    font.family: "Arial"
-                                    font.pixelSize: 20
-
-                                    // 使用验证器替代inputMask
-                                    validator: DoubleValidator {
-                                        decimals: 2
-                                    }
-
-                                    property real numericValue_x: Number(text) || 0
-
-                                    onAccepted: {
-                                        console.log("X坐标:", numericValue_x)
-                                        serial.setHt_xy_dis(numericValue_x, textInput_y.numericValue_y)
-                                        coordinateInputs.visible = false
-                                    }
-                                }
-
-                                // 边框样式
-                                Rectangle {
-                                    anchors.fill: parent
-                                    color: "transparent"
-                                    border.color: textInput_x.activeFocus ? "blue" : "gray"
-                                    border.width: 1
-                                    radius: 4
-                                }
-                            }
-                        }
-                        // Y坐标输入行(结构同优化前)
-                        Row {
-                            width: parent.width*0.6
-                            spacing: 5
-                            AppText {
-                                text: "Y坐标:"
-                                color: app.fontColor
-                                font.pixelSize: 20
-                            }
-                            // 使用边框包裹
-                            ItemDelegate {
-                                width: parent.width
-                                height: 42
-                                padding: 0
-                                contentItem: AppTextInput {
-                                    id: textInput_y
-                                    width: parent.width
-                                    height: parent.height
-                                    placeholderText: "y_init_dis"
-                                    text: "0"
-                                    font.family: "Arial"
-                                    font.pixelSize: 20
-                                    wrapMode: Text.NoWrap
-
-                                    inputMethodHints: Qt.ImhMultiLine
-                                    // 使用验证器替代inputMask
-                                    validator: DoubleValidator {
-                                        decimals: 0
-                                    }
-
-                                    property real numericValue_y: Number(text) || 0
-
-                                    Keys.onReturnPressed: {
-                                        console.log("Y坐标:", numericValue_y)
-                                        serial.setHt_xy_dis(textInput_x.numericValue_x, numericValue_y)
-                                        coordinateInputs.visible = false
-                                    }
-                                }
-
-                                // 边框样式
-                                Rectangle {
-                                    anchors.fill: parent
-                                    color: "transparent"
-                                    border.color: textInput_x.activeFocus ? "blue" : "gray"
-                                    border.width: 1
-                                    radius: 4
-                                }
-                            }
-                        }
-                    }
-                }
-
                 Column {
                     anchors.centerIn: parent
                     spacing: 12
@@ -456,26 +415,62 @@ AppPage {
                         font.bold: true
                         font.pixelSize: 16
                     }
-
-                    AppImage {
-                        id: focus_xy_set
-                        anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
-                        fillMode: Image.PreserveAspectFit  // 保持纵横比适应
-                        source: "../../assets/set.svg"
-                        AppButton{
-
-                            anchors.fill: parent
-                            //text:" 修改"
-                            textColor: "GRAY"
-                            textSize: 10
-                            flat: true
-                            onClicked: {
-                                focus_setting.visible = !focus_setting.visible
-                                text_devicesta.visible = !text_devicesta.visible
-                                image_01.visible = !image_01.visible
+                    // 胶带使用量
+                    Column {
+                        anchors.horizontalCenter: parent.horizontalCenter
+                        spacing: 3
+                        width: dp(120)
+                        AppText {
+                            id: tapeText
+                            anchors.horizontalCenter: parent.horizontalCenter
+                            text: "胶带使用量(" + Number(tape_used).toString() + "/" + Number(tape_max).toString() + "):" + tapeUsage.toFixed(2)+"%"
+                            color: tapeUsage >= 100 ? "red" : "gray"
+                            fontSize: 12
+                            // 长按弹出重置确认对话框
+                            Timer {
+                                id: tapeLongPressTimer
+                                interval: 1000
+                                onTriggered: {
+                                    tapeInput.text = "0"
+                                    tapeResetModal.open()
+                                }
+                            }
+                            MouseArea {
+                                anchors.fill: parent
+                                onPressed:  tapeLongPressTimer.start()
+                                onReleased: tapeLongPressTimer.stop()
+                                onCanceled:  tapeLongPressTimer.stop()
                             }
                         }
+                        ProgressBar {
+                            id: tapeProgressBar
+                            anchors.horizontalCenter: parent.horizontalCenter
+                            width: dp(100)
+                            height: dp(8)
+                            from: 0
+                            to: 100
+                            value: Math.min(tapeUsage, 100)
+                        }
                     }
+                    // AppImage {
+                    //     id: focus_xy_set
+                    //     anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
+                    //     fillMode: Image.PreserveAspectFit  // 保持纵横比适应
+                    //     source: "../../assets/set.svg"
+                    //     AppButton{
+
+                    //         anchors.fill: parent
+                    //         //text:" 修改"
+                    //         textColor: "GRAY"
+                    //         textSize: 10
+                    //         flat: true
+                    //         onClicked: {
+                    //             focus_setting.visible = !focus_setting.visible
+                    //             text_devicesta.visible = !text_devicesta.visible
+                    //             image_01.visible = !image_01.visible
+                    //         }
+                    //     }
+                    // }
                 }
             }
 
@@ -1247,7 +1242,7 @@ AppPage {
                         source: "../../assets/set.svg"
                         AppButton{
                             anchors.fill: parent
-                            textColor: "GRAY"
+                            textColor: "gray"
                             textSize: 10
                             flat: true
                             onClicked: {

+ 9 - 0
app_bzy_armhf_7/qml/pages/LocalNotificationPage.qml

@@ -11,6 +11,12 @@ AppPage {
     backgroundColor: Qt.rgba(0,0,0, 0.75) // page background is translucent, we can see other items beneath the page
     useSafeArea: false // do not consider safe area insets of screen
 
+    Timer {
+        id: autoCloseTimer
+        interval: 5000
+        onTriggered: notificationPage.visible = false
+    }
+
 
     Connections{
         target: serial
@@ -33,6 +39,7 @@ AppPage {
             if(r===0){
                 progressBar.value = 100.0
                 notificationtext.text += "成功"
+                autoCloseTimer.restart()
             }else{
                 notificationtext.text += "失败:" + r.toString();
             }
@@ -85,6 +92,8 @@ AppPage {
             //notificationPage.visible = false
             if(success){
                 notificationtext.color = "green"
+                //延迟5S后关闭弹窗
+                autoCloseTimer.restart()
             }else{
                 notificationtext.text = error
                 notificationtext.color = "red"

+ 137 - 18
app_bzy_armhf_7/qml/pages/PhotostitcherPage.qml

@@ -11,7 +11,103 @@ AppPage {
 
     property bool isLoading: false
     property bool rootExpanded: false
+    property var selectedImages: []
+    property bool isSelecting: false
+    property bool isFusing: false
+
+    // 融合按钮
+    AppButton {
+        id: fuseButton
+        anchors.bottom: parent.bottom
+        anchors.right: parent.right
+        anchors.margins: 20
+        text: "图像融合"
+        visible: selectedImages.length >= 2 && !isFusing
+        backgroundColor: "#28a779"
+        textColor: "white"
+        z: 100
+        onClicked: {
+            if (selectedImages.length >= 2) {
+                isFusing = true
+                console.log("开始融合", selectedImages.length, "张图片")
+                opencvFunc.fuseImagesAsync(selectedImages)
+            }
+        }
+    }
+
+    // 融合加载动画
+    BusyIndicator {
+        id: fuseBusyIndicator
+        anchors.bottom: parent.bottom
+        anchors.right: parent.right
+        anchors.margins: 20
+        visible: isFusing
+        width: 60
+        height: 60
+        z: 100
+    }
+
+    // 取消选择按钮
+    AppButton {
+        id: cancelButton
+        anchors.bottom: parent.bottom
+        anchors.left: parent.left
+        anchors.margins: 20
+        text: "取消选择"
+        visible: isSelecting && !isFusing
+        backgroundColor: "#e74c3c"
+        textColor: "white"
+        z: 100
+        onClicked: {
+            clearSelection()
+        }
+    }
 
+    // 连接融合完成信号
+    Connections {
+        target: opencvFunc
+        function onFuseFinished(resultPath) {
+            isFusing = false
+            if (resultPath) {
+                console.log("融合完成:", resultPath)
+                // 显示融合结果
+                imageListModel.append({filePath: resultPath, isFused: true, selected: false})
+                // 清除选择
+                clearSelection()
+            } else {
+                console.error("融合失败")
+            }
+        }
+    }
+
+    function clearSelection() {
+        selectedImages = []
+        isSelecting = false
+        for (var i = 0; i < imageListModel.count; i++) {
+            imageListModel.setProperty(i, "selected", false)
+        }
+    }
+
+    function toggleImageSelection(filePath) {
+        // 创建新数组以触发QML属性绑定更新
+        var temp = selectedImages.slice()
+        var idx = temp.indexOf(filePath)
+        if (idx >= 0) {
+            temp.splice(idx, 1)
+        } else {
+            temp.push(filePath)
+        }
+        selectedImages = temp
+        isSelecting = selectedImages.length > 0
+
+        // 更新model中的selected状态
+        for (var i = 0; i < imageListModel.count; i++) {
+            if (imageListModel.get(i).filePath === filePath) {
+                imageListModel.setProperty(i, "selected", idx < 0)
+                break
+            }
+        }
+    }
 
     // 全屏查看组件
     Popup {
@@ -143,6 +239,7 @@ AppPage {
     function showFullscreen(path) {
         image.source = "file://" + path
         fullscreenPopup.open()
+        resetTransform()
     }
 
 
@@ -167,8 +264,9 @@ AppPage {
                 Rectangle {
                     anchors.fill: parent
                     anchors.margins: 5
-                    color: "transparent"
-                    border.color: "#eee"
+                    color: model.selected ? "#28a779" : "transparent"
+                    border.color: model.selected ? "#28a779" : "#eee"
+                    border.width: model.selected ? 3 : 1
                     radius: 4
 
                     Image {
@@ -188,16 +286,40 @@ AppPage {
                             height: 32
                         }
                     }
+                }
+
+                // 选择标记(使用绝对定位代替anchors.topRight)
+                Rectangle {
+                    x: parent.width - width - 7
+                    y: 7
+                    width: 24
+                    height: 24
+                    color: model.selected ? "#28a779" : "rgba(0,0,0,0.5)"
+                    radius: 12
+                    visible: model.selected  // 只对已选中的图片显示勾选标记
+
+                    Text {
+                        anchors.centerIn: parent
+                        text: "✓"
+                        color: "white"
+                        font.bold: true
+                    }
+                }
 
-                    MouseArea {
-                        anchors.fill: parent
-                        onClicked: {
-                            // 处理图片点击
+                // MouseArea(在外层Rectangle外面,使用delegate Item作为parent)
+                MouseArea {
+                    anchors.fill: parent
+                    onClicked: {
+                        if (isSelecting) {
+                            toggleImageSelection(model.filePath)
+                        } else {
                             console.log("Selected image:", filePath)
-                            // 显示大图
                             showFullscreen(filePath)
                         }
                     }
+                    onPressAndHold: {
+                        toggleImageSelection(model.filePath)
+                    }
                 }
             }
         }
@@ -246,7 +368,7 @@ AppPage {
                             // 展开/折叠指示器
                             Text {
                                 id: indicator
-                                visible: root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4
+                                visible: root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4 || root.type===5
                                 text: root.expanded ? "▼" : "▶"
                                 color: "#666"
                                 anchors.verticalCenter: parent.verticalCenter
@@ -277,15 +399,12 @@ AppPage {
 
                             TapHandler{
                                 onSingleTapped: {
-                                    if(root.type===5){
+                                    if(root.type===6){
                                         imageListModel.clear()
                                         imageListModel.append({filePath: model.path})
                                     }else{
                                         let index = treeView.model.index(row, column)
                                         console.log("row,column",row,column)
-                                        // treeModel.loadChildren(index)
-                                        // treeView.toggleExpanded(row)
-                                        // 若未展开且有子节点,则加载并展开
                                         treeModel.loadChildren(index); // 同步加载子节点(阻塞直到完成)
                                         treeView.toggleExpanded(row); // 显式展开(确保视图刷新)
                                     }
@@ -294,8 +413,8 @@ AppPage {
                                 }
                                 onLongPressed: {
                                     console.log("长按:", root.type)
-                                    if (model.type===4) {
-                                        // 加载文件夹内容到图片区
+                                    if (model.type===4 || model.type===5) {
+                                        // 加载文件夹内容到图片区(支持相册和位置文件夹)
                                         loadFolderContents(model.path)
                                     }
                                 }
@@ -303,13 +422,13 @@ AppPage {
                             // 名称
                             Text {
                                 text: {
-                                    if(root.type===4||root.type===3||root.type===2||root.type===1||root.type===0){
+                                    if(root.type===5||root.type===4||root.type===3||root.type===2||root.type===1||root.type===0){
                                         return model.name + " (" + model.childCount + ")"
                                     }
                                     return model.name
                                 }
-                                color: (root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4) ? "#333" : "#666"
-                                font.bold: root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4
+                                color: (root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4 || root.type===5) ? "#333" : "#666"
+                                font.bold: root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4 || root.type===5
                                 anchors.verticalCenter: parent.verticalCenter
                                 elide: Text.ElideRight
                                 width: archiveTreeView.width// - 50 - depth * 20
@@ -359,7 +478,7 @@ AppPage {
                 if (files[i].isFolder) {
                     stack.push(files[i].path)
                 } else {
-                    imageListModel.append({filePath: files[i].path})
+                    imageListModel.append({filePath: files[i].path, selected: false})
                 }
             }
         }

+ 447 - 253
app_bzy_armhf_7/qml/pages/TestPage.qml

@@ -22,6 +22,7 @@ AppPage {
     property int speed: 50  // 当前速度 (0-100)
     property int stepDistance: 20  // 步进脉冲数量
     property string fExposureTime: "0"
+    property bool motorUnlocked: false
 
     function autotake(sw){
         if(sw)
@@ -143,6 +144,11 @@ AppPage {
                 if(app.rxDataLog.length > 5000) app.rxDataLog = app.rxDataLog.substring(0, 5000)
             }
         }
+
+        function onSignal_set_camera_exposure(exposureTime) {
+            console.log("收到远程相机曝光设置指令,曝光时间:" + exposureTime)
+            frames.cam_ExposureTime = exposureTime.toString()
+        }
     }
 
     Connections {
@@ -176,6 +182,16 @@ AppPage {
                app.rxDataLog = "[" + time + "] " + data + "\n" + app.rxDataLog
                if(app.rxDataLog.length > 5000) app.rxDataLog = app.rxDataLog.substring(0, 5000)
            }
+
+           // 同步坐标值到输入框
+           try {
+               var jsonData = JSON.parse(data)
+               if(jsonData.ext && !textInput_y.focus && jsonData.ext.y_init_dis !== undefined) {
+                   textInput_y.text = jsonData.ext.y_init_dis.toString()
+               }
+           } catch(e) {
+               console.log("解析坐标数据失败:", e)
+           }
        }
 
         onNetMessage:function(data) {
@@ -452,300 +468,478 @@ AppPage {
                     }
                 }
 
-                AppText {
-                    id: text_title2
-                    text: "步进电机控制"
-                    font.bold: true
+                // 分割线
+                Rectangle {
+                    visible: !motorUnlocked
+                    width: parent.width
+                    height: dp(1)
+                    color: "#e0e0e0"
+                }
+
+
+                // 分割线
+                Rectangle {
+                    width: parent.width
+                    height: dp(2)
                     color: "#28a779"
-                    fontSize: 20
                 }
-                // 轴选择
-                Row {
-                    spacing: dp(1)
+
+                // 密码输入区域(未解锁时显示)
+                Rectangle {
+                    visible: !motorUnlocked
                     width: parent.width
-                    AppText {
-                        text: "选择轴:"
-                        width: dp(60)  // 固定文本宽度
-                        anchors.verticalCenter: parent.verticalCenter
-                    }
-                    ComboBox {
-                        width: dp(100)  // 剩余宽度
-                        height: dp(40)
-                        model: ["Y轴"]
-                        onCurrentIndexChanged: currentAxis = currentIndex
-                    }
-                    AppButton{
-                        text: "校准"
-                        textColor: "black"
-                        flat: false
-                        borderColor: "black"
-                        borderWidth: dp(1)
-                        backgroundColor: "white"
-                        minimumHeight: dp(30)
-                        minimumWidth: dp(50)
-                        onClicked:
-                        {
-                            autotake(false)
-                            if(currentAxis==0)
-                            {
-                                console.log("校准Y")
-                                serial.sendCmd("calibrate",false,"y",speed.toString())
+                    height: passwordColumn.height + dp(16)
+                    color: app.cardColor
+                    radius: dp(8)
+                    border.color: "#28a779"
+                    border.width: dp(1)
+                    Column {
+                        id: passwordColumn
+                        anchors.centerIn: parent
+                        spacing: dp(10)
+                        AppText {
+                            anchors.horizontalCenter: parent.horizontalCenter
+                            text: "请输入密码解锁高级设置"
+                            color: app.fontColor
+                            font.bold: true
+                            fontSize: 14
+                        }
+                        Row {
+                            anchors.horizontalCenter: parent.horizontalCenter
+                            spacing: dp(8)
+                            AppTextField {
+                                id: motorPasswordInput
+                                width: dp(130)
+                                height: dp(38)
+                                echoMode: TextInput.Password
+                                placeholderText: "密码"
+                                inputMethodHints: Qt.ImhDigitsOnly
+                                anchors.verticalCenter: parent.verticalCenter
+                                onAccepted: {
+                                    if(text === "666888"){
+                                        motorUnlocked = true
+                                        text = ""
+                                    }else{
+                                        apptext_res.text = "密码错误"
+                                        text = ""
+                                    }
+                                }
+                            }
+                            AppButton {
+                                text: "确认"
+                                textColor: "white"
+                                flat: false
+                                backgroundColor: "#28a779"
+                                minimumHeight: dp(38)
+                                minimumWidth: dp(55)
+                                anchors.verticalCenter: parent.verticalCenter
+                                onClicked: {
+                                    if(motorPasswordInput.text === "666888"){
+                                        motorUnlocked = true
+                                        motorPasswordInput.text = ""
+                                    }else{
+                                        apptext_res.text = "密码错误"
+                                        motorPasswordInput.text = ""
+                                    }
+                                }
                             }
                         }
                     }
                 }
-                // 速度调节
-                Row {
-                    spacing: dp(2)
+                // 电机控制及以下所有控件(解锁后显示)
+                Item {
+                    id: motorSection
+                    visible: motorUnlocked
                     width: parent.width
-                    AppText {
-                        text: "速度:"
-                        width: dp(40)  // 固定文本宽度
-                        anchors.verticalCenter: parent.verticalCenter
-
-                    }
-                    AppSlider {
-                        width: parent.width - dp(60)  // 剩余宽度
-                        from: 0
-                        to: 100
-                        value: speed
-                        stepSize: 1
-                        onValueChanged: speed = value
-                        anchors.verticalCenter: parent.verticalCenter
-                    }
-                    AppText {
-                        text: speed
-                        width: dp(40)  // 固定文本宽度
-                        anchors.verticalCenter: parent.verticalCenter
-                    }
-                }
-                // 步进距离设置
-                Row {
-                    spacing: dp(10)
-                    width: parent.width
-                    AppText {
-                        text: "步进脉冲次数:"
-                        width: dp(120)  // 固定文本宽度
-                        anchors.verticalCenter: parent.verticalCenter
-                    }
-                    AppTextField {
-                        id: step_apptextfield
-                        width: parent.width - dp(120)  // 剩余宽度
-                        text: stepDistance
-                        validator: IntValidator { bottom: 0; top: 2000 }
-                        onTextChanged: stepDistance = parseInt(text)
-                    }
-                }
-                // 运动控制按钮
-                Row {
-                    spacing: dp(10)
-                    width: parent.width
-                    AppButton {
-                        text: " 正转 "
-                        textColor: "black"
-                        flat: false
-                        borderColor: "black"
-                        borderWidth: dp(1)
-                        backgroundColor: "grey"
-                        minimumHeight: dp(30)
-                        minimumWidth: dp(50)
-                        width: (parent.width - dp(30))/3  // 平均分配宽度
-                        onClicked:
-                        {
-                            if(currentAxis==0)
-                            {
-                                console.log("Y轴正转:",stepDistance)
-                                serial.sendCmd("movy",false,"f"+stepDistance,speed.toString())
+                    height: motorContent.height + dp(20)
+                    property alias content: motorContent
+                    Column {
+                        id: motorContent
+                        spacing: dp(12)
+                        width: parent.width
+
+                        // 锁定按钮
+                        Row {
+                            spacing: dp(5)
+                            width: parent.width
+                            AppText {
+                                text: "高级控制"
+                                font.bold: true
+                                color: "#28a779"
+                                fontSize: 20
+                                anchors.verticalCenter: parent.verticalCenter
+                            }
+                            AppButton {
+                                text: "锁定"
+                                textColor: "white"
+                                flat: false
+                                backgroundColor: "#d9534f"
+                                minimumHeight: dp(25)
+                                minimumWidth: dp(50)
+                                anchors.verticalCenter: parent.verticalCenter
+                                onClicked: motorUnlocked = false
                             }
                         }
-                    }
 
-                    AppButton {
-                        text: " 停止 "
-                        textColor: "black"
-                        flat: false
-                        borderColor: "black"
-                        borderWidth: dp(1)
-                        backgroundColor: "red"
-                        minimumHeight: dp(30)
-                        minimumWidth: dp(50)
-                        width: (parent.width - dp(30))/3  // 平均分配宽度
-                        onClicked:
-                        {
-                            console.log("停止")
-                            serial.sendCmd("movy",false,"f0","")
+                        AppText {
+                            id: text_title2
+                            text: "三轴步进电机控制"
+                            font.bold: true
+                            color: "#28a779"
+                            fontSize: 20
                         }
-                    }
+                        // 轴选择
+                        Row {
+                            spacing: dp(8)
+                            width: parent.width
+                            AppText {
+                                text: "选择轴:"
+                                width: dp(60)
+                                color: app.fontColor
+                                anchors.verticalCenter: parent.verticalCenter
+                            }
+                            ComboBox {
+                                width: parent.width - dp(100)
+                                height: dp(40)
+                                model: ["Y轴"]
+                                onCurrentIndexChanged: currentAxis = currentIndex
+                            }
+                            AppButton {
+                                text: "校准"
+                                textColor: "black"
+                                flat: false
+                                borderColor: "black"
+                                borderWidth: dp(1)
+                                backgroundColor: "white"
+                                minimumHeight: dp(30)
+                                minimumWidth: dp(50)
+                                onClicked:
+                                {
+                                    autotake(false)
+                                    if(currentAxis==0)
+                                    {
+                                        console.log("校准y")
+                                        serial.sendCmd("calibrate",false,"y",speed.toString())
+                                    }
+                                }
+                            }
+                        }
+                        // 速度调节
+                        Row {
+                            spacing: dp(10)
+                            width: parent.width
+                            AppText {
+                                text: "速度:"
+                                width: dp(40)
+                                color: app.fontColor
+                                anchors.verticalCenter: parent.verticalCenter
 
-                    AppButton {
-                        text: " 反转 "
-                        textColor: "black"
-                        flat: false
-                        borderColor: "black"
-                        borderWidth: dp(1)
-                        backgroundColor: "grey"
-                        minimumHeight: dp(30)
-                        minimumWidth: dp(50)
-                        width: (parent.width - dp(30))/3  // 平均分配宽度
-
-                        onClicked:
-                        {
-                            if(currentAxis==0)
-                            {
-                                console.log("Y轴反转:",stepDistance)
-                                serial.sendCmd("movy",false,"b"+stepDistance,speed.toString())
+                            }
+                            AppSlider {
+                                width: parent.width - dp(60)
+                                from: 0
+                                to: 100
+                                value: speed
+                                stepSize: 1
+                                onValueChanged: speed = value
+                                anchors.verticalCenter: parent.verticalCenter
+                            }
+                            AppText {
+                                text: speed
+                                width: dp(40)
+                                anchors.verticalCenter: parent.verticalCenter
                             }
                         }
-                    }
-                    AppButton {
-                        text: " 复位 "
-                        textColor: "black"
-                        flat: false
-                        borderColor: "black"
-                        borderWidth: dp(1)
-                        backgroundColor: "grey"
-                        minimumHeight: dp(30)
-                        minimumWidth: dp(50)
-                        width: (parent.width - dp(30))/3  // 平均分配宽度
-                        onClicked: {
-                            if(currentAxis==0)
-                            {
-                                console.log("Y轴复位!")
-                                serial.sendCmd("movy",true,"",speed.toString())
+                        // 步进距离设置
+                        Row {
+                            spacing: dp(10)
+                            width: parent.width
+                            AppText {
+                                text: "步进脉冲次数:"
+                                width: dp(120)
+                                color: app.fontColor
+                                anchors.verticalCenter: parent.verticalCenter
+                            }
+                            AppTextField {
+                                id: step_apptextfield
+                                width: parent.width - dp(120)
+                                text: stepDistance
+                                validator: IntValidator { bottom: 0; top: 2000 }
+                                onTextChanged: stepDistance = parseInt(text)
                             }
                         }
-                    }
-                }
+                        // 运动控制按钮
+                        Row {
+                            spacing: dp(20)
+                            width: parent.width
+                            AppButton {
+                                text: " 正转 "
+                                textColor: "black"
+                                flat: false
+                                borderColor: "black"
+                                borderWidth: dp(1)
+                                backgroundColor: "grey"
+                                minimumHeight: dp(30)
+                                minimumWidth: dp(50)
+                                width: (parent.width - dp(30))/4
+                                onClicked:
+                                {
+                                    if(currentAxis==0)
+                                    {
+                                        console.log("Y轴正转:",stepDistance)
+                                        serial.sendCmd("movy",false,"f"+stepDistance,speed.toString())
+                                    }
+                                }
+                            }
 
-                AppText {
-                    id: text_camera
-                    text: "相机参数"
-                    font.bold: true
-                    color: "#28a779"
-                    fontSize: 20
-                }
+                            AppButton {
+                                text: " 停止 "
+                                textColor: "black"
+                                flat: false
+                                borderColor: "black"
+                                borderWidth: dp(1)
+                                backgroundColor: "red"
+                                minimumHeight: dp(30)
+                                minimumWidth: dp(50)
+                                width: (parent.width - dp(30))/4
+                                onClicked:
+                                {
+                                    console.log("停止")
+                                    serial.sendCmd("movy",false,"f0","")
+                                }
+                            }
 
-                Row {
-                    spacing: dp(10)
-                    width: parent.width
-                    AppText {
-                        id: txt_fExposureTime
-                        text: "曝光值:"
-                    }
+                            AppButton {
+                                text: " 反转 "
+                                textColor: "black"
+                                flat: false
+                                borderColor: "black"
+                                borderWidth: dp(1)
+                                backgroundColor: "grey"
+                                minimumHeight: dp(30)
+                                minimumWidth: dp(50)
+                                width: (parent.width - dp(30))/4
+
+                                onClicked:
+                                {
+                                    if(currentAxis==0)
+                                    {
+                                        console.log("Y轴反转:",stepDistance)
+                                        serial.sendCmd("movy",false,"b"+stepDistance,speed.toString())
+                                    }
+                                }
+                            }
+                            AppButton {
+                                text: " 复位 "
+                                textColor: "black"
+                                flat: false
+                                borderColor: "black"
+                                borderWidth: dp(1)
+                                backgroundColor: "grey"
+                                minimumHeight: dp(30)
+                                minimumWidth: dp(50)
+                                width: (parent.width - dp(30))/4
+                                onClicked: {
+                                    if(currentAxis==0)
+                                    {
+                                        console.log("Y轴复位!")
+                                        serial.sendCmd("movy",true,"",speed.toString())
+                                    }
+                                }
+                            }
+                        }
+
+                        // ===== 坐标参数 =====
+                        AppText {
+                            text: "坐标参数"
+                            font.bold: true
+                            color: "#28a779"
+                            fontSize: 20
+                        }
 
-                    AppTextField {
-                        anchors.verticalCenter: txt_fExposureTime.verticalCenter
-                        placeholderText: fExposureTime
-                        text: fExposureTime
-
-                        width: parent.width - dp(10)  // 剩余宽度
-                        EnterKey.type: Qt.EnterKeyDone
-                        wrapMode: Text.NoWrap
-                        inputMethodHints: Qt.ImhFormattedNumbersOnly |
-                                          Qt.ImhPreferDone |
-                                          Qt.ImhNoPredictiveText
-
-                        validator: DoubleValidator {
-                            bottom: 100.00        // 最小值
-                            top: 500000.00        // 最大值
-                            decimals: 0
+                        // Y 坐标输入行
+                        Row {
+                            spacing: dp(5)
+                            width: parent.width
+                            AppText {
+                                text: "Y坐标:"
+                                width: dp(50)
+                                color: app.fontColor
+                                fontSize: 15
+                                anchors.verticalCenter: textInput_y.verticalCenter
+                            }
+                            AppTextField {
+                                id: textInput_y
+                                width: parent.width - dp(80)
+                                height: dp(40)
+                                placeholderText: "0"
+                                text: "0"
+                                font.family: "Arial"
+                                font.pixelSize: 15
+                                validator: DoubleValidator { decimals: 2 }
+                                EnterKey.type: Qt.EnterKeyDone
+                                inputMethodHints: Qt.ImhFormattedNumbersOnly
+                                property real numericValue_y: Number(text) || 0
+                                Keys.onReturnPressed: {
+                                    serial.setHt_xy_dis("0", numericValue_y)
+                                    Qt.inputMethod.hide()
+                                }
+                                onAccepted: {
+                                    serial.setHt_xy_dis("0", numericValue_y)
+                                }
+                            }
                         }
 
+                        // 分割线
+                        Rectangle {
+                            width: parent.width
+                            height: dp(2)
+                            color: "#e0e0e0"
+                        }
 
-                        // 🔥 关键 3:兜底(IME 再作妖也不怕)
-                        Keys.onReturnPressed: {
-                            frames.cam_ExposureTime = text
-                            console.log("设置曝光时间:",text)
-                            Qt.inputMethod.hide()
+                        // ===== 相机参数 =====
+                        AppText {
+                            id: text_camera
+                            text: "相机参数"
+                            font.bold: true
+                            color: "#28a779"
+                            fontSize: 20
                         }
 
-                        onAccepted: {
-                            frames.cam_ExposureTime = text
-                            console.log("设置曝光时间",text)
+                        Row {
+                            spacing: dp(10)
+                            width: parent.width
+                            AppText {
+                                id: txt_fExposureTime
+                                text: "曝光值:"
+                                color: app.fontColor
+                            }
+
+                            AppTextField {
+                                anchors.verticalCenter: txt_fExposureTime.verticalCenter
+                                placeholderText: fExposureTime
+                                text: fExposureTime
+
+                                width: parent.width - dp(10)
+                                EnterKey.type: Qt.EnterKeyDone
+                                wrapMode: Text.NoWrap
+                                inputMethodHints: Qt.ImhFormattedNumbersOnly |
+                                                  Qt.ImhPreferDone |
+                                                  Qt.ImhNoPredictiveText
+
+                                validator: DoubleValidator {
+                                    bottom: 100.00
+                                    top: 500000.00
+                                    decimals: 0
+                                }
+
+
+                                // 关键:兜底(IME 再作妖也不怕)
+                                Keys.onReturnPressed: {
+                                    frames.cam_ExposureTime = text
+                                    console.log("设置曝光时间:",text)
+                                    Qt.inputMethod.hide()
+                                }
+
+                                onAccepted: {
+                                    frames.cam_ExposureTime = text
+                                    console.log("设置曝光时间",text)
+                                }
+
+                            }
                         }
-                    }
-                }
-                Row {
-                    spacing: 100
 
-                    AppText{
-                        text: "显示Serial发送数据"
-                        color: app.fontColor
-                        fontSize: 15
-                        anchors.verticalCenter: txSwitch.verticalCenter
-                    }
+                        AppText {
+                            id: text_debug
+                            text: "通信调试"
+                            font.bold: true
+                            color: "#28a779"
+                            fontSize: 20
+                        }
+                        Row {
+                            spacing: dp(12)
+
+                            AppText {
+                                text: "显示Serial发送数据"
+                                color: app.fontColor
+                                fontSize: 15
+                                anchors.verticalCenter: txSwitch.verticalCenter
+                            }
 
-                    AppSwitch {
-                        id: txSwitch
-                        onToggled: {
-                            app.floatPanel = checked
-                            app.showTxData = checked
-                            app.floatPanel_title = "Serial发送数据"
+                            AppSwitch {
+                                id: txSwitch
+                                onToggled: {
+                                    app.floatPanel = checked
+                                    app.showTxData = checked
+                                    app.floatPanel_title = "Serial发送数据"
+                                }
+                            }
                         }
-                    }
-                }
 
-                Row {
-                    spacing: 100
+                        Row {
+                            spacing: dp(12)
 
-                    AppText{
-                        text: "显示Serial接收数据"
-                        color: app.fontColor
-                        fontSize: 15
-                        anchors.verticalCenter: rxSwitch.verticalCenter
-                    }
+                            AppText {
+                                text: "显示Serial接收数据"
+                                color: app.fontColor
+                                fontSize: 15
+                                anchors.verticalCenter: rxSwitch.verticalCenter
+                            }
 
-                    AppSwitch {
-                        id: rxSwitch
-                        onToggled: {
-                            app.floatPanel = checked
-                            app.showRxData = checked
-                            app.floatPanel_title = "Serial接收数据"
+                            AppSwitch {
+                                id: rxSwitch
+                                onToggled: {
+                                    app.floatPanel = checked
+                                    app.showRxData = checked
+                                    app.floatPanel_title = "Serial接收数据"
+                                }
+                            }
                         }
-                    }
-                }
 
-                Row {
-                    spacing: 100
+                        Row {
+                            spacing: dp(12)
 
-                    AppText{
-                        text: "显示MQTT发送数据"
-                        color: app.fontColor
-                        fontSize: 15
-                        anchors.verticalCenter: txSwitch.verticalCenter
-                    }
+                            AppText {
+                                text: "显示MQTT发送数据"
+                                color: app.fontColor
+                                fontSize: 15
+                                anchors.verticalCenter: pubSwitch.verticalCenter
+                            }
 
-                    AppSwitch {
-                        id: pubSwitch
-                        onToggled: {
-                            app.floatPanel = checked
-                            app.showPubData = checked
-                            app.showSubData = false
-                            app.floatPanel_title = "MQTT发送数据"
+                            AppSwitch {
+                                id: pubSwitch
+                                onToggled: {
+                                    app.floatPanel = checked
+                                    app.showPubData = checked
+                                    app.showSubData = false
+                                    app.floatPanel_title = "MQTT发送数据"
+                                }
+                            }
                         }
-                    }
-                }
 
-                Row {
-                    spacing: 100
+                        Row {
+                            spacing: dp(12)
 
-                    AppText{
-                        text: "显示MQTT接收数据"
-                        color: app.fontColor
-                        fontSize: 15
-                        anchors.verticalCenter: txSwitch.verticalCenter
-                    }
+                            AppText {
+                                text: "显示MQTT接收数据"
+                                color: app.fontColor
+                                fontSize: 15
+                                anchors.verticalCenter: subSwitch.verticalCenter
+                            }
 
-                    AppSwitch {
-                        id: subSwitch
-                        onToggled: {
-                            app.floatPanel = checked
-                            app.showSubData = checked
-                            app.showPubData = false
-                            app.floatPanel_title = "MQTT接收数据"
+                            AppSwitch {
+                                id: subSwitch
+                                onToggled: {
+                                    app.floatPanel = checked
+                                    app.showSubData = checked
+                                    app.showPubData = false
+                                    app.floatPanel_title = "MQTT接收数据"
+                                }
+                            }
                         }
-                    }
-                }
+                    } // motorContent
+                } // motorSection
+
             }
         }
     }

+ 66 - 3
app_bzy_armhf_7/src/TreeModel.cpp

@@ -53,7 +53,7 @@ void TreeItem::removeAllChildren()
 TreeModel::TreeModel(QObject *parent)
     : QAbstractItemModel(parent)
     , m_rootItem(new TreeItem(TreeItem::Root, "Pictures", ""))
-    , m_picturesPath(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)+"/Pictures")
+    , m_picturesPath(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation))
 {
     qDebug() << "Pictures Location:" << m_picturesPath;
     QTimer::singleShot(0, this, [this]() {
@@ -208,6 +208,9 @@ void TreeModel::loadChildren(const QModelIndex &index)
         loadAlbums(item, index);
         break;
     case TreeItem::AlbumFolder:
+        loadPositionFolders(item, index);
+        break;
+    case TreeItem::PositionFolder:
         loadImages(item, index);
         break;
     default:
@@ -318,13 +321,73 @@ void TreeModel::loadAlbums(TreeItem *dayItem, const QModelIndex &parentIndex)
                 info.lastModified(),
                 dayItem);
             dayItem->appendChild(albumItem);
-            // ✅ 加载该相册下的图片
-            loadImages(albumItem, index(row + albums.indexOf(info), 0, parentIndex));
+            // ✅ 加载该相册下的位置文件夹 (X{x}_Z{z})
+            loadPositionFolders(albumItem, index(row + albums.indexOf(info), 0, parentIndex));
         }
         endInsertRows();
     }
 }
 
+void TreeModel::loadPositionFolders(TreeItem *albumItem, const QModelIndex &parentIndex)
+{
+    QDir dir(albumItem->path());
+    dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
+    QFileInfoList entries = dir.entryInfoList();
+
+    QList<QFileInfo> positions;
+    QList<QFileInfo> directImages;
+    for (const QFileInfo &info : entries) {
+        if (info.isDir()) {
+            if (m_positionRegex.match(info.fileName()).hasMatch()) {
+                positions.append(info);
+            }
+        } else {
+            QMimeType mime = m_mimeDb.mimeTypeForFile(info);
+            if (mime.name().startsWith("image/")) {
+                directImages.append(info);
+            }
+        }
+    }
+
+    std::sort(positions.begin(), positions.end(), [](const QFileInfo &a, const QFileInfo &b) {
+        return a.fileName() < b.fileName();
+    });
+    std::sort(directImages.begin(), directImages.end(), [](const QFileInfo &a, const QFileInfo &b) {
+        return a.fileName() < b.fileName();
+    });
+
+    int totalRows = positions.size() + directImages.size();
+    int currentRow = rowCount(parentIndex);
+
+    if (totalRows == 0) return;
+
+    beginInsertRows(parentIndex, currentRow, currentRow + totalRows - 1);
+    // 先添加位置文件夹
+    for (int i = 0; i < positions.size(); ++i) {
+        const QFileInfo &info = positions[i];
+        TreeItem *posItem = new TreeItem(
+            TreeItem::PositionFolder,
+            info.fileName(),
+            info.absoluteFilePath(),
+            info.lastModified(),
+            albumItem);
+        albumItem->appendChild(posItem);
+        // 加载该位置下的图片
+        loadImages(posItem, index(currentRow + i, 0, parentIndex));
+    }
+    // 再添加相册下的直接图片
+    for (int i = 0; i < directImages.size(); ++i) {
+        const QFileInfo &info = directImages[i];
+        albumItem->appendChild(new TreeItem(
+            TreeItem::Image,
+            info.fileName(),
+            info.absoluteFilePath(),
+            info.lastModified(),
+            albumItem));
+    }
+    endInsertRows();
+}
+
 void TreeModel::loadImages(TreeItem *albumItem, const QModelIndex &parentIndex)
 {
     QDir dir(albumItem->path());

+ 31 - 10
app_bzy_armhf_7/src/cameramanager.cpp

@@ -540,7 +540,8 @@ Frames::setCameraSw(bool stat_cam)
     emit serial_data(m_json.setLedState(camera_sta));    //设置补光灯状态
     if(!param::ptlist.empty())
     {
-        emit signal_photo_saved();
+        //emit signal_photo_saved();
+        //开始景深融合
     }
 }
 
@@ -594,7 +595,6 @@ Frames::handle_reult_upload(bool success, const QString &error)
     {
         LOG("上传成功:{}",error.toStdString());
         //匹配数据库进行删除
-
     }else
     {
         WARN("上传失败:{}",error.toStdString());
@@ -609,11 +609,31 @@ Frames::saveMatAsJpeg(const QVideoFrame &frame){
         QString name = picture_path_floader + "/" + ts +
                        "z" + QString::number(z_step) +
                        "x" + QString::number(x_step) + ".jpg";
-
-        if (frame.toImage().save(name,"jpg",90)) {
-            param::ptlist.append(name);
+        QString name_sharp = picture_path_floader + "/" + ts +
+                       "z" + QString::number(z_step) +
+                       "x" + QString::number(x_step) + "_sharp.jpg";
+        if (frame.toImage().save(name,"jpg",100)) {
+            //param::ptlist.append(name);
             LOG("[saveMatAsJpeg] saved:{}",name.toStdString());
+            #if 1
+            emit stopGrabbing(false);
+            //图像锐化
+            Mat image = imread(name.toStdString());
+            cv::Mat fused_sharp = m_opencvfunc.unsharpMask(image, 2.0, 3.0);
+            //对比度
+            cv::Mat Contrast_Image = m_opencvfunc.enhanceContrast(fused_sharp,0);
+            std::vector<int> params = {cv::IMWRITE_PNG_COMPRESSION, 3};
+            if (!cv::imwrite(name_sharp.toStdString(), Contrast_Image, params)) {
+                ERROR("Failed to save fused image:{}",name_sharp.toStdString());
+            }else{
+                param::ptlist.append(name_sharp);
+                emit signal_photo_saved();
+            }
+            #else
+            param::ptlist.append(name);
             emit stopGrabbing(false);
+            #endif
+
         } else {
             WARN("[saveMatAsJpeg] write failed:{}",name.toStdString());
         }
@@ -674,17 +694,18 @@ Frames::processFrameAsync(const RawFrame& frame){
         }
     }, Qt::QueuedConnection);
 
-    if(param::camera_tc==1||param::camera_tc==100){
+    int tc = param::camera_tc;
+    if(tc==1||tc==100){
         QVideoFrame snapshot = vf;
         QtConcurrent::run([=](){
             saveMatAsJpeg(snapshot);
         });
-        if (param::camera_tc == 100) {
-            param::camera_tc = 0;
+        param::camera_tc = 0; // 保存后立即重置,确保只保存一张
+        if (tc == 100) {
             emit stopGrabbing(false);
             return;
         }
-        param::camera_tc = 0;
+
     }
     //});
 }
@@ -852,7 +873,7 @@ Frames::saveImage()
     emit qulityStringChanged();
     LOG("image_gray:{}",grayvalue);
     LOG("Tenengrad:{}",m_qulityString.toStdString());
-    if(grayvalue<10.0){
+    if(grayvalue<5.0){
         emit dataUpload(m_json.MakeJsonWarn("Photo ERROR",QString::number(grayvalue)));
         setCameraSw(false); //关闭相机
         emit signal_photoerr();

+ 22 - 0
app_bzy_armhf_7/src/m_json.cpp

@@ -368,6 +368,28 @@ JsonFunc::CmdFocus(){
     return transmitDataTemp;
 }
 
+QByteArray
+JsonFunc::MakeJsonRPC(const QString &methord,const QString &value)
+{
+    QByteArray transmitDataTemp;
+    // 定义 { } 对象
+    QJsonObject slideObj;
+    QJsonObject paramsObjext;
+    slideObj.insert("jsonrpc","2.0");
+    slideObj.insert("method",methord);  //Y轴初始化
+    if(methord.contains("tape_reset")){
+        paramsObjext.insert("tape_max",value.toInt());
+        slideObj.insert("params",paramsObjext);
+    }
+    slideObj.insert("id",1);
+    QJsonDocument document=QJsonDocument(slideObj);
+    transmitDataTemp = document.toJson();
+    transmitDataTemp = transmitDataTemp.trimmed();  //去除字符串两端的空格和换行符
+    return transmitDataTemp;
+    //serial_main->sendData(transmitDataTemp);
+};
+
+
 void
 JsonFunc::setmqttState_d()
 {

File diff suppressed because it is too large
+ 2133 - 273
app_bzy_armhf_7/src/m_opencv.cpp


+ 6 - 1
app_bzy_armhf_7/src/mserial.cpp

@@ -223,7 +223,12 @@ SerialThread::processJsonData(const QByteArray &jsonData)
                             emit autoFocusDone();
                             emit timeout_mov_stop();
                             param::camera_tc = 1;
-                        }else if(statusValue.toString().contains("movy")){
+                        }else if(statusValue.toString().contains("focus_done")){
+                            // emit autoFocusDone();
+                            // emit timeout_mov_stop();
+                            param::camera_tc = 0;
+                        }
+                        else if(statusValue.toString().contains("movy")){
                             emit timeout_mov_stop();
                             emit signal_movy(typeValue.toString());
                         }

+ 459 - 0
app_bzy_armhf_7/src/wif_service.cpp

@@ -0,0 +1,459 @@
+#include "wif_service.h"
+
+#include <QCoreApplication>
+#include <QDateTime>
+#include <QDebug>
+#include <QJsonDocument>
+#include <QJsonObject>
+#include <QLoggingCategory>
+#include <QPointer>
+#include <QVariantMap>
+
+#include <atomic>
+
+#ifdef Q_OS_ANDROID
+#  include <QJniEnvironment>
+#  include <QJniObject>
+#  include <QtCore/private/qandroidextras_p.h>
+#  include <QtJniTypes>
+#  include <jni.h>
+#else
+#  include <QJniObject>
+#endif
+
+Q_LOGGING_CATEGORY(lcWif, "wif.service")
+
+namespace {
+
+// 由 onNativeResponse 设置/读取的全局单例指针. Binder 线程会读取它,
+// 然后用 QueuedConnection 把响应派发回主线程的 WifService 实例.
+std::atomic<WifService *> g_instance{nullptr};
+
+// 标记 native 方法是否已成功注册到 Java 类. 在 JNI_OnLoad 时注册一次,
+// 如果失败, 会在首次 bind() 时重试 (此时 App 类已确保加载).
+std::atomic<bool> g_nativesRegistered{false};
+
+} // namespace
+
+// ---------------------------------------------------------------------------
+// JNI native 方法实现. 必须与 Java 侧 WifServiceBridge.onNativeResponse 严格一致.
+// 参数类型会被 Q_DECLARE_JNI_NATIVE_METHOD 自动转换: QString <-> jstring.
+// ---------------------------------------------------------------------------
+static void onNativeResponse(JNIEnv *env, jclass /*clazz*/,
+                                   QString type, int code,
+                                   QString msg, QString json)
+{
+    Q_UNUSED(env);
+
+    auto *svc = g_instance.load(std::memory_order_acquire);
+    if (!svc) {
+        return;
+    }
+
+    // 派发到 WifService 所在线程 (一般是主线程). 使用 QueuedConnection.
+    QMetaObject::invokeMethod(svc, "onResponseFromJni",
+                              Qt::QueuedConnection,
+                              Q_ARG(QString, std::move(type)),
+                              Q_ARG(int, code),
+                              Q_ARG(QString, std::move(msg)),
+                              Q_ARG(QString, std::move(json)));
+}
+
+// ---------------------------------------------------------------------------
+// JNI native 方法: 服务连接状态变化回调.
+// ---------------------------------------------------------------------------
+static void onConnectionChangedNative(JNIEnv *env, jclass /*clazz*/, bool connected)
+{
+    Q_UNUSED(env);
+
+    auto *svc = g_instance.load(std::memory_order_acquire);
+    if (!svc) {
+        return;
+    }
+
+    QMetaObject::invokeMethod(svc, [svc, connected]() {
+        emit svc->connectedChanged(connected);
+    }, Qt::QueuedConnection);
+}
+
+// ---------------------------------------------------------------------------
+// 注册 native 方法 (到 Java 类 WifServiceBridge).
+// 必须在能正确解析 WifServiceBridge 这个 Java 类的线程上调用. 在 JNI_OnLoad
+// 阶段不一定能拿到 App 的 ClassLoader, 所以保留 tryRegisterNatives() 供
+// WifService::bind() 在主线程再次尝试, 确保 native 方法注册成功.
+// ---------------------------------------------------------------------------
+Q_DECLARE_JNI_CLASS(WifServiceBridgeJ, "com/yfkj/bzyv1/WifServiceBridge")
+Q_DECLARE_JNI_NATIVE_METHOD(onNativeResponse)
+Q_DECLARE_JNI_NATIVE_METHOD(onConnectionChangedNative)
+
+static bool tryRegisterNatives()
+{
+    if (g_nativesRegistered.load(std::memory_order_acquire)) {
+        return true;
+    }
+    QJniEnvironment qenv;
+    if (!qenv.jniEnv()) {
+        return false;
+    }
+    bool ok = qenv.registerNativeMethods<QtJniTypes::WifServiceBridgeJ>({
+        Q_JNI_NATIVE_METHOD(onNativeResponse),
+        Q_JNI_NATIVE_METHOD(onConnectionChangedNative)
+    });
+    if (ok) {
+        g_nativesRegistered.store(true, std::memory_order_release);
+    }
+    qCDebug(lcWif) << "WifService registerNativeMethods:" << ok;
+    return ok;
+}
+
+Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void * /*reserved*/)
+{
+    // 尝试立即注册; 若失败会在 bind() 时再次尝试 (此时 app 类必定已加载).
+    tryRegisterNatives();
+    return JNI_VERSION_1_6;
+}
+
+// ---------------------------------------------------------------------------
+// PIMPL
+// ---------------------------------------------------------------------------
+class WifService::Private
+{
+public:
+    bool bound = false;
+};
+
+WifService::WifService(QObject *parent)
+    : QObject(parent), d(new Private)
+{
+    g_instance.store(this, std::memory_order_release);
+}
+
+WifService::~WifService()
+{
+    unbind();
+    if (g_instance.load(std::memory_order_acquire) == this) {
+        g_instance.store(nullptr, std::memory_order_release);
+    }
+    delete d;
+}
+
+void WifService::bind()
+{
+    if (d->bound) {
+        return;
+    }
+#ifdef Q_OS_ANDROID
+    QJniObject ctx = QNativeInterface::QAndroidApplication::context();
+    if (!ctx.isValid()) {
+        qCWarning(lcWif) << "bind: Android context not available";
+        return;
+    }
+    // 确保 native 方法已注册 (如果 JNI_OnLoad 时失败, 这里再补一次).
+    tryRegisterNatives();
+    QJniObject::callStaticMethod<void>(
+        "com/yfkj/bzyv1/WifServiceBridge",
+        "bind",
+        "(Landroid/content/Context;)V",
+        ctx.object());
+    d->bound = true;
+    qCDebug(lcWif) << "WifService bound";
+#else
+    qCDebug(lcWif) << "bind: non-Android platform, no-op";
+#endif
+}
+
+void WifService::unbind()
+{
+    if (!d->bound) {
+        return;
+    }
+#ifdef Q_OS_ANDROID
+    QJniObject ctx = QNativeInterface::QAndroidApplication::context();
+    if (ctx.isValid()) {
+        QJniObject::callStaticMethod<void>(
+            "com/yfkj/bzyv1/WifServiceBridge",
+            "unbind",
+            "(Landroid/content/Context;)V",
+            ctx.object());
+    }
+#endif
+    d->bound = false;
+}
+
+int WifService::request(const QString &type, const QJsonObject &param)
+{
+    QJsonObject root;
+    root.insert(QStringLiteral("type"), type);
+    if (!param.isEmpty()) {
+        root.insert(QStringLiteral("param"), param);
+    }
+    return requestRaw(QString::fromUtf8(QJsonDocument(root).toJson(QJsonDocument::Compact)));
+}
+
+int WifService::requestMap(const QString &type, const QVariantMap &param)
+{
+    return request(type, QJsonObject::fromVariantMap(param));
+}
+
+int WifService::requestRaw(const QString &json)
+{
+#ifdef Q_OS_ANDROID
+    QJniObject jstr = QJniObject::fromString(json);
+    jint ret = QJniObject::callStaticMethod<jint>(
+        "com/yfkj/bzyv1/WifServiceBridge",
+        "request",
+        "(Ljava/lang/String;)I",
+        jstr.object());
+    return static_cast<int>(ret);
+#else
+    Q_UNUSED(json);
+    qCDebug(lcWif) << "requestRaw (no-op):" << json;
+    return -1;
+#endif
+}
+
+void WifService::onResponseFromJni(const QString &type, int code,
+                                   const QString &msg, const QString &json)
+{
+    emit responseReceived(type, code, msg, json);
+}
+
+// ===========================================================================
+// 便捷封装
+// ===========================================================================
+int WifService::reboot()
+{
+    QJsonObject p; p.insert(QStringLiteral("delay"), 0);
+    return request(TYPE_REBOOT(), p);
+}
+
+int WifService::requestLocation()
+{
+    return request(TYPE_LOCATION());
+}
+
+int WifService::requestDeviceInfo()
+{
+    return request(TYPE_DEVICE_INFO());
+}
+
+int WifService::setTime(qint64 timeMs)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("time"), timeMs);
+    return request(TYPE_SET_TIME(), p);
+}
+
+int WifService::setHotspot(const QString &ssid, const QString &password)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("ssid"), ssid);
+    p.insert(QStringLiteral("password"), password);
+    return request(TYPE_HOTSPOT_CONFIG(), p);
+}
+
+int WifService::setWifi(const QString &ssid, const QString &password,
+                        bool isStatic, const QString &ip,
+                        const QString &dns1, const QString &dns2)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("ssid"), ssid);
+    p.insert(QStringLiteral("password"), password);
+    if (isStatic) {
+        p.insert(QStringLiteral("isStatic"), true);
+        p.insert(QStringLiteral("ip"), ip);
+        p.insert(QStringLiteral("dns1"), dns1);
+        p.insert(QStringLiteral("dns2"), dns2);
+    } else {
+        p.insert(QStringLiteral("isStatic"), false);
+    }
+    return request(TYPE_WIFI_CONFIG(), p);
+}
+
+int WifService::setEthernet(const QString &ip, const QString &netmask,
+                            const QString &gateway,
+                            const QString &dns1, const QString &dns2)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("ip"), ip);
+    p.insert(QStringLiteral("netmask"), netmask);
+    p.insert(QStringLiteral("gateway"), gateway);
+    p.insert(QStringLiteral("dns1"), dns1);
+    p.insert(QStringLiteral("dns2"), dns2);
+    return request(TYPE_ETHERNET_CONFIG(), p);
+}
+
+int WifService::setEthernetEnable(const QString &iface, bool enable)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("iface"), iface);
+    p.insert(QStringLiteral("enable"), enable);
+    return request(TYPE_ETHERNET_ENABLE(), p);
+}
+
+int WifService::setStatusBarVisible(bool visible)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("show"), visible);
+    return request(TYPE_STATUS_BAR(), p);
+}
+
+int WifService::setBrightness(int brightness)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("brightness"), brightness);
+    return request(TYPE_BRIGHTNESS(), p);
+}
+
+int WifService::setVolume(int volume)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("volume"), volume);
+    return request(TYPE_VOLUME(), p);
+}
+
+int WifService::setLocationEnable(bool enable)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("enable"), enable);
+    return request(TYPE_LOCATION_ENABLE(), p);
+}
+
+int WifService::startHome()
+{
+    return request(TYPE_START_HOME());
+}
+
+int WifService::factoryReset()
+{
+    return request(TYPE_FACTORY_RESET());
+}
+
+int WifService::install(const QString &apkPath, bool autoStart)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("path"), apkPath);
+    return request(autoStart ? TYPE_INSTALL_AND_START() : TYPE_INSTALL(), p);
+}
+
+int WifService::uninstall(const QString &packageName)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("packageName"), packageName);
+    return request(TYPE_UNINSTALL(), p);
+}
+
+int WifService::startApp(const QString &packageName)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("packageName"), packageName);
+    return request(TYPE_INSTALL_AND_START(), p);
+}
+
+int WifService::setFunctionLock(const QString &function, const QString &password)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("function"), function);
+    p.insert(QStringLiteral("new_password"), password);
+    return request(TYPE_FUNCTION_LOCK(), p);
+}
+
+int WifService::setScreenLock(const QString &newLockType, const QString &newLock,
+                              const QString &currentLockType, const QString &currentLock)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("newLockType"), newLockType);
+    p.insert(QStringLiteral("newLock"), newLock);
+    if (!currentLockType.isEmpty()) {
+        p.insert(QStringLiteral("currentLockType"), currentLockType);
+        p.insert(QStringLiteral("currentLock"), currentLock);
+    }
+    return request(TYPE_SET_SCREEN_LOCK(), p);
+}
+
+int WifService::addAppWidget(const QString &packageName, const QString &className,
+                             int screen, int cellX, int cellY, int spanX, int spanY)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("packageName"), packageName);
+    p.insert(QStringLiteral("className"), className);
+    p.insert(QStringLiteral("screen"), screen);
+    p.insert(QStringLiteral("cellX"), cellX);
+    p.insert(QStringLiteral("cellY"), cellY);
+    p.insert(QStringLiteral("spanX"), spanX);
+    p.insert(QStringLiteral("spanY"), spanY);
+    return request(TYPE_ADD_APP_WIDGET(), p);
+}
+
+int WifService::configInstallWhitelist(const QString &action, const QString &packageName)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("action"), action);
+    p.insert(QStringLiteral("package_name"), packageName);
+    return request(TYPE_CONFIG_INSTALL_WHITELIST(), p);
+}
+
+int WifService::setCustomLauncher(const QString &packageName)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("packageName"), packageName);
+    return request(TYPE_CUSTOM_LAUNCHER(), p);
+}
+
+int WifService::rebootModem()
+{
+    return request(TYPE_REBOOT_MODEM());
+}
+
+int WifService::setCustomBootAnimation(const QString &filePath)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("path"), filePath);
+    return request(TYPE_CUSTOM_BOOT_ANIMATION(), p);
+}
+
+int WifService::setAutoTime(bool enable)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("enable"), enable);
+    return request(TYPE_AUTO_TIME(), p);
+}
+
+int WifService::setFanControl(int level)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("level"), level);
+    return request(TYPE_FAN_CONTROL(), p);
+}
+
+int WifService::clearAppStorage(const QString &packageName)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("packageName"), packageName);
+    return request(TYPE_CLEAR_APP_STORAGE(), p);
+}
+
+int WifService::setKioskMode(bool enable)
+{
+    QJsonObject root;
+    root.insert(QStringLiteral("type"), TYPE_KIOSK_MODE());
+    root.insert(QStringLiteral("param"), QJsonValue(enable));
+    return requestRaw(QString::fromUtf8(QJsonDocument(root).toJson(QJsonDocument::Compact)));
+}
+
+int WifService::otaUpdate(const QString &filePath)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("path"), filePath);
+    return request(TYPE_OTA_UPDATE(), p);
+}
+
+int WifService::setAlias(const QString &packageName, const QString &alias)
+{
+    QJsonObject p;
+    p.insert(QStringLiteral("packageName"), packageName);
+    p.insert(QStringLiteral("alias"), alias);
+    return request(TYPE_ALIAS(), p);
+}
+
+#include "moc_wif_service.cpp"

+ 2 - 9
q6_felgo_iot/CMakeLists.txt

@@ -89,7 +89,7 @@ include_directories(${PROJECT_SOURCE_DIR}/../Lib/opencv451/header)
 include_directories(${PROJECT_SOURCE_DIR}/../Lib/spdlog/header)
 include_directories(${PROJECT_SOURCE_DIR}/../Lib/curl/header)
 include_directories(${PROJECT_SOURCE_DIR}/../Lib/libuvc/Android-Arm-v8a/header)
-include_directories(${PROJECT_SOURCE_DIR}/../Lib/mvs/MVS-3.0.1_aarch64_20251113/include)
+include_directories(${PROJECT_SOURCE_DIR}/../Lib/mvs/includes)
 include_directories(${PROJECT_SOURCE_DIR}/../Lib/librga-1.10.0/include)
 qt_add_executable(q6_felgo_iot
     header/main.h
@@ -239,18 +239,11 @@ target_link_libraries(q6_felgo_iot
 
 target_link_libraries(q6_felgo_iot
   PRIVATE
-  ${MVS_LIB_PATHS}/libCppUnit_gcc49_v3_0.so
-  ${MVS_LIB_PATHS}/libGCBase_gcc49_v3_0.so
-  ${MVS_LIB_PATHS}/libGenApi_gcc49_v3_0.so
-  ${MVS_LIB_PATHS}/libLog_gcc49_v3_0.so
-  ${MVS_LIB_PATHS}/libMathParser_gcc49_v3_0.so
   ${MVS_LIB_PATHS}/libMediaProcess.so
   ${MVS_LIB_PATHS}/libMvCameraControl.so
   ${MVS_LIB_PATHS}/libMvCameraControlWrapper.so
   ${MVS_LIB_PATHS}/libMVGigEVisionSDK.so
-  ${MVS_LIB_PATHS}/libMvUsb3vTL.so
-  ${MVS_LIB_PATHS}/libNodeMapData_gcc49_v3_0.so
-  ${MVS_LIB_PATHS}/libXmlParser_gcc49_v3_0.so)
+  ${MVS_LIB_PATHS}/libMvUsb3vTL.so)
 
 
 target_link_libraries(q6_felgo_iot

+ 16 - 16
q6_felgo_iot/CMakeLists.txt.user

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 17.0.1, 2026-06-23T11:47:39. -->
+<!-- Written by QtCreator 17.0.1, 2026-07-24T20:37:39. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
@@ -108,27 +108,27 @@
     <value type="int" key="CMake.Configure.BaseEnvironment">2</value>
     <value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
     <valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
-    <value type="QString" key="CMake.Initial.Parameters">-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON
--DCMAKE_FIND_ROOT_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
--DCMAKE_TOOLCHAIN_FILE:FILEPATH=F:/Android_Env/android_sdk/ndk/27.2.12479018/build/cmake/android.toolchain.cmake
--DCMAKE_BUILD_TYPE:STRING=Release
--DQT_MAINTENANCE_TOOL:FILEPATH=D:/Qt/Felgo/MaintenanceTool.exe
+    <value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Ninja
 -DANDROID_NDK:PATH=F:/Android_Env/android_sdk/ndk/27.2.12479018
 -DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
--DQT_NO_GLOBAL_APK_TARGET_PART_OF_ALL:BOOL=ON
--DQT_HOST_PATH:PATH=%{Qt:QT_HOST_PREFIX}
--DANDROID_ABI:STRING=arm64-v8a
--DANDROID_SDK_ROOT:PATH=F:/Android_Env/android_sdk
 -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
--DCMAKE_GENERATOR:STRING=Ninja
--DANDROID_STL:STRING=c++_shared
+-DQT_USE_TARGET_ANDROID_BUILD_DIR:BOOL=ON
+-DQT_NO_GLOBAL_APK_TARGET_PART_OF_ALL:BOOL=ON
+-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
+-DCMAKE_TOOLCHAIN_FILE:FILEPATH=F:/Android_Env/android_sdk/ndk/27.2.12479018/build/cmake/android.toolchain.cmake
+-DANDROID_USE_LEGACY_TOOLCHAIN_FILE:BOOL=OFF
+-DCMAKE_BUILD_TYPE:STRING=Release
+-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
+-DQT_MAINTENANCE_TOOL:FILEPATH=D:/Qt/Felgo/MaintenanceTool.exe
 -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
+-DANDROID_SDK_ROOT:PATH=F:/Android_Env/android_sdk
 -DANDROID_PLATFORM:STRING=android-23
 -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
--DQT_USE_TARGET_ANDROID_BUILD_DIR:BOOL=ON
--DANDROID_USE_LEGACY_TOOLCHAIN_FILE:BOOL=OFF
--DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
--DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake</value>
+-DCMAKE_FIND_ROOT_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
+-DANDROID_ABI:STRING=arm64-v8a
+-DQT_HOST_PATH:PATH=%{Qt:QT_HOST_PREFIX}
+-DANDROID_STL:STRING=c++_shared
+-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON</value>
     <value type="QString" key="CMake.Source.Directory">F:\QT_WorkSpace\qt6_iot_all\q6_felgo_iot</value>
     <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:\QT_WorkSpace\qt6_iot_all\q6_felgo_iot\build\Qt_6_8_3_android_arm64_v8a_Clang_arm64_v8a-Release</value>
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">

+ 13 - 0
q6_felgo_iot/docs/Readme.md

@@ -1,3 +1,16 @@
+@header/cameramanager.h:218-232 Y轴是负责对焦,每次移动会触发这个槽函数,第一个位置是X0_Z0,依次是X0_Z1,X0_Z2,X0_Z3,X1_Z0,X1_Z2到X7_Z3一共32个位置,打开相机后初始化位置为X0_Z0,触发 @src/mserial.cpp:352-356 后更新位置,现在需要完成Y轴的每次移动都触发图片保存,保存的规则按照位置创建文件夹,X和Z移动完成后对每个位置的文件夹下的图片进行融合,再进行上传
+## 20260708
+    #define APP_VERSION "1.11.30"
+    1、界面ui更新:
+        增加滤网更换测试按钮,
+        滑台控制、相机参数设置、调试增加密码保护
+        主界面增加胶带使用量、滤网使用量、自清洁周期的状态展示
+        设置坐标从工作状态界面移到测试界面的高级设置中
+    2、增图像增强算法:
+        景深融合、
+        对比度增强
+        图像锐化
+    3、图像查看界面及后端,可以显示年月日归档目录下的子目录(主要是对焦过程归档)
 ## 20260623
      #define APP_VERSION "1.10.30"
      1、针对MCU丢参数的更新,解析到坐标为0时主动恢复参数到MCU;

+ 4 - 1
q6_felgo_iot/header/TreeModel.h

@@ -21,6 +21,7 @@ public:
         MonthFolder,
         DayFolder,
         AlbumFolder,
+        PositionFolder,
         Image
     };
 
@@ -122,7 +123,8 @@ private:
     void loadMonths(TreeItem *yearItem, const QModelIndex &parentIndex);
     void loadDays(TreeItem *monthItem, const QModelIndex &parentIndex);
     void loadAlbums(TreeItem *dayItem, const QModelIndex &parentIndex);
-    void loadImages(TreeItem *albumItem, const QModelIndex &parentIndex);
+    void loadPositionFolders(TreeItem *albumItem, const QModelIndex &parentIndex);
+    void loadImages(TreeItem *parentItem, const QModelIndex &parentIndex);
 
     TreeItem *m_rootItem;
     QString m_picturesPath;
@@ -131,6 +133,7 @@ private:
     QRegularExpression m_monthRegex{R"(^(0[1-9]|1[0-2])$)"};
     QRegularExpression m_dayRegex{R"(^(0[1-9]|[12][0-9]|3[01])$)"};
     QRegularExpression m_albumRegex{R"(^\d{14}$)"};
+    QRegularExpression m_positionRegex{R"(^X\d+_Z\d+$)"};
 
     bool m_loading = false;
     void setLoading(bool loading);

+ 31 - 1
q6_felgo_iot/header/cameramanager.h

@@ -211,6 +211,8 @@ signals:
     void signal_photo_saved();
     void signal_wait_upload(const QString &path);
     void signal_cache_image(const QString &path);
+    void signal_fuse_batch_finished(int fusedCount, int skippedCount);
+    void signal_position_changed(int x, int z);
     void stepCountChanged(const QString step);
 public slots:
 
@@ -225,6 +227,20 @@ public slots:
         emit serial_data(m_json.ImageFunc(m_qulityString.toDouble()));
         emit qulityStringChanged();
         emit stepCountChanged(stepcount);
+        if (m_xz_sequence_done) {
+            LOG("onMovDone: XZ sequence already done, skip saving at {}/{}",
+                x_step, z_step);
+            return;
+        }
+        ensurePositionFolder();
+        saveImageForCurrentPosition();
+        y_step++;
+        LOG("onMovDone: position=X{}_Z{}, y_step={}", x_step, z_step, y_step);
+        if (y_step >= focus_step_max) {
+            y_step = focus_step_max;
+            m_xz_sequence_done = true;
+            startDepthFusionBatch();
+        }
     }
 //    void parseFrame(const cv::Mat& frame);
     void upload_handle(void);
@@ -242,10 +258,16 @@ private slots:
     void update_qulstr(QString q_str);
     //
     void saveMatAsJpeg(const QVideoFrame &frame);
+    bool saveFrameAsJpeg(const QVideoFrame &frame, const QString &path, int quality = 90);
     //void sendData(QByteArray m_byte);
     void displayFrame(const QVideoFrame &frame);
     void mov_x_z_run();
     void processFrameAsync(const RawFrame& frame);
+    void ensurePositionFolder();
+    void startDepthFusionBatch();
+    void saveImageForCurrentPosition();
+    void uploadFusedImage(const QString &imagePath);
+    void fusePositionFolder(const QString &folder, int x, int z);
 private:
     Q_DISABLE_COPY( Frames )
 
@@ -292,14 +314,22 @@ private:
     QVector<double> image_qulity;
 
     int image_qulity_num;
-
+    int pos_step = 0;
     int z_step = 0;
     int x_step = 0;
 
     //图片归档路径
     QString picture_path_floader;
+    QString current_position_folder;
+    QStringList position_folders;
+    int last_position_x = -1;
     QVector<cv::Mat> m_frame_buffer;
 
+    int y_step = 0; // 当前Y轴对焦步数
+    bool m_xz_sequence_done = false; // X/Z移动序列是否完成
+    bool m_fusion_started = false; // 是否已开始融合
+    QMutex m_positionMutex; // 位置状态互斥锁
+
     int testJNI();
     int checkPermission(void)
     {

+ 131 - 3
q6_felgo_iot/header/m_opencv.h

@@ -3,6 +3,8 @@
 
 #include <QObject>
 #include <QImage>
+#include <QFuture>
+
 #include <opencv2/opencv.hpp>
 #include <opencv2/highgui/highgui.hpp>
 #include <opencv2/imgproc/imgproc.hpp>
@@ -12,22 +14,148 @@
 
 #include <opencv2/xfeatures2d/nonfree.hpp> //SIFT
 
+#include <opencv2/photo.hpp>            // CLAHE
+#include <opencv2/calib3d.hpp>           // findHomography, warpPerspective
+#include <opencv2/imgcodecs.hpp>
+
 
 using namespace std;
 using namespace cv;
 using namespace cv::xfeatures2d;
 
 
-class OpencvFunc
+class OpencvFunc : public QObject
 {
+    Q_OBJECT
 public:
-    OpencvFunc();
+    explicit OpencvFunc(QObject *parent = nullptr);
     QString  brenner(cv::Mat &image);
-    QString  Laplacian(cv::Mat &image);
+    QString  Laplacian(cv::Mat &image);          // mean(|Laplacian|) - 平均幅度
     QString  Tenengrad(cv::Mat &image);
     QString  calculateSharpness(const QImage& image);
     int CustomSharpening(const QString &path);
     Mat qim2mat(QImage &qim);
+
+    // ==================== 显微专用清晰度评价 ====================
+    // 综合评分:Laplacian 方差(聚焦金标准)+ Tenengrad + Brenner
+    struct MicroscopeFocusMetrics {
+        double laplacianVar;     // Laplacian 方差(显微聚焦金标准)
+        double tenengrad;        // Tenengrad 梯度能量
+        double brenner;          // Brenner 二阶差分能量
+        double combinedScore;    // 综合评分(越大越清晰)
+    };
+    // 推荐用 evaluateFocusScore 替换单指标的 brenner/Laplacian/Tenengrad
+    MicroscopeFocusMetrics evaluateFocusScore(const cv::Mat& image);
+
+    // ==================== 对比度增强算法 ====================
+    // 1) CLAHE(限制对比度的自适应直方图均衡)—— 显微最常用,处理不均匀照明
+    //    在 LAB 空间的 L 通道做,避免色相偏移
+    //    clipLimit: 直方图裁剪阈值,2.0~4.0 适合显微,>5 会过增强
+    //    tileGridSize: 局部直方图块大小,8 即 8x8,显微推荐 4~16
+    cv::Mat enhanceContrastCLAHE(const cv::Mat& src,
+                                  double clipLimit = 2.0,
+                                  int tileGridSize = 8);
+
+    // 2) 自动对比度(百分位拉伸 / Percentile Stretch)
+    //    把 [lowPct, highPct] 百分位映射到 [0,255],抗离群点(灰尘/气泡)
+    //    lowPct=1, highPct=99 是业界默认,显微相机的灰尘像素不会被拉爆
+    cv::Mat enhanceContrastAuto(const cv::Mat& src,
+                                 double lowPct = 1.0,
+                                 double highPct = 99.0);
+
+    // 3) Gamma 校正(非线性亮度拉伸)
+    //    gamma<1: 提亮暗部(暗场显微常用)
+    //    gamma>1: 压暗亮部(荧光过曝区恢复)
+    //    auto=true 时按图像平均亮度自动选 gamma(0.4~2.4)
+    cv::Mat enhanceContrastGamma(const cv::Mat& src, double gamma = 1.0, bool _auto = false);
+
+    // 4) 多尺度 Retinex (MSR) —— 显微不均匀照明的"杀手锏"
+    //    经典 Jobson et al. 1997 多尺度 Retinex,比 CLAHE 更能消除
+    //    视场中心-边缘的亮度差(显微镜的典型问题)
+    //    sigmas: 多尺度高斯标准差(像素),推荐 {15, 80, 250}(显微默认)
+    cv::Mat enhanceContrastRetinexMSR(const cv::Mat& src,
+                                       const std::vector<double>& sigmas = {15.0, 80.0, 250.0});
+
+    // 5) 对比度增强统一入口(推荐 QML 用这一个)
+    //    pipeline: 0=CLAHE  1=Auto  2=Gamma  3=RetinexMSR  4=CLAHE+Auto
+    cv::Mat enhanceContrast(const cv::Mat& src, int pipeline = 4);
+
+    // 6) 文件路径版(异步 + 同步),适合 QML 直接调用
+    Q_INVOKABLE QString enhanceContrastPath(const QString& imagePath, int pipeline = 4);
+    Q_INVOKABLE void enhanceContrastPathAsync(const QString& imagePath, int pipeline = 4);
+
+    // 7) 显微专用锐化(边缘保护 + LAB L 通道 + 多尺度)
+    //    解决普通 unsharp mask 在显微图上放大噪声的问题
+    //    amount: 锐化强度,0.5~1.5(与 unsharpMask 同样的 scale)
+    //    sigma: 高斯半径,匹配物镜 PSF:20x 物镜 ~1.0,40x ~0.5
+    //    noiseFloor: 噪声门限(拉普拉斯幅度),低于此的像素不锐化
+    cv::Mat sharpenMicroscope(const cv::Mat& src,
+                               double amount = 1.0,
+                               double sigma = 1.0,
+                               double noiseFloor = 5.0);
+
+    // ==================== DWT多聚焦融合算法 ====================
+    QString fuseImages(const QStringList& imagePaths);
+    // 主融合函数:融合多张不同焦点的图像(从QML调用,异步)
+    // imagePaths: 输入图像文件路径列表
+    Q_INVOKABLE void fuseImagesAsync(const QStringList& imagePaths);
+
+    // 主融合函数:融合多张不同焦点的图像
+    // images: 输入图像列表,所有图像必须尺寸相同
+    // levels: 小波分解层数,默认为3层
+    // 返回:融合后的图像
+    cv::Mat multiFocusFusion(const std::vector<cv::Mat>& images, int levels = 3);
+
+    // 单张图像的Haar小波分解
+    // src: 输入图像(单通道,浮点型)
+    // levels: 分解层数
+    // 返回:分解后的小波系数列表(LL, LH, HL, HH)
+    std::vector<std::vector<cv::Mat>> haarDWT(const cv::Mat& src, int levels);
+
+    // Haar小波逆变换
+    // coeffs: 小波系数列表
+    // 返回:重构后的图像
+    cv::Mat haarIDWT(const std::vector<std::vector<cv::Mat>>& coeffs);
+
+    // 计算图像的聚焦度图(清晰度图)
+    // image: 输入图像
+    // 返回:聚焦度图,值越大表示越清晰
+    cv::Mat calculateFocusMap(const cv::Mat& image);
+
+    // 创建平滑的权重图
+    // focusMaps: 各图像的聚焦度图
+    // sigma: 高斯平滑的标准差,默认为5
+    // 返回:各图像的权重图
+    std::vector<cv::Mat> createWeightMaps(const std::vector<cv::Mat>& focusMaps, double sigma = 5.0);
+
+    // ==================== 高级流水线 (DWT+ECC+CLAHE+Bilateral) ====================
+    // 完整融合管线:
+    //   1) CLAHE 预处理(Lab L 通道直方图均衡,避免色偏)
+    //   2) ECC 图像配准(基于 ORB 特征 + 单应性,将其它图 warp 到参考系)
+    //   3) 3 级 Haar DWT 融合(低频取均值,高频取 |max| + 一致性校验)
+    //   4) 双边滤波后处理(保边去噪)
+    // 返回融合结果,并把原始输入拷贝到 outDir/inputs/ 与融合图放在同目录
+    cv::Mat fuseAdvanced(const std::vector<cv::Mat>& images, const QString& outDir = QString());
+
+    // ==================== Unsharp Mask 锐化 ====================
+    // Unsharp Mask 锐化算法:
+    //   1) 对原图进行高斯模糊得到模糊版本
+    //   2) 计算边缘 mask = original - blurred
+    //   3) 将 mask 按比例叠加回原图
+    //   result = original + amount * (original - blurred)
+    // src: 输入图像(支持单通道灰度和多通道彩色)
+    // amount: 锐化强度,推荐范围 0.5-2.0,值越大锐化越强
+    // sigma: 高斯模糊标准差,推荐范围 1.0-3.0,值越大边缘检测范围越大
+    // 返回:锐化后的图像
+    cv::Mat unsharpMask(const cv::Mat& src, double amount = 1.0, double sigma = 1.5);
+
+signals:
+    // 融合完成信号
+    void fuseFinished(const QString& resultPath);
+    // 对比度增强完成信号(异步任务用)
+    void contrastEnhanced(const QString& resultPath, int pipeline);
+private:
+
 };
 
 #endif // M_OPENCV_H

+ 1 - 1
q6_felgo_iot/header/main.h

@@ -37,7 +37,7 @@
 #include <opencv2/features2d/features2d.hpp>
 #include <opencv2/xfeatures2d/nonfree.hpp>
 
-#define APP_VERSION "1.10.30"
+#define APP_VERSION "1.11.30"
 
 using namespace std;
 

+ 1 - 0
q6_felgo_iot/header/mqtthandler.h

@@ -137,6 +137,7 @@ signals:
     void signal_reupload_image(const QString &path);
     void signal_imei_change(const QString &new_imei);
     void signal_upload_log(const QString &path);
+    void signal_set_camera_exposure(int exposureTime);
 public slots:
     void install_app();
     void startReupload();

+ 0 - 35
q6_felgo_iot/header/mserial.h

@@ -281,40 +281,5 @@ private:
 };
 
 
-class Serial_AT : public QSerialPort
-{
-    Q_OBJECT
-public:
-    explicit Serial_AT(QObject *parent = 0);
-    QTimer *m_5s;
-    // 发送字节数
-    int txByte = 0;
-    // 接收字节数
-    int rxByte = 0;
-    // 数据缓存区
-    QByteArray dataBuf;
-    // 串口描述内容
-    QStringList serialDescription;
-    // 串口扫描函数
-    QStringList serialScan(void);
-    bool serialOpen(QString serialName, int baudRate);
-    void sendData(QByteArray sendData);
-    void serialClose();
-
-private slots:
-    void ReadData();
-
-private:
-    QTextCodec *tc;
-    QString at_str;
-    QTimer* timeout_recv = nullptr;
-signals:
-    void readSignal(int recByte);
-    void sendSuccess(int sendByte);
-    void imeiDone();
-    void iccidDone();
-};
-
-
 
 #endif // MSEIAL_H

+ 87 - 19
q6_felgo_iot/qml/pages/HomePage.qml

@@ -19,7 +19,12 @@ AppPage {
   property var tt
   property bool isonline: false
   property var net_list:[]
-
+  property real tapeUsage: 0
+  property real filterUsage: 0
+  property bool tapeAlertShown: false
+  property bool filterAlertShown: false
+  property real freq_filter: 0
+  property real worked_day: 0
   navigationBarHidden: true
   backgroundColor: app.theme_backgroundColor
 
@@ -189,7 +194,31 @@ AppPage {
           dvs = dvs.split("-")
           app.bvReceived(dvs[0])
           app.appReceived(dvs[1])
+
+          if(jsonData.ext.tape_used){
+              tapeUsage = Number(jsonData.ext.tape_used)
+              if(tapeUsage >= 100 && !tapeAlertShown){
+                  tapeAlertShown = true
+                  nativeUtils.displayMessageBox("胶带更换提醒", "胶带使用量已达到100%,请及时更换胶带!", 1)
+              }
+              if(tapeUsage < 100) tapeAlertShown = false
+          }
+          if(jsonData.ext.filter_used){
+              filterUsage = Number(jsonData.ext.filter_used)
+              if(filterUsage >= 100 && !filterAlertShown){
+                  filterAlertShown = true
+                  nativeUtils.displayMessageBox("滤网更换提醒", "滤网使用量已达到100%,请及时更换滤网!", 1)
+              }
+              if(filterUsage < 100) filterAlertShown = false
+          }
+          if(jsonData.ext.freq_filter){
+              freq_filter = jsonData.ext.freq_filter
+          }
+          if(jsonData.ext.worked_day){
+              worked_day = jsonData.ext.worked_day
+          }
       }
+      
       function onDisconnect_485(){
            text_devicesta.text =qsTr("485未连接,读取数据失败");
            originalString =serial.getId()
@@ -438,12 +467,12 @@ AppPage {
 
                 Column {
                     anchors.centerIn: parent
-                    spacing: 12
+                    spacing: 8
                     visible: true
                     AppImage {
                         id: image_01
                         anchors.horizontalCenter: parent.horizontalCenter
-                        anchors.topMargin:  30
+                        anchors.topMargin:  15
                         source: "../../assets/a.svg"
                         fillMode: Image.PreserveAspectFit
                     }
@@ -456,25 +485,65 @@ AppPage {
                         font.pixelSize: 16
                     }
 
-                    AppImage {
-                        id: focus_xy_set
-                        anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
-                        fillMode: Image.PreserveAspectFit  // 保持纵横比适应
-                        source: "../../assets/set.svg"
-                        AppButton{
+                    // 胶带使用量
+                    Column {
+                        anchors.horizontalCenter: parent.horizontalCenter
+                        spacing: 3
+                        width: dp(120)
+                        AppText {
+                            anchors.horizontalCenter: parent.horizontalCenter
+                            text: "胶带: " + tapeUsage.toFixed(2) + "%"
+                            color: tapeUsage >= 100 ? "#ff4444" : "#666666"
+                            fontSize: 12
+                        }
+                        Rectangle {
+                            anchors.horizontalCenter: parent.horizontalCenter
+                            width: dp(100)
+                            height: dp(6)
+                            color: "#e8e8e8"
+                            radius: dp(3)
+                            Rectangle {
+                                width: parent.width * Math.min(tapeUsage, 100) / 100
+                                height: parent.height
+                                color: tapeUsage >= 100 ? "#ff4444" : "#28a779"
+                                radius: dp(3)
+                            }
+                        }
+                    }
 
-                            anchors.fill: parent
-                            //text:" 修改"
-                            textColor: "GRAY"
-                            textSize: 10
-                            flat: true
-                            onClicked: {
-                                focus_setting.visible = !focus_setting.visible
-                                text_devicesta.visible = !text_devicesta.visible
-                                image_01.visible = !image_01.visible
+                    // 滤网使用量
+                    Column {
+                        anchors.horizontalCenter: parent.horizontalCenter
+                        spacing: 3
+                        width: dp(120)
+                        AppText {
+                            anchors.horizontalCenter: parent.horizontalCenter
+                            text: "滤网: " + filterUsage.toFixed(2) + "%"
+                            color: filterUsage >= 100 ? "#ff4444" : "#666666"
+                            fontSize: 12
+                        }
+                        Rectangle {
+                            anchors.horizontalCenter: parent.horizontalCenter
+                            width: dp(100)
+                            height: dp(6)
+                            color: "#e8e8e8"
+                            radius: dp(3)
+                            Rectangle {
+                                width: parent.width * Math.min(filterUsage, 100) / 100
+                                height: parent.height
+                                color: filterUsage >= 100 ? "#ff4444" : "#28a779"
+                                radius: dp(3)
                             }
                         }
                     }
+
+                    // 自清洁周期
+                    AppText {
+                        anchors.horizontalCenter: parent.horizontalCenter
+                        text: "自清洁周期: " + Number(worked_day).toString() + "/" + Number(freq_filter).toString()
+                        color: app.fontColor
+                        fontSize: 11
+                    }
                 }
             }
 
@@ -1340,7 +1409,6 @@ AppPage {
             }
         }
 
-
   }
 
 } // page

+ 136 - 18
q6_felgo_iot/qml/pages/PhotostitcherPage.qml

@@ -11,7 +11,103 @@ AppPage {
 
     property bool isLoading: false
     property bool rootExpanded: false
+    property var selectedImages: []
+    property bool isSelecting: false
+    property bool isFusing: false
+
+    // 融合按钮
+    AppButton {
+        id: fuseButton
+        anchors.bottom: parent.bottom
+        anchors.right: parent.right
+        anchors.margins: 20
+        text: "图像融合"
+        visible: selectedImages.length >= 2 && !isFusing
+        backgroundColor: "#28a779"
+        textColor: "white"
+        z: 100
+        onClicked: {
+            if (selectedImages.length >= 2) {
+                isFusing = true
+                console.log("开始融合", selectedImages.length, "张图片")
+                opencvFunc.fuseImagesAsync(selectedImages)
+            }
+        }
+    }
+
+    // 融合加载动画
+    BusyIndicator {
+        id: fuseBusyIndicator
+        anchors.bottom: parent.bottom
+        anchors.right: parent.right
+        anchors.margins: 20
+        visible: isFusing
+        width: 60
+        height: 60
+        z: 100
+    }
+
+    // 取消选择按钮
+    AppButton {
+        id: cancelButton
+        anchors.bottom: parent.bottom
+        anchors.left: parent.left
+        anchors.margins: 20
+        text: "取消选择"
+        visible: isSelecting && !isFusing
+        backgroundColor: "#e74c3c"
+        textColor: "white"
+        z: 100
+        onClicked: {
+            clearSelection()
+        }
+    }
 
+    // 连接融合完成信号
+    Connections {
+        target: opencvFunc
+        function onFuseFinished(resultPath) {
+            isFusing = false
+            if (resultPath) {
+                console.log("融合完成:", resultPath)
+                // 显示融合结果
+                imageListModel.append({filePath: resultPath, isFused: true, selected: false})
+                // 清除选择
+                clearSelection()
+            } else {
+                console.error("融合失败")
+            }
+        }
+    }
+
+    function clearSelection() {
+        selectedImages = []
+        isSelecting = false
+        for (var i = 0; i < imageListModel.count; i++) {
+            imageListModel.setProperty(i, "selected", false)
+        }
+    }
+
+    function toggleImageSelection(filePath) {
+        // 创建新数组以触发QML属性绑定更新
+        var temp = selectedImages.slice()
+        var idx = temp.indexOf(filePath)
+        if (idx >= 0) {
+            temp.splice(idx, 1)
+        } else {
+            temp.push(filePath)
+        }
+        selectedImages = temp
+        isSelecting = selectedImages.length > 0
+
+        // 更新model中的selected状态
+        for (var i = 0; i < imageListModel.count; i++) {
+            if (imageListModel.get(i).filePath === filePath) {
+                imageListModel.setProperty(i, "selected", idx < 0)
+                break
+            }
+        }
+    }
 
     // 全屏查看组件
     Popup {
@@ -168,8 +264,9 @@ AppPage {
                 Rectangle {
                     anchors.fill: parent
                     anchors.margins: 5
-                    color: "transparent"
-                    border.color: "#eee"
+                    color: model.selected ? "#28a779" : "transparent"
+                    border.color: model.selected ? "#28a779" : "#eee"
+                    border.width: model.selected ? 3 : 1
                     radius: 4
 
                     Image {
@@ -189,16 +286,40 @@ AppPage {
                             height: 32
                         }
                     }
+                }
+
+                // 选择标记(使用绝对定位代替anchors.topRight)
+                Rectangle {
+                    x: parent.width - width - 7
+                    y: 7
+                    width: 24
+                    height: 24
+                    color: model.selected ? "#28a779" : "rgba(0,0,0,0.5)"
+                    radius: 12
+                    visible: model.selected  // 只对已选中的图片显示勾选标记
+
+                    Text {
+                        anchors.centerIn: parent
+                        text: "✓"
+                        color: "white"
+                        font.bold: true
+                    }
+                }
 
-                    MouseArea {
-                        anchors.fill: parent
-                        onClicked: {
-                            // 处理图片点击
+                // MouseArea(在外层Rectangle外面,使用delegate Item作为parent)
+                MouseArea {
+                    anchors.fill: parent
+                    onClicked: {
+                        if (isSelecting) {
+                            toggleImageSelection(model.filePath)
+                        } else {
                             console.log("Selected image:", filePath)
-                            // 显示大图
                             showFullscreen(filePath)
                         }
                     }
+                    onPressAndHold: {
+                        toggleImageSelection(model.filePath)
+                    }
                 }
             }
         }
@@ -247,7 +368,7 @@ AppPage {
                             // 展开/折叠指示器
                             Text {
                                 id: indicator
-                                visible: root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4
+                                visible: root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4 || root.type===5
                                 text: root.expanded ? "▼" : "▶"
                                 color: "#666"
                                 anchors.verticalCenter: parent.verticalCenter
@@ -278,15 +399,12 @@ AppPage {
 
                             TapHandler{
                                 onSingleTapped: {
-                                    if(root.type===5){
+                                    if(root.type===6){
                                         imageListModel.clear()
                                         imageListModel.append({filePath: model.path})
                                     }else{
                                         let index = treeView.model.index(row, column)
                                         console.log("row,column",row,column)
-                                        // treeModel.loadChildren(index)
-                                        // treeView.toggleExpanded(row)
-                                        // 若未展开且有子节点,则加载并展开
                                         treeModel.loadChildren(index); // 同步加载子节点(阻塞直到完成)
                                         treeView.toggleExpanded(row); // 显式展开(确保视图刷新)
                                     }
@@ -295,8 +413,8 @@ AppPage {
                                 }
                                 onLongPressed: {
                                     console.log("长按:", root.type)
-                                    if (model.type===4) {
-                                        // 加载文件夹内容到图片区
+                                    if (model.type===4 || model.type===5) {
+                                        // 加载文件夹内容到图片区(支持相册和位置文件夹)
                                         loadFolderContents(model.path)
                                     }
                                 }
@@ -304,13 +422,13 @@ AppPage {
                             // 名称
                             Text {
                                 text: {
-                                    if(root.type===4||root.type===3||root.type===2||root.type===1||root.type===0){
+                                    if(root.type===5||root.type===4||root.type===3||root.type===2||root.type===1||root.type===0){
                                         return model.name + " (" + model.childCount + ")"
                                     }
                                     return model.name
                                 }
-                                color: (root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4) ? "#333" : "#666"
-                                font.bold: root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4
+                                color: (root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4 || root.type===5) ? "#333" : "#666"
+                                font.bold: root.type===0 || root.type === 1 || root.type===2 || root.type===3 || root.type===4 || root.type===5
                                 anchors.verticalCenter: parent.verticalCenter
                                 elide: Text.ElideRight
                                 width: archiveTreeView.width// - 50 - depth * 20
@@ -360,7 +478,7 @@ AppPage {
                 if (files[i].isFolder) {
                     stack.push(files[i].path)
                 } else {
-                    imageListModel.append({filePath: files[i].path})
+                    imageListModel.append({filePath: files[i].path, selected: false})
                 }
             }
         }

File diff suppressed because it is too large
+ 1054 - 812
q6_felgo_iot/qml/pages/TestPage.qml


+ 65 - 2
q6_felgo_iot/src/TreeModel.cpp

@@ -208,6 +208,9 @@ void TreeModel::loadChildren(const QModelIndex &index)
         loadAlbums(item, index);
         break;
     case TreeItem::AlbumFolder:
+        loadPositionFolders(item, index);
+        break;
+    case TreeItem::PositionFolder:
         loadImages(item, index);
         break;
     default:
@@ -318,13 +321,73 @@ void TreeModel::loadAlbums(TreeItem *dayItem, const QModelIndex &parentIndex)
                 info.lastModified(),
                 dayItem);
             dayItem->appendChild(albumItem);
-            // ✅ 加载该相册下的图片
-            loadImages(albumItem, index(row + albums.indexOf(info), 0, parentIndex));
+            // ✅ 加载该相册下的位置文件夹 (X{x}_Z{z})
+            loadPositionFolders(albumItem, index(row + albums.indexOf(info), 0, parentIndex));
         }
         endInsertRows();
     }
 }
 
+void TreeModel::loadPositionFolders(TreeItem *albumItem, const QModelIndex &parentIndex)
+{
+    QDir dir(albumItem->path());
+    dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
+    QFileInfoList entries = dir.entryInfoList();
+
+    QList<QFileInfo> positions;
+    QList<QFileInfo> directImages;
+    for (const QFileInfo &info : entries) {
+        if (info.isDir()) {
+            if (m_positionRegex.match(info.fileName()).hasMatch()) {
+                positions.append(info);
+            }
+        } else {
+            QMimeType mime = m_mimeDb.mimeTypeForFile(info);
+            if (mime.name().startsWith("image/")) {
+                directImages.append(info);
+            }
+        }
+    }
+
+    std::sort(positions.begin(), positions.end(), [](const QFileInfo &a, const QFileInfo &b) {
+        return a.fileName() < b.fileName();
+    });
+    std::sort(directImages.begin(), directImages.end(), [](const QFileInfo &a, const QFileInfo &b) {
+        return a.fileName() < b.fileName();
+    });
+
+    int totalRows = positions.size() + directImages.size();
+    int currentRow = rowCount(parentIndex);
+
+    if (totalRows == 0) return;
+
+    beginInsertRows(parentIndex, currentRow, currentRow + totalRows - 1);
+    // 先添加位置文件夹
+    for (int i = 0; i < positions.size(); ++i) {
+        const QFileInfo &info = positions[i];
+        TreeItem *posItem = new TreeItem(
+            TreeItem::PositionFolder,
+            info.fileName(),
+            info.absoluteFilePath(),
+            info.lastModified(),
+            albumItem);
+        albumItem->appendChild(posItem);
+        // 加载该位置下的图片
+        loadImages(posItem, index(currentRow + i, 0, parentIndex));
+    }
+    // 再添加相册下的直接图片
+    for (int i = 0; i < directImages.size(); ++i) {
+        const QFileInfo &info = directImages[i];
+        albumItem->appendChild(new TreeItem(
+            TreeItem::Image,
+            info.fileName(),
+            info.absoluteFilePath(),
+            info.lastModified(),
+            albumItem));
+    }
+    endInsertRows();
+}
+
 void TreeModel::loadImages(TreeItem *albumItem, const QModelIndex &parentIndex)
 {
     QDir dir(albumItem->path());

+ 297 - 8
q6_felgo_iot/src/cameramanager.cpp

@@ -34,7 +34,14 @@
 #include <QTimer>
 #include <QDateTime>
 #include <QDebug>
+#include <QStandardPaths>
+#include <QRegularExpression>
+#include <QDir>
+#include <QImage>
+#include <QFileInfo>
+#include <QThread>
 #include <QtConcurrent/QtConcurrent>
+#include <QFutureWatcher>
 #include <m_workthread.h>
 #include <mserial.h>
 #include <curl/curl.h>
@@ -51,7 +58,7 @@ namespace Qt6QCamera {
 //< hikrobot
 void *handle = NULL;
 unsigned int nRet = MV_OK;
-MVCC_ENUMVALUE current_pixel;
+MVCC_ENUMVALUE_EX current_pixel;
 
 
 SenderCustom sender_custom;
@@ -248,6 +255,7 @@ Frames::setCameraSw(bool stat_cam)
     if(camera_sta && m_streaming_active) return;  //如果已经是打开状态,退出
     MVCC_FLOATVALUE stExposureTime = {0};
     static int fd = 0;
+    emit serial_data(m_json.setLedState(camera_sta));    //设置补光灯状态
     if(camera_sta){
         if(param::camera_type.contains("hikrobot"))
         {
@@ -384,7 +392,7 @@ Frames::setCameraSw(bool stat_cam)
                      int nPacketSize = MV_CC_GetOptimalPacketSize(handle);
                      if (nPacketSize > 0)
                      {
-                         nRet = MV_CC_SetIntValue(handle,"GevSCPSPacketSize",nPacketSize);
+                         nRet = MV_CC_SetIntValueEx(handle,"GevSCPSPacketSize",nPacketSize);
                          if(nRet != MV_OK)
                          {
                              ERROR("Warning: Set Packet Size fail nRet:{:x}",nRet);
@@ -430,7 +438,7 @@ Frames::setCameraSw(bool stat_cam)
                      ERROR("[MV_CC_GetIntValueEx Height]:{:x}",nRet);
                  }
                  //获取像素格式
-                 nRet = MV_CC_GetPixelFormat(handle,&current_pixel);
+                 nRet = MV_CC_GetEnumValueEx(handle,"PixelFormat",&current_pixel);
                  if(nRet==MV_OK){
                      LOG("MV_CC_GetPixelFormat:{}",current_pixel.nCurValue);
                  }else{
@@ -535,10 +543,11 @@ Frames::setCameraSw(bool stat_cam)
 
     LOG("设置相机状态:{}",camera_sta);
     emit cameraStaChanged(camera_sta);                   //同步状态到qml
-    emit serial_data(m_json.setLedState(camera_sta));    //设置补光灯状态
     if(!param::ptlist.empty())
     {
-        emit signal_photo_saved();
+        //emit signal_photo_saved();  //触发图片上传
+        //触发图片景深融合、融合成功上传成功的、融合失败上传清晰度最高的照片
+
     }
 }
 
@@ -549,14 +558,14 @@ Frames::setExposureTime(const QString &exptime)
     float exposure_time = exptime.toFloat(&ok);
     if(handle&&ok){
         //关闭自动曝光
-        nRet = MV_CC_SetExposureAutoMode(handle,MV_EXPOSURE_AUTO_MODE_OFF);
+        nRet = MV_CC_SetFloatValue(handle,"ExposureTime",MV_EXPOSURE_AUTO_MODE_OFF);
         if(nRet==MV_OK){
             LOG("MV_CC_SetExposureAutoMode OFF Success");
         }else{
             ERROR("MV_CC_SetExposureAutoMode OFF Failed");
         }
 
-        nRet = MV_CC_SetExposureTime(handle,exposure_time);
+        nRet = MV_CC_SetFloatValue(handle,"ExposureTime",exposure_time);
         if(nRet==MV_OK){
             LOG("MV_CC_SetExposureTime Success");
             m_fExposureTime = exptime;
@@ -606,11 +615,15 @@ Frames::mov_x_z_run(){
     /*z3x7*/
     if(z_step==3&&x_step==7){
         emit stopGrabbing(false);
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
 
     if(z_step<=2&&x_step==7){
         z_step++;
         emit serial_data(m_json.MotorMove("movz",movX_b,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
 
 
@@ -621,10 +634,14 @@ Frames::mov_x_z_run(){
         x_step++;
         z_step = 0;
         emit serial_data(m_json.MotorMove("movx",movX_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
     if(z_step<=2&&x_step==6){
         z_step++;
         emit serial_data(m_json.MotorMove("movz",movZ_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
 
     /*z3x5*/
@@ -634,10 +651,14 @@ Frames::mov_x_z_run(){
         x_step++;
         z_step = 0;
         emit serial_data(m_json.MotorMove("movx",movX_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
     if(z_step<=2&&x_step==5){
         z_step++;
         emit serial_data(m_json.MotorMove("movz",movZ_b,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
 
     /*z3x4*/
@@ -646,10 +667,14 @@ Frames::mov_x_z_run(){
         x_step++;
         z_step = 0;
         emit serial_data(m_json.MotorMove("movx",movX_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
     if(z_step<=2&&x_step==4){
         z_step++;
         emit serial_data(m_json.MotorMove("movz",movZ_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
 
     /*z3x3*/
@@ -658,10 +683,14 @@ Frames::mov_x_z_run(){
         x_step++;
         z_step = 0;
         emit serial_data(m_json.MotorMove("movx",movX_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
     if(z_step<=2&&x_step==3){
         z_step++;
         emit serial_data(m_json.MotorMove("movz",movZ_b,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
     /**/
 
@@ -671,10 +700,14 @@ Frames::mov_x_z_run(){
         x_step++;
         z_step = 0;
         emit serial_data(m_json.MotorMove("movx",movX_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
     if(z_step<=2&&x_step==2){
         z_step++;
         emit serial_data(m_json.MotorMove("movz",movZ_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
     /**/
 
@@ -684,11 +717,15 @@ Frames::mov_x_z_run(){
         x_step++;
         z_step = 0;
         emit serial_data(m_json.MotorMove("movx",movX_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
 
     if(z_step<=2&&x_step==1){
         z_step++;
         emit serial_data(m_json.MotorMove("movz",movZ_b,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
 
     /*z3x0*/
@@ -697,11 +734,15 @@ Frames::mov_x_z_run(){
         x_step++;
         z_step = 0;
         emit serial_data(m_json.MotorMove("movx",movX_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
     if(z_step<=2&&x_step==0)
     {
         z_step++;
         emit serial_data(m_json.MotorMove("movz",movZ_f,"50"));
+        emit signal_position_changed(x_step, z_step);
+        y_step = 0;
     }
 
 }
@@ -729,11 +770,27 @@ Frames::saveMatAsJpeg(const QVideoFrame &frame){
     }
 }
 
+bool
+Frames::saveFrameAsJpeg(const QVideoFrame &frame, const QString &path, int quality)
+{
+    if (!frame.isValid()) return false;
+    QImage img = frame.toImage();
+    if (img.isNull()) return false;
+    return img.save(path, "jpg", quality);
+}
+
 void
 Frames::processFrameAsync(const RawFrame& frame){
     //QtConcurrent::run([=]() {
         cv::Mat raw;
         switch (frame.pixelType) {
+        case PixelType_Gvsp_RGB8_Packed:
+            // 构造RGB三通道原始Mat
+            raw = cv::Mat(frame.height, frame.width, CV_8UC3,
+                          (void*)frame.data.constData());
+            // RGB → BGRA,补充Alpha通道(255不透明)
+            cv::cvtColor(raw, m_frame, cv::COLOR_RGB2BGRA);
+            break;
         case PixelType_Gvsp_BayerRG8:
             raw = cv::Mat(frame.height, frame.width, CV_8UC1,
                           (void*)frame.data.constData());
@@ -796,6 +853,7 @@ Frames::processFrameAsync(const RawFrame& frame){
     //});
 }
 
+
 void
 Frames::handleGrab(bool sta_cam){
     if (m_grabThread.isRunning()) return;
@@ -813,7 +871,6 @@ Frames::handleGrab(bool sta_cam){
                     return;
                 }
             }
-
             if(!handle) return;
             const uint32_t payload = stParam.nCurValue;
             LOG("payload size:{}",payload);
@@ -827,9 +884,65 @@ Frames::handleGrab(bool sta_cam){
                     emit stopGrabbing(false);
                     break;
                 }
+#if 0
+                // ----------------------
+                // 宽高
+                // ----------------------
+                uint32_t nWidth  = stImageInfo.stFrameInfo.nExtendWidth;
+                uint32_t nHeight = stImageInfo.stFrameInfo.nExtendHeight;
+                uint32_t nDstSize = nWidth * nHeight * 3;
+                // ----------------------
+                // 开辟缓存(统一用 vector,自动释放)
+                // ----------------------
+                std::vector<uint8_t> pBGR24Buf(nDstSize);
+                std::vector<uint8_t> pResultBuf(nDstSize);
+                // ----------------------
+                // 转 RGB
+                // ----------------------
+                MV_CC_PIXEL_CONVERT_PARAM_EX stConvertParam = {0};
+                stConvertParam.nWidth         = nWidth;
+                stConvertParam.nHeight        = nHeight;
+                stConvertParam.pSrcData       = stImageInfo.pBufAddr;
+                stConvertParam.nSrcDataLen    = stImageInfo.stFrameInfo.nFrameLen;
+                stConvertParam.enSrcPixelType = stImageInfo.stFrameInfo.enPixelType;
+                stConvertParam.enDstPixelType = PixelType_Gvsp_RGB8_Packed;
+                stConvertParam.pDstBuffer     = pBGR24Buf.data();
+                stConvertParam.nDstBufferSize = pBGR24Buf.size();
+
+                nRet = MV_CC_ConvertPixelTypeEx(handle, &stConvertParam);
+                if (MV_OK != nRet) {
+                    ERROR("Convert failed: %x", nRet);
+                    MV_CC_FreeImageBuffer(handle, &stImageInfo);
+                    continue;
+                }
+
+                // ----------------------
+                // 锐化
+                // ----------------------
+                MV_CC_SHARPEN_PARAM stSharpenParam = {0};
+                stSharpenParam.enPixelType      = PixelType_Gvsp_RGB8_Packed;
+                stSharpenParam.nWidth           = nWidth;
+                stSharpenParam.nHeight          = nHeight;
+                stSharpenParam.pSrcBuf          = pBGR24Buf.data();
+                stSharpenParam.nSrcBufLen       = pBGR24Buf.size();
+                stSharpenParam.pDstBuf          = pResultBuf.data();
+                stSharpenParam.nDstBufSize      = pResultBuf.size();
+                stSharpenParam.nSharpenRadius   = 21;
+                stSharpenParam.nSharpenThreshold = 0;
+                stSharpenParam.nSharpenPosAmount = 100;
+                stSharpenParam.nSharpenNegAmount = 100;
+
+                nRet = MV_CC_ImageSharpen(handle, &stSharpenParam);
+                if (MV_OK != nRet) {
+                    ERROR("MV_CC_ImageSharpen: %x", nRet);
+                    MV_CC_FreeImageBuffer(handle, &stImageInfo);
+                    continue;
+                }
+#endif
                 RawFrame frame;
                 frame.width     = stImageInfo.stFrameInfo.nWidth;
                 frame.height    = stImageInfo.stFrameInfo.nHeight;
+#if 1
                 frame.pixelType = stImageInfo.stFrameInfo.enPixelType;
                 m_width = frame.width;
                 m_height = frame.height;
@@ -839,6 +952,8 @@ Frames::handleGrab(bool sta_cam){
                     (const char*)stImageInfo.pBufAddr,
                     dataSize
                 );
+
+#endif
                 MV_CC_FreeImageBuffer(handle, &stImageInfo);
                 // ✅ 像素处理放到新的 QFuture
                 processFrameAsync(frame);
@@ -993,3 +1108,177 @@ Frames::captureImage(){
 
 
 } /* namespace Qt6QCamera */
+
+// ==================== 新增:位置文件夹与图像保存实现 ====================
+
+namespace Qt6QCamera {
+
+void Frames::ensurePositionFolder()
+{
+    QString posFolder = QString("X%1_Z%2").arg(x_step).arg(z_step);
+    current_position_folder = picture_path_floader + "/" + posFolder;
+    QDir dir(current_position_folder);
+    if (!dir.exists()) {
+        if (dir.mkpath(".")) {
+            LOG("ensurePositionFolder: created folder={}", current_position_folder.toStdString());
+        } else {
+            ERROR("ensurePositionFolder: failed to create folder={}", current_position_folder.toStdString());
+        }
+    }
+}
+
+void Frames::saveImageForCurrentPosition()
+{
+    if(m_frame.empty()){
+        ERROR("saveImageForCurrentPosition: empty frame!");
+        return;
+    }
+    Mat image_gray;
+    cv::cvtColor(m_frame, image_gray, cv::COLOR_BGRA2GRAY);
+    double grayvalue = cv::mean(image_gray)[0];
+    if(grayvalue < 10.0){
+        WARN("saveImageForCurrentPosition: grayvalue too low={}", grayvalue);
+        return;
+    }
+    QString ts = QDateTime::currentDateTime().toString("yyyyMMddhhmmss_zzz");
+    QString filename = QString("Y%1_%2.jpg").arg(y_step).arg(ts);
+    QString fullPath = current_position_folder + "/" + filename;
+
+    // 与 saveMatAsJpeg 走同一条 QVideoFrame(RGBA8888) → QImage 管线,
+    // 避免 cvMatToQImage() 在 Format_RGB32 上的字节序歧义导致颜色失真。
+    QVideoFrameFormat vfmt(QSize(m_frame.cols, m_frame.rows),
+                           QVideoFrameFormat::Format_RGBA8888);
+    QVideoFrame vf(vfmt);
+    if (!vf.map(QVideoFrame::WriteOnly)) {
+        ERROR("saveImageForCurrentPosition: QVideoFrame map failed");
+        return;
+    }
+    memcpy(vf.bits(0), m_frame.data,
+           static_cast<size_t>(m_frame.total() * m_frame.elemSize()));
+    vf.unmap();
+
+    if (saveFrameAsJpeg(vf, fullPath, 90)) {
+        param::ptlist.append(fullPath);
+        LOG("saveImageForCurrentPosition: saved={}", fullPath.toStdString());
+    } else {
+        ERROR("saveImageForCurrentPosition: save failed path={}", fullPath.toStdString());
+    }
+}
+
+void Frames::startDepthFusionBatch()
+{
+    if(m_fusion_started){
+        LOG("startDepthFusionBatch: already started, skip.");
+        return;
+    }
+    m_fusion_started = true;
+    LOG("startDepthFusionBatch: starting fusion for X{}_Z{}", x_step, z_step);
+    QTimer::singleShot(100, this, [this](){
+        fusePositionFolder(position_folders.isEmpty() ? current_position_folder : position_folders.last(),
+                           x_step, z_step);
+    });
+}
+
+void Frames::fusePositionFolder(const QString &folder, int x, int z)
+{
+    QDir dir(folder);
+    if(!dir.exists()){
+        WARN("fusePositionFolder: folder not exist={}", folder.toStdString());
+        return;
+    }
+    QStringList filters;
+    filters << "*.jpg" << "*.jpeg" << "*.png";
+    QFileInfoList files = dir.entryInfoList(filters, QDir::Files | QDir::Readable, QDir::Name);
+    if(files.size() < 2){
+        LOG("fusePositionFolder: less than 2 images in {}, skip fusion.", folder.toStdString());
+        emit signal_fuse_batch_finished(0, files.size());
+        return;
+    }
+    LOG("fusePositionFolder: found {} images in {}", files.size(), folder.toStdString());
+    std::vector<cv::Mat> images;
+    for(const QFileInfo &fi : files){
+        cv::Mat img = cv::imread(fi.absoluteFilePath().toStdString());
+        if(!img.empty()){
+            images.push_back(img);
+        }
+    }
+    if(images.size() < 2){
+        emit signal_fuse_batch_finished(0, 0);
+        return;
+    }
+    QDateTime now = QDateTime::currentDateTime();
+    QString ts = now.toString("yyyyMMddhhmmss");
+    QString fusedName = QString("fused_X%1_Z%2_%3.jpg").arg(x).arg(z).arg(ts);
+    QString fusedPath = folder + "/" + fusedName;
+    bool fused = false;
+    if(images.size() >= 2){
+        try{
+            cv::Mat result;
+            if(images.size() == 2){
+                cv::Mat &img1 = images[0];
+                cv::Mat &img2 = images[1];
+                if(img1.size() == img2.size()){
+                    cv::addWeighted(img1, 0.5, img2, 0.5, 0, result);
+                    fused = true;
+                }
+            }
+            if(!fused && images.size() > 2){
+                std::vector<cv::Mat> channels[3];
+                for(cv::Mat &img : images){
+                    if(img.channels() == 3){
+                        std::vector<cv::Mat> ch;
+                        cv::split(img, ch);
+                        for(int c = 0; c < 3; ++c) channels[c].push_back(ch[c]);
+                    }
+                }
+                cv::Mat merged;
+                std::vector<cv::Mat> outCh;
+                for(int c = 0; c < 3; ++c){
+                    if(!channels[c].empty()){
+                        cv::Mat meanMat;
+                        cv::Mat sumMat = cv::Mat::zeros(channels[c][0].size(), CV_64F);
+                        for(auto &ch : channels[c]){
+                            cv::Mat d; ch.convertTo(d, CV_64F); sumMat += d;
+                        }
+                        sumMat /= channels[c].size();
+                        sumMat.convertTo(meanMat, channels[c][0].type());
+                        outCh.push_back(meanMat);
+                    }
+                }
+                if(outCh.size() == 3){
+                    cv::merge(outCh, result);
+                    fused = true;
+                }
+            }
+            if(fused){
+                cv::imwrite(fusedPath.toStdString(), result);
+                LOG("fusePositionFolder: fused image saved={}", fusedPath.toStdString());
+                param::ptlist.append(fusedPath);
+                emit signal_cache_image(fusedPath);
+                uploadFusedImage(fusedPath);
+                emit signal_fuse_batch_finished(1, 0);
+            } else {
+                WARN("fusePositionFolder: fusion method failed");
+                emit signal_fuse_batch_finished(0, files.size());
+            }
+        }catch(const cv::Exception &e){
+            ERROR("fusePositionFolder: cv::Exception={}", e.what());
+            emit signal_fuse_batch_finished(0, files.size());
+        }
+    } else {
+        LOG("fusePositionFolder: only 1 image, copy as fused.");
+        cv::imwrite(fusedPath.toStdString(), images[0]);
+        param::ptlist.append(fusedPath);
+        emit signal_cache_image(fusedPath);
+        uploadFusedImage(fusedPath);
+        emit signal_fuse_batch_finished(1, 0);
+    }
+}
+
+void Frames::uploadFusedImage(const QString &imagePath)
+{
+    LOG("uploadFusedImage: path={}", imagePath.toStdString());
+    emit signal_wait_upload(imagePath);
+}
+
+} // namespace Qt6QCamera

File diff suppressed because it is too large
+ 2218 - 61
q6_felgo_iot/src/m_opencv.cpp


+ 5 - 0
q6_felgo_iot/src/main.cpp

@@ -10,6 +10,7 @@
 #include <m_loger.h>
 #include <TreeModel.h>
 #include <app_curlFunc.h>
+#include <m_opencv.h>
 
 //uncomment this line to add the Live Client Module and use live reloading with your custom C++ code
 //#include <FelgoLiveClient>
@@ -463,6 +464,10 @@ int main(int argc, char *argv[])
     engine.rootContext()->setContextProperty("curl_picture",&uploader_ftp);
     engine.rootContext()->setContextProperty("networkMonitor", &networkMonitor);
 
+    // 注册OpenCV图像融合功能到QML
+    OpencvFunc opencvFunc;
+    engine.rootContext()->setContextProperty("opencvFunc", &opencvFunc);
+
 
 
     QObject::connect(&serialThread,&SerialThread::dataUpload,&mqttHandler,&MqttHandler::publish_m);     //串口到MQTT

+ 7 - 0
q6_felgo_iot/src/mqtthandler.cpp

@@ -291,6 +291,13 @@ MqttHandler::onMessageReceived(const QByteArray &message, const QMqttTopicName &
                         ERROR("无法复制日志文件:{}",logFilePath.toStdString());
                     }
                 }
+                // 远程设置相机曝光值
+                else if(METHOD.toString()=="ctr_cam"&&!PARAMS.isNull()){
+                    QJsonObject params_Obj = PARAMS.toObject();
+                    int exposureTime = params_Obj["ExporseTime"].toInt();
+                    LOG("收到远程相机曝光设置指令,曝光时间:{}", exposureTime);
+                    emit signal_set_camera_exposure(exposureTime);
+                }
             }
         }
         if(!cmdValue.isNull()){

+ 0 - 124
q6_felgo_iot/src/mserial.cpp

@@ -7,132 +7,8 @@
 #include <QSqlQuery>
 #include <QSqlRecord>
 
-
 class param;
 
-Serial_AT::Serial_AT(QObject *parent /*= 0*/ )
-{
-    // 定义文本编码
-    tc = QTextCodec::codecForName("UTF-8");
-    timeout_recv = new QTimer(this);
-    connect(timeout_recv,&QTimer::timeout,this,[=](){
-        sendData(at_str.toUtf8());
-        timeout_recv->stop();
-    });
-}
-
-QStringList Serial_AT::serialScan(void)
-{
-    QStringList serialPortList;
-    serialDescription.clear(); // 每次扫描先清除串口描述信息
-    foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
-        this->setPort(info);
-        serialPortList.append(this->portName());
-        serialDescription.append(info.description());
-        qDebug() << this->portName();
-        qDebug() << info.description();
-    }
-    // 解决无串口连接时 打不开软件的问题
-    if(serialPortList.length() <= 0) serialPortList.append("None");
-    if(serialDescription.length() <= 0) serialDescription.append("None");
-    return serialPortList;
-}
-
-bool Serial_AT::serialOpen(QString serialName, int baudRate)
-{
-    this->setPortName(serialName);
-    if(this->open(QIODeviceBase::ReadWrite)) {
-        this->setBaudRate(baudRate);
-        this->setDataBits(QSerialPort::Data8);
-        this->setParity(QSerialPort::NoParity);
-        this->setStopBits(QSerialPort::OneStop);
-        this->setFlowControl(QSerialPort::NoFlowControl);
-        // 下位机发送数据会响应这个槽函数
-        connect(this, &QSerialPort::readyRead, this, &Serial_AT::ReadData);
-        return true;
-    }else{
-        qDebug() << "Failed to open serial port." << serialName;
-    }
-    return false;
-}
-// 读数据
-void Serial_AT::ReadData()
-{
-    dataBuf = this->readAll();
-    this->rxByte += tc->toUnicode(dataBuf).length();
-    QString response = dataBuf;
-    qDebug() <<"接收到AT数据:" << dataBuf;
-    if(at_str.contains("AT+CGSN")){
-        //解析IMEI
-        if(dataBuf.contains("OK")){
-            // 提取 IMEI
-            int imeiStart = response.indexOf("\r\n") + 2; // 跳过第一个回车换行符
-            int imeiEnd = response.indexOf("\r\n", imeiStart); // 查找第二个回车换行符
-            if (imeiStart != -1 && imeiEnd != -1 && imeiEnd > imeiStart) {
-                param::imei = response.mid(imeiStart, imeiEnd - imeiStart);
-                qDebug() <<"解析到IMEI:" << param::imei;
-                emit imeiDone();
-                //保存到SQLITE
-                at_str.clear();
-                this->clear();
-                this->close();
-            }
-        }
-    }else if(at_str.contains("AT+ICCID")){ //解析iccid
-        // 提取 ICCID
-        // 去除首尾的空白字符和换行符
-        if(response.contains("OK")){
-            response = response.trimmed();
-            int iccidStart = response.indexOf(":") + 1; // 跳过第一个回车换行符
-            int iccidEnd = response.indexOf("\r\n", iccidStart); // 查找第二个回车换行符
-
-            param::iccid = response.mid(iccidStart, iccidEnd - iccidStart);
-            qDebug() << "ICCID: " << param::iccid;
-            at_str.clear();
-
-            sendData("AT+CSQ\r\n");
-        }
-    }else if(at_str.contains("AT+CSQ")){
-        // 去除首尾的空白字符和换行符
-        if(response.contains("OK")){
-            // 去除多余的换行符和空格
-            response = response.trimmed();
-            // 查找 CSQ 起始位置和结束位置
-            int csqStart = response.indexOf(":") + 1;
-            int csqEnd = response.indexOf(",", csqStart);
-            // 提取 CSQ 值
-            param::csq = response.mid(csqStart, csqEnd - csqStart);
-            at_str.clear();
-            this->clear();
-            this->close();
-        }
-    }
-    timeout_recv->stop();
-    dataBuf.clear();
-    //emit this->readSignal(this->rxByte);
-}
-// 写数据
-void Serial_AT::sendData(QByteArray sendData)
-{
-    at_str = sendData;
-    int byteTemp;
-    byteTemp = this->write(sendData);
-    // 发送失败返回-1
-    if(byteTemp != -1)
-    {
-        qDebug() <<"发送AT数据Success:" << byteTemp;
-        timeout_recv->start(5000);
-    }
-    this->flush();
-}
-// 关闭串口
-void Serial_AT::serialClose()
-{
-    this->clear();
-    this->close();
-}
-
-
 SerialThread::SerialThread(QObject *parent)
     : QThread(parent), m_running(false)
 {