|
|
|
@ -46,6 +46,7 @@ bool CameraControl::readCameraConfig(QString filePath)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_mapIdCameraInfoSide.clear();
|
|
|
|
m_mapIdCameraInfoSide.clear();
|
|
|
|
m_mapIdCameraInfoTop.clear();
|
|
|
|
m_mapIdCameraInfoTop.clear();
|
|
|
|
|
|
|
|
exposureRowMap.clear();
|
|
|
|
m_mapSerialNumberIdSide.clear();
|
|
|
|
m_mapSerialNumberIdSide.clear();
|
|
|
|
m_mapSerialNumberIdTop.clear();
|
|
|
|
m_mapSerialNumberIdTop.clear();
|
|
|
|
|
|
|
|
|
|
|
|
@ -119,6 +120,38 @@ bool CameraControl::readCameraConfig(QString filePath)
|
|
|
|
qWarning() << "side id error";
|
|
|
|
qWarning() << "side id error";
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//根据文档读取,没有则采用默认值如下
|
|
|
|
|
|
|
|
//现在1和2巷道都是用的下三层(1-3层)曝光值250000ms/增益20,
|
|
|
|
|
|
|
|
//中三层(4-6层)曝光值150000ms/增益20,
|
|
|
|
|
|
|
|
//上三层(7-9层)曝光值50000ms/增益20
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QJsonObject exposureRowObj = jsonObj.value("exposureRowMap").toObject();
|
|
|
|
|
|
|
|
if (!exposureRowObj.isEmpty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for each (QString key in exposureRowObj.keys()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exposureRowMap[key.toInt()] = exposureRowObj.value(key).toInt();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for (int floor = 1; floor <= 9; floor++) {
|
|
|
|
|
|
|
|
int exposure = 2500;
|
|
|
|
|
|
|
|
if (floor >= 1 && floor <= 3)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
exposure = 250000;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (floor >= 7 && floor <= 9)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
exposure = 50000;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
exposure = 150000;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
exposureRowMap[floor] = exposure;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QJsonObject devicesObj = jsonObj.value("devices").toObject();
|
|
|
|
QJsonObject devicesObj = jsonObj.value("devices").toObject();
|
|
|
|
if (!devicesObj.isEmpty()) {
|
|
|
|
if (!devicesObj.isEmpty()) {
|
|
|
|
@ -178,6 +211,7 @@ bool CameraControl::readCameraConfig(QString filePath)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -261,6 +295,7 @@ bool CameraControl::loadCamera(const QList<CameraInfo>& cameraInfoList)
|
|
|
|
else if (cameraType == CameraType::LXTof)
|
|
|
|
else if (cameraType == CameraType::LXTof)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Camera* pLXCamera = new LXCamera();
|
|
|
|
Camera* pLXCamera = new LXCamera();
|
|
|
|
|
|
|
|
|
|
|
|
if (pLXCamera->initCamera(serialNumber))
|
|
|
|
if (pLXCamera->initCamera(serialNumber))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_vecPCamera.push_back(pLXCamera);
|
|
|
|
m_vecPCamera.push_back(pLXCamera);
|
|
|
|
@ -369,6 +404,7 @@ bool CameraControl::setSoftwareTrigger(const QStringList& serialNumberList)
|
|
|
|
bool CameraControl::openCamera(const QString& serialNumber)
|
|
|
|
bool CameraControl::openCamera(const QString& serialNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QMap<QString, int>::iterator iter = m_mapSNIndex.find(serialNumber);
|
|
|
|
QMap<QString, int>::iterator iter = m_mapSNIndex.find(serialNumber);
|
|
|
|
|
|
|
|
qInfo() << "openCamera sid: " << serialNumber << " index:" << iter.value();
|
|
|
|
if (iter == m_mapSNIndex.end())
|
|
|
|
if (iter == m_mapSNIndex.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
qWarning() << "Do not find " << serialNumber;
|
|
|
|
qWarning() << "Do not find " << serialNumber;
|
|
|
|
@ -425,7 +461,10 @@ bool CameraControl::setSoftwareTrigger(const QString& serialNumber)
|
|
|
|
int index = iter.value();
|
|
|
|
int index = iter.value();
|
|
|
|
return m_vecPCamera[index]->setTriggerSource(SOFTWARE);
|
|
|
|
return m_vecPCamera[index]->setTriggerSource(SOFTWARE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int CameraControl::getDeviceId(const QString& serialNumber) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return m_mapSerialNumberIdSide.value(serialNumber);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CameraControl::setExposure(const QString& serialNumber, int exposure)
|
|
|
|
bool CameraControl::setExposure(const QString& serialNumber, int exposure)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -565,22 +604,8 @@ void CameraControl::capture(const QStringList& serialNumberList, int location, i
|
|
|
|
//现在1和2巷道都是用的下三层(1-3层)曝光值250000ms/增益20,
|
|
|
|
//现在1和2巷道都是用的下三层(1-3层)曝光值250000ms/增益20,
|
|
|
|
//中三层(4-6层)曝光值150000ms/增益20,
|
|
|
|
//中三层(4-6层)曝光值150000ms/增益20,
|
|
|
|
//上三层(7-9层)曝光值50000ms/增益20
|
|
|
|
//上三层(7-9层)曝光值50000ms/增益20
|
|
|
|
int exposure = 0;
|
|
|
|
int exposure = exposureRowMap[floor];
|
|
|
|
if (floor!=0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (floor >= 1 && floor <= 3)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
exposure = 250000;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (floor >= 7 && floor <= 9)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
exposure = 50000;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
exposure = 150000;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
setExposure(serialNumber, exposure);
|
|
|
|
setExposure(serialNumber, exposure);
|
|
|
|
|
|
|
|
|
|
|
|
if (!capture(serialNumber, imgInfo.image, imgInfo.image3D, floor))
|
|
|
|
if (!capture(serialNumber, imgInfo.image, imgInfo.image3D, floor))
|
|
|
|
|