diff --git a/doc/~$盘点客户端与web端通信协议(普洱,石家庄).docx b/doc/~$盘点客户端与web端通信协议(普洱,石家庄).docx index 83fab46..f4986bb 100644 Binary files a/doc/~$盘点客户端与web端通信协议(普洱,石家庄).docx and b/doc/~$盘点客户端与web端通信协议(普洱,石家庄).docx differ diff --git a/runner17/Release/smokeBox.exe b/runner17/Release/smokeBox.exe index ef61bd0..13da305 100644 Binary files a/runner17/Release/smokeBox.exe and b/runner17/Release/smokeBox.exe differ diff --git a/runner17/Release/smokeBox.pdb b/runner17/Release/smokeBox.pdb index ba17110..5804ebb 100644 Binary files a/runner17/Release/smokeBox.pdb and b/runner17/Release/smokeBox.pdb differ diff --git a/src/CameraControl.cpp b/src/CameraControl.cpp index 45030a9..fbfc3a2 100644 --- a/src/CameraControl.cpp +++ b/src/CameraControl.cpp @@ -426,6 +426,19 @@ bool CameraControl::setSoftwareTrigger(const QString& serialNumber) return m_vecPCamera[index]->setTriggerSource(SOFTWARE); } + +bool CameraControl::setExposure(const QString& serialNumber, int exposure) +{ + QMap::iterator iter = m_mapSNIndex.find(serialNumber); + if (iter == m_mapSNIndex.end()) + { + qWarning() << "Do not find " << serialNumber; + return false; + } + int index = iter.value(); + return m_vecPCamera[index]->setExposure(exposure); +} + bool CameraControl::capture(const QString& serialNumber, cv::Mat& img, cv::Mat& img3D, int exposure) { QMap::iterator iter = m_mapSNIndex.find(serialNumber); @@ -549,29 +562,26 @@ void CameraControl::capture(const QStringList& serialNumberList, int location, i rotationAngle = m_mapIdCameraInfoSide.value(id).rotationAngle; } - ////12õ㣨1-3㣩عֵ250000ms/20 - ////㣨4-6㣩عֵ150000ms/20 - ////㣨7-9㣩عֵ50000ms/20 - //if (floor!=0) - //{ - // int exposure = 0; - // double gain = 0; - // if (floor >= 1 && floor <= 3) - // { - // exposure = 250000; - // } - // else if (floor >= 7 && floor <= 9) - // { - // exposure = 50000; - // } - // else - // { - // exposure = 150000; - // } - - //} - - + //12õ㣨1-3㣩عֵ250000ms/20 + //㣨4-6㣩عֵ150000ms/20 + //㣨7-9㣩عֵ50000ms/20 + int exposure = 0; + if (floor!=0) + { + if (floor >= 1 && floor <= 3) + { + exposure = 250000; + } + else if (floor >= 7 && floor <= 9) + { + exposure = 50000; + } + else + { + exposure = 150000; + } + } + setExposure(serialNumber, exposure); if (!capture(serialNumber, imgInfo.image, imgInfo.image3D, floor)) { diff --git a/src/CameraControl.h b/src/CameraControl.h index b5bce2b..1865a66 100644 --- a/src/CameraControl.h +++ b/src/CameraControl.h @@ -64,6 +64,7 @@ public: bool startCamera(const QString& serialNumber); bool stopCamera(const QString& serialNumber); bool setSoftwareTrigger(const QString& serialNumber); + bool setExposure(const QString& serialNumber,int exposure); Q_SLOT void onCapture(int cameraLocation,int location, int floor); diff --git a/src/HikCamera.cpp b/src/HikCamera.cpp index 708aa36..fd75df6 100644 --- a/src/HikCamera.cpp +++ b/src/HikCamera.cpp @@ -292,7 +292,7 @@ void HikCamera::destroyCamera() } bool HikCamera::setExposure(int exposure) { - return true; + return setCameraProperty(ExposureTime, exposure); } bool HikCamera::setGain(double gain) {