Browse Source

合并

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
17b79df146

+ 40
- 32
XHWK.WKTool/CountdownWindow.xaml.cs View File

21
         /// <summary>
21
         /// <summary>
22
         /// 计时器
22
         /// 计时器
23
         /// </summary>
23
         /// </summary>
24
-        private int ImgNum = 21;
25
-        public void Initialize(bool ShowlblShortcut = false, int changeTime = 2100)
24
+        private int ImgNum = 22;
25
+        public void Initialize(bool ShowlblShortcut = false, int changeTime = 2000)
26
         {
26
         {
27
-            //if (ShowlblShortcut)
28
-            //{
29
-            //    lblShortcut.Visibility = Visibility.Visible;
30
-            //}
31
-            //else
32
-            //{
33
-            //    lblShortcut.Visibility = Visibility.Hidden;
34
-            //}
35
-            ImgNum = 21;
27
+            if (ShowlblShortcut)
28
+            {
29
+                lblShortcut.Visibility = Visibility.Visible;
30
+            }
31
+            else
32
+            {
33
+                lblShortcut.Visibility = Visibility.Hidden;
34
+            }
35
+            ImgNum = 22;
36
             bool IsStart = true;
36
             bool IsStart = true;
37
             new Thread(new ThreadStart(new Action(() =>
37
             new Thread(new ThreadStart(new Action(() =>
38
             {
38
             {
45
                             loadingImg(ImgNum);
45
                             loadingImg(ImgNum);
46
                             LogHelper.WriteInfoLog("【" + ImgNum + "】");
46
                             LogHelper.WriteInfoLog("【" + ImgNum + "】");
47
                             ImgNum--;
47
                             ImgNum--;
48
-                            Thread.Sleep(changeTime / 21);
48
+                            Thread.Sleep(changeTime / 22);
49
                         }
49
                         }
50
                         else
50
                         else
51
                         {
51
                         {
107
                       DispatcherPriority.Send,
107
                       DispatcherPriority.Send,
108
                       new Action(() =>
108
                       new Action(() =>
109
                       {
109
                       {
110
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_5.png"));
110
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_7.png"));
111
                       }));
111
                       }));
112
                     break;
112
                     break;
113
                 case 2:
113
                 case 2:
115
                       DispatcherPriority.Send,
115
                       DispatcherPriority.Send,
116
                       new Action(() =>
116
                       new Action(() =>
117
                       {
117
                       {
118
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_4.png"));
118
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_6.png"));
119
                       }));
119
                       }));
120
                     break;
120
                     break;
121
                 case 3:
121
                 case 3:
123
                       DispatcherPriority.Send,
123
                       DispatcherPriority.Send,
124
                       new Action(() =>
124
                       new Action(() =>
125
                       {
125
                       {
126
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_3.png"));
126
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_5.png"));
127
                       }));
127
                       }));
128
                     break;
128
                     break;
129
                 case 4:
129
                 case 4:
131
                       DispatcherPriority.Send,
131
                       DispatcherPriority.Send,
132
                       new Action(() =>
132
                       new Action(() =>
133
                       {
133
                       {
134
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_2.png"));
134
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_4.png"));
135
                       }));
135
                       }));
136
                     break;
136
                     break;
137
                 case 5:
137
                 case 5:
139
                       DispatcherPriority.Send,
139
                       DispatcherPriority.Send,
140
                       new Action(() =>
140
                       new Action(() =>
141
                       {
141
                       {
142
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_1.png"));
142
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_3.png"));
143
                       }));
143
                       }));
144
                     break;
144
                     break;
145
                 case 6:
145
                 case 6:
147
                       DispatcherPriority.Send,
147
                       DispatcherPriority.Send,
148
                       new Action(() =>
148
                       new Action(() =>
149
                       {
149
                       {
150
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_7.png"));
150
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_2.png"));
151
                       }));
151
                       }));
152
                     break;
152
                     break;
153
                 case 7:
153
                 case 7:
155
                       DispatcherPriority.Send,
155
                       DispatcherPriority.Send,
156
                       new Action(() =>
156
                       new Action(() =>
157
                       {
157
                       {
158
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_6.png"));
158
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown1_1.png"));
159
                       }));
159
                       }));
160
                     break;
160
                     break;
161
                 case 8:
161
                 case 8:
163
                       DispatcherPriority.Send,
163
                       DispatcherPriority.Send,
164
                       new Action(() =>
164
                       new Action(() =>
165
                       {
165
                       {
166
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_5.png"));
166
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_7.png"));
167
                       }));
167
                       }));
168
                     break;
168
                     break;
169
                 case 9:
169
                 case 9:
171
                       DispatcherPriority.Send,
171
                       DispatcherPriority.Send,
172
                       new Action(() =>
172
                       new Action(() =>
173
                       {
173
                       {
174
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_4.png"));
174
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_6.png"));
175
                       }));
175
                       }));
176
                     break;
176
                     break;
177
                 case 10:
177
                 case 10:
179
                       DispatcherPriority.Send,
179
                       DispatcherPriority.Send,
180
                       new Action(() =>
180
                       new Action(() =>
181
                       {
181
                       {
182
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_3.png"));
182
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_5.png"));
183
                       }));
183
                       }));
184
                     break;
184
                     break;
185
                 case 11:
185
                 case 11:
187
                       DispatcherPriority.Send,
187
                       DispatcherPriority.Send,
188
                       new Action(() =>
188
                       new Action(() =>
189
                       {
189
                       {
190
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_2.png"));
190
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_4.png"));
191
                       }));
191
                       }));
192
                     break;
192
                     break;
193
                 case 12:
193
                 case 12:
195
                       DispatcherPriority.Send,
195
                       DispatcherPriority.Send,
196
                       new Action(() =>
196
                       new Action(() =>
197
                       {
197
                       {
198
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_1.png"));
198
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_3.png"));
199
                       }));
199
                       }));
200
                     break;
200
                     break;
201
                 case 13:
201
                 case 13:
203
                       DispatcherPriority.Send,
203
                       DispatcherPriority.Send,
204
                       new Action(() =>
204
                       new Action(() =>
205
                       {
205
                       {
206
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_9.png"));
206
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_2.png"));
207
                       }));
207
                       }));
208
                     break;
208
                     break;
209
                 case 14:
209
                 case 14:
211
                       DispatcherPriority.Send,
211
                       DispatcherPriority.Send,
212
                       new Action(() =>
212
                       new Action(() =>
213
                       {
213
                       {
214
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_8.png"));
214
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown2_1.png"));
215
                       }));
215
                       }));
216
                     break;
216
                     break;
217
                 case 15:
217
                 case 15:
219
                       DispatcherPriority.Send,
219
                       DispatcherPriority.Send,
220
                       new Action(() =>
220
                       new Action(() =>
221
                       {
221
                       {
222
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_7.png"));
222
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_8.png"));
223
                       }));
223
                       }));
224
                     break;
224
                     break;
225
                 case 16:
225
                 case 16:
227
                       DispatcherPriority.Send,
227
                       DispatcherPriority.Send,
228
                       new Action(() =>
228
                       new Action(() =>
229
                       {
229
                       {
230
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_6.png"));
230
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_7.png"));
231
                       }));
231
                       }));
232
                     break;
232
                     break;
233
                 case 17:
233
                 case 17:
235
                       DispatcherPriority.Send,
235
                       DispatcherPriority.Send,
236
                       new Action(() =>
236
                       new Action(() =>
237
                       {
237
                       {
238
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_5.png"));
238
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_6.png"));
239
                       }));
239
                       }));
240
                     break;
240
                     break;
241
                 case 18:
241
                 case 18:
243
                       DispatcherPriority.Send,
243
                       DispatcherPriority.Send,
244
                       new Action(() =>
244
                       new Action(() =>
245
                       {
245
                       {
246
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_4.png"));
246
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_5.png"));
247
                       }));
247
                       }));
248
                     break;
248
                     break;
249
                 case 19:
249
                 case 19:
251
                       DispatcherPriority.Send,
251
                       DispatcherPriority.Send,
252
                       new Action(() =>
252
                       new Action(() =>
253
                       {
253
                       {
254
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_3.png"));
254
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_4.png"));
255
                       }));
255
                       }));
256
                     break;
256
                     break;
257
                 case 20:
257
                 case 20:
259
                       DispatcherPriority.Send,
259
                       DispatcherPriority.Send,
260
                       new Action(() =>
260
                       new Action(() =>
261
                       {
261
                       {
262
-                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_2.png"));
262
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_3.png"));
263
                       }));
263
                       }));
264
                     break;
264
                     break;
265
                 case 21:
265
                 case 21:
266
+                    Dispatcher.Invoke(
267
+                      DispatcherPriority.Send,
268
+                      new Action(() =>
269
+                      {
270
+                          imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown3_2.png"));
271
+                      }));
272
+                    break;
273
+                case 22:
266
                     Dispatcher.Invoke(
274
                     Dispatcher.Invoke(
267
                       DispatcherPriority.Send,
275
                       DispatcherPriority.Send,
268
                       new Action(() =>
276
                       new Action(() =>

BIN
XHWK.WKTool/Images/countdown1_1.png View File


BIN
XHWK.WKTool/Images/countdown1_2.png View File


BIN
XHWK.WKTool/Images/countdown1_3.png View File


BIN
XHWK.WKTool/Images/countdown1_4.png View File


BIN
XHWK.WKTool/Images/countdown1_5.png View File


BIN
XHWK.WKTool/Images/countdown1_6.png View File


BIN
XHWK.WKTool/Images/countdown1_7.png View File


BIN
XHWK.WKTool/Images/countdown2_1.png View File


BIN
XHWK.WKTool/Images/countdown2_2.png View File


BIN
XHWK.WKTool/Images/countdown2_3.png View File


BIN
XHWK.WKTool/Images/countdown2_4.png View File


BIN
XHWK.WKTool/Images/countdown2_5.png View File


BIN
XHWK.WKTool/Images/countdown2_6.png View File


BIN
XHWK.WKTool/Images/countdown2_7.png View File


BIN
XHWK.WKTool/Images/countdown3_1.png View File


BIN
XHWK.WKTool/Images/countdown3_2.png View File


BIN
XHWK.WKTool/Images/countdown3_3.png View File


BIN
XHWK.WKTool/Images/countdown3_4.png View File


BIN
XHWK.WKTool/Images/countdown3_5.png View File


BIN
XHWK.WKTool/Images/countdown3_6.png View File


BIN
XHWK.WKTool/Images/countdown3_7.png View File


BIN
XHWK.WKTool/Images/countdown3_8.png View File


BIN
XHWK.WKTool/Images/countdown3_9.png View File


+ 62
- 70
XHWK.WKTool/PrintWindow.xaml View File

32
     </Window.Resources>
32
     </Window.Resources>
33
     <Viewbox>
33
     <Viewbox>
34
         <Grid x:Name="GridContent" Height="600" Width="900">
34
         <Grid x:Name="GridContent" Height="600" Width="900">
35
-        <Grid.RowDefinitions>
36
-            <RowDefinition Height="120"/>
37
-            <RowDefinition Height="*"/>
38
-            <RowDefinition Height="80"/>
39
-        </Grid.RowDefinitions>
40
-        <Grid Grid.Row="0" Background="#E6EAF0" MouseLeftButtonDown="Window_MouseLeftButtonDown">
41
             <Grid.RowDefinitions>
35
             <Grid.RowDefinitions>
42
-                <RowDefinition Height="50"/>
43
-                <RowDefinition Height="50"/>
36
+                <RowDefinition Height="120"/>
44
                 <RowDefinition Height="*"/>
37
                 <RowDefinition Height="*"/>
38
+                <RowDefinition Height="80"/>
45
             </Grid.RowDefinitions>
39
             </Grid.RowDefinitions>
46
-            <Button Cursor="Hand" Grid.Row="0" x:Name="btnClose" Background="#CC4848" Foreground="#FFFFFF" Content="×" FontSize="20" Width="30" Height="30" HorizontalAlignment="Right" Margin="0,0,10,0" Click="BtnClose_Click" Style="{StaticResource NoMouseOverButtonStyle}">
40
+            <Grid Grid.Row="0" Background="#E6EAF0" MouseLeftButtonDown="Window_MouseLeftButtonDown">
41
+                <Grid.RowDefinitions>
42
+                    <RowDefinition Height="50"/>
43
+                    <RowDefinition Height="50"/>
44
+                    <RowDefinition Height="*"/>
45
+                </Grid.RowDefinitions>
46
+                <Button Cursor="Hand" Grid.Row="0" x:Name="btnClose" Background="#CC4848" Foreground="#FFFFFF" Content="×" FontSize="20" Width="30" Height="30" HorizontalAlignment="Right" Margin="0,0,10,0" Click="BtnClose_Click" Style="{StaticResource NoMouseOverButtonStyle}">
47
 
47
 
48
-            </Button>
49
-            <StackPanel Grid.Row="1" HorizontalAlignment="Left" Orientation="Horizontal" Margin="10,2,0,0" Height="40">
50
-                <TextBlock  Text="打印机:"  FontSize="20" Padding="0,5,0,0"/>
51
-                <ComboBox Cursor="Hand" Width="210"
48
+                </Button>
49
+                <StackPanel Grid.Row="1" HorizontalAlignment="Left" Orientation="Horizontal" Margin="10,2,0,0" Height="40">
50
+                    <TextBlock  Text="打印机:"  FontSize="20" Padding="0,5,0,0"/>
51
+                    <ComboBox Cursor="Hand" Width="210"
52
                                 x:Name="cmbClass"
52
                                 x:Name="cmbClass"
53
                                 Padding="30,0,10,0"
53
                                 Padding="30,0,10,0"
54
                                 VerticalContentAlignment="Center"
54
                                 VerticalContentAlignment="Center"
57
                                 FontSize="14"
57
                                 FontSize="14"
58
                                 SelectedValuePath="Key"
58
                                 SelectedValuePath="Key"
59
                                 />
59
                                 />
60
-                <TextBlock Text="份数:" FontSize="20" Margin="80,0,0,0" Padding="0,5,0,0" HorizontalAlignment="Right"/>
61
-                <TextBlock x:Name="txbNumberOfCopies" Width="100" Text="1" FontSize="16" Padding="50,10,0,0" Background="White"/>
62
-                <Grid>
63
-                    <Grid.RowDefinitions>
64
-                        <RowDefinition Height="auto"/>
65
-                        <RowDefinition Height="auto"/>
66
-                    </Grid.RowDefinitions>
67
-                    <Button Cursor="Hand" Grid.Row="0" x:Name="btnLess"  Content="-" Click="BtnLess_Click"/>
68
-                    <Button Cursor="Hand" Grid.Row="1" x:Name="btnAdd"  Content="+" Click="BtnAdd_Click"/>
69
-                </Grid>
70
-                <!--<TextBlock Text="点型:" FontSize="20"  Margin="120,10,0,0"/>
60
+                    <TextBlock Text="份数:" FontSize="20" Margin="80,0,0,0" Padding="0,5,0,0" HorizontalAlignment="Right"/>
61
+                    <TextBlock x:Name="txbNumberOfCopies" Width="100" Text="1" FontSize="16" Padding="50,10,0,0" Background="White"/>
62
+                    <Grid>
63
+                        <Grid.RowDefinitions>
64
+                            <RowDefinition Height="auto"/>
65
+                            <RowDefinition Height="auto"/>
66
+                        </Grid.RowDefinitions>
67
+                        <Button Cursor="Hand" Grid.Row="0" x:Name="btnLess"  Content="-" Click="BtnLess_Click"/>
68
+                        <Button Cursor="Hand" Grid.Row="1" x:Name="btnAdd"  Content="+" Click="BtnAdd_Click"/>
69
+                    </Grid>
70
+                    <!--<TextBlock Text="点型:" FontSize="20"  Margin="120,10,0,0"/>
71
                 <RadioButton x:Name="rbnSquarePoint" Content="方点" FontSize="16"  Margin="0,15,0,0" IsChecked="True"/>
71
                 <RadioButton x:Name="rbnSquarePoint" Content="方点" FontSize="16"  Margin="0,15,0,0" IsChecked="True"/>
72
                 <RadioButton x:Name="rbnDots" Content="圆点" FontSize="16"  Margin="0,15,0,0"/>-->
72
                 <RadioButton x:Name="rbnDots" Content="圆点" FontSize="16"  Margin="0,15,0,0"/>-->
73
-            </StackPanel>
74
-        </Grid>
75
-        <Grid Grid.Row="1">
76
-            <Image x:Name="imgPri"/>
77
-        </Grid>
73
+                </StackPanel>
74
+            </Grid>
78
 
75
 
79
-        <Button
76
+            <Views:ZJClippingBorder Grid.Row="0" x:Name="tip_outer" Margin="0" Background="#FFE6EAF0" CornerRadius="4" Visibility="Collapsed">
77
+                <Grid>
78
+                    <Label Content="打印中..." HorizontalAlignment="Center" Margin="0,20,0,0" Height="35" VerticalAlignment="Top" FontSize="20"></Label>
79
+                    <ProgressBar BorderBrush="#4597FF"
80
+                             Foreground="#4597FF"
81
+                    Grid.Row="0"
82
+                    x:Name="pgbProcess"
83
+                    Height="20"
84
+                    Margin="50,20,50,0"
85
+                    Visibility="Visible" />
86
+                    <Label Grid.Row="0"
87
+                    HorizontalAlignment="Center" Width="100"
88
+                    x:Name="lbProcess"
89
+                    Height="30"
90
+                    Margin="0,20,0,0"
91
+                       FontSize="16"
92
+                    Content=""
93
+                       Foreground="White"
94
+                    Visibility="Visible" />
95
+                </Grid>
96
+            </Views:ZJClippingBorder>
97
+            <Grid Grid.Row="1">
98
+                <Image x:Name="imgPri"/>
99
+            </Grid>
100
+
101
+            <Button
80
                     x:Name="btnPrint"
102
                     x:Name="btnPrint"
81
                     Grid.Row="8"
103
                     Grid.Row="8"
82
                     Width="115"
104
                     Width="115"
88
                     IsDefault="True"
110
                     IsDefault="True"
89
                     Cursor="Hand"
111
                     Cursor="Hand"
90
                     Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
112
                     Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
91
-            <Button.Template>
92
-                <ControlTemplate TargetType="{x:Type Button}">
93
-                    <Border
113
+                <Button.Template>
114
+                    <ControlTemplate TargetType="{x:Type Button}">
115
+                        <Border
94
                                 BorderBrush="{TemplateBinding Control.BorderBrush}"
116
                                 BorderBrush="{TemplateBinding Control.BorderBrush}"
95
                                 BorderThickness="1"
117
                                 BorderThickness="1"
96
                                 CornerRadius="7">
118
                                 CornerRadius="7">
97
-                        <Border.Background>#2E8CF0</Border.Background>
98
-                        <ContentPresenter
119
+                            <Border.Background>#2E8CF0</Border.Background>
120
+                            <ContentPresenter
99
                                     HorizontalAlignment="Center"
121
                                     HorizontalAlignment="Center"
100
                                     VerticalAlignment="Center"
122
                                     VerticalAlignment="Center"
101
                                     Content="{TemplateBinding ContentControl.Content}" />
123
                                     Content="{TemplateBinding ContentControl.Content}" />
102
-                    </Border>
103
-                </ControlTemplate>
104
-            </Button.Template>
105
-        </Button>
106
-        <Views:ZJClippingBorder
107
-            x:Name="tip_outer"
108
-            Width="760"
109
-            Height="44"
110
-            Margin="0,30,0,0"
111
-            HorizontalAlignment="Center"
112
-            VerticalAlignment="Center"
113
-            Background="#FAFAFA"
114
-            CornerRadius="4"
115
-            Visibility="Collapsed">
116
-            <Grid>
117
-
118
-                <ProgressBar BorderBrush="#4597FF"
119
-                             Foreground="#4597FF"
120
-                    Grid.Row="0"
121
-                    x:Name="pgbProcess"
122
-                    Height="20"
123
-                    Margin="0,0,0,0"
124
-                    Visibility="Visible" />
125
-                <Label Grid.Row="0"
126
-                    HorizontalAlignment="Center" Width="100"
127
-                    x:Name="lbProcess"
128
-                    Height="30"
129
-                    Margin="0,0,0,0"
130
-                       FontSize="16"
131
-                    Content=""
132
-                       Foreground="White"
133
-                    Visibility="Visible" />
134
-            </Grid>
135
-        </Views:ZJClippingBorder>
136
-    </Grid>
124
+                        </Border>
125
+                    </ControlTemplate>
126
+                </Button.Template>
127
+            </Button>
128
+        </Grid>
137
     </Viewbox>
129
     </Viewbox>
138
 </Window>
130
 </Window>

+ 116
- 189
XHWK.WKTool/PrintWindow.xaml.cs View File

21
         /// </summary>
21
         /// </summary>
22
         public DataTable data = new DataTable();
22
         public DataTable data = new DataTable();
23
         private DataTable dtComponentsUniqueNo;
23
         private DataTable dtComponentsUniqueNo;
24
-        /// <summary>
25
-        /// 计时器状态
26
-        /// </summary>
27
-        private enum State
28
-        {
29
-            Start,
30
-            Pause,
31
-            End
32
-        }
33
-        private DispatcherTimer t = null;
34
-        /// <summary>
35
-        /// 状态
36
-        /// </summary>
37
-        private State _state = State.End;
38
-        /// <summary>
39
-        /// 计时用
40
-        /// </summary>
41
-        private TimeSpan _timeSpan = new TimeSpan(0, 0, 0, 0, 0);
24
+
25
+        private System.Timers.Timer times;
42
         public PrintWindow()
26
         public PrintWindow()
43
         {
27
         {
44
             InitializeComponent();
28
             InitializeComponent();
81
                 imgPri.Source = null;
65
                 imgPri.Source = null;
82
             }
66
             }
83
             I = 0;
67
             I = 0;
84
-            if (t == null)
85
-            {
86
-                t = new DispatcherTimer();
87
-                t.Tick += OnTimer;
88
-                t.Interval = new TimeSpan(0, 0, 0, 1);
89
-                t.IsEnabled = true;
90
-                t.Start();
91
-            }
92
-            t.Interval = new TimeSpan(0, 0, 0, 1);
93
             tip_outer.Visibility = Visibility.Collapsed;
68
             tip_outer.Visibility = Visibility.Collapsed;
94
         }
69
         }
95
-        private System.Timers.Timer times;
96
         /// <summary>
70
         /// <summary>
97
         /// 打印
71
         /// 打印
98
         /// </summary>
72
         /// </summary>
106
                 MessageWindow.Show("打印机不能为空!");
80
                 MessageWindow.Show("打印机不能为空!");
107
                 return;
81
                 return;
108
             }
82
             }
109
-            APP.myloading.Show();
110
-            APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeServering, InvokeServerCompate);
111
-
112
-
113
-
114
-
115
-            //I = 1;
116
             //APP.myloading.Show();
83
             //APP.myloading.Show();
117
-            //tip_outer.Visibility = Visibility.Visible;
118
-            //Thread.Sleep(2000);
119
-            //Times();
120
-            //Dispatcher.Invoke(() =>
121
-            //{
122
-            //    times = new System.Timers.Timer(100)//初始值为300
123
-            //    {
124
-            //        AutoReset = true//设置是否执行System.Timers.Timer.Elapsed事件
125
-            //    };//设置执行一次(false)还是一直执行(true)
126
-            //    I = 0;
127
-            //    tip_outer.Visibility = Visibility.Visible;
128
-            //    times.Elapsed += new System.Timers.ElapsedEventHandler(Times_Elapsed);
129
-            //    times.Enabled = true; //启动计时器
130
-            //                          //APP.myloading.Show();
131
-            //});
132
-
84
+            btnClose.IsEnabled = false;
85
+            btnPrint.IsEnabled = false;
86
+            //APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeServering, InvokeServerCompate);
87
+            Thread myThread = new Thread(StartPrint);
88
+            List<string> StrList = new List<string>();
133
 
