Browse Source

zhao:兼容T8Y手写板

tags/录制修改前
耀 3 years ago
parent
commit
969e3cb7fc
1 changed files with 29 additions and 9 deletions
  1. 29
    9
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 29
- 9
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

@@ -4864,6 +4864,7 @@ namespace XHWK.WKTool
4864 4864
         /// </summary>
4865 4865
         private void deviceHand()
4866 4866
         {
4867
+            IsPen = true;
4867 4868
             if (APP.IsOutputInfoLog)
4868 4869
             {
4869 4870
                 LogHelper.WriteInfoLog(string.Format("切换笔模式:设备类型:{0}", deviceType.ToString()));
@@ -4880,7 +4881,6 @@ namespace XHWK.WKTool
4880 4881
             else
4881 4882
             {
4882 4883
                 IsT8 = false;
4883
-                IsPen = true;
4884 4884
                 //获取当前设备模式,根据模式切换鼠标和笔
4885 4885
                 robotpenController.GetInstance()._Send(cmdId.SearchMode);
4886 4886
                 if (APP.IsOutputInfoLog)
@@ -4894,6 +4894,7 @@ namespace XHWK.WKTool
4894 4894
         /// </summary>
4895 4895
         private void deviceMouse()
4896 4896
         {
4897
+            IsPen = false;
4897 4898
             if (deviceType == eDeviceType.T8B_D2 || deviceType == eDeviceType.T8Y || deviceType == eDeviceType.T8S_LQ)
4898 4899
             {
4899 4900
                 IsT8 = true;
@@ -4906,7 +4907,6 @@ namespace XHWK.WKTool
4906 4907
             else
4907 4908
             {
4908 4909
                 IsT8 = false;
4909
-                IsPen = false;
4910 4910
                 //获取当前设备模式,根据模式切换鼠标和笔
4911 4911
                 robotpenController.GetInstance()._Send(cmdId.SearchMode);
4912 4912
                 if (APP.IsOutputInfoLog)
@@ -4959,7 +4959,11 @@ namespace XHWK.WKTool
4959 4959
             {
4960 4960
                 if (APP.IsOutputInfoLog)
4961 4961
                 {
4962
-                    LogHelper.WriteInfoLog("已切换成笔模式");
4962
+                    LogHelper.WriteInfoLog("当前为笔模式");
4963
+                }
4964
+                if(!IsPen)
4965
+                {
4966
+                    deviceMouse();
4963 4967
                 }
4964 4968
                 ////当前为笔模式时  切换回鼠标模式
4965 4969
                 //if (!IsPen && !IsT8)
@@ -4975,7 +4979,11 @@ namespace XHWK.WKTool
4975 4979
             {
4976 4980
                 if (APP.IsOutputInfoLog)
4977 4981
                 {
4978
-                    LogHelper.WriteInfoLog("已切换成鼠标模式");
4982
+                    LogHelper.WriteInfoLog("当前为鼠标模式");
4983
+                }
4984
+                if(IsPen)
4985
+                {
4986
+                    deviceHand();
4979 4987
                 }
4980 4988
                 ////当前为鼠标模式 切换为笔模式
4981 4989
                 //if (isOpen && !IsT8)
@@ -5063,7 +5071,7 @@ namespace XHWK.WKTool
5063 5071
         }
5064 5072
 
5065 5073
         /// <summary>
5066
-        /// 
5074
+        /// 书写
5067 5075
         /// </summary>        
5068 5076
         /// /// <param name="bIndex"></param>
5069 5077
         /// <param name="bPenStatus"></param>
@@ -5089,10 +5097,10 @@ namespace XHWK.WKTool
5089 5097
             //if (bPenStatus == 17)
5090 5098
             //{
5091 5099
             //}
5092
-            if(APP.IsOutputInfoLog)
5093
-            {
5094
-                LogHelper.WriteInfoLog(string.Format(@"x={0},y={1},s={2},p={3}", bx, by, bPenStatus, bPress));
5095
-            }
5100
+            //if(APP.IsOutputInfoLog)
5101
+            //{
5102
+            //    LogHelper.WriteInfoLog(string.Format(@"x={0},y={1},s={2},p={3}", bx, by, bPenStatus, bPress));
5103
+            //}
5096 5104
 
5097 5105
             stroke.Add(new System.Drawing.Point(by, bx));
5098 5106
 
@@ -5220,6 +5228,7 @@ namespace XHWK.WKTool
5220 5228
                                         m_nDeviceH = banWidth;
5221 5229
                                     }
5222 5230
                                 }
5231
+
5223 5232
                                 if (APP.IsOutputInfoLog)
5224 5233
                                 {
5225 5234
                                     LogHelper.WriteInfoLog(string.Format("手写板宽度为:{0} 高度为:{1}", m_nDeviceW, m_nDeviceH));
@@ -5239,6 +5248,17 @@ namespace XHWK.WKTool
5239 5248
                             //    txbNotConnected.Text = "手写板";
5240 5249
                             //    txbNotConnecteds.Text = "手写板";
5241 5250
                             //}));
5251
+
5252
+
5253
+                            new Thread(new ThreadStart(new Action(() =>
5254
+                            {
5255
+                                Thread.Sleep(1500);
5256
+                                //Dispatcher.Invoke(() =>
5257
+                                //{
5258
+                                    //获取当前设备状态
5259
+                                    robotpenController.GetInstance()._Send(cmdId.SearchMode);
5260
+                                //});
5261
+                            }))).Start();
5242 5262
                         }
5243 5263
                     }
5244 5264
                 }

Loading…
Cancel
Save