|
@@ -925,8 +925,6 @@ namespace XHWK.WKTool
|
925
|
925
|
|
926
|
926
|
private bool _isRbnOpen;
|
927
|
927
|
|
928
|
|
- private System.Timers.Timer _times;
|
929
|
|
-
|
930
|
928
|
/// <summary>
|
931
|
929
|
/// 摄像头打开事件
|
932
|
930
|
/// </summary>
|
|
@@ -973,18 +971,6 @@ namespace XHWK.WKTool
|
973
|
971
|
}
|
974
|
972
|
CameraHelper.imageCallback = LoadImage;
|
975
|
973
|
CameraHelper.StartCameraDevice(cameraIndex, this.Dispatcher);
|
976
|
|
- if (_timer != null)
|
977
|
|
- {
|
978
|
|
- _times.Elapsed -= Times_Elapsed;
|
979
|
|
- _times.Enabled = false;
|
980
|
|
- _times.Dispose();
|
981
|
|
- }
|
982
|
|
- _times = new System.Timers.Timer(200) //初始值为300
|
983
|
|
- {
|
984
|
|
- AutoReset = true //设置是否执行System.Timers.Timer.Elapsed事件
|
985
|
|
- }; //设置执行一次(false)还是一直执行(true)
|
986
|
|
- _times.Elapsed += Times_Elapsed;
|
987
|
|
- _times.Enabled = true; //启动计时器
|
988
|
974
|
_isRbnOpen = true;
|
989
|
975
|
string imgPath = FileToolsCommon.GetFileAbsolutePath("Temp/imgplayer");
|
990
|
976
|
FileToolsCommon.CreateDirectory(imgPath);
|
|
@@ -1062,30 +1048,6 @@ namespace XHWK.WKTool
|
1062
|
1048
|
RbnOpen.IsEnabled = false;
|
1063
|
1049
|
CameraHelper.CloseDevice();
|
1064
|
1050
|
RbnOpen.IsEnabled = true;
|
1065
|
|
- if (_timer != null)
|
1066
|
|
- {
|
1067
|
|
- _times.Elapsed -= Times_Elapsed;
|
1068
|
|
- _times.Enabled = false;
|
1069
|
|
- _times.Dispose();
|
1070
|
|
- _times = null;
|
1071
|
|
- }
|
1072
|
|
- }
|
1073
|
|
- }
|
1074
|
|
-
|
1075
|
|
- private void Times_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
1076
|
|
- {
|
1077
|
|
- if (_isRbnOpen)
|
1078
|
|
- {
|
1079
|
|
- try
|
1080
|
|
- {
|
1081
|
|
- long time = Timestamp();
|
1082
|
|
- string imgPath = FileToolsCommon.GetFileAbsolutePath("Temp/imgplayer");
|
1083
|
|
- CameraHelper.CaptureImage(imgPath, time.ToString());
|
1084
|
|
- }
|
1085
|
|
- catch (Exception ex)
|
1086
|
|
- {
|
1087
|
|
- LogHelper.WriteErrLog("【摄像】(Times_Elapsed)生成图片错误:" + ex.Message, ex);
|
1088
|
|
- }
|
1089
|
1051
|
}
|
1090
|
1052
|
}
|
1091
|
1053
|
|
|
@@ -1102,7 +1064,7 @@ namespace XHWK.WKTool
|
1102
|
1064
|
/// </param>
|
1103
|
1065
|
private async void BtnDevice_Click(object sender, RoutedEventArgs e)
|
1104
|
1066
|
{
|
1105
|
|
- if (RbnTurnOff.IsChecked != null && !(bool)RbnTurnOff.IsChecked)
|
|
1067
|
+ if (_isRbnOpen)
|
1106
|
1068
|
{
|
1107
|
1069
|
RbnTurnOff.IsChecked = true;
|
1108
|
1070
|
RbnTurnOff_Click(null, null);
|
|
@@ -2619,6 +2581,8 @@ namespace XHWK.WKTool
|
2619
|
2581
|
App.W_CountdownWindow = new CountdownWindow();
|
2620
|
2582
|
}
|
2621
|
2583
|
App.W_CountdownWindow.InitAndShow();
|
|
2584
|
+ _recordType = 3;
|
|
2585
|
+ RecordBtnStatus();
|
2622
|
2586
|
|
2623
|
2587
|
#endregion 录像倒计时
|
2624
|
2588
|
|
|
@@ -2645,6 +2609,7 @@ namespace XHWK.WKTool
|
2645
|
2609
|
BtnScreenRecording.IsEnabled = true;
|
2646
|
2610
|
BtnRecord.IsEnabled = true;
|
2647
|
2611
|
BtnStop.IsEnabled = false;
|
|
2612
|
+ SheXiangTouSp.Visibility = Visibility.Visible;
|
2648
|
2613
|
}
|
2649
|
2614
|
else if (_recordType == 1)
|
2650
|
2615
|
{
|
|
@@ -2652,6 +2617,7 @@ namespace XHWK.WKTool
|
2652
|
2617
|
TxbType.Text = "录制中";
|
2653
|
2618
|
BtnRecord.Visibility = Visibility.Collapsed;
|
2654
|
2619
|
BtnRecordSuspend.Visibility = Visibility.Visible;
|
|
2620
|
+ SheXiangTouSp.Visibility = Visibility.Hidden;
|
2655
|
2621
|
}
|
2656
|
2622
|
else if (_recordType == 2)
|
2657
|
2623
|
{
|
|
@@ -2659,16 +2625,19 @@ namespace XHWK.WKTool
|
2659
|
2625
|
TxbType.Text = "暂停中";
|
2660
|
2626
|
BtnRecord.Visibility = Visibility.Visible;
|
2661
|
2627
|
BtnRecordSuspend.Visibility = Visibility.Collapsed;
|
|
2628
|
+ SheXiangTouSp.Visibility = Visibility.Hidden;
|
2662
|
2629
|
}
|
2663
|
2630
|
else if (_recordType == 3)
|
2664
|
2631
|
{
|
2665
|
2632
|
TxbType.Text = "倒计时";
|
|
2633
|
+ SheXiangTouSp.Visibility = Visibility.Hidden;
|
2666
|
2634
|
}
|
2667
|
2635
|
else if (_recordType == 4)
|
2668
|
2636
|
{
|
2669
|
2637
|
TxbType.Text = "合并中";
|
2670
|
2638
|
StartPauseGrid.Visibility = Visibility.Hidden;
|
2671
|
2639
|
BtnScreenRecording.IsEnabled = false;
|
|
2640
|
+ SheXiangTouSp.Visibility = Visibility.Hidden;
|
2672
|
2641
|
}
|
2673
|
2642
|
}
|
2674
|
2643
|
|
|
@@ -2745,6 +2714,7 @@ namespace XHWK.WKTool
|
2745
|
2714
|
BtnScreenRecording.IsEnabled = false;
|
2746
|
2715
|
_timer.Change(-1, 0);
|
2747
|
2716
|
_timer.Dispose();
|
|
2717
|
+ _timer = null;
|
2748
|
2718
|
TxbTime.Text = "00:00";
|
2749
|
2719
|
TxbType.Text = "保存中";
|
2750
|
2720
|
_recordType = 4;
|