Commit 67469f5c by 马宁-艾果

UE控制预设详细放到NDI设置里,保存发送预设指令待完善

parent 250e174b
using System.Windows.Controls;
using System.Collections.Generic;
using System.Windows.Controls;
using VIZ.Framework.Core;
namespace VIZ.FGOUT.Module
......@@ -13,6 +14,8 @@ namespace VIZ.FGOUT.Module
InitializeComponent();
WPFHelper.BindingViewModel(this, new NDISettingPanelViewModel());
_Sports_.ItemsSource = new List<string>() { "跳远", "三级跳", "跳马", "标枪", "自由操", "单杠", "高低杠", "单人3m跳水", "单人10m跳水", "双人3m跳水", "双人10m跳水", "双人速度攀岩" };
}
}
}
......@@ -8,7 +8,7 @@
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:local="clr-namespace:VIZ.FGOUT.Module"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Width="800"
Width="900"
Height="800"
d:DataContext="{d:DesignInstance Type=local:NDISettingViewModel}"
mc:Ignorable="d">
......@@ -25,7 +25,6 @@
<behaviors:InvokeCommandAction Command="{Binding LoadedCommand}" />
</behaviors:EventTrigger>
</behaviors:Interaction.Triggers>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
......
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows.Data;
using VIZ.FGOUT.Connection.UDP.Clip.Signal.Send;
using VIZ.FGOUT.Domain;
using VIZ.FGOUT.Storage;
using VIZ.Framework.Common;
......@@ -21,6 +23,8 @@ namespace VIZ.FGOUT.Module
{
// 初始化命令
this.InitCommand();
this.PresetsSelectionChangedCommand = new VCommand(PresetsSelectionChanged);
}
/// <summary>
......@@ -472,5 +476,251 @@ namespace VIZ.FGOUT.Module
return model.IsLocalStream;
}
#region UE相关
//Dictionary<string, string> dics = new Dictionary<string, string> { { "JT", "Javelin Throw" }, { "TJ", "Triple Jump" }, { "LJ", "Long Jump" } };
Dictionary<string, string> dics = new Dictionary<string, string> { { "JT", "标枪" }, { "TJ", "三级跳" }, { "LJ", "跳远" } };
private JavelinThrowConfig GetConfig(string number)
{
var index = dics.Values.ToList().IndexOf(number);
var key = dics.Keys.ToList()[index];
return ApplicationDomainEx.LiteDbContext.JavelinThrowConfig.FindOne(p => p.Number == key);
}
private string _presetsItem;
public string PresetsItem
{
get => _presetsItem;
set
{
_presetsItem = value;
this.RaisePropertyChanged(nameof(PresetsItem));
}
}
public VCommand PresetsSelectionChangedCommand { get; set; }
private void PresetsSelectionChanged()
{
if (PresetsItem != null)
{
//反序列化
var uePackage = (UEPackage)JsonConvert.DeserializeObject(GetConfig(PresetsItem).Data, typeof(UEPackage));
var zoomSets = uePackage.UE_Presets.StartSets.ZoomSets;
ZoomEaseItem = zoomSets.ZoomEase;
MoveEaseItem = zoomSets.MoveEase;
Scale = zoomSets.Scale;
ZoomIn = zoomSets.ZoomIn;
ZoomOut = zoomSets.ZoomOut;
Move = zoomSets.Move;
SafeScale = zoomSets.SafeScale;
BMovementOnlyX = zoomSets.bMovementOnlyX;
MovementOnlyXPosition = zoomSets.MovementOnlyXPosition;
BMovementOnlyY = zoomSets.bMovementOnlyY;
MovementOnlyYPosition = zoomSets.MovementOnlyYPosition;
var enableStats = uePackage.UE_Presets.StartSets.EnableStats;
ShowHeight = enableStats.bShowHeight;
ShowSpeed = enableStats.bShowSpeed;
UseZoom = enableStats.bEnableZoom;
var splineSets = uePackage.UE_Presets.StartSets.SplineSets;
Line = splineSets.bLineBehind;
}
}
#region 预设属性
private string _zoomEaseItem = string.Empty;
public string ZoomEaseItem
{
get => _zoomEaseItem;
set
{
_zoomEaseItem = value;
this.RaisePropertyChanged(nameof(ZoomEaseItem));
}
}
private string _moveEaseItem = string.Empty;
public string MoveEaseItem
{
get => _moveEaseItem;
set
{
_moveEaseItem = value;
this.RaisePropertyChanged(nameof(MoveEaseItem));
}
}
private double _scale;
public double Scale
{
get => this._scale;
set
{
_scale = value;
this.RaisePropertyChanged(nameof(Scale));
}
}
private bool _line;
public bool Line
{
get => _line;
set
{
_line = value;
this.RaisePropertyChanged(nameof(Line));
}
}
private double _zoomIn;
public double ZoomIn
{
get => _zoomIn;
set
{
_zoomIn = value;
this.RaisePropertyChanged(nameof(ZoomIn));
}
}
private double _zoomOut;
public double ZoomOut
{
get => _zoomOut;
set
{
_zoomOut = value;
this.RaisePropertyChanged(nameof(ZoomOut));
}
}
private double _move;
public double Move
{
get => _move;
set
{
_move = value;
this.RaisePropertyChanged(nameof(Move));
}
}
private double _safeScale;
public double SafeScale
{
get => _safeScale;
set
{
_safeScale = value;
this.RaisePropertyChanged(nameof(SafeScale));
}
}
private bool _showHeight = true;
public bool ShowHeight
{
get => _showHeight;
set
{
_showHeight = value;
this.RaisePropertyChanged(nameof(ShowHeight));
}
}
private bool _showSpeed = true;
public bool ShowSpeed
{
get => _showSpeed;
set
{
_showSpeed = value;
this.RaisePropertyChanged(nameof(ShowSpeed));
}
}
private bool _useZoom = false;
public bool UseZoom
{
get => _useZoom;
set
{
_useZoom = value;
this.RaisePropertyChanged(nameof(UseZoom));
}
}
private bool _bEnableSpline;
public bool BEnableSpline
{
get => _bEnableSpline;
set
{
_bEnableSpline = value;
this.RaisePropertyChanged(nameof(BEnableSpline));
}
}
private bool _bMovementOnlyX;
public bool BMovementOnlyX
{
get => _bMovementOnlyX;
set
{
_bMovementOnlyX = value;
this.RaisePropertyChanged(nameof(BMovementOnlyX));
}
}
private bool _bMovementOnlyY;
public bool BMovementOnlyY
{
get => _bMovementOnlyY;
set
{
_bMovementOnlyY = value;
this.RaisePropertyChanged(nameof(BMovementOnlyY));
}
}
private int _movementOnlyXPosition;
public int MovementOnlyXPosition
{
get => _movementOnlyXPosition;
set
{
_movementOnlyXPosition = value;
this.RaisePropertyChanged(nameof(MovementOnlyXPosition));
}
}
private int _movementOnlyYPosition;
public int MovementOnlyYPosition
{
get => _movementOnlyYPosition;
set
{
_movementOnlyYPosition = value;
this.RaisePropertyChanged(nameof(MovementOnlyYPosition));
}
}
#endregion
#endregion
}
}
\ No newline at end of file
using System;
using log4net;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Common;
using VIZ.Framework.Core;
using VIZ.FGOUT.Domain;
using VIZ.FGOUT.Storage;
using log4net;
using VIZ.Framework.Common;
using VIZ.Framework.Core;
namespace VIZ.FGOUT.Module
{
......@@ -159,11 +155,9 @@ namespace VIZ.FGOUT.Module
/// </summary>
private void Loaded()
{
if (ApplicationDomainEx.ServiceManager.GetService<INDIViewService>(this.ViewKey) != null)
{
NdiViewConfig config = ApplicationDomainEx.ServiceManager.GetService<INDIViewService>(this.ViewKey).ViewConfig;
this.ViewConfig = config;
}
}
......
......@@ -8,8 +8,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="UE Control"
Width="{Binding WindowWidth, Mode=TwoWay}"
Height="450"
Width="370"
Height="400"
d:DataContext="{d:DesignInstance Type=local:UEControlPanelViewModel}"
Background="#383D41"
ResizeMode="NoResize"
......@@ -68,8 +68,8 @@
Content="X"
Style="{StaticResource Button_Setting_Close}" />
</DockPanel>
<StackPanel Height="410" Orientation="Horizontal">
<Grid Width="300" Margin="20,10,10,10">
<StackPanel Height="360" Orientation="Horizontal">
<Grid Width="360" Margin="30">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
......@@ -77,9 +77,9 @@
<RowDefinition />
<RowDefinition />
<RowDefinition />
<!--<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />-->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
......@@ -261,11 +261,11 @@
Content="后"
Style="{StaticResource ButtonStyle}" />
</StackPanel>-->
<TextBlock
<!--<TextBlock
Grid.Row="6"
Grid.Column="0"
Style="{StaticResource TextBlockStyle}"
Text="Sports" />
Text="Sports" />-->
<!--<StackPanel
Grid.Row="5"
Grid.Column="1"
......@@ -289,7 +289,7 @@
Content="{Binding DetailContent, Mode=TwoWay}"
Style="{StaticResource ButtonStyle}" />
</StackPanel>-->
<ComboBox
<!--<ComboBox
Grid.Row="6"
Grid.Column="1"
Width="100"
......@@ -317,9 +317,9 @@
Margin="5,0,0,0"
Command="{Binding SendPresetCommand}"
Content="Save"
Style="{StaticResource ButtonStyle}" />
Style="{StaticResource ButtonStyle}" />-->
</Grid>
<Grid
<!--<Grid
Width="600"
Margin="10,10,0,10"
Visibility="{Binding UESettingVisibility, Mode=TwoWay}">
......@@ -390,12 +390,14 @@
VerticalAlignment="Center"
Foreground="White"
Text="Curve:" />
<!--<ComboBox
-->
<!--<ComboBox
Grid.Row="1"
Grid.Column="3"
ItemsSource="{StaticResource LineFrontOrBehind}"
SelectedIndex="{Binding Line, Mode=TwoWay}"
Style="{StaticResource ComboBoxStyle}" />-->
<!--
<ToggleButton
Grid.Row="2"
Grid.Column="3"
......@@ -452,12 +454,14 @@
VerticalAlignment="Center"
Foreground="White"
Text="ShowHeight:" />
<!--<ComboBox
-->
<!--<ComboBox
Grid.Row="5"
Grid.Column="1"
ItemsSource="{StaticResource TrueOrFalse}"
SelectedIndex="{Binding ShowHeight, Mode=TwoWay}"
Style="{StaticResource ComboBoxStyle}" />-->
<!--
<ToggleButton
Grid.Row="5"
Grid.Column="1"
......@@ -469,12 +473,14 @@
VerticalAlignment="Center"
Foreground="White"
Text="ShowSpeed:" />
<!--<ComboBox
-->
<!--<ComboBox
Grid.Row="5"
Grid.Column="3"
ItemsSource="{StaticResource TrueOrFalse}"
SelectedIndex="{Binding ShowSpeed, Mode=TwoWay}"
Style="{StaticResource ComboBoxStyle}" />-->
<!--
<ToggleButton
Grid.Row="5"
Grid.Column="3"
......@@ -485,12 +491,14 @@
VerticalAlignment="Center"
Foreground="White"
Text="UseZoom:" />
<!--<ComboBox
-->
<!--<ComboBox
Grid.Row="6"
Grid.Column="1"
ItemsSource="{StaticResource TrueOrFalse}"
SelectedIndex="{Binding UseZoom, Mode=TwoWay}"
Style="{StaticResource ComboBoxStyle}" />-->
<!--
<ToggleButton
Grid.Row="6"
Grid.Column="1"
......@@ -501,12 +509,14 @@
VerticalAlignment="Center"
Foreground="White"
Text="MovementOnlyX:" />
<!--<ComboBox
-->
<!--<ComboBox
Grid.Row="7"
Grid.Column="1"
ItemsSource="{StaticResource IsEnable}"
SelectedIndex="{Binding BMovementOnlyX, Mode=TwoWay}"
Style="{StaticResource ComboBoxStyle}" />-->
<!--
<ToggleButton
x:Name="MovementOnlyX"
Grid.Row="7"
......@@ -525,12 +535,14 @@
VerticalAlignment="Center"
Foreground="White"
Text="MovementOnlyY:" />
<!--<ComboBox
-->
<!--<ComboBox
Grid.Row="8"
Grid.Column="1"
ItemsSource="{StaticResource IsEnable}"
SelectedIndex="{Binding BMovementOnlyY, Mode=TwoWay}"
Style="{StaticResource ComboBoxStyle}" />-->
<!--
<ToggleButton
x:Name="MovementOnlyY"
Grid.Row="8"
......@@ -551,7 +563,7 @@
Command="{Binding Path=SaveCommand}"
Content="Save"
Style="{StaticResource ButtonStyle}" />
</Grid>
</Grid>-->
</StackPanel>
</StackPanel>
</Window>
#pragma checksum "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "11798D054ECBBA54BDC424EE40D35FA03E049B3A139B570D423A5C0C197C4927"
#pragma checksum "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2EFBEF83ECF6C333C42475C005F3F9270F355FC545C4DE4E2C54DCD4FC7A4B22"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -62,6 +62,38 @@ namespace VIZ.FGOUT.Module {
/// </summary>
public partial class NDISettingPanelView : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 146 "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox _Sports_;
#line default
#line hidden
#line 231 "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Primitives.ToggleButton EnableSpline;
#line default
#line hidden
#line 363 "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Primitives.ToggleButton MovementOnlyX;
#line default
#line hidden
#line 389 "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Primitives.ToggleButton MovementOnlyY;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
......@@ -90,6 +122,21 @@ namespace VIZ.FGOUT.Module {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this._Sports_ = ((System.Windows.Controls.ComboBox)(target));
return;
case 2:
this.EnableSpline = ((System.Windows.Controls.Primitives.ToggleButton)(target));
return;
case 3:
this.MovementOnlyX = ((System.Windows.Controls.Primitives.ToggleButton)(target));
return;
case 4:
this.MovementOnlyY = ((System.Windows.Controls.Primitives.ToggleButton)(target));
return;
}
this._contentLoaded = true;
}
}
......
#pragma checksum "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "11798D054ECBBA54BDC424EE40D35FA03E049B3A139B570D423A5C0C197C4927"
#pragma checksum "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2EFBEF83ECF6C333C42475C005F3F9270F355FC545C4DE4E2C54DCD4FC7A4B22"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -62,6 +62,38 @@ namespace VIZ.FGOUT.Module {
/// </summary>
public partial class NDISettingPanelView : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 146 "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ComboBox _Sports_;
#line default
#line hidden
#line 231 "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Primitives.ToggleButton EnableSpline;
#line default
#line hidden
#line 363 "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Primitives.ToggleButton MovementOnlyX;
#line default
#line hidden
#line 389 "..\..\..\..\..\NDISettingView\View\NDISettingPanelView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Primitives.ToggleButton MovementOnlyY;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
......@@ -90,6 +122,21 @@ namespace VIZ.FGOUT.Module {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this._Sports_ = ((System.Windows.Controls.ComboBox)(target));
return;
case 2:
this.EnableSpline = ((System.Windows.Controls.Primitives.ToggleButton)(target));
return;
case 3:
this.MovementOnlyX = ((System.Windows.Controls.Primitives.ToggleButton)(target));
return;
case 4:
this.MovementOnlyY = ((System.Windows.Controls.Primitives.ToggleButton)(target));
return;
}
this._contentLoaded = true;
}
}
......
#pragma checksum "..\..\..\..\..\NDISettingView\View\NDISettingView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "D7BD6613706E6B795E9F04F662AD5FE60417C64E706C6EFBE1AA8FC1891A4AF2"
#pragma checksum "..\..\..\..\..\NDISettingView\View\NDISettingView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DC04447B2527BF05DE2CDE1E3203CA9E561056EF3D4813DAA83E7EF14B701461"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\NDISettingView\View\NDISettingView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "D7BD6613706E6B795E9F04F662AD5FE60417C64E706C6EFBE1AA8FC1891A4AF2"
#pragma checksum "..\..\..\..\..\NDISettingView\View\NDISettingView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DC04447B2527BF05DE2CDE1E3203CA9E561056EF3D4813DAA83E7EF14B701461"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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