2025-03-27 18:36:54 +08:00
|
|
|
#include "interface.h"
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <detProcess.hpp>
|
|
|
|
|
#include <opencv2/core/utils/logger.hpp>
|
|
|
|
|
#include <appCore.hpp>
|
|
|
|
|
//#include <pythonCpp.h>
|
|
|
|
|
//#include <global.h>
|
|
|
|
|
//#include "mainwindow.h"
|
|
|
|
|
//#include <shellapi.h>
|
|
|
|
|
//#include <spdlog.h>
|
|
|
|
|
//#include <QApplication>
|
|
|
|
|
//#include <QSystemSemaphore>
|
|
|
|
|
//#include <QSharedMemory>
|
|
|
|
|
//#include <QMessageLogger>//ÈÕÖ¾
|
|
|
|
|
//#include <QDebug>
|
|
|
|
|
//#include <qmessagebox.h>
|
|
|
|
|
//#include <qpushbutton.h>
|
|
|
|
|
//#include <qlineedit.h>
|
|
|
|
|
//#include <qlabel.h>
|
|
|
|
|
//
|
|
|
|
|
//#include <qcombobox.h>
|
|
|
|
|
//#include <QMetaType>
|
|
|
|
|
//
|
|
|
|
|
//#include <back/manualDetThread.h>
|
|
|
|
|
//#include <uiModule/uiModule_imageDoubleCheckQdialog.h>
|
|
|
|
|
//
|
|
|
|
|
////#include <appCore.hpp>
|
|
|
|
|
|
|
|
|
|
//#include <qqmlengine.h>
|
|
|
|
|
//#include <QQmlApplicationEngine>
|
|
|
|
|
//#include <QQmlContext>
|
|
|
|
|
//#include <QGuiApplication>
|
|
|
|
|
|
|
|
|
|
//void connectSignalAndSlots(MainWindow* front, appCore* _core, detProcess* _detProcess)
|
|
|
|
|
//{
|
|
|
|
|
// //LOG
|
|
|
|
|
// QObject::connect(&_core->_logService._logToQtWidget, &logToQtWidget::stdLogSignal,
|
|
|
|
|
// front->_logWidget, &logWidget::recvStdLogMsg);
|
|
|
|
|
// QObject::connect(&_core->_logService._logToQtWidget, &logToQtWidget::qtLogSignal,
|
|
|
|
|
// front->_logWidget, &logWidget::recvQtLogMsg);
|
|
|
|
|
// QObject::connect(&_core->_logService._logToQtWidget, &logToQtWidget::mainWindowStdLogSignal,
|
|
|
|
|
// front->_displayWidget, &displayWidget::recvMainWindowStdLogMsg);
|
|
|
|
|
//
|
|
|
|
|
// ///////////TEMP
|
|
|
|
|
// //QObject::connect(&_core->_qtFunc, &qtFunction::addCtData, front, &MainWindow::addCtData);
|
|
|
|
|
// QObject::connect(&_core->_qtFunc, &qtFunction::sendInitString, front, &MainWindow::recvInitString);
|
|
|
|
|
// QObject::connect(&_core->_qtFunc, &qtFunction::sendPixmapImageWidget, front, &MainWindow::recvPixmapImageWidget);
|
|
|
|
|
//
|
|
|
|
|
// QObject::connect(&_core->_qtFunc, &qtFunction::sendInitFinished, front, &MainWindow::recvInitFinished);
|
|
|
|
|
// //QObject::connect(&_core->_qtFunc, &qtFunction::addDashBoardData, front, &MainWindow::addDashBoardData);
|
|
|
|
|
// QObject::connect(&_core->_qtFunc, &qtFunction::addCtData, front, &MainWindow::addCtData);
|
|
|
|
|
// QObject::connect(&_core->_qtFunc, &qtFunction::addHistoryDataSignal, front, &MainWindow::addDetHistoryData);
|
|
|
|
|
// //QObject::connect(&_core->_qtFunc, &qtFunction::switchStartBtnStatusSignal,
|
|
|
|
|
// // front->_displayWidget->_switchProductWidget, &switchProductWidget::switchStartBtnStatus);
|
|
|
|
|
// //QObject::connect(&_core->_qtFunc, &qtFunction::uiModuleLocationMap_ResetToDefault,
|
|
|
|
|
// // front->_displayWidget->_uiModuleLocationMap, &uiModuleLocationMap::resetToDefault);
|
|
|
|
|
// //QObject::connect(&_core->_qtFunc, &qtFunction::uiModuleLocationMap_SetProductSignStatus,
|
|
|
|
|
// // front, &MainWindow::uiModuleLocationMapSetProductSignStatus);
|
|
|
|
|
// //uiModuleImageDoubleCheckQdialog
|
|
|
|
|
// QObject::connect(&_core->_qtFunc, &qtFunction::uiModuleImageDoubleCheckQdialog_ShowWindows,
|
|
|
|
|
// front, [=](QPixmap map) {front->_imageDoubleCheckQdialog->showAndSetImg(map); });
|
|
|
|
|
//
|
|
|
|
|
// //uiModuleSummaryDataManager
|
|
|
|
|
// //QObject::connect(&_core->_qtFunc, &qtFunction::uiModuleSummaryDataManager_SetSummaryResultText,
|
|
|
|
|
// // front, [=](QString text, Qt::GlobalColor color)
|
|
|
|
|
// // {front->_displayWidget->_summaryDataManager->setSummaryResult(text, color); });
|
|
|
|
|
// //QObject::connect(&_core->_qtFunc, &qtFunction::uiModuleSummaryDataManager_Reset,
|
|
|
|
|
// // front, [=]() {front->_displayWidget->_summaryDataManager->resetAllValue(); });
|
|
|
|
|
//
|
|
|
|
|
// QObject::connect(&_core->_qtFunc, &qtFunction::uiModuleBackContinueDetDialog_show,
|
|
|
|
|
// front, [=]() {front->_backContinueDetDialog->show(); });
|
|
|
|
|
// QObject::connect(&_core->_qtFunc, &qtFunction::uiModuleBackContinueDetDialog_hide,
|
|
|
|
|
// front, [=]() {front->_backContinueDetDialog->hide(); });
|
|
|
|
|
//
|
|
|
|
|
// QObject::connect(&_core->_qtFunc, &qtFunction::uiModuleHistoryListWidget_reset,
|
|
|
|
|
// front, [=]() {front->_displayWidget->historyImgs->reset(); });
|
|
|
|
|
//
|
|
|
|
|
// QObject::connect(&_detProcess->_manualDetThread, &manualDetThread::finishImgReadSignal,
|
|
|
|
|
// front->_manualDetWidget, &manualDetWidget::finishImgReadSlot);
|
|
|
|
|
//
|
|
|
|
|
// QObject::connect(front->_manualDetWidget, &manualDetWidget::startManualDetSignal,
|
|
|
|
|
// &_detProcess->_manualDetThread, &manualDetThread::startManualDetSlot);
|
|
|
|
|
//
|
|
|
|
|
// QObject::connect(front, &MainWindow::reInitSignal,
|
|
|
|
|
// _detProcess, [=]() {_detProcess->start(); });
|
|
|
|
|
// QObject::connect(front->_loadingWidget.retryBtn, &QPushButton::clicked,
|
|
|
|
|
// _detProcess, [=]() {_detProcess->start(); });
|
|
|
|
|
// /* QObject::connect(front->_displayWidget->_switchProductWidget, &switchProductWidget::startArmProgramSignal,
|
|
|
|
|
// front->_productDetDoubleCheck, &productDetDoubleCheck::showAndSetText);*/
|
|
|
|
|
//
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
class Backend : public IBackend {
|
|
|
|
|
public:
|
|
|
|
|
//appCore _core;
|
|
|
|
|
void test() override { std::cout << "Hello from Backend!" << std::endl; }
|
|
|
|
|
void init() override {
|
2025-03-28 18:33:43 +08:00
|
|
|
if (initOnce == false) {
|
|
|
|
|
cv::utils::logging::setLogLevel(cv::utils::logging::LOG_LEVEL_ERROR);
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-27 18:36:54 +08:00
|
|
|
//detProcess _detProcess;
|
|
|
|
|
//_detProcess.start();
|
|
|
|
|
}
|
2025-03-28 18:33:43 +08:00
|
|
|
void cleanup() override {
|
|
|
|
|
|
|
|
|
|
//detProcess _detProcess;
|
|
|
|
|
//_detProcess.start();
|
|
|
|
|
}
|
|
|
|
|
private:
|
|
|
|
|
bool initOnce = false;
|
|
|
|
|
detProcess* _detProcess;
|
2025-03-27 18:36:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
IBackend* CreateBackend() { return new Backend(); }
|
|
|
|
|
void ReleaseBackend(IBackend* backend) { delete backend; }
|
|
|
|
|
}
|