浏览代码

代码重构临时提交

tags/对接微服务前
张剑 3 年前
父节点
当前提交
9d776a3e84

+ 426
- 0
README.md 查看文件

@@ -0,0 +1,426 @@
1
+# 拓思德点阵笔
2
+
3
+引用
4
+
5
+```csharp
6
+using TStudyDigitalPen.HID;
7
+```
8
+
9
+
10
+
11
+代码
12
+
13
+```csharp
14
+#region 拓思德点阵笔
15
+
16
+    #region 值初始化
17
+
18
+    // 不同尺寸点阵纸点阵宽高尺寸计算方法为:纸张物理尺寸(毫米)/0.3 *8,详见 开发必读.pdf 文档
19
+
20
+    /// <summary>
21
+    /// A4点阵纸点阵宽度
22
+    /// </summary>
23
+    private const int A4_WIDTH = 5600;
24
+
25
+/// <summary>
26
+/// A4点阵纸点阵高度
27
+/// </summary>
28
+private const int A4_HEIGHT = 7920;
29
+
30
+///// <summary>
31
+///// 画板
32
+///// </summary>
33
+//private Graphics graphics;
34
+
35
+/// <summary>
36
+/// 笔画坐标数组
37
+/// </summary>
38
+//private List<System.Drawing.Point> stroke;
39
+
40
+/// <summary>
41
+/// 笔序列号
42
+/// </summary>
43
+private string penSerial;
44
+
45
+/// <summary>
46
+/// 笔是否在点
47
+/// </summary>
48
+private bool isPenDown;
49
+
50
+//当前点阵地址
51
+private string currentPageSerial = string.Empty;
52
+
53
+//不同点阵地址对应的笔迹绘制图片,用于实现在不同点阵地址书写切换时,显示书写内容自动切换
54
+//本例图片放在内存中存储,对于大量或者需要在多个点阵地址对应图片进行切换演示,建议将图片存储到文件,以免内存溢出
55
+private Dictionary<string, System.Drawing.Image> pagesDic = new Dictionary<string, System.Drawing.Image>();
56
+
57
+#endregion 值初始化
58
+
59
+    public void InitTSDPen()
60
+{
61
+    //stroke = new List<System.Drawing.Point>();
62
+    //获取点阵笔实例,并绑定点阵笔事件
63
+    //将授权文件内容传入,获取点阵笔对象实例
64
+    APP.digitalPen = DigitalPenHID.GetInstance(certificates.MyLicense.Bytes);
65
+    //绑定笔连接事件
66
+    APP.digitalPen.PenConnected += OnTSDPenConnect;
67
+    //绑定笔断开事件
68
+    APP.digitalPen.PenDisconnect += OnTSDPenDisconnect;
69
+    //绑定笔书写输出坐标事件
70
+    APP.digitalPen.PenCoordinate += OnTSDPenCoordinate;
71
+    //绑定抬笔事件
72
+    APP.digitalPen.PenUp += OnTSDPenUp;
73
+    //绑定落笔事件
74
+    APP.digitalPen.PenDown += OnTSDPenDown;
75
+    APP.digitalPen.PenBatteryCapacity += OnTSDBatteryCapacity;
76
+    APP.digitalPen.PenMemoryFillLevel += OnTSDMemoryFillLevel;
77
+    //完成初始化点阵笔,开始与点阵笔通信
78
+    ERROR_CODE ER = APP.digitalPen.Start();
79
+
80
+    //启动接收笔数据,完成初始化工作
81
+    ERROR_CODE rc = APP.digitalPen.Start();
82
+    //判断是否成功
83
+    if (ER != ERROR_CODE.ERROR_OK)
84
+    {
85
+        MessageWindow.Show("初始化失败,授权过期,返回值:" + ER.ToString());
86
+    }
87
+}
88
+
89
+/// <summary>
90
+/// 落笔
91
+/// </summary>
92
+/// <param name="time">
93
+/// 时间戳,1970年1月1日到现在的总毫秒数
94
+/// </param>
95
+/// <param name="penSerial">
96
+/// 点阵笔序列号
97
+/// </param>
98
+/// <param name="penType">
99
+/// 点阵笔型号编号
100
+/// </param>
101
+private void OnTSDPenDown(ulong time, string penSerial, int penType)
102
+{
103
+    if (CheckAccess())
104
+    {
105
+        Action<ulong, string, int> action = new Action<ulong, string, int>(OnTSDPenDown);
106
+        Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
107
+    }
108
+    else
109
+    {
110
+
111
+        isPenDown = true;
112
+
113
+    }
114
+}
115
+
116
+/// <summary>
117
+/// 抬笔
118
+/// </summary>
119
+/// <param name="time">
120
+/// 时间戳,1970年1月1日到现在的总毫秒数
121
+/// </param>
122
+/// <param name="penSerial">
123
+/// 点阵笔序列号
124
+/// </param>
125
+/// <param name="penType">
126
+/// 点阵笔型号编号
127
+/// </param>
128
+private void OnTSDPenUp(ulong time, string penSerial, int penType)
129
+{
130
+    if (CheckAccess())
131
+    {
132
+        Action<ulong, string, int> action = new Action<ulong, string, int>(OnTSDPenUp);
133
+        Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
134
+    }
135
+    else
136
+    {
137
+        isPenDown = false;
138
+        APP.PenSerial = penSerial;
139
+
140
+    }
141
+    if (APP.PageContextData.currpage > 0)
142
+    {
143
+        Dispatcher.Invoke(new Action(() =>
144
+                                     {
145
+                                         myblackboard.changepages(0, 0, true, Color, PenSize, APP.PageContextData.currpage - 1, 0);
146
+                                     }));
147
+    }
148
+}
149
+
150
+/// <summary>
151
+/// 笔断开
152
+/// </summary>
153
+/// <param name="time">
154
+/// 时间戳,1970年1月1日到现在的总毫秒数
155
+/// </param>
156
+/// <param name="penSerial">
157
+/// 点阵笔序列号
158
+/// </param>
159
+/// <param name="penType">
160
+/// 点阵笔型号编号
161
+/// </param>
162
+private void OnTSDPenDisconnect(ulong time, string penSerial, int penType)
163
+{
164
+    if (CheckAccess())
165
+    {
166
+        Action<ulong, string, int> action = new Action<ulong, string, int>(OnTSDPenDisconnect);
167
+        Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
168
+    }
169
+    else
170
+    {
171
+        APP.PenSerial = penSerial;
172
+        APP.PenStatus = false;
173
+        UpdateDevStatus();
174
+    }
175
+}
176
+
177
+/// <summary>
178
+/// 笔连接
179
+/// </summary>
180
+/// <param name="time">
181
+/// 时间戳,1970年1月1日到现在的总毫秒数
182
+/// </param>
183
+/// <param name="penSerial">
184
+/// 点阵笔序列号
185
+/// </param>
186
+/// <param name="penType">
187
+/// 点阵笔型号编号
188
+/// </param>
189
+private void OnTSDPenConnect(ulong time, string penSerial, int penType)
190
+{
191
+    if (CheckAccess())
192
+    {
193
+        Action<ulong, string, int> action = new Action<ulong, string, int>(OnTSDPenConnect);
194
+        Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
195
+    }
196
+    else
197
+    {
198
+        APP.PenSerial = penSerial;
199
+        APP.PenStatus = true;
200
+        this.penSerial = penSerial;
201
+        //连接后,在获取笔数据前,可以清除笔内的历史数据
202
+        //APP.digitalPen.ClearMemory(penSerial);
203
+
204
+        //开始接收笔数据
205
+        APP.digitalPen.GetPenData(penSerial);
206
+        UpdateDevStatus();
207
+    }
208
+}
209
+
210
+/// <summary>
211
+/// 电池电量
212
+/// </summary>
213
+/// <param name="time">
214
+/// </param>
215
+/// <param name="penSerial">
216
+/// </param>
217
+/// <param name="penType">
218
+/// </param>
219
+/// <param name="capacity">
220
+/// </param>
221
+private void OnTSDBatteryCapacity(ulong time, string penSerial, int penType, byte capacity)
222
+{
223
+    if (CheckAccess())
224
+    {
225
+        Action<ulong, string, int, byte> action = new Action<ulong, string, int, byte>(OnTSDBatteryCapacity);
226
+        Dispatcher.Invoke(action, new object[] { time, penSerial, penType, capacity });
227
+    }
228
+    else
229
+    {
230
+        //System.Windows.MessageWindow.Show("电池电量:" + capacity.ToString());
231
+    }
232
+}
233
+
234
+/// <summary>
235
+/// 已用存储
236
+/// </summary>
237
+/// <param name="time">
238
+/// </param>
239
+/// <param name="penSerial">
240
+/// </param>
241
+/// <param name="penType">
242
+/// </param>
243
+/// <param name="fillLevel">
244
+/// </param>
245
+private void OnTSDMemoryFillLevel(ulong time, string penSerial, int penType, byte fillLevel)
246
+{
247
+    if (CheckAccess())
248
+    {
249
+        Action<ulong, string, int, byte> action = new Action<ulong, string, int, byte>(OnTSDMemoryFillLevel);
250
+        Dispatcher.Invoke(action, new object[] { time, penSerial, penType, fillLevel });
251
+    }
252
+    else
253
+    {
254
+    }
255
+}
256
+
257
+/// <summary>
258
+/// 笔书写,收到坐标
259
+/// </summary>
260
+/// <param name="time">
261
+/// 时间戳,1970年1月1日到现在的总毫秒数
262
+/// </param>
263
+/// <param name="penSerial">
264
+/// 点阵笔序列号
265
+/// </param>
266
+/// <param name="penType">
267
+/// 点阵笔型号编号
268
+/// </param>
269
+/// <param name="pageSerial">
270
+/// 点阵地址
271
+/// </param>
272
+/// <param name="cx">
273
+/// x坐标
274
+/// </param>
275
+/// <param name="cy">
276
+/// y坐标
277
+/// </param>
278
+/// <param name="force">
279
+/// 压力值
280
+/// </param>
281
+private void OnTSDPenCoordinate(ulong time, string penSerial, int penType, string pageSerial, int cx, int cy, byte force)
282
+{
283
+    if (CheckAccess())
284
+    {
285
+        Action<ulong, string, int, string, int, int, byte> ac = new Action<ulong, string, int, string, int, int, byte>(OnTSDPenCoordinate);
286
+        Dispatcher.Invoke(ac, new object[] { time, pageSerial, penType, pageSerial, cx, cy, force });
287
+    }
288
+    else
289
+    {
290
+        //判断是否是落笔后输出的坐标,在设置悬浮模式下,落笔前的悬浮坐标不绘制
291
+        if (!isPenDown)
292
+        {
293
+            return;
294
+        }
295
+        //stroke.Add(new System.Drawing.Point(cx, cy));
296
+
297
+        double PropW = blackboard_canvas.ActualWidth / A4_WIDTH;
298
+        double PropH = blackboard_canvas.ActualHeight / A4_HEIGHT;
299
+        //点
300
+        double tempX = cx * PropW;
301
+        double tempY = cy * PropH;
302
+        //pageSerial //点阵IP地址  与打印的页面关联
303
+        if (APP.PageContextData.currpage > 0)
304
+        {
305
+            Dispatcher.Invoke(new Action(() =>
306
+                                         {
307
+                                             float Pressure = force / 100f;
308
+                                             //myblackboard.changepages(testX, testY,false);
309
+                                             myblackboard.changepages(tempX, tempY, false, Color, PenSize, APP.PageContextData.currpage - 1, Pressure);
310
+
311
+                                             #region 设置滚动条位置
312
+
313
+                                                 //点在显示页面上方
314
+                                                 if (tempY < ScroMain.VerticalOffset)
315
+                                                 {
316
+                                                     //滚动条当前位置
317
+                                                     double RollCurrentLocation = ScroMain.VerticalOffset;
318
+                                                     //向上滚动至以点为中心需要滚动的距离
319
+                                                     double UpRoll = (RollCurrentLocation - tempY) + (ScroMain.ActualHeight / 2);
320
+                                                     //如果小于0则等于0
321
+                                                     double RollLocation = RollCurrentLocation - UpRoll;
322
+                                                     if (RollLocation < 0)
323
+                                                     {
324
+                                                         RollLocation = 0;
325
+                                                     }
326
+                                                     ////滚动条实际偏移量
327
+                                                     //double RollOffset = RollCurrentLocation - RollLocation;
328
+                                                     ScroMain.ScrollToVerticalOffset(RollLocation);
329
+                                                 }
330
+                                             //点在显示页面下方
331
+                                             if (tempY > ScroMain.VerticalOffset + ScroMain.ActualHeight)
332
+                                             {
333
+                                                 //滚动条当前位置
334
+                                                 double RollCurrentLocation = ScroMain.VerticalOffset;
335
+                                                 //向下滚动至以点为中心需要滚动的距离
336
+                                                 double DownRoll = (tempY - RollCurrentLocation) - (ScroMain.ActualHeight / 2);
337
+                                                 //如果小于0则等于0
338
+                                                 double RollLocation = RollCurrentLocation + DownRoll;
339
+                                                 //滚动条最大滚动值
340
+                                                 double ScrollbarMaxNum = GridM.ActualHeight - ScroMain.ActualHeight;
341
+                                                 if (RollLocation > ScrollbarMaxNum)
342
+                                                 {
343
+                                                     RollLocation = ScrollbarMaxNum;
344
+                                                 }
345
+                                                 ////滚动条实际偏移量
346
+                                                 //double RollOffset = RollLocation-RollCurrentLocation;
347
+                                                 ScroMain.ScrollToVerticalOffset(RollLocation);
348
+                                             }
349
+
350
+                                             #endregion 设置滚动条位置
351
+
352
+                                                 if (tempX > 0 && tempY > 0)
353
+                                                 {
354
+                                                     //System.Windows.Point getP = blackboard_canvas.PointToScreen(new System.Windows.Point(testX, testY));
355
+                                                     System.Windows.Point getP = ScroMain.PointToScreen(new System.Windows.Point(tempX, tempY - ScroMain.VerticalOffset));
356
+                                                     SetCursorPos((int)getP.X, (int)getP.Y);
357
+                                                 }
358
+                                         }));
359
+        }
360
+    }
361
+}
362
+
363
+/// <summary>
364
+/// 清空笔内存储
365
+/// </summary>
366
+public void ClearPenStorage()
367
+{
368
+    if (!string.IsNullOrEmpty(penSerial))
369
+    {
370
+        APP.digitalPen.ClearMemory(penSerial);
371
+    }
372
+}
373
+
374
+/// <summary>
375
+/// 获取剩余电量
376
+/// </summary>
377
+public void GetPenElectricityQuantity()
378
+{
379
+    if (!string.IsNullOrEmpty(penSerial))
380
+    {
381
+        APP.digitalPen.GetBatteryCapacity(penSerial);
382
+    }
383
+}
384
+
385
+/// <summary>
386
+/// 获取存储空间
387
+/// </summary>
388
+public void GetUsedStorage()
389
+{
390
+    if (!string.IsNullOrEmpty(penSerial))
391
+    {
392
+        APP.digitalPen.GetMemoryFillLevel(penSerial);
393
+    }
394
+}
395
+
396
+/// <summary>
397
+/// 开启悬浮
398
+/// </summary>
399
+public void 开启悬浮()
400
+{
401
+    if (!string.IsNullOrEmpty(penSerial))
402
+    {
403
+        APP.digitalPen.SetPenHoverMode(true, penSerial);
404
+    }
405
+}
406
+
407
+/// <summary>
408
+/// 关闭悬浮
409
+/// </summary>
410
+public void 关闭悬浮()
411
+{
412
+    if (!string.IsNullOrEmpty(penSerial))
413
+    {
414
+        APP.digitalPen.SetPenHoverMode(false, penSerial);
415
+    }
416
+}
417
+
418
+/// <summary>
419
+/// 引用user32.dll动态链接库(windows api), 使用库中定义 API:SetCursorPos 设置光标位置
420
+/// </summary>
421
+[System.Runtime.InteropServices.DllImport("user32.dll")]
422
+private static extern int SetCursorPos(int x, int y);
423
+
424
+#endregion 拓思德点阵笔
425
+```
426
+

+ 2
- 2
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs 查看文件

@@ -418,7 +418,7 @@ namespace XHWK.WKTool
418 418
                 APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
419 419
             }
420 420
             APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
421
-            APP.W_XHMicroLessonSystemWindow.InitPen();
421
+            //APP.W_XHMicroLessonSystemWindow.InitPen();
422 422
             APP.W_XHMicroLessonSystemWindow.InitTQLPPen();
423 423
             APP.W_XHMicroLessonSystemWindow.Show();
424 424
 
@@ -894,7 +894,7 @@ namespace XHWK.WKTool
894 894
                 BtnStopRecordingScreen_Click(null, null);
895 895
             }
896 896
             APP.W_XHMicroLessonSystemWindow.InitializeKeyDownEvent();
897
-            APP.W_XHMicroLessonSystemWindow.InitPen();
897
+            //APP.W_XHMicroLessonSystemWindow.InitPen();
898 898
             APP.W_XHMicroLessonSystemWindow.InitTQLPPen();
899 899
             APP.W_XHMicroLessonSystemWindow.Show();
900 900
 

+ 570
- 0
XHWK.WKTool/Utils/luobo/LuoBoPenUtil.cs 查看文件

@@ -0,0 +1,570 @@
1
+using Common.system;
2
+
3
+using RobotpenGateway;
4
+
5
+using System;
6
+using System.Threading;
7
+
8
+namespace XHWK.WKTool.Utils.luobo
9
+{
10
+    class LuoBoPenUtil
11
+    {
12
+        #region 罗博智慧笔
13
+
14
+        #region 值初始化
15
+
16
+        [System.Runtime.InteropServices.DllImport("kernel32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
17
+        public static extern void OutputDebugString(string message);
18
+
19
+        public robotpenController.returnPointData Date { get => date; set => date = value; }
20
+
21
+        public bool usbIsConnected = false;
22
+        private eDeviceType deviceType = eDeviceType.Unknow;
23
+
24
+        private int m_nDeviceW = 22600;
25
+
26
+        private int m_nDeviceH = 16650;
27
+        private robotpenController.returnPointData date = null;
28
+
29
+
30
+        public bool isOpen = true;
31
+
32
+        /// <summary>
33
+        /// 是否为笔模式
34
+        /// </summary>
35
+        private bool IsPen = false;
36
+
37
+        private bool IsT8 = true;
38
+
39
+        #endregion 值初始化
40
+
41
+
42
+        /// <summary>
43
+        /// 笔模式
44
+        /// </summary>
45
+        private void lb_device_hand()
46
+        {
47
+            IsPen = true;
48
+            if (deviceType == eDeviceType.T8B_D2 || deviceType == eDeviceType.T8Y || deviceType == eDeviceType.T8S_LQ || deviceType == eDeviceType.T8C)
49
+            {
50
+                robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_HAND);
51
+            }
52
+            else
53
+            {
54
+                //获取当前设备模式,根据模式切换鼠标和笔
55
+                robotpenController.GetInstance()._Send(cmdId.SearchMode);
56
+            }
57
+        }
58
+
59
+        /// <summary>
60
+        /// 鼠标模式
61
+        /// </summary>
62
+        private void lb_device_mouse()
63
+        {
64
+            IsPen = false;
65
+            if (deviceType == eDeviceType.T8B_D2 || deviceType == eDeviceType.T8Y || deviceType == eDeviceType.T8S_LQ || deviceType == eDeviceType.T8C)
66
+            {
67
+                robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_MOUSE);
68
+            }
69
+            else
70
+            {
71
+                //获取当前设备模式,根据模式切换鼠标和笔
72
+                robotpenController.GetInstance()._Send(cmdId.SearchMode);
73
+            }
74
+        }
75
+
76
+        private void luobo_searchModeEvt(int modeType)
77
+        {
78
+            if (APP.IsOutputInfoLog)
79
+            {
80
+                if (modeType == 1)
81
+                {
82
+                    LogHelper.WriteInfoLog("当前为笔模式");
83
+                }
84
+                else
85
+                {
86
+                    LogHelper.WriteInfoLog("当前为鼠标模式");
87
+                }
88
+            }
89
+        }
90
+
91
+        // 子节点设备状态改变事件
92
+        private void luobo_nodeStatusEvt(NODE_STATUS ns)
93
+        {
94
+            string strStatus = string.Empty;
95
+            switch (ns)
96
+            {
97
+                case NODE_STATUS.DEVICE_POWER_OFF:
98
+                    {
99
+                        strStatus = "DEVICE_POWER_OFF";
100
+                    }
101
+                    break;
102
+                case NODE_STATUS.DEVICE_STANDBY:
103
+                    {
104
+                        strStatus = "DEVICE_STANDBY";
105
+
106
+                    }
107
+                    break;
108
+                case NODE_STATUS.DEVICE_INIT_BTN:
109
+                    {
110
+                        strStatus = "DEVICE_INIT_BTN";
111
+
112
+                    }
113
+                    break;
114
+                case NODE_STATUS.DEVICE_OFFLINE:
115
+                    {
116
+                        strStatus = "DEVICE_OFFLINE";
117
+                    }
118
+                    break;
119
+                case NODE_STATUS.DEVICE_ACTIVE:
120
+                    {
121
+                        strStatus = "DEVICE_ACTIVE";
122
+                        //deviceHand();
123
+                    }
124
+                    break;
125
+                case NODE_STATUS.DEVICE_LOW_POWER_ACTIVE:
126
+                    {
127
+                        strStatus = "DEVICE_LOW_POWER_ACTIVE";
128
+                    }
129
+                    break;
130
+                case NODE_STATUS.DEVICE_OTA_MODE:
131
+                    {
132
+                        strStatus = "DEVICE_OTA_MODE";
133
+                    }
134
+                    break;
135
+                case NODE_STATUS.DEVICE_OTA_WAIT_SWITCH:
136
+                    {
137
+                        strStatus = "DEVICE_OTA_WAIT_SWITCH";
138
+                    }
139
+                    break;
140
+                case NODE_STATUS.DEVICE_DFU_MODE:
141
+                    {
142
+                        strStatus = "DEVICE_DFU_MODE";
143
+
144
+                    }
145
+                    break;
146
+                case NODE_STATUS.DEVICE_TRYING_POWER_OFF:
147
+                    {
148
+                        strStatus = "DEVICE_TRYING_POWER_OFF";
149
+                    }
150
+                    break;
151
+                case NODE_STATUS.DEVICE_FINISHED_PRODUCT_TEST:
152
+                    {
153
+                        strStatus = "DEVICE_FINISHED_PRODUCT_TEST";
154
+                    }
155
+                    break;
156
+                case NODE_STATUS.DEVICE_SYNC_MODE:
157
+                    {
158
+                        strStatus = "DEVICE_SYNC_MODE";
159
+                    }
160
+                    break;
161
+                default:
162
+                    {
163
+                        strStatus = "UNKNOW";
164
+                    }
165
+                    break;
166
+            }
167
+        }
168
+        private void luobo_switchModeEvt(int modeType)
169
+        {
170
+            if (modeType == 1)
171
+            {
172
+                if (APP.IsOutputInfoLog)
173
+                {
174
+                    LogHelper.WriteInfoLog("当前为笔模式");
175
+                }
176
+                if (!IsPen)
177
+                {
178
+                    lb_device_mouse();
179
+                }
180
+            }
181
+            else
182
+            {
183
+                if (APP.IsOutputInfoLog)
184
+                {
185
+                    LogHelper.WriteInfoLog("当前为鼠标模式");
186
+                }
187
+                if (IsPen)
188
+                {
189
+                    lb_device_hand();
190
+                }
191
+            }
192
+        }
193
+
194
+        //初始化笔服务
195
+        private void InitlbPen()
196
+        {
197
+            try
198
+            {
199
+                robotpenController.GetInstance()._ConnectInitialize(eDeviceType.Gateway, IntPtr.Zero);
200
+                robotpenController.GetInstance().deviceChangeEvt += new robotpenController.DeviceChange(luobo_deviceChangeEvt);
201
+                robotpenController.GetInstance().searchModeEvt += luobo_searchModeEvt;
202
+                robotpenController.GetInstance().nodeStatusEvt += luobo_nodeStatusEvt;
203
+                robotpenController.GetInstance().switchModeEvt += luobo_switchModeEvt;
204
+                robotpenController.GetInstance().keyPressEvt += new robotpenController.KeyPress(luobo_keyPressEvt);
205
+
206
+                Date = new robotpenController.returnPointData(luobo_bigDataReportEvt1);
207
+                robotpenController.GetInstance().initDeletgate(ref Date);
208
+
209
+                CheckUsbConnect();
210
+            }
211
+            catch (Exception ex)
212
+            {
213
+                LogHelper.WriteErrLog("设备初始化失败:" + ex.Message, ex);
214
+            }
215
+        }
216
+
217
+
218
+
219
+        /// <summary>
220
+        /// 设备插拔消息,更新listview
221
+        /// </summary>
222
+        /// <param name="bStatus">
223
+        /// </param>
224
+        /// <param name="uPid">
225
+        /// </param>
226
+        private void luobo_deviceChangeEvt(bool bStatus, ushort uPid)
227
+        {
228
+            //throw new NotImplementedException();
229
+            Console.WriteLine("luobo_deviceChangeEvt");
230
+            try
231
+            {
232
+                if (APP.IsOutputInfoLog)
233
+                {
234
+                    LogHelper.WriteInfoLog(string.Format("设备状态{0} PID = {1}", bStatus, uPid));
235
+                }
236
+            }
237
+            catch (Exception)
238
+            {
239
+            }
240
+            CheckUsbConnect();
241
+        }
242
+
243
+        /// <summary>
244
+        /// 书写
245
+        /// </summary>
246
+        /// ///
247
+        /// <param name="bIndex">
248
+        /// </param>
249
+        /// <param name="bPenStatus">
250
+        /// </param>
251
+        /// <param name="bx">
252
+        /// </param>
253
+        /// <param name="by">
254
+        /// </param>
255
+        /// <param name="bPress">
256
+        /// </param>
257
+        private void luobo_bigDataReportEvt1(byte bIndex, byte bPenStatus, short bx, short by, short bPress)
258
+        {
259
+            if (bx == 0 && by == 0 && bPenStatus == 0 && bPress == 0)
260
+            {
261
+                return;
262
+            }
263
+            //17是按下,16是抬起
264
+            if (bPenStatus == 16 || bPenStatus == 0)
265
+            {
266
+                //stroke.Clear();
267
+                if (APP.PageContextData.currpage > 0)
268
+                {
269
+                    Dispatcher.Invoke(new Action(() =>
270
+                    {
271
+                        myblackboard.changepages(0, 0, true, Color, PenSize, APP.PageContextData.currpage - 1, 0);
272
+                    }));
273
+                }
274
+            }
275
+
276
+            double PropW = blackboard_canvas.ActualWidth / m_nDeviceH;
277
+            double PropH = blackboard_canvas.ActualHeight / m_nDeviceW;
278
+            //点
279
+            double tempY = (m_nDeviceW - bx) * PropH;
280
+            double tempX = by * PropW;
281
+            //pageSerial //点阵IP地址  与打印的页面关联
282
+            if (APP.PageContextData.currpage > 0)
283
+            {
284
+                Dispatcher.Invoke(new Action(() =>
285
+                {
286
+                    float Pressure = bPress / 100f;
287
+
288
+                    if (bPress > 0)
289
+                    {
290
+                        myblackboard.changepages(tempX, tempY, false, Color, PenSize, APP.PageContextData.currpage - 1, Pressure);
291
+                    }
292
+
293
+                    #region 设置滚动条位置
294
+
295
+                    //点在显示页面上方
296
+                    if (tempY < ScroMain.VerticalOffset)
297
+                    {
298
+                        //滚动条当前位置
299
+                        double RollCurrentLocation = ScroMain.VerticalOffset;
300
+                        //向上滚动至以点为中心需要滚动的距离
301
+                        double UpRoll = (RollCurrentLocation - tempY) + (ScroMain.ActualHeight / 2);
302
+                        //如果小于0则等于0
303
+                        double RollLocation = RollCurrentLocation - UpRoll;
304
+                        if (RollLocation < 0)
305
+                        {
306
+                            RollLocation = 0;
307
+                        }
308
+                        ////滚动条实际偏移量
309
+                        //double RollOffset = RollCurrentLocation - RollLocation;
310
+                        ScroMain.ScrollToVerticalOffset(RollLocation);
311
+                    }
312
+                    //点在显示页面下方
313
+                    if (tempY > ScroMain.VerticalOffset + ScroMain.ActualHeight)
314
+                    {
315
+                        //滚动条当前位置
316
+                        double RollCurrentLocation = ScroMain.VerticalOffset;
317
+                        //向下滚动至以点为中心需要滚动的距离
318
+                        double DownRoll = (tempY - RollCurrentLocation) - (ScroMain.ActualHeight / 2);
319
+                        //如果小于0则等于0
320
+                        double RollLocation = RollCurrentLocation + DownRoll;
321
+                        //滚动条最大滚动值
322
+                        double ScrollbarMaxNum = GridM.ActualHeight - ScroMain.ActualHeight;
323
+                        if (RollLocation > ScrollbarMaxNum)
324
+                        {
325
+                            RollLocation = ScrollbarMaxNum;
326
+                        }
327
+                        ////滚动条实际偏移量
328
+                        //double RollOffset = RollLocation-RollCurrentLocation;
329
+                        ScroMain.ScrollToVerticalOffset(RollLocation);
330
+                    }
331
+
332
+                    #endregion 设置滚动条位置
333
+
334
+                    if (tempX > 0 && tempY > 0)
335
+                    {
336
+                        //System.Windows.Point getP = blackboard_canvas.PointToScreen(new System.Windows.Point(testX, testY));
337
+                        System.Windows.Point getP = ScroMain.PointToScreen(new System.Windows.Point(tempX, tempY - ScroMain.VerticalOffset));
338
+                        SetCursorPos((int)getP.X, (int)getP.Y);
339
+                    }
340
+                }));
341
+            }
342
+        }
343
+
344
+        /// <summary>
345
+        /// 判断是否有设备连接
346
+        /// </summary>
347
+        public void CheckUsbConnect()
348
+        {
349
+            usbIsConnected = false;
350
+            Thread.Sleep(200);
351
+            int nDeviceCount = robotpenController.GetInstance()._GetDeviceCount();
352
+            if (APP.IsOutputInfoLog)
353
+            {
354
+                LogHelper.WriteInfoLog(string.Format("当前有 {0} 个设备", nDeviceCount));
355
+            }
356
+            if (nDeviceCount > 0)
357
+            {
358
+                for (int i = 0; i < nDeviceCount; ++i)
359
+                {
360
+                    ushort npid = 0;
361
+                    ushort nvid = 0;
362
+                    string strDeviceName = string.Empty;
363
+                    eDeviceType dtype = eDeviceType.Unknow;
364
+                    if (robotpenController.GetInstance()._GetAvailableDevice(i, ref npid, ref nvid, ref strDeviceName, ref dtype))
365
+                    {
366
+                        if (!usbIsConnected)
367
+                        {
368
+                            usbIsConnected = true;
369
+                            deviceType = dtype;
370
+                            robotpenController.GetInstance()._ConnectInitialize(deviceType, IntPtr.Zero);
371
+                            int nRes = robotpenController.GetInstance()._ConnectOpen();
372
+                            if (nRes != 0)
373
+                            {
374
+                                //LogHelper.WriteInfoLog(string.Format(@"x={0},y={1},s={2},p={3}", bx, by, bPenStatus, bPress));
375
+                                LogHelper.WriteErrLog("设备自动连接失败,请重新插拔设备或尝试手动连接!", null);
376
+                                usbIsConnected = false;
377
+                                break;
378
+                            }
379
+
380
+                            robotpenController.GetInstance()._Send(cmdId.GetConfig);
381
+
382
+                            APP.BoardStatus = true;
383
+                            try
384
+                            {
385
+                                int banWidth = robotpenController.GetInstance().getWidth();
386
+                                int banHeight = robotpenController.GetInstance().getHeight();
387
+                                if (banWidth > 0 && banHeight > 0)
388
+                                {
389
+                                    if (banWidth > banHeight)
390
+                                    {
391
+                                        m_nDeviceW = banWidth;
392
+                                        m_nDeviceH = banHeight;
393
+                                    }
394
+                                    else
395
+                                    {
396
+                                        m_nDeviceW = banHeight;
397
+                                        m_nDeviceH = banWidth;
398
+                                    }
399
+                                }
400
+
401
+                                if (APP.IsOutputInfoLog)
402
+                                {
403
+                                    LogHelper.WriteInfoLog(string.Format("手写板宽度为:{0} 高度为:{1}", m_nDeviceW, m_nDeviceH));
404
+                                }
405
+                            }
406
+                            catch (Exception ex)
407
+                            {
408
+                                LogHelper.WriteErrLog("手写板大小获取失败:" + ex.Message, ex);
409
+                            }
410
+                            UpdateDevStatus();
411
+                            if (APP.IsOutputInfoLog)
412
+                            {
413
+                                LogHelper.WriteInfoLog(string.Format("设备类型:{0}", deviceType.ToString()));
414
+                            }
415
+
416
+                            new Thread(new ThreadStart(new Action(() =>
417
+                            {
418
+                                Thread.Sleep(500);
419
+
420
+                                robotpenController.GetInstance()._Send(cmdId.SearchMode);
421
+                            }))).Start();
422
+                        }
423
+
424
+
425
+                    }
426
+                }
427
+            }
428
+            else
429
+            {
430
+                APP.BoardStatus = false;
431
+                UpdateDevStatus();
432
+            }
433
+        }
434
+
435
+        /// <summary>
436
+        /// 按键回调函数
437
+        /// </summary>
438
+        /// <param name="Value">
439
+        /// </param>
440
+        private void luobo_keyPressEvt(eKeyPress Value)
441
+        {
442
+            switch (Value)
443
+            {
444
+                case eKeyPress.CLICK:
445
+                    break;
446
+
447
+                case eKeyPress.DBCLICK:
448
+                    break;
449
+
450
+                case eKeyPress.PAGEUP:
451
+                    last_button_Click(null, null);
452
+                    break;
453
+
454
+                case eKeyPress.PAGEDOWN:
455
+                    next_btn_Click(null, null);
456
+                    break;
457
+
458
+                case eKeyPress.CREATEPAGE://关机键
459
+                    break;
460
+
461
+                case eKeyPress.KEY_A:
462
+                    break;
463
+
464
+                case eKeyPress.KEY_B:
465
+                    break;
466
+
467
+                case eKeyPress.KEY_C:
468
+                    break;
469
+
470
+                case eKeyPress.KEY_D:
471
+                    break;
472
+
473
+                case eKeyPress.KEY_E:
474
+                    break;
475
+
476
+                case eKeyPress.KEY_F:
477
+                    break;
478
+
479
+                case eKeyPress.KEY_UP:
480
+                    last_button_Click(null, null);
481
+                    break;
482
+
483
+                case eKeyPress.KEY_DOWN:
484
+                    next_btn_Click(null, null);
485
+                    break;
486
+
487
+                case eKeyPress.KEY_YES:
488
+                    break;
489
+
490
+                case eKeyPress.KEY_NO:
491
+                    break;
492
+
493
+                case eKeyPress.KEY_CANCEL:
494
+                    break;
495
+
496
+                case eKeyPress.KEY_OK:
497
+                    break;
498
+
499
+                case eKeyPress.PAGEUPCLICK://上一页
500
+                    //last_button_Click(null, null);
501
+                    break;
502
+
503
+                case eKeyPress.PAGEUPDBCLICK://双击上一页
504
+                    break;
505
+
506
+                case eKeyPress.PAGEUPPRESS://长按上一页
507
+                    break;
508
+
509
+                case eKeyPress.PAGEDOWNCLICK://下一页
510
+                    //next_btn_Click(null, null);
511
+                    break;
512
+
513
+                case eKeyPress.PAGEDOWNDBCLICK://双击下一页
514
+                    break;
515
+
516
+                case eKeyPress.PAGEDOWNPRESS://长按下一页
517
+                    break;
518
+            }
519
+        }
520
+
521
+        /// <summary>
522
+        /// 更新设备状态显示
523
+        /// </summary>
524
+        public void UpdateDevStatus()
525
+        {
526
+            if (APP.BoardStatus && (APP.PenStatus || APP.TQLPenStatus))
527
+            {
528
+                Dispatcher.Invoke(new Action(() =>
529
+                {
530
+                    txbNotConnected.Text = "笔/板已连接";
531
+                    txbNotConnecteds.Text = "笔/板已连接";
532
+                }));
533
+            }
534
+            else if (APP.BoardStatus)
535
+            {
536
+                Dispatcher.Invoke(new Action(() =>
537
+                {
538
+                    txbNotConnected.Text = "手写板已连接";
539
+                    txbNotConnecteds.Text = "手写板已连接";
540
+                }));
541
+            }
542
+            else if (APP.PenStatus)
543
+            {
544
+                Dispatcher.Invoke(new Action(() =>
545
+                {
546
+                    txbNotConnected.Text = "智能笔已连接";
547
+                    txbNotConnecteds.Text = "智能笔已连接";
548
+                }));
549
+            }
550
+            else if (APP.TQLPenStatus)
551
+            {
552
+                Dispatcher.Invoke(new Action(() =>
553
+                {
554
+                    txbNotConnected.Text = "智能笔已连接";
555
+                    txbNotConnecteds.Text = "智能笔已连接";
556
+                }));
557
+            }
558
+            else
559
+            {
560
+                Dispatcher.Invoke(new Action(() =>
561
+                {
562
+                    txbNotConnected.Text = "未连接";
563
+                    txbNotConnecteds.Text = "未连接";
564
+                }));
565
+            }
566
+        }
567
+
568
+        #endregion 罗博智慧笔
569
+    }
570
+}

