张洋 преди 4 дни
родител
ревизия
951f1a5441

BIN
bin/Win32/Debug/zhipuzi_pos_windows/concrt140d.dll


BIN
bin/Win32/Debug/zhipuzi_pos_windows/msvcp140d.dll


BIN
bin/Win32/Debug/zhipuzi_pos_windows/ucrtbased.dll


BIN
bin/Win32/Debug/zhipuzi_pos_windows/vcruntime140d.dll


BIN
bin/Win32/Release/zhipuzi_pos_windows/concrt140.dll


BIN
bin/Win32/Release/zhipuzi_pos_windows/msvcp140.dll


BIN
bin/Win32/Release/zhipuzi_pos_windows/ucrtbase.dll


BIN
bin/Win32/Release/zhipuzi_pos_windows/vcruntime140.dll


BIN
dll/debug/concrt140d.dll


BIN
dll/debug/msvcp140d.dll


BIN
dll/debug/ucrtbased.dll


BIN
dll/debug/vcruntime140d.dll


BIN
dll/release/concrt140.dll


BIN
dll/release/msvcp140.dll


BIN
dll/release/ucrtbase.dll


BIN
dll/release/vcruntime140.dll


+ 4 - 4
zhipuzi_pos_windows/ai/YoloFeatureManager.cpp

@@ -309,10 +309,10 @@ std::string YoloFeatureManager::Class(cv::Mat & image)
 		}
 
 		// 在画面上绘制分类结果
-		//std::wstring resultText = CLewaimaiString::ANSIToUnicode(className) + L" : " + std::to_wstring(round(topConfidence * 10000) / 100) + L"%";
-		//this->drawChineseText(image, resultText.c_str(), cv::Point(20, 50), cv::Scalar(0, 255, 0), 24);
-		//cv::imshow("YOLOv8s-cls 实时图像分类", image);
-		//if (cv::waitKey(30) >= 0); // 按任意键退出
+		std::wstring resultText = CLewaimaiString::ANSIToUnicode(className) + L" : " + std::to_wstring(round(topConfidence * 10000) / 100) + L"%";
+		this->drawChineseText(image, resultText.c_str(), cv::Point(20, 50), cv::Scalar(0, 255, 0), 24);
+		cv::imshow("YOLOv8s-cls 实时图像分类", image);
+		if (cv::waitKey(30) >= 0); // 按任意键退出
 
 		return className;
 	}

BIN
zhipuzi_pos_windows/resource/skin.zip


+ 122 - 111
zhipuzi_pos_windows/tool/CSqlite3.cpp

@@ -1,39 +1,50 @@
-#include "../pch/pch.h"
+#include "../pch/pch.h"
 #include "CSqlite3.h"
 
 #include "CSetting.h"
 
 CSqlite3::CSqlite3()
 {
-	std::wstring folderPath = CSystem::GetProgramDir() + L"\\db";
-	if (!CSystem::IsDirExist(folderPath))
+	try
 	{
-		LOG_INFO("folderPath:" << folderPath.c_str()<<",没有找到对应的目录,即将创建");
-		bool flag = CreateDirectory(folderPath.c_str(), NULL);
-		if (flag == false)
+		sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
+
+		std::wstring folderPath = CSystem::GetProgramDir() + L"\\db";
+		if (!CSystem::IsDirExist(folderPath))
 		{
-			LOG_INFO("新建 db 目录失败!");
+			LOG_INFO("folderPath:" << folderPath.c_str() << ",没有找到对应的目录,即将创建");
+			bool flag = CreateDirectory(folderPath.c_str(), NULL);
+			if (flag == false)
+			{
+				LOG_INFO("新建 db 目录失败!");
+			}
+
+			LOG_INFO("新建 db 目录成功!");
 		}
 
-		LOG_INFO("新建 db 目录成功!");
-	}
+		//濡傛灉娌℃湁杩欎釜鏂囦欢锛岃繖閲屼細鍒涘缓杩欎釜鏂囦欢
+		std::wstring path = CSystem::GetProgramDir() + L"\\db\\pos.db";
+		std::string s_path = CLewaimaiString::UnicodeToUTF8(path);
 
-    //如果没有这个文件,这里会创建这个文件
-	std::wstring path = CSystem::GetProgramDir() + L"\\db\\pos.db";
-	std::string s_path = CLewaimaiString::UnicodeToUTF8(path);
+		//LOG_INFO("s_path:" << s_path.c_str());
 
-    m_rc = sqlite3_open(s_path.c_str(), &m_db);
+		m_rc = sqlite3_open(s_path.c_str(), &m_db);
 
-    if(m_rc)
-    {
-        LOG_INFO("Can't open database: " << sqlite3_errmsg(m_db));
-        return;
-    }
+		if (m_rc != SQLITE_OK)
+		{
+			LOG_INFO("Can't open database: " << sqlite3_errmsg(m_db));
+			return;
+		}
 
-    else
-    {
-        //LOG_INFO("Opened database successfully");
-    }
+		//LOG_INFO("Opened database successfully");
+
+	}
+	catch (const std::exception& e)
+	{
+		std::string aa = std::string(e.what());
+		LOG_INFO(("创建数据库文件失败: " + std::string(e.what())).c_str());
+		return ;
+	}
 }
 
 CSqlite3::~CSqlite3()
