Browse Source

开始做AI学习功能

张洋 15 hours ago
parent
commit
bd6ddaf201

+ 38 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/aixuexi_page.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window>
+	<Font id="0" name="微软雅黑" size="24" />
+	<Font id="aixuexi_1" name="微软雅黑" size="28" />
+	<Font id="2" name="微软雅黑" size="16" />
+	<Font id="3" name="微软雅黑" size="14" />
+    <Font id="4" name="微软雅黑" size="12" />
+
+	<AIxuexiPage>
+		<HorizontalLayout>
+			<Control width="1" bkcolor="#FFD1D1D1"></Control>
+			
+            <VerticalLayout name="aixuexi_page_paishe_layout" width="500" padding="0,0,0,0" bordercorner="10,10" bkcolor="#FFFFFFFF">
+                <Label name="aixuexi_page_xuanzhong_food_name" text="未选中商品" heiht="40" padding="10,10,10,10" font="aixuexi_1"></Label>
+
+                <Label name="aixuexi_page_xuanzhong_food_name" multiline="true" text="智铺子AI识别默认就能识别几百种常见的水果蔬菜,这些常见的水果蔬菜无需学习,只有智铺子AI无法正常识别的冷门商品或非水果蔬菜类商品才需要学习。" heiht="60" padding="10,0,10,10" font="4"></Label>
+
+                <Control height="1" bkcolor="#FFEBE8E8" padding="10,0,10,0"></Control>
+
+                <Control height="350"></Control>
+
+                <HorizontalLayout height="50">
+                    <Control></Control>
+                        <Button name="aixuexi_page_paishe_btn" width="150" height="50" text="拍摄并学习" textcolor="#FFFFFFFF" padding="0,10,0,0" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
+                    <Control></Control>
+                </HorizontalLayout>
+
+                
+            </VerticalLayout>
+
+            <Control width="1" bkcolor="#FFD1D1D1"></Control>
+
+            <VerticalLayout name="aixuexi_page_food_layout" padding="15,0,0,0" bordercorner="10,10" bkcolor="#FFFFFFFF">
+
+            </VerticalLayout>    
+		</HorizontalLayout>
+	</AIxuexiPage>
+</Window>

+ 2 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_page.xml

@@ -118,6 +118,8 @@
 					<Control bkimage="search_icon.png" width="25" height="26" pos="45,23,70,49" float="true"></Control>
 					
 					<Button name="diandan_food_search_clear" visible="false" normalimage="search_clear.png" hotimage="search_clear.png" pushedimage="search_clear.png" bkimage="search_clear.png" width="23" height="23" pos="365,23,68,46" float="true"></Button>
+
+					<Button name="diandan_page_aixuexi_btn" width="120" height="50" text="AI学习" textcolor="#FFFFFFFF" padding="30,10,0,0" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
 				</HorizontalLayout>
 			</VerticalLayout>
 			

+ 5 - 0
zhipuzi_pos_windows/control/ControlEx.h

@@ -25,6 +25,7 @@
 #include "../page/CShoukuanPageUI.h"
 #include "../page/CShoukuanOrderListPageUI.h"
 #include "../page/CShoukuanOrderInfoPageUI.h"
+#include "../page/CAIxuexiPageUI.h"
 
 #include "CWaimaiOrderItemUI.h"
 #include "CDianneiOrderItemUI.h"
@@ -135,6 +136,10 @@ public:
 		{
 			return new CShoukuanOrderInfoPageUI;
 		}
+		else if (_tcscmp(pstrClass, _T("AIxuexiPage")) == 0)
+		{
+			return new CAIxuexiPageUI;
+		}
 
 		//控件相关的
 		else if (_tcscmp(pstrClass, _T("WaimaiOrderItem")) == 0)

+ 52 - 0
zhipuzi_pos_windows/page/CAIxuexiPageUI.cpp

@@ -0,0 +1,52 @@
+#include "CAIxuexiPageUI.h"
+
+CAIxuexiPageUI::CAIxuexiPageUI()
+{
+
+}
+
+CAIxuexiPageUI::~CAIxuexiPageUI()
+{
+
+}
+
+
+void CAIxuexiPageUI::InitShow()
+{
+
+}
+
+//处理按钮点击类事件
+void CAIxuexiPageUI::HandleClickMsg(TNotifyUI& msg)
+{
+
+}
+
+
+void CAIxuexiPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
+{
+
+}
+
+void CAIxuexiPageUI::HandleItemSelectMsg(TNotifyUI& msg)
+{
+
+}
+
+
+void CAIxuexiPageUI::HandleTextChangedMsg(TNotifyUI& msg)
+{
+
+}
+
+
+void CAIxuexiPageUI::HandleTextCapture(std::string content)
+{
+
+}
+
+
+bool CAIxuexiPageUI::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+	return false;
+}