89
 
134
-
135
-            //string imgPath = FileToolsCommon.GetFileAbsolutePath("temp");
90
+            //string imgPath = 
136
             //FileToolsCommon.CreateFile(imgPath);
91
             //FileToolsCommon.CreateFile(imgPath);
137
             //string pdf = imgPath + "\\101.pdf";
92
             //string pdf = imgPath + "\\101.pdf";
138
-            //string tpf = imgPath + "\\102.TPF";
139
-            //string msg = string.Empty;
140
-            //string outPut = string.Empty;
141
-            ////if(rbnSquarePoint.IsChecked==false)
142
-            ////{
143
-            ////    pyte = 1;
144
-            ////}
145
-            //LatticeFileHelper.GeneratingPDF(pdf, tpf, out int pr, out msg, out outPut/*, pyte*/);
146
-            //if (pr == 0)
147
-            //{
148
-            //    //outPut = outPut.Replace("[", "").Replace("]", "").Replace("\"", "").Trim();
149
-            //    //APP.OutPut = outPut.Split(',');
150
-            //    //string []page= outPut.Split(',');
151
-            //    //for(int i=0;i<page.Length;i++) //增加页码编号
152
-            //    //{
153
-            //    //    APP.PageDrawList[i].PageCode = page[i];
154
-            //    //}
155
-
156
-            //    //string defa = string.Empty;
157
-            //    //List<string> defaList = LatticeFileHelper.GetPrinterList(out defa);
158
-
159
-            //    string standardError = string.Empty;
160
-            //    string standardOutput = string.Empty;
161
-            //    int frequency = Convert.ToInt32(txbNumberOfCopies.Text);
162
-            //    //for (int i=0;i< frequency;i++)
163
-            //    //{
164
-            //    LatticeFileHelper.PrinterTPFFile(tpf, frequency, cmbClass.Text, out int printResult, out standardError, out standardOutput);
165
-            //    //}
166
-            //    if (printResult == 0)// 0为成功
167
-            //    {
168
-            //        new Thread(new ThreadStart(new Action(() =>
169
-            //        {
170
-            //            Dispatcher.Invoke(() =>
171
-            //            {
172
-            //                I = 100;
173
-            //                pgbProcess.Value = I * 100 / 100;
174
-            //                lbProcess.Content = string.Format("{0}/{1}", I, 100);
175
-            //                APP.myloading.Hide();
176
-            //                I = 0;
177
-            //            });
178
-            //            Thread.Sleep(2000);
179
-            //            Dispatcher.Invoke(() =>
180
-            //            {
181
-            //                //tip_outer.Visibility = Visibility.Collapsed;
182
-            //                MessageWindow.Show("打印成功");
183
-            //            });
184
-            //        }))).Start();
93
+            //PDF位置
94
+            string SourcePath=FileToolsCommon.GetFileAbsolutePath("/temp/101.pdf");
95
+            StrList.Add(SourcePath);
96
+            //打印数量
97
+            int PrinterNum = Convert.ToInt32(txbNumberOfCopies.Text);
98
+            StrList.Add(PrinterNum.ToString());
99
+            //打印机名称
100
+            string PrinterName = cmbClass.Text;
101
+            StrList.Add(PrinterName);
185
 