@@ -45,46 +56,46 @@ CSqlite3::~CSqlite3()
 }
 
 /**
- * 对数据库表进行一些初始化和检查,这个函数每次程序启动的时候执行1次,就不会再执行了
+ * 对数据库表进行一些初始化和检查,这个函数每次程序启动的时候执行1次,就不会再执行了
  */
 bool CSqlite3::InitDB()
 {
-    //先处理pos_config表
+    //先处理pos_config表
 	bool ret = this->InitPosConfig();
 	if (!ret)
 	{
 		return false;
 	}
 
-	//再处理pos_chufang_printer表
+	//再处理pos_chufang_printer表
 	ret = this->InitPosChufangPrinter();
 	if (!ret)
 	{
 		return false;
 	}
 
-	//再处理pos_user表
+	//再处理pos_user表
 	ret = this->InitPosUser();
 	if (!ret)
 	{
 		return false;
 	}
 
-	//再处理pos_food表
+	//再处理pos_food表
 	ret = this->InitPosFood();
 	if (!ret)
 	{
 		return false;
 	}
 
-	//再处理pos_foodtype表
+	//再处理pos_foodtype表
 	ret = this->InitPosFoodType();
 	if (!ret)
 	{
 		return false;
 	}
 
-	//再处理pos_foodpackage表
+	//再处理pos_foodpackage表
 	ret = this->InitPosFoodPackage();
 	if (!ret)
 	{
@@ -96,7 +107,7 @@ bool CSqlite3::InitDB()
 
 bool CSqlite3::InitPosConfig()
 {
-	//检查有没有pos_config这个表,如果没有就创建
+	//检查有没有pos_config这个表,如果没有就创建
 	std::string sql = "SELECT COUNT(*) FROM sqlite_master where type = 'table' and name = 'pos_config';";
 	sqlite3_stmt * stmt = NULL;
 
@@ -108,7 +119,7 @@ bool CSqlite3::InitPosConfig()
 
 			if (count == 0)
 			{
-				//说明没找到这个表,那么这个时候新建这个表,先释放前面的stmt
+				//璇存槑娌℃壘鍒拌繖涓�〃锛岄偅涔堣繖涓�椂鍊欐柊寤鸿繖涓�〃锛屽厛閲婃斁鍓嶉潰鐨剆tmt
 				sqlite3_finalize(stmt);
 				stmt = NULL;
 
@@ -118,7 +129,7 @@ bool CSqlite3::InitPosConfig()
 
 				if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 				{
-					//执行该语句
+					//执行该语句
 					if (sqlite3_step(stmt) != SQLITE_DONE)
 					{
 						LOG_ERROR("create table fail: " << sqlite3_errmsg(m_db));
@@ -127,7 +138,7 @@ bool CSqlite3::InitPosConfig()
 						return false;
 					}
 
-					//走到这里就是表创建成功了
+					//璧板埌杩欓噷灏辨槸琛ㄥ垱寤烘垚鍔熶簡
 					//LOG_INFO("create table success");
 					sqlite3_finalize(stmt);
 				}
@@ -142,7 +153,7 @@ bool CSqlite3::InitPosConfig()
 			}
 			else
 			{
-				//说明已经有这个表了,就不用再创建了
+				//说明已经有这个表了,就不用再创建了
 				sqlite3_finalize(stmt);
 			}
 
@@ -163,21 +174,21 @@ bool CSqlite3::InitPosConfig()
 			}
 			else
 			{
-				//异常情况
+				//寮傚父鎯呭喌
 				sqlite3_finalize(stmt);
 				return false;
 			}
 		}
 		else
 		{
-			//异常情况
+			//寮傚父鎯呭喌
 			sqlite3_finalize(stmt);
 			return false;
 		}
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 		return false;
 	}
@@ -190,7 +201,7 @@ bool CSqlite3::InitPosChufangPrinter()
 	std::string sql = "SELECT COUNT(*) FROM sqlite_master where type = 'table' and name = 'pos_chufang_printer';";
 	sqlite3_stmt * stmt = NULL;
 