+ 76
- 116
XHWK.WKTool/XHMicroLessonSystemWindow.xaml 查看文件

@@ -7,8 +7,8 @@
7 7
     Title="星火微课系统"
8 8
     Width="950"
9 9
     Height="700"
10
-    AllowsTransparency="True"
11
-    Background="Transparent"
10
+    AllowsTransparency="False"
11
+  
12 12
     BorderBrush="#eee"
13 13
     BorderThickness="1"
14 14
     Loaded="Window_Loaded"
@@ -879,10 +879,7 @@
879 879
                                             <ScaleTransform ScaleX="-1" />
880 880
                                         </Image.RenderTransform>
881 881
                                     </Image>
882
-                                    <!--<Label Content="" Grid.Column="0" Height="2" Width="2" HorizontalAlignment="Left"  VerticalAlignment="Top" Background="#FF0F0F0F" Margin="1,0,0,0" />
883
-                        <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,16,0" />
884
-                        <Label Content="" Grid.Column="0" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="1,0,0,0" />
885
-                        <Label Content="" Grid.Column="1" Height="2" Width="2" Background="#FF0F0F0F" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,16,0" />-->
882
+                                   
886 883
                                 </Grid>
887 884
                             </Border>
888 885
                         </Grid>
@@ -893,52 +890,56 @@
893 890
                             Grid.Row="2"
