Browse Source

对接罗博智写板T8C

tags/对接微服务前
张剑 3 years ago
parent
commit
d0efc4b3df

BIN
DLL/Robot/RbtBezier.dll View File


BIN
DLL/Robot/RobotDotMatrix.dll View File


BIN
DLL/Robot/RobotUsbWrapper.dll View File


BIN
DLL/Robot/RobotpenGateway.dll View File


+ 2
- 2
XHWK.WKTool/App.config View File

9
     <!--参数是否加密 0不加密 1加密-->
9
     <!--参数是否加密 0不加密 1加密-->
10
     <add key="IsParameterEncryption" value="0" />
10
     <add key="IsParameterEncryption" value="0" />
11
     <!--版本号-->
11
     <!--版本号-->
12
-    <add key="VersionCode" value="97" />
13
-    <add key="VersionName" value="3.1.3" />
12
+    <add key="VersionCode" value="98" />
13
+    <add key="VersionName" value="3.1.4" />
14
     <!--皮肤样式 0白 1蓝 2黑色 -->
14
     <!--皮肤样式 0白 1蓝 2黑色 -->
15
     <add key="SkinStyle" value="0" />
15
     <add key="SkinStyle" value="0" />
16
     <!--是否输出视频记录日志:0否-->
16
     <!--是否输出视频记录日志:0否-->

BIN
XHWK.WKTool/Extension/RbtBezier.dll View File


BIN
XHWK.WKTool/Extension/RobotUsbWrapper.dll View File


+ 93
- 152
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

566
         /// </param>
566
         /// </param>
567
         private void BtnAdd_Click(object sender, RoutedEventArgs e)
567
         private void BtnAdd_Click(object sender, RoutedEventArgs e)
568
         {
568
         {
569
+            lb_device_hand();
569
             Record();
570
             Record();
570
             if (APP.PageContextData.currpage > 0)
571
             if (APP.PageContextData.currpage > 0)
571
             {
572
             {
2656
         /// </param>
2657
         /// </param>
2657
         private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
2658
         private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
2658
         {
2659
         {
2660
+            lb_device_mouse();
2659
             ThreadPool.QueueUserWorkItem(o =>
2661
             ThreadPool.QueueUserWorkItem(o =>
2660
             {
2662
             {
2661
                 bool microphoneGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.microphone);
2663
                 bool microphoneGood = ZAudioRecordHelper.IsDeviceGood(ZAudioRecordHelper.RecordType.microphone);
2961
                     EndRecord();
2963
                     EndRecord();
2962
                 }))).Start();
2964
                 }))).Start();
2963
                 //鼠标模式
2965
                 //鼠标模式
2964
-                deviceMouse();
2966
+                lb_device_mouse();
2965
             }
2967
             }
2966
         }
2968
         }
2967
 
2969
 
2980
         private void StartRecord()
2982
         private void StartRecord()
2981
         {
2983
         {
2982
             //电子版切换笔模式
2984
             //电子版切换笔模式
2983
-            deviceHand();
2985
+            lb_device_hand();
2984
 
2986
 
2985
             VideoInfo = new Model_Video
2987
             VideoInfo = new Model_Video
2986
             {
2988
             {
3670
             }
3672
             }
3671
             else
3673
             else
3672
             {
3674
             {
3673
-                //labPenSerial.Text = penSerial;
3674
-                //labPenStatus.Text = "PenDown";
3675
+
3675
                 isPenDown = true;
3676
                 isPenDown = true;
3676
 
3677
 
3677
-                //Dispatcher.Invoke(new Action(() =>
3678
-                //{
3679
-                //    for (int i = 0; i < APP.PageDrawList.Count; i++)
3680
-                //    {
3681
-                //        if (APP.PageDrawList[i].PageCode == penSerial)
3682
-                //        {
3683
-                //            if (i < APP.pageData.pagenum)
3684
-                //            {
3685
-                //                if (i < APP.pageData.currpage)
3686
-                //                {
3687
-                //                    int num = APP.pageData.currpage - i;
3688
-                //                    APP.pageData.currpage -= num;
3689
-                //                    myblackboard.changepage(APP.pageData.currpage - 1);
3690
-                //                    if (APP.PageDrawList.Count > 0)
3691
-                //                    {
3692
-                //                        if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && APP.pageData.currpage > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
3693
-                //                        {
3694
-                //                            //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage - 1]));//cs
3695
-
3696
-                //                            imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3697
-                //                        }
3698
-                //                        else
3699
-                //                        {
3700
-                //                            imgCanvas.Source = null;
3701
-                //                        }
3702
-                //                    }
3703
-                //                }
3704
-                //                else
3705
-                //                {
3706
-                //                    int num = i - APP.pageData.currpage;
3707
-                //                    APP.pageData.currpage += num;
3708
-                //                    myblackboard.changepage(APP.pageData.currpage - 1);
3709
-                //                    if (APP.PageDrawList.Count > 0)
3710
-                //                    {
3711
-                //                        if (!string.IsNullOrWhiteSpace(txbCurrpage.Text) && APP.pageData.currpage <= APP.PageDrawList.Count && !string.IsNullOrWhiteSpace(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath))
3712
-                //                        {
3713
-                //                            //imgCanvas.Source = new BitmapImage(new Uri(APP.Paths[APP.pageData.currpage-1]));
3714
-                //                            imgCanvas.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));
3715
-                //                        }
3716
-                //                        else
3717
-                //                        {
3718
-                //                            imgCanvas.Source = null;
3719
-                //                        }
3720
-                //                    }
3721
-                //                }
3722
-                //            }
3723
-                //            return;
3724
-                //        }
3725
-                //    }
3726
-                //    //myblackboard.changepages(0, 0, true);
3727
-                //    //myblackboard.changepaget(0, 0, true, blackboard_canvas);
3728
-                //}));
3729
             }
3678
             }
3730
             //myblackboard.changepages(0, 0, true);
3679
             //myblackboard.changepages(0, 0, true);
3731
         }
3680
         }
