增加gige相机增益设置

master
bobpan 5 years ago
parent cbc0a26cec
commit 322864e26e

@ -1,73 +1,42 @@
{ {
"devices": { "devices": {
"DMK 33GP031 23814564": { "DMK 33GP031 25614072": {
"algorithm": 0, "algorithm": 0,
"algorithm_dll": 0, "board_num": 0,
"board_num": 1, "board_type": 0,
"board_type": 64, "exposure": 26000,
"exposure": 1600, "folder": ".\\testimg\\",
"folder": "G:\\重庆捷力\\NG\\2\\PA131Q\\",
"format": "GRAY8", "format": "GRAY8",
"gain": 8, "gain": 8,
"id": 1, "height": 1944,
"id": 2,
"loop": 1, "loop": 1,
"rely_on_camera": "", "rely_on_camera": "",
"save": 0, "save": 0,
"save_img_suffix": ".BMP", "save_img_suffix": ".BMP",
"savefile_rgb_swapped": false, "showname": "工位2",
"showname": "工位1", "type": 120,
"type": 100, "width": 2592,
"zoom": 1 "zoom": 1
}, },
"DMK 33GP031 2814182": { "MV-CA050-10GC 00C27808759": {
"algorithm": 0, "algorithm": 0,
"algorithm_dll": 0, "board_num": 0,
"board_num": 1, "board_type": 0,
"board_type": 64, "exposure": 160000,
"exposure": 1600, "folder": "G:\\重庆捷力\\NG\\2\\PA131Q\\",
"folder": "H:\\download\\重庆捷力\\图片\\1\\AANN-HG\\",
"format": "GRAY8", "format": "GRAY8",
"gain": 8, "gain": 8,
"id": 2, "height": 960,
"id": 1,
"loop": 1, "loop": 1,
"rely_on_camera": "", "rely_on_camera": "",
"save": 0, "save": 0,
"save_img_suffix": ".BMP", "save_img_suffix": ".BMP",
"savefile_rgb_swapped": false, "showname": "工位1",
"showname": "工位2", "type": 140,
"type": 100, "width": 1280,
"zoom": 1 "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
}
} }
} }

@ -114,11 +114,11 @@ void CCameraHik::InitProperty()
if (m_hDevice != nullptr&&m_pCamOpt != nullptr) if (m_hDevice != nullptr&&m_pCamOpt != nullptr)
{ {
int nRet = 0; int nRet = 0;
nRet = MV_CC_SetWidth(m_hDevice, m_pCamOpt->width); // nRet = MV_CC_SetWidth(m_hDevice, m_pCamOpt->width);
nRet = MV_CC_SetHeight(m_hDevice, m_pCamOpt->height); // nRet = MV_CC_SetHeight(m_hDevice, m_pCamOpt->height);
nRet = MV_CC_SetExposureTime(m_hDevice, m_pCamOpt->exposure); nRet = MV_CC_SetExposureTime(m_hDevice, m_pCamOpt->exposure);
nRet = MV_CC_SetGain(m_hDevice, m_pCamOpt->gain); 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);
} }
} }

@ -315,6 +315,10 @@ bool CCameraGige::ISetProperty(TP_CAMERA_PROPERTY* pCamProperty)
m_nExposure = m_pCamOpt->exposure = pCamProperty->value; m_nExposure = m_pCamOpt->exposure = pCamProperty->value;
setExposure(m_pCamOpt->exposure); setExposure(m_pCamOpt->exposure);
break; break;
case TP_CAM_PROPERTY_GAIN:
m_nGain = pCamProperty->value;
setGain(m_nGain);
break;
default: default:
break; break;
} }

@ -91,9 +91,9 @@ CMainWin::CMainWin(QWidget *parent)
bool bOpen = m_pSerialPort->OpenCom(strDefaultPort, QString::number(baut)); bool bOpen = m_pSerialPort->OpenCom(strDefaultPort, QString::number(baut));
if (bOpen == false) 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); // 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.setWindowIcon(QIcon(LEAPER_LOGO));
infobox.exec(); // infobox.exec();
} }
connect(&m_HeartBit, SIGNAL(timeout()), this, SLOT(onHeardBit())); connect(&m_HeartBit, SIGNAL(timeout()), this, SLOT(onHeardBit()));
m_HeartBit.start(300); m_HeartBit.start(300);

@ -60,8 +60,8 @@ Q_SLOT void QCamSetDlg::onButtonClicked()
{ {
// m_pCorl->IOpenCamera(m_curCamKey); // m_pCorl->IOpenCamera(m_curCamKey);
// m_pCorl->IStartCamera(m_curCamKey); // m_pCorl->IStartCamera(m_curCamKey);
m_pCorl->IRunAlg(m_curCamKey, false); //m_pCorl->IRunAlg(m_curCamKey, false);
// m_pCorl->ISnapImage(QStringList()<<m_curCamKey); m_pCorl->ISnapImage(QStringList()<<m_curCamKey);
} }
else if ("pushButton_3" == strObj)//应用 else if ("pushButton_3" == strObj)//应用

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>841</width> <width>841</width>
<height>484</height> <height>486</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -88,7 +88,7 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>打开</string> <string>软触发一次</string>
</property> </property>
</widget> </widget>
</item> </item>

Loading…
Cancel
Save