diff --git a/README.md b/README.md index 1b32298..f5b6ff4 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,41 @@ Identify the types and quantities of smoke boxes 2、相机采图后至算法使用期间,通讯格式、图像保存等各种规范修改。 +3、相机采图模块修改: +​ 原先是一次多个相机拍一堆货物,得到Qvector类型的图像数据,匹配时去挨张图匹配,直到匹配成功,后面队列中的图像掠过,返回匹配结果。 +​ 现改为,相机分别在堆垛机左右两侧,两台相机分别拍两侧的货物,即单个位置可能会发送两条信号(分别对应两个相机),但两图像需要检测的目标不一,且在边缘货架上,只会触发单侧。 +​ **数据流修改:** -遗留冲突问题: +​ 通讯线程:接收拍照信号1->接收数据处理信号1->接收拍照信号2->接收数据处理信号2->返回相机1拍照成功 ->返回相机2拍照成功 + +​ 拍照线程: 相机1拍照-> 相机2拍照-> + +​ 计算线程...:品规...->层高... + +​ + +通讯结果数据处理: + +对QMap进行(in+out):GPS(in)->GPE(out)->RTS(in)->RTE(out) -1、ADModule中有个确认WorkMode问题,怀疑可能是出入库之前要做区别,导致很多相机操作是跟WorkMode有关的。 +Camera.json中id是给相机的编号,可以用于区分石家庄项目中的左右相机,与通讯中货物的方向对应。 -周三下午 -2D相机模块修改:由于之前是多个相机拍一个库,若前一个相机的图像为OK,则不运行下一个;故而vecImageInfo中的值都是多个相机拍的一堆烟。 -但是石家庄方案只需要一台相机拍摄即可品规。一个软件接入的多台相机是分别要执行的结果。 +—————————————————————— + +之前海康相机是手动改为黑白图像,然后代码里暂不支持彩色图像输入(需改) + + + +遗留冲突问题: + +1、ADModule中有个确认WorkMode问题,怀疑可能是出入库之前要做区别,导致很多相机操作是跟WorkMode有关的。 diff --git a/doc/~$盘点客户端与web端通信协议(普洱,石家庄).docx b/doc/~$盘点客户端与web端通信协议(普洱,石家庄).docx new file mode 100644 index 0000000..50b6755 Binary files /dev/null and b/doc/~$盘点客户端与web端通信协议(普洱,石家庄).docx differ diff --git a/doc/视觉盘点客户端与web端通信协议(普洱,石家庄).docx b/doc/视觉盘点客户端与web端通信协议(普洱,石家庄).docx new file mode 100644 index 0000000..030e192 Binary files /dev/null and b/doc/视觉盘点客户端与web端通信协议(普洱,石家庄).docx differ diff --git a/runner17/Release/config/camera.json b/runner17/Release/config/camera.json index 27c6bcc..46aae93 100644 --- a/runner17/Release/config/camera.json +++ b/runner17/Release/config/camera.json @@ -18,7 +18,7 @@ "frame_rate": 9.3, "gain": 2, "height": 1200, - "id": 1, + "id": 2, "loop": 1, "mac_address": "", "offset_x": 0, @@ -35,6 +35,42 @@ "type": 140, "width": 1920, "zoom": 1 + }, + "LP-OCM-HL060M 00J49540865": { + "algorithm": 1, + "algorithm_dll": 1, + "auto_open": false, + "auto_push": true, + "balanceRatio": 0, + "balanceRatioSelector": 0, + "board_config_file": "", + "board_name": "", + "board_num": 0, + "board_type": 64, + "camera_file": "", + "exposure": 10000, + "folder": "model1\\", + "format": "None", + "frame_rate": 9.3, + "gain": 2, + "height": 3072, + "id": 1, + "loop": 1, + "mac_address": "", + "offset_x": 0, + "offset_y": 0, + "param_policy": 2, + "rely_on_camera": "", + "rotation_angle": 0, + "calib_file": ".\\config\\right.calib", + "save": 1, + "save_img_suffix": ".BMP", + "savefile_rgb_swapped": false, + "showname": "相机一", + "trigger_source": "Line0", + "type": 140, + "width": 2048, + "zoom": 1 } }, "top": { @@ -43,6 +79,6 @@ }, "side": { "startID": 1, - "endID": 1 + "endID": 2 } } diff --git a/runner17/Release/log/log-2024-01-09.log b/runner17/Release/log/log-2024-01-09.log deleted file mode 100644 index e208820..0000000 --- a/runner17/Release/log/log-2024-01-09.log +++ /dev/null @@ -1,192 +0,0 @@ -Info | 2024-01-09 20:10:17 ܶ | initCamera -Debug | 2024-01-09 20:10:17 ܶ | Decode smokeInfo from "D:/Code/Logistics/smokeboxidentification/runner17/Release\\user\\smokeInfo.xlsx" successed -Debug | 2024-01-09 20:10:17 ܶ | "D:/Code/Logistics/smokeboxidentification/runner17/Release\\templateNum" has not folder -Debug | 2024-01-09 20:10:17 ܶ | Find device: "00787720450" -Debug | 2024-01-09 20:10:17 ܶ | m_vecPCamera size: 1 -Warning | 2024-01-09 20:10:17 ܶ | QObject::moveToThread: Cannot move objects with a parent -Debug | 2024-01-09 20:10:17 ܶ | init CategoryMatcher successed -Debug | 2024-01-09 20:10:18 ܶ | NetControl::onConnected -TPTcpClient::slotConnected -Debug | 2024-01-09 20:10:18 ܶ | ӳɹ -Debug | 2024-01-09 20:10:19 ܶ | Open camera: "00787720450" successed -Debug | 2024-01-09 20:10:19 ܶ | Start camera: "00787720450" successed -Debug | 2024-01-09 20:10:19 ܶ | Set device successed -Debug | 2024-01-09 20:10:19 ܶ | Set camera: "00787720450" software trigger successed -Warning | 2024-01-09 20:10:23 ܶ | i receive data from server: "ST&6&111&2121&1>" -Debug | 2024-01-09 20:10:23 ܶ | msg: "ST&6&111&2121&1>" content: "ST&6&111&2121&1" -Debug | 2024-01-09 20:10:23 ܶ | strlist length: 5 head: "ST" -Debug | 2024-01-09 20:10:23 ܶ | ʼ̵ -Warning | 2024-01-09 20:10:30 ܶ | i receive data from server: "GP&6&111&2121&1&310102&25>" -Debug | 2024-01-09 20:10:30 ܶ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" -Debug | 2024-01-09 20:10:30 ܶ | strlist length: 7 head: "GP" -Debug | 2024-01-09 20:10:30 ܶ | λȡͼ -Info | 2024-01-09 20:10:30 ܶ | [captureSide]: Enter -Info | 2024-01-09 20:10:30 ܶ | [onCapture]: Enter -Info | 2024-01-09 20:10:30 ܶ | [onCapture]: cameraLocation = 0 -Info | 2024-01-09 20:10:30 ܶ | [onCapture]: Out -Debug | 2024-01-09 20:10:30 ܶ | start capture, length: 1 -Debug | 2024-01-09 20:10:31 ܶ | convert Mat successed! -Debug | 2024-01-09 20:10:31 ܶ | ת -Debug | 2024-01-09 20:10:31 ܶ | [Camera]: Side Camera Captured. -Info | 2024-01-09 20:10:31 ܶ | workMode = 2 -Debug | 2024-01-09 20:10:31 ܶ | Save image: ".\\fileData\\2121\\1.BMP" -Debug | 2024-01-09 20:10:31 ܶ | "Camera 00787720450 Match Start ..." -Debug | 2024-01-09 20:10:31 ܶ | Get TemplateImg OK! -Debug | 2024-01-09 20:10:31 ܶ | templateLevel = 2 -Info | 2024-01-09 20:10:31 ܶ | level = 1 -Info | 2024-01-09 20:10:31 ܶ | templateImgPath = "./templateImg/310102/310102-11.bmp" -Debug | 2024-01-09 20:10:31 ܶ | Level == 1 -Info | 2024-01-09 20:10:31 ܶ | level = 2 -Info | 2024-01-09 20:10:31 ܶ | templateImgPath = "./templateImg/310102/310102-21.bmp" -Debug | 2024-01-09 20:10:32 ܶ | "Camera 00787720450 Match successful!" -Info | 2024-01-09 20:10:32 ܶ | fileName "1_310102_rlt.BMP" -Info | 2024-01-09 20:10:32 ܶ | filePath ".\\fileData\\2121\\1_310102_rlt.BMP" -Debug | 2024-01-09 20:10:32 ܶ | send msg: "RT&6&111&2121&1&&&0>" -Warning | 2024-01-09 20:16:35 ܶ | i receive data from server: "ST&6&111&2121&1>" -Debug | 2024-01-09 20:16:35 ܶ | msg: "ST&6&111&2121&1>" content: "ST&6&111&2121&1" -Debug | 2024-01-09 20:16:35 ܶ | strlist length: 5 head: "ST" -Debug | 2024-01-09 20:16:35 ܶ | ʼ̵ -Warning | 2024-01-09 20:16:40 ܶ | i receive data from server: "GP&6&111&2121&1&310102&25>" -Debug | 2024-01-09 20:16:40 ܶ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" -Debug | 2024-01-09 20:16:40 ܶ | strlist length: 7 head: "GP" -Debug | 2024-01-09 20:16:40 ܶ | λȡͼ -Info | 2024-01-09 20:16:40 ܶ | [captureSide]: Enter -Info | 2024-01-09 20:16:40 ܶ | [onCapture]: Enter -Info | 2024-01-09 20:16:40 ܶ | [onCapture]: cameraLocation = 0 -Info | 2024-01-09 20:16:40 ܶ | [onCapture]: Out -Debug | 2024-01-09 20:16:40 ܶ | start capture, Debug | 2024-01-09 20:16:45 ܶ | delete netControl -Debug | 2024-01-09 20:16:45 ܶ | NetControl::onDisconnected -TPTcpClient::slotDisconnected - | [Camera]: Side Camera Captured. -Info | 2024-01-09 20:16:40 ܶ | workMode = 2 -Debug | 2024-01-09 20:16:40 ܶ | Save image: ".\\fileData\\2121\\1.BMP" -Debug | 2024-01-09 20:16:40 ܶ | "Camera 00787720450 Match Start ..." -Debug | 2024-01-09 20:16:40 ܶ | Get TemplateImg OK! -Debug | 2024-01-09 20:16:40 ܶ | templateLevel = 2 -Info | 2024-01-09 20:16:40 ܶ | level = 1 -Info | 2024-01-09 20:16:40 ܶ | templateImgPath = "./templateImg/310102/310102-11.bmp" -Debug | 2024-01-09 20:16:40 ܶ | Level == 1 -Info | 2024-01-09 20:16:40 ܶ | level = 2 -Info | 2024-01-09 20:16:40 ܶ | templateImgPath = "./templateImg/310102/310102-21.bmp" -Debug | 2024-01-09 20:16:41 ܶ | "Camera 00787720450 Match successful!" -Info | 2024-01-09 20:16:41 ܶ | fileName "1_310102_rlt.BMP" -Info | 2024-01-09 20:16:41 ܶ | filePath ".\\fileData\\2121\\1_310102_rlt.BMP" -Debug | 2024-01-09 20:16:41 ܶ | send msg: "RT&6&111&2121&1&&&0>" -Debug | 2024-01-09 20:17:09 ܶ | delete netControl -Debug | 2024-01-09 20:17:09 ܶ | NetControl::onDisconnected -TPTcpClient::slotDisconnected -Info | 2024-01-09 20:18:42 ܶ | initCamera -Debug | 2024-01-09 20:18:42 ܶ | Decode smokeInfo from "D:/Code/Logistics/smokeboxidentification/runner17/Release\\user\\smokeInfo.xlsx" successed -Debug | 2024-01-09 20:18:42 ܶ | "D:/Code/Logistics/smokeboxidentification/runner17/Release\\templateNum" has not folder -Debug | 2024-01-09 20:18:42 ܶ | Find device: "00787720450" -Debug | 2024-01-09 20:18:43 ܶ | m_vecPCamera size: 1 -Warning | 2024-01-09 20:18:43 ܶ | QObject::moveToThread: Cannot move objects with a parent -Debug | 2024-01-09 20:18:43 ܶ | init CategoryMatcher successed -Debug | 2024-01-09 20:18:43 ܶ | NetControl::onConnected -TPTcpClient::slotConnected -Debug | 2024-01-09 20:18:43 ܶ | ӳɹ -Debug | 2024-01-09 20:18:44 ܶ | Open camera: "00787720450" successed -Debug | 2024-01-09 20:18:44 ܶ | Start camera: "00787720450" successed -Debug | 2024-01-09 20:18:44 ܶ | Set device successed -Debug | 2024-01-09 20:18:44 ܶ | Set camera: "00787720450" software trigger successed -Warning | 2024-01-09 20:18:53 ܶ | i receive data from server: "ST&6&111&2121&1>" -Debug | 2024-01-09 20:18:53 ܶ | msg: "ST&6&111&2121&1>" content: "ST&6&111&2121&1" -Debug | 2024-01-09 20:18:53 ܶ | strlist length: 5 head: "ST" -Debug | 2024-01-09 20:18:53 ܶ | ʼ̵ -Warning | 2024-01-09 20:18:58 ܶ | i receive data from server: "GP&6&111&2121&1&310102&25>" -Debug | 2024-01-09 20:18:58 ܶ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" -Debug | 2024-01-09 20:18:58 ܶ | strlist length: 7 head: "GP" -Debug | 2024-01-09 20:18:58 ܶ | λȡͼ -Info | 2024-01-09 20:18:58 ܶ | [captureSide]: Enter -Info | 2024-01-09 20:18:58 ܶ | [onCapture]: Enter -Info | 2024-01-09 20:18:58 ܶ | [onCapture]: cameraLocation = 0 -Info | 2024-01-09 20:18:58 ܶ | [onCapture]: Out -Debug | 2024-01-09 20:18:58 ܶ | start capture, length: 1 -Debug | 2024-01-09 20:18:58 ܶ | convert Mat successed! -Debug | 2024-01-09 20:18:58 ܶ | ת -Debug | 2024-01-09 20:18:58 ܶ | [Camera]: Side Camera Captured. -Info | 2024-01-09 20:18:58 ܶ | workMode = 2 -Debug | 2024-01-09 20:18:58 ܶ | Save image: ".\\fileData\\2121\\1.BMP" -Debug | 2024-01-09 20:18:58 ܶ | "Camera 00787720450 Match Start ..." -Debug | 2024-01-09 20:18:58 ܶ | Get TemplateImg OK! -Debug | 2024-01-09 20:18:58 ܶ | templateLevel = 2 -Info | 2024-01-09 20:18:58 ܶ | level = 1 -Info | 2024-01-09 20:18:58 ܶ | templateImgPath = "./templateImg/310102/310102-11.bmp" -Debug | 2024-01-09 20:18:58 ܶ | Level == 1 -Info | 2024-01-09 20:18:58 ܶ | level = 2 -Info | 2024-01-09 20:18:58 ܶ | templateImgPath = "./templateImg/310102/310102-21.bmp" -Debug | 2024-01-09 20:18:59 ܶ | "Camera 00787720450 Match successful!" -Info | 2024-01-09 20:18:59 ܶ | fileName "1_310102_rlt.BMP" -Info | 2024-01-09 20:18:59 ܶ | filePath ".\\fileData\\2121\\1_310102_rlt.BMP" -Debug | 2024-01-09 20:18:59 ܶ | send msg: "RT&6&111&2121&1&&&0>" -Debug | 2024-01-09 20:20:07 ܶ | delete netControl -Debug | 2024-01-09 20:20:07 ܶ | NetControl::onDisconnected -TPTcpClient::slotDisconnected -Info | 2024-01-09 20:20:26 ܶ | initCamera -Debug | 2024-01-09 20:20:26 ܶ | Decode smokeInfo from "D:/Code/Logistics/smokeboxidentification/runner17/Release\\user\\smokeInfo.xlsx" successed -Debug | 2024-01-09 20:20:26 ܶ | "D:/Code/Logistics/smokeboxidentification/runner17/Release\\templateNum" has not folder -Debug | 2024-01-09 20:20:26 ܶ | Find device: "00787720450" -Debug | 2024-01-09 20:20:26 ܶ | m_vecPCamera size: 1 -Warning | 2024-01-09 20:20:26 ܶ | QObject::moveToThread: Cannot move objects with a parent -Debug | 2024-01-09 20:20:26 ܶ | init CategoryMatcher successed -Debug | 2024-01-09 20:20:26 ܶ | NetControl::onConnected -TPTcpClient::slotConnected -Debug | 2024-01-09 20:20:26 ܶ | ӳɹ -Debug | 2024-01-09 20:20:28 ܶ | Open camera: "00787720450" successed -Debug | 2024-01-09 20:20:28 ܶ | Start camera: "00787720450" successed -Debug | 2024-01-09 20:20:28 ܶ | Set device successed -Debug | 2024-01-09 20:20:28 ܶ | Set camera: "00787720450" software trigger successed -Warning | 2024-01-09 20:20:35 ܶ | i receive data from server: "ST&6&111&2121&1>" -Debug | 2024-01-09 20:20:35 ܶ | msg: "ST&6&111&2121&1>" content: "ST&6&111&2121&1" -Debug | 2024-01-09 20:20:35 ܶ | strlist length: 5 head: "ST" -Debug | 2024-01-09 20:20:35 ܶ | ʼ̵ -Warning | 2024-01-09 20:20:40 ܶ | i receive data from server: "GP&6&111&2121&1&310102&25>" -Debug | 2024-01-09 20:20:40 ܶ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" -Debug | 2024-01-09 20:20:40 ܶ | strlist length: 7 head: "GP" -Debug | 2024-01-09 20:20:40 ܶ | λȡͼ -Info | 2024-01-09 20:20:40 ܶ | [captureSide]: Enter -Info | 2024-01-09 20:20:40 ܶ | [onCapture]: Enter -Info | 2024-01-09 20:20:40 ܶ | [onCapture]: cameraLocation = 0 -Info | 2024-01-09 20:20:40 ܶ | [onCapture]: Out -Debug | 2024-01-09 20:20:40 ܶ | start capture, length: 1 -Debug | 2024-01-09 20:20:40 ܶ | convert Mat successed! -Debug | 2024-01-09 20:20:40 ܶ | ת -Debug | 2024-01-09 20:20:40 ܶ | [Camera]: Side Camera Captured. -Info | 2024-01-09 20:20:40 ܶ | workMode = 2 -Debug | 2024-01-09 20:20:40 ܶ | Save image: ".\\fileData\\2121\\1.BMP" -Debug | 2024-01-09 20:20:40 ܶ | "Camera 00787720450 Match Start ..." -Debug | 2024-01-09 20:20:40 ܶ | Get TemplateImg OK! -Debug | 2024-01-09 20:20:40 ܶ | templateLevel = 2 -Info | 2024-01-09 20:20:40 ܶ | level = 1 -Info | 2024-01-09 20:20:40 ܶ | templateImgPath = "./templateImg/310102/310102-11.bmp" -Debug | 2024-01-09 20:20:40 ܶ | Level == 1 -Info | 2024-01-09 20:20:41 ܶ | level = 2 -Info | 2024-01-09 20:20:41 ܶ | templateImgPath = "./templateImg/310102/310102-21.bmp" -Debug | 2024-01-09 20:20:41 ܶ | "Camera 00787720450 Match successful!" -Info | 2024-01-09 20:20:41 ܶ | fileName "1_310102_rlt.BMP" -Info | 2024-01-09 20:20:41 ܶ | filePath ".\\fileData\\2121\\1_310102_rlt.BMP" -Warning | 2024-01-09 20:20:48 ܶ | i receive data from server: "GP&6&111&2121&1&310102&25>" -Debug | 2024-01-09 20:20:48 ܶ | msg: "GP&6&111&2121&1&310102&25>" content: "GP&6&111&2121&1&310102&25" -Debug | 2024-01-09 20:20:48 ܶ | strlist length: 7 head: "GP" -Debug | 2024-01-09 20:20:48 ܶ | λȡͼ -Info | 2024-01-09 20:20:48 ܶ | [captureSide]: Enter -Info | 2024-01-09 20:20:48 ܶ | [onCapture]: Enter -Info | 2024-01-09 20:20:48 ܶ | [onCapture]: cameraLocation = 0 -Info | 2024-01-09 20:20:48 ܶ | [onCapture]: Out -Debug | 2024-01-09 20:20:48 ܶ | start capture, length: 1 -Debug | 2024-01-09 20:20:48 ܶ | convert Mat successed! -Debug | 2024-01-09 20:20:48 ܶ | ת -Debug | 2024-01-09 20:20:48 ܶ | [Camera]: Side Camera Captured. -Info | 2024-01-09 20:20:48 ܶ | workMode = 2 -Debug | 2024-01-09 20:20:48 ܶ | Save image: ".\\fileData\\2121\\1.BMP" -Debug | 2024-01-09 20:20:48 ܶ | "Camera 00787720450 Match Start ..." -Debug | 2024-01-09 20:20:48 ܶ | Get TemplateImg OK! -Debug | 2024-01-09 20:20:48 ܶ | templateLevel = 2 -Info | 2024-01-09 20:20:48 ܶ | level = 1 -Info | 2024-01-09 20:20:48 ܶ | templateImgPath = "./templateImg/310102/310102-11.bmp" -Debug | 2024-01-09 20:20:48 ܶ | Level == 1 -Info | 2024-01-09 20:20:48 ܶ | level = 2 -Info | 2024-01-09 20:20:48 ܶ | templateImgPath = "./templateImg/310102/310102-21.bmp" -Debug | 2024-01-09 20:20:49 ܶ | "Camera 00787720450 Match successful!" -Info | 2024-01-09 20:20:49 ܶ | fileName "1_310102_rlt.BMP" -Info | 2024-01-09 20:20:49 ܶ | filePath ".\\fileData\\2121\\1_310102_rlt.BMP" diff --git a/runner17/Release/smokeBox.exe b/runner17/Release/smokeBox.exe index 1d48976..6911260 100644 Binary files a/runner17/Release/smokeBox.exe and b/runner17/Release/smokeBox.exe differ diff --git a/src/CameraControl.cpp b/src/CameraControl.cpp index 3c8212b..bfb514f 100644 --- a/src/CameraControl.cpp +++ b/src/CameraControl.cpp @@ -155,6 +155,7 @@ bool CameraControl::readCameraConfig(QString filePath) { m_mapIdCameraInfoSide[id] = cameraInfo; m_mapSerialNumberIdSide[cameraInfo.serialNumber] = id; + qInfo() << "m_mapSerialNumberIdSide[" << cameraInfo.serialNumber << "]: " << id; } } @@ -167,6 +168,7 @@ bool CameraControl::initCamera() { qInfo() << "initCamera"; QList cameraInfoList = m_mapIdCameraInfoSide.values(); + qInfo() << "cameraInfoList.len = "<< cameraInfoList.length(); cameraInfoList.append(m_mapIdCameraInfoTop.values()); if (!loadCamera(cameraInfoList)) { @@ -439,10 +441,11 @@ bool CameraControl::getSaveImgNameInfo(QString serialNumber, FileInfo& fileInfo) return true; } -Q_SLOT void CameraControl::onCapture(int cameraLocation) +Q_SLOT void CameraControl::onCapture(int cameraLocation,int cameraID) { qInfo() << "[onCapture]: Enter"; qInfo() << "[onCapture]: cameraLocation = "<< cameraLocation; + qInfo() << "[onCapture]: cameraID = " << cameraID; QStringList serialNumList; switch (cameraLocation) { @@ -452,19 +455,36 @@ Q_SLOT void CameraControl::onCapture(int cameraLocation) break; case eCameraLocation::emSide: m_eCameraLocation = emSide; +#if IMAGEDRAWING == LPV + for (auto iter = m_mapSerialNumberIdSide.begin(); iter != m_mapSerialNumberIdSide.end(); iter++) + { + if (iter.value() == cameraID) + { + serialNumList << iter.key(); + } + } + + qInfo() << serialNumList; +#elif IMAGEDRAWING == OPENCV serialNumList = m_mapSerialNumberIdSide.keys(); +#endif // IMAGEDRAWING == LPV + + break; default: break; } qInfo() << "[onCapture]: Out"; - capture(serialNumList); + if (serialNumList.length() != 0) + { + capture(serialNumList); + } } void CameraControl::capture(const QStringList& serialNumberList) { int len = serialNumberList.length(); - qDebug() << "start capture, length: " << len; + //qDebug() << "start capture, length: " << len; QVector vecImageInfo; for (int i = 0; i < len; ++i) { @@ -495,14 +515,16 @@ void CameraControl::capture(const QStringList& serialNumberList) imgInfo.imageOrigin = ILImagePtr(__uuidof(LImage)); imgInfo.imageFixed = ILImagePtr(__uuidof(LImage)); } - //imgInfo.imageOrigin->SetImageData(imgInfo.image.cols, imgInfo.image.rows, (void*)imgInfo.image.data, imgInfo.image.step, 0); - imgInfo.imageOrigin->Load("C:/Users/LENOVO/Downloads/0108/310102.bmp"); + + imgInfo.imageOrigin->SetImageData(imgInfo.image.cols, imgInfo.image.rows, (void*)imgInfo.image.data, imgInfo.image.step, 0); + if (m_calib->IsCalibrated()) { m_calib->FixImage(imgInfo.imageOrigin, imgInfo.imageFixed); } vecImageInfo.push_back(imgInfo); } + emit sgCapturedImage(vecImageInfo, m_eCameraLocation); } diff --git a/src/CameraControl.h b/src/CameraControl.h index 6898214..53dffad 100644 --- a/src/CameraControl.h +++ b/src/CameraControl.h @@ -62,7 +62,7 @@ public: bool setSoftwareTrigger(const QString& serialNumber); - Q_SLOT void onCapture(int cameraLocation); + Q_SLOT void onCapture(int cameraLocation,int cameraID); signals: void sgCapturedImage(const QVector& vecImageInfo, int cameraLocation); private: diff --git a/src/CategoryMatcher.cpp b/src/CategoryMatcher.cpp index 84aa2f2..d963acf 100644 --- a/src/CategoryMatcher.cpp +++ b/src/CategoryMatcher.cpp @@ -74,10 +74,10 @@ void CategoryMatcher::setILMatch(const MatchParam& matchParam) } -bool CategoryMatcher::smokeMatch(const QString& typeNo, ILImagePtr image) +bool CategoryMatcher::smokeMatch(const QString& typeNo, ILImagePtr image, int id) { std::pair> templateLevelAndvecMatchRltPtr; - bool bRlt = smokeMatch(typeNo, image, templateLevelAndvecMatchRltPtr); + bool bRlt = smokeMatch(typeNo, image, templateLevelAndvecMatchRltPtr,id); drawImage(image, templateLevelAndvecMatchRltPtr); return bRlt; } @@ -96,13 +96,13 @@ bool CategoryMatcher::smokeMatch(const QString& typeNo, const cv::Mat& inputMat, ilImgGray->SetImageData(imgMatGray.cols, imgMatGray.rows, (void*)imgMatGray.data, imgMatGray.step, 0); qDebug() << "LPV SetImageData OK!"; std::pair> templateLevelAndvecMatchRltPtr; - bool bRlt = smokeMatch(typeNo, ilImgGray, templateLevelAndvecMatchRltPtr); + bool bRlt = smokeMatch(typeNo, ilImgGray, templateLevelAndvecMatchRltPtr, 0); drawImage(imgMatGray, rltMat, templateLevelAndvecMatchRltPtr); return bRlt; } bool CategoryMatcher::smokeMatch(const QString& typeNo, const ILImagePtr ilImgPtr, - std::pair>& templateLevelAndvecMatchRltPtr) + std::pair>& templateLevelAndvecMatchRltPtr,int id) { TemplateObject templateObj; QString templateImgFolderPath = TYPE_TEMPLATE_PATH; @@ -114,28 +114,29 @@ bool CategoryMatcher::smokeMatch(const QString& typeNo, const ILImagePtr ilImgPt // 磺1ģĵ1ģ壺11 // лӲ3101022ģĵ1ģ壺310102-21 QString folderPath = QString("%1\\%2").arg(templateImgFolderPath).arg(typeNo); + QString str; if (getTemplateImgFileInfo(folderPath, templateObj)) { - qDebug() << "Get TemplateImg OK!"; + str = QString("[%1]:Get TemplateImg OK!").arg(id); + qDebug() < vecMatchSroreMax; QVector vecMatchRltsMax; QList keys = templateObj.uniqueKeys(); int templateLevel = keys.length(); - qDebug() << "templateLevel = " << templateLevel; + str = QString("[%1]:templateLevel =%2").arg(id).arg(templateLevel); + qDebug() << str; templateLevelAndvecMatchRltPtr.first = templateLevel; // ͬģ弶 for each (int level in keys) { - qInfo() << "level = " << level; QVector vecMatchSrore; QVector vecMatchRlts; QMap strScoreMap = templateObj.value(level); for (QMap::iterator it = strScoreMap.begin(); it != strScoreMap.end(); ++it) { QString templateImgPath = it.key(); - qInfo() << "templateImgPath = "<< templateImgPath; ILImagePtr ilTemplatePtr(__uuidof(LImage)); ilTemplatePtr->Load(templateImgPath.toStdString().c_str()); if (ilTemplatePtr->Void()) @@ -157,7 +158,6 @@ bool CategoryMatcher::smokeMatch(const QString& typeNo, const ILImagePtr ilImgPt if (level == 1) // ģ { - qDebug() << "Level == 1"; ILImageArithmPtr imgArithm(__uuidof(LImageArithm)); imgArithm->Resize(ilImgPtr, 0.5, 0.5, LPVInterNearest, img); } @@ -165,6 +165,8 @@ bool CategoryMatcher::smokeMatch(const QString& typeNo, const ILImagePtr ilImgPt LPVErrorCode err = m_ilmatch->Match((level == 1 ? img : ilImgPtr), nullptr, &matchResults); LPVErrorCode errF = m_ilmatchF->Match((level == 1 ? img : ilImgPtr), nullptr, &matchResultsF); if (err < LPVErrorCode::LPVNoError || errF < LPVErrorCode::LPVNoError) { + str = QString("[%1]:Match Failed;templateImgPath = %2").arg(id).arg(templateImgPath); + qDebug() << str; continue; // match failed } @@ -202,7 +204,6 @@ bool CategoryMatcher::smokeMatch(const QString& typeNo, const ILImagePtr ilImgPt } } - } if (vecMatchSrore.isEmpty()) { @@ -219,9 +220,8 @@ bool CategoryMatcher::smokeMatch(const QString& typeNo, const ILImagePtr ilImgPt } if (vecMatchSroreMax.isEmpty() || (vecMatchSroreMax.length() != templateLevel)) { - QString outStr = QString("Level: %1 match failed!") - .arg(vecMatchSroreMax.length() + 1); - qDebug() << outStr; + str = QString("[%1]:Level: %1 match failed!").arg(id).arg(vecMatchSroreMax.length() + 1); + qDebug() << str; templateLevelAndvecMatchRltPtr.second = vecMatchRltsMax; return false; } @@ -232,8 +232,8 @@ bool CategoryMatcher::smokeMatch(const QString& typeNo, const ILImagePtr ilImgPt } else { - QString outStr = QString("%1 find templateImage failed!").arg(folderPath); - qDebug() << outStr; + str = QString("[%1]:Find templateImage failed! Folder = %2").arg(id).arg(folderPath); + qDebug() << str; return false; } return true; @@ -290,7 +290,7 @@ bool CategoryMatcher::getTemplateImgFileInfo(const QString& folderPath, Template void CategoryMatcher::drawImage(ILImagePtr image, std::pair> templateLevelAndvecMatchRltPtr) { - if (image->Height == 0 || image->Width == 0) + if (image->Void()) { return; } diff --git a/src/CategoryMatcher.h b/src/CategoryMatcher.h index d232143..b4da0d6 100644 --- a/src/CategoryMatcher.h +++ b/src/CategoryMatcher.h @@ -46,7 +46,7 @@ class CategoryMatcher : public QObject public: CategoryMatcher(QObject *parent = nullptr); ~CategoryMatcher(); - bool smokeMatch(const QString& typeNo, ILImagePtr image); + bool smokeMatch(const QString& typeNo, ILImagePtr image, int id); void saveResultsImage(const QString& filePath); bool smokeMatch(const QString& typeNo, const cv::Mat& inputMat, cv::Mat& rltMat); @@ -57,7 +57,7 @@ private: void setILMatch(const MatchParam& matchParam); bool getTemplateImgFileInfo(const QString& folderPath, TemplateObject& templateObject); bool smokeMatch(const QString& type, const ILImagePtr ilImgPtr, - std::pair >& templateLevelAndvecMatchRltPtr); + std::pair >& templateLevelAndvecMatchRltPtr, int id); void drawImage(const cv::Mat& imgMatSrc, cv::Mat& resulQImg, std::pair> templateLevelAndvecMatchRltPtr); diff --git a/src/SmokeBoxIdentification.cpp b/src/SmokeBoxIdentification.cpp index 411fee5..14965cf 100644 --- a/src/SmokeBoxIdentification.cpp +++ b/src/SmokeBoxIdentification.cpp @@ -12,9 +12,9 @@ SmokeBoxIdentification::SmokeBoxIdentification(QWidget *parent) //m_pShowRltImgLabel = ui.label_showImg; moduleLoading(); - - connect(this, &SmokeBoxIdentification::sgCapture, CameraControl::instance(), &CameraControl::onCapture); - connect(CameraControl::instance(), &CameraControl::sgCapturedImage, this, &SmokeBoxIdentification::onCapturedImage); + + //connect(this, &SmokeBoxIdentification::sgCapture, CameraControl::instance(), &CameraControl::onCapture); + //connect(CameraControl::instance(), &CameraControl::sgCapturedImage, this, &SmokeBoxIdentification::onCapturedImage); QString applicationDirPath = QCoreApplication::applicationDirPath(); QtConcurrent::run([=]() @@ -81,6 +81,9 @@ SmokeBoxIdentification::SmokeBoxIdentification(QWidget *parent) connect(this, &SmokeBoxIdentification::sgCategoryMatchFinished, this, &SmokeBoxIdentification::onNumStatistic); + connect(this, &SmokeBoxIdentification::sgCapture, CameraControl::instance(), &CameraControl::onCapture); + connect(CameraControl::instance(), &CameraControl::sgCapturedImage, this, &SmokeBoxIdentification::onCapturedImage); + connect(this, &SmokeBoxIdentification::sgControlSideLight, lpSerialStation::instance() , &lpSerialStation::onControlSideLight); @@ -127,16 +130,14 @@ Q_SLOT void SmokeBoxIdentification::onActionClicked() } } -void SmokeBoxIdentification::captureTop() +void SmokeBoxIdentification::captureTop(int cameraID) { - qInfo() << "[captureTop]: Enter"; - emit sgCapture(eCameraLocation::emTop); + emit sgCapture(eCameraLocation::emTop, cameraID); } -void SmokeBoxIdentification::captureSide() +void SmokeBoxIdentification::captureSide(int cameraID) { - qInfo() << "[captureSide]: Enter"; - emit sgCapture(eCameraLocation::emSide); + emit sgCapture(eCameraLocation::emSide, cameraID); } void SmokeBoxIdentification::saveImage(const cv::Mat& imgMat, const QString& filePath) @@ -150,23 +151,42 @@ void SmokeBoxIdentification::saveImage(const cv::Mat& imgMat, const QString& fil qDebug() << "Save image: " << filePath; } +void SmokeBoxIdentification::saveImage(ILImagePtr image, const QString& filePath) +{ + if (image->Void()) + { + qWarning() << "Image is empty"; + return; + } + std::wstring path = filePath.toStdWString(); + image->Save(path.c_str(), nullptr); + qDebug() << "Save image: " << filePath; +} + void SmokeBoxIdentification::saveImage(const QVector& vecImageInfo, int workMode) { QString dataSaveFolderPath; - qInfo() << "workMode = " << workMode; + +#if IMAGEDRAWING==LPV + dataSaveFolderPath = QString("%1\\%2\\%3").arg(FILE_STORAGE_PATH)/*.arg(ORIGIN_IMAGE_FOLDER)*/ + .arg(m_currtIntoStockInfo.taskNum).arg(m_currtIntoStockInfo.id); +#elif IMAGEDRAWING==OPENCV switch (workMode) { case WorkMode::StockCheck: - dataSaveFolderPath = QString("%1\\%2").arg(FILE_STORAGE_PATH).arg(m_currtStockCheckInfo.taskNum); + dataSaveFolderPath = QString("%1\\%2\\%3").arg(FILE_STORAGE_PATH).arg(m_currtStockCheckInfo.stockNum) + .arg(m_currtStockCheckInfo.taskNum); break; case WorkMode::IntoStock: - dataSaveFolderPath =QString("%1\\%2\\%3\\%4").arg(FILE_STORAGE_PATH).arg(INTOSTOCK_IMAGE_FOLDER) + dataSaveFolderPath = QString("%1\\%2\\%3\\%4").arg(FILE_STORAGE_PATH).arg(INTOSTOCK_IMAGE_FOLDER) .arg(m_currtIntoStockInfo.stockNum).arg(m_currtIntoStockInfo.taskNum); break; default: - dataSaveFolderPath = QString("%1\\%2").arg(FILE_STORAGE_PATH).arg(m_currtIntoStockInfo.taskNum); - //return; + qDebug() << "Mode: " << workMode << "do not save Image"; + return; } +#endif + QDir folder(dataSaveFolderPath); if (!folder.exists()) { @@ -185,6 +205,11 @@ void SmokeBoxIdentification::saveImage(const QVector& vecImageInfo, i { FileInfo fileInfo = vecImageInfo.at(i).saveImgInfo; QString filePath = QString("%1\\%2").arg(dataSaveFolderPath).arg(fileInfo.name); + +#if IMAGEDRAWING == LPV + saveImage(vecImageInfo.at(i).imageOrigin, filePath); + +#elif IMAGEDRAWING == OPENCV if (workMode == WorkMode::IntoStock) { QString filePathSend = QString("%1/%2/%3/%4").arg(INTOSTOCK_IMAGE_FOLDER) @@ -193,6 +218,7 @@ void SmokeBoxIdentification::saveImage(const QVector& vecImageInfo, i } saveImage(vecImageInfo.at(i).image, filePath); +#endif } } @@ -217,124 +243,11 @@ Q_SLOT void SmokeBoxIdentification::onCapturedImage(const QVector& ve } else if (cameraLocation == eCameraLocation::emSide) { -#if IMAGEDRAWING==LPV - qDebug() << "[Camera]: Side Camera Captured."; - QtConcurrent::run([=] { - saveImage(vecImageInfo, m_workMode); - - bool bRlt = false; - QString typeNum = m_currtStockCheckInfo.smokeTypeNum; - cv::Mat imgRltMat; - - - // ݶͨѶ֮ǰstockNumݸĴ洢ַ - //QString dataSaveFolder = QString("%1\\%2\\%3").arg(FILE_STORAGE_PATH) - // .arg(m_currtStockCheckInfo.stockNum).arg(m_currtStockCheckInfo.taskNum); - QString dataSaveFolder = QString("%1\\%2").arg(FILE_STORAGE_PATH) - .arg(m_currtStockCheckInfo.taskNum); - - // ֮ǰǶһ⣬ǰһͼΪOKһ - for each (const ImageInfo& imgInfo in vecImageInfo) - { - QString str = QString("Camera %1 Match Start ...").arg(imgInfo.cameraSn); - qDebug() << str; - - if (imgInfo.imageFixed->Height !=0 && imgInfo.imageFixed->Width!=0) - { - if (m_pCategoryMatcher->smokeMatch(typeNum, imgInfo.imageFixed)) - { - str = QString("Camera %1 Match successful!").arg(imgInfo.cameraSn); - qDebug() << str; - bRlt = true; - FileInfo fileInfo = imgInfo.saveImgInfo; - QString fileName = QString("%1_%2_rlt%3").arg(fileInfo.strId) - .arg(m_currtStockCheckInfo.smokeTypeNum).arg(fileInfo.suffix); - qInfo() << "fileName" << fileName; - QString filePath = QString("%1\\%2").arg(dataSaveFolder).arg(fileName); - qInfo() << "filePath" << filePath; - m_pCategoryMatcher->saveResultsImage(filePath); - break; - } - else - { - str = QString("Camera %1 Match Failed!").arg(imgInfo.cameraSn); - qWarning() << str; - } - - } - else - { - qDebug() << "imgInfo.image is Empty!"; - } - } - if (!bRlt) - { - QString filePath = dataSaveFolder + QString("\\%1_error.PNG") - .arg(m_currtStockCheckInfo.smokeTypeNum); - m_pCategoryMatcher->saveResultsImage(filePath); - //saveImage(imgRltMat, filePath); - } - QString typeNumRlt = bRlt ? typeNum : "0"; - m_currtStockCheckInfo.smokeTypeNumRlt = typeNumRlt; - qDebug() << "typeNumRlt: " << typeNumRlt; - - //Ƚ3DҪ3DٷȷϢ - m_currtStockCheckInfo.smokeQuantityRlt = typeNumRlt; - sendResults(MsgType::StockCheckResult); - //emit sgCategoryMatchFinished(typeNumRlt); - }); - -#elif IMAGEDRAWING==OPENCV - qDebug() << "side captured"; - QtConcurrent::run([=] { - saveImage(vecImageInfo, m_workMode); - bool bRlt = false; - QString typeNum = m_currtStockCheckInfo.smokeTypeNum; - cv::Mat imgRltMat; - QString dataSaveFolder = QString("%1\\%2\\%3").arg(FILE_STORAGE_PATH) - .arg(m_currtStockCheckInfo.stockNum).arg(m_currtStockCheckInfo.taskNum); - - for each (const ImageInfo& imgInfo in vecImageInfo) - { - QString str = QString("Camera %1 Match Start ...").arg(imgInfo.cameraSn); - qDebug() << str; - if (m_pCategoryMatcher->smokeMatch(typeNum, imgInfo.image, imgRltMat)) - { - str = QString("Camera %1 Match successful!").arg(imgInfo.cameraSn); - qDebug() << str; - bRlt = true; - FileInfo fileInfo = imgInfo.saveImgInfo; - QString fileName = QString("%1_%2_rlt%3").arg(fileInfo.strId) - .arg(m_currtStockCheckInfo.smokeTypeNum).arg(fileInfo.suffix); - QString filePath = QString("%1\\%2").arg(dataSaveFolder).arg(fileName); - saveImage(imgRltMat, filePath); - break; - } - else - { - str = QString("Camera %1 Match Failed!").arg(imgInfo.cameraSn); - qWarning() << str; - } - } - if (!bRlt) - { - QString filePath = dataSaveFolder + QString("\\%1_error.PNG") - .arg(m_currtStockCheckInfo.smokeTypeNum); - saveImage(imgRltMat, filePath); - } - QString typeNumRlt = bRlt ? typeNum : "0"; - m_currtStockCheckInfo.smokeTypeNumRlt = typeNumRlt; - qDebug() << "typeNumRlt: " << typeNumRlt; - emit sgCategoryMatchFinished(typeNumRlt); - //if (!imgRltMat.empty()) - //{ - // cv::cvtColor(imgRltMat, imgRltMat, cv::COLOR_BGR2RGB); - // QImage resultQImg((const unsigned char*)imgRltMat.data, imgRltMat.cols, imgRltMat.rows, imgRltMat.step, QImage::Format_RGB888); - // emit sgShowImage(m_pShowRltImgLabel, resultQImg); - //} + qDebug() << "[Camera{" << m_currtIntoStockInfo.stockLocation << "}]: Captured."; + saveImage(vecImageInfo, m_workMode); - }); -#endif + m_imageList.insert(m_currtIntoStockInfo.id.toInt(), vecImageInfo); + sendResults(MsgType::IntoStockResult); } } @@ -390,11 +303,11 @@ Q_SLOT void SmokeBoxIdentification::onDecodeMsg(const QString& msg) qDebug() << "ȡλ"; QString taskNum = strList.at(2); QString currentTaskNum = m_currtStockCheckInfo.taskNum; - //if (m_workMode == WorkMode::StockCheck) - //{ - captureSide(); - //captureTop(); - //} + if (m_workMode == WorkMode::StockCheck) + { + captureSide(1); + captureTop(1); + } } } else if (strList.at(0) == INTO_STOCK_HEAD) @@ -408,7 +321,7 @@ Q_SLOT void SmokeBoxIdentification::onDecodeMsg(const QString& msg) intoStockInfo.taskNum = strList.at(2); intoStockInfo.stockNum = strList.at(3); m_currtIntoStockInfo = intoStockInfo; - captureTop(); + captureTop(1); } } else if (strList.at(0) == LIGHT_CONTROL_HEAD) @@ -426,19 +339,19 @@ Q_SLOT void SmokeBoxIdentification::onDecodeMsg(const QString& msg) } } } - else if (strList.at(0) == START_TAKE) + else if (strList.at(0) == START_CAPTURE) { - qDebug() << "ʼ̵"; - //m_workMode = WorkMode::IntoStock; + qDebug() << "λȡͼʼ"; + //m_workMode = WorkMode::Capture; m_currtIntoStockInfo.streetName = strList.at(1); m_currtIntoStockInfo.id = strList.at(2); m_currtIntoStockInfo.taskNum = strList.at(3); m_currtIntoStockInfo.stockLocation = strList.at(4); - + captureSide(m_currtIntoStockInfo.stockLocation.toInt()); } - else if (strList.at(0) == START_CAPTURE) + else if (strList.at(0) == START_CALCULATE) { - qDebug() << "λȡͼ"; + qDebug() << "Ʒʼ"; //m_workMode = WorkMode::StockCheck; m_currtStockCheckInfo.streetName = strList.at(1); m_currtStockCheckInfo.id = strList.at(2); @@ -446,10 +359,88 @@ Q_SLOT void SmokeBoxIdentification::onDecodeMsg(const QString& msg) m_currtStockCheckInfo.stockLocation = strList.at(4); m_currtStockCheckInfo.smokeTypeNum = strList.at(5); m_currtStockCheckInfo.smokeQuantity = strList.at(6); - captureSide(); + m_stocketList.insert(m_currtStockCheckInfo.id.toInt(),m_currtStockCheckInfo); + calculate(m_currtStockCheckInfo.id.toInt()); } } +void SmokeBoxIdentification::calculate(int stocketID) +{ + QtConcurrent::run([=] { + + bool bRlt = false; + StockCheckInfo stocket = m_stocketList.value(stocketID); + if (!m_stocketList.contains(stocketID)) + { + qCritical() << "Don't Save stocketID[" << stocketID << "] Message!"; + return; + } + QString typeNum = stocket.smokeTypeNum; + cv::Mat imgRltMat; + + + // ݶͨѶ֮ǰstockNumݸĴ洢ַ + //QString dataSaveFolder = QString("%1\\%2\\%3").arg(FILE_STORAGE_PATH) + // .arg(m_currtStockCheckInfo.stockNum).arg(m_currtStockCheckInfo.taskNum); + QString dataSaveFolder = QString("%1\\%2\\%3").arg(FILE_STORAGE_PATH) + .arg(stocket.taskNum).arg(stocket.id); + + + QVector vecImageInfo = m_imageList.value(stocket.id.toInt()); + + // ֮ǰǶһ⣬ǰһͼΪOKһ + for each (const ImageInfo& imgInfo in vecImageInfo) + { + QString str = QString("[%1]:Camera %2 Match Start ...").arg(stocket.id).arg(imgInfo.cameraSn); + qDebug() << str; + + if (!imgInfo.imageFixed->Void()) + { + if (m_pCategoryMatcher->smokeMatch(typeNum, imgInfo.imageFixed,stocket.id.toInt())) + { + str = QString("[%1]:Camera %2 Match successful!").arg(stocket.id).arg(imgInfo.cameraSn); + qDebug() << str; + bRlt = true; + FileInfo fileInfo = imgInfo.saveImgInfo; + QString fileName = QString("%1_%2_rlt%3").arg(fileInfo.strId) + .arg(m_currtStockCheckInfo.smokeTypeNum).arg(fileInfo.suffix); + qInfo() << "fileName" << fileName; + QString filePath = QString("%1\\%2").arg(dataSaveFolder).arg(fileName); + qInfo() << "filePath" << filePath; + m_pCategoryMatcher->saveResultsImage(filePath); + break; + } + else + { + str = QString("[%1]:Camera %2 Match Failed!").arg(stocket.id).arg(imgInfo.cameraSn); + qWarning() << str; + } + + } + else + { + str = QString("[%1]:imgInfo.image is Empty!").arg(stocket.id); + qDebug() << str; + } + } + if (!bRlt) + { + QString filePath = dataSaveFolder + QString("\\%1_error.PNG") + .arg(stocket.smokeTypeNum); + m_pCategoryMatcher->saveResultsImage(filePath); + //saveImage(imgRltMat, filePath); + } + QString typeNumRlt = bRlt ? typeNum : "0"; + m_stocketList[stocketID].smokeTypeNumRlt = typeNumRlt; + qDebug() << "typeNumRlt: " << typeNumRlt; + + //Ƚ3DҪ3DٷȷϢ + m_stocketList[stocketID].smokeQuantityRlt = stocket.smokeQuantity; + sendResults(MsgType::StockCheckResult,stocketID); + //emit sgCategoryMatchFinished(typeNumRlt); + }); +} + Q_SLOT void SmokeBoxIdentification::onNumStatistic(QString typeNum) { qDebug() << "start num statistic"; @@ -515,7 +506,7 @@ Q_SLOT void SmokeBoxIdentification::onNumStatistic(QString typeNum) } } -void SmokeBoxIdentification::sendResults(int mode) +void SmokeBoxIdentification::sendResults(int mode, int id) { QString resultInfoMsg; switch (mode) @@ -557,14 +548,15 @@ void SmokeBoxIdentification::sendResults(int mode) } break; case eCommunicationRules::emSJZ: - resultInfoMsg.append(RETURN_MES).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.streetName).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.id).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.taskNum).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.stockLocation).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.smokeTypeNumRlt).append(SPLIT_RULE) - .append(m_currtStockCheckInfo.smokeQuantityRlt).append(SPLIT_RULE) - .append(QString::number(m_currtStockCheckInfo.correctness)).append(END_SYMBOL); + resultInfoMsg.append(RETURN_CALCULATE).append(SPLIT_RULE) + .append(m_stocketList.value(id).streetName).append(SPLIT_RULE) + .append(m_stocketList.value(id).id).append(SPLIT_RULE) + .append(m_stocketList.value(id).taskNum).append(SPLIT_RULE) + .append(m_stocketList.value(id).stockLocation).append(SPLIT_RULE) + .append(m_stocketList.value(id).smokeTypeNumRlt).append(SPLIT_RULE) + .append(m_stocketList.value(id).smokeQuantityRlt).append(SPLIT_RULE) + .append(QString::number(m_stocketList.value(id).correctness)).append(END_SYMBOL); + m_stocketList.remove(id); break; default: break; @@ -572,6 +564,9 @@ void SmokeBoxIdentification::sendResults(int mode) break; case IntoStockResult: + switch (m_moduleParam.COMMRules) + { + case eCommunicationRules::emNJ: { resultInfoMsg.append(INTO_STOCK_HEAD).append(SPLIT_RULE) .append(m_currtIntoStockInfo.streetName).append(SPLIT_RULE) @@ -583,6 +578,19 @@ void SmokeBoxIdentification::sendResults(int mode) resultInfoMsg.append(imagesPathList.at(i)).append(CONTENT_SPLIT); } resultInfoMsg.append(imagesPathList.last()).append(END_SYMBOL); + break; + } + case eCommunicationRules::emSJZ: + { + resultInfoMsg.append(END_CAPTURE).append(SPLIT_RULE) + .append(m_currtIntoStockInfo.streetName).append(SPLIT_RULE) + .append(m_currtIntoStockInfo.id).append(SPLIT_RULE) + .append(m_currtIntoStockInfo.taskNum).append(SPLIT_RULE) + .append(m_currtIntoStockInfo.stockLocation).append(SPLIT_RULE); + break; + } + default: + break; } break; default: @@ -836,45 +844,4 @@ void SmokeBoxIdentification::moduleLoading() m_moduleParam.Camera3D = ModuleParamObj.value("Camera3D").toInt(); m_moduleParam.COMMRules = (eCommunicationRules)ModuleParamObj.value("COMMRules").toInt(); } - - //// ıļԶȡģʽ - //QFile file(strName); - //if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) - //{ - // qDebug() << "Could not open file for reading."; - // QMessageBox::information(NULL, QStringLiteral("ļ"), QStringLiteral("ʧܣ"), QMessageBox::Ok); - // return; - //} - - //// QTextStream 󣬲ļ - //QTextStream in(&file); - - //int row = 0; - - //// ȡ - //while (!in.atEnd()) - //{ - // ++row; - // // ıжȡһ - // QString line = in.readLine(); - - // // ʹtabַָΪ - // QStringList values = line.split(' '); - - // if (row <= 3) - // { - // pts[(Axis)values[0].toInt()].first = values[1].toDouble(); - // pts[(Axis)values[0].toInt()].second = values[2].toDouble(); - // } - // else - // { - // m_basicPlane.A = values[0].toDouble(); - // m_basicPlane.B = values[1].toDouble(); - // m_basicPlane.C = values[2].toDouble(); - // m_basicPlane.D = values[3].toDouble(); - // } - //} - - //// رļ - //file.close(); } \ No newline at end of file diff --git a/src/SmokeBoxIdentification.h b/src/SmokeBoxIdentification.h index e23be84..0f15d0c 100644 --- a/src/SmokeBoxIdentification.h +++ b/src/SmokeBoxIdentification.h @@ -27,8 +27,8 @@ enum MsgType { EmptyCheckResult = 0, DataCollectionEndSC, - StockCheckResult, - IntoStockResult + StockCheckResult, // ʯׯĿʾͼƷɹ + IntoStockResult // ʯׯĿʾλȡͼɹ }; enum WorkMode @@ -39,80 +39,6 @@ enum WorkMode IntoStock }; -enum StockCheckMode -{ - NoVirtual = 0, - TypeVirtual, //Ʒģ̵ - NumVirtual, //ģ̵ - TypeNumVirtual //Ʒģ̵ -}; - -struct IntoStockInfo -{ - QString streetName; // - QString taskNum; // - - QString stockNum; //λUL062015020111 6ŶѶ2ұߣ - QString id = 0; - QString stockLocation = 0; // 12ң0Ϊ֮ǰ - QStringList imagesPathList; -}; - -struct EmptyCheckInfo -{ - QString streetName; - QString taskNum; -}; - -struct StockCheckInfo -{ - // "SC&6&UL062015020111&6335&37010106&30&N>" - // ¹GP&111&6&2121&1&S001&25> - // 111:ID - // 6: - // 2121:- - // 112 - // S001:Ʒ-λ͵Ʒ - // - QString streetName; // 6 - QString taskNum; // 6335 - QString stockNum; // λUL062015020111 6ŶѶ2ұߣ - QString id = 0; - QString stockLocation = 0; // 12ң0Ϊ֮ǰ - QString smokeTypeNum; //λ͵Ʒ37010106 - QString smokeQuantity; //λ͵30 - QString smokeTypeNumRlt; //̵ʶƷ - QString smokeQuantityRlt; //̵ʶ - bool correctness; //̵Ƿλһ - //void clear() - //{ - // streetName.clear(); - // taskNum.clear(); - // stockNum.clear(); - // smokeTypeNum.clear(); - // smokeQuantity.clear(); - // smokeTypeNumRlt.clear(); - // smokeQuantityRlt.clear(); - // correctness = false; - //} - //StockCheckInfo &operator = (const StockCheckInfo& obj) - //{ - // this->streetName = obj.streetName; - // this->taskNum = obj.taskNum; - // this->stockNum = obj.stockNum; - // this->smokeTypeNum = obj.smokeTypeNum; - // this->smokeQuantity = obj.smokeQuantity; - // this->smokeTypeNumRlt = obj.smokeTypeNumRlt; - // this->smokeQuantityRlt = obj.smokeQuantityRlt; - // this->correctness = obj.correctness; - // return *this; - //} - - - - -}; - - struct ModuleParam { @@ -140,7 +66,7 @@ public: ~SmokeBoxIdentification(); signals: - void sgCapture(int cameraLocation); + void sgCapture(int cameraLocation,int cameraID); void sgCategoryMatchFinished(QString smokeNum); void sgShowImage(QLabel* labelPtr, const QImage& qImage); //void sgSendData2AndAlgo(); @@ -165,15 +91,18 @@ private: Q_SLOT void onSendEmptyCheckResults(const QMap&); Q_SLOT void onNewNumData(const QVector>& vec, const QVector& strVec, int side); - void sendResults(int mode); + void sendResults(int mode, int id = 0); void saveData2File(const QVector& strVec, QString folderPath, int side); - void captureTop(); - void captureSide(); + void captureTop(int cameraID); + void captureSide(int cameraID); void saveImage(const QVector& vecImageInfo, int workMode); void saveImage(const cv::Mat& imgMat, const QString& filePath); + void saveImage(ILImagePtr image, const QString& filePath); bool decodeSmokeInfoCsv(const QString& filePath); bool matchSmokeNameAndTemplateFolderName(const QString& folderPath); + void calculate(int stocketID); + bool m_bEmptyCheckStart{ false }; //bool m_bStockCheckStart{ false }; bool m_bCaptureFinish{ false }; @@ -203,6 +132,9 @@ private: QNumTemplateBuild* m_pNumTemplateBuild{ nullptr }; StockCheckMode m_stockCheckMode; + QMap> m_imageList; // int:idImageInfoӦͼ + QMapm_stocketList; // ƷĴź + QThread* m_pTcpClientThread; //QLabel* m_pShowRltImgLabel; Ui::SmokeBoxIdentificationClass ui; diff --git a/src/common/commonDefine.h b/src/common/commonDefine.h index c566934..658f527 100644 --- a/src/common/commonDefine.h +++ b/src/common/commonDefine.h @@ -36,6 +36,7 @@ #define SMOKEINFO_XLSX_CONFIG "\\user\\smokeInfo.xlsx" #define FILE_STORAGE_PATH ".\\fileData" #define INTOSTOCK_IMAGE_FOLDER "intoStock" +#define ORIGIN_IMAGE_FOLDER "Origin" #define TYPE_TEMPLATE_PATH ".\\templateImg" //#define NUM_TEMPLATE_PATH ".\\templateNum" #define LOCAL_MODEL_PATH "\\localModel" @@ -51,9 +52,10 @@ #define CODE_CONTENT_SPLIT "," #define CONTENT_SPLIT ";" #define END_SYMBOL ">" -#define START_CAPTURE "GP" // λȡͼ -#define START_TAKE "ST" // ʼ̵ -#define RETURN_MES "RT" // +#define START_CAPTURE "GPS" // λȡͼʼ +#define END_CAPTURE "GPE" // λȡͼ +#define START_CALCULATE "RTS" // ʼƷ +#define RETURN_CALCULATE "RTE" // Ʒ #define LP_COLOR_CONTROL 0x88 #define LP_D1TOD80 0x86 @@ -132,6 +134,76 @@ struct debugMsg QString msAD_2; }; +enum StockCheckMode +{ + NoVirtual = 0, + TypeVirtual, //Ʒģ̵ + NumVirtual, //ģ̵ + TypeNumVirtual //Ʒģ̵ +}; + +struct IntoStockInfo +{ + QString streetName; // + QString taskNum; // - + QString stockNum; //λUL062015020111 6ŶѶ2ұߣ + QString id = 0; + QString stockLocation = 0; // 12ң0Ϊ֮ǰ + QStringList imagesPathList; +}; + +struct EmptyCheckInfo +{ + QString streetName; + QString taskNum; +}; + +struct StockCheckInfo +{ + // "SC&6&UL062015020111&6335&37010106&30&N>" + // ¹GP&111&6&2121&1&S001&25> + // 111:ID + // 6: + // 2121:- + // 112 + // S001:Ʒ-λ͵Ʒ + // + QString streetName; // 6 + QString taskNum; // 6335 + QString stockNum; // λUL062015020111 6ŶѶ2ұߣ + QString id = 0; + QString stockLocation = 0; // 12ң0Ϊ֮ǰ + QString smokeTypeNum; //λ͵Ʒ37010106 + QString smokeQuantity; //λ͵30 + QString smokeTypeNumRlt; //̵ʶƷ + QString smokeQuantityRlt; //̵ʶ + bool correctness; //̵Ƿλһ + //void clear() + //{ + // streetName.clear(); + // taskNum.clear(); + // stockNum.clear(); + // smokeTypeNum.clear(); + // smokeQuantity.clear(); + // smokeTypeNumRlt.clear(); + // smokeQuantityRlt.clear(); + // correctness = false; + //} + //StockCheckInfo &operator = (const StockCheckInfo& obj) + //{ + // this->streetName = obj.streetName; + // this->taskNum = obj.taskNum; + // this->stockNum = obj.stockNum; + // this->smokeTypeNum = obj.smokeTypeNum; + // this->smokeQuantity = obj.smokeQuantity; + // this->smokeTypeNumRlt = obj.smokeTypeNumRlt; + // this->smokeQuantityRlt = obj.smokeQuantityRlt; + // this->correctness = obj.correctness; + // return *this; + //} +}; + + enum eCommunicationRules { emNJ = 0, // Ͼ @@ -141,7 +213,7 @@ enum eCommunicationRules enum eCameraLocation { emSide=0, // Чɼ - emTop // õ + emTop, // õ }; enum eSideID { diff --git a/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_Calculate.cpp b/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_Calculate.cpp new file mode 100644 index 0000000..4d35262 --- /dev/null +++ b/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_Calculate.cpp @@ -0,0 +1,114 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'Calculate.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.9.4) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "../../Calculate.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'Calculate.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.9.4. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_Calculate_t { + QByteArrayData data[3]; + char stringdata0[17]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_Calculate_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_Calculate_t qt_meta_stringdata_Calculate = { + { +QT_MOC_LITERAL(0, 0, 9), // "Calculate" +QT_MOC_LITERAL(1, 10, 5), // "start" +QT_MOC_LITERAL(2, 16, 0) // "" + + }, + "Calculate\0start\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_Calculate[] = { + + // content: + 7, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags + 1, 0, 19, 2, 0x08 /* Private */, + + // slots: parameters + QMetaType::Void, + + 0 // eod +}; + +void Calculate::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Calculate *_t = static_cast(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->start(); break; + default: ; + } + } + Q_UNUSED(_a); +} + +const QMetaObject Calculate::staticMetaObject = { + { &QObject::staticMetaObject, qt_meta_stringdata_Calculate.data, + qt_meta_data_Calculate, qt_static_metacall, nullptr, nullptr} +}; + + +const QMetaObject *Calculate::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *Calculate::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_Calculate.stringdata0)) + return static_cast(this); + return QObject::qt_metacast(_clname); +} + +int Calculate::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QObject::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast(_a[0]) = -1; + _id -= 1; + } + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_CameraControl.cpp b/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_CameraControl.cpp index 8e3b168..4796206 100644 --- a/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_CameraControl.cpp +++ b/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_CameraControl.cpp @@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_CameraControl_t { - QByteArrayData data[8]; - char stringdata0[95]; + QByteArrayData data[9]; + char stringdata0[104]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -39,12 +39,14 @@ QT_MOC_LITERAL(3, 31, 18), // "QVector" QT_MOC_LITERAL(4, 50, 12), // "vecImageInfo" QT_MOC_LITERAL(5, 63, 14), // "cameraLocation" QT_MOC_LITERAL(6, 78, 9), // "onCapture" -QT_MOC_LITERAL(7, 88, 6) // "onOpen" +QT_MOC_LITERAL(7, 88, 8), // "cameraID" +QT_MOC_LITERAL(8, 97, 6) // "onOpen" }, "CameraControl\0sgCapturedImage\0\0" "QVector\0vecImageInfo\0" - "cameraLocation\0onCapture\0onOpen" + "cameraLocation\0onCapture\0cameraID\0" + "onOpen" }; #undef QT_MOC_LITERAL @@ -65,14 +67,14 @@ static const uint qt_meta_data_CameraControl[] = { 1, 2, 29, 2, 0x06 /* Public */, // slots: name, argc, parameters, tag, flags - 6, 1, 34, 2, 0x0a /* Public */, - 7, 0, 37, 2, 0x08 /* Private */, + 6, 2, 34, 2, 0x0a /* Public */, + 8, 0, 39, 2, 0x08 /* Private */, // signals: parameters QMetaType::Void, 0x80000000 | 3, QMetaType::Int, 4, 5, // slots: parameters - QMetaType::Void, QMetaType::Int, 5, + QMetaType::Void, QMetaType::Int, QMetaType::Int, 5, 7, QMetaType::Void, 0 // eod @@ -85,7 +87,7 @@ void CameraControl::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _i Q_UNUSED(_t) switch (_id) { case 0: _t->sgCapturedImage((*reinterpret_cast< const QVector(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; - case 1: _t->onCapture((*reinterpret_cast< int(*)>(_a[1]))); break; + case 1: _t->onCapture((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 2: _t->onOpen(); break; default: ; } diff --git a/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_SmokeBoxIdentification.cpp b/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_SmokeBoxIdentification.cpp index 86f877b..a364183 100644 --- a/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_SmokeBoxIdentification.cpp +++ b/tpvs17/SmokeBoxIdentification/GeneratedFiles/Release/moc_SmokeBoxIdentification.cpp @@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_SmokeBoxIdentification_t { - QByteArrayData data[38]; - char stringdata0[552]; + QByteArrayData data[39]; + char stringdata0[561]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -36,44 +36,45 @@ QT_MOC_LITERAL(0, 0, 22), // "SmokeBoxIdentification" QT_MOC_LITERAL(1, 23, 9), // "sgCapture" QT_MOC_LITERAL(2, 33, 0), // "" QT_MOC_LITERAL(3, 34, 14), // "cameraLocation" -QT_MOC_LITERAL(4, 49, 23), // "sgCategoryMatchFinished" -QT_MOC_LITERAL(5, 73, 8), // "smokeNum" -QT_MOC_LITERAL(6, 82, 11), // "sgShowImage" -QT_MOC_LITERAL(7, 94, 7), // "QLabel*" -QT_MOC_LITERAL(8, 102, 8), // "labelPtr" -QT_MOC_LITERAL(9, 111, 6), // "qImage" -QT_MOC_LITERAL(10, 118, 21), // "sgNumDataCollectStart" -QT_MOC_LITERAL(11, 140, 6), // "sideId" -QT_MOC_LITERAL(12, 147, 20), // "sgNumDataCollectStop" -QT_MOC_LITERAL(13, 168, 22), // "sgStartEmptyPlaceCheck" -QT_MOC_LITERAL(14, 191, 10), // "streetName" -QT_MOC_LITERAL(15, 202, 21), // "sgStopEmptyPlaceCheck" -QT_MOC_LITERAL(16, 224, 18), // "sgControlSideLight" -QT_MOC_LITERAL(17, 243, 9), // "sgSendMsg" -QT_MOC_LITERAL(18, 253, 3), // "msg" -QT_MOC_LITERAL(19, 257, 11), // "onDecodeMsg" -QT_MOC_LITERAL(20, 269, 15), // "onCapturedImage" -QT_MOC_LITERAL(21, 285, 18), // "QVector" -QT_MOC_LITERAL(22, 304, 12), // "vecImageInfo" -QT_MOC_LITERAL(23, 317, 14), // "camearLocation" -QT_MOC_LITERAL(24, 332, 14), // "onNumStatistic" -QT_MOC_LITERAL(25, 347, 7), // "typeNum" -QT_MOC_LITERAL(26, 355, 11), // "onShowImage" -QT_MOC_LITERAL(27, 367, 27), // "onMonitorSensorTriggerStart" -QT_MOC_LITERAL(28, 395, 26), // "onMonitorSensorTriggerStop" -QT_MOC_LITERAL(29, 422, 15), // "onActionClicked" -QT_MOC_LITERAL(30, 438, 23), // "onSendEmptyCheckResults" -QT_MOC_LITERAL(31, 462, 17), // "QMap" -QT_MOC_LITERAL(32, 480, 12), // "onNewNumData" -QT_MOC_LITERAL(33, 493, 25), // "QVector >" -QT_MOC_LITERAL(34, 519, 3), // "vec" -QT_MOC_LITERAL(35, 523, 16), // "QVector" -QT_MOC_LITERAL(36, 540, 6), // "strVec" -QT_MOC_LITERAL(37, 547, 4) // "side" +QT_MOC_LITERAL(4, 49, 8), // "cameraID" +QT_MOC_LITERAL(5, 58, 23), // "sgCategoryMatchFinished" +QT_MOC_LITERAL(6, 82, 8), // "smokeNum" +QT_MOC_LITERAL(7, 91, 11), // "sgShowImage" +QT_MOC_LITERAL(8, 103, 7), // "QLabel*" +QT_MOC_LITERAL(9, 111, 8), // "labelPtr" +QT_MOC_LITERAL(10, 120, 6), // "qImage" +QT_MOC_LITERAL(11, 127, 21), // "sgNumDataCollectStart" +QT_MOC_LITERAL(12, 149, 6), // "sideId" +QT_MOC_LITERAL(13, 156, 20), // "sgNumDataCollectStop" +QT_MOC_LITERAL(14, 177, 22), // "sgStartEmptyPlaceCheck" +QT_MOC_LITERAL(15, 200, 10), // "streetName" +QT_MOC_LITERAL(16, 211, 21), // "sgStopEmptyPlaceCheck" +QT_MOC_LITERAL(17, 233, 18), // "sgControlSideLight" +QT_MOC_LITERAL(18, 252, 9), // "sgSendMsg" +QT_MOC_LITERAL(19, 262, 3), // "msg" +QT_MOC_LITERAL(20, 266, 11), // "onDecodeMsg" +QT_MOC_LITERAL(21, 278, 15), // "onCapturedImage" +QT_MOC_LITERAL(22, 294, 18), // "QVector" +QT_MOC_LITERAL(23, 313, 12), // "vecImageInfo" +QT_MOC_LITERAL(24, 326, 14), // "camearLocation" +QT_MOC_LITERAL(25, 341, 14), // "onNumStatistic" +QT_MOC_LITERAL(26, 356, 7), // "typeNum" +QT_MOC_LITERAL(27, 364, 11), // "onShowImage" +QT_MOC_LITERAL(28, 376, 27), // "onMonitorSensorTriggerStart" +QT_MOC_LITERAL(29, 404, 26), // "onMonitorSensorTriggerStop" +QT_MOC_LITERAL(30, 431, 15), // "onActionClicked" +QT_MOC_LITERAL(31, 447, 23), // "onSendEmptyCheckResults" +QT_MOC_LITERAL(32, 471, 17), // "QMap" +QT_MOC_LITERAL(33, 489, 12), // "onNewNumData" +QT_MOC_LITERAL(34, 502, 25), // "QVector >" +QT_MOC_LITERAL(35, 528, 3), // "vec" +QT_MOC_LITERAL(36, 532, 16), // "QVector" +QT_MOC_LITERAL(37, 549, 6), // "strVec" +QT_MOC_LITERAL(38, 556, 4) // "side" }, "SmokeBoxIdentification\0sgCapture\0\0" - "cameraLocation\0sgCategoryMatchFinished\0" + "cameraLocation\0cameraID\0sgCategoryMatchFinished\0" "smokeNum\0sgShowImage\0QLabel*\0labelPtr\0" "qImage\0sgNumDataCollectStart\0sideId\0" "sgNumDataCollectStop\0sgStartEmptyPlaceCheck\0" @@ -104,48 +105,48 @@ static const uint qt_meta_data_SmokeBoxIdentification[] = { 9, // signalCount // signals: name, argc, parameters, tag, flags - 1, 1, 104, 2, 0x06 /* Public */, - 4, 1, 107, 2, 0x06 /* Public */, - 6, 2, 110, 2, 0x06 /* Public */, - 10, 1, 115, 2, 0x06 /* Public */, - 12, 0, 118, 2, 0x06 /* Public */, - 13, 1, 119, 2, 0x06 /* Public */, - 15, 0, 122, 2, 0x06 /* Public */, - 16, 1, 123, 2, 0x06 /* Public */, - 17, 1, 126, 2, 0x06 /* Public */, + 1, 2, 104, 2, 0x06 /* Public */, + 5, 1, 109, 2, 0x06 /* Public */, + 7, 2, 112, 2, 0x06 /* Public */, + 11, 1, 117, 2, 0x06 /* Public */, + 13, 0, 120, 2, 0x06 /* Public */, + 14, 1, 121, 2, 0x06 /* Public */, + 16, 0, 124, 2, 0x06 /* Public */, + 17, 1, 125, 2, 0x06 /* Public */, + 18, 1, 128, 2, 0x06 /* Public */, // slots: name, argc, parameters, tag, flags - 19, 1, 129, 2, 0x08 /* Private */, - 20, 2, 132, 2, 0x08 /* Private */, - 24, 1, 137, 2, 0x08 /* Private */, - 26, 2, 140, 2, 0x08 /* Private */, - 27, 1, 145, 2, 0x08 /* Private */, - 28, 1, 148, 2, 0x08 /* Private */, - 29, 0, 151, 2, 0x08 /* Private */, - 30, 1, 152, 2, 0x08 /* Private */, - 32, 3, 155, 2, 0x08 /* Private */, + 20, 1, 131, 2, 0x08 /* Private */, + 21, 2, 134, 2, 0x08 /* Private */, + 25, 1, 139, 2, 0x08 /* Private */, + 27, 2, 142, 2, 0x08 /* Private */, + 28, 1, 147, 2, 0x08 /* Private */, + 29, 1, 150, 2, 0x08 /* Private */, + 30, 0, 153, 2, 0x08 /* Private */, + 31, 1, 154, 2, 0x08 /* Private */, + 33, 3, 157, 2, 0x08 /* Private */, // signals: parameters - QMetaType::Void, QMetaType::Int, 3, - QMetaType::Void, QMetaType::QString, 5, - QMetaType::Void, 0x80000000 | 7, QMetaType::QImage, 8, 9, - QMetaType::Void, QMetaType::Int, 11, + QMetaType::Void, QMetaType::Int, QMetaType::Int, 3, 4, + QMetaType::Void, QMetaType::QString, 6, + QMetaType::Void, 0x80000000 | 8, QMetaType::QImage, 9, 10, + QMetaType::Void, QMetaType::Int, 12, QMetaType::Void, - QMetaType::Void, QMetaType::QString, 14, + QMetaType::Void, QMetaType::QString, 15, QMetaType::Void, QMetaType::Void, QMetaType::Int, 2, - QMetaType::Void, QMetaType::QString, 18, + QMetaType::Void, QMetaType::QString, 19, // slots: parameters - QMetaType::Void, QMetaType::QString, 18, - QMetaType::Void, 0x80000000 | 21, QMetaType::Int, 22, 23, - QMetaType::Void, QMetaType::QString, 25, - QMetaType::Void, 0x80000000 | 7, QMetaType::QImage, 8, 9, + QMetaType::Void, QMetaType::QString, 19, + QMetaType::Void, 0x80000000 | 22, QMetaType::Int, 23, 24, + QMetaType::Void, QMetaType::QString, 26, + QMetaType::Void, 0x80000000 | 8, QMetaType::QImage, 9, 10, QMetaType::Void, QMetaType::Int, 2, QMetaType::Void, QMetaType::Int, 2, QMetaType::Void, - QMetaType::Void, 0x80000000 | 31, 2, - QMetaType::Void, 0x80000000 | 33, 0x80000000 | 35, QMetaType::Int, 34, 36, 37, + QMetaType::Void, 0x80000000 | 32, 2, + QMetaType::Void, 0x80000000 | 34, 0x80000000 | 36, QMetaType::Int, 35, 37, 38, 0 // eod }; @@ -156,7 +157,7 @@ void SmokeBoxIdentification::qt_static_metacall(QObject *_o, QMetaObject::Call _ SmokeBoxIdentification *_t = static_cast(_o); Q_UNUSED(_t) switch (_id) { - case 0: _t->sgCapture((*reinterpret_cast< int(*)>(_a[1]))); break; + case 0: _t->sgCapture((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 1: _t->sgCategoryMatchFinished((*reinterpret_cast< QString(*)>(_a[1]))); break; case 2: _t->sgShowImage((*reinterpret_cast< QLabel*(*)>(_a[1])),(*reinterpret_cast< const QImage(*)>(_a[2]))); break; case 3: _t->sgNumDataCollectStart((*reinterpret_cast< int(*)>(_a[1]))); break; @@ -206,7 +207,7 @@ void SmokeBoxIdentification::qt_static_metacall(QObject *_o, QMetaObject::Call _ } else if (_c == QMetaObject::IndexOfMethod) { int *result = reinterpret_cast(_a[0]); { - typedef void (SmokeBoxIdentification::*_t)(int ); + typedef void (SmokeBoxIdentification::*_t)(int , int ); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&SmokeBoxIdentification::sgCapture)) { *result = 0; return; @@ -308,9 +309,9 @@ int SmokeBoxIdentification::qt_metacall(QMetaObject::Call _c, int _id, void **_a } // SIGNAL 0 -void SmokeBoxIdentification::sgCapture(int _t1) +void SmokeBoxIdentification::sgCapture(int _t1, int _t2) { - void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)) }; + void *_a[] = { nullptr, const_cast(reinterpret_cast(&_t1)), const_cast(reinterpret_cast(&_t2)) }; QMetaObject::activate(this, &staticMetaObject, 0, _a); }