-	//读取厨房打印机的参数
+	//璇诲彇鍘ㄦ埧鎵撳嵃鏈虹殑鍙傛暟
 	if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 	{
 		if (sqlite3_step(stmt) == SQLITE_ROW)
@@ -199,7 +210,7 @@ bool CSqlite3::InitPosChufangPrinter()
 
 			if (count == 0)
 			{
-				//说明没找到这个表,那么这个时候新建这个表,先释放前面的stmt
+				//璇存槑娌℃壘鍒拌繖涓�〃锛岄偅涔堣繖涓�椂鍊欐柊寤鸿繖涓�〃锛屽厛閲婃斁鍓嶉潰鐨剆tmt
 				sqlite3_finalize(stmt);
 				stmt = NULL;
 
@@ -215,7 +226,7 @@ bool CSqlite3::InitPosChufangPrinter()
 
 				if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 				{
-					//执行该语句
+					//执行该语句
 					if (sqlite3_step(stmt) != SQLITE_DONE)
 					{
 						std::string err = sqlite3_errmsg(m_db);
@@ -225,7 +236,7 @@ bool CSqlite3::InitPosChufangPrinter()
 						return false;
 					}
 
-					//走到这里就是表创建成功了
+					//璧板埌杩欓噷灏辨槸琛ㄥ垱寤烘垚鍔熶簡
 					sqlite3_finalize(stmt);
 				}
 				else
@@ -239,11 +250,11 @@ bool CSqlite3::InitPosChufangPrinter()
 			}
 			else
 			{
-				//说明已经有这个表了,就不用再创建了
+				//说明已经有这个表了,就不用再创建了
 				sqlite3_finalize(stmt);
 			}
 
-			//兼容性检查,判断字段是否存在
+			//鍏煎�鎬ф�鏌ワ紝鍒ゆ柇瀛楁�鏄�惁瀛樺湪
 			std::string sql_pandduan = "select COUNT(*) from sqlite_master where type = 'table' and tbl_name = 'pos_chufang_printer' and sql like '%fenlei%';";
 			stmt = NULL;
 
@@ -255,7 +266,7 @@ bool CSqlite3::InitPosChufangPrinter()
 
 					if (count == 0)
 					{
-						//说明没找到这个字段,准备添加字段
+						//璇存槑娌℃壘鍒拌繖涓�瓧娈碉紝鍑嗗�娣诲姞瀛楁�
 						sqlite3_finalize(stmt);
 						stmt = NULL;
 
@@ -264,7 +275,7 @@ bool CSqlite3::InitPosChufangPrinter()
 
 						if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 						{
-							//执行该语句
+							//执行该语句
 							if (sqlite3_step(stmt) != SQLITE_DONE)
 							{
 								std::string err = sqlite3_errmsg(m_db);
@@ -274,7 +285,7 @@ bool CSqlite3::InitPosChufangPrinter()
 								return false;
 							}
 
-							//走到这里就是表创建成功了
+							//璧板埌杩欓噷灏辨槸琛ㄥ垱寤烘垚鍔熶簡
 							LOG_INFO("alter table success");
 							sqlite3_finalize(stmt);
 						}
@@ -289,14 +300,14 @@ bool CSqlite3::InitPosChufangPrinter()
 					}
 					else
 					{
-						//说明已经有这2个字段了
+						//璇存槑宸茬粡鏈夎繖2涓�瓧娈典簡
 						sqlite3_finalize(stmt);
 					}
 				}
 			}
 			else
 			{
-				//异常情况
+				//寮傚父鎯呭喌
 				sqlite3_finalize(stmt);
 				return false;
 			}
@@ -312,7 +323,7 @@ bool CSqlite3::InitPosChufangPrinter()
 
 					if (count == 0)
 					{
-						//说明没找到这个字段,准备添加字段
+						//璇存槑娌℃壘鍒拌繖涓�瓧娈碉紝鍑嗗�娣诲姞瀛楁�
 						sqlite3_finalize(stmt);
 						stmt = NULL;
 
@@ -321,7 +332,7 @@ bool CSqlite3::InitPosChufangPrinter()
 
 						if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 						{
-							//执行该语句
+							//执行该语句
 							if (sqlite3_step(stmt) != SQLITE_DONE)
 							{
 								std::string err = sqlite3_errmsg(m_db);
@@ -331,7 +342,7 @@ bool CSqlite3::InitPosChufangPrinter()
 								return false;
 							}
 
-							//走到这里就是表创建成功了
+							//璧板埌杩欓噷灏辨槸琛ㄥ垱寤烘垚鍔熶簡
 							sqlite3_finalize(stmt);
 						}
 
@@ -346,14 +357,14 @@ bool CSqlite3::InitPosChufangPrinter()
 					}
 					else
 					{
-						//说明已经有这2个字段了
+						//璇存槑宸茬粡鏈夎繖2涓�瓧娈典簡
 						sqlite3_finalize(stmt);
 					}
 				}
 			}
 			else
 			{
-				//异常情况
+				//寮傚父鎯呭喌
 				sqlite3_finalize(stmt);
 				return false;
 			}
