You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
smokeboxidentification/src/common/commonDefine.h

186 lines
3.8 KiB
C

#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 "QZkJsonParser.h"
#include "lp_singleton.h"
#define DELETE_POINTER(p) if (p) {delete p; p = NULL;}
#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 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 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 eCameraLocation
{
emSide=0,
emTop
};
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