Commit 3b9da37e by 鲁志-悦动

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

parent b5e17edf
...@@ -805,17 +805,17 @@ ...@@ -805,17 +805,17 @@
</b:EventTrigger> </b:EventTrigger>
</b:Interaction.Triggers> </b:Interaction.Triggers>
</TextBox> </TextBox>
<!--<TextBox <TextBox
Width="30" Width="30"
Background="Yellow" Background="Yellow"
BorderBrush="Red" BorderBrush="Red"
BorderThickness="2" BorderThickness="2"
FontSize="14" FontSize="14"
Foreground="Black" Foreground="Black"
IsEnabled="False" IsEnabled="False"
Style="{StaticResource TextBoxStyle}" Style="{StaticResource TextBoxStyle}"
Text="{Binding AutoSendCount}" />--> Text="{Binding AutoSendCount}" />
<TextBlock <!--<TextBlock
Width="30" Width="30"
Height="30" Height="30"
Padding="0,6,0,0" Padding="0,6,0,0"
...@@ -841,7 +841,7 @@ ...@@ -841,7 +841,7 @@
NumText="{Binding AutoSendIntervalTime}" NumText="{Binding AutoSendIntervalTime}"
TempNumText="{Binding AutoSendIntervalTime}" TempNumText="{Binding AutoSendIntervalTime}"
TextAlignment="Center" TextAlignment="Center"
Visibility="{Binding TimeCountActVisibility}" /> Visibility="{Binding TimeCountActVisibility}" />-->
</StackPanel> </StackPanel>
</Border> </Border>
......
...@@ -52,7 +52,7 @@ namespace VIZ.FGOUT.Module ...@@ -52,7 +52,7 @@ namespace VIZ.FGOUT.Module
ApplicationDomainEx.ServiceManager.AddService(NDIMainViewKeys.MainView, this); ApplicationDomainEx.ServiceManager.AddService(NDIMainViewKeys.MainView, this);
// 初始化二次确认自动发送倒计时器 // 初始化二次确认自动发送倒计时器
//InitAutoSendTimer(); InitAutoSendTimer();
//_autoSend_Timer.Stop(); //_autoSend_Timer.Stop();
//_autoSend_Timer.Start(); //_autoSend_Timer.Start();
...@@ -204,7 +204,7 @@ namespace VIZ.FGOUT.Module ...@@ -204,7 +204,7 @@ namespace VIZ.FGOUT.Module
//ApplicationDomain.MessageManager.Register<ReplayEndValueModel>(this, this.ReplayEndValueFromNDIViewModel); //ApplicationDomain.MessageManager.Register<ReplayEndValueModel>(this, this.ReplayEndValueFromNDIViewModel);
//接收自动发送消息 //接收自动发送消息
ApplicationDomain.MessageManager.Register<AutoSendModel>(this, this.AutoSendIntervalTimeChanged); //ApplicationDomain.MessageManager.Register<AutoSendModel>(this, this.AutoSendIntervalTimeChanged);
//接收更新主页面Title体育项目名和位置标记消息 //接收更新主页面Title体育项目名和位置标记消息
ApplicationDomain.MessageManager.Register<UpdateTitleAndPositionMarkModel>(this, this.UpdateTitleAndPositionMarkMethod); ApplicationDomain.MessageManager.Register<UpdateTitleAndPositionMarkModel>(this, this.UpdateTitleAndPositionMarkMethod);
...@@ -312,47 +312,55 @@ namespace VIZ.FGOUT.Module ...@@ -312,47 +312,55 @@ namespace VIZ.FGOUT.Module
#region 自动发送倒计时器 #region 自动发送倒计时器
//private System.Timers.Timer _autoSend_Timer = new System.Timers.Timer(); 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 void UpdateAutoSendTimer_Tick(object sender, EventArgs e) //刷新界面控件
//public void Refresh()
//{ //{
// try // DispatcherFrame frame = new DispatcherFrame();
// { // Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
// WPFHelper.BeginInvoke(() => // new DispatcherOperationCallback(delegate (object f)
// { // {
// if (AutoSendCount == 1) // ((DispatcherFrame)f).Continue = false;
// AutoSendCount = _tempAutoSendCount; // return null;
// AutoSendCount--; // }
// }); // ), frame);
// } // Dispatcher.PushFrame(frame);
// catch (Exception ex)
// {
// log.Error(ex);
// }
//} //}
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 #endregion
#region 发送算法参数相关 #region 发送算法参数相关
...@@ -992,7 +1000,7 @@ namespace VIZ.FGOUT.Module ...@@ -992,7 +1000,7 @@ namespace VIZ.FGOUT.Module
var text = tb.Text; var text = tb.Text;
if (int.TryParse(text, out var value) && value > 0) if (int.TryParse(text, out var value) && value > 0)
{ {
_reconfirmAutoSendIntervalTimeModel.IntervalTime = value; AutoSendCount = _reconfirmAutoSendIntervalTimeModel.IntervalTime = value;
ApplicationDomain.MessageManager.Send(_reconfirmAutoSendIntervalTimeModel); ApplicationDomain.MessageManager.Send(_reconfirmAutoSendIntervalTimeModel);
} }
} }
...@@ -1178,8 +1186,8 @@ namespace VIZ.FGOUT.Module ...@@ -1178,8 +1186,8 @@ namespace VIZ.FGOUT.Module
var replayModel = new ReplayModel() { IsReplay = false }; var replayModel = new ReplayModel() { IsReplay = false };
ApplicationDomain.MessageManager.Send(replayModel); ApplicationDomain.MessageManager.Send(replayModel);
//_initialValue = SliderMaxValue; //_initialValue = SliderMaxValue;
StartTime = 0; //StartTime = 0;
EndTime = 0; //EndTime = 0;
var managerAlgorithm = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1); var managerAlgorithm = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
if (managerAlgorithm == null) return; if (managerAlgorithm == null) return;
...@@ -1242,21 +1250,21 @@ namespace VIZ.FGOUT.Module ...@@ -1242,21 +1250,21 @@ namespace VIZ.FGOUT.Module
public ReplayStartModel replayStartModel = new ReplayStartModel(); public ReplayStartModel replayStartModel = new ReplayStartModel();
private void ReplayStart() private void ReplayStart()
{ {
//if (StartTime == 0) if (NDIViewModel.StartTime == 0)
//{ {
// MessageBoxEx.ShowDialog("请选择入点."); MessageBoxEx.ShowDialog("请选择入点.");
// return; return;
//} }
//if (EndTime == 0) if (NDIViewModel.EndTime == 0)
//{ {
// MessageBoxEx.ShowDialog("请选择出点."); MessageBoxEx.ShowDialog("请选择出点.");
// return; return;
//} }
//if (EndTime <= StartTime) if (NDIViewModel.EndTime <= NDIViewModel.StartTime)
//{ {
// MessageBoxEx.ShowDialog("出点应大于入点."); MessageBoxEx.ShowDialog("出点应大于入点.");
// return; return;
//} }
ApplicationDomain.MessageManager.Send(replayStartModel); ApplicationDomain.MessageManager.Send(replayStartModel);
...@@ -1277,6 +1285,8 @@ namespace VIZ.FGOUT.Module ...@@ -1277,6 +1285,8 @@ namespace VIZ.FGOUT.Module
//manager.SendJson(replayPackage); //manager.SendJson(replayPackage);
//MessageBoxEx.ShowDialog("Replay Start OK."); //MessageBoxEx.ShowDialog("Replay Start OK.");
StartAutoSendTimer();
} }
public VCommand InPointCommand { get; set; } public VCommand InPointCommand { get; set; }
...@@ -1293,33 +1303,33 @@ namespace VIZ.FGOUT.Module ...@@ -1293,33 +1303,33 @@ namespace VIZ.FGOUT.Module
ApplicationDomain.MessageManager.Send(replayOutPointModel); ApplicationDomain.MessageManager.Send(replayOutPointModel);
} }
private long _start_time; //private long _start_time;
/// <summary> ///// <summary>
/// 开始时间戳 ///// 开始时间戳
/// </summary> ///// </summary>
public long StartTime //public long StartTime
{ //{
get => _start_time; // get => _start_time;
set // set
{ // {
_start_time = value; // _start_time = value;
this.RaisePropertyChanged(nameof(StartTime)); // this.RaisePropertyChanged(nameof(StartTime));
} // }
} //}
private long _end_time; //private long _end_time;
/// <summary> ///// <summary>
/// 结束时间戳 ///// 结束时间戳
/// </summary> ///// </summary>
public long EndTime //public long EndTime
{ //{
get => _end_time; // get => _end_time;
set // set
{ // {
_end_time = value; // _end_time = value;
this.RaisePropertyChanged(nameof(EndTime)); // this.RaisePropertyChanged(nameof(EndTime));
} // }
} //}
#endregion #endregion
......
...@@ -242,21 +242,21 @@ namespace VIZ.FGOUT.Module ...@@ -242,21 +242,21 @@ namespace VIZ.FGOUT.Module
var managerAlgorithm = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1); var managerAlgorithm = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
if (managerAlgorithm == null) return; if (managerAlgorithm == null) return;
if (StartTime == 0) //if (StartTime == 0)
{ //{
MessageBoxEx.ShowDialog("请选择入点."); // MessageBoxEx.ShowDialog("请选择入点.");
return; // return;
} //}
if (EndTime == 0) //if (EndTime == 0)
{ //{
MessageBoxEx.ShowDialog("请选择出点."); // MessageBoxEx.ShowDialog("请选择出点.");
return; // return;
} //}
if (EndTime <= StartTime) //if (EndTime <= StartTime)
{ //{
MessageBoxEx.ShowDialog("出点应大于入点."); // MessageBoxEx.ShowDialog("出点应大于入点.");
return; // return;
} //}
List<List<List<int>>> inPoints = new List<List<List<int>>>(); List<List<List<int>>> inPoints = new List<List<List<int>>>();
bool isInPoint = false; 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> // <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> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
...@@ -10,11 +10,11 @@ none ...@@ -10,11 +10,11 @@ none
false false
DEBUG;TRACE DEBUG;TRACE
24-1226537834 241325682082
4-1529606353 4-699044453
95-2032219709 951167816992
151915249285 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; 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