894 891
                             Background="#FFFFFFFF"
895 892
                             Visibility="Visible">
896
-                            <StackPanel
897
-                                HorizontalAlignment="Right"
898
-                                VerticalAlignment="Center"
899
-                                Orientation="Horizontal">
900
-                                <!--  页码  -->
901
-                                <Grid
893
+                            <Grid.ColumnDefinitions>
894
+                                <ColumnDefinition Width="200"></ColumnDefinition>
895
+                                <ColumnDefinition Width="*"></ColumnDefinition>
896
+                                <ColumnDefinition Width="200"></ColumnDefinition>
897
+                        
898
+                            </Grid.ColumnDefinitions>
899
+                            <!--  页码  -->
900
+                            <Grid
902 901
                                     x:Name="GridPage"
903
-                                    Grid.Row="1"
904
-                                    Margin="0"
905
-                                    HorizontalAlignment="Center"
902
+                                    Grid.Column="0"
903
+                                    Grid.Row="0"
904
+                                    HorizontalAlignment="Left"
906 905
                                     VerticalAlignment="Center"
907 906
                                     MouseLeftButtonDown="Window_MouseLeftButtonDown_1"
908 907
                                     Visibility="Collapsed">
909
-                                    <StackPanel
908
+                                <StackPanel
910 909
                                         Grid.Row="0"
