浏览代码

合并

tags/录制修改前
zhangxueyang 4 年前
父节点
当前提交
17b79df146

+ 40
- 32
XHWK.WKTool/CountdownWindow.xaml.cs 查看文件

@@ -21,18 +21,18 @@ namespace XHWK.WKTool
21 21
         /// <summary>
22 22
         /// 计时器
23 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 36
             bool IsStart = true;
37 37
             new Thread(new ThreadStart(new Action(() =>
38 38
             {
@@ -45,7 +45,7 @@ namespace XHWK.WKTool
45 45
                             loadingImg(ImgNum);
46 46
                             LogHelper.WriteInfoLog("【" + ImgNum + "】");
47 47
                             ImgNum--;
48
-                            Thread.Sleep(changeTime / 21);
48
+                            Thread.Sleep(changeTime / 22);
49 49
                         }
50 50
                         else
51 51
                         {
@@ -107,7 +107,7 @@ namespace XHWK.WKTool
107 107
                       DispatcherPriority.Send,
108 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 112
                     break;
113 113
                 case 2:
@@ -115,7 +115,7 @@ namespace XHWK.WKTool
115 115
                       DispatcherPriority.Send,
116 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 120
                     break;
121 121
                 case 3:
@@ -123,7 +123,7 @@ namespace XHWK.WKTool
123 123
                       DispatcherPriority.Send,
124 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 128
                     break;
129 129
                 case 4:
@@ -131,7 +131,7 @@ namespace XHWK.WKTool
131 131
                       DispatcherPriority.Send,
132 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 136
                     break;
137 137
                 case 5:
@@ -139,7 +139,7 @@ namespace XHWK.WKTool
139 139
                       DispatcherPriority.Send,
140 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 144
                     break;
145 145
                 case 6:
@@ -147,7 +147,7 @@ namespace XHWK.WKTool
147 147
                       DispatcherPriority.Send,
148 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 152
                     break;
153 153
                 case 7:
@@ -155,7 +155,7 @@ namespace XHWK.WKTool
155 155
                       DispatcherPriority.Send,
156 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 160
                     break;
161 161
                 case 8:
@@ -163,7 +163,7 @@ namespace XHWK.WKTool
163 163
                       DispatcherPriority.Send,
164 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 168
                     break;
169 169
                 case 9:
@@ -171,7 +171,7 @@ namespace XHWK.WKTool
171 171
                       DispatcherPriority.Send,
172 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 176
                     break;
177 177
                 case 10:
@@ -179,7 +179,7 @@ namespace XHWK.WKTool
179 179
                       DispatcherPriority.Send,
180 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 184
                     break;
185 185
                 case 11:
@@ -187,7 +187,7 @@ namespace XHWK.WKTool
187 187
                       DispatcherPriority.Send,
188 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 192
                     break;
193 193
                 case 12:
@@ -195,7 +195,7 @@ namespace XHWK.WKTool
195 195
                       DispatcherPriority.Send,
196 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 200
                     break;
201 201
                 case 13:
@@ -203,7 +203,7 @@ namespace XHWK.WKTool
203 203
                       DispatcherPriority.Send,
204 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 208
                     break;
209 209
                 case 14:
@@ -211,7 +211,7 @@ namespace XHWK.WKTool
211 211
                       DispatcherPriority.Send,
212 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 216
                     break;
217 217
                 case 15:
@@ -219,7 +219,7 @@ namespace XHWK.WKTool
219 219
                       DispatcherPriority.Send,
220 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 224
                     break;
225 225
                 case 16:
@@ -227,7 +227,7 @@ namespace XHWK.WKTool
227 227
                       DispatcherPriority.Send,
228 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 232
                     break;
233 233
                 case 17:
@@ -235,7 +235,7 @@ namespace XHWK.WKTool
235 235
                       DispatcherPriority.Send,
236 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 240
                     break;
241 241
                 case 18:
@@ -243,7 +243,7 @@ namespace XHWK.WKTool
243 243
                       DispatcherPriority.Send,
244 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 248
                     break;
249 249
                 case 19:
@@ -251,7 +251,7 @@ namespace XHWK.WKTool
251 251
                       DispatcherPriority.Send,
252 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 256
                     break;
257 257
                 case 20:
@@ -259,10 +259,18 @@ namespace XHWK.WKTool
259 259
                       DispatcherPriority.Send,
260 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 264
                     break;
265 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 274
                     Dispatcher.Invoke(
267 275
                       DispatcherPriority.Send,
268 276
                       new Action(() =>

二进制
XHWK.WKTool/Images/countdown1_1.png 查看文件


二进制
XHWK.WKTool/Images/countdown1_2.png 查看文件


二进制
XHWK.WKTool/Images/countdown1_3.png 查看文件


二进制
XHWK.WKTool/Images/countdown1_4.png 查看文件


二进制
XHWK.WKTool/Images/countdown1_5.png 查看文件


二进制
XHWK.WKTool/Images/countdown1_6.png 查看文件


二进制
XHWK.WKTool/Images/countdown1_7.png 查看文件


二进制
XHWK.WKTool/Images/countdown2_1.png 查看文件


二进制
XHWK.WKTool/Images/countdown2_2.png 查看文件


二进制
XHWK.WKTool/Images/countdown2_3.png 查看文件


二进制
XHWK.WKTool/Images/countdown2_4.png 查看文件


二进制
XHWK.WKTool/Images/countdown2_5.png 查看文件


二进制
XHWK.WKTool/Images/countdown2_6.png 查看文件


二进制
XHWK.WKTool/Images/countdown2_7.png 查看文件


二进制
XHWK.WKTool/Images/countdown3_1.png 查看文件


二进制
XHWK.WKTool/Images/countdown3_2.png 查看文件


二进制
XHWK.WKTool/Images/countdown3_3.png 查看文件


二进制
XHWK.WKTool/Images/countdown3_4.png 查看文件


二进制
XHWK.WKTool/Images/countdown3_5.png 查看文件


二进制
XHWK.WKTool/Images/countdown3_6.png 查看文件


二进制
XHWK.WKTool/Images/countdown3_7.png 查看文件


二进制
XHWK.WKTool/Images/countdown3_8.png 查看文件


二进制
XHWK.WKTool/Images/countdown3_9.png 查看文件


+ 62
- 70
XHWK.WKTool/PrintWindow.xaml 查看文件

@@ -32,23 +32,23 @@
32 32
     </Window.Resources>
33 33
     <Viewbox>
34 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 35
             <Grid.RowDefinitions>
42
-                <RowDefinition Height="50"/>
43
-                <RowDefinition Height="50"/>
36
+                <RowDefinition Height="120"/>
44 37
                 <RowDefinition Height="*"/>
38
+                <RowDefinition Height="80"/>
45 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 52
                                 x:Name="cmbClass"
53 53
                                 Padding="30,0,10,0"
54 54
                                 VerticalContentAlignment="Center"
@@ -57,26 +57,48 @@
57 57
                                 FontSize="14"
58 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 71
                 <RadioButton x:Name="rbnSquarePoint" Content="方点" FontSize="16"  Margin="0,15,0,0" IsChecked="True"/>
72 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 102
                     x:Name="btnPrint"
81 103
                     Grid.Row="8"
82 104
                     Width="115"
@@ -88,51 +110,21 @@
88 110
                     IsDefault="True"
89 111
                     Cursor="Hand"
90 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 116
                                 BorderBrush="{TemplateBinding Control.BorderBrush}"
95 117
                                 BorderThickness="1"
96 118
                                 CornerRadius="7">
97
-                        <Border.Background>#2E8CF0</Border.Background>
98
-                        <ContentPresenter
119
+                            <Border.Background>#2E8CF0</Border.Background>
120
+                            <ContentPresenter
99 121
                                     HorizontalAlignment="Center"
100 122
                                     VerticalAlignment="Center"
101 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 129
     </Viewbox>
138 130
 </Window>

+ 116
- 189
XHWK.WKTool/PrintWindow.xaml.cs 查看文件

@@ -21,24 +21,8 @@ namespace XHWK.WKTool
21 21
         /// </summary>
22 22
         public DataTable data = new DataTable();
23 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 26
         public PrintWindow()
43 27
         {
44 28
             InitializeComponent();
@@ -81,18 +65,8 @@ namespace XHWK.WKTool
81 65
                 imgPri.Source = null;
82 66
             }
83 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 68
             tip_outer.Visibility = Visibility.Collapsed;
94 69
         }
95
-        private System.Timers.Timer times;
96 70
         /// <summary>
97 71
         /// 打印
98 72
         /// </summary>
@@ -106,100 +80,110 @@ namespace XHWK.WKTool
106 80
                 MessageWindow.Show("打印机不能为空!");
107 81
                 return;
108 82
             }
109
-            APP.myloading.Show();
110
-            APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeServering, InvokeServerCompate);
111
-
112
-
113
-
114
-
115
-            //I = 1;
116 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 91
             //FileToolsCommon.CreateFile(imgPath);
137 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 187
         /// <summary>
204 188
         /// 打印-开始
205 189
         /// </summary>
@@ -207,13 +191,13 @@ namespace XHWK.WKTool
207 191
         private object InvokeServering()
208 192
         {
209 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 201
             Thread.Sleep(2000);
218 202
 
219 203
             string imgPath = FileToolsCommon.GetFileAbsolutePath("temp");
@@ -243,8 +227,8 @@ namespace XHWK.WKTool
243 227
                 string standardError = string.Empty;
244 228
                 string standardOutput = string.Empty;
245 229
                 int frequency = 1;
246
-                Dispatcher.Invoke(() =>
247
-                {
230
+                //Dispatcher.Invoke(() =>
231
+                //{
248 232
                      frequency = Convert.ToInt32(txbNumberOfCopies.Text);
249 233
                     LatticeFileHelper.PrinterTPFFile(tpf, frequency, cmbClass.Text, out int printResult, out standardError, out standardOutput);
250 234
                     if (printResult == 0)// 0为成功
@@ -267,14 +251,17 @@ namespace XHWK.WKTool
267 251
                                 MessageWindow.Show("打印成功");
268 252
                             });
269 253
                         }))).Start();
