Browse Source

zhao:获取手写板大小

tags/录制修改前
耀 4 years ago
parent
commit
e9323def0c
1 changed files with 27 additions and 20 deletions
  1. 27
    20
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

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

5011
                 date = new RobotpenGateway.robotpenController.returnPointData(Form1_bigDataReportEvt1);
5011
                 date = new RobotpenGateway.robotpenController.returnPointData(Form1_bigDataReportEvt1);
5012
                 robotpenController.GetInstance().initDeletgate(ref date);
5012
                 robotpenController.GetInstance().initDeletgate(ref date);
5013
 
5013
 
5014
-                int banWidth = robotpenController.GetInstance().getWidth();
5015
-                int banHeight = robotpenController.GetInstance().getHeight();
5016
-                if (banWidth > 0 && banHeight > 0)
5017
-                {
5018
-
5019
-                    if (banWidth > banHeight)
5020
-                    {
5021
-                        m_nDeviceW = banWidth;
5022
-                        m_nDeviceH = banHeight;
5023
-                    }
5024
-                    else
5025
-                    {
5026
-                        m_nDeviceW = banHeight;
5027
-                        m_nDeviceH = banWidth;
5028
-                    }
5029
-                }
5030
-                if (APP.IsOutputInfoLog)
5031
-                {
5032
-                    LogHelper.WriteInfoLog(string.Format("手写板宽度为:{0} 高度为:{1}", m_nDeviceW, m_nDeviceH));
5033
-                }
5034
                 CheckUsbConnect();
5014
                 CheckUsbConnect();
5035
 
5015
 
5036
                 ////robotpenController.GetInstance().returnOptimizePointDataEvt += new robotpenController.returnOptimizePointData(Form1_returnOptimizePointDataEvt);
5016
                 ////robotpenController.GetInstance().returnOptimizePointDataEvt += new robotpenController.returnOptimizePointData(Form1_returnOptimizePointDataEvt);
5222
                             robotpenController.GetInstance()._Send(cmdId.GetConfig);
5202
                             robotpenController.GetInstance()._Send(cmdId.GetConfig);
5223
 
5203
 
5224
                             APP.BoardStatus = true;
5204
                             APP.BoardStatus = true;
5205
+                            try
5206
+                            {
5207
+                                int banWidth = robotpenController.GetInstance().getWidth();
5208
+                                int banHeight = robotpenController.GetInstance().getHeight();
5209
+                                if (banWidth > 0 && banHeight > 0)
5210
+                                {
5211
+
5212
+                                    if (banWidth > banHeight)
5213
+                                    {
5214
+                                        m_nDeviceW = banWidth;
5215
+                                        m_nDeviceH = banHeight;
5216
+                                    }
5217
+                                    else
5218
+                                    {
5219
+                                        m_nDeviceW = banHeight;
5220
+                                        m_nDeviceH = banWidth;
5221
+                                    }
5222
+                                }
5223
+                                if (APP.IsOutputInfoLog)
5224
+                                {
5225
+                                    LogHelper.WriteInfoLog(string.Format("手写板宽度为:{0} 高度为:{1}", m_nDeviceW, m_nDeviceH));
5226
+                                }
5227
+                            }
5228
+                            catch (Exception ex)
5229
+                            {
5230
+                                LogHelper.WriteErrLog("手写板大小获取失败:" + ex.Message, ex);
5231
+                            }
5225
                             UpdateDevStatus();
5232
                             UpdateDevStatus();
5226
                             if (APP.IsOutputInfoLog)
5233
                             if (APP.IsOutputInfoLog)
5227
                             {
5234
                             {

Loading…
Cancel
Save