优化结构

This commit is contained in:
2024-08-14 15:56:29 +08:00
parent c69dd16b27
commit bfb0b8064c
15 changed files with 619 additions and 16 deletions
@@ -3,7 +3,7 @@
#include <Inspection_apexSmall.hpp>
#include <simpleAlgo.h>
#include <CISCO_struct.hpp>
static double pixACC = 0.01;
static double apexSmallpixACC = 0.01;
//输入det切出的连接器图片
cv::Size apexSmallMinPin(30, 30), apexSmallMaxPin(400, 400);
static void apexSmallHalconPaint(cv::Mat& out, std::vector<startAndEndPoints>xLines, const std::vector<cv::Rect>& AllPinsPos, const std::vector<rectAndResult>& AllPos, double& maxRange)
@@ -29,7 +29,7 @@ static void apexSmallHalconPaint(cv::Mat& out, std::vector<startAndEndPoints>xLi
for (auto& rectIn : groupedRectangles[i])
{
cv::Point mid(rectIn.rect.x, rectIn.rect.y);
double range = pointToLineDistance(mid, xLines[i].start, xLines[i].end) * pixACC;
double range = pointToLineDistance(mid, xLines[i].start, xLines[i].end) * apexSmallpixACC;
maxRange = max(maxRange, range);
cv::Rect rect(rectIn.rect.x - rectIn.rect.width / 2, rectIn.rect.y - rectIn.rect.height / 2, rectIn.rect.width, rectIn.rect.height);
cv::Scalar scolor;
@@ -50,7 +50,7 @@ static void apexSmallHalconPaint(cv::Mat& out, std::vector<startAndEndPoints>xLi
for (auto& rectIn : PinGroupedRectangles[i])
{
cv::Point mid(rectIn.x, rectIn.y);
double range = pointToLineDistance(mid, xLines[i].start, xLines[i].end) * pixACC;
double range = pointToLineDistance(mid, xLines[i].start, xLines[i].end) * apexSmallpixACC;
maxRange = max(maxRange, range);
cv::Rect rect(rectIn.x - rectIn.width / 2, rectIn.y - rectIn.height / 2, rectIn.width, rectIn.height);
cv::Scalar scolor = cv::Scalar(0, 255, 0);
@@ -93,7 +93,7 @@ void sqlManager::initialization(appConfig* _appConfig,std::string dataBasePath,
std::cout << "SQL runing Init..." << std::endl;
dbPtr = new sqliteModule(dataBasePath);//初始化
dbPtr->backup(dataBasePath + getCurrentDate() + ".db");//备份
std::vector<std::string>tables = getFutureDates(180);
std::vector<std::string>tables = getFutureDates(30);
//整合所需要的数据名
std::vector<std::string>dataStr;
@@ -160,7 +160,10 @@ bool sqlManager::addData(std::string SN,std::vector<sqlData> data)
if (res.customType == sqlFalse)
{
for (auto keyName : data)
{
dbPtr->addColumn(currentTableName, keyName.key, "text");
std::cout << "new col insert" << keyName.key << std::endl;
}
dbPtr->Insert(currentTableName, SN, data);
}
mutex.unlock();
+1 -1
View File
@@ -10,7 +10,7 @@
#include <qtimer.h>
#define disableBackEndCheck 0
#define disableBackEndCheck 1
#define disableeAlgo 0
#define enableHideConsle 1
class detGlobalData
@@ -1,6 +0,0 @@
#include <appCoreQtFunction.h>
void qtFunction::productDetEnded()
{
}
@@ -4,8 +4,6 @@
class qtFunction :public QObject
{
Q_OBJECT
public slots:
void productDetEnded();//整个检测流程结束
signals:
void sendErrorToMainwindow(backEndError);
void sendPixmapImageWidget(showImgPack*);
@@ -11,7 +11,7 @@ public:
backContinueDetDialog()
{
timer = new QTimer(this);
_fancyWarnWindow = new fancyWarnWindow(fancyWarnWindow::tip, "是否继续背面检测", "", true);
_fancyWarnWindow = new fancyWarnWindow(fancyWarnWindow::tip, "是否继续背面检测", "", false);
_fancyWarnWindow->disableHideAfterClicked();
_fancyWarnWindow->hide();
QObject::connect(_fancyWarnWindow->continueBtn, &QPushButton::clicked, this, &backContinueDetDialog::continueClicked);
@@ -27,6 +27,277 @@
"codedAlgoIndex":-1,
"HandleAi":
{
},
"productSign": {
"1": {
"x": 1565,
"y": 20,
"w": 300,
"h": 170,
"sign": "列1行1"
},
"2": {
"x": 1300,
"y": 20,
"w": 300,
"h": 170,
"sign": "列2行1"
},
"3": {
"x": 1050,
"y": 20,
"w": 300,
"h": 170,
"sign": "列3行1"
},
"4": {
"x": 600,
"y": 20,
"w": 300,
"h": 170,
"sign": "列4行1"
},
"5": {
"x": 330,
"y": 20,
"w": 300,
"h": 170,
"sign": "列5行1"
},
"6": {
"x": 55,
"y": 20,
"w": 300,
"h": 170,
"sign": "列6行1"
},
"7": {
"x": 1565,
"y": 330,
"w": 300,
"h": 170,
"sign": "列1行2"
},
"8": {
"x": 1300,
"y": 330,
"w": 300,
"h": 170,
"sign": "列2行2"
},
"9": {
"x": 1050,
"y": 330,
"w": 300,
"h": 170,
"sign": "列3行2"
},
"10": {
"x": 600,
"y": 330,
"w": 300,
"h": 170,
"sign": "列4行2"
},
"11": {
"x": 330,
"y": 330,
"w": 300,
"h": 170,
"sign": "列5行2"
},
"12": {
"x": 55,
"y": 330,
"w": 300,
"h": 170,
"sign": "列6行2"
},
"13": {
"x": 90,
"y": 575,
"w": 220,
"h": 210,
"sign": "列1行3"
},
"14": {
"x": 300,
"y": 575,
"w": 240,
"h": 210,
"sign": "列2行3"
},
"15": {
"x": 550,
"y": 575,
"w": 240,
"h": 210,
"sign": "列3行3"
},
"16": {
"x": 800,
"y": 575,
"w": 240,
"h": 210,
"sign": "列4行3"
},
"17": {
"x": 1050,
"y": 575,
"w": 240,
"h": 210,
"sign": "列5行3"
},
"18": {
"x": 1300,
"y": 575,
"w": 240,
"h": 210,
"sign": "列6行3"
}
,
"19": {
"x": 1550,
"y": 575,
"w": 240,
"h": 210,
"sign": "列7行3"
},
"20": {
"x": 90,
"y": 880,
"w": 220,
"h": 210,
"sign": "列1行4"
},
"21": {
"x": 300,
"y": 880,
"w": 240,
"h": 210,
"sign": "列2行4"
},
"22": {
"x": 550,
"y": 880,
"w": 240,
"h": 210,
"sign": "列3行4"
},
"23": {
"x": 800,
"y": 880,
"w": 240,
"h": 210,
"sign": "列4行4"
},
"24": {
"x": 1050,
"y": 880,
"w": 240,
"h": 210,
"sign": "列5行4"
},
"25": {
"x": 1300,
"y": 880,
"w": 240,
"h": 210,
"sign": "列6行4"
}
,
"26": {
"x": 1550,
"y": 880,
"w": 240,
"h": 210,
"sign": "列7行4"
},
"27": {
"x": 1565,
"y": 1230,
"w": 300,
"h": 170,
"sign": "列1行5"
},
"28": {
"x": 1300,
"y": 1230,
"w": 300,
"h": 170,
"sign": "列2行5"
},
"29": {
"x": 1050,
"y": 1230,
"w": 300,
"h": 170,
"sign": "列3行5"
},
"30": {
"x": 600,
"y": 1230,
"w": 300,
"h": 170,
"sign": "列4行5"
},
"31": {
"x": 330,
"y": 1230,
"w": 300,
"h": 170,
"sign": "列5行5"
},
"32": {
"x": 55,
"y": 1230,
"w": 300,
"h": 170,
"sign": "列6行5"
},
"33": {
"x": 1565,
"y": 1520,
"w": 300,
"h": 170,
"sign": "列1行6"
},
"34": {
"x": 1300,
"y": 1520,
"w": 300,
"h": 170,
"sign": "列2行6"
},
"35": {
"x": 1050,
"y": 1520,
"w": 300,
"h": 170,
"sign": "列3行6"
},
"36": {
"x": 600,
"y": 1520,
"w": 300,
"h": 170,
"sign": "列4行6"
},
"37": {
"x": 330,
"y": 1520,
"w": 300,
"h": 170,
"sign": "列5行6"
},
"38": {
"x": 55,
"y": 1520,
"w": 300,
"h": 170,
"sign": "列6行6"
}
}
+339 -2
View File
@@ -45,7 +45,344 @@
}
}
]
}
},
"productSign": {
"1": {
"x": 1305,
"y": 10,
"w": 150,
"h": 160,
"sign": "列1行1"
},
"2": {
"x": 1305,
"y": 170,
"w": 150,
"h": 160,
"sign": "列1行2"
},
"3": {
"x": 1305,
"y": 330,
"w": 150,
"h": 160,
"sign": "列1行3"
},
"4": {
"x": 1305,
"y": 490,
"w": 150,
"h": 160,
"sign": "列1行4"
},
"5": {
"x": 1305,
"y": 650,
"w": 150,
"h": 160,
"sign": "列1行5"
},
"6": {
"x": 1305,
"y": 810,
"w": 150,
"h": 160,
"sign": "列1行6"
},
"7": {
"x": 1305,
"y": 970,
"w": 150,
"h": 160,
"sign": "列1行7"
},
"8": {
"x": 1305,
"y": 1130,
"w": 150,
"h": 160,
"sign": "列1行8"
},
"9": {
"x": 1095,
"y": 1130,
"w": 150,
"h": 160,
"sign": "列2行8"
},
"10": {
"x": 1095,
"y": 970,
"w": 150,
"h": 160,
"sign": "列2行7"
},
"11": {
"x": 1095,
"y": 810,
"w": 150,
"h": 160,
"sign": "列2行6"
},
"12": {
"x": 1095,
"y": 650,
"w": 150,
"h": 160,
"sign": "列2行5"
},
"13": {
"x": 1095,
"y": 490,
"w": 150,
"h": 160,
"sign": "列2行4"
},
"14": {
"x": 1095,
"y": 330,
"w": 150,
"h": 160,
"sign": "列2行3"
},
"15": {
"x": 1095,
"y": 170,
"w": 150,
"h": 160,
"sign": "列2行2"
},
"16": {
"x": 1095,
"y": 10,
"w": 150,
"h": 160,
"sign": "列2行1"
},
"17": {
"x": 875,
"y": 10,
"w": 150,
"h": 160,
"sign": "列3行1"
},
"18": {
"x": 875,
"y": 170,
"w": 150,
"h": 160,
"sign": "列3行2"
},
"19": {
"x": 875,
"y": 330,
"w": 150,
"h": 160,
"sign": "列3行3"
},
"20": {
"x": 875,
"y": 490,
"w": 150,
"h": 160,
"sign": "列3行4"
},
"21": {
"x": 875,
"y": 650,
"w": 150,
"h": 160,
"sign": "列3行5"
},
"22": {
"x": 875,
"y": 810,
"w": 150,
"h": 160,
"sign": "列3行6"
},
"23": {
"x": 875,
"y": 970,
"w": 150,
"h": 160,
"sign": "列3行7"
},
"24": {
"x": 875,
"y": 1130,
"w": 150,
"h": 160,
"sign": "列3行8"
},
"25": {
"x": 655,
"y": 1130,
"w": 150,
"h": 160,
"sign": "列4行8"
},
"26": {
"x": 655,
"y": 970,
"w": 150,
"h": 160,
"sign": "列4行7"
},
"27": {
"x": 655,
"y": 810,
"w": 150,
"h": 160,
"sign": "列4行6"
},
"28": {
"x": 655,
"y": 650,
"w": 150,
"h": 160,
"sign": "列4行5"
},
"29": {
"x": 655,
"y": 490,
"w": 150,
"h": 160,
"sign": "列4行4"
},
"30": {
"x": 655,
"y": 330,
"w": 150,
"h": 160,
"sign": "列4行3"
},
"31": {
"x": 655,
"y": 170,
"w": 150,
"h": 160,
"sign": "列4行2"
},
"32": {
"x": 655,
"y": 10,
"w": 150,
"h": 160,
"sign": "列4行1"
},
"33": {
"x": 405,
"y": 10,
"w": 150,
"h": 160,
"sign": "列5行1"
},
"34": {
"x": 405,
"y": 170,
"w": 150,
"h": 160,
"sign": "列5行2"
},
"35": {
"x": 405,
"y": 330,
"w": 150,
"h": 160,
"sign": "列5行3"
},
"36": {
"x": 405,
"y": 490,
"w": 150,
"h": 160,
"sign": "列5行4"
},
"37": {
"x": 405,
"y": 650,
"w": 150,
"h": 160,
"sign": "列5行5"
},
"38": {
"x": 405,
"y": 810,
"w": 150,
"h": 160,
"sign": "列5行6"
},
"39": {
"x": 405,
"y": 970,
"w": 150,
"h": 160,
"sign": "列5行7"
},
"40": {
"x": 405,
"y": 1130,
"w": 150,
"h": 160,
"sign": "列5行8"
},
"41": {
"x": 155,
"y": 1130,
"w": 150,
"h": 160,
"sign": "列6行1"
},
"42": {
"x": 155,
"y": 970,
"w": 150,
"h": 160,
"sign": "列6行2"
},
"43": {
"x": 155,
"y": 810,
"w": 150,
"h": 160,
"sign": "列6行3"
},
"44": {
"x": 155,
"y": 650,
"w": 150,
"h": 160,
"sign": "列6行4"
},
"45": {
"x": 155,
"y": 490,
"w": 150,
"h": 160,
"sign": "列6行5"
},
"46": {
"x": 155,
"y": 330,
"w": 150,
"h": 160,
"sign": "列6行6"
},
"47": {
"x": 155,
"y": 170,
"w": 150,
"h": 160,
"sign": "列6行7"
},
"48": {
"x": 155,
"y": 10,
"w": 150,
"h": 160,
"sign": "列6行8"
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.