@@ -373,7 +384,7 @@ bool CSqlite3::InitPosChufangPrinter()
 					std::string fenlei = (char*)sqlite3_column_text(stmt, 6);
 					std::string fenlei_ids = (char*)sqlite3_column_text(stmt, 7);
 
-					//这里仅仅是把数据库内容读到内存,所以之类用false
+					//杩欓噷浠呬粎鏄�妸鏁版嵁搴撳唴瀹硅�鍒板唴瀛橈紝鎵€浠ヤ箣绫荤敤false
 					CSetting::GetInstance()->AddChufangPrinter(date, name, ip, guige, fendan, fenlei, fenlei_ids, false);
 				}
 
@@ -381,7 +392,7 @@ bool CSqlite3::InitPosChufangPrinter()
 			}
 			else
 			{
-				//异常情况
+				//寮傚父鎯呭喌
 				sqlite3_finalize(stmt);
 				return false;
 			}
@@ -396,7 +407,7 @@ bool CSqlite3::InitPosUser()
 	std::string sql = "SELECT COUNT(*) FROM sqlite_master where type = 'table' and name = 'pos_user';";
 	sqlite3_stmt * stmt = NULL;	
 
-	//读取厨房打印机的参数
+	//璇诲彇鍘ㄦ埧鎵撳嵃鏈虹殑鍙傛暟
 	if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 	{
 		if (sqlite3_step(stmt) == SQLITE_ROW)
@@ -405,7 +416,7 @@ bool CSqlite3::InitPosUser()
 
 			if (count == 0)
 			{
-				//说明没找到这个表,那么这个时候新建这个表,先释放前面的stmt
+				//璇存槑娌℃壘鍒拌繖涓�〃锛岄偅涔堣繖涓�椂鍊欐柊寤鸿繖涓�〃锛屽厛閲婃斁鍓嶉潰鐨剆tmt
 				sqlite3_finalize(stmt);
 				stmt = NULL;
 
@@ -416,7 +427,7 @@ bool CSqlite3::InitPosUser()
 
 				if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 				{
-					//执行该语句
+					//执行该语句
 					if (sqlite3_step(stmt) != SQLITE_DONE)
 					{
 						std::string err = sqlite3_errmsg(m_db);
@@ -426,7 +437,7 @@ bool CSqlite3::InitPosUser()
 						return false;
 					}
 
-					//走到这里就是表创建成功了
+					//璧板埌杩欓噷灏辨槸琛ㄥ垱寤烘垚鍔熶簡
 					//LOG_INFO("create table success");
 					sqlite3_finalize(stmt);
 				}
@@ -441,7 +452,7 @@ bool CSqlite3::InitPosUser()
 			}
 			else
 			{
-				//说明已经有这个表了,就不用再创建了
+				//说明已经有这个表了,就不用再创建了
 				sqlite3_finalize(stmt);
 			}
 
@@ -455,7 +466,7 @@ bool CSqlite3::InitPosUser()
 					std::string username = (char*)sqlite3_column_text(stmt, 1);
 					std::string password = (char*)sqlite3_column_text(stmt, 2);
 
-					//这里仅仅是把数据库内容读到内存,所以之类用false
+					//杩欓噷浠呬粎鏄�妸鏁版嵁搴撳唴瀹硅�鍒板唴瀛橈紝鎵€浠ヤ箣绫荤敤false
 					CSetting::GetInstance()->SetUser(username, password);
 				}
 
@@ -463,7 +474,7 @@ bool CSqlite3::InitPosUser()
 			}
 			else
 			{
-				//异常情况
+				//寮傚父鎯呭喌
 				sqlite3_finalize(stmt);
 				return false;
 			}
