Commit 3b9da37e by 鲁志-悦动

手动模式Replay倒计时显示数字到0时停止

parent b5e17edf
......@@ -805,7 +805,7 @@
</b:EventTrigger>
</b:Interaction.Triggers>
</TextBox>
<!--<TextBox
<TextBox
Width="30"
Background="Yellow"
BorderBrush="Red"
......@@ -814,8 +814,8 @@
Foreground="Black"
IsEnabled="False"
Style="{StaticResource TextBoxStyle}"
Text="{Binding AutoSendCount}" />-->
<TextBlock
Text="{Binding AutoSendCount}" />
<!--<TextBlock
Width="30"
Height="30"
Padding="0,6,0,0"
......@@ -841,7 +841,7 @@
NumText="{Binding AutoSendIntervalTime}"
TempNumText="{Binding AutoSendIntervalTime}"
TextAlignment="Center"
Visibility="{Binding TimeCountActVisibility}" />
Visibility="{Binding TimeCountActVisibility}" />-->
</StackPanel>
</Border>
......
......@@ -52,7 +52,7 @@ namespace VIZ.FGOUT.Module
ApplicationDomainEx.ServiceManager.AddService(NDIMainViewKeys.MainView, this);
// 初始化二次确认自动发送倒计时器
//InitAutoSendTimer();
InitAutoSendTimer();
//_autoSend_Timer.Stop();
//_autoSend_Timer.Start();
......@@ -204,7 +204,7 @@ namespace VIZ.FGOUT.Module
//ApplicationDomain.MessageManager.Register<ReplayEndValueModel>(this, this.ReplayEndValueFromNDIViewModel);
//接收自动发送消息
ApplicationDomain.MessageManager.Register<AutoSendModel>(this, this.AutoSendIntervalTimeChanged);
//ApplicationDomain.MessageManager.Register<AutoSendModel>(this, this.AutoSendIntervalTimeChanged);
//接收更新主页面Title体育项目名和位置标记消息
ApplicationDomain.MessageManager.Register<UpdateTitleAndPositionMarkModel>(this, this.UpdateTitleAndPositionMarkMethod);
......@@ -312,47 +312,55 @@ namespace VIZ.FGOUT.Module
#region 自动发送倒计时器
//private System.Timers.Timer _autoSend_Timer = new System.Timers.Timer();
//private int _tempAutoSendCount = 4;
////刷新界面控件
////public void Refresh()
////{
//// DispatcherFrame frame = new DispatcherFrame();
//// Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
//// new DispatcherOperationCallback(delegate (object f)
//// {
//// ((DispatcherFrame)f).Continue = false;
//// return null;
//// }
//// ), frame);
//// Dispatcher.PushFrame(frame);
////}
//public void InitAutoSendTimer()
//{
// _autoSend_Timer.Interval = 1000;
// _autoSend_Timer.Elapsed += UpdateAutoSendTimer_Tick;
//}
private System.Timers.Timer _autoSend_Timer = new System.Timers.Timer();
//private void UpdateAutoSendTimer_Tick(object sender, EventArgs e)
//刷新界面控件
//public void Refresh()
//{
// try
// {
// WPFHelper.BeginInvoke(() =>
// {
// if (AutoSendCount == 1)
// AutoSendCount = _tempAutoSendCount;
// AutoSendCount--;
// });
// }
// catch (Exception ex)
// DispatcherFrame frame = new DispatcherFrame();
// Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
// new DispatcherOperationCallback(delegate (object f)
// {
// log.Error(ex);
// ((DispatcherFrame)f).Continue = false;
// return null;
// }
// ), frame);
// Dispatcher.PushFrame(frame);
//}
public void InitAutoSendTimer()
{
_autoSend_Timer.Interval = 1000;
_autoSend_Timer.Elapsed += UpdateAutoSendTimer_Tick;
}
private void StartAutoSendTimer()
{
AutoSendCount = AutoSendIntervalTime - 1;
var minus = NDIViewModel.EndTime - NDIViewModel.StartTime;
if (minus > 0)
Task.Delay((int)minus * 2).Wait();
_autoSend_Timer.Stop();
_autoSend_Timer.Start();
}
private void UpdateAutoSendTimer_Tick(object sender, EventArgs e)
{
try
{
WPFHelper.BeginInvoke(() =>
{
if (AutoSendCount == 1)
_autoSend_Timer.Stop();
AutoSendCount--;
});
}
catch (Exception ex)
{
log.Error(ex);
}
}
#endregion
#region 发送算法参数相关
......@@ -992,7 +1000,7 @@ namespace VIZ.FGOUT.Module
var text = tb.Text;
if (int.TryParse(text, out var value) && value > 0)
{
_reconfirmAutoSendIntervalTimeModel.IntervalTime = value;
AutoSendCount = _reconfirmAutoSendIntervalTimeModel.IntervalTime = value;
ApplicationDomain.MessageManager.Send(_reconfirmAutoSendIntervalTimeModel);
}
}
......@@ -1178,8 +1186,8 @@ namespace VIZ.FGOUT.Module
var replayModel = new ReplayModel() { IsReplay = false };
ApplicationDomain.MessageManager.Send(replayModel);
//_initialValue = SliderMaxValue;
StartTime = 0;
EndTime = 0;
//StartTime = 0;
//EndTime = 0;
var managerAlgorithm = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
if (managerAlgorithm == null) return;
......@@ -1242,21 +1250,21 @@ namespace VIZ.FGOUT.Module
public ReplayStartModel replayStartModel = new ReplayStartModel();
private void ReplayStart()
{
//if (StartTime == 0)
//{
// MessageBoxEx.ShowDialog("请选择入点.");
// return;
//}
//if (EndTime == 0)
//{
// MessageBoxEx.ShowDialog("请选择出点.");
// return;
//}
//if (EndTime <= StartTime)
//{
// MessageBoxEx.ShowDialog("出点应大于入点.");
// return;
//}
if (NDIViewModel.StartTime == 0)
{
MessageBoxEx.ShowDialog("请选择入点.");
return;
}
if (NDIViewModel.EndTime == 0)
{
MessageBoxEx.ShowDialog("请选择出点.");
return;
}
if (NDIViewModel.EndTime <= NDIViewModel.StartTime)
{
MessageBoxEx.ShowDialog("出点应大于入点.");
return;
}
ApplicationDomain.MessageManager.Send(replayStartModel);
......@@ -1277,6 +1285,8 @@ namespace VIZ.FGOUT.Module
//manager.SendJson(replayPackage);
//MessageBoxEx.ShowDialog("Replay Start OK.");
StartAutoSendTimer();
}
public VCommand InPointCommand { get; set; }
......@@ -1293,33 +1303,33 @@ namespace VIZ.FGOUT.Module
ApplicationDomain.MessageManager.Send(replayOutPointModel);
}
private long _start_time;
/// <summary>
/// 开始时间戳
/// </summary>
public long StartTime
{
get => _start_time;
set
{
_start_time = value;
this.RaisePropertyChanged(nameof(StartTime));
}
}
//private long _start_time;
///// <summary>
///// 开始时间戳
///// </summary>
//public long StartTime
//{
// get => _start_time;
// set
// {
// _start_time = value;
// this.RaisePropertyChanged(nameof(StartTime));
// }
//}
private long _end_time;
/// <summary>
/// 结束时间戳
/// </summary>
public long EndTime
{
get => _end_time;
set
{
_end_time = value;
this.RaisePropertyChanged(nameof(EndTime));
}
}
//private long _end_time;
///// <summary>
///// 结束时间戳
///// </summary>
//public long EndTime
//{
// get => _end_time;
// set
// {
// _end_time = value;
// this.RaisePropertyChanged(nameof(EndTime));
// }
//}
#endregion
......
......@@ -242,21 +242,21 @@ namespace VIZ.FGOUT.Module
var managerAlgorithm = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
if (managerAlgorithm == null) return;
if (StartTime == 0)
{
MessageBoxEx.ShowDialog("请选择入点.");
return;
}
if (EndTime == 0)
{
MessageBoxEx.ShowDialog("请选择出点.");
return;
}
if (EndTime <= StartTime)
{
MessageBoxEx.ShowDialog("出点应大于入点.");
return;
}
//if (StartTime == 0)
//{
// MessageBoxEx.ShowDialog("请选择入点.");
// return;
//}
//if (EndTime == 0)
//{
// MessageBoxEx.ShowDialog("请选择出点.");
// return;
//}
//if (EndTime <= StartTime)
//{
// MessageBoxEx.ShowDialog("出点应大于入点.");
// return;
//}
List<List<List<int>>> inPoints = new List<List<List<int>>>();
bool isInPoint = false;
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E68896CD9B0EB8F47AE18FC2FB622EA1F7A6137510BF365CF7C39234496524DB"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "5CFFE3E9A5115F8CA83E4D3B67097DEF4559AC2B8462D768121E586DC89E2AA6"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E68896CD9B0EB8F47AE18FC2FB622EA1F7A6137510BF365CF7C39234496524DB"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "5CFFE3E9A5115F8CA83E4D3B67097DEF4559AC2B8462D768121E586DC89E2AA6"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......
......@@ -10,11 +10,11 @@ none
false
DEBUG;TRACE
24-1226537834
4-1529606353
95-2032219709
151915249285
241325682082
4-699044453
951167816992
151674092382
NDIMainView\View\NDIMainView.xaml;NDIPreviewView\View\NDIPreviewView.xaml;NDISettingView\View\AlgorithmSettingPanelView.xaml;NDISettingView\View\Algorithm\AlgorithmCablewayPanelView.xaml;NDISettingView\View\Algorithm\AlgorithmNearPanelView.xaml;NDISettingView\View\Algorithm\AlgorithmSinglePanelView.xaml;NDISettingView\View\Algorithm\AlgorithmSixteenPanelView.xaml;NDISettingView\View\Algorithm\AlgorithmTacticsPanelView.xaml;NDISettingView\View\NDISettingPanelView.xaml;NDISettingView\View\NDISettingView.xaml;NDIView\View\NDIView.xaml;SystemSetting\View\AboutPanelView.xaml;SystemSetting\View\CheckDataPanelView.xaml;SystemSetting\View\HotkeySettingPanelView.xaml;SystemSetting\View\MattingImagePanelView.xaml;SystemSetting\View\NewWindowView.xaml;SystemSetting\View\PackageSettingPanelView.xaml;SystemSetting\View\PreviewSettingPanelView.xaml;SystemSetting\View\ReplayPanelView.xaml;SystemSetting\View\StyleSettingPanelView.xaml;SystemSetting\View\SystemSettingView.xaml;SystemSetting\View\UEControlPanelView.xaml;SystemSetting\View\UESettingPanelView.xaml;Themes\SliderArrange.xaml;
True
False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment