完善现有功能
This commit is contained in:
@@ -310,7 +310,10 @@ bool simpleCorrection(correctionStruct* correctionData, CorrectionPoints& result
|
||||
for (auto zData : correctionData->in_Z_X0Y)
|
||||
sum += zData;
|
||||
for (auto zData : correctionData->in_Z_X0Y_Value)
|
||||
sum += zData;
|
||||
{
|
||||
if(zData > -100)
|
||||
sum += zData;
|
||||
}
|
||||
result.OriginZ = sum / 3;
|
||||
}
|
||||
//X
|
||||
@@ -319,7 +322,10 @@ bool simpleCorrection(correctionStruct* correctionData, CorrectionPoints& result
|
||||
for (auto xData : correctionData->in_X_Y0Z)
|
||||
sum += xData;
|
||||
for (auto xData : correctionData->in_X_Y0Z_Value)
|
||||
sum += xData;
|
||||
{
|
||||
if (xData > -100)
|
||||
sum += xData;
|
||||
}
|
||||
result.OriginX = sum / 3;
|
||||
}
|
||||
//Y
|
||||
@@ -328,17 +334,24 @@ bool simpleCorrection(correctionStruct* correctionData, CorrectionPoints& result
|
||||
for (auto yData : correctionData->in_Y_X0Z)
|
||||
sum += yData;
|
||||
for (auto yData : correctionData->in_Y_X0Z_Value)
|
||||
sum += yData;
|
||||
if (yData > -100)
|
||||
sum += yData;
|
||||
result.OriginY = sum / 3;
|
||||
}
|
||||
if (result.OriginZ < -1000 || result.OriginX < -1000 || result.OriginY < -1000)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
double offsetLimit(double valueIn,double offsetLimitIn)
|
||||
{
|
||||
valueIn = (valueIn < -offsetLimitIn) ? -offsetLimitIn : valueIn;
|
||||
valueIn = (valueIn > offsetLimitIn) ? offsetLimitIn : valueIn;
|
||||
return valueIn;
|
||||
}
|
||||
void ALGO_Correction(std::shared_ptr <detData> data)
|
||||
{
|
||||
data->writeBack("short", 274, "1");
|
||||
return;
|
||||
//data->writeBack("short", 274, "1");
|
||||
//return;
|
||||
CorrectionPoints resultPoints;
|
||||
bool correctionResult = simpleCorrection(&data->laserData, resultPoints);
|
||||
std::cout << "correctionResult_X" << resultPoints.OriginX << std::endl;
|
||||
@@ -373,6 +386,22 @@ void ALGO_Correction(std::shared_ptr <detData> data)
|
||||
std::cout << "correctionFinalResultY" << correctionFinalResultY << std::endl;
|
||||
std::cout << "correctionFinalResultZ" << correctionFinalResultZ << std::endl;
|
||||
|
||||
correctionFinalResultX = doubleLmit(correctionFinalResultX, 3);
|
||||
correctionFinalResultY = doubleLmit(correctionFinalResultY, 3);
|
||||
correctionFinalResultZ = doubleLmit(correctionFinalResultZ, 3);
|
||||
|
||||
std::cout << "correctionFinalResultX" << correctionFinalResultX << std::endl;
|
||||
std::cout << "correctionFinalResultY" << correctionFinalResultY << std::endl;
|
||||
std::cout << "correctionFinalResultZ" << correctionFinalResultZ << std::endl;
|
||||
|
||||
correctionFinalResultX = offsetLimit(correctionFinalResultX, offsetLimit_X);
|
||||
correctionFinalResultY = offsetLimit(correctionFinalResultY, offsetLimit_Y);
|
||||
correctionFinalResultZ = offsetLimit(correctionFinalResultZ, offsetLimit_Z);
|
||||
|
||||
std::cout << "correctionFinalResultX" << correctionFinalResultX << std::endl;
|
||||
std::cout << "correctionFinalResultY" << correctionFinalResultY << std::endl;
|
||||
std::cout << "correctionFinalResultZ" << correctionFinalResultZ << std::endl;
|
||||
|
||||
//double offsetRx = data->_productDataStruct.baseRad[0] - point.x;
|
||||
//double offsetRy = data->_productDataStruct.baseRad[1] - point.y;
|
||||
//double offsetRz = data->_productDataStruct.baseRad[2] - point.z;
|
||||
|
||||
@@ -396,7 +396,7 @@ public:
|
||||
pack.armPos = data->armPos;
|
||||
cvMatToQPixMap(data->resultImgs[0], pack.img);
|
||||
emit _core._qtFunc.uiModuleImageDoubleCheckQdialog_ShowWindows(pack);
|
||||
pack.type = 2;
|
||||
pack.type = 1;
|
||||
}
|
||||
|
||||
if (data->halconOK == true)
|
||||
@@ -407,7 +407,7 @@ public:
|
||||
pack.armPos = data->armPos;
|
||||
cvMatToQPixMap(data->resultImgs[1], pack.img);
|
||||
emit _core._qtFunc.uiModuleImageDoubleCheckQdialog_ShowWindows(pack);
|
||||
pack.type = 1;
|
||||
pack.type = 0;
|
||||
}
|
||||
if (finalOk == true)
|
||||
emit _core._qtFunc.uiModuleLocationMap_SetProductSignStatus(data->armPos, 2);
|
||||
@@ -541,6 +541,7 @@ public slots:
|
||||
_triggerManager.sendFinsMsg("write_short_351_1");
|
||||
|
||||
qDebug() << "SN:" << SN << "开始运行,型号->" << QString::fromStdString(_core._detGlobalData.productTypeStr);
|
||||
std::cout << "SN:" << SN.toStdString() << "开始运行,型号->" << _core._detGlobalData.productTypeStr <<std::endl;
|
||||
|
||||
}
|
||||
//人工复判按下NG
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include<handleAiModelList.hpp>
|
||||
#include <handleAiModel.h>
|
||||
|
||||
#define enableHandleAiModel 0
|
||||
#define enableHandleAiModel 1
|
||||
void handleAiModelManager::handleAiModelManager::run()
|
||||
{
|
||||
if (init == true)
|
||||
|
||||
@@ -168,6 +168,7 @@ public slots:
|
||||
if (disableTextChange == false)
|
||||
startBtn->setText("运行");
|
||||
snIntputLine->setDisabled(false);
|
||||
partNumberIntputLine->setDisabled(false);
|
||||
std::cout << "按下软件运行" << std::endl;
|
||||
}
|
||||
else
|
||||
@@ -176,6 +177,7 @@ public slots:
|
||||
if (disableTextChange == false)
|
||||
startBtn->setText("急停");
|
||||
snIntputLine->setDisabled(true);
|
||||
partNumberIntputLine->setDisabled(true);
|
||||
std::cout << "按下软件急停" << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -197,6 +199,7 @@ private slots:
|
||||
startBtn->setEnabled(true);
|
||||
indexFromPartNumber = index;
|
||||
snIntputLine->setFocus();
|
||||
emit switchProductSignal(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user