|
|
|
@ -29,7 +29,7 @@ valueMainUI::valueMainUI(QWidget *parent)
|
|
|
|
|
|
|
|
|
|
|
|
setupTrayIcon();//后台任务栏初始化
|
|
|
|
setupTrayIcon();//后台任务栏初始化
|
|
|
|
setWindowIcon(QIcon(WINDOWICON));
|
|
|
|
setWindowIcon(QIcon(WINDOWICON));
|
|
|
|
setWindowTitle(tr("识别定位一体检测系统(v1.0.8 21.12.09)"));
|
|
|
|
setWindowTitle(tr("识别定位一体检测系统(v1.0.9 21.12.10)"));
|
|
|
|
lpGlobalData::instance();
|
|
|
|
lpGlobalData::instance();
|
|
|
|
lpConfig::instance()->loadConfig();
|
|
|
|
lpConfig::instance()->loadConfig();
|
|
|
|
|
|
|
|
|
|
|
|
@ -228,13 +228,13 @@ Q_SLOT void valueMainUI::onRecvDataStr_A(const QJsonObject& json)
|
|
|
|
double cnt_x = json.value("center_x").toDouble();
|
|
|
|
double cnt_x = json.value("center_x").toDouble();
|
|
|
|
double cnt_y = json.value("center_y").toDouble();
|
|
|
|
double cnt_y = json.value("center_y").toDouble();
|
|
|
|
int resultType = json.value("resultType").toInt(-1);
|
|
|
|
int resultType = json.value("resultType").toInt(-1);
|
|
|
|
QString strPath = json.value("imagePath").toString();
|
|
|
|
/*QString strPath = json.value("imagePath").toString();
|
|
|
|
QString strBase64 = json.value("imageData_base64").toString();
|
|
|
|
QString strBase64 = json.value("imageData_base64").toString();
|
|
|
|
QByteArray imgbase64 = strBase64.toUtf8();
|
|
|
|
QByteArray imgbase64 = strBase64.toUtf8();
|
|
|
|
QImage newImg;
|
|
|
|
QImage newImg;
|
|
|
|
QByteArray imgArr = QByteArray::fromBase64(imgbase64);
|
|
|
|
QByteArray imgArr = QByteArray::fromBase64(imgbase64);
|
|
|
|
newImg.loadFromData(imgArr);
|
|
|
|
newImg.loadFromData(imgArr);
|
|
|
|
m_ImgViewer_A->setImg(newImg);
|
|
|
|
m_ImgViewer_A->setImg(newImg);*/
|
|
|
|
|
|
|
|
|
|
|
|
QString sMsg = QString("%1 : %2->Score:%3 Angle:%4 Center:(%5,%6)")
|
|
|
|
QString sMsg = QString("%1 : %2->Score:%3 Angle:%4 Center:(%5,%6)")
|
|
|
|
.arg(QDateTime::currentDateTime().toString("hh:mm:ss"))
|
|
|
|
.arg(QDateTime::currentDateTime().toString("hh:mm:ss"))
|
|
|
|
@ -316,13 +316,13 @@ Q_SLOT void valueMainUI::onRecvDataStr_B(const QJsonObject& json)
|
|
|
|
double cnt_x = json.value("center_x").toDouble();
|
|
|
|
double cnt_x = json.value("center_x").toDouble();
|
|
|
|
double cnt_y = json.value("center_y").toDouble();
|
|
|
|
double cnt_y = json.value("center_y").toDouble();
|
|
|
|
int resultType = json.value("resultType").toInt(-1);
|
|
|
|
int resultType = json.value("resultType").toInt(-1);
|
|
|
|
QString strPath = json.value("imagePath").toString();
|
|
|
|
/*QString strPath = json.value("imagePath").toString();
|
|
|
|
QString strBase64 = json.value("imageData_base64").toString();
|
|
|
|
QString strBase64 = json.value("imageData_base64").toString();
|
|
|
|
QByteArray imgbase64 = strBase64.toUtf8();
|
|
|
|
QByteArray imgbase64 = strBase64.toUtf8();
|
|
|
|
QImage newImg;
|
|
|
|
QImage newImg;
|
|
|
|
QByteArray imgArr = QByteArray::fromBase64(imgbase64);
|
|
|
|
QByteArray imgArr = QByteArray::fromBase64(imgbase64);
|
|
|
|
newImg.loadFromData(imgArr);
|
|
|
|
newImg.loadFromData(imgArr);
|
|
|
|
m_ImgViewer_B->setImg(newImg);
|
|
|
|
m_ImgViewer_B->setImg(newImg);*/
|
|
|
|
|
|
|
|
|
|
|
|
QString sMsg = QString("%1 : %2->Score:%3 Angle:%4 Center:(%5,%6)")
|
|
|
|
QString sMsg = QString("%1 : %2->Score:%3 Angle:%4 Center:(%5,%6)")
|
|
|
|
.arg(QDateTime::currentDateTime().toString("hh:mm:ss"))
|
|
|
|
.arg(QDateTime::currentDateTime().toString("hh:mm:ss"))
|
|
|
|
@ -949,16 +949,6 @@ Q_SLOT void valueMainUI::on_data_send_completed_A(QSharedPointer<TP_PROTOCOL_MES
|
|
|
|
Q_SLOT void valueMainUI::on_data_recv_completed_A(QSharedPointer<TP_PROTOCOL_MESSAGE> msg_ptr, QSharedPointer<QByteArray> pData)
|
|
|
|
Q_SLOT void valueMainUI::on_data_recv_completed_A(QSharedPointer<TP_PROTOCOL_MESSAGE> msg_ptr, QSharedPointer<QByteArray> pData)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QJsonObject json = msg_ptr->body;
|
|
|
|
QJsonObject json = msg_ptr->body;
|
|
|
|
QString strcmd = json.value("cmd").toString();
|
|
|
|
|
|
|
|
if (strcmd == "algRlt")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QString strName = json.value("modeName").toString();
|
|
|
|
|
|
|
|
double score = json.value("score").toDouble();
|
|
|
|
|
|
|
|
double angle = json.value("angle").toDouble();
|
|
|
|
|
|
|
|
double cnt_x = json.value("center_x").toDouble();
|
|
|
|
|
|
|
|
double cnt_y = json.value("center_y").toDouble();
|
|
|
|
|
|
|
|
int resultType = json.value("resultType").toInt(-1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (json.contains("image_data"))
|
|
|
|
if (json.contains("image_data"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QJsonObject objImg = json.value("image_data").toObject();
|
|
|
|
QJsonObject objImg = json.value("image_data").toObject();
|
|
|
|
@ -970,13 +960,17 @@ Q_SLOT void valueMainUI::on_data_recv_completed_A(QSharedPointer<TP_PROTOCOL_MES
|
|
|
|
QImage fmtImg = img.convertToFormat(QImage::Format_ARGB32);
|
|
|
|
QImage fmtImg = img.convertToFormat(QImage::Format_ARGB32);
|
|
|
|
m_ImgViewer_A->setImg(fmtImg);
|
|
|
|
m_ImgViewer_A->setImg(fmtImg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// QString strBase64 = json.value("imageData_base64").toString();
|
|
|
|
return;
|
|
|
|
// QByteArray imgbase64 = strBase64.toUtf8();
|
|
|
|
|
|
|
|
// QImage newImg;
|
|
|
|
|
|
|
|
// QByteArray imgArr = QByteArray::fromBase64(imgbase64);
|
|
|
|
|
|
|
|
// newImg.loadFromData(imgArr);
|
|
|
|
|
|
|
|
// m_ImgViewer_A->setImg(newImg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString strcmd = json.value("cmd").toString();
|
|
|
|
|
|
|
|
if (strcmd == "algRlt")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QString strName = json.value("modeName").toString();
|
|
|
|
|
|
|
|
double score = json.value("score").toDouble();
|
|
|
|
|
|
|
|
double angle = json.value("angle").toDouble();
|
|
|
|
|
|
|
|
double cnt_x = json.value("center_x").toDouble();
|
|
|
|
|
|
|
|
double cnt_y = json.value("center_y").toDouble();
|
|
|
|
|
|
|
|
int resultType = json.value("resultType").toInt(-1);
|
|
|
|
QString sMsg = QString("%1 : %2->Score:%3 Angle:%4 Center:(%5,%6)")
|
|
|
|
QString sMsg = QString("%1 : %2->Score:%3 Angle:%4 Center:(%5,%6)")
|
|
|
|
.arg(QDateTime::currentDateTime().toString("hh:mm:ss"))
|
|
|
|
.arg(QDateTime::currentDateTime().toString("hh:mm:ss"))
|
|
|
|
.arg(strName).arg(QString::number(score, 'f', 2)).arg(QString::number(angle, 'f', 2)).arg(QString::number(cnt_x, 'f', 2)).arg(QString::number(cnt_y, 'f', 2));
|
|
|
|
.arg(strName).arg(QString::number(score, 'f', 2)).arg(QString::number(angle, 'f', 2)).arg(QString::number(cnt_x, 'f', 2)).arg(QString::number(cnt_y, 'f', 2));
|
|
|
|
@ -1057,18 +1051,6 @@ Q_SLOT void valueMainUI::on_data_send_completed_B(QSharedPointer<TP_PROTOCOL_MES
|
|
|
|
Q_SLOT void valueMainUI::on_data_recv_completed_B(QSharedPointer<TP_PROTOCOL_MESSAGE> msg_ptr, QSharedPointer<QByteArray> pData)
|
|
|
|
Q_SLOT void valueMainUI::on_data_recv_completed_B(QSharedPointer<TP_PROTOCOL_MESSAGE> msg_ptr, QSharedPointer<QByteArray> pData)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QJsonObject json = msg_ptr->body;
|
|
|
|
QJsonObject json = msg_ptr->body;
|
|
|
|
if (!json.empty()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString strcmd = json.value("cmd").toString();
|
|
|
|
|
|
|
|
if (strcmd == "algRlt")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QString strName = json.value("modeName").toString();
|
|
|
|
|
|
|
|
double score = json.value("score").toDouble();
|
|
|
|
|
|
|
|
double angle = json.value("angle").toDouble();
|
|
|
|
|
|
|
|
double cnt_x = json.value("center_x").toDouble();
|
|
|
|
|
|
|
|
double cnt_y = json.value("center_y").toDouble();
|
|
|
|
|
|
|
|
int resultType = json.value("resultType").toInt(-1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (json.contains("image_data"))
|
|
|
|
if (json.contains("image_data"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QJsonObject objImg = json.value("image_data").toObject();
|
|
|
|
QJsonObject objImg = json.value("image_data").toObject();
|
|
|
|
@ -1080,14 +1062,18 @@ Q_SLOT void valueMainUI::on_data_recv_completed_B(QSharedPointer<TP_PROTOCOL_MES
|
|
|
|
QImage fmtImg = img.convertToFormat(QImage::Format_ARGB32);
|
|
|
|
QImage fmtImg = img.convertToFormat(QImage::Format_ARGB32);
|
|
|
|
m_ImgViewer_B->setImg(fmtImg);
|
|
|
|
m_ImgViewer_B->setImg(fmtImg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!json.empty()) {
|
|
|
|
|
|
|
|
|
|
|
|
// QString strPath = json.value("imagePath").toString();
|
|
|
|
QString strcmd = json.value("cmd").toString();
|
|
|
|
// QString strBase64 = json.value("imageData_base64").toString();
|
|
|
|
if (strcmd == "algRlt")
|
|
|
|
// QByteArray imgbase64 = strBase64.toUtf8();
|
|
|
|
{
|
|
|
|
// QImage newImg;
|
|
|
|
QString strName = json.value("modeName").toString();
|
|
|
|
// QByteArray imgArr = QByteArray::fromBase64(imgbase64);
|
|
|
|
double score = json.value("score").toDouble();
|
|
|
|
// newImg.loadFromData(imgArr);
|
|
|
|
double angle = json.value("angle").toDouble();
|
|
|
|
// m_ImgViewer_B->setImg(newImg);
|
|
|
|
double cnt_x = json.value("center_x").toDouble();
|
|
|
|
|
|
|
|
double cnt_y = json.value("center_y").toDouble();
|
|
|
|
|
|
|
|
int resultType = json.value("resultType").toInt(-1);
|
|
|
|
|
|
|
|
|
|
|
|
QString sMsg = QString("%1 : %2->Score:%3 Angle:%4 Center:(%5,%6)")
|
|
|
|
QString sMsg = QString("%1 : %2->Score:%3 Angle:%4 Center:(%5,%6)")
|
|
|
|
.arg(QDateTime::currentDateTime().toString("hh:mm:ss"))
|
|
|
|
.arg(QDateTime::currentDateTime().toString("hh:mm:ss"))
|
|
|
|
|