3882
             }
3831
             }
3883
             else
3832
             else
3884
             {
3833
             {
3885
-                //System.Windows.MessageWindow.Show("存储:" + fillLevel.ToString());
3886
             }
3834
             }
3887
         }
3835
         }
3888
 
3836
 
4145
         /// <summary>
4093
         /// <summary>
4146
         /// 笔模式
4094
         /// 笔模式
4147
         /// </summary>
4095
         /// </summary>
4148
-        private void deviceHand()
4096
+        private void lb_device_hand()
4149
         {
4097
         {
4150
             IsPen = true;
4098
             IsPen = true;
4151
-            if (APP.IsOutputInfoLog)
4152
-            {
4153
-                LogHelper.WriteInfoLog(string.Format("切换笔模式:设备类型:{0}", deviceType.ToString()));
4154
-            }
4155
             if (deviceType == eDeviceType.T8B_D2 || deviceType == eDeviceType.T8Y || deviceType == eDeviceType.T8S_LQ || deviceType == eDeviceType.T8C)
4099
             if (deviceType == eDeviceType.T8B_D2 || deviceType == eDeviceType.T8Y || deviceType == eDeviceType.T8S_LQ || deviceType == eDeviceType.T8C)
4156
             {
4100
             {
4157
-                IsT8 = true;
4158
                 robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_HAND);
4101
                 robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_HAND);
4159
-                if (APP.IsOutputInfoLog)
4160
-                {
4161
-                    LogHelper.WriteInfoLog("使用robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_HAND)切换");
4162
-                }
4163
             }
4102
             }
4164
             else
4103
             else
4165
             {
4104
             {
4166
-                IsT8 = false;
4167
                 //获取当前设备模式,根据模式切换鼠标和笔
4105
                 //获取当前设备模式,根据模式切换鼠标和笔
4168
                 robotpenController.GetInstance()._Send(cmdId.SearchMode);
4106
                 robotpenController.GetInstance()._Send(cmdId.SearchMode);
4169
-                if (APP.IsOutputInfoLog)
4170
-                {
4171
-                    LogHelper.WriteInfoLog("发送(cmdId.SearchMode)");
4172
-                }
4173
             }
4107
             }
4174
         }
4108
         }
4175
 
4109
 
4176
         /// <summary>
4110
         /// <summary>
4177
         /// 鼠标模式
4111
         /// 鼠标模式
4178
         /// </summary>
4112
         /// </summary>