911 910
                                         Grid.Column="1"
912
-                                        Width="220"
913 911
                                         Height="30"
914 912
                                         Margin="0,0,0,0"
915 913
                                         HorizontalAlignment="Center"
916 914
                                         VerticalAlignment="Bottom"
917 915
                                         Background="Transparent"
918 916
                                         Orientation="Horizontal">
919
-                                        <Button
917
+
918
+                                    <Label Margin="5,0,0,0" Content="页码:" VerticalAlignment="Center" ></Label>
919
+
920
+                                    <Button
920 921
                                             x:Name="last_button"
921 922
                                             Width="28"
922 923
                                             Height="20"
923 924
                                             Click="last_button_Click"
924 925
                                             Cursor="Hand"
925 926
                                             Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
926
-                                            <StackPanel>
927
-                                                <Image
927
+                                        <StackPanel>
928
+                                            <Image
928 929
                                                     Width="16"
929 930
                                                     Height="12"
930 931
                                                     Source=".\Images\class_p1.png" />
931
-                                            </StackPanel>
932
-                                        </Button>
933
-                                        <Grid
932
+                                        </StackPanel>
933
+                                    </Button>
934
+                                    <Grid
934 935
                                             Width="60"
935 936
                                             Background="Transparent"
936 937
                                             MouseLeftButtonDown="Window_MouseLeftButtonDown_1">
