Commit b53afded by 王永辉

选择预设项目,预设项目详情显示、隐藏

parent 2f916ffc
fba8dc5b9b837464b22019519439fe1b9f969740 b77ab2f7b49389b9182c7f81f043501dbd1f28bc
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
library library
C# C#
.cs .cs
D:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\ D:\wyh\FGOUT\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\
VIZ.FGOUT.Common VIZ.FGOUT.Common
none none
false false
...@@ -13,7 +13,7 @@ false ...@@ -13,7 +13,7 @@ false
21870986562 21870986562
31364711570 31364711570
171121717210 171166775462
Themes\Generic.xaml;Widgets\FootballFieldPanel\FootballFieldPanel.xaml; Themes\Generic.xaml;Widgets\FootballFieldPanel\FootballFieldPanel.xaml;
False False
......
D:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs D:\wyh\FGOUT\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs
FD:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Themes\Generic.xaml;; FD:\wyh\FGOUT\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Themes\Generic.xaml;;
FD:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Widgets\FootballFieldPanel\FootballFieldPanel.xaml;; FD:\wyh\FGOUT\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Widgets\FootballFieldPanel\FootballFieldPanel.xaml;;
2adf7066a7150cc95852f050d7878737e179ab22 954a8f953ea0c9e58cbd7a4e88ffc6456f42311e
a374a7f17b3bff0c3c028efbfc085fc4a1015b5b 1565ec4cef60aa46d7212ff978cf49d7d3fe3743
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
library library
C# C#
.cs .cs
D:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module.Resource\obj\x64\Debug\ D:\wyh\FGOUT\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module.Resource\obj\x64\Debug\
VIZ.FGOUT.Module.Resource VIZ.FGOUT.Module.Resource
none none
false false
DEBUG;TRACE DEBUG;TRACE
16153409119 16498493296
1470602451 1-1441241311
11-350624472 11-1602666439
24771590698 23304678694
Style\Button\Button_NdiView.xaml;Style\Button\Button_Setting.xaml;Style\Button\Button_WindowTop.xaml;Style\CheckBox\CheckBox_NdiView.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_NdiView.xaml;Style\RadioButton\RadioButton_Setting.xaml;Style\Slider\Slider_Setting.xaml;Style\TextBox\TextBox_Setting.xaml;Themes\Generic.xaml;Toolkit\NumericUpDown\NumericUpDown.xaml; Style\Button\Button_NdiView.xaml;Style\Button\Button_Setting.xaml;Style\Button\Button_WindowTop.xaml;Style\CheckBox\CheckBox_NdiView.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_NdiView.xaml;Style\RadioButton\RadioButton_Setting.xaml;Style\Slider\Slider_Setting.xaml;Style\TextBox\TextBox_Setting.xaml;Themes\Generic.xaml;Toolkit\NumericUpDown\NumericUpDown.xaml;
False True
 
