diff --git a/.vscode/settings.json b/.vscode/settings.json index f2df0341..0c9072c8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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" } } \ No newline at end of file diff --git a/Cigarette/Alg/alg_jd_yolo3.cpp b/Cigarette/Alg/alg_jd_yolo3.cpp index 4601fa80..6fc4c05f 100644 --- a/Cigarette/Alg/alg_jd_yolo3.cpp +++ b/Cigarette/Alg/alg_jd_yolo3.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; //判断测试图片是否正常读取 diff --git a/Cigarette/Thread/Cleanthread.cpp b/Cigarette/Thread/Cleanthread.cpp index eb97ba00..92785787 100644 --- a/Cigarette/Thread/Cleanthread.cpp +++ b/Cigarette/Thread/Cleanthread.cpp @@ -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) diff --git a/Cigarette/Thread/Logthread.cpp b/Cigarette/Thread/Logthread.cpp index 1c084913..1c729016 100644 --- a/Cigarette/Thread/Logthread.cpp +++ b/Cigarette/Thread/Logthread.cpp @@ -2,8 +2,8 @@ #include #include #include +#include -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); diff --git a/Cigarette/Thread/syncworkthread.cpp b/Cigarette/Thread/syncworkthread.cpp index 71e6c011..2e9d4722 100644 --- a/Cigarette/Thread/syncworkthread.cpp +++ b/Cigarette/Thread/syncworkthread.cpp @@ -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)); } diff --git a/Cigarette/Thread/workthread.cpp b/Cigarette/Thread/workthread.cpp index 1c99999b..99e9b22c 100644 --- a/Cigarette/Thread/workthread.cpp +++ b/Cigarette/Thread/workthread.cpp @@ -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)); } diff --git a/Cigarette/Ui/dialogsetup.cpp b/Cigarette/Ui/dialogsetup.cpp index 7402d6c9..34626ff8 100644 --- a/Cigarette/Ui/dialogsetup.cpp +++ b/Cigarette/Ui/dialogsetup.cpp @@ -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); diff --git a/Cigarette/Ui/output_statistic.cpp b/Cigarette/Ui/output_statistic.cpp index bdbb0fbb..8607f805 100644 --- a/Cigarette/Ui/output_statistic.cpp +++ b/Cigarette/Ui/output_statistic.cpp @@ -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(); diff --git a/Cigarette/Ui/plcsetup.cpp b/Cigarette/Ui/plcsetup.cpp index 37166aca..cc2eba56 100644 --- a/Cigarette/Ui/plcsetup.cpp +++ b/Cigarette/Ui/plcsetup.cpp @@ -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()) { diff --git a/Cigarette/alg_jd.bak.jpg b/Cigarette/alg_jd.bak.jpg deleted file mode 100644 index 32cc04e0..00000000 Binary files a/Cigarette/alg_jd.bak.jpg and /dev/null differ diff --git a/Cigarette/alg_jd.jpg b/Cigarette/alg_jd.jpg deleted file mode 100644 index 5e4a89d0..00000000 Binary files a/Cigarette/alg_jd.jpg and /dev/null differ diff --git a/Cigarette/cigarette.cpp b/Cigarette/cigarette.cpp index a9b64b3f..8be54698 100644 --- a/Cigarette/cigarette.cpp +++ b/Cigarette/cigarette.cpp @@ -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 < 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]; diff --git a/Cigarette/common.h b/Cigarette/common.h index a911e243..1b43f0cf 100644 --- a/Cigarette/common.h +++ b/Cigarette/common.h @@ -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秒) diff --git a/Cigarette/pswd.txt b/Cigarette/conf/pswd.txt similarity index 100% rename from Cigarette/pswd.txt rename to Cigarette/conf/pswd.txt diff --git a/Cigarette/pswd_op.txt b/Cigarette/conf/pswd_op.txt similarity index 100% rename from Cigarette/pswd_op.txt rename to Cigarette/conf/pswd_op.txt diff --git a/Cigarette/conf/rotate.txt b/Cigarette/conf/rotate.txt new file mode 100644 index 00000000..48882cc8 --- /dev/null +++ b/Cigarette/conf/rotate.txt @@ -0,0 +1 @@ +0,3,0,3,0,3,0,3, \ No newline at end of file diff --git a/Cigarette/splash.jpg b/Cigarette/conf/splash.jpg similarity index 100% rename from Cigarette/splash.jpg rename to Cigarette/conf/splash.jpg diff --git a/Cigarette/main.cpp b/Cigarette/main.cpp index b7b3c76b..9f5e8770 100644 --- a/Cigarette/main.cpp +++ b/Cigarette/main.cpp @@ -30,7 +30,7 @@ int main(int argc, char* argv[]) } #endif qRegisterMetaType("cv::Mat"); - QPixmap pixmap("D:/Release/splash.jpg"); + QPixmap pixmap((ROOTPATH_PREFIX + SLASH + SPLASH_FILE).c_str()); QSplashScreen splash(pixmap); splash.show(); a.processEvents();