Commit bb72eb1a by 鲁志-悦动

主页面发送全部算法参数 And 挂起、重置、继续加快捷键

parent 7f486ba9
......@@ -169,13 +169,13 @@ C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\bin\x64\Debug\AltaxoCore.pdb
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\bin\x64\Debug\AltaxoCore.xml
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\bin\x64\Debug\Newtonsoft.Json.xml
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\VIZ.FGOUT.Common.csproj.AssemblyReference.cache
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\VIZ.FGOUT.Common_MarkupCompile.cache
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\VIZ.FGOUT.Common_MarkupCompile.lref
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\Themes\Generic.baml
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\Widgets\FootballFieldPanel\FootballFieldPanel.baml
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\VIZ.FGOUT.Common.g.resources
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\VIZ.FGOUT.Common.csproj.CoreCompileInputs.cache
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\VIZ.FGOUT.Common.dll
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\VIZ.FGOUT.Common.pdb
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\VIZ.FGOU.2BB051D9.Up2Date
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\Themes\Generic.baml
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\Widgets\FootballFieldPanel\FootballFieldPanel.baml
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\VIZ.FGOUT.Common.g.resources
using System.Collections.Generic;
namespace VIZ.FGOUT.Connection
namespace VIZ.FGOUT.Connection
{
/// <summary>
......
......@@ -65,6 +65,21 @@
/// <summary>
/// 发送
/// </summary>
Send
Send,
/// <summary>
/// HoldON
/// </summary>
HoldOn,
/// <summary>
/// Reset
/// </summary>
Reset,
/// <summary>
/// GoOn
/// </summary>
GoOn
}
}
......@@ -10,11 +10,11 @@ none
false
DEBUG;TRACE
221979955803
1470602451
11-350624472
24-1321085892
22-1578589972
1-1441241311
11-1602666439
23-2035776870
Resources\StringResource.zh-CN.xaml;Resources\StringResource.en.xaml;Style\Button\Button_NdiView.xaml;Style\Button\Button_Setting.xaml;Style\Button\Button_WindowTop.xaml;Style\CheckBox\CheckBox_NdiView.xaml;Style\CheckBox\CheckBox_RaidoButtonStyle.xaml;Style\CheckBox\CheckBox_Setting.xaml;Style\CheckBox\CheckBox_WindowTop.xaml;Style\ComboBox\ComboBox_Setting.xaml;Style\HotkeyBox\HotkeyBox_Setting.xaml;Style\MessageBox\MessageBoxEx.xaml;Style\RadioButton\RadioButton_FootballSide.xaml;Style\RadioButton\RadioButton_NdiMainViewBlue.xaml;Style\RadioButton\RadioButton_NdiView.xaml;Style\RadioButton\RadioButton_Setting.xaml;Style\Slider\Slider_Setting.xaml;Style\TextBlock\TextBlock_Setting.xaml;Style\TextBox\TextBox_Setting.xaml;Style\ToogleButton\ToogleButton_Setting.xaml;Themes\Generic.xaml;Toolkit\NumericUpDown\NumericUpDown.xaml;
False
True
......@@ -242,6 +242,24 @@ namespace VIZ.FGOUT.Module
return AssembleNDIMainViewHotkeyMode(NDIMainViewHotkeys.Send);
}
//HoldOn
if (string.Equals(this.Support.HotkeyConfig.HoldOn, hotkey))
{
return AssembleNDIMainViewHotkeyMode(NDIMainViewHotkeys.HoldOn);
}
//Rest
if (string.Equals(this.Support.HotkeyConfig.Reset, hotkey))
{
return AssembleNDIMainViewHotkeyMode(NDIMainViewHotkeys.Reset);
}
//GoOn
if (string.Equals(this.Support.HotkeyConfig.GoOn, hotkey))
{
return AssembleNDIMainViewHotkeyMode(NDIMainViewHotkeys.GoOn);
}
//位置标记删除命令
//if (string.Equals("Ctrl + Z", hotkey) || string.Equals(this.Support.HotkeyConfig.Delete, hotkey))
if (string.Equals(this.Support.HotkeyConfig.Delete, hotkey))
......
......@@ -7,6 +7,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Interop;
using VIZ.FGOUT.Connection;
using VIZ.FGOUT.Connection.UDP.Clip.Signal.Send;
......@@ -17,6 +18,7 @@ using VIZ.Framework.Common;
using VIZ.Framework.Connection;
using VIZ.Framework.Core;
using VIZ.Framework.Domain;
using Application = System.Windows.Application;
namespace VIZ.FGOUT.Module
{
......@@ -486,33 +488,47 @@ namespace VIZ.FGOUT.Module
private void AlgorithmSend()
{
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
if (manager == null)
return;
AlgorithmPackage_Figout_sports_model package = new AlgorithmPackage_Figout_sports_model
{
Matting_interval = Matting_interval,
Moving_pixel = Moving_pixel,
Is_Big_Model = IsBigModel
};
manager.SendJson(package);
MessageBoxEx.ShowDialog("算法参数保存成功。");
//存算法数据
if (manager == null) return;
var number = ApplicationDomainEx.LiteDbContext.ViewConfig.FindOne(p => p.ViewKey == NDIViewKeys.CAM_1)
.GameName;
if (!string.IsNullOrEmpty(number))
{
var config = ApplicationDomainEx.LiteDbContext.JavelinThrowConfig.FindOne(p => p.Number == number);
if (config == null) return;
//拿出来,更新修改数据,再放回去
var alPackage =
(AlgorithmPackage_Figout_sports_model)JsonConvert.DeserializeObject(config.AlgorithmData,
typeof(AlgorithmPackage_Figout_sports_model));
//拿出来,更新修改数据
var alPackage = (AlgorithmPackage_Figout_sports_model)JsonConvert.DeserializeObject(config.AlgorithmData, typeof(AlgorithmPackage_Figout_sports_model));
if(alPackage == null) return;
alPackage.Matting_interval = Matting_interval;
alPackage.Moving_pixel = Moving_pixel;
alPackage.Is_Big_Model = IsBigModel;
var _algorithmMessage = alPackage == null ? string.Empty : JsonConvert.SerializeObject(alPackage, JSON_SERIALIZER_SETTINGS);
config.AlgorithmData = _algorithmMessage;
// AlgorithmPackage_Figout_sports_model package = new AlgorithmPackage_Figout_sports_model
//{
// Matting_interval = Matting_interval,
// Moving_pixel = Moving_pixel,
// Is_Big_Model = IsBigModel,
// SportsCode = number
//};
//发送给算法
manager.SendJson(alPackage);
MessageBoxEx.ShowDialog("算法参数保存成功。");
//存算法数据
//if (!string.IsNullOrEmpty(number))
//{
// var config = ApplicationDomainEx.LiteDbContext.JavelinThrowConfig.FindOne(p => p.Number == number);
// if (config == null) return;
// //拿出来,更新修改数据,再放回去
// var alPackage =
// (AlgorithmPackage_Figout_sports_model)JsonConvert.DeserializeObject(config.AlgorithmData,
// typeof(AlgorithmPackage_Figout_sports_model));
// alPackage.Matting_interval = Matting_interval;
// alPackage.Moving_pixel = Moving_pixel;
// alPackage.Is_Big_Model = IsBigModel;
//再放回去
var algorithmMessage = JsonConvert.SerializeObject(alPackage, JSON_SERIALIZER_SETTINGS);
config.AlgorithmData = algorithmMessage;
ApplicationDomainEx.LiteDbContext.JavelinThrowConfig.Upsert(config);
}
......@@ -1882,7 +1898,9 @@ namespace VIZ.FGOUT.Module
}
DateTime _startDt = DateTime.Now;
//DateTime _endDt = DateTime.Now;
DateTime _prestartDt = DateTime.Now;
DateTime _endDt = DateTime.Now;
private int _minis = 400;
private int _sliderStartValue = 0;
public int SliderStartValue
......@@ -1890,18 +1908,24 @@ namespace VIZ.FGOUT.Module
get => (int)_sliderStartValue;
set
{
//if ((DateTime.Now - _prestartDt).TotalMilliseconds < _minis) return;
//var nowDt = _prestartDt = DateTime.Now;
//if ((nowDt - _startDt).TotalMilliseconds < _minis) return;
//var minus = (nowDt - _startDt).TotalMilliseconds;
var nowDt = DateTime.Now;
var minus = (nowDt - _startDt).TotalMilliseconds;
if (minus > 450)
var minus = (nowDt - _endDt).TotalMilliseconds;
if (minus > _minis)
{
if (!_isReplayChecked)
{
_sliderStartValue = value;
this.RaisePropertyChanged(nameof(SliderStartValue));
var replayModel = new ReplayModel() { IsReplay = true, IsStartValue = true, SliderValue = value };
ApplicationDomain.MessageManager.Send(replayModel);
}
if (!_isReplayChecked)
{
_sliderStartValue = value;
this.RaisePropertyChanged(nameof(SliderStartValue));
var replayModel = new ReplayModel() { IsReplay = true, IsStartValue = true, SliderValue = value };
ApplicationDomain.MessageManager.Send(replayModel);
}
}
_startDt = DateTime.Now;
//log.Info("StartValue =" + _sliderStartValue);
}
}
......@@ -1912,9 +1936,14 @@ namespace VIZ.FGOUT.Module
get => _sliderEndValue;
set
{
//if ((DateTime.Now - _prestartDt).TotalMilliseconds < _minis) return;
//var nowDt = _prestartDt = DateTime.Now;
//if ((nowDt - _endDt).TotalMilliseconds < _minis) return;
//log.Info("EndValue =" + _sliderEndValue);
var nowDt = DateTime.Now;
var minus = (nowDt - _startDt).TotalMilliseconds;
if (minus > 450)
if (minus > _minis)
{
if (!_isReplayChecked)
{
......@@ -1925,6 +1954,7 @@ namespace VIZ.FGOUT.Module
ApplicationDomain.MessageManager.Send(replayModel);
}
}
_endDt = DateTime.Now;
}
}
......@@ -2353,25 +2383,36 @@ namespace VIZ.FGOUT.Module
{
SliderEndValue = NDIViewModel.SliderEndValue;
_isDown = true;
_startDt = DateTime.Now;
//_startDt = DateTime.Now;
_endDt = DateTime.Now;
}
//左
else if (context.hotkey.Equals(NDIMainViewHotkeys.Left))
{
if (_isDown)
{
NDIViewModel.SliderEndValue = --SliderEndValue;
_endDt = DateTime.Now;
}
else
{
NDIViewModel.SliderStartValue = --SliderStartValue;
_startDt = DateTime.Now;
_startDt = DateTime.Now;
}
}
//右
else if (context.hotkey.Equals(NDIMainViewHotkeys.Right))
{
if (_isDown)
{
NDIViewModel.SliderEndValue = ++SliderEndValue;
_endDt = DateTime.Now;
}
else
{
NDIViewModel.SliderStartValue = ++SliderStartValue;
_startDt = DateTime.Now;
_startDt = DateTime.Now;
}
}
//Replay Start
else if (context.hotkey.Equals(NDIMainViewHotkeys.ReplayStart))
......@@ -2405,6 +2446,21 @@ namespace VIZ.FGOUT.Module
{
Send();
}
//HoldOn
else if (context.hotkey.Equals(NDIMainViewHotkeys.HoldOn))
{
Holdon();
}
//Reset
else if (context.hotkey.Equals(NDIMainViewHotkeys.Reset))
{
Reset();
}
//GoOn
else if (context.hotkey.Equals(NDIMainViewHotkeys.GoOn))
{
GoOn();
}
}
}
}
......@@ -35,7 +35,7 @@
<Grid Margin="45,60,40,0">
<Grid.RowDefinitions>
<RowDefinition Height="60" />
<RowDefinition Height="350" />
<RowDefinition Height="450" />
</Grid.RowDefinitions>
<!-- 算法裁切快捷键 -->
<!--<TextBlock
......@@ -61,6 +61,8 @@
<RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120" />
......@@ -279,6 +281,54 @@
Hotkey="{Binding Path=SendCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" />
<!-- 挂起 -->
<TextBlock
Grid.Row="7"
Grid.Column="0"
VerticalAlignment="Center"
FontSize="18"
Foreground="White"
Text="{DynamicResource HoldOn}" />
<fcommon:HotkeyBox
Grid.Row="7"
Grid.Column="1"
Height="30"
Margin="0,0,20,0"
Hotkey="{Binding Path=HoldOnCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" />
<!-- 重置 -->
<TextBlock
Grid.Row="7"
Grid.Column="2"
VerticalAlignment="Center"
FontSize="18"
Foreground="White"
Text="{DynamicResource Reset}" />
<fcommon:HotkeyBox
Grid.Row="7"
Grid.Column="3"
Height="30"
Margin="0,0,20,0"
Hotkey="{Binding Path=ResetCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" />
<!-- 继续 -->
<TextBlock
Grid.Row="8"
Grid.Column="0"
VerticalAlignment="Center"
FontSize="18"
Foreground="White"
Text="{DynamicResource GoOn}" />
<fcommon:HotkeyBox
Grid.Row="8"
Grid.Column="1"
Height="30"
Margin="0,0,20,0"
Hotkey="{Binding Path=GoOnCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" />
<!-- CAM 3 -->
<!--<TextBlock Text="CAM 3" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="1"></TextBlock>
......
......@@ -295,7 +295,6 @@ namespace VIZ.FGOUT.Module
#endregion
#region 清除选区快捷键
private string _cleanInPointCmd;
......@@ -316,6 +315,66 @@ namespace VIZ.FGOUT.Module
#endregion
#region HoldOn快捷键
private string _holdOnCmd;
/// <summary>
/// Send快捷键
/// </summary>
[HotkeyProperty]
public string HoldOnCmd
{
get { return _holdOnCmd; }
set
{
_holdOnCmd = value;
this.RaisePropertyChanged(nameof(HoldOnCmd));
this.CheckHotkey(nameof(HoldOnCmd), value);
}
}
#endregion
#region Reset快捷键
private string _resetCmd;
/// <summary>
/// Send快捷键
/// </summary>
[HotkeyProperty]
public string ResetCmd
{
get { return _resetCmd; }
set
{
_resetCmd = value;
this.RaisePropertyChanged(nameof(ResetCmd));
this.CheckHotkey(nameof(ResetCmd), value);
}
}
#endregion
#region GoOn快捷键
private string _goOnCmd;
/// <summary>
/// Send快捷键
/// </summary>
[HotkeyProperty]
public string GoOnCmd
{
get { return _goOnCmd; }
set
{
_goOnCmd = value;
this.RaisePropertyChanged(nameof(GoOnCmd));
this.CheckHotkey(nameof(GoOnCmd), value);
}
}
#endregion
// ======================================================================================
// === Commond ===
// ======================================================================================
......@@ -352,6 +411,9 @@ namespace VIZ.FGOUT.Module
this.CleanInPointCmd = this.HotkeyConfig.CleanInPoint;
this.AbandonCmd = this.HotkeyConfig.Abandon;
this.SendCmd = this.HotkeyConfig.Send;
this.GoOnCmd = this.HotkeyConfig.GoOn;
this.HoldOnCmd = this.HotkeyConfig.HoldOn;
this.ResetCmd = this.HotkeyConfig.Reset;
}
#endregion
......@@ -404,6 +466,15 @@ namespace VIZ.FGOUT.Module
if(this.SendCmd != this.HotkeyConfig.Send)
return true;
if(this.HoldOnCmd != this.HotkeyConfig.HoldOn)
return true;
if(this.ResetCmd != this.HotkeyConfig.Reset)
return true;
if(this.GoOnCmd != this.HotkeyConfig.GoOn)
return true;
//// 算法裁切
//if (this.AutoCAM1 != this.HotkeyConfig.AutoCAM1)
// return true;
......@@ -474,6 +545,9 @@ namespace VIZ.FGOUT.Module
this.HotkeyConfig.CleanInPoint = CleanInPointCmd;
this.HotkeyConfig.Abandon = AbandonCmd;
this.HotkeyConfig.Send = SendCmd;
this.HotkeyConfig.HoldOn = HoldOnCmd;
this.HotkeyConfig.Reset = ResetCmd;
this.HotkeyConfig.GoOn = GoOnCmd;
// 更新配置
ApplicationDomainEx.LiteDbContext.HotkeyConfig.Upsert(this.HotkeyConfig);
......@@ -483,7 +557,6 @@ namespace VIZ.FGOUT.Module
{
service.HotkeyConfig = this.HotkeyConfig;
}
return true;
//// 算法裁切
......
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace VIZ.FGOUT.Module
{
......@@ -196,5 +198,6 @@ namespace VIZ.FGOUT.Module
//}
#endregion
}
}
#pragma checksum "..\..\..\..\..\SystemSetting\View\HotkeySettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F9D23A9A540816FB3B4B874A6BBC7272C616AF5F4E1823CCBC43886AD8725573"
#pragma checksum "..\..\..\..\..\SystemSetting\View\HotkeySettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "39CE2E5CCD4E33BACD83F8383CA4E06D6DB31D210B069559491556BAAB3012C3"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\SystemSetting\View\HotkeySettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F9D23A9A540816FB3B4B874A6BBC7272C616AF5F4E1823CCBC43886AD8725573"
#pragma checksum "..\..\..\..\..\SystemSetting\View\HotkeySettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "39CE2E5CCD4E33BACD83F8383CA4E06D6DB31D210B069559491556BAAB3012C3"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......

C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIMainView\View\NDIMainView.xaml;;
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;;
......
......@@ -62,5 +62,11 @@
public string Abandon { get; set; } = "P";
public string Send { get; set; } = "M";
public string HoldOn { get; set; } = "H";
public string Reset { get; set; } = "F";
public string GoOn { get; set; } = "G";
}
}
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