+ 36 - 0
zhipuzi_pos_windows/page/CAIxuexiPageUI.h

@@ -0,0 +1,36 @@
+#pragma once
+
+#include "../pch/pch.h"
+#include "CBasePageUI.h"
+
+#include "../wnd/CModalWnd.h"
+
+class CAIxuexiPageUI : public CBasePageUI
+{
+public:
+	CAIxuexiPageUI();
+
+	~CAIxuexiPageUI();
+
+	//初始化当前页面的展示,处理默认展示效果,在页面每次被选中加载(注意不是页面创建构造)的时候调用,如果多次选中会多次调用,这里要避免数据重复处理
+	void InitShow();
+
+	//处理按钮点击类事件
+	void HandleClickMsg(TNotifyUI& msg);
+
+	//处理option切换事件
+	void HandleSelectChangeMsg(TNotifyUI& msg);
+
+	//处理下拉框、radio的切换事件
+	void HandleItemSelectMsg(TNotifyUI& msg);
+
+	//处理编辑框输入内容改变事件
+	void HandleTextChangedMsg(TNotifyUI& msg);
+
+	//处理扫码枪捕捉到的扫码信息
+	void HandleTextCapture(std::string content);
+
+	//处理自定义消息,各个页面处理各个页面自己的(是自己处理的消息返回true,不是自己处理的消息返回false)
+	bool HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+};
+

+ 10 - 1
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -951,6 +951,10 @@ void CDiandanPageUI::HandleClickMsg(TNotifyUI& msg)
 	{
 		this->ClickMemberInfoShow();
 	}
+	else if (name == L"diandan_page_aixuexi_btn")
+	{
+		this->ClickAixuexi();
+	}
 }
 
 //处理option切换事件
@@ -3994,4 +3998,9 @@ void CDiandanPageUI::HandleDiandanAIShibieResult()
 	{
 		this->InitFoodShow();
 	}
-}
+}
+
+void CDiandanPageUI::ClickAixuexi()
+{
+	this->m_pMainWnd->SwitchPage(CMainWnd::AIXUEXI);
+}

+ 3 - 0
zhipuzi_pos_windows/page/CDiandanPageUI.h

@@ -118,6 +118,9 @@ public:
 	//展示会员详情
 	void ClickMemberInfoShow();
 
+	//点击AI学习
+	void ClickAixuexi();
+
 	//点击整单折扣
 	void ClickZhekou();
 

+ 7 - 0
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -1564,6 +1564,13 @@ void CMainWnd::CreatePages()
 		m_pages[SHOUKUANINFO] = pChildContainer;
 	}
 
+	{
+		CDialogBuilder builder;
+		CDialogBuilderCallbackEx cb;
+		pChildContainer = static_cast<CBasePageUI*>(builder.Create(_T("aixuexi_page.xml"), (UINT)0, &cb, &m_pm));
+		m_pages[AIXUEXI] = pChildContainer;
+	}
+
 	//这里纯粹只是创建对象,不做任何初始化等处理
 }
 

+ 1 - 0
zhipuzi_pos_windows/wnd/CMainWnd.h

@@ -38,6 +38,7 @@ public:
 		SHOUKUAN, //快速收银页面
 		SHOUKUANDINGDAN, //收款订单列表
 		SHOUKUANINFO, //收款订单详情
+		AIXUEXI, //AI学习
 	};
 
     LPCTSTR GetWindowClassName() const

+ 2 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -242,6 +242,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="ai\SQLiteVecManager.h" />
     <ClInclude Include="ai\YoloClassName.h" />
     <ClInclude Include="ai\YoloFeatureManager.h" />
+    <ClInclude Include="page\CAIxuexiPageUI.h" />
     <ClInclude Include="worker\CDiandanAIShibieWorker.h" />
     <ClInclude Include="worker\CVideoCaptureWorker.h" />
     <ClInclude Include="sqlite3\sqlite-vec.h" />
@@ -372,6 +373,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClCompile Include="ai\test.cpp" />
     <ClCompile Include="ai\test.h" />
     <ClCompile Include="ai\YoloFeatureManager.cpp" />
+    <ClCompile Include="page\CAIxuexiPageUI.cpp" />
     <ClCompile Include="worker\CDiandanAIShibieWorker.cpp" />
     <ClCompile Include="worker\CVideoCaptureWorker.cpp" />
     <ClCompile Include="sqlite3\shell.c" />

+ 6 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -396,6 +396,9 @@
     <ClInclude Include="worker\CDiandanAIShibieWorker.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="page\CAIxuexiPageUI.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">
@@ -752,6 +755,9 @@
     <ClCompile Include="worker\CDiandanAIShibieWorker.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="page\CAIxuexiPageUI.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="resource\zhipuzi.ico">