添加配置文件根路径的define,方便本地调试

main
Jeffrey_Li 4 days ago
parent e26959acea
commit 6ea27d23d7

@ -66,6 +66,14 @@
"typeinfo": "cpp",
"cassert": "cpp",
"bitset": "cpp",
"regex": "cpp"
"regex": "cpp",
"filesystem": "cpp",
"codecvt": "cpp",
"optional": "cpp",
"cfenv": "cpp",
"__nullptr": "cpp",
"__split_buffer": "cpp",
"queue": "cpp",
"locale": "cpp"
}
}

@ -25,14 +25,14 @@ bool YOLO_V3::CreateSession(std::string model_path, std::string model_name)
modelWeights = model_path + "/" + model_name;
modelConfiguration = model_path + "/jd.cfg";
classesFile = model_path + "/jd.names";
image_path = model_path + "/" + "alg_jd"+ std::string(SUFFIX);
image_path = model_path + "/" + "alg_jd"+ std::string(IMG_SUFFIX);
}
else {
modelWeights = "D:/model/jd.weights";
classesFile = "D:/model/jd.names";
modelWeights = ROOTPATH_PREFIX + SLASH + MODELPATH + "jd.weights";
classesFile = ROOTPATH_PREFIX + SLASH + MODELPATH + "jd.names";
// Give the configuration and weight files for the model
modelConfiguration = "D:/model/jd.cfg";
image_path = "D:/model/alg_jd"+ std::string(SUFFIX);
modelConfiguration = ROOTPATH_PREFIX + SLASH + MODELPATH + "jd.cfg";
image_path = ROOTPATH_PREFIX + SLASH + MODELPATH + "alg_jd"+ std::string(IMG_SUFFIX);
}
std::ifstream classNamesFile(classesFile.c_str());
@ -54,14 +54,7 @@ bool YOLO_V3::CreateSession(std::string model_path, std::string model_name)
net.setPreferableTarget(cv::dnn::DNN_TARGET_CUDA);
#endif
//cv::Mat image = cv::imread("alg_jd"+SUFFIX);
cv::Mat image = cv::imread(image_path);
/*if (g_sys_conf.model_jpg_path.length() > 0) {
image = cv::imread(g_sys_conf.model_jpg_path.toStdString());
}
else {
image = cv::imread("D:/Release/alg_jd"+SUFFIX);
}*/
//识别一张图测试模型是否正确并且完成GPU数据加载
if (!image.data) return false; //判断测试图片是否正常读取

@ -37,7 +37,6 @@ void CleanWorkThread::doWork()
qint64 spaceSize;
qint64 dirSize;
QString dirPath = g_conf_path.save_pics_path;
//QString iDriver = "D:/";
char drive[_MAX_DRIVE];
char dir_1[_MAX_DIR];
char fname[_MAX_FNAME];
@ -48,7 +47,6 @@ void CleanWorkThread::doWork()
LPCWSTR strDriver = (LPCWSTR)iDriver.utf16();
ULARGE_INTEGER freeDiskSpaceAvailable, totalDiskSpace, totalFreeDiskSpace;
qint64 gb = (1024 * 1024 * 1024);
//QString dir("D:/image");
QString dir(g_conf_path.save_pics_path + "/ALL");
if (delSelection == 2)