4179
-        private void deviceMouse()
4113
+        private void lb_device_mouse()
4180
         {
4114
         {
4181
             IsPen = false;
4115
             IsPen = false;
4182
-            if (deviceType == eDeviceType.T8B_D2 || deviceType == eDeviceType.T8Y || deviceType == eDeviceType.T8S_LQ)
4116
+            if (deviceType == eDeviceType.T8B_D2 || deviceType == eDeviceType.T8Y || deviceType == eDeviceType.T8S_LQ || deviceType == eDeviceType.T8C)
4183
             {
4117
             {
4184
-                IsT8 = true;
4185
                 robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_MOUSE);
4118
                 robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_MOUSE);
4186
-                if (APP.IsOutputInfoLog)
4187
-                {
4188
-                    LogHelper.WriteInfoLog("使用robotpenController.GetInstance().setDeviceMode(eDeviceMode.DEVICE_MOUSE)切换");
4189
-                }
4190
             }
4119
             }
4191
             else
4120
             else
4192
             {
4121
             {
4193
-                IsT8 = false;
4194
                 //获取当前设备模式,根据模式切换鼠标和笔
4122
                 //获取当前设备模式,根据模式切换鼠标和笔
4195
                 robotpenController.GetInstance()._Send(cmdId.SearchMode);
4123
                 robotpenController.GetInstance()._Send(cmdId.SearchMode);
4196
-                if (APP.IsOutputInfoLog)
4197
-                {
4198
-                    LogHelper.WriteInfoLog("发送(cmdId.SearchMode)");
4199
-                }
4200
             }
4124
             }
4201
         }
4125
         }
4202
 
4126
 
4237
             }
4161
             }
4238
         }
4162
         }
4239
 
4163
 
4164
+        // 子节点设备状态改变事件
4165
+        private void Form1_nodeStatusEvt(NODE_STATUS ns)
4166
+        {
4167
+            string strStatus = string.Empty;
4168
+            switch (ns)
4169
+            {
4170
+                case NODE_STATUS.DEVICE_POWER_OFF:
4171
+                    {
4172
+                        strStatus = "DEVICE_POWER_OFF";
4173
+                    }
4174
+                    break;
4175
+                case NODE_STATUS.DEVICE_STANDBY:
4176
+                    {
4177
+                        strStatus = "DEVICE_STANDBY";
4178
+                       
4179
+                    }
4180
+                    break;
4181
+                case NODE_STATUS.DEVICE_INIT_BTN:
4182
+                    {
4183
+                        strStatus = "DEVICE_INIT_BTN";
4184
+                       
4185
+                    }
4186
+                    break;
4187
+                case NODE_STATUS.DEVICE_OFFLINE:
4188
+                    {
4189
+                        strStatus = "DEVICE_OFFLINE";
4190
+                    }
4191
+                    break;
4192
+                case NODE_STATUS.DEVICE_ACTIVE:
4193
+                    {
4194
+                        strStatus = "DEVICE_ACTIVE";
4195
+                        //deviceHand();
4196
+                    }
4197
+                    break;
4198
+                case NODE_STATUS.DEVICE_LOW_POWER_ACTIVE:
4199
+                    {
4200
+                        strStatus = "DEVICE_LOW_POWER_ACTIVE";
4201
+                    }
4202
+                    break;
4203
+                case NODE_STATUS.DEVICE_OTA_MODE:
4204
+                    {
4205
+                        strStatus = "DEVICE_OTA_MODE";
4206
+                    }
4207
+                    break;
4208
+                case NODE_STATUS.DEVICE_OTA_WAIT_SWITCH:
4209
+                    {
4210
+                        strStatus = "DEVICE_OTA_WAIT_SWITCH";
4211
+                    }
4212
+                    break;
4213
+                case NODE_STATUS.DEVICE_DFU_MODE:
4214
+                    {
4215
+                        strStatus = "DEVICE_DFU_MODE";
4216
+                        
4217
+                    }
4218
+                    break;
4219
+                case NODE_STATUS.DEVICE_TRYING_POWER_OFF:
4220
+                    {
4221
+                        strStatus = "DEVICE_TRYING_POWER_OFF";
4222
+                    }
4223
+                    break;
4224
+                case NODE_STATUS.DEVICE_FINISHED_PRODUCT_TEST:
4225
+                    {
4226
+                        strStatus = "DEVICE_FINISHED_PRODUCT_TEST";
4227
+                    }
4228
+                    break;
4229
+                case NODE_STATUS.DEVICE_SYNC_MODE:
4230
+                    {
4231
+                        strStatus = "DEVICE_SYNC_MODE";
4232
+                    }
4233
+                    break;
4234
+                default:
4235
+                    {
4236
+                        strStatus = "UNKNOW";
4237
+                    }
4238
+                    break;
4239
+            }
4240
+        }
4240
         private void Form1_switchModeEvt(int modeType)
