|  |  | @ -122,12 +122,12 @@ Cigarette::Cigarette(QWidget* parent) | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (!dirinfo->exists()) { |  |  |  |         if (!dirinfo->exists()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             // 如果文件夹信息不存在
 |  |  |  |             // 如果文件夹信息不存在
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             delete dirinfo, dirinfo = nullptr; |  |  |  |             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; |  |  |  |         delete dirinfo, dirinfo = nullptr; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     else |  |  |  |     else | 
			
		
	
		
		
			
				
					
					|  |  |  |         g_conf_path.config_path = "D:/conf"; |  |  |  |         g_conf_path.config_path = QString::fromStdString(ROOTPATH_PREFIX + SLASH + CONFPATH); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     bool update_rotate = false; |  |  |  |     bool update_rotate = false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (!read_rotate_message()) { |  |  |  |     if (!read_rotate_message()) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -247,11 +247,11 @@ Cigarette::Cigarette(QWidget* parent) | 
			
		
	
		
		
			
				
					
					|  |  |  |     quantity_stop_count = 0; |  |  |  |     quantity_stop_count = 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |     g_seconds = 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);	//初始化系统配置
 |  |  |  |     read_sys_config(g_sys_conf, config_path);	//初始化系统配置
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (g_sys_conf.model_path.isEmpty()) { |  |  |  |     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()) { |  |  |  |     if (g_sys_conf.model_name.isEmpty()) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -1061,12 +1061,12 @@ void Cigarette::OnKey(QKeyEvent* event) | 
			
		
	
		
		
			
				
					
					|  |  |  |         std::fstream cfg_file; |  |  |  |         std::fstream cfg_file; | 
			
		
	
		
		
			
				
					
					|  |  |  |         char buf[256]; |  |  |  |         char buf[256]; | 
			
		
	
		
		
			
				
					
					|  |  |  |         memset(buf, 0, 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; |  |  |  |         QString rects_file = g_conf_path.config_path + "/" + buf; | 
			
		
	
		
		
			
				
					
					|  |  |  |         cfg_file.open(rects_file.toLocal8Bit().constData(), ios::trunc | ofstream::out); |  |  |  |         cfg_file.open(rects_file.toLocal8Bit().constData(), ios::trunc | ofstream::out); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (!cfg_file.is_open()) |  |  |  |         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; |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         for (int i = 0; i < g_display_label_conf[Num].RectVet[Cnt].size(); i++) |  |  |  |         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; |  |  |  |         std::fstream cfg_file; | 
			
		
	
		
		
			
				
					
					|  |  |  |         char buf[256]; |  |  |  |         char buf[256]; | 
			
		
	
		
		
			
				
					
					|  |  |  |         memset(buf, 0, 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; |  |  |  |         QString rects_file = g_conf_path.config_path + "/" + buf; | 
			
		
	
		
		
			
				
					
					|  |  |  |         cfg_file.open(rects_file.toLocal8Bit().constData()); |  |  |  |         cfg_file.open(rects_file.toLocal8Bit().constData()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (!cfg_file.is_open()) |  |  |  |         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; |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         while (!cfg_file.eof()) |  |  |  |         while (!cfg_file.eof()) | 
			
		
	
	
		
		
			
				
					|  |  | @ -1256,12 +1256,12 @@ void Cigarette::OnTPClickHub(int Num_Cnt) | 
			
		
	
		
		
			
				
					
					|  |  |  |         std::fstream cfg_file; |  |  |  |         std::fstream cfg_file; | 
			
		
	
		
		
			
				
					
					|  |  |  |         char buf[256]; |  |  |  |         char buf[256]; | 
			
		
	
		
		
			
				
					
					|  |  |  |         memset(buf, 0, 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; |  |  |  |         QString rects_file = g_conf_path.config_path + "/" + buf; | 
			
		
	
		
		
			
				
					
					|  |  |  |         cfg_file.open(rects_file.toLocal8Bit().constData()); |  |  |  |         cfg_file.open(rects_file.toLocal8Bit().constData()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (!cfg_file.is_open()) |  |  |  |         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; |  |  |  |             return; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         while (!cfg_file.eof()) |  |  |  |         while (!cfg_file.eof()) | 
			
		
	
	
		
		
			
				
					|  |  | @ -2112,10 +2112,11 @@ void Cigarette::on_pushButton_clear_released()//换班 | 
			
		
	
		
		
			
				
					
					|  |  |  | QString Cigarette::read_pswd() |  |  |  | QString Cigarette::read_pswd() | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |     std::fstream cfg_file; |  |  |  |     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()) |  |  |  |     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"; |  |  |  |         return "81dc9bdb52d04dc20036dbd8313ed055"; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (!cfg_file.eof()) |  |  |  |     if (!cfg_file.eof()) | 
			
		
	
	
		
		
			
				
					|  |  | @ -2144,10 +2145,11 @@ QString Cigarette::read_pswd() | 
			
		
	
		
		
			
				
					
					|  |  |  | QString Cigarette::read_op_pswd() |  |  |  | QString Cigarette::read_op_pswd() | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |     std::fstream cfg_file; |  |  |  |     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()) |  |  |  |     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"; |  |  |  |         return "81dc9bdb52d04dc20036dbd8313ed055"; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (!cfg_file.eof()) |  |  |  |     if (!cfg_file.eof()) | 
			
		
	
	
		
		
			
				
					|  |  | @ -2174,9 +2176,10 @@ QString Cigarette::read_op_pswd() | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | bool Cigarette::read_conf(ConfPath& conf_path) { |  |  |  | bool Cigarette::read_conf(ConfPath& conf_path) { | 
			
		
	
		
		
			
				
					
					|  |  |  |     std::fstream conf_file; |  |  |  |     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()) { |  |  |  |     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; |  |  |  |         return false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     while (!conf_file.eof()) { |  |  |  |     while (!conf_file.eof()) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -2603,11 +2606,11 @@ bool Cigarette::read_modbus_config(ModbusConf& conf) | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |     QString str_kick; |  |  |  |     QString str_kick; | 
			
		
	
		
		
			
				
					
					|  |  |  |     std::fstream cfg_file; |  |  |  |     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()); |  |  |  |     cfg_file.open(modbus_file.toLocal8Bit().constData()); | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (!cfg_file.is_open()) |  |  |  |     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; |  |  |  |         return false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     while (!cfg_file.eof()) |  |  |  |     while (!cfg_file.eof()) | 
			
		
	
	
		
		
			
				
					|  |  | @ -2662,11 +2665,11 @@ bool Cigarette::read_modbus_config(ModbusConf& conf) | 
			
		
	
		
		
			
				
					
					|  |  |  | bool Cigarette::read_rotate_message() |  |  |  | bool Cigarette::read_rotate_message() | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |     std::fstream cfg_file; |  |  |  |     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()); |  |  |  |     cfg_file.open(rotate_file.toLocal8Bit().constData()); | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (!cfg_file.is_open()) |  |  |  |     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; |  |  |  |         return false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (!cfg_file.eof()) |  |  |  |     if (!cfg_file.eof()) | 
			
		
	
	
		
		
			
				
					|  |  | @ -2699,11 +2702,11 @@ bool Cigarette::read_rotate_message() | 
			
		
	
		
		
			
				
					
					|  |  |  | bool Cigarette::save_rotate_message() |  |  |  | bool Cigarette::save_rotate_message() | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |     std::fstream cfg_file; |  |  |  |     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); |  |  |  |     cfg_file.open(rotate_file.toLocal8Bit().constData(), ios::trunc | ofstream::out); | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (!cfg_file.is_open()) |  |  |  |     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; |  |  |  |         return false; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     for (int i = 0; i < NumberOfSupportedCameras; i++) { |  |  |  |     for (int i = 0; i < NumberOfSupportedCameras; i++) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -2782,7 +2785,7 @@ QImage Cigarette::cvMatToQImage(const cv::Mat& mat) | 
			
		
	
		
		
			
				
					
					|  |  |  | void Cigarette::read_plc_items() |  |  |  | void Cigarette::read_plc_items() | 
			
		
	
		
		
			
				
					
					|  |  |  | { |  |  |  | { | 
			
		
	
		
		
			
				
					
					|  |  |  |     std::fstream cfg_file; |  |  |  |     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()); |  |  |  |     cfg_file.open(plc_file.toLocal8Bit().constData()); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (!cfg_file.is_open()) |  |  |  |     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) { |  |  |  |         if (SingleCamInfo[i].IsOpen && quantity > 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             std::fstream cfg_file; |  |  |  |             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; |  |  |  |             file_path = g_conf_path.config_path + "/" + file_name; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             char buf[256]; |  |  |  |             char buf[256]; | 
			
		
	
	
		
		
			
				
					|  |  | 
 |