From 322864e26e689477decf9ac75c985b2e265ba08b Mon Sep 17 00:00:00 2001 From: bobpan Date: Fri, 13 Nov 2020 18:08:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0gige=E7=9B=B8=E6=9C=BA?= =?UTF-8?q?=E5=A2=9E=E7=9B=8A=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runner17/config/camera.json | 71 ++++++++------------------- src/lpCamera/lpCamHik/CameraHik.cpp | 6 +-- src/lpCamera/tpCamGige/CameraGige.cpp | 4 ++ tpvs17/lpMain/CMainWin.cpp | 6 +-- tpvs17/lpMain/QCamSetDlg.cpp | 4 +- tpvs17/lpMain/QCamSetDlg.ui | 4 +- 6 files changed, 34 insertions(+), 61 deletions(-) diff --git a/runner17/config/camera.json b/runner17/config/camera.json index 391a9ae..cd50345 100644 --- a/runner17/config/camera.json +++ b/runner17/config/camera.json @@ -1,73 +1,42 @@ { "devices": { - "DMK 33GP031 23814564": { + "DMK 33GP031 25614072": { "algorithm": 0, - "algorithm_dll": 0, - "board_num": 1, - "board_type": 64, - "exposure": 1600, - "folder": "G:\\重庆捷力\\NG\\2\\PA131Q\\", + "board_num": 0, + "board_type": 0, + "exposure": 26000, + "folder": ".\\testimg\\", "format": "GRAY8", "gain": 8, - "id": 1, + "height": 1944, + "id": 2, "loop": 1, "rely_on_camera": "", "save": 0, "save_img_suffix": ".BMP", - "savefile_rgb_swapped": false, - "showname": "工位1", - "type": 100, + "showname": "工位2", + "type": 120, + "width": 2592, "zoom": 1 }, - "DMK 33GP031 2814182": { + "MV-CA050-10GC 00C27808759": { "algorithm": 0, - "algorithm_dll": 0, - "board_num": 1, - "board_type": 64, - "exposure": 1600, - "folder": "H:\\download\\重庆捷力\\图片\\1\\AANN-HG\\", + "board_num": 0, + "board_type": 0, + "exposure": 160000, + "folder": "G:\\重庆捷力\\NG\\2\\PA131Q\\", "format": "GRAY8", "gain": 8, - "id": 2, + "height": 960, + "id": 1, "loop": 1, "rely_on_camera": "", "save": 0, "save_img_suffix": ".BMP", - "savefile_rgb_swapped": false, - "showname": "工位2", - "type": 100, + "showname": "工位1", + "type": 140, + "width": 1280, "zoom": 1 } - }, - "pool": { - "framerate": 30, - "triggerdirection": 0, - "triggermode": 1 - }, - "windows": { - "cam_win_1_1": { - "bitsperpixel": 32, - "buffer_h": 1944, - "buffer_w": 2592, - "buffers": 2, - "cache_origin": false, - "device": "DMK 33GP031 23814564", - "images": 1, - "index": 0, - "mirror": 0, - "rgb_swapped": false - }, - "cam_win_2_1": { - "bitsperpixel": 32, - "buffer_h": 1944, - "buffer_w": 2592, - "buffers": 2, - "cache_origin": false, - "device": "DMK 33GP031 2814182", - "images": 1, - "index": 0, - "mirror": 0, - "rgb_swapped": false - } } } diff --git a/src/lpCamera/lpCamHik/CameraHik.cpp b/src/lpCamera/lpCamHik/CameraHik.cpp index e5d75f6..d8ae845 100644 --- a/src/lpCamera/lpCamHik/CameraHik.cpp +++ b/src/lpCamera/lpCamHik/CameraHik.cpp @@ -114,11 +114,11 @@ void CCameraHik::InitProperty() if (m_hDevice != nullptr&&m_pCamOpt != nullptr) { int nRet = 0; - nRet = MV_CC_SetWidth(m_hDevice, m_pCamOpt->width); - nRet = MV_CC_SetHeight(m_hDevice, m_pCamOpt->height); +// nRet = MV_CC_SetWidth(m_hDevice, m_pCamOpt->width); +// nRet = MV_CC_SetHeight(m_hDevice, m_pCamOpt->height); nRet = MV_CC_SetExposureTime(m_hDevice, m_pCamOpt->exposure); nRet = MV_CC_SetGain(m_hDevice, m_pCamOpt->gain); - nRet = MV_CC_SetPixelFormat(m_hDevice, PixelType_Gvsp_Mono8); + //nRet = MV_CC_SetPixelFormat(m_hDevice, PixelType_Gvsp_Mono8); } } diff --git a/src/lpCamera/tpCamGige/CameraGige.cpp b/src/lpCamera/tpCamGige/CameraGige.cpp index 629a896..86f7388 100644 --- a/src/lpCamera/tpCamGige/CameraGige.cpp +++ b/src/lpCamera/tpCamGige/CameraGige.cpp @@ -315,6 +315,10 @@ bool CCameraGige::ISetProperty(TP_CAMERA_PROPERTY* pCamProperty) m_nExposure = m_pCamOpt->exposure = pCamProperty->value; setExposure(m_pCamOpt->exposure); break; + case TP_CAM_PROPERTY_GAIN: + m_nGain = pCamProperty->value; + setGain(m_nGain); + break; default: break; } diff --git a/tpvs17/lpMain/CMainWin.cpp b/tpvs17/lpMain/CMainWin.cpp index cd9d2be..0dfe3d5 100644 --- a/tpvs17/lpMain/CMainWin.cpp +++ b/tpvs17/lpMain/CMainWin.cpp @@ -91,9 +91,9 @@ CMainWin::CMainWin(QWidget *parent) bool bOpen = m_pSerialPort->OpenCom(strDefaultPort, QString::number(baut)); if (bOpen == false) { - QMessageBox infobox(QMessageBox::Information, QString(QObject::tr("ʾ")), QString("Com %1 %2 open failed").arg(strDefaultPort).arg(baut), QMessageBox::Yes | QMessageBox::No, NULL); - infobox.setWindowIcon(QIcon(LEAPER_LOGO)); - infobox.exec(); +// QMessageBox infobox(QMessageBox::Information, QString(QObject::tr("ʾ")), QString("Com %1 %2 open failed").arg(strDefaultPort).arg(baut), QMessageBox::Yes | QMessageBox::No, NULL); +// infobox.setWindowIcon(QIcon(LEAPER_LOGO)); +// infobox.exec(); } connect(&m_HeartBit, SIGNAL(timeout()), this, SLOT(onHeardBit())); m_HeartBit.start(300); diff --git a/tpvs17/lpMain/QCamSetDlg.cpp b/tpvs17/lpMain/QCamSetDlg.cpp index 20a1ea1..5025a0f 100644 --- a/tpvs17/lpMain/QCamSetDlg.cpp +++ b/tpvs17/lpMain/QCamSetDlg.cpp @@ -60,8 +60,8 @@ Q_SLOT void QCamSetDlg::onButtonClicked() { // m_pCorl->IOpenCamera(m_curCamKey); // m_pCorl->IStartCamera(m_curCamKey); - m_pCorl->IRunAlg(m_curCamKey, false); -// m_pCorl->ISnapImage(QStringList()<IRunAlg(m_curCamKey, false); + m_pCorl->ISnapImage(QStringList()<0 0 841 - 484 + 486 @@ -88,7 +88,7 @@ - 打开 + 软触发一次