FD:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module.Resource\Themes\Generic.xaml;; FD:\wyh\FGOUT\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module.Resource\Themes\Generic.xaml;;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Windows;
using VIZ.FGOUT.Connection.UDP.Clip.Signal.Send; using VIZ.FGOUT.Connection.UDP.Clip.Signal.Send;
using VIZ.FGOUT.Domain;
using VIZ.FGOUT.Storage;
using VIZ.Framework.Connection; using VIZ.Framework.Connection;
using VIZ.Framework.Core; using VIZ.Framework.Core;
...@@ -9,6 +13,7 @@ namespace VIZ.FGOUT.Module ...@@ -9,6 +13,7 @@ namespace VIZ.FGOUT.Module
{ {
//网络终结点key //网络终结点key
private string _endpointKey = "UE"; private string _endpointKey = "UE";
JavelinThrowConfig javelinThrowConfig = new JavelinThrowConfig();
public UEControlPanelViewModel() public UEControlPanelViewModel()
{ {
StartPackagingCommand = new VCommand(this.StartPackaging); StartPackagingCommand = new VCommand(this.StartPackaging);
...@@ -23,7 +28,19 @@ namespace VIZ.FGOUT.Module ...@@ -23,7 +28,19 @@ namespace VIZ.FGOUT.Module
AfterDrawingTheLinePositionCommand = new VCommand(this.AfterDrawingTheLinePosition); AfterDrawingTheLinePositionCommand = new VCommand(this.AfterDrawingTheLinePosition);
SendPresetCommand = new VCommand(this.SendPreset); SendPresetCommand = new VCommand(this.SendPreset);
ConnectionManager.UdpConnection.AddEndpointManager(new UdpEndpointManager(_endpointKey, "127.0.0.1", 8888)); DetailCommand = new VCommand(this.Detail);
CancelCommand = new VCommand(this.Cancel);
//ConnectionManager.UdpConnection.AddEndpointManager(new UdpEndpointManager(_endpointKey, "127.0.0.1", 8888));
string clientIP = ApplicationDomainEx.IniStorage.GetValue<UdpConfig, string>(p => p.UDP_BINDING_IP);
ConnectionManager.UdpConnection.AddEndpointManager(new UdpEndpointManager(_endpointKey, clientIP, 8888));
javelinThrowConfig = ApplicationDomainEx.LiteDbContext.JavelinThrowConfig.FindAll().FirstOrDefault();
if (javelinThrowConfig == null) return;
PresetsProjects.Add("掷标枪");
//var number = javelinThrowConfig.Number;
//var data = javelinThrowConfig.Data;
} }
public VCommand StartPackagingCommand { get; set; } public VCommand StartPackagingCommand { get; set; }
/// <summary> /// <summary>
...@@ -122,7 +139,13 @@ namespace VIZ.FGOUT.Module ...@@ -122,7 +139,13 @@ namespace VIZ.FGOUT.Module
/// </summary> /// </summary>
private void SendPreset() private void SendPreset()
{ {
SendJson("UE_Presets"); if(PresetsItem ==null)
return;
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(_endpointKey);
if (manager == null) return;
if (PresetsItem.Equals("掷标枪"))
manager.SendJsonString(javelinThrowConfig.Data);
//SendJson("UE_Presets");
} }
/// <summary> /// <summary>
/// 发送JSON数据 /// 发送JSON数据
...@@ -137,5 +160,77 @@ namespace VIZ.FGOUT.Module ...@@ -137,5 +160,77 @@ namespace VIZ.FGOUT.Module
ueEvent.UE_event = ueEventStr; ueEvent.UE_event = ueEventStr;
manager.SendJson(ueEvent); manager.SendJson(ueEvent);
} }
public VCommand DetailCommand { get; set; }
private void Detail()
{
UESettingVisibility = Visibility.Visible;
if(WindowWidth ==400)
WindowWidth += 800;
}
public VCommand CancelCommand { get; set; }
private void Cancel()
{
UESettingVisibility = Visibility.Collapsed;
if (WindowWidth == 1200)
WindowWidth -= 800;
}
#region 属性
/// <summary>
/// 预设项目ComboBox
/// </summary>
private List<string> _presetsProjects= new List<string>();
public List<string> PresetsProjects
{
get => _presetsProjects;
set
{
_presetsProjects = value;
this.RaisePropertyChanged(nameof(PresetsProjects));
}
}
private string _presetsItem;
public string PresetsItem
{
get => _presetsItem;
set
{
_presetsItem = value;
this.RaisePropertyChanged(nameof(PresetsItem));
}
}
/// <summary>
/// UE设置部分显示隐藏
/// </summary>
private Visibility _ueSettingVisibility = Visibility.Collapsed;
public Visibility UESettingVisibility
{
get => _ueSettingVisibility;
set
{
_ueSettingVisibility = value;
this.RaisePropertyChanged(nameof(UESettingVisibility));
}
}
private double _windowWidth = 400;
public double WindowWidth
{
get => _windowWidth;
set
{
_windowWidth = value;
this.RaisePropertyChanged(nameof(WindowWidth));
}
}
#endregion
} }
} }
using System.Collections.Generic; using Newtonsoft.Json;
using System.Collections.Generic;
using System.IO.Packaging; using System.IO.Packaging;
using System.Linq;
using System.Xml.Linq; using System.Xml.Linq;
using VIZ.FGOUT.Connection.UDP.Clip.Signal.Send; using VIZ.FGOUT.Connection.UDP.Clip.Signal.Send;
using VIZ.FGOUT.Domain;
using VIZ.FGOUT.Storage;
using VIZ.Framework.Connection; using VIZ.Framework.Connection;
using VIZ.Framework.Core; using VIZ.Framework.Core;
...@@ -26,6 +30,14 @@ namespace VIZ.FGOUT.Module ...@@ -26,6 +30,14 @@ namespace VIZ.FGOUT.Module
this.GetWindow().Close(); this.GetWindow().Close();
} }
/// <summary>
/// 序列化设置
/// </summary>
private readonly static JsonSerializerSettings JSON_SERIALIZER_SETTINGS = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
};
private void Save() private void Save()
{ {
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager($"UE"); UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager($"UE");
...@@ -43,8 +55,17 @@ namespace VIZ.FGOUT.Module ...@@ -43,8 +55,17 @@ namespace VIZ.FGOUT.Module
new Position() { name = "speed", x = 1035, y = 1890 } new Position() { name = "speed", x = 1035, y = 1890 }
}; };
uePackage.UE_Presets.StartSets.Datas.Positions = positions; uePackage.UE_Presets.StartSets.Datas.Positions = positions;
manager.SendJson(uePackage);
} //预设参数存库
string msg = uePackage == null ? string.Empty : JsonConvert.SerializeObject(uePackage, JSON_SERIALIZER_SETTINGS);
//JavelinThrowConfig javelinThrowConfig = new JavelinThrowConfig();
//this.javelinThrowConfig = ApplicationDomainEx.LiteDbContext.JavelinThrowConfig.FindAll().FirstOrDefault();
//if (javelinThrowConfig == null) return;
//javelinThrowConfig.Number = "JT";
//javelinThrowConfig.Data = msg;
//ApplicationDomainEx.LiteDbContext.JavelinThrowConfig.Upsert(javelinThrowConfig);
//manager.SendJson(uePackage);
}
#region Property #region Property
......
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