Browse Source

1.0.0

master
zhangxueyang 3 years ago
parent
commit
5030b3b048

+ 3
- 2
XHPZ.Desktop/APP.cs View File

58
         public static bool TQLPenStatus = false;
58
         public static bool TQLPenStatus = false;
59
         #endregion
59
         #endregion
60
         #region 页面
60
         #region 页面
61
+        public static MainWindow W_mainWindow = null;
61
         ///// <summary>
62
         ///// <summary>
62
         ///// 批注
63
         ///// 批注
63
         ///// </summary>
64
         ///// </summary>
124
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
125
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
125
                 {
126
                 {
126
                     //如果是管理员,则直接运行
127
                     //如果是管理员,则直接运行
127
-                    MainWindow mainWindow = new MainWindow();
128
+                    W_mainWindow = new MainWindow();
128
                     // 定义Application对象作为整个应用程序入口
129
                     // 定义Application对象作为整个应用程序入口
129
                     Application app = new Application();
130
                     Application app = new Application();
130
-                    app.Run(mainWindow);
131
+                    app.Run(W_mainWindow);
131
                 }
132
                 }
132
                 else
133
                 else
133
                 {
134
                 {

+ 3
- 6
XHPZ.Desktop/MainWindow.xaml View File

5
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6
         xmlns:local="clr-namespace:XHPZ.Desktop"
6
         xmlns:local="clr-namespace:XHPZ.Desktop"
7
         mc:Ignorable="d"
7
         mc:Ignorable="d"
8
-<<<<<<< HEAD
9
-        Title="智慧批注" Height="300" Width="300">
10
-=======
11
-        Title="MainWindow" 
8
+        Title="智慧批注" 
9
+
12
     WindowStyle="None" AllowsTransparency="True"    WindowState="Normal"
10
     WindowStyle="None" AllowsTransparency="True"    WindowState="Normal"
13
-    ShowInTaskbar="False"  Topmost="True" ResizeMode="NoResize" 
11
+    ShowInTaskbar="True"  Topmost="True" ResizeMode="NoResize" 
14
         d:DesignHeight="250" Width="500" Height="250"  MouseMove="Window_MouseMove"  BorderThickness="7">
12
         d:DesignHeight="250" Width="500" Height="250"  MouseMove="Window_MouseMove"  BorderThickness="7">
15
     <Window.Effect>
13
     <Window.Effect>
16
         <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
14
         <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
17
     </Window.Effect>
15
     </Window.Effect>
18
->>>>>>> c3ffa44dd9c0e70fe134cf74c328dc36897b6b64
19
     <Grid>
16
     <Grid>
20
         <TextBlock Text="欢迎使用星火批注!" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" Margin="0,0,0,35"/>
17
         <TextBlock Text="欢迎使用星火批注!" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" Margin="0,0,0,35"/>
21
         <TextBlock Text="使用点阵笔时自动批注,右键退出批注。" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" Margin="0,35,0,0"/>
18
         <TextBlock Text="使用点阵笔时自动批注,右键退出批注。" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" Margin="0,35,0,0"/>

+ 18
- 6
XHPZ.Desktop/MainWindow.xaml.cs View File

36
 
36
 
37
 
37
 
38
 
38
 
39
-           if(APP.W_PracticeWindow==null)
39
+            if (APP.W_PracticeWindow == null)
40
             {
40
             {
41
                 APP.W_PracticeWindow = new PracticeWindow
41
                 APP.W_PracticeWindow = new PracticeWindow
42
                 {
42
                 {
68
                 System.Environment.Exit(0);
68
                 System.Environment.Exit(0);
69
             }
69
             }
70
         }
70
         }
71
-
71
+        public void UpdateDevStatus()
72
+        {
73
+            if (APP.PenStatus || APP.TQLPenStatus)
74
+            {
75
+                Dispatcher.Invoke(new Action(() =>
76
+                {
77
+                    txbType.Text = "已连接";
78
+                }));
79
+            }
80
+            else
81
+            {
82
+                Dispatcher.Invoke(new Action(() =>
83
+                {
84
+                    txbType.Text = "未连接";
85
+                }));
86
+            }
87
+        }
72
         private void BtnMin_Click(object sender, RoutedEventArgs e)
88
         private void BtnMin_Click(object sender, RoutedEventArgs e)
73
         {
89
         {
74
             if (WindowState == WindowState.Minimized)
90
             if (WindowState == WindowState.Minimized)
81
             }
97
             }
82
         }
98
         }
83
     }
99
     }
84
-
85
-
86
-
87
-
88
 }
100
 }

+ 2
- 1
XHPZ.Desktop/PracticeWindow.xaml.cs View File

136
 
136
 
137
                 //开始接收笔数据
137
                 //开始接收笔数据
138
                 APP.digitalPen.GetPenData(penSerial);
138
                 APP.digitalPen.GetPenData(penSerial);
139
-                //UpdateDevStatus();
139
+                APP.W_mainWindow.UpdateDevStatus();
140
                 ////Dispatcher.Invoke(new Action(() =>
140
                 ////Dispatcher.Invoke(new Action(() =>
141
                 ////{
141
                 ////{
142
                 ////    txbNotConnected.Text = "已连接";
142
                 ////    txbNotConnected.Text = "已连接";
162
             {
162
             {
163
                 APP.PenSerial = penSerial;
163
                 APP.PenSerial = penSerial;
164
                 APP.PenStatus = false;
164
                 APP.PenStatus = false;
165
+                APP.W_mainWindow.UpdateDevStatus();
165
                 //UpdateDevStatus();
166
                 //UpdateDevStatus();
166
                 ////Dispatcher.Invoke(new Action(() =>
167
                 ////Dispatcher.Invoke(new Action(() =>
167
                 ////{
168
                 ////{

+ 2
- 2
XHPZ.Desktop/TQLPen/PenEvents.cs View File

82
                 {
82
                 {
83
                     APP.TQLPenStatus = true;
83
                     APP.TQLPenStatus = true;
84
                     //form.AddLog("智能笔已连接!");
84
                     //form.AddLog("智能笔已连接!");
85
-                    //APP.W_XHMicroLessonSystemWindow.UpdateDevStatus();
85
+                    APP.W_mainWindow.UpdateDevStatus();
86
                 }
86
                 }
87
                 else
87
                 else
88
                 {
88
                 {
89
                     APP.TQLPenStatus = false;
89
                     APP.TQLPenStatus = false;
90
                     //form.DisConnect();
90
                     //form.DisConnect();
91
                     //form.AddLog("智能笔已断开连接!");
91
                     //form.AddLog("智能笔已断开连接!");
92
-                    //APP.W_XHMicroLessonSystemWindow.UpdateDevStatus();
92
+                    APP.W_mainWindow.UpdateDevStatus();
93
                 }
93
                 }
94
             }
94
             }
95
             catch (Exception)
95
             catch (Exception)

Loading…
Cancel
Save