937
-                                            <StackPanel
938
+                                        <StackPanel
938 939
                                                 HorizontalAlignment="Center"
939 940
                                                 Background="Transparent"
940 941
                                                 Orientation="Horizontal">
941
-                                                <TextBlock
942
+                                            <TextBlock
942 943
                                                     x:Name="txbCurrpage"
943 944
                                                     Margin="0"
944 945
                                                     HorizontalAlignment="Center"
@@ -946,22 +947,22 @@
946 947
                                                     FontSize="{Binding WordSize14}"
947 948
                                                     Text="{Binding currpage}"
948 949
                                                     TextAlignment="Center" />
949
-                                                <TextBlock
950
+                                            <TextBlock
950 951
                                                     HorizontalAlignment="Center"
951 952
                                                     VerticalAlignment="Center"
952 953
                                                     FontSize="{Binding WordSize14}"
953 954
                                                     Text="/"
954 955
                                                     TextAlignment="Center" />
955
-                                                <TextBlock
956
+                                            <TextBlock
956 957
                                                     x:Name="txbTotalpage"
957 958
                                                     HorizontalAlignment="Center"
958 959
                                                     VerticalAlignment="Center"
959 960
                                                     FontSize="{Binding WordSize14}"
960 961
                                                     Text="{Binding pagenum}"