@ -2,8 +2,8 @@
#include <QDir>
#include <QMutex>
#include <QDate>
#include <common.h>
const char PATH_LogPath[] = "D:/log/";
const char Suffix[] = ".txt";
bool CLog::isFileReady = false;
bool CLog::isRecord2File = true;
@ -21,7 +21,7 @@ void CLog::setLogType(const CLog::CLOG_TYPE& level)
bool CLog::init(LogConfig& logConfig)
{
isRecord2File = logConfig.isRecord2File;
QString logDir = QString(PATH_LogPath);
QString logDir = QString::fromStdString(ROOTPATH_PREFIX + SLASH + LOGPATH);
if (createDir(logDir))
{
QString fileName = logDir + QDir::separator() + QDate::currentDate().toString("yyyy-MM-dd") + QString(Suffix);

@ -203,10 +203,11 @@ void SyncWorkThread::run()
if (merge_index == work_camera_nums * unit_count) {
file_name = g_conf_path.save_pics_path + "/"
+ now_ts.toString("yyyy-MM-dd") + "/"
+ now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + SUFFIX;
+ now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") +
QString::fromStdString(IMG_SUFFIX);
g_save_queue->put(std::make_pair(file_name.toLocal8Bit().constData(), merge_image));
#ifdef __TCPSend
QString sendName = now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + SUFFIX;
QString sendName = now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + SUFIMG_SUFFIXFIX;
TCPSendInfo.pics_name = sendName.toLocal8Bit().constData();
TCP_Info_queue->put(TCPSendInfo);
#endif
@ -278,11 +279,11 @@ void SyncWorkThread::run()
+ QString::number(local_camera_number + 1) + "/" + QString::number(index + 1) + "/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + "_" + ng_reason_maps[ngReason] +
SUFFIX;
QString::fromStdString(IMG_SUFFIX);
QString remotePath = "/image/ng/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + "_" + ng_reason_maps[ngReason] +
SUFFIX;
QString::fromStdString(IMG_SUFFIX);
g_save_queue->put(std::make_pair(file_name.toLocal8Bit().constData(), m));
m = vec_out[index].clone();
@ -291,11 +292,11 @@ void SyncWorkThread::run()
+ QString::number(local_camera_number + 1) + "/" + QString::number(index + 1) + "/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + "_" + ng_reason_maps[ngReason] +
SUFFIX;
QString::fromStdString(IMG_SUFFIX);
remotePath = "/image/ng_result/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + "_" + ng_reason_maps[ngReason] +
SUFFIX;
QString::fromStdString(IMG_SUFFIX);
//g_save_queue->put(std::make_pair(file_name.toStdString(), m));
g_save_queue->put(std::make_pair(file_name.toLocal8Bit().constData(), m));
}

@ -184,12 +184,14 @@ void WorkThread::run()
now_ts.toString("yyyy-MM-dd") + "/"
+ QString::number(local_camera_number + 1) + "/" + QString::number(index + 1) + "/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + SUFFIX;
"#" + "_" + QString::number(index + 1) +
QString::fromStdString(IMG_SUFFIX);
std::string filename = file_name.toLocal8Bit().constData();
g_save_queue->put(std::make_pair(filename, m));
QString sendName = now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + SUFFIX;
"#" + "_" + QString::number(index + 1) +
QString::fromStdString(IMG_SUFFIX);
#ifdef __TCPSend
TCPSendInfo.pics_name = sendName.toLocal8Bit().constData();
TCP_Info_queue->put(TCPSendInfo);
@ -261,11 +263,11 @@ void WorkThread::run()
+ QString::number(local_camera_number + 1) + "/" + QString::number(index + 1) + "/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + "_" + ng_reason_maps[ngReason] +
SUFFIX;
QString::fromStdString(IMG_SUFFIX);
QString remotePath = "/image/ng/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + "_" + ng_reason_maps[ngReason] +
SUFFIX;
QString::fromStdString(IMG_SUFFIX);
g_save_queue->put(std::make_pair(file_name.toLocal8Bit().constData(), m));
m = vec_out[index].clone();
@ -274,11 +276,11 @@ void WorkThread::run()
+ QString::number(local_camera_number + 1) + "/" + QString::number(index + 1) + "/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + "_" + ng_reason_maps[ngReason] +
SUFFIX;
QString::fromStdString(IMG_SUFFIX);
remotePath = "/image/ng_result/" +
now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") + QString::number(local_camera_number + 1) +
"#" + "_" + QString::number(index + 1) + "_" + ng_reason_maps[ngReason] +
SUFFIX;
QString::fromStdString(IMG_SUFFIX);
//g_save_queue->put(std::make_pair(file_name.toStdString(), m));
g_save_queue->put(std::make_pair(file_name.toLocal8Bit().constData(), m));
}

@ -62,9 +62,9 @@ DialogSetup::DialogSetup(QWidget* parent) : QDialog(parent) {
if (!dirinfo->exists()) {
// 如果文件夹信息不存在
delete dirinfo, dirinfo = nullptr;
g_conf_path.config_path = "D:/conf";
g_conf_path.config_path = QString::fromStdString(ROOTPATH_PREFIX + SLASH + CONFPATH);
}
dirinfo->setNameFilters(QStringList("conf.txt"));
dirinfo->setNameFilters(QStringList(CONF_FILE.c_str()));
QStringList fileList = dirinfo->entryList(QDir::Files);
fileList.removeOne(".");
fileList.removeOne("..");
@ -72,7 +72,7 @@ DialogSetup::DialogSetup(QWidget* parent) : QDialog(parent) {
}
else {
// 如果路径空
g_conf_path.config_path = "D:/conf";
g_conf_path.config_path = QString::fromStdString(ROOTPATH_PREFIX + SLASH + CONFPATH);
}
ui.comboBox_config_path->addItem(g_conf_path.config_path);
// 更换选择文件
@ -354,7 +354,7 @@ void DialogSetup::on_toolButton_choose_config_path_released() {
if (dirName.isEmpty()) {
// 点击取消按钮
if (g_conf_path.config_path.isEmpty())
dirName = "D:/conf";
dirName = QString::fromStdString(ROOTPATH_PREFIX + SLASH + CONFPATH);
else
dirName = g_conf_path.config_path;
}
@ -363,11 +363,11 @@ void DialogSetup::on_toolButton_choose_config_path_released() {
if (!dirinfo->exists())
delete dirinfo, dirinfo = nullptr;
dirinfo->setNameFilters(QStringList("conf.txt"));
dirinfo->setNameFilters(QStringList(CONF_FILE.c_str()));
QStringList fileList = dirinfo->entryList(QDir::Files);
if (fileList.count() == 0) {
dirName = "D:/conf";
dirName = QString::fromStdString(ROOTPATH_PREFIX + SLASH + CONFPATH);
}
//fileList.removeOne(".");
@ -395,7 +395,7 @@ void DialogSetup::on_toolButton_choose_model_path_released() {
if (dirName.isEmpty()) {
if (g_sys_conf.model_path.isEmpty())
dirName = "D:/model";
dirName = QString::fromStdString(ROOTPATH_PREFIX + SLASH + MODELPATH);
else
dirName = g_sys_conf.model_path;
@ -409,7 +409,7 @@ void DialogSetup::on_toolButton_choose_model_path_released() {
dirinfo->setNameFilters(QStringList("*.weights"));
QStringList fileList = dirinfo->entryList(QDir::Files);
if (fileList.count() == 0) {
g_sys_conf.model_path = "D:/model";
g_sys_conf.model_path = QString::fromStdString(ROOTPATH_PREFIX + SLASH + MODELPATH);
g_sys_conf.model_name = "jd.weights";
}
else
@ -472,7 +472,7 @@ void DialogSetup::on_toolButton_choose_path_jpg_released() {
void DialogSetup::write_pswd()
{
std::fstream cfg_file;
cfg_file.open("D:/Release/pswd.txt", std::ios::out | std::ios::trunc);
cfg_file.open((ROOTPATH_PREFIX + SLASH + PSWD_FILE).c_str(), std::ios::out | std::ios::trunc);
if (cfg_file.good())
{
char buf[256];
@ -485,7 +485,7 @@ void DialogSetup::write_pswd()
void DialogSetup::write_pswd_op()
{
std::fstream cfg_file;
cfg_file.open("D:/Release/pswd_op.txt", std::ios::out | std::ios::trunc);
cfg_file.open((ROOTPATH_PREFIX + SLASH + PSWD_OP_FILE).c_str(), std::ios::out | std::ios::trunc);
if (cfg_file.good())
{
char buf[256];
@ -497,7 +497,7 @@ void DialogSetup::write_pswd_op()
}
void DialogSetup::write_conf_path() {
std::fstream cfg_file;
cfg_file.open(CONFPATH, std::ios::out | std::ios::trunc);
cfg_file.open(ROOTPATH_PREFIX + CONFPATH, std::ios::out | std::ios::trunc);
if (cfg_file.good()) {
char buf[256];
memset(buf, 0, 256);

@ -50,7 +50,7 @@ void output_statistic::recMsgFromDialogSetup()
QString file_path, file_name;
QFile file;
for (int i = 0; i < NumberOfSupportedCameras; i++) {
file_name = QString(STATISTIC_FILE).arg(i);
file_name = QString::fromStdString(STATISTIC_FILE).arg(i);
file_path = g_conf_path.config_path + "/" + file_name;
file.setFileName(file_path);
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
@ -60,7 +60,7 @@ void output_statistic::recMsgFromDialogSetup()
textBrowser_mat[i]->setText(in.readAll());
}
else {
std::cout << "can not open statistic file" << std::endl;
std::cout << "can not open statistic file" << file_path.toShort() << std::endl;
}
file.close();
this->show();

@ -244,13 +244,13 @@ void PlcSetup::handleTimeout()
void PlcSetup::read_plc_items()
{
std::fstream cfg_file;
QString plc_file = g_conf_path.config_path + "/" + PLC_CONFIG_FILE;
QString plc_file = g_conf_path.config_path + "/" + QString::fromStdString(PLC_CONFIG_FILE);
cfg_file.open(plc_file.toLocal8Bit().constData());
if (!cfg_file.is_open())
{
std::cout << "Error: Open production file " << PLC_ITEM_FILE << std::endl;
std::cout << "Error: Open production file " << plc_file.toStdString() << std::endl;
return;
}
while (!cfg_file.eof())
@ -280,7 +280,7 @@ void PlcSetup::read_plc_items()
void PlcSetup::save_plc_items()
{
std::fstream cfg_file;
QString plc_file = g_conf_path.config_path + "/" + PLC_CONFIG_FILE;
QString plc_file = g_conf_path.config_path + "/" + QString::fromStdString(PLC_CONFIG_FILE);
cfg_file.open(plc_file.toLocal8Bit().constData(), std::ios::out | std::ios::trunc);
if (cfg_file.good())
{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

@ -122,12 +122,12 @@ Cigarette::Cigarette(QWidget* parent)
if (!dirinfo->exists()) {
// 如果文件夹信息不存在
delete dirinfo, dirinfo = nullptr;
g_conf_path.config_path = "D:/conf";
g_conf_path.config_path = QString::fromStdString(ROOTPATH_PREFIX + SLASH + CONFPATH);
}
delete dirinfo, dirinfo = nullptr;
}
else
g_conf_path.config_path = "D:/conf";
g_conf_path.config_path = QString::fromStdString(ROOTPATH_PREFIX + SLASH + CONFPATH);
bool update_rotate = false;
if (!read_rotate_message()) {
@ -247,11 +247,11 @@ Cigarette::Cigarette(QWidget* parent)
quantity_stop_count = 0;
g_seconds = 0;
QString config_path = g_conf_path.config_path + "/conf.txt";
QString config_path = g_conf_path.config_path + QString::fromStdString( SLASH + CONF_FILE);
read_sys_config(g_sys_conf, config_path); //初始化系统配置
if (g_sys_conf.model_path.isEmpty()) {
g_sys_conf.model_path = "D:/model";
g_sys_conf.model_path = QString::fromStdString(ROOTPATH_PREFIX + SLASH + MODELPATH);
}
if (g_sys_conf.model_name.isEmpty()) {
@ -1061,12 +1061,12 @@ void Cigarette::OnKey(QKeyEvent* event)
std::fstream cfg_file;
char buf[256];
memset(buf, 0, 256);
sprintf(buf, SELECT_RECTS_FILE, Num, Cnt);
sprintf(buf, SELECT_RECTS_FILE.c_str(), Num, Cnt);
QString rects_file = g_conf_path.config_path + "/" + buf;
cfg_file.open(rects_file.toLocal8Bit().constData(), ios::trunc | ofstream::out);
if (!cfg_file.is_open())
{
std::cout << "Error: Open config file SelectRects.txt" << std::endl;
std::cout << "Error: Open SelectRects file " << rects_file.toStdString() << std::endl;
return;
}
for (int i = 0; i < g_display_label_conf[Num].RectVet[Cnt].size(); i++)
@ -1209,12 +1209,12 @@ void Cigarette::DrawRect_init(int Num_Cnt) {
std::fstream cfg_file;
char buf[256];
memset(buf, 0, 256);
sprintf(buf, SELECT_RECTS_FILE, Num, Cnt);
sprintf(buf, SELECT_RECTS_FILE.c_str(), Num, Cnt);
QString rects_file = g_conf_path.config_path + "/" + buf;
cfg_file.open(rects_file.toLocal8Bit().constData());
if (!cfg_file.is_open())
{
std::cout << "Error: Open config file SelectRects" << Num << Cnt << ".txt" << std::endl;
std::cout << "Error: Open SelectRects file" << rects_file.toStdString() << std::endl;
return;
}
while (!cfg_file.eof())
@ -1256,12 +1256,12 @@ void Cigarette::OnTPClickHub(int Num_Cnt)
std::fstream cfg_file;
char buf[256];
memset(buf, 0, 256);
sprintf(buf, SELECT_RECTS_FILE, Num, Cnt);
sprintf(buf, SELECT_RECTS_FILE.c_str(), Num, Cnt);
QString rects_file = g_conf_path.config_path + "/" + buf;
cfg_file.open(rects_file.toLocal8Bit().constData());
if (!cfg_file.is_open())
{
std::cout << "Error: Open config file SelectRects.txt" << std::endl;
std::cout << "Error: Open SelectRects file " << rects_file.toStdString() << std::endl;
return;
}
while (!cfg_file.eof())
@ -2112,10 +2112,11 @@ void Cigarette::on_pushButton_clear_released()//换班
QString Cigarette::read_pswd()
{
std::fstream cfg_file;
cfg_file.open("D:/Release/pswd.txt");
std::string pswd_path = ROOTPATH_PREFIX + SLASH + PSWD_FILE;
cfg_file.open(pswd_path.c_str());
if (!cfg_file.is_open())
{
std::cout << "Error: Open config file pswd.txt" << std::endl;
std::cout << "Error: Open pswd file" << pswd_path <<std::endl;
return "81dc9bdb52d04dc20036dbd8313ed055";
}
if (!cfg_file.eof())
@ -2144,10 +2145,11 @@ QString Cigarette::read_pswd()
QString Cigarette::read_op_pswd()
{
std::fstream cfg_file;
cfg_file.open("D:/Release/pswd_op.txt");
std::string pswd_op_path = ROOTPATH_PREFIX + SLASH + PSWD_OP_FILE;
cfg_file.open(pswd_op_path.c_str());
if (!cfg_file.is_open())
{
std::cout << "Error: Open config file pswd_op.txt" << std::endl;
std::cout << "Error: Open pswd_op file" <<pswd_op_path<< std::endl;
return "81dc9bdb52d04dc20036dbd8313ed055";
}
if (!cfg_file.eof())
@ -2174,9 +2176,10 @@ QString Cigarette::read_op_pswd()
bool Cigarette::read_conf(ConfPath& conf_path) {
std::fstream conf_file;
conf_file.open(CONFPATH);
std::string conf_file_path = ROOTPATH_PREFIX + SLASH + CONFPATH + CONFPATH_FILE;
conf_file.open(conf_file_path);
if (!conf_file.is_open()) {
std::cout << "Error: Open conf path file " << CONFPATH << std::endl;
std::cout << "Error: Open conf_path file " << conf_file_path << std::endl;
return false;
}
while (!conf_file.eof()) {
@ -2603,11 +2606,11 @@ bool Cigarette::read_modbus_config(ModbusConf& conf)
{
QString str_kick;
std::fstream cfg_file;
QString modbus_file = g_conf_path.config_path + "/" + MODBUS_CONFIGURE_FILE;
QString modbus_file = g_conf_path.config_path + "/" + QString::fromStdString(MODBUS_CONFIGURE_FILE);
cfg_file.open(modbus_file.toLocal8Bit().constData());
if (!cfg_file.is_open())
{
std::cout << "Error: Open config file " << MODBUS_CONFIGURE_FILE << std::endl;
std::cout << "Error: Open modbus file" << modbus_file.toStdString() << std::endl;
return false;
}
while (!cfg_file.eof())
@ -2662,11 +2665,11 @@ bool Cigarette::read_modbus_config(ModbusConf& conf)
bool Cigarette::read_rotate_message()
{
std::fstream cfg_file;
QString rotate_file = g_conf_path.config_path + "/" + ROTATE_FILE;
QString rotate_file = g_conf_path.config_path + "/" + QString::fromStdString(ROTATE_FILE);
cfg_file.open(rotate_file.toLocal8Bit().constData());
if (!cfg_file.is_open())
{
std::cout << "Error: Open config file rotate.txt" << std::endl;
std::cout << "Error: Open config file rotate.txt" << ROTATE_FILE << std::endl;
return false;
}
if (!cfg_file.eof())
@ -2699,11 +2702,11 @@ bool Cigarette::read_rotate_message()
bool Cigarette::save_rotate_message()
{
std::fstream cfg_file;
QString rotate_file = g_conf_path.config_path + "/" + ROTATE_FILE;
QString rotate_file = g_conf_path.config_path + "/" + QString::fromStdString(ROTATE_FILE);
cfg_file.open(rotate_file.toLocal8Bit().constData(), ios::trunc | ofstream::out);
if (!cfg_file.is_open())
{
std::cout << "Error: Open config file rotate.txt" << std::endl;
std::cout << "Error: Open config file rotate.txt" << ROTATE_FILE << std::endl;
return false;
}
for (int i = 0; i < NumberOfSupportedCameras; i++) {
@ -2782,7 +2785,7 @@ QImage Cigarette::cvMatToQImage(const cv::Mat& mat)
void Cigarette::read_plc_items()
{
std::fstream cfg_file;
QString plc_file = g_conf_path.config_path + "/" + PLC_CONFIG_FILE;
QString plc_file = g_conf_path.config_path + "/" + QString::fromStdString(PLC_CONFIG_FILE);
cfg_file.open(plc_file.toLocal8Bit().constData());
if (!cfg_file.is_open())
@ -3700,7 +3703,7 @@ void Cigarette::record_output_statistic(qint64 quantity, int Kick[NumberOfSuppor
{
if (SingleCamInfo[i].IsOpen && quantity > 0) {
std::fstream cfg_file;
file_name = QString(STATISTIC_FILE).arg(i);
file_name = QString::fromStdString(STATISTIC_FILE).arg(i);
file_path = g_conf_path.config_path + "/" + file_name;
char buf[256];

@ -25,7 +25,7 @@
//#define __MQTTSend // MQTT发送
#define BASLER_SUPPORT
#if defined (BASLER_SUPPORT)
#define USB_BASLER_NEW_FW //使用basler定制固件
#define USB_BASLER_NEW_FW //使用basler定制固件
#endif
#define HIK_SUPPORT
#define BALLUFF_SUPPORT
@ -55,17 +55,32 @@
#endif
// 主界面基本参数配置文件
#define CONFPATH "D:/conf/conf_path.txt"
//#define CONFIGURE_FILE "D:/conf/conf.txt"
#ifdef __DEBUG
#define ROOTPATH_PREFIX std::string(".")
#else
#define ROOTPATH_PREFIX std::string("D:")
#endif
#define CONFPATH std::string("conf")
#define MODELPATH std::string("model")
#define LOGPATH std::string("log")
#define IMAGEPATH std::string("image")
#define SLASH std::string("/")
// 相机旋转角度配置文件
#define ROTATE_FILE "rotate.txt"
#define MODBUS_CONFIGURE_FILE "modbus.txt"
#define PLC_CONFIG_FILE "plc.txt"
#define SELECT_RECTS_FILE "SelectRects%d%d.txt"
#define STATISTIC_FILE "camera%1_statistic.txt"
#define ALARM_RECORD_FILE "alarm.txt"
#define ROTATE_FILE std::string("rotate.txt")
#define MODBUS_CONFIGURE_FILE std::string("modbus.txt")
#define PLC_CONFIG_FILE std::string("plc.txt")
#define SELECT_RECTS_FILE std::string("SelectRects%d%d.txt")
#define STATISTIC_FILE std::string("camera%1_statistic.txt")
#define ALARM_RECORD_FILE std::string("alarm.txt")
#define CONFPATH_FILE std::string("conf_path.txt")
#define CONF_FILE std::string("conf.txt")
#define PSWD_FILE std::string("pswd.txt")
#define PSWD_OP_FILE std::string("pswd_op.txt")
#define SPLASH_FILE std::string("splash.jpg")
#define OUTPUT_HIGH_WIDTH 20000 //输出信号的脉冲宽度,微秒
#define SUFFIX ".jpg"
// 图片格式
#define IMG_SUFFIX std::string(".jpg")
#define OP_TIME 300 //OP权限时长默认300秒
#define ADMIN_TIME 600 //ADMIN权限时长默认300秒

@ -0,0 +1 @@
0,3,0,3,0,3,0,3,

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB

@ -30,7 +30,7 @@ int main(int argc, char* argv[])
}
#endif
qRegisterMetaType<cv::Mat>("cv::Mat");
QPixmap pixmap("D:/Release/splash.jpg");
QPixmap pixmap((ROOTPATH_PREFIX + SLASH + SPLASH_FILE).c_str());
QSplashScreen splash(pixmap);
splash.show();
a.processEvents();

Loading…
Cancel
Save