270
-                    }
271
-                    else
254
+                }
255
+                else
256
+                {
257
+                    Dispatcher.Invoke(() =>
272 258
                     {
273 259
                         APP.myloading.Hide();
274 260
                         MessageWindow.Show(standardError);
275
-                    }
276
-                });
277
-             
261
+                    });
262
+                }
263
+                //});
264
+
278 265
             }
279 266
             else
280 267
             {
@@ -298,66 +285,6 @@ namespace XHWK.WKTool
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 289
         private int I = 0;
363 290
         private void Times_Elapsed(object sender, System.Timers.ElapsedEventArgs e)

+ 1
- 0
XHWK.WKTool/XHMicroLessonSystemWindow.xaml 查看文件

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

+ 12
- 12
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs 查看文件

@@ -3145,15 +3145,15 @@ namespace XHWK.WKTool
3145 3145
                         Thread.Sleep(500);
3146 3146
                         int imgW = (int)GridMain.ActualWidth + (GridMain.ActualWidth % 2 > 0 ? 1 : 0);
3147 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 3158
                         APP.FFmpeg.VideoTranscode(VideoSynthesisPathName, VideoSavePathName, imgW, imgH);
3159 3159
                         VideoInfo.FileGuid = Guid.NewGuid().ToString();
@@ -3320,9 +3320,9 @@ namespace XHWK.WKTool
3320 3320
                 ////设置纸张横向
3321 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 3326
                 iTextSharp.text.pdf.PdfWriter.GetInstance(document, new FileStream(imgPath, FileMode.Create, FileAccess.ReadWrite));
3327 3327
                 document.Open();
3328 3328
                 iTextSharp.text.Image image;

+ 4
- 1
XHWK.WKTool/XHWK.WKTool.csproj 查看文件

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

正在加载...
取消
保存