|
@@ -64,7 +64,7 @@ namespace XHWK.WKTool
|
64
|
64
|
APP.pageData.currpage = 1;
|
65
|
65
|
DataContext = APP.pageData;
|
66
|
66
|
|
67
|
|
- txbStoragePath.Text = FileToolsCommon.GetConfigValue("VideoType");
|
|
67
|
+ txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoType");
|
68
|
68
|
if (FileToolsCommon.GetConfigValue("IsSound").Equals("true"))
|
69
|
69
|
{
|
70
|
70
|
rbnY.IsChecked = true;
|
|
@@ -73,7 +73,7 @@ namespace XHWK.WKTool
|
73
|
73
|
{
|
74
|
74
|
rbnN.IsChecked = true;
|
75
|
75
|
}
|
76
|
|
- txbStoragePath.Text = FileToolsCommon.GetConfigValue("VideoSavePath");
|
|
76
|
+ txbStoragePath.Content = FileToolsCommon.GetConfigValue("VideoSavePath");
|
77
|
77
|
Initialize();
|
78
|
78
|
InitPen();
|
79
|
79
|
}
|
|
@@ -134,7 +134,7 @@ namespace XHWK.WKTool
|
134
|
134
|
if (CameraHelper.CameraDevices.Count > 0)
|
135
|
135
|
{
|
136
|
136
|
CameraHelper.SetCameraDevice(0);
|
137
|
|
- //wfhCamera.Visibility = Visibility.Hidden;
|
|
137
|
+ imgPlayer.Visibility = Visibility.Visible;
|
138
|
138
|
RbnOpen = new List<string>();
|
139
|
139
|
times = new System.Timers.Timer(200);//设置执行一次(false)还是一直执行(true)
|
140
|
140
|
times.AutoReset = true;//设置是否执行System.Timers.Timer.Elapsed事件
|
|
@@ -143,11 +143,8 @@ namespace XHWK.WKTool
|
143
|
143
|
|
144
|
144
|
IsRbnOpen = true;
|
145
|
145
|
}
|
146
|
|
-
|
147
|
|
-
|
148
|
146
|
}
|
149
|
147
|
|
150
|
|
-
|
151
|
148
|
int I = 9999;
|
152
|
149
|
private void Times_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
153
|
150
|
{
|
|
@@ -157,17 +154,17 @@ namespace XHWK.WKTool
|
157
|
154
|
{
|
158
|
155
|
Dispatcher.Invoke(() =>
|
159
|
156
|
{
|
160
|
|
- if(I>10006)
|
|
157
|
+ if(I>10010)
|
161
|
158
|
{
|
|
159
|
+ long time = Timestamp();
|
162
|
160
|
//string FilePathName = ImgPath + RsImgName.Count + ".png";
|
163
|
|
- string path = CameraHelper.CaptureImage(@"G:\103", I.ToString());
|
|
161
|
+ string path = CameraHelper.CaptureImage(@"G:\103", time.ToString());
|
164
|
162
|
if (!string.IsNullOrWhiteSpace(path))
|
165
|
163
|
{
|
166
|
164
|
RbnOpen.Add(path);
|
167
|
165
|
imgPlayer.Source = new BitmapImage(new Uri(path));
|
168
|
166
|
}
|
169
|
167
|
}
|
170
|
|
-
|
171
|
168
|
I++;
|
172
|
169
|
});
|
173
|
170
|
}
|
|
@@ -185,8 +182,9 @@ namespace XHWK.WKTool
|
185
|
182
|
private void RbnTurnOff_Click(object sender, RoutedEventArgs e)
|
186
|
183
|
{
|
187
|
184
|
IsRbnOpen = false;
|
188
|
|
- //wfhCamera.Visibility = Visibility.Hidden;
|
|
185
|
+ imgPlayer.Visibility = Visibility.Hidden;
|
189
|
186
|
CameraHelper.CloseDevice();
|
|
187
|
+ I = 9999;
|
190
|
188
|
}
|
191
|
189
|
#endregion
|
192
|
190
|
#endregion
|
|
@@ -255,33 +253,33 @@ namespace XHWK.WKTool
|
255
|
253
|
/// <param name="e"></param>
|
256
|
254
|
private void BtnSave_Click(object sender, RoutedEventArgs e)
|
257
|
255
|
{
|
258
|
|
- #region 合法性判断
|
259
|
|
- if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
|
260
|
|
- {
|
261
|
|
- System.Windows.MessageBox.Show("路径不可为空!");
|
262
|
|
- return;
|
263
|
|
- }
|
264
|
|
- string temp = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + APP.WKData.WkName.Trim() + "/";
|
265
|
|
- if (!APP.WKData.WkPath.Equals(temp))
|
266
|
|
- {
|
267
|
|
- APP.WKData.WkPath = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + APP.WKData.WkName.Trim() + "/";
|
268
|
|
- if (FileToolsCommon.IsExistDirectory(APP.WKData.WkPath))
|
269
|
|
- {
|
270
|
|
- //微课已存在
|
271
|
|
- MessageBoxResult dr = System.Windows.MessageBox.Show("讲解已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
|
272
|
|
- if (dr == MessageBoxResult.OK)
|
273
|
|
- {
|
274
|
|
- FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
|
275
|
|
- }
|
276
|
|
- else
|
277
|
|
- {
|
278
|
|
- return;
|
279
|
|
- }
|
280
|
|
- }
|
281
|
|
- //创建文件夹
|
282
|
|
- FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
|
283
|
|
- }
|
284
|
|
- #endregion
|
|
256
|
+ //#region 合法性判断
|
|
257
|
+ //if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
|
|
258
|
+ //{
|
|
259
|
+ // System.Windows.MessageBox.Show("路径不可为空!");
|
|
260
|
+ // return;
|
|
261
|
+ //}
|
|
262
|
+ //string temp = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + APP.WKData.WkName.Trim() + "/";
|
|
263
|
+ //if (!APP.WKData.WkPath.Equals(temp))
|
|
264
|
+ //{
|
|
265
|
+ // APP.WKData.WkPath = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + APP.WKData.WkName.Trim() + "/";
|
|
266
|
+ // if (FileToolsCommon.IsExistDirectory(APP.WKData.WkPath))
|
|
267
|
+ // {
|
|
268
|
+ // //微课已存在
|
|
269
|
+ // MessageBoxResult dr = System.Windows.MessageBox.Show("讲解已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
|
|
270
|
+ // if (dr == MessageBoxResult.OK)
|
|
271
|
+ // {
|
|
272
|
+ // FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
|
|
273
|
+ // }
|
|
274
|
+ // else
|
|
275
|
+ // {
|
|
276
|
+ // return;
|
|
277
|
+ // }
|
|
278
|
+ // }
|
|
279
|
+ // //创建文件夹
|
|
280
|
+ // FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
|
|
281
|
+ //}
|
|
282
|
+ //#endregion
|
285
|
283
|
|
286
|
284
|
|
287
|
285
|
if (rbnMP4.IsChecked == true)
|
|
@@ -317,6 +315,7 @@ namespace XHWK.WKTool
|
317
|
315
|
{
|
318
|
316
|
GridMain.Visibility = Visibility.Collapsed;
|
319
|
317
|
gridSetUp.Visibility = Visibility.Visible;
|
|
318
|
+ txbStoragePath.Content = APP.WKData.WkPath;
|
320
|
319
|
}
|
321
|
320
|
/// <summary>
|
322
|
321
|
/// 设置 浏览事件
|
|
@@ -325,20 +324,25 @@ namespace XHWK.WKTool
|
325
|
324
|
/// <param name="e"></param>
|
326
|
325
|
private void BtnBrowse_Click(object sender, RoutedEventArgs e)
|
327
|
326
|
{
|
328
|
|
- string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
329
|
|
- Ofd = new System.Windows.Forms.FolderBrowserDialog();
|
330
|
327
|
|
331
|
|
- Result = Ofd.ShowDialog();
|
332
|
|
- if (Result == System.Windows.Forms.DialogResult.OK)
|
333
|
|
- {
|
334
|
|
- if (Ofd.SelectedPath != "")
|
335
|
|
- {
|
336
|
|
- txbStoragePath.Text = Ofd.SelectedPath;
|
337
|
|
- //string ApplicationData = ZConfig.dataPath + "fileStorageAddress.txt";
|
338
|
|
- //string temp = ofd.SelectedPath;
|
339
|
|
- //System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
340
|
|
- }
|
341
|
|
- }
|
|
328
|
+
|
|
329
|
+ System.Diagnostics.Process.Start(APP.WKData.WkPath);
|
|
330
|
+ //string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
|
331
|
+ //Ofd = new System.Windows.Forms.FolderBrowserDialog();
|
|
332
|
+
|
|
333
|
+ //Result = Ofd.ShowDialog();
|
|
334
|
+ //if (Result == System.Windows.Forms.DialogResult.OK)
|
|
335
|
+ //{
|
|
336
|
+ // if (Ofd.SelectedPath != "")
|
|
337
|
+ // {
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+ // //txbStoragePath.Text = Ofd.SelectedPath;
|
|
341
|
+ // //string ApplicationData = ZConfig.dataPath + "fileStorageAddress.txt";
|
|
342
|
+ // //string temp = ofd.SelectedPath;
|
|
343
|
+ // //System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
|
344
|
+ // }
|
|
345
|
+ //}
|
342
|
346
|
}
|
343
|
347
|
/// <summary>
|
344
|
348
|
/// 画笔颜色事件 白色
|
|
@@ -1439,6 +1443,7 @@ namespace XHWK.WKTool
|
1439
|
1443
|
//labPenStatus.Text = "PenDown";
|
1440
|
1444
|
isPenDown = true;
|
1441
|
1445
|
}
|
|
1446
|
+ //myblackboard.changepages(0, 0, true);
|
1442
|
1447
|
}
|
1443
|
1448
|
|
1444
|
1449
|
/// <summary>
|
|
@@ -1469,6 +1474,11 @@ namespace XHWK.WKTool
|
1469
|
1474
|
//}
|
1470
|
1475
|
stroke.Clear();
|
1471
|
1476
|
}
|
|
1477
|
+ Dispatcher.Invoke(new Action(() =>
|
|
1478
|
+ {
|
|
1479
|
+ myblackboard.changepages(0, 0, true);
|
|
1480
|
+ }));
|
|
1481
|
+
|
1472
|
1482
|
}
|
1473
|
1483
|
|
1474
|
1484
|
/// <summary>
|
|
@@ -1488,6 +1498,12 @@ namespace XHWK.WKTool
|
1488
|
1498
|
{
|
1489
|
1499
|
APP.PenSerial = penSerial;
|
1490
|
1500
|
APP.PenStatus = false;
|
|
1501
|
+
|
|
1502
|
+ Dispatcher.Invoke(new Action(() =>
|
|
1503
|
+ {
|
|
1504
|
+ txbNotConnected.Text = "未连接";
|
|
1505
|
+ txbNotConnecteds.Text = "未连接";
|
|
1506
|
+ }));
|
1491
|
1507
|
}
|
1492
|
1508
|
}
|
1493
|
1509
|
|
|
@@ -1514,6 +1530,12 @@ namespace XHWK.WKTool
|
1514
|
1530
|
|
1515
|
1531
|
//开始接收笔数据
|
1516
|
1532
|
APP.digitalPen.GetPenData(penSerial);
|
|
1533
|
+ Dispatcher.Invoke(new Action(() =>
|
|
1534
|
+ {
|
|
1535
|
+ txbNotConnected.Text = "已连接";
|
|
1536
|
+ txbNotConnecteds.Text = "已连接";
|
|
1537
|
+ }));
|
|
1538
|
+
|
1517
|
1539
|
}
|
1518
|
1540
|
}
|
1519
|
1541
|
/// <summary>
|
|
@@ -1589,7 +1611,12 @@ namespace XHWK.WKTool
|
1589
|
1611
|
double testY=(double)cy * PropH;
|
1590
|
1612
|
//pageSerial //点阵IP地址 与打印的页面关联
|
1591
|
1613
|
|
|
1614
|
+ Dispatcher.Invoke(new Action(() =>
|
|
1615
|
+ {
|
|
1616
|
+ myblackboard.changepages(testX, testY,false);
|
|
1617
|
+ }));
|
1592
|
1618
|
|
|
1619
|
+
|
1593
|
1620
|
////每3个点画一条曲线
|
1594
|
1621
|
//if (stroke.Count % 3 == 0)
|
1595
|
1622
|
//{
|
|
@@ -1654,5 +1681,17 @@ namespace XHWK.WKTool
|
1654
|
1681
|
APP.digitalPen.SetPenHoverMode(false, penSerial);
|
1655
|
1682
|
}
|
1656
|
1683
|
#endregion
|
|
1684
|
+ /// <summary>
|
|
1685
|
+ /// 最小化
|
|
1686
|
+ /// </summary>
|
|
1687
|
+ /// <param name="sender"></param>
|
|
1688
|
+ /// <param name="e"></param>
|
|
1689
|
+ private void BtnShrink_Click(object sender, RoutedEventArgs e)
|
|
1690
|
+ {
|
|
1691
|
+ if(Visibility== Visibility.Hidden)
|
|
1692
|
+ Visibility = Visibility.Visible;
|
|
1693
|
+ else
|
|
1694
|
+ Visibility = Visibility.Hidden;
|
|
1695
|
+ }
|
1657
|
1696
|
}
|
1658
|
1697
|
}
|