Kaynağa Gözat

zhao:修改手写板SDK,增加T8系列其他设备和T7PL设备适配

tags/录制修改前
耀 3 yıl önce
ebeveyn
işleme
66193ae999

BIN
Common/dlls/RobotUsbWrapper.dll Dosyayı Görüntüle


BIN
Common/dlls/RobotpenGateway.dll Dosyayı Görüntüle


+ 70
- 9
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Dosyayı Görüntüle

@@ -4850,10 +4850,10 @@ namespace XHWK.WKTool
4850 4850
         //int pageData = 0;
4851 4851
 
4852 4852
         bool AreSynchronized = false;
4853
-        //Dictionary<string, drawFormForA4> fa4dic = new Dictionary<string, drawFormForA4>();
4854
-        //drawFormForA4 dfa4_sync;
4855
-        //string[] szSubjectArray = new string[21] { "未选", "语文", "数学", "英语", "物理", "化学", "生物", "历史", "地理", "政治", "自然", "科一", "科二", "科三", "科四", "科五", "科六", "科七", "科八", "科九", "科十" };
4856
-
4853
+        /// <summary>
4854
+        /// 笔模式
4855
+        /// </summary>
4856
+        bool IsPen = false;
4857 4857
         #endregion
4858 4858
 
4859 4859
         #region 罗博智慧笔
@@ -4863,14 +4863,72 @@ namespace XHWK.WKTool
4863 4863
         /// </summary>
4864 4864
         private void deviceHand()
4865 4865
         {
4866
-            robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_HAND);
4866
+            if (deviceType == eDeviceType.T8B_D2 || deviceType == eDeviceType.T8Y || deviceType == eDeviceType.T8S_LQ)
4867
+            {
4868
+                robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_HAND);
4869
+            }
4870
+            else
4871
+            {
4872
+                IsPen = true;
4873
+                //获取当前设备模式,根据模式切换鼠标和笔
4874
+                robotpenController.GetInstance()._Send(cmdId.SearchMode);
4875
+            }
4867 4876
         }
4868 4877
         /// <summary>
4869 4878
         /// 鼠标模式
4870 4879
         /// </summary>
4871 4880
         private void deviceMouse()
4872 4881
         {
4873
-            robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_MOUSE);
4882
+            if (deviceType == eDeviceType.T8B_D2 || deviceType == eDeviceType.T8Y || deviceType == eDeviceType.T8S_LQ)
4883
+            {
4884
+                robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_MOUSE);
4885
+            }
4886
+            else
4887
+            {
4888
+                IsPen = false;
4889
+                //获取当前设备模式,根据模式切换鼠标和笔
4890
+                robotpenController.GetInstance()._Send(cmdId.SearchMode);
4891
+            }
4892
+        }
4893
+
4894
+        private void Form1_searchModeEvt(int modeType)
4895
+        {
4896
+            if (modeType == 1)
4897
+            {
4898
+                //当前为笔模式时  切换回鼠标模式
4899
+                if(!IsPen)
4900
+                {
4901
+                    robotpenController.GetInstance()._Send(cmdId.SwitchMode);
4902
+                }
4903
+            }
4904
+            else
4905
+            {
4906
+                //当前为鼠标模式 切换为笔模式
4907
+                if(isOpen)
4908
+                {
4909
+                    robotpenController.GetInstance()._Send(cmdId.SwitchMode);
4910
+                }
4911
+            }
4912
+        }
4913
+
4914
+        private void Form1_switchModeEvt(int modeType)
4915
+        {
4916
+            if (modeType == 1)
4917
+            {
4918
+                //当前为笔模式时  切换回鼠标模式
4919
+                if (!IsPen)
4920
+                {
4921
+                    robotpenController.GetInstance()._Send(cmdId.SwitchMode);
4922
+                }
4923
+            }
4924
+            else
4925
+            {
4926
+                //当前为鼠标模式 切换为笔模式
4927
+                if (isOpen)
4928
+                {
4929
+                    robotpenController.GetInstance()._Send(cmdId.SwitchMode);
4930
+                }
4931
+            }
4874 4932
         }
4875 4933
         //初始化笔服务
4876 4934
         private void InitlbPen()
@@ -4880,10 +4938,11 @@ namespace XHWK.WKTool
4880 4938
 
4881 4939
                 robotpenController.GetInstance()._ConnectInitialize(eDeviceType.Gateway, IntPtr.Zero);
4882 4940
                 robotpenController.GetInstance().deviceChangeEvt += new robotpenController.DeviceChange(Form1_deviceChangeEvt);
4941
+                robotpenController.GetInstance().searchModeEvt += Form1_searchModeEvt;
4942
+                robotpenController.GetInstance().switchModeEvt += Form1_switchModeEvt;
4883 4943
                 //robotpenController.GetInstance().deviceChangeEvt += new robotpenController.DeviceChange(Form1_deviceChangeEvt);
4884 4944
                 //robotpenController.GetInstance().gatewatVersionEvt += Form1_gatewatVersionEvt;
4885 4945
                 //robotpenController.GetInstance().nodeStatusEvt += Form1_nodeStatusEvt;
4886
-                //    robotpenController.GetInstance().searchModeEvt += Form1_searchModeEvt;
4887 4946
 
4888 4947
                 //// 所有设备均注册该页码显示消息 目前只有T9设备才会有页码识别功能, 客户代码可以根据设备来判断是否消费该事件
4889 4948
                 //robotpenController.GetInstance().showPageEvt += new robotpenController.ShowPage(Form1_showPageEvt);
@@ -4930,8 +4989,10 @@ namespace XHWK.WKTool
4930 4989
         {
4931 4990
             //throw new NotImplementedException();
4932 4991
             //Console.WriteLine();
4933
-
4934
-            LogHelper.WriteInfoLog(string.Format("设备状态{0} PID = {1}", bStatus, uPid));
4992
+            if (APP.IsOutputInfoLog)
4993
+            {
4994
+                LogHelper.WriteInfoLog(string.Format("设备状态{0} PID = {1}", bStatus, uPid));
4995
+            }
4935 4996
             SetListView();
4936 4997
         }
4937 4998
 

Loading…
İptal
Kaydet