4241
         private void Form1_switchModeEvt(int modeType)
4241
         {
4242
         {
4242
             if (modeType == 1)
4243
             if (modeType == 1)
4247
                 }
4248
                 }
4248
                 if (!IsPen)
4249
                 if (!IsPen)
4249
                 {
4250
                 {
4250
-                    deviceMouse();
4251
+                    lb_device_mouse();
4251
                 }
4252
                 }
4252
             }
4253
             }
4253
             else
4254
             else
4258
                 }
4259
                 }
4259
                 if (IsPen)
4260
                 if (IsPen)
4260
                 {
4261
                 {
4261
-                    deviceHand();
4262
+                    lb_device_hand();
4262
                 }
4263
                 }
4263
             }
4264
             }
4264
         }
4265
         }
4271
                 robotpenController.GetInstance()._ConnectInitialize(eDeviceType.Gateway, IntPtr.Zero);
4272
                 robotpenController.GetInstance()._ConnectInitialize(eDeviceType.Gateway, IntPtr.Zero);
4272
                 robotpenController.GetInstance().deviceChangeEvt += new robotpenController.DeviceChange(Form1_deviceChangeEvt);
4273
                 robotpenController.GetInstance().deviceChangeEvt += new robotpenController.DeviceChange(Form1_deviceChangeEvt);
4273
                 robotpenController.GetInstance().searchModeEvt += Form1_searchModeEvt;
4274
                 robotpenController.GetInstance().searchModeEvt += Form1_searchModeEvt;
4275
+                robotpenController.GetInstance().nodeStatusEvt += Form1_nodeStatusEvt;
4274
                 robotpenController.GetInstance().switchModeEvt += Form1_switchModeEvt;
4276
                 robotpenController.GetInstance().switchModeEvt += Form1_switchModeEvt;
4275
 
4277
 
4276
                 //// 所有设备均注册该页码显示消息 目前只有T9设备才会有页码识别功能, 客户代码可以根据设备来判断是否消费该事件
4278
                 //// 所有设备均注册该页码显示消息 目前只有T9设备才会有页码识别功能, 客户代码可以根据设备来判断是否消费该事件
4291
             }
4293
             }
4292
         }
4294
         }
4293
 
4295
 
4294
-        /// <summary>
4295
-        /// 委托实例函数,用于异步修改listview显示的USB连接设备信息
4296
-        /// </summary>
4297
-        private void SetListView()
4298
-        {
4299
-            if (usbIsConnected)
4300
-            {
4301
-                robotpenController.GetInstance()._CloseConnect();
4302
-            }
4303
-            CheckUsbConnect();
4304
-        }
4296
+   
4305
 
4297
 
4306
         /// <summary>
4298
         /// <summary>
4307
         /// 设备插拔消息,更新listview
4299
         /// 设备插拔消息,更新listview
4313
         private void Form1_deviceChangeEvt(bool bStatus, ushort uPid)
4305
         private void Form1_deviceChangeEvt(bool bStatus, ushort uPid)
4314
         {
4306
         {
4315
             //throw new NotImplementedException();
4307
             //throw new NotImplementedException();
4316
-            //Console.WriteLine();
4308
+            Console.WriteLine("Form1_deviceChangeEvt");
4317
             try
4309
             try
4318
             {
4310
             {
4319
                 if (APP.IsOutputInfoLog)
4311
                 if (APP.IsOutputInfoLog)
4324
             catch (Exception)
4316
             catch (Exception)
4325
             {
4317
             {
4326
             }
4318
             }
4327
-            //SetListView();
4328
             CheckUsbConnect();
4319
             CheckUsbConnect();
4329
         }
4320
         }
4330
 
4321
 
4506
                             new Thread(new ThreadStart(new Action(() =>
4497
                             new Thread(new ThreadStart(new Action(() =>
4507
                             {
4498
                             {
4508
                                 Thread.Sleep(500);
4499
                                 Thread.Sleep(500);
4509
-
4500
+                               
4510
                                 robotpenController.GetInstance()._Send(cmdId.SearchMode);
4501
                                 robotpenController.GetInstance()._Send(cmdId.SearchMode);
4511
                             }))).Start();
4502
                             }))).Start();
4512
                         }
4503
                         }
4504
+
4505
+                      
4513
                     }
4506
                     }
4514
                 }
4507
                 }
4515
             }
4508
             }
5823
                     return;
5816
                     return;
5824
                 });
5817
                 });
5825
             }
5818
             }
5826
-
5827
-            #region 拓思德生成点阵文件
5828
-
5829
-            ////TPF文件位置
5830
-            //string TPFPath = FileToolsCommon.GetFileAbsolutePath("temp/");
5831
-            //FileToolsCommon.CreateDirectory(TPFPath);
5832
-            //TPFPath += "101.TPF";
5833
-            ////生成点阵文件
5834
-            //LatticeFileHelper.GeneratingPDF(SourcePath, TPFPath, out int pr, out string msg, out string outPut/*, pyte*/);
5835
-            //while (!FileToolsCommon.IsExistFile(TPFPath))
5836
-            //{
5837
-            //    Thread.Sleep(100);
5838
-            //}
5839
-            //while (string.IsNullOrWhiteSpace(pr.ToString()))
5840
-            //{
5841
-            //    Thread.Sleep(100);
5842
-            //}
5843
-            //Thread.Sleep(1000);
5844
-
5845
-            #endregion 拓思德生成点阵文件
5846
-
5847
-            #region 拓思德打印
5848
-
5849
-            ////打印
5850
-            //LatticeFileHelper.PrinterTPFFile(TPFPath, PrinterNum, PrinterName, out int printResult, out string standardError, out string standardOutput);
5851
-            //if (printResult == 0)
5852
-            //{
5853
-            //    Dispatcher.Invoke(() =>
5854
-            //    {
5855
-            //        btnClose.IsEnabled = true;
5856
-            //        btnPrint.IsEnabled = true;
5857
-            //        num = 99;
5858
-            //        timesPrint.Stop();
5859
-            //        pgbProcess.Value = 100;
5860
-            //        lbProcess.Content = "100%";
5861
-            //        MessageWindow.Show("打印成功!");
5862
-            //        GridPrintMask.Visibility = Visibility.Collapsed;
5863
-            //    });
5864
-            //}
5865
-            //else
5866
-            //{
5867
-            //    Dispatcher.Invoke(() =>
5868
-            //    {
5869
-            //        btnClose.IsEnabled = true;
5870
-            //        btnPrint.IsEnabled = true;
5871
-            //        timesPrint.Stop();
5872
-            //        GridPrintMask.Visibility = Visibility.Collapsed;
5873
-            //        MessageWindow.Show(standardError);
5874
-            //    });
5875
-            //}
5876
-
5877
-            #endregion 拓思德打印
5878
         }
5819
         }
5879
 
5820
 
5880
         /// <summary>
5821
         /// <summary>

+ 1
- 1
XHWK.WKTool/XHWK.WKTool.csproj View File

152
     <Reference Include="O2S.Components.PDFRender4NET">
152
     <Reference Include="O2S.Components.PDFRender4NET">
153
       <HintPath>..\DLL\O2S.Components.PDFRender4NET.dll</HintPath>
153
       <HintPath>..\DLL\O2S.Components.PDFRender4NET.dll</HintPath>
154
     </Reference>
154
     </Reference>
155
-    <Reference Include="RobotpenGateway, Version=1.1.6.1, Culture=neutral, processorArchitecture=x86">
155
+    <Reference Include="RobotpenGateway, Version=1.1.6.2, Culture=neutral, processorArchitecture=x86">
156
       <SpecificVersion>False</SpecificVersion>
156
       <SpecificVersion>False</SpecificVersion>
157
       <HintPath>..\DLL\Robot\RobotpenGateway.dll</HintPath>
157
       <HintPath>..\DLL\Robot\RobotpenGateway.dll</HintPath>
158
     </Reference>
158
     </Reference>

+ 1
- 1
星火微课/星火微课-正式.iss View File

3
 
3
 
4
 #define MyAppName "星火微课"  
4
 #define MyAppName "星火微课"  
5
 #define MyAppDir "xhwk"
5
 #define MyAppDir "xhwk"
6
-#define MyAppVersion "3.1.3"
6
+#define MyAppVersion "3.1.4"
7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
7
 #define MyAppPublisher "河南星火燎原软件科技有限公司"
8
 #define MyAppURL "http://www.xhkjedu.com/"
8
 #define MyAppURL "http://www.xhkjedu.com/"
9
 #define MySourcePath "D:\Project\CSharp\xhwkclient\XHWK.WKTool\bin\x86\Debug\"
9
 #define MySourcePath "D:\Project\CSharp\xhwkclient\XHWK.WKTool\bin\x86\Debug\"

Loading…
Cancel
Save