|
|
|
|
|
#ifndef COMMON_DEFINE_H
|
|
|
|
|
|
#define COMMON_DEFINE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QtCore\qthread.h>
|
|
|
|
|
|
#include <QtCore\qmap.h>
|
|
|
|
|
|
#include <QtCore\qstring.h>
|
|
|
|
|
|
#include <QtWidgets\qtablewidget.h>
|
|
|
|
|
|
#include <QtWidgets\qdialog.h>
|
|
|
|
|
|
#include <QtGui\qevent.h>
|
|
|
|
|
|
#include <QtCore\qtimer.h>
|
|
|
|
|
|
#include <QtWidgets/QApplication>
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
|
|
|
|
#include "QZkJsonParser.h"
|
|
|
|
|
|
#include "lp_singleton.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "LPVCore.h"
|
|
|
|
|
|
#include "LPVGeom.h"
|
|
|
|
|
|
#include "LPVPat.h"
|
|
|
|
|
|
#include "LPVImgProc.h"
|
|
|
|
|
|
#include "DisplayHelper.h"
|
|
|
|
|
|
#include "LPVDisplay.h"
|
|
|
|
|
|
#include "LPVCalib.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define DELETE_POINTER(p) if (p) {delete p; p = NULL;}
|
|
|
|
|
|
|
|
|
|
|
|
//#define IMAGEDRAWING OPENCV
|
|
|
|
|
|
#define IMAGEDRAWING LPV
|
|
|
|
|
|
|
|
|
|
|
|
#define MODULE_CONFIG "\\config\\module.json"
|
|
|
|
|
|
#define CAMERA_CONFIG "\\config\\camera.json"
|
|
|
|
|
|
#define NET_CONFIG "\\config\\netSetting.json"
|
|
|
|
|
|
#define COM_CONFIG "\\config\\comSetting.json"
|
|
|
|
|
|
#define MATCHER_CONFIG "\\config\\match.json"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define SMOKEINFO_XLSX_CONFIG "\\user\\smokeInfo.xlsx"
|
|
|
|
|
|
#define FILE_STORAGE_PATH ".\\fileData"
|
|
|
|
|
|
#define INTOSTOCK_IMAGE_FOLDER "intoStock"
|
|
|
|
|
|
#define ORIGIN_IMAGE_FOLDER "Origin"
|
|
|
|
|
|
#define TYPE_TEMPLATE_PATH ".\\templateImg"
|
|
|
|
|
|
//#define NUM_TEMPLATE_PATH ".\\templateNum"
|
|
|
|
|
|
#define LOCAL_MODEL_PATH "\\localModel"
|
|
|
|
|
|
|
|
|
|
|
|
#define HEARTBEAT_HEAD "HB"
|
|
|
|
|
|
#define CREATE_CONNECT_HEAD "CE"
|
|
|
|
|
|
#define EMPTY_CHECK_HEAD "EC"
|
|
|
|
|
|
#define STOCK_CHECK_HEAD "SC"
|
|
|
|
|
|
#define INTO_STOCK_HEAD "IS"
|
|
|
|
|
|
#define LIGHT_CONTROL_HEAD "LC"
|
|
|
|
|
|
#define TAKE_PHOTO_HEAD "TP"
|
|
|
|
|
|
#define SPLIT_RULE "&"
|
|
|
|
|
|
#define CODE_CONTENT_SPLIT ","
|
|
|
|
|
|
#define CONTENT_SPLIT ";"
|
|
|
|
|
|
#define END_SYMBOL ">"
|
|
|
|
|
|
#define START_CAPTURE "GPS" // <20><>λȡͼ<C8A1><CDBC>ʼ
|
|
|
|
|
|
#define END_CAPTURE "GPE" // <20><>λȡͼ<C8A1><CDBC><EFBFBD><EFBFBD>
|
|
|
|
|
|
#define START_CALCULATE "RTS" // <20><>ʼƷ<CABC><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
#define RETURN_CALCULATE "RTE" // Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
#define LP_COLOR_CONTROL 0x88
|
|
|
|
|
|
#define LP_D1TOD80 0x86
|
|
|
|
|
|
#define LP_D81TOD140 0x87
|
|
|
|
|
|
#define LP_SIDELIGHT_SWITCH 0x85
|
|
|
|
|
|
#define LP_SIDELIGHT_CONFIGURATION 0x88
|
|
|
|
|
|
#define LP_RESTART_LIGHT 0xFE
|
|
|
|
|
|
#define LP_DATA_FULL_BITS 16
|
|
|
|
|
|
#define TPI_DEMARCATING_DIALOG "demarcating_tpi"
|
|
|
|
|
|
|
|
|
|
|
|
#define TPI_BUTTON_CLEAR_RESULT "tpi_btn_clear_result"
|
|
|
|
|
|
|
|
|
|
|
|
#define TPI_RESULT_OK "tpi_result_ok"//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
#define TPI_RESULT_MISS_NAIL "tpi_result_miss_nail"//ȱ<><C8B1>
|
|
|
|
|
|
#define TPI_RESULT_MISS_BEAD "tpi_result_miss_bead"//ȱ<><C8B1>
|
|
|
|
|
|
#define TPI_RESULT_CONNECT "tpi_result_connect"//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>༭ճ<E0BCAD><D5B3>
|
|
|
|
|
|
#define TPI_RESULT_BLANK "tpi_result_blank"//û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
#define TPI_RESULT_OTHERS "tpi_result_others"//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
#define TP_SERVER_CONNECTION "tp_connection" //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
#define ACTION_LOGION "actionLogin" //<2F>û<EFBFBD><C3BB><EFBFBD>½
|
|
|
|
|
|
#define ACTION_SYSTEM "actionSystem" //ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>
|
|
|
|
|
|
#define ACTION_PARAMS "actionParams"
|
|
|
|
|
|
#define ACTION_DATA_CHECK "actionDataCheck"
|
|
|
|
|
|
#define ACTION_TEST "actionTest"
|
|
|
|
|
|
#define ACTION_MANGEMENT "actionMangement"
|
|
|
|
|
|
#define ACTION_NET "actionNetTrigger"
|
|
|
|
|
|
#define ACTION_IMAGE_CALI "action_image_cali"
|
|
|
|
|
|
#define SMOKE_TYPE_LABEL "typeLabel"
|
|
|
|
|
|
#define SMOKE_NUM_LABEL "numberLabel"
|
|
|
|
|
|
#define SMOKE_POS_LABEL "positionLabel"
|
|
|
|
|
|
|
|
|
|
|
|
const int monitorNum = 4;
|
|
|
|
|
|
|
|
|
|
|
|
struct rstData
|
|
|
|
|
|
{
|
|
|
|
|
|
QString s_typeStr;
|
|
|
|
|
|
QString s_num;
|
|
|
|
|
|
QString s_planeStr;
|
|
|
|
|
|
QImage s_typeImg;
|
|
|
|
|
|
//QImage s_numImg;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct outputData
|
|
|
|
|
|
{
|
|
|
|
|
|
outputData()
|
|
|
|
|
|
{
|
|
|
|
|
|
mStrTypeName = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
QImage mTypeImage;
|
|
|
|
|
|
QString mStrTypeName;
|
|
|
|
|
|
QString mSurffixType;
|
|
|
|
|
|
QString mStrChineseName;
|
|
|
|
|
|
QString snapSignal;
|
|
|
|
|
|
double bestScore;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct COMbody
|
|
|
|
|
|
{
|
|
|
|
|
|
COMbody() {
|
|
|
|
|
|
deviceName = "";
|
|
|
|
|
|
comName = "";
|
|
|
|
|
|
bauRate = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
QString deviceName;
|
|
|
|
|
|
QString comName;
|
|
|
|
|
|
QString bauRate;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct debugMsg
|
|
|
|
|
|
{
|
|
|
|
|
|
QString msEmpty_1;
|
|
|
|
|
|
QString msEmpty_2;
|
|
|
|
|
|
QString msPlane_1;
|
|
|
|
|
|
QString msPlane_2;
|
|
|
|
|
|
QString msAD_1;
|
|
|
|
|
|
QString msAD_2;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum StockCheckMode
|
|
|
|
|
|
{
|
|
|
|
|
|
NoVirtual = 0,
|
|
|
|
|
|
TypeVirtual, //Ʒ<><C6B7>ģ<EFBFBD><C4A3><EFBFBD>̵<EFBFBD>
|
|
|
|
|
|
NumVirtual, //<2F><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>̵<EFBFBD>
|
|
|
|
|
|
TypeNumVirtual //Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>̵<EFBFBD>
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct IntoStockInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
QString streetName; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
QString taskNum; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
QString stockNum; //<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>UL062015020111 6<>ŶѶ<C5B6><D1B6><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD>ұߣ<D2B1>
|
|
|
|
|
|
QString id = 0;
|
|
|
|
|
|
QString stockLocation = 0; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>2<EFBFBD>ң<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>Ϊ֮ǰ<D6AE><C7B0><EFBFBD><EFBFBD>
|
|
|
|
|
|
QString smokeTypeNum; //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>37010106
|
|
|
|
|
|
QString smokeQuantity; //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>30
|
|
|
|
|
|
int Floor = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ĵĻ<C4B5><C4BB><EFBFBD><EFBFBD>ڸܿ<DFBC><DCBF>ĵڼ<C4B5><DABC><EFBFBD>
|
|
|
|
|
|
QStringList imagesPathList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString pcdSrc; //<2F>̵<EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
|
bool correctness =1; //<2F><><EFBFBD>ճɹ<D5B3>
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct EmptyCheckInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
QString streetName;
|
|
|
|
|
|
QString taskNum;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct StockCheckInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
// "SC&6&UL062015020111&6335&37010106&30&N>"
|
|
|
|
|
|
// <20>¹<EFBFBD><C2B9><EFBFBD><EFBFBD><EFBFBD>GP&111&6&2121&1&S001&25>
|
|
|
|
|
|
// 111:ID<49><44>
|
|
|
|
|
|
// 6:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// 2121:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// 1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>2<EFBFBD><32>
|
|
|
|
|
|
// S001:Ʒ<><C6B7><EFBFBD><EFBFBD>-<2D><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
|
|
|
|
|
|
//
|
|
|
|
|
|
QString streetName; // <20><><EFBFBD><EFBFBD>6
|
|
|
|
|
|
QString taskNum; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>6335
|
|
|
|
|
|
QString stockNum; // <20><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>UL062015020111 6<>ŶѶ<C5B6><D1B6><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD>ұߣ<D2B1>
|
|
|
|
|
|
QString id = 0;
|
|
|
|
|
|
QString stockLocation = 0; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>2<EFBFBD>ң<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>Ϊ֮ǰ<D6AE><C7B0><EFBFBD><EFBFBD>
|
|
|
|
|
|
QString smokeTypeNum; //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>37010106
|
|
|
|
|
|
QString smokeQuantity; //<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>30
|
|
|
|
|
|
QString smokeTypeNumRlt; //<2F>̵<EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
|
|
|
|
|
|
QString smokeQuantityRlt; //<2F>̵<EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
bool correctness; //<2F>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>һ<EFBFBD><D2BB>
|
|
|
|
|
|
QStringList imagesPathList;
|
|
|
|
|
|
|
|
|
|
|
|
QString pcdSrc; //<2F>̵<EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
int Floor = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ĵĻ<C4B5><C4BB><EFBFBD><EFBFBD>ڸܿ<DFBC><DCBF>ĵڼ<C4B5><DABC><EFBFBD>
|
|
|
|
|
|
//void clear()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// streetName.clear();
|
|
|
|
|
|
// taskNum.clear();
|
|
|
|
|
|
// stockNum.clear();
|
|
|
|
|
|
// smokeTypeNum.clear();
|
|
|
|
|
|
// smokeQuantity.clear();
|
|
|
|
|
|
// smokeTypeNumRlt.clear();
|
|
|
|
|
|
// smokeQuantityRlt.clear();
|
|
|
|
|
|
// correctness = false;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//StockCheckInfo &operator = (const StockCheckInfo& obj)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// this->streetName = obj.streetName;
|
|
|
|
|
|
// this->taskNum = obj.taskNum;
|
|
|
|
|
|
// this->stockNum = obj.stockNum;
|
|
|
|
|
|
// this->smokeTypeNum = obj.smokeTypeNum;
|
|
|
|
|
|
// this->smokeQuantity = obj.smokeQuantity;
|
|
|
|
|
|
// this->smokeTypeNumRlt = obj.smokeTypeNumRlt;
|
|
|
|
|
|
// this->smokeQuantityRlt = obj.smokeQuantityRlt;
|
|
|
|
|
|
// this->correctness = obj.correctness;
|
|
|
|
|
|
// return *this;
|
|
|
|
|
|
//}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum eCommunicationRules
|
|
|
|
|
|
{
|
|
|
|
|
|
emNJ = 0, // <20>Ͼ<EFBFBD>
|
|
|
|
|
|
emSJZ // ʯ<><CAAF>ׯ
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum eCameraLocation
|
|
|
|
|
|
{
|
|
|
|
|
|
emSide=0, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
emTop, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum eSideID {
|
|
|
|
|
|
em_LEFT = 0,
|
|
|
|
|
|
em_RIGHT,
|
|
|
|
|
|
|
|
|
|
|
|
MAX_SIDES
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum loopDataLogicRef
|
|
|
|
|
|
{
|
|
|
|
|
|
emDatalogic1 = 0,
|
|
|
|
|
|
emDatalogic2
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum lightCtrl
|
|
|
|
|
|
{
|
|
|
|
|
|
emTurnOnLight = 1,
|
|
|
|
|
|
emTurnOffLight
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum emEptyPlateMonitorSelection
|
|
|
|
|
|
{
|
|
|
|
|
|
emEmptyMonitorTrigger_1 = 1,
|
|
|
|
|
|
emEmptyMonitorTrigger_2
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum StockCheckTrigger
|
|
|
|
|
|
{
|
|
|
|
|
|
emMonitorTriggerStart = 1,
|
|
|
|
|
|
emMonitorTriggerStop
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
namespace myBody {
|
|
|
|
|
|
enum stationRef
|
|
|
|
|
|
{
|
|
|
|
|
|
emSTATION_EMPTY_1,
|
|
|
|
|
|
emSTATION_EMPTY_2,
|
|
|
|
|
|
emSTATION_PLANE_1,
|
|
|
|
|
|
emSTATION_PLANE_2,
|
|
|
|
|
|
emSTATION_AD_1,
|
|
|
|
|
|
emSTATION_AD_2,
|
|
|
|
|
|
emSTATION_NUM,
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
using matGroup = struct dataGroup
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
dataGroup() {
|
|
|
|
|
|
vec.resize(monitorNum);
|
|
|
|
|
|
}
|
|
|
|
|
|
void clear() {
|
|
|
|
|
|
for (int i = 0; i < vec.size(); ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
vec[i].clear();
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
QVector<QVector<double>> vec;
|
|
|
|
|
|
using PTR = std::shared_ptr<dataGroup>;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // !COMMON_DEFINE_H
|