Parcourir la source

删除废弃代码

tags/对接微服务前
张剑 il y a 3 ans
Parent
révision
4c4ef6509c
1 fichiers modifiés avec 27 ajouts et 171 suppressions
  1. 27
    171
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 27
- 171
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs Voir le fichier

@@ -112,11 +112,6 @@ namespace XHWK.WKTool
112 112
         /// </summary>
113 113
         internal FileDirectoryData pageData = new FileDirectoryData();
114 114
 
115
-        /// <summary>
116
-        /// 下标
117
-        /// </summary>
118
-        private int Subscript = 0;
119
-
120 115
         /// <summary>
121 116
         /// 是否是修改状态
122 117
         /// </summary>
@@ -172,7 +167,7 @@ namespace XHWK.WKTool
172 167
             txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoSavePath");
173 168
             Initialize();
174 169
             //拓思德
175
-            //InitPen();
170
+            //InitTSDPen();
176 171
             //罗博手写板
177 172
             InitlbPen();
178 173
             //腾千里
@@ -311,8 +306,6 @@ namespace XHWK.WKTool
311 306
         {
312 307
             //设置
313 308
             gridSetUp.Visibility = Visibility.Collapsed;
314
-            ////页码
315
-            //GridPage.Visibility = Visibility.Collapsed;
316 309
             //我的
317 310
             GridMyVideo.Visibility = Visibility.Collapsed;
318 311
             //首页
@@ -664,25 +657,6 @@ namespace XHWK.WKTool
664 657
             }
665 658
         }
666 659
 
667
-        /// <summary>
668
-        /// 最小化
669
-        /// </summary>
670
-        /// <param name="sender">
671
-        /// </param>
672
-        /// <param name="e">
673
-        /// </param>
674
-        private void BtnShrink_Click(object sender, RoutedEventArgs e)
675
-        {
676
-            if (WindowState == WindowState.Minimized)
677
-            {
678
-                WindowState = WindowState.Normal;
679
-            }
680
-            else
681
-            {
682
-                WindowState = WindowState.Minimized;
683
-            }
684
-        }
685
-
686 660
         #endregion 事件
687 661
 
688 662
         #region 设置
@@ -704,38 +678,6 @@ namespace XHWK.WKTool
704 678
 
705 679
                 #region 读取用户配置
706 680
 
707
-                #region 请求地址  废弃  --2021年7月9日赵耀
708
-
709
-                ////接口地址
710
-                //if (!File.Exists(APP.DataPath + "interfaceAddress.txt")) //若为空
711
-                //{
712
-                //    txbInterfaceAddress.Text = APP.apiUrl.Replace("http://", "").Trim();
713
-                //}
714
-                //else
715
-                //{
716
-                //    txbInterfaceAddress.Text = System.IO.File.ReadAllText(APP.DataPath + "interfaceAddress.txt", Encoding.Default).Replace("http://", "").Trim();
717
-                //}
718
-                ////上传地址
719
-                //if (!File.Exists(APP.DataPath + "imageUploadAddress.txt")) //若为空
720
-                //{
721
-                //    txbImageUploadAddress.Text = APP.uploadUrl.Replace("http://", "").Replace("/", "").Trim();
722
-                //}
723
-                //else
724
-                //{
725
-                //    txbImageUploadAddress.Text = System.IO.File.ReadAllText(APP.DataPath + "imageUploadAddress.txt", Encoding.Default).Replace("http://", "").Replace("/", "").Trim();
726
-                //}
727
-                ////下载地址
728
-                //if (!File.Exists(APP.DataPath + "pictureShowsAddress.txt")) //若为空
729
-                //{
730
-                //    txbPictureShowsAddress.Text = APP.showImageUrl.Replace("http://", "").Replace("/static", "").Replace("/", "").Trim();
731
-                //}
732
-                //else
733
-                //{
734
-                //    txbPictureShowsAddress.Text = System.IO.File.ReadAllText(APP.DataPath + "pictureShowsAddress.txt", Encoding.Default).Replace("http://", "").Replace("/static", "").Replace("/", "").Trim();
735
-                //}
736
-
737
-                #endregion 请求地址  废弃  --2021年7月9日赵耀
738
-
739 681
                 /// < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
740 682
                 if ("1".Equals(APP.CameraPosition))
741 683
                 {
@@ -796,11 +738,6 @@ namespace XHWK.WKTool
796 738
                 GridM.IsEnabled = true;
797 739
                 GridRecordingTitle.Visibility = Visibility.Visible;
798 740
                 gridSetUp.Visibility = Visibility.Collapsed;
799
-                //if (APP.pageData.pagenum > 0)
800
-                //{
801
-                //    GridPage.Visibility = Visibility.Visible;
802
-                //}
803
-                //DataContext = APP.pageData;
804 741
             }
805 742
         }
806 743
 
@@ -830,14 +767,6 @@ namespace XHWK.WKTool
830 767
                 {
831 768
                     FileToolsCommon.SetConfigValue("VideoType", "3");
832 769
                 }
833
-                //if (rbnY.IsChecked == true)
834
-                //{
835
-                //    FileToolsCommon.SetConfigValue("IsSound", "true");
836
-                //}
837
-                //else
838
-                //{
839
-                //    FileToolsCommon.SetConfigValue("IsSound", "false");
840
-                //}
841 770
 
842 771
                 UpdateHideSRToolConfig();
843 772
 
@@ -1395,23 +1324,8 @@ namespace XHWK.WKTool
1395 1324
                     DereferenceLinks = true
1396 1325
                 };
1397 1326
 
1398
-                //APP.myloading.Show();
1399 1327
                 APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeServering, InvokeServerCompate);
1400 1328
 
1401
-                //new Thread(
1402
-                //    o =>
1403
-                //    {
1404
-                //        Thread.Sleep(400);
1405
-
1406
-                //        Dispatcher.Invoke(new Action(() =>
1407
-                //        {
1408
-                //            OpenDialog();
1409
-                //        }
1410
-                //            ));
1411
-                //    })
1412
-                //{
1413
-                //    IsBackground = true
1414
-                //}.Start();
1415 1329
             }
1416 1330
             catch (Exception ex)
1417 1331
             {
@@ -3611,31 +3525,27 @@ namespace XHWK.WKTool
3611 3525
 
3612 3526
         #endregion 值初始化
3613 3527
 
3614
-        public void InitPen()
3528
+        public void InitTSDPen()
3615 3529
         {
3616 3530
             //stroke = new List<System.Drawing.Point>();
3617 3531
             //获取点阵笔实例,并绑定点阵笔事件
3618 3532
             //将授权文件内容传入,获取点阵笔对象实例
3619 3533
             APP.digitalPen = DigitalPenHID.GetInstance(certificates.MyLicense.Bytes);
3620 3534
             //绑定笔连接事件
3621
-            APP.digitalPen.PenConnected += OnPenConnect;
3535
+            APP.digitalPen.PenConnected += OnTSDPenConnect;
3622 3536
             //绑定笔断开事件
3623
-            APP.digitalPen.PenDisconnect += OnPenDisconnect;
3537
+            APP.digitalPen.PenDisconnect += OnTSDPenDisconnect;
3624 3538
             //绑定笔书写输出坐标事件
3625
-            APP.digitalPen.PenCoordinate += OnPenCoordinate;
3539
+            APP.digitalPen.PenCoordinate += OnTSDPenCoordinate;
3626 3540
             //绑定抬笔事件
3627
-            APP.digitalPen.PenUp += OnPenUp;
3541
+            APP.digitalPen.PenUp += OnTSDPenUp;
3628 3542
             //绑定落笔事件
3629
-            APP.digitalPen.PenDown += OnPenDown;
3630
-            APP.digitalPen.PenBatteryCapacity += OnBatteryCapacity;
3631
-            APP.digitalPen.PenMemoryFillLevel += OnMemoryFillLevel;
3543
+            APP.digitalPen.PenDown += OnTSDPenDown;
3544
+            APP.digitalPen.PenBatteryCapacity += OnTSDBatteryCapacity;
3545
+            APP.digitalPen.PenMemoryFillLevel += OnTSDMemoryFillLevel;
3632 3546
             //完成初始化点阵笔,开始与点阵笔通信
3633 3547
             ERROR_CODE ER = APP.digitalPen.Start();
3634 3548
 
3635
-            ////绑定笔在新的点阵地址页面书写事件
3636
-            //APP.digitalPen.PenNewPage += APP.digitalPen_OnPenNewPage;
3637
-            ////绑定笔信息事件
3638
-            //APP.digitalPen.PenInfo += APP.digitalPen_OnPenInfo;
3639 3549
             //启动接收笔数据,完成初始化工作
3640 3550
             ERROR_CODE rc = APP.digitalPen.Start();
3641 3551
             //判断是否成功
@@ -3657,11 +3567,11 @@ namespace XHWK.WKTool
3657 3567
         /// <param name="penType">
3658 3568
         /// 点阵笔型号编号
3659 3569
         /// </param>
3660
-        private void OnPenDown(ulong time, string penSerial, int penType)
3570
+        private void OnTSDPenDown(ulong time, string penSerial, int penType)
3661 3571
         {
3662 3572
             if (CheckAccess())
3663 3573
             {
3664
-                Action<ulong, string, int> action = new Action<ulong, string, int>(OnPenDown);
3574
+                Action<ulong, string, int> action = new Action<ulong, string, int>(OnTSDPenDown);
3665 3575
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3666 3576
             }
3667 3577
             else
@@ -3670,7 +3580,6 @@ namespace XHWK.WKTool
3670 3580
                 isPenDown = true;
3671 3581
 
3672 3582
             }
3673
-            //myblackboard.changepages(0, 0, true);
3674 3583
         }
3675 3584
 
3676 3585
         /// <summary>
@@ -3685,27 +3594,18 @@ namespace XHWK.WKTool
3685 3594
         /// <param name="penType">
3686 3595
         /// 点阵笔型号编号
3687 3596
         /// </param>
3688
-        private void OnPenUp(ulong time, string penSerial, int penType)
3597
+        private void OnTSDPenUp(ulong time, string penSerial, int penType)
3689 3598
         {
3690 3599
             if (CheckAccess())
3691 3600
             {
3692
-                Action<ulong, string, int> action = new Action<ulong, string, int>(OnPenUp);
3601
+                Action<ulong, string, int> action = new Action<ulong, string, int>(OnTSDPenUp);
3693 3602
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3694 3603
             }
3695 3604
             else
3696 3605
             {
3697 3606
                 isPenDown = false;
3698 3607
                 APP.PenSerial = penSerial;
3699
-                //int leftPoints = stroke.Count % 3;
3700
-                //if (0 != leftPoints)
3701
-                //{
3702
-                //    int from = stroke.Count - leftPoints - 1;
3703
-                //    if (from < 0)
3704
-                //        from = 0;
3705
-                //    int to = stroke.Count - 1;
3706
-                //    DrawCoordinates(from, to);
3707
-                //}
3708
-                //stroke.Clear();
3608
+  
3709 3609
             }
3710 3610
             if (APP.PageContextData.currpage > 0)
3711 3611
             {
@@ -3728,11 +3628,11 @@ namespace XHWK.WKTool
3728 3628
         /// <param name="penType">
3729 3629
         /// 点阵笔型号编号
3730 3630
         /// </param>
3731
-        private void OnPenDisconnect(ulong time, string penSerial, int penType)
3631
+        private void OnTSDPenDisconnect(ulong time, string penSerial, int penType)
3732 3632
         {
3733 3633
             if (CheckAccess())
3734 3634
             {
3735
-                Action<ulong, string, int> action = new Action<ulong, string, int>(OnPenDisconnect);
3635
+                Action<ulong, string, int> action = new Action<ulong, string, int>(OnTSDPenDisconnect);
3736 3636
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3737 3637
             }
3738 3638
             else
@@ -3740,11 +3640,6 @@ namespace XHWK.WKTool
3740 3640
                 APP.PenSerial = penSerial;
3741 3641
                 APP.PenStatus = false;
3742 3642
                 UpdateDevStatus();
3743
-                //Dispatcher.Invoke(new Action(() =>
3744
-                //{
3745
-                //    txbNotConnected.Text = "未连接";
3746
-                //    txbNotConnecteds.Text = "未连接";
3747
-                //}));
3748 3643
             }
3749 3644
         }
3750 3645
 
@@ -3760,11 +3655,11 @@ namespace XHWK.WKTool
3760 3655
         /// <param name="penType">
3761 3656
         /// 点阵笔型号编号
3762 3657
         /// </param>
3763
-        private void OnPenConnect(ulong time, string penSerial, int penType)
3658
+        private void OnTSDPenConnect(ulong time, string penSerial, int penType)
3764 3659
         {
3765 3660
             if (CheckAccess())
3766 3661
             {
3767
-                Action<ulong, string, int> action = new Action<ulong, string, int>(OnPenConnect);
3662
+                Action<ulong, string, int> action = new Action<ulong, string, int>(OnTSDPenConnect);
3768 3663
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3769 3664
             }
3770 3665
             else
@@ -3792,11 +3687,11 @@ namespace XHWK.WKTool
3792 3687
         /// </param>
3793 3688
         /// <param name="capacity">
3794 3689
         /// </param>
3795
-        private void OnBatteryCapacity(ulong time, string penSerial, int penType, byte capacity)
3690
+        private void OnTSDBatteryCapacity(ulong time, string penSerial, int penType, byte capacity)
3796 3691
         {
3797 3692
             if (CheckAccess())
3798 3693
             {
3799
-                Action<ulong, string, int, byte> action = new Action<ulong, string, int, byte>(OnBatteryCapacity);
3694
+                Action<ulong, string, int, byte> action = new Action<ulong, string, int, byte>(OnTSDBatteryCapacity);
3800 3695
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType, capacity });
3801 3696
             }
3802 3697
             else
@@ -3816,11 +3711,11 @@ namespace XHWK.WKTool
3816 3711
         /// </param>
3817 3712
         /// <param name="fillLevel">
3818 3713
         /// </param>
3819
-        private void OnMemoryFillLevel(ulong time, string penSerial, int penType, byte fillLevel)
3714
+        private void OnTSDMemoryFillLevel(ulong time, string penSerial, int penType, byte fillLevel)
3820 3715
         {
3821 3716
             if (CheckAccess())
3822 3717
             {
3823
-                Action<ulong, string, int, byte> action = new Action<ulong, string, int, byte>(OnMemoryFillLevel);
3718
+                Action<ulong, string, int, byte> action = new Action<ulong, string, int, byte>(OnTSDMemoryFillLevel);
3824 3719
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType, fillLevel });
3825 3720
             }
3826 3721
             else
@@ -3852,11 +3747,11 @@ namespace XHWK.WKTool
3852 3747
         /// <param name="force">
3853 3748
         /// 压力值
3854 3749
         /// </param>
3855
-        private void OnPenCoordinate(ulong time, string penSerial, int penType, string pageSerial, int cx, int cy, byte force)
3750
+        private void OnTSDPenCoordinate(ulong time, string penSerial, int penType, string pageSerial, int cx, int cy, byte force)
3856 3751
         {
3857 3752
             if (CheckAccess())
3858 3753
             {
3859
-                Action<ulong, string, int, string, int, int, byte> ac = new Action<ulong, string, int, string, int, int, byte>(OnPenCoordinate);
3754
+                Action<ulong, string, int, string, int, int, byte> ac = new Action<ulong, string, int, string, int, int, byte>(OnTSDPenCoordinate);
3860 3755
                 Dispatcher.Invoke(ac, new object[] { time, pageSerial, penType, pageSerial, cx, cy, force });
3861 3756
             }
3862 3757
             else
@@ -3923,12 +3818,6 @@ namespace XHWK.WKTool
3923 3818
 
3924 3819
                         #endregion 设置滚动条位置
3925 3820
 
3926
-                        //gridM.Height //A4高度
3927
-                        //ScroMain.VerticalOffset;//获取滚动条位置
3928
-                        //ScroMain.ActualHeight//A4纸显示高度
3929
-                        //ScroMain.ScrollToHorizontalOffset()//设置滚动条位置
3930
-
3931
-                        //Mouse.GetPosition(this)
3932 3821
                         if (tempX > 0 && tempY > 0)
3933 3822
                         {
3934 3823
                             //System.Windows.Point getP = blackboard_canvas.PointToScreen(new System.Windows.Point(testX, testY));
@@ -3937,28 +3826,9 @@ namespace XHWK.WKTool
3937 3826
                         }
3938 3827
                     }));
3939 3828
                 }
3940
-
3941
-                ////每3个点画一条曲线
3942
-                //if (stroke.Count % 3 == 0)
3943
-                //{
3944
-                //    int from = stroke.Count - 3 - 1;
3945
-                //    if (from < 0)
3946
-                //        from = 0;
3947
-                //    int to = stroke.Count - 1;
3948
-                //    DrawCoordinates(from, to);
3949
-                //}
3950 3829
             }
3951 3830
         }
3952 3831
 
3953
-        /// <summary>
3954
-        /// 停止笔
3955
-        /// </summary>
3956
-        public void StopDigitalPen()
3957
-        {
3958
-            //停止,释放资源
3959
-            APP.digitalPen.Stop();
3960
-        }
3961
-
3962 3832
         /// <summary>
3963 3833
         /// 清空笔内存储
3964 3834
         /// </summary>
@@ -4846,7 +4716,7 @@ namespace XHWK.WKTool
4846 4716
             HideAngleBorder();
4847 4717
         }
4848 4718
 
4849
-        private void imgCanvas_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
4719
+        private void imgCanvas_MouseMove(object sender, MouseEventArgs e)
4850 4720
         {
4851 4721
             if (e.LeftButton == MouseButtonState.Pressed && mouseDown)
4852 4722
             {
@@ -4875,7 +4745,7 @@ namespace XHWK.WKTool
4875 4745
             }
4876 4746
         }
4877 4747
 
4878
-        private System.Drawing.PointF imgRightDown;
4748
+        private PointF imgRightDown;
4879 4749
 
4880 4750
         /// <summary>
4881 4751
         /// 设置控件最上层
@@ -5259,15 +5129,7 @@ namespace XHWK.WKTool
5259 5129
         private void BtnJumpPage_Click(object sender, RoutedEventArgs e)
5260 5130
         {
5261 5131
             int JumpPage = 0;
5262
-            //try
5263
-            //{
5264
-            //    JumpPage = int.Parse(txtJump.Text);
5265
-            //}
5266
-            //catch (Exception ex)
5267
-            //{
5268
-            //    MessageWindow.Show("操作有误!请输入有效的页码!");
5269
-            //    return;
5270
-            //}
5132
+  
5271 5133
             if (JumpPage < 1)
5272 5134
             {
5273 5135
                 JumpPage = 1;
@@ -5283,10 +5145,6 @@ namespace XHWK.WKTool
5283 5145
             JumpPageClick();
5284 5146
 
5285 5147
             #endregion 跳转
5286
-
5287
-            //txbCurrpage.Visibility = Visibility.Visible;
5288
-            //txtJump.Visibility = Visibility.Hidden;
5289
-            //BtnJumpPage.Visibility = Visibility.Hidden;
5290 5148
         }
5291 5149
 
5292 5150
         /// <summary>
@@ -5339,8 +5197,6 @@ namespace XHWK.WKTool
5339 5197
             ///初始化
5340 5198
             if (TMC.TmatrixInitialize() == false)
5341 5199
             {
5342
-                //MessageBox.Show(this, "点阵码初始化失败!", "生成点阵码", MessageBoxButtons.OK, MessageBoxIcon.Error);
5343
-                //Close();
5344 5200
             }
5345 5201
             else
5346 5202
             {

Chargement…
Annuler
Enregistrer