961 962
                                                     TextAlignment="Center" />
962
-                                            </StackPanel>
963
-                                        </Grid>
964
-                                        <Button
963
+                                        </StackPanel>
964
+                                    </Grid>
965
+                                    <Button
965 966
                                             x:Name="next_btn"
966 967
                                             Width="28"
967 968
                                             Height="20"
@@ -969,70 +970,29 @@
969 970
                                             Click="next_btn_Click"
970 971
                                             Cursor="Hand"
971 972
                                             Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
972
-                                            <StackPanel>
973
-                                                <Image
973
+                                        <StackPanel>
974
+                                            <Image
974 975
                                                     Width="16"
975 976
                                                     Height="12"
976 977
                                                     Source=".\Images\class_p2.png" />
977
-                                            </StackPanel>
978
-                                        </Button>
979
-
980
-                                        <TextBlock
981
-                                            Margin="0,0,3,0"
982
-                                            VerticalAlignment="Center"
983
-                                            FontSize="{Binding WordSize14}"
984
-                                            Text="转" />
985
-                                        <!--<TextBox x:Name="txtJump" Text="123" Height="17" Width="25" Visibility="Visible" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0"  input:InputMethod.IsInputMethodEnabled="False" PreviewTextInput="txtJump_PreviewTextInput" KeyDown="txtJump_KeyDown" />-->
986
-                                        <!--<Button Cursor="Hand" Visibility="Visible" x:Name="BtnJumpPage" HorizontalAlignment="Left"  VerticalAlignment="Center" Width="17" Height="17" Background="White" BorderBrush="#FFABADB3" Margin="24,0,0,0" Click="BtnJumpPage_Click">
987
-                            <Button.Resources>
988
-                                <Style TargetType="{x:Type Border}">
989
-                                    <Setter Property="CornerRadius" Value="0" />
990
-                                    <Setter Property="BorderBrush" Value="#3492F4" />
991
-                                </Style>
992
-                            </Button.Resources>
993
-                            <Image Source="/星火微课;component/Images/VideoList_OK.png" Margin="2,2,2,2"></Image>
994
-                        </Button>-->
978
+                                        </StackPanel>
979
+                                    </Button>
995 980
 
996
-                                        <ComboBox
997
-                                            x:Name="CbxPageList"
998
-                                            Width="55"
999
-                                            Height="24"
1000
-                                            HorizontalAlignment="Center"
1001
-                                            VerticalAlignment="Center"
1002
-                                            VerticalContentAlignment="Center"
1003
-                                            BorderThickness="1"
1004
-                                            Cursor="Hand"
1005
-                                            DisplayMemberPath="PageName"
1006
-                                            FontSize="{Binding WordSize14}"
1007
-                                            SelectedIndex="-1"
1008
-                                            SelectedValuePath="PageCode"
1009
-                                            SelectionChanged="CbxPageList_SelectionChanged">
1010
-                                            <ComboBox.Background>
1011
-                                                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
1012
-                                                    <GradientStop Offset="0" Color="#FFF0F0F0" />
1013
-                                                    <GradientStop Offset="1" Color="#FFE5E5E5" />
1014
-                                                </LinearGradientBrush>
1015
-                                            </ComboBox.Background>
1016
-                                        </ComboBox>
1017
-                                        <TextBlock
1018
-                                            Margin="3,0,0,0"
1019
-                                            VerticalAlignment="Center"
1020
-                                            FontSize="{Binding WordSize14}"
1021
-                                            Text="页" />
1022
-                                    </StackPanel>
1023
-                                </Grid>
1024
-                                <StackPanel
981
+                                </StackPanel>
982
+                            </Grid>
983
+                            <StackPanel
1025 984
                                     Margin="5"
985
+                                    Grid.Column="1"
1026 986
                                     HorizontalAlignment="Right"
1027 987
                                     VerticalAlignment="Center"
1028 988
                                     Orientation="Horizontal">
1029
-                                    <TextBlock
989
+                                <TextBlock
1030 990
                                         Margin="5,0,0,0"
1031 991
                                         Padding="0,0,0,0"
1032 992
                                         VerticalAlignment="Center"
1033 993
                                         FontSize="{Binding WordSize12}"
1034 994
                                         Text="颜色: " />
1035
-                                    <Button
995
+                                <Button
1036 996
                                         x:Name="btnWhite"
1037 997
                                         Width="20"
1038 998
                                         Height="20"
@@ -1041,12 +1001,12 @@
1041 1001
                                         Click="BtnWhite_Click"
1042 1002
                                         Cursor="Hand"
1043 1003
                                         Visibility="Collapsed" />
1044
-                                    <Border
1004
+                                <Border
1045 1005
                                         Width="20"
1046 1006
                                         Height="20"
1047 1007
                                         Margin="5,2,0,0"
1048 1008
                                         Background="#666666">
1049
-                                        <Button
1009
+                                    <Button
1050 1010
                                             x:Name="btnRed"
1051 1011
                                             Width="20"
1052 1012
                                             Height="20"
@@ -1056,19 +1016,19 @@
1056 1016
                                             Click="BtnRed_Click"
1057 1017
                                             Cursor="Hand"
1058 1018
                                             Style="{StaticResource NoMouseOverButtonStyle}">
1059
-                                            <Image
1019
+                                        <Image
1060 1020
                                                 x:Name="imgRed"
1061 1021
                                                 Width="12"
1062 1022
                                                 Source=".\Images\microLessonSystem_999.png"
1063 1023
                                                 Visibility="Visible" />
1064
-                                        </Button>
1065
-                                    </Border>
1066
-                                    <Border
1024
+                                    </Button>
1025
+                                </Border>
1026
+                                <Border
1067 1027
                                         Width="20"
1068 1028
                                         Height="20"
1069 1029
                                         Margin="5,2,0,0"
1070 1030
                                         Background="#666666">
1071
-                                        <Button
1031
+                                    <Button
1072 1032
                                             x:Name="btnGray"
1073 1033
                                             Width="20"
1074 1034
                                             Height="20"
@@ -1077,19 +1037,19 @@
1077 1037
                                             Click="BtnGray_Click"
1078 1038
                                             Cursor="Hand"
1079 1039
                                             Style="{StaticResource NoMouseOverButtonStyle}">
1080
-                                            <Image
1040
+                                        <Image
1081 1041
                                                 x:Name="imgGray"
1082 1042
                                                 Width="12"
1083 1043
                                                 Source=".\Images\microLessonSystem_999.png"
1084 1044
                                                 Visibility="Collapsed" />