@@ -475,7 +486,7 @@ bool CSqlite3::InitPosUser()
 
 bool CSqlite3::InitPosFood()
 {
-	//检查有没有pos_food这个表,如果没有就创建
+	//检查有没有pos_food这个表,如果没有就创建
 	std::string sql = "SELECT COUNT(*) FROM sqlite_master where type = 'table' and name = 'pos_food';";
 	sqlite3_stmt * stmt = NULL;
 
@@ -487,7 +498,7 @@ bool CSqlite3::InitPosFood()
 
 			if (count == 0)
 			{
-				//说明没找到这个表,那么这个时候新建这个表,先释放前面的stmt
+				//璇存槑娌℃壘鍒拌繖涓�〃锛岄偅涔堣繖涓�椂鍊欐柊寤鸿繖涓�〃锛屽厛閲婃斁鍓嶉潰鐨剆tmt
 				sqlite3_finalize(stmt);
 				stmt = NULL;
 
@@ -527,7 +538,7 @@ bool CSqlite3::InitPosFood()
 
 				if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 				{
-					//执行该语句
+					//执行该语句
 					if (sqlite3_step(stmt) != SQLITE_DONE)
 					{
 						LOG_ERROR("create table fail: " << sqlite3_errmsg(m_db));
@@ -536,7 +547,7 @@ bool CSqlite3::InitPosFood()
 						return false;
 					}
 
-					//走到这里就是表创建成功了
+					//璧板埌杩欓噷灏辨槸琛ㄥ垱寤烘垚鍔熶簡
 					//LOG_INFO("create table success");
 					sqlite3_finalize(stmt);
 				}
@@ -551,20 +562,20 @@ bool CSqlite3::InitPosFood()
 			}
 			else
 			{
-				//说明已经有这个表了,就不用再创建了
+				//说明已经有这个表了,就不用再创建了
 				sqlite3_finalize(stmt);
 			}
 		}
 		else
 		{
-			//异常情况
+			//寮傚父鎯呭喌
 			sqlite3_finalize(stmt);
 			return false;
 		}
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 		return false;
 	}
@@ -574,7 +585,7 @@ bool CSqlite3::InitPosFood()
 
 bool CSqlite3::InitPosFoodType()
 {
-	//检查有没有pos_foodtype这个表,如果没有就创建
+	//检查有没有pos_foodtype这个表,如果没有就创建
 	std::string sql = "SELECT COUNT(*) FROM sqlite_master where type = 'table' and name = 'pos_foodtype';";
 	sqlite3_stmt * stmt = NULL;
 
@@ -586,7 +597,7 @@ bool CSqlite3::InitPosFoodType()
 
 			if (count == 0)
 			{
-				//说明没找到这个表,那么这个时候新建这个表,先释放前面的stmt
+				//璇存槑娌℃壘鍒拌繖涓�〃锛岄偅涔堣繖涓�椂鍊欐柊寤鸿繖涓�〃锛屽厛閲婃斁鍓嶉潰鐨剆tmt
 				sqlite3_finalize(stmt);
 				stmt = NULL;
 
@@ -598,7 +609,7 @@ bool CSqlite3::InitPosFoodType()
 
 				if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 				{
-					//执行该语句
+					//执行该语句
 					if (sqlite3_step(stmt) != SQLITE_DONE)
 					{
 						LOG_ERROR("create table fail: " << sqlite3_errmsg(m_db));
@@ -607,7 +618,7 @@ bool CSqlite3::InitPosFoodType()
 						return false;
 					}
 
-					//走到这里就是表创建成功了
+					//璧板埌杩欓噷灏辨槸琛ㄥ垱寤烘垚鍔熶簡
 					//LOG_INFO("create table success");
 					sqlite3_finalize(stmt);
 				}
@@ -622,20 +633,20 @@ bool CSqlite3::InitPosFoodType()
 			}
 			else
 			{
-				//说明已经有这个表了,就不用再创建了
+				//说明已经有这个表了,就不用再创建了
 				sqlite3_finalize(stmt);
 			}
 		}
 		else
 		{
-			//异常情况
+			//寮傚父鎯呭喌
 			sqlite3_finalize(stmt);
 			return false;
 		}
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 		return false;
 	}
@@ -645,7 +656,7 @@ bool CSqlite3::InitPosFoodType()
 
 bool CSqlite3::InitPosFoodPackage()
 {
-	//检查有没有pos_foodpackage这个表,如果没有就创建
+	//检查有没有pos_foodpackage这个表,如果没有就创建
 	std::string sql = "SELECT COUNT(*) FROM sqlite_master where type = 'table' and name = 'pos_foodpackage';";
 	sqlite3_stmt * stmt = NULL;
 
@@ -657,7 +668,7 @@ bool CSqlite3::InitPosFoodPackage()
 
 			if (count == 0)
 			{
-				//说明没找到这个表,那么这个时候新建这个表,先释放前面的stmt
+				//璇存槑娌℃壘鍒拌繖涓�〃锛岄偅涔堣繖涓�椂鍊欐柊寤鸿繖涓�〃锛屽厛閲婃斁鍓嶉潰鐨剆tmt
 				sqlite3_finalize(stmt);
 				stmt = NULL;
 
@@ -679,7 +690,7 @@ bool CSqlite3::InitPosFoodPackage()
 
 				if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 				{
-					//执行该语句
+					//执行该语句
 					if (sqlite3_step(stmt) != SQLITE_DONE)
 					{
 						LOG_ERROR("create table fail: " << sqlite3_errmsg(m_db));
@@ -688,7 +699,7 @@ bool CSqlite3::InitPosFoodPackage()
 						return false;
 					}
 
-					//走到这里就是表创建成功了
+					//璧板埌杩欓噷灏辨槸琛ㄥ垱寤烘垚鍔熶簡
 					//LOG_INFO("create table success");
 					sqlite3_finalize(stmt);
 				}
@@ -703,20 +714,20 @@ bool CSqlite3::InitPosFoodPackage()
 			}
 			else
 			{
-				//说明已经有这个表了,就不用再创建了
+				//说明已经有这个表了,就不用再创建了
 				sqlite3_finalize(stmt);
 			}
 		}
 		else
 		{
-			//异常情况
+			//寮傚父鎯呭喌
 			sqlite3_finalize(stmt);
 			return false;
 		}
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 		return false;
 	}
@@ -817,7 +828,7 @@ bool CSqlite3::InitFoodData(rapidjson::Value& foodrows)
 {
 	this->ExeSQl("begin;");
 
-	//先清空之前的旧数据,重新完整写入新数据
+	//先清空之前的旧数据,重新完整写入新数据
 	std::string sql_delete = "delete from pos_food;";
 	this->ExeSQl(sql_delete);
 
@@ -879,7 +890,7 @@ bool CSqlite3::InitFoodData(rapidjson::Value& foodrows)
 			weight_food_code = "";
 		}
 
-		//插入一个商品数据
+		//插入一个商品数据
 		std::string sql = "INSERT INTO pos_food (id,shop_id,name,price,tag,status,type_id,is_dabao,dabao_money,is_nature,nature,autostocknum,goods_img,unit,barcode,member_price_used,member_price, \
 			buying_price,stock,stockvalid,stock_warning,is_shouyinji_show,is_waimai_show,is_tangshi_show,is_zhengcan_show,expiration_date,is_weight,member_price_json,weight_plu_code,weight_food_code,jiagong_type,cost_mode) VALUES ('" + id + "' ,'" + shop_id + "','" \
 			+ name + "', '" + price + "', '" + tag + "', '" + status + "', '" + type_id + "', '" + is_dabao + "', '" + dabao_money + "', '" + is_nature + "', '" + nature + "', '" \
@@ -889,7 +900,7 @@ bool CSqlite3::InitFoodData(rapidjson::Value& foodrows)
 		bool ret = this->ExeSQl(sql);
 		if (!ret)
 		{
-			LOG_INFO("商品插入失败,sql:" << sql.c_str());
+			LOG_INFO("鍟嗗搧鎻掑叆澶辫触锛宻ql:" << sql.c_str());
 			return false;
 		}
 	}
@@ -903,7 +914,7 @@ bool CSqlite3::InitFoodtypeData(rapidjson::Value& foodtyperows)
 {
 	this->ExeSQl("begin;");
 
-	//先清空之前的旧数据,重新完整写入新数据
+	//先清空之前的旧数据,重新完整写入新数据
 	std::string sql = "delete from pos_foodtype;";
 	this->ExeSQl(sql);
 
@@ -916,13 +927,13 @@ bool CSqlite3::InitFoodtypeData(rapidjson::Value& foodtyperows)
 		std::string is_shouyinji_show = CLewaimaiString::SqlZhuanyi(CLewaimaiJson::ToString(foodtypeinfo["is_shouyinji_show"]));
 		std::string tag = CLewaimaiString::SqlZhuanyi(CLewaimaiJson::ToString(foodtypeinfo["tag"]));
 
-		//插入一个商品数据
+		//插入一个商品数据
 		std::string sql = "INSERT INTO pos_foodtype (id,name,is_shouyinji_show,tag) VALUES ('" + type_id + "' ,'" +  name + "', '" + is_shouyinji_show + "', '" + tag + "')";
 
 		bool ret = this->ExeSQl(sql);
 		if (!ret)
 		{
-			LOG_INFO("商品分类插入失败:" << i);
+			LOG_INFO("商品分类插入失败:" << i);
 			return false;
 		}
 	}
@@ -934,7 +945,7 @@ bool CSqlite3::InitFoodtypeData(rapidjson::Value& foodtyperows)
 
 bool CSqlite3::InitFoodpackageData(rapidjson::Value& foodpackagerows)
 {
-	//先清空之前的旧数据,重新完整写入新数据
+	//先清空之前的旧数据,重新完整写入新数据
 	this->ExeSQl("begin;");
 
 	std::string sql = "delete from pos_foodpackage;";
@@ -961,7 +972,7 @@ bool CSqlite3::InitFoodpackageData(rapidjson::Value& foodpackagerows)
 		std::string is_shouyinji_show = CLewaimaiString::SqlZhuanyi(CLewaimaiJson::ToString(foodinfo["is_shouyinji_show"]));
 		std::string barcode = CLewaimaiString::SqlZhuanyi(CLewaimaiJson::ToString(foodinfo["barcode"]));
 
-		//插入一个商品数据
+		//插入一个商品数据
 		std::string sql = "INSERT INTO pos_foodpackage (id,shop_id,name,price,tag,status,is_dabao,dabao_money,nature,goods_img,unit,supporttype,is_shouyinji_show,barcode) VALUES ('" + id + "' ,'" + shop_id + "','" \
 			+ name + "', '" + price + "', '" + tag + "', '" + status + "', '" + is_dabao + "', '" + dabao_money +  "', '" + nature + "', '" \
 			+ goods_img + "', '" + unit + "', '" + supporttype + "', '" + is_shouyinji_show + "', '" + barcode + "')";
@@ -969,7 +980,7 @@ bool CSqlite3::InitFoodpackageData(rapidjson::Value& foodpackagerows)
 		bool ret = this->ExeSQl(sql);
 		if (!ret)
 		{
-			LOG_INFO("商品套餐插入失败:" << i);
+			LOG_INFO("商品套餐插入失败:" << i);
 			return false;
 		}
 	}
@@ -986,7 +997,7 @@ bool CSqlite3::UpdateOneFood(rapidjson::Value& foodrows)
 	rapidjson::Value& foodinfo = foodrows;
 	std::string id = CLewaimaiString::SqlZhuanyi(foodinfo["goods_id"].GetString());
 
-	//不管当前有没有这个商品,执行一下删除
+	//不管当前有没有这个商品,执行一下删除
 	std::string sql_delete = "delete from pos_food where id = '" + id + "';";
 	this->ExeSQl(sql_delete);
 	
@@ -1062,7 +1073,7 @@ bool CSqlite3::UpdateOneFood(rapidjson::Value& foodrows)
 		weight_food_code = "";
 	}
 
-	//插入一个商品数据
+	//插入一个商品数据
 	std::string sql = "INSERT INTO pos_food (id,shop_id,name,price,tag,status,type_id,is_dabao,dabao_money,is_nature,nature,autostocknum,goods_img,unit,barcode,member_price_used,member_price, \
 			buying_price,stock,stockvalid,stock_warning,is_shouyinji_show,is_waimai_show,is_tangshi_show,is_zhengcan_show,expiration_date,is_weight,member_price_json,weight_plu_code,weight_food_code,jiagong_type,cost_mode) VALUES ('" + id + "' ,'" + shop_id + "','" \
 		+ name + "', '" + price + "', '" + tag + "', '" + status + "', '" + type_id + "', '" + is_dabao + "', '" + dabao_money + "', '" + is_nature + "', '" + nature + "', '" \
@@ -1086,7 +1097,7 @@ bool CSqlite3::DeleteOneFood(std::string food_id)
 
 	this->ExeSQl("begin;");
 
-	//不管当前有没有这个商品,执行一下删除
+	//不管当前有没有这个商品,执行一下删除
 	std::string sql_delete = "delete from pos_food where id = '" + food_id + "';";
 	this->ExeSQl(sql_delete);
 
@@ -1104,13 +1115,13 @@ bool CSqlite3::AddOneFoodtype(std::string type_id, std::string name, std::string
 	is_shouyinji_show = CLewaimaiString::SqlZhuanyi(is_shouyinji_show);
 	tag = CLewaimaiString::SqlZhuanyi(tag);
 
-	//插入一个商品数据
+	//插入一个商品数据
 	std::string sql = "INSERT INTO pos_foodtype (id,name,is_shouyinji_show,tag) VALUES ('" + type_id + "' ,'" + name + "', '" + is_shouyinji_show + "', '" + tag + "')";
 
 	bool ret = this->ExeSQl(sql);
 	if (!ret)
 	{
-		LOG_INFO("商品分类插入失败:");
+		LOG_INFO("商品分类插入失败:");
 		return false;
 	}
 
@@ -1140,7 +1151,7 @@ bool CSqlite3::ExeSQl(std::string sql)
 	return true;
 }
 
-//获取套餐商品的数量
+//获取套餐商品的数量
 int CSqlite3::GetFoodpackageNum()
 {
 	int count = 0;
@@ -1159,7 +1170,7 @@ int CSqlite3::GetFoodpackageNum()
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
@@ -1205,7 +1216,7 @@ std::vector<CFoodType> CSqlite3::GetFoodtypes(bool is_shouyinji_show)
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
@@ -1238,7 +1249,7 @@ bool CSqlite3::GetFoodtypeById(std::string foodtype_id, CFoodType& newFoodType)
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
@@ -1246,7 +1257,7 @@ bool CSqlite3::GetFoodtypeById(std::string foodtype_id, CFoodType& newFoodType)
 }
 
 /**
- * 如果type_id为0,表示读取所有商品,否则只读取当前type_id的商品
+ * 如果type_id为0,表示读取所有商品,否则只读取当前type_id的商品
  */
 std::vector<CFood> CSqlite3::GetFoodByTypeid(std::string type_id, bool is_shouyinji_show)
 {
@@ -1320,7 +1331,7 @@ std::vector<CFood> CSqlite3::GetFoodByTypeid(std::string type_id, bool is_shouyi
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
@@ -1383,7 +1394,7 @@ std::vector<CFood> CSqlite3::GetFoodForTiaomacheng()
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
@@ -1457,7 +1468,7 @@ std::vector<CFood> CSqlite3::GetFoodByFoodname(std::string foodname, bool is_sho
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
@@ -1509,7 +1520,7 @@ std::vector<CFoodpackage> CSqlite3::GetFoodpackages(bool is_shouyinji_show)
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
@@ -1570,7 +1581,7 @@ bool CSqlite3::GetFoodById(std::string food_id, CFood& newFood)
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
@@ -1631,7 +1642,7 @@ bool CSqlite3::GetFoodByBarcode(std::string barcode, CFood& newFood)
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
@@ -1692,7 +1703,7 @@ bool CSqlite3::GetFoodByPluBianma(std::string barcode, CFood& newFood)
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
@@ -1733,14 +1744,14 @@ bool CSqlite3::GetFoodpackageById(std::string foodpackage_id, CFoodpackage& newF
 	}
 	else
 	{
-		//异常情况
+		//寮傚父鎯呭喌
 		sqlite3_finalize(stmt);
 	}
 
 	return is_found;
 }
 
-//更新商品ID的库存
+//更新商品ID的库存
 void CSqlite3::UpdateFoodStock(std::string food_id, std::string stock)
 {
 	food_id = CLewaimaiString::SqlZhuanyi(food_id);

+ 6 - 5
zhipuzi_pos_windows/worker/CDiandanAIShibieWorker.cpp

@@ -73,7 +73,7 @@ void CDiandanAIShibieWorker::HandleDiandanAIShibie()
 				continue;
 			}
 
-			//auto time_1 = std::chrono::high_resolution_clock::now();
+			auto time_1 = std::chrono::high_resolution_clock::now();
 
 			m_ai_shibie_foodname = m_yoloFeatureManager.ClassFromVideoCapture();
 
@@ -86,11 +86,12 @@ void CDiandanAIShibieWorker::HandleDiandanAIShibie()
 				std::cout << "未检测到任何类别。" << std::endl;
 			}
 
-			//auto time_2 = std::chrono::high_resolution_clock::now();
+			auto time_2 = std::chrono::high_resolution_clock::now();
 
-			//auto duration_1 = std::chrono::duration_cast<std::chrono::milliseconds>(time_2 - time_1);
-			//std::wstring msg = L"摄像头识别耗时: " + std::to_wstring(duration_1.count()) + L" 毫秒";
-			//DEBUG_LOG(msg.c_str());
+			auto duration_1 = std::chrono::duration_cast<std::chrono::milliseconds>(time_2 - time_1);
+			std::wstring msg = L"摄像头识别耗时: " + std::to_wstring(duration_1.count()) + L" 毫秒";
+			DEBUG_LOG(msg.c_str());
+			LOG_INFO(std::to_wstring(duration_1.count()));
 
 			//主线程里面去处理界面刷新
 			if (m_hwnd != NULL)

+ 1 - 1
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -177,7 +177,7 @@ copy $(SolutionDir)res\ai\ $(SolutionDir)bin\$(Platform)\$(Configuration)\$(Proj
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <DisableSpecificWarnings>4099;4091;4838;4244;4819</DisableSpecificWarnings>
       <LanguageStandard>stdcpp17</LanguageStandard>
-      <EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
+      <EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
       <OpenMPSupport>true</OpenMPSupport>
     </ClCompile>
     <Link>