Browse Source

删除废弃代码

tags/对接微服务前
张剑 3 years ago
parent
commit
4c4ef6509c
1 changed files with 27 additions and 171 deletions
  1. 27
    171
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 27
- 171
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

112
         /// </summary>
112
         /// </summary>
113
         internal FileDirectoryData pageData = new FileDirectoryData();
113
         internal FileDirectoryData pageData = new FileDirectoryData();
114
 
114
 
115
-        /// <summary>
116
-        /// 下标
117
-        /// </summary>
118
-        private int Subscript = 0;
119
-
120
         /// <summary>
115
         /// <summary>
121
         /// 是否是修改状态
116
         /// 是否是修改状态
122
         /// </summary>
117
         /// </summary>
172
             txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoSavePath");
167
             txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoSavePath");
173
             Initialize();
168
             Initialize();
174
             //拓思德
169
             //拓思德
175
-            //InitPen();
170
+            //InitTSDPen();
176
             //罗博手写板
171
             //罗博手写板
177
             InitlbPen();
172
             InitlbPen();
178
             //腾千里
173
             //腾千里
311
         {
306
         {
312
             //设置
307
             //设置
313
             gridSetUp.Visibility = Visibility.Collapsed;
308
             gridSetUp.Visibility = Visibility.Collapsed;
314
-            ////页码
315
-            //GridPage.Visibility = Visibility.Collapsed;
316
             //我的
309
             //我的
317
             GridMyVideo.Visibility = Visibility.Collapsed;
310
             GridMyVideo.Visibility = Visibility.Collapsed;
318
             //首页
311
             //首页
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
         #endregion 事件
660
         #endregion 事件
687
 
661
 
688
         #region 设置
662
         #region 设置
704
 
678
 
705
                 #region 读取用户配置
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
                 /// < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
681
                 /// < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
740
                 if ("1".Equals(APP.CameraPosition))
682
                 if ("1".Equals(APP.CameraPosition))
741
                 {
683
                 {
796
                 GridM.IsEnabled = true;
738
                 GridM.IsEnabled = true;
797
                 GridRecordingTitle.Visibility = Visibility.Visible;
739
                 GridRecordingTitle.Visibility = Visibility.Visible;
798
                 gridSetUp.Visibility = Visibility.Collapsed;
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
                 {
767
                 {
831
                     FileToolsCommon.SetConfigValue("VideoType", "3");
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
                 UpdateHideSRToolConfig();
771
                 UpdateHideSRToolConfig();
843
 
772
 
1395
                     DereferenceLinks = true
1324
                     DereferenceLinks = true
1396
                 };
1325
                 };
1397
 
1326
 
1398
-                //APP.myloading.Show();
1399
                 APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeServering, InvokeServerCompate);
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
             catch (Exception ex)
1330
             catch (Exception ex)
1417
             {
1331
             {
3611
 
3525
 
3612
         #endregion 值初始化
3526
         #endregion 值初始化
3613
 
3527
 
3614
-        public void InitPen()
3528
+        public void InitTSDPen()
3615
         {
3529
         {
3616
             //stroke = new List<System.Drawing.Point>();
3530
             //stroke = new List<System.Drawing.Point>();
3617
             //获取点阵笔实例,并绑定点阵笔事件
3531
             //获取点阵笔实例,并绑定点阵笔事件
3618
             //将授权文件内容传入,获取点阵笔对象实例
3532
             //将授权文件内容传入,获取点阵笔对象实例
3619
             APP.digitalPen = DigitalPenHID.GetInstance(certificates.MyLicense.Bytes);
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
             ERROR_CODE ER = APP.digitalPen.Start();
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
             ERROR_CODE rc = APP.digitalPen.Start();
3550
             ERROR_CODE rc = APP.digitalPen.Start();
3641
             //判断是否成功
3551
             //判断是否成功
3657
         /// <param name="penType">
3567
         /// <param name="penType">
3658
         /// 点阵笔型号编号
3568
         /// 点阵笔型号编号
3659
         /// </param>
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
             if (CheckAccess())
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
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3575
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3666
             }
3576
             }
3667
             else
3577
             else
3670
                 isPenDown = true;
3580
                 isPenDown = true;
3671
 
3581
 
3672
             }
3582
             }
3673
-            //myblackboard.changepages(0, 0, true);
3674
         }
3583
         }
3675
 
3584
 
3676
         /// <summary>
3585
         /// <summary>
3685
         /// <param name="penType">
3594
         /// <param name="penType">
3686
         /// 点阵笔型号编号
3595
         /// 点阵笔型号编号
3687
         /// </param>
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
             if (CheckAccess())
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
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3602
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3694
             }
3603
             }
3695
             else
3604
             else
3696
             {
3605
             {
3697
                 isPenDown = false;
3606
                 isPenDown = false;
3698
                 APP.PenSerial = penSerial;
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
             if (APP.PageContextData.currpage > 0)
3610
             if (APP.PageContextData.currpage > 0)
3711
             {
3611
             {
3728
         /// <param name="penType">
3628
         /// <param name="penType">
3729
         /// 点阵笔型号编号
3629
         /// 点阵笔型号编号
3730
         /// </param>
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
             if (CheckAccess())
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
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3636
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3737
             }
3637
             }
3738
             else
3638
             else
3740
                 APP.PenSerial = penSerial;
3640
                 APP.PenSerial = penSerial;
3741
                 APP.PenStatus = false;
3641
                 APP.PenStatus = false;
3742
                 UpdateDevStatus();
3642
                 UpdateDevStatus();
3743
-                //Dispatcher.Invoke(new Action(() =>
3744
-                //{
3745
-                //    txbNotConnected.Text = "未连接";
3746
-                //    txbNotConnecteds.Text = "未连接";
3747
-                //}));
3748
             }
3643
             }
3749
         }
3644
         }
3750
 
3645
 
3760
         /// <param name="penType">
3655
         /// <param name="penType">
3761
         /// 点阵笔型号编号
3656
         /// 点阵笔型号编号
3762
         /// </param>
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
             if (CheckAccess())
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
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3663
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType });
3769
             }
3664
             }
3770
             else
3665
             else
3792
         /// </param>
3687
         /// </param>
3793
         /// <param name="capacity">
3688
         /// <param name="capacity">
3794
         /// </param>
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
             if (CheckAccess())
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
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType, capacity });
3695
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType, capacity });
3801
             }
3696
             }
3802
             else
3697
             else
3816
         /// </param>
3711
         /// </param>
3817
         /// <param name="fillLevel">
3712
         /// <param name="fillLevel">
3818
         /// </param>
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
             if (CheckAccess())
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
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType, fillLevel });
3719
                 Dispatcher.Invoke(action, new object[] { time, penSerial, penType, fillLevel });
3825
             }
3720
             }
3826
             else
3721
             else
3852
         /// <param name="force">
3747
         /// <param name="force">
3853
         /// 压力值
3748
         /// 压力值
3854
         /// </param>
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
             if (CheckAccess())
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
                 Dispatcher.Invoke(ac, new object[] { time, pageSerial, penType, pageSerial, cx, cy, force });
3755
                 Dispatcher.Invoke(ac, new object[] { time, pageSerial, penType, pageSerial, cx, cy, force });
3861
             }
3756
             }
3862
             else
3757
             else
3923
 
3818
 
3924
                         #endregion 设置滚动条位置
3819
                         #endregion 设置滚动条位置
3925
 
3820
 
3926
-                        //gridM.Height //A4高度
3927
-                        //ScroMain.VerticalOffset;//获取滚动条位置
3928
-                        //ScroMain.ActualHeight//A4纸显示高度
3929
-                        //ScroMain.ScrollToHorizontalOffset()//设置滚动条位置
3930
-
3931
-                        //Mouse.GetPosition(this)
3932
                         if (tempX > 0 && tempY > 0)
3821
                         if (tempX > 0 && tempY > 0)
3933
                         {
3822
                         {
3934
                             //System.Windows.Point getP = blackboard_canvas.PointToScreen(new System.Windows.Point(testX, testY));
3823
                             //System.Windows.Point getP = blackboard_canvas.PointToScreen(new System.Windows.Point(testX, testY));
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
         /// <summary>
3832
         /// <summary>
3963
         /// 清空笔内存储
3833
         /// 清空笔内存储
3964
         /// </summary>
3834
         /// </summary>
4846
             HideAngleBorder();
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
             if (e.LeftButton == MouseButtonState.Pressed && mouseDown)
4721
             if (e.LeftButton == MouseButtonState.Pressed && mouseDown)
4852
             {
4722
             {
4875
             }
4745
             }
4876
         }
4746
         }
4877
 
4747
 
4878
-        private System.Drawing.PointF imgRightDown;
4748
+        private PointF imgRightDown;
4879
 
4749
 
4880
         /// <summary>
4750
         /// <summary>
4881
         /// 设置控件最上层
4751
         /// 设置控件最上层
5259
         private void BtnJumpPage_Click(object sender, RoutedEventArgs e)
5129
         private void BtnJumpPage_Click(object sender, RoutedEventArgs e)
5260
         {
5130
         {
5261
             int JumpPage = 0;
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
             if (JumpPage < 1)
5133
             if (JumpPage < 1)
5272
             {
5134
             {
5273
                 JumpPage = 1;
5135
                 JumpPage = 1;
5283
             JumpPageClick();
5145
             JumpPageClick();
5284
 
5146
 
5285
             #endregion 跳转
5147
             #endregion 跳转
5286
-
5287
-            //txbCurrpage.Visibility = Visibility.Visible;
5288
-            //txtJump.Visibility = Visibility.Hidden;
5289
-            //BtnJumpPage.Visibility = Visibility.Hidden;
5290
         }
5148
         }
5291
 
5149
 
5292
         /// <summary>
5150
         /// <summary>
5339
             ///初始化
5197
             ///初始化
5340
             if (TMC.TmatrixInitialize() == false)
5198
             if (TMC.TmatrixInitialize() == false)
5341
             {
5199
             {
5342
-                //MessageBox.Show(this, "点阵码初始化失败!", "生成点阵码", MessageBoxButtons.OK, MessageBoxIcon.Error);
5343
-                //Close();
5344
             }
5200
             }
5345
             else
5201
             else
5346
             {
5202
             {

Loading…
Cancel
Save