1085
-                                        </Button>
1086
-                                    </Border>
1087
-                                    <Border
1045
+                                    </Button>
1046
+                                </Border>
1047
+                                <Border
1088 1048
                                         Width="20"
1089 1049
                                         Height="20"
1090 1050
                                         Margin="5,2,0,0"
1091 1051
                                         Background="#666666">
1092
-                                        <Button
1052
+                                    <Button
1093 1053
                                             x:Name="btnCyanBlue"
1094 1054
                                             Width="20"
1095 1055
                                             Height="20"
@@ -1098,20 +1058,20 @@
1098 1058
                                             Click="BtnCyanBlue_Click"
1099 1059
                                             Cursor="Hand"
1100 1060
                                             Style="{StaticResource NoMouseOverButtonStyle}">
1101
-                                            <Image
1061
+                                        <Image
1102 1062
                                                 x:Name="imgCyanBlue"
1103 1063
                                                 Width="12"
1104 1064
                                                 Source=".\Images\microLessonSystem_999.png"
1105 1065
                                                 Visibility="Collapsed" />
1106
-                                        </Button>
1107
-                                    </Border>
1108
-                                    <Border
1066
+                                    </Button>
1067
+                                </Border>
1068
+                                <Border
1109 1069
                                         Width="20"
1110 1070
                                         Height="20"
1111 1071
                                         Margin="5,2,0,0"
1112 1072
                                         Background="#666666">
1113 1073
 
1114
-                                        <Button
1074
+                                    <Button
1115 1075
                                             x:Name="btnYellow"
1116 1076
                                             Width="20"
1117 1077
                                             Height="20"
@@ -1121,20 +1081,20 @@
1121 1081
                                             Cursor="Hand"
1122 1082
                                             Style="{StaticResource NoMouseOverButtonStyle}">
1123 1083
 
1124
-                                            <Image
1084
+                                        <Image
1125 1085
                                                 x:Name="imgYellow"
1126 1086
                                                 Width="12"
1127 1087
                                                 Source=".\Images\microLessonSystem_999.png"
1128 1088
                                                 Visibility="Collapsed" />
1129
-                                        </Button>
1130
-                                    </Border>
1131
-                                    <Border
1089
+                                    </Button>
1090
+                                </Border>
1091
+                                <Border
1132 1092
                                         Width="20"
1133 1093
                                         Height="20"
1134 1094
                                         Margin="5,2,0,0"
1135 1095
                                         Background="#666666">
1136 1096
 
1137
-                                        <Button
1097
+                                    <Button
1138 1098
                                             x:Name="btnBlue"
1139 1099
                                             Width="20"
1140 1100
                                             Height="20"
@@ -1143,20 +1103,20 @@
1143 1103
                                             Click="BtnBlue_Click"
1144 1104
                                             Cursor="Hand"
1145 1105
                                             Style="{StaticResource NoMouseOverButtonStyle}">
1146
-                                            <Image
1106
+                                        <Image
1147 1107
                                                 x:Name="imgBlue"
1148 1108
                                                 Width="12"
1149 1109
                                                 Source=".\Images\microLessonSystem_999.png"
1150 1110
                                                 Visibility="Collapsed" />
1151
-                                        </Button>
1152
-                                    </Border>
1153
-                                    <TextBlock
1111
+                                    </Button>
1112
+                                </Border>
1113
+                                <TextBlock
1154 1114
                                         Margin="5,0,0,0"
1155 1115
                                         Padding="0,0,0,0"
1156 1116
                                         VerticalAlignment="Center"
1157 1117
                                         FontSize="{Binding WordSize12}"
1158 1118
                                         Text="粗细: " />
1159
-                                    <RadioButton
1119
+                                <RadioButton
1160 1120
                                         x:Name="rbnFine"
1161 1121
                                         Margin="0"
1162 1122
                                         VerticalAlignment="Center"
@@ -1166,7 +1126,7 @@
1166 1126
                                         FontSize="{Binding WordSize12}"
1167 1127
                                         IsChecked="True"
1168 1128
                                         Style="{StaticResource radBase}" />
1169
-                                    <RadioButton
1129
+                                <RadioButton
1170 1130
                                         x:Name="rbnIn"
1171 1131
                                         Margin="5,0,0,0"
1172 1132
                                         VerticalAlignment="Center"
@@ -1175,7 +1135,7 @@
1175 1135
                                         Cursor="Hand"
1176 1136
                                         FontSize="{Binding WordSize12}"
1177 1137
                                         Style="{StaticResource radBase}" />
1178
-                                    <RadioButton
1138
+                                <RadioButton
1179 1139
                                         x:Name="rbnCrude"
1180 1140
                                         Margin="5,0,0,0"
1181 1141
                                         VerticalAlignment="Center"
@@ -1184,18 +1144,19 @@
1184 1144
                                         Cursor="Hand"
1185 1145
                                         FontSize="{Binding WordSize12}"
1186 1146
                                         Style="{StaticResource radBase}" />
1187
-                                </StackPanel>
1188
-                                <StackPanel
1147
+                            </StackPanel>
1148
+                            <StackPanel
1189 1149
                                     Margin="5"
1150
+                                    Grid.Column="2"
1190 1151
                                     HorizontalAlignment="Right"
1191 1152
                                     VerticalAlignment="Center"
1192 1153
                                     Orientation="Horizontal">
1193
-                                    <TextBlock
1154
+                                <TextBlock
1194 1155
                                         Padding="5,0,0,0"
1195 1156
                                         VerticalAlignment="Center"
1196 1157
                                         FontSize="{Binding WordSize12}"
1197 1158
                                         Text="摄像头: " />
1198
-                                    <RadioButton
1159
+                                <RadioButton
1199 1160
                                         x:Name="rbnOpen"
1200 1161
                                         Margin="0,0,0,0"
1201 1162
                                         VerticalAlignment="Center"
@@ -1204,7 +1165,7 @@
1204 1165
                                         Cursor="Hand"
1205 1166
                                         FontSize="{Binding WordSize12}"
1206 1167
                                         Style="{StaticResource radBase}" />
1207
-                                    <RadioButton
1168
+                                <RadioButton
1208 1169
                                         x:Name="rbnTurnOff"
1209 1170
                                         Margin="5,0,10,0"
1210 1171
                                         VerticalAlignment="Center"
@@ -1214,7 +1175,6 @@
1214 1175
                                         FontSize="{Binding WordSize12}"
1215 1176
                                         IsChecked="True"
1216 1177
                                         Style="{StaticResource radBase}" />
1217
-                                </StackPanel>
1218 1178
                             </StackPanel>
1219 1179
                         </Grid>
1220 1180
                     </Grid>

+ 104
- 691
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs
文件差异内容过多而无法显示
查看文件


+ 3
- 0
XHWK.WKTool/XHWK.WKTool.csproj 查看文件

@@ -855,6 +855,9 @@
855 855
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
856 856
     </Content>
857 857
   </ItemGroup>
858
+  <ItemGroup>
859
+    <Folder Include="Utils\luobo\" />
860
+  </ItemGroup>
858 861
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
859 862
   <PropertyGroup>
860 863
     <PreBuildEvent>xcopy /Y /i /e $(ProjectDir)\Extension $(TargetDir)\

正在加载...
取消
保存