102
 
103
+            num = 0;
104
+            tip_outer.Visibility = Visibility.Visible;
105
+            myThread.Start(StrList);
106
+            times = new System.Timers.Timer(100);
107
+            times.Elapsed += Times_ElapsedClick;
108
+            times.Start();
109
+        }
110
+        int num = 0;
111
+        /// <summary>
112
+        /// 计时器
113
+        /// </summary>
114
+        /// <param name="sender"></param>
115
+        /// <param name="e"></param>
116
+        private void Times_ElapsedClick(object sender, System.Timers.ElapsedEventArgs e)
117
+        {
118
+            Dispatcher.Invoke(() =>
119
+            {
120
+                pgbProcess.Value = num;
121
+                lbProcess.Content = string.Format("{0}/{1}", num, 100);
122
+                if (num < 99)
123
+                {
124
+                    num++;
125
+                    times.Interval += (num/2);
126
+                }
127
+                else
128
+                {
129
+                    times.Stop();
130
+                }
131
+            });
132
+        }
186
 
133
 
187
-                   
188
-                    
189
-                  
190
-            //    }
191
-            //    else
192
-            //    {
193
-            //        APP.myloading.Hide();
194
-            //        MessageWindow.Show(standardError);
195
-            //    }
196
-            //}
197
-            //else
198
-            //{
199
-            //    APP.myloading.Hide();
200
-            //    MessageWindow.Show(msg);
201
-            //}
134
+        /// <summary>
135
+        /// 开始打印
136
+        /// </summary>
137
+        void StartPrint(object obj)
138
+        {
139
+            List<string> objStr = (List<string>)obj;
140
+            string SourcePath= objStr[0];
141
+            int PrinterNum=int.Parse(objStr[1]);
142
+            string PrinterName= objStr[2];
143
+            //TPF文件位置
144
+            string TPFPath = FileToolsCommon.GetFileAbsolutePath("temp/");
145
+            FileToolsCommon.CreateDirectory(TPFPath);
146
+            TPFPath += "101.TPF";
147
+            //生成点阵文件
148
+            LatticeFileHelper.GeneratingPDF(SourcePath, TPFPath, out int pr, out string msg, out string outPut/*, pyte*/);
149
+            while(!FileToolsCommon.IsExistFile(TPFPath))
150
+            {
151
+                Thread.Sleep(100);
152
+            }
153
+            while(string.IsNullOrWhiteSpace(pr.ToString()))
154
+            {
155
+                Thread.Sleep(100);
156
+            }
157
+            Thread.Sleep(1000);
158
+            //打印
159
+            LatticeFileHelper.PrinterTPFFile(TPFPath, PrinterNum, PrinterName, out int printResult, out string standardError, out string standardOutput);
160
+            if (printResult == 0)
161
+            {
162
+                Dispatcher.Invoke(() =>
163
+                {
164
+                    btnClose.IsEnabled = true;
165
+                    btnPrint.IsEnabled = true;
166
+                    num = 99;
167
+                    times.Stop();
168
+                    pgbProcess.Value = 100;
169
+                    lbProcess.Content = string.Format("{0}/{1}", 100, 100);
170
+                    MessageWindow.Show("打印成功!");
171
+                    tip_outer.Visibility = Visibility.Collapsed;
172
+                });
173
+            }
174
+            else
175
+            {
176
+                Dispatcher.Invoke(() =>
177
+                {
178
+                    btnClose.IsEnabled = true;
179
+                    btnPrint.IsEnabled = true;
180
+                    times.Stop();
181
+                    tip_outer.Visibility = Visibility.Collapsed;
182
+                    MessageWindow.Show(standardError);
183
+                });
184
+            }
202
         }
185
         }
186
+
203
         /// <summary>
187
         /// <summary>
204
         /// 打印-开始
188
         /// 打印-开始
205
         /// </summary>
189
         /// </summary>
207
         private object InvokeServering()
191
         private object InvokeServering()
208
         {
192
         {
209
             Dispatcher.Invoke(() =>
193
             Dispatcher.Invoke(() =>
210
-                       {
211
-                           I = 1;
212
-                           pgbProcess.Value = I * 100 / 100;
213
-                           lbProcess.Content = string.Format("{0}/{1}", I, 100);
214
-                           tip_outer.Visibility = Visibility.Visible;
215
-                           //I = 0;
216
-                       });
194
+             {
195
+                 I = 1;
196
+                 pgbProcess.Value = I * 100 / 100;
197
+                 lbProcess.Content = string.Format("{0}/{1}", I, 100);
198
+                 tip_outer.Visibility = Visibility.Visible;
199
+                 //I = 0;
200
+             });
217
             Thread.Sleep(2000);
201
             Thread.Sleep(2000);
218
 
202
 
219
             string imgPath = FileToolsCommon.GetFileAbsolutePath("temp");
203
             string imgPath = FileToolsCommon.GetFileAbsolutePath("temp");
243
                 string standardError = string.Empty;
227
                 string standardError = string.Empty;
244
                 string standardOutput = string.Empty;
228
                 string standardOutput = string.Empty;
245
                 int frequency = 1;
229
                 int frequency = 1;
246
-                Dispatcher.Invoke(() =>
247
-                {
230
+                //Dispatcher.Invoke(() =>
231
+                //{
248
                      frequency = Convert.ToInt32(txbNumberOfCopies.Text);
232
                      frequency = Convert.ToInt32(txbNumberOfCopies.Text);
249
                     LatticeFileHelper.PrinterTPFFile(tpf, frequency, cmbClass.Text, out int printResult, out standardError, out standardOutput);
233
                     LatticeFileHelper.PrinterTPFFile(tpf, frequency, cmbClass.Text, out int printResult, out standardError, out standardOutput);
250
                     if (printResult == 0)// 0为成功
234
                     if (printResult == 0)// 0为成功
267
                                 MessageWindow.Show("打印成功");
251
                                 MessageWindow.Show("打印成功");
268
                             });
252
                             });
269
                         }))).Start();
253
                         }))).Start();
270
-                    }
271
-                    else
254
+                }
255
+                else
256
+                {
257
+                    Dispatcher.Invoke(() =>
272
                     {
258
                     {
273
                         APP.myloading.Hide();
259
                         APP.myloading.Hide();
274
                         MessageWindow.Show(standardError);
260
                         MessageWindow.Show(standardError);
275
-                    }
276
-                });
277
-             
261
+                    });
262
+                }
263
+                //});
264
+
278
             }
265
             }
279
             else
266
             else
280
             {
267
             {
298
             {
285
             {
299
             }
286
             }
300
         }
287
         }
301
-        /// <summary>
302
-        /// 时钟回调
303
-        /// </summary>
304
-        /// <param name="sender"></param>
305
-        /// <param name="e"></param>
306
-        private void OnTimer(object sender, EventArgs e)
307
-        {
308
-            switch (_state)
309
-            {
310
-                case State.Start:
311
-                    {
312
-                        _timeSpan += new TimeSpan(0, 0, 0, 1);
313
-                    }
314
-                    break;
315
-
316
-                case State.Pause:
317
-                    {
318
-                    }
319
-                    break;
320
-
321
-                case State.End:
322
-                    {
323
-                        _timeSpan = new TimeSpan();
324
-                        //_timeSpan = new TimeSpan(0, 23, 12, 45, 54);
325
-                    }
326
-                    break;
327
-            }
328
-
329
-            string time = string.Format("{0:D2}:{1:D2}",/* _timeSpan.Hours,*/ _timeSpan.Minutes, _timeSpan.Seconds);
330
-            if(I < 90 && I != 0)
331
-            {
332
-                Dispatcher.Invoke(() =>
333
-                {
334
-                 
335
-                    pgbProcess.Value = I * 100 / 100;
336
-            lbProcess.Content = string.Format("{0}/{1}", I, 100);
337
-                    if (I == 1)
338
-                    {
339
-                        I = 30;
340
-                    }
341
-                    else
342
-                    {
343
-                        I += 30;
344
-                    }
345
-                });
346
-            }
347
-        }
348
-        private void Times()
349
-        {
350
-            Dispatcher.Invoke(() =>
351
-            {
352
-                while (I <= 90&&I!=0)
353
-            {
354
-                pgbProcess.Value = I * 100 / 100;
355
-                lbProcess.Content = string.Format("{0}/{1}", I, 100);
356
-                Thread.Sleep(100);
357
-                I++;
358
-            }
359
-            });
360
-        }
361
 
288
 
362
         private int I = 0;
289
         private int I = 0;
363
         private void Times_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
290
         private void Times_Elapsed(object sender, System.Timers.ElapsedEventArgs e)

+ 1
- 0
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

619
                 </Border>
619
                 </Border>
620
             </Grid>
620
             </Grid>
621
 
621
 
622
+
622
             <Grid x:Name="GridMyVideo" Grid.Row="1" Margin="0" Background="White" Visibility="Collapsed">
623
             <Grid x:Name="GridMyVideo" Grid.Row="1" Margin="0" Background="White" Visibility="Collapsed">
623
                 <Grid.RowDefinitions>
624
                 <Grid.RowDefinitions>
624
                     <RowDefinition Height="*"/>
625
                     <RowDefinition Height="*"/>

+ 12
- 12
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

3145
                         Thread.Sleep(500);
3145
                         Thread.Sleep(500);
3146
                         int imgW = (int)GridMain.ActualWidth + (GridMain.ActualWidth % 2 > 0 ? 1 : 0);
3146
                         int imgW = (int)GridMain.ActualWidth + (GridMain.ActualWidth % 2 > 0 ? 1 : 0);
3147
                         int imgH = (int)GridMain.ActualHeight + (GridMain.ActualHeight % 2 > 0 ? 1 : 0);
3147
                         int imgH = (int)GridMain.ActualHeight + (GridMain.ActualHeight % 2 > 0 ? 1 : 0);
3148
-                        if (ThuRes)
3149
-                        {
3150
-                            Bitmap bmp = ImageHelper.ReadBitmapFile(ThumbnailPathName);
3151
-                            if (bmp != null)
3152
-                            {
3153
-                                imgW = bmp.Width + (bmp.Width % 2 > 0 ? 1 : 0);
3154
-                                imgH = bmp.Height + (bmp.Height % 2 > 0 ? 1 : 0);
3155
-                            }
3156
-                        }
3148
+                        //if (ThuRes)
3149
+                        //{
3150
+                        //    Bitmap bmp = ImageHelper.ReadBitmapFile(ThumbnailPathName);
3151
+                        //    if (bmp != null)
3152
+                        //    {
3153
+                        //        imgW = bmp.Width + (bmp.Width % 2 > 0 ? 1 : 0);
3154
+                        //        imgH = bmp.Height + (bmp.Height % 2 > 0 ? 1 : 0);
3155
+                        //    }
3156
+                        //}
3157
 
3157
 
3158
                         APP.FFmpeg.VideoTranscode(VideoSynthesisPathName, VideoSavePathName, imgW, imgH);
3158
                         APP.FFmpeg.VideoTranscode(VideoSynthesisPathName, VideoSavePathName, imgW, imgH);
3159
                         VideoInfo.FileGuid = Guid.NewGuid().ToString();
3159
                         VideoInfo.FileGuid = Guid.NewGuid().ToString();
3320
                 ////设置纸张横向
3320
                 ////设置纸张横向
3321
                 //document.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
3321
                 //document.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
3322
 
3322
 
3323
-                string imgPath = FileToolsCommon.GetFileAbsolutePath("temp");
3324
-                FileToolsCommon.CreateFile(imgPath);
3325
-                imgPath += "\\101.pdf";
3323
+                string imgPath = FileToolsCommon.GetFileAbsolutePath("temp/");
3324
+                FileToolsCommon.CreateDirectory(imgPath);
3325
+                imgPath += "101.pdf";
3326
                 iTextSharp.text.pdf.PdfWriter.GetInstance(document, new FileStream(imgPath, FileMode.Create, FileAccess.ReadWrite));
3326
                 iTextSharp.text.pdf.PdfWriter.GetInstance(document, new FileStream(imgPath, FileMode.Create, FileAccess.ReadWrite));
3327
                 document.Open();
3327
                 document.Open();
3328
                 iTextSharp.text.Image image;
3328
                 iTextSharp.text.Image image;

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

1586
     <Resource Include="Images\countdown3_6.png" />
1586
     <Resource Include="Images\countdown3_6.png" />
1587
     <Resource Include="Images\countdown3_7.png" />
1587
     <Resource Include="Images\countdown3_7.png" />
1588
     <Resource Include="Images\countdown3_8.png" />
1588
     <Resource Include="Images\countdown3_8.png" />
1589
-    <Resource Include="Images\countdown3_9.png" />
1590
     <Resource Include="Images\microLessonSystem_999.png" />
1589
     <Resource Include="Images\microLessonSystem_999.png" />
1591
   </ItemGroup>
1590
   </ItemGroup>
1592
   <ItemGroup>
1591
   <ItemGroup>
1611
     <Resource Include="Images\rdo_no.png" />
1610
     <Resource Include="Images\rdo_no.png" />
1612
     <Resource Include="Images\rdo_yes.png" />
1611
     <Resource Include="Images\rdo_yes.png" />
1613
   </ItemGroup>
1612
   </ItemGroup>
1613
+  <ItemGroup>
1614
+    <Resource Include="Images\countdown1_6.png" />
1615
+    <Resource Include="Images\countdown1_7.png" />
1616
+  </ItemGroup>
1614
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1617
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1615
 </Project>
1618
 </Project>

Loading…
Cancel
Save