Commit d00627f4 by 鲁志-悦动

修复“回放时先用鼠标拖动滑块,再按方向键选择入点、出点时会发生跳变,无法精确选择”的缺陷。

parent 967e1b72
......@@ -6,5 +6,7 @@
public class SendPlaceModel
{
public string Key { get; set; }
public bool IsAuto { get; set; }
}
}
......@@ -940,6 +940,11 @@
<b:Interaction.Behaviors>
<local:TextBoxEnterKeyUpdateBehavior />
</b:Interaction.Behaviors>
<b:Interaction.Triggers>
<b:EventTrigger EventName="KeyDown">
<b:InvokeCommandAction Command="{Binding Matting_intervalKeyDownCommand}" PassEventArgsToCommand="True" />
</b:EventTrigger>
</b:Interaction.Triggers>
</TextBox>
<TextBlock
Grid.Column="3"
......@@ -960,10 +965,16 @@
<b:Interaction.Behaviors>
<local:TextBoxEnterKeyUpdateBehavior />
</b:Interaction.Behaviors>
<b:Interaction.Triggers>
<b:EventTrigger EventName="KeyDown">
<b:InvokeCommandAction Command="{Binding Moving_pixelKeyDownCommand}" PassEventArgsToCommand="True" />
</b:EventTrigger>
</b:Interaction.Triggers>
</TextBox>
<CheckBox
Grid.Column="5"
Margin="0,12"
Command="{Binding BigModelCommand}"
Content="{DynamicResource LargeModel}"
FontSize="14"
Foreground="White"
......
......@@ -9,6 +9,7 @@ using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Threading;
using VIZ.FGOUT.Connection;
......@@ -215,6 +216,11 @@ namespace VIZ.FGOUT.Module
this.AutoSendIntervalTimeChangedCommand = new VCommand<RoutedEventArgs>(this.AutoSendIntervalTimeChanged);
//算法发送参数
this.AlgorithmSendCommand = new VCommand(this.AlgorithmSend);
//两个算法参数回车命令
this.Matting_intervalKeyDownCommand = new VCommand<KeyEventArgs>(this.Matting_intervalKeyDown);
this.Moving_pixelKeyDownCommand = new VCommand<KeyEventArgs>(this.Moving_pixelKeyDown);
this.BigModelCommand = new VCommand(this.BigModel);
}
/// <summary>
......@@ -544,6 +550,56 @@ namespace VIZ.FGOUT.Module
private void AlgorithmSend()
{
AlgorithmSendCommon(true);
//UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
//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));
// if(alPackage == null) return;
// alPackage.Matting_interval = Matting_interval;
// alPackage.Moving_pixel = Moving_pixel;
// alPackage.Is_Big_Model = IsBigModel;
// // 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);
//}
}
private void AlgorithmSendCommon(bool isMessage = false)
{
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
if (manager == null) return;
var number = ApplicationDomainEx.LiteDbContext.ViewConfig.FindOne(p => p.ViewKey == NDIViewKeys.CAM_1)
......@@ -554,42 +610,23 @@ namespace VIZ.FGOUT.Module
if (config == null) return;
//拿出来,更新修改数据
var alPackage = (AlgorithmPackage_Figout_sports_model)JsonConvert.DeserializeObject(config.AlgorithmData, typeof(AlgorithmPackage_Figout_sports_model));
if(alPackage == null) return;
if (alPackage == null) return;
alPackage.Matting_interval = Matting_interval;
alPackage.Moving_pixel = Moving_pixel;
alPackage.Is_Big_Model = IsBigModel;
// 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;
if (isMessage)
MessageBoxEx.ShowDialog("算法参数保存成功。");
//再放回去
var algorithmMessage = JsonConvert.SerializeObject(alPackage, JSON_SERIALIZER_SETTINGS);
config.AlgorithmData = algorithmMessage;
ApplicationDomainEx.LiteDbContext.JavelinThrowConfig.Upsert(config);
}
}
#endregion
//int _sliderStartInitValue;
......@@ -1211,6 +1248,41 @@ namespace VIZ.FGOUT.Module
}
}
public VCommand<KeyEventArgs> Matting_intervalKeyDownCommand { get; set; }
private void Matting_intervalKeyDown(KeyEventArgs e)
{
//TextBoxTextCommon(e);
}
public VCommand<KeyEventArgs> Moving_pixelKeyDownCommand { get; set; }
private void Moving_pixelKeyDown(KeyEventArgs e)
{
//TextBoxTextCommon(e);
}
private void TextBoxTextCommon(KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
if (e.OriginalSource is System.Windows.Controls.TextBox tb)
{
var text = tb.Text;
if (int.TryParse(text, out var value) && value > 0)
{
AlgorithmSendCommon();
}
}
}
}
public VCommand BigModelCommand { get; set; }
private void BigModel()
{
//AlgorithmSendCommon();
}
//private void ReconfirmSendParamsCommon(ReconfirmStatus reconfirmStatus)
//{
// var manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1__CLIP);
......@@ -1917,6 +1989,7 @@ namespace VIZ.FGOUT.Module
private void SendPlace()
{
ThreePositionButtonsUnChecked();
sendPlaceModel.IsAuto = isAutoEnable;
ApplicationDomain.MessageManager.Send(sendPlaceModel);
}
......
......@@ -238,13 +238,13 @@ namespace VIZ.FGOUT.Module
else if (view.vm.IsStartValue)
{
//view.vm.IsStartValue =false;
index = SliderValue;
SliderStartValue = index = SliderValue;
}
//如果是End滑块在动
else if (view.vm.IsEndValue)
{
//view.vm.IsEndValue = false;
index = SliderValue;
SliderEndValue = index = SliderValue;
}
#region 公共代码
......
......@@ -704,6 +704,21 @@ namespace VIZ.FGOUT.Module
NDIView nDIView = this.GetView<NDIView>();
//自动模式下验证开始、结束标记
//if (sendPlaceModel.IsAuto)
//{
// if (nDIView.polygonsStart.Count < 2)
// {
// MessageBoxEx.ShowDialog("开始标记不足2个,是不是没按右键保存?");
// return;
// }
// if (nDIView.polygonsEnd.Count < 1)
// {
// MessageBoxEx.ShowDialog("结束标记没有数据,是不是没按右键保存?");
// return;
// }
//}
#region 保存位置部分
this.setPlaceNewConfig = ApplicationDomainEx.LiteDbContext.SetPlaceNewConfig.FindOne(p => p.SportCode == this.viewConfig.GameName);
......
......@@ -428,11 +428,10 @@
VerticalAlignment="Center"
CacheMode="BitmapCache"
FocusVisualStyle="{x:Null}"
IsSelectionRangeEnabled="True"
IsSelectionRangeEnabled="True" PreviewMouseUp="SL_Bat1_OnPreviewMouseUp"
IsSnapToTickEnabled="True"
Maximum="{Binding ElementName=UC_Arrange, Path=Maximum}"
Minimum="{Binding ElementName=UC_Arrange, Path=Minimum}"
MouseLeave="SL_Bat1_OnMouseLeave"
SelectionEnd="{Binding ElementName=UC_Arrange, Path=EndValue}"
SelectionStart="{Binding ElementName=UC_Arrange, Path=StartValue}"
Style="{DynamicResource SliderStyle1}"
......@@ -449,12 +448,13 @@
Width="{Binding ElementName=UC_Arrange, Path=SliderWidth}"
Margin="2"
VerticalAlignment="Center"
CacheMode="BitmapCache" MouseLeave="SL_Bat2_OnMouseLeave"
CacheMode="BitmapCache"
FocusVisualStyle="{x:Null}"
IsSelectionRangeEnabled="True"
IsSnapToTickEnabled="True"
Maximum="{Binding ElementName=UC_Arrange, Path=Maximum}"
Minimum="{Binding ElementName=UC_Arrange, Path=Minimum}"
PreviewMouseUp="SL_Bat2_OnPreviewMouseUp"
SelectionEnd="{Binding ElementName=UC_Arrange, Path=EndValue}"
SelectionStart="{Binding ElementName=UC_Arrange, Path=StartValue}"
Style="{DynamicResource SliderStyle1}"
......
......@@ -207,5 +207,15 @@ namespace VIZ.FGOUT.Module
{
//((Slider)sender).MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
}
private void SL_Bat2_OnPreviewMouseUp(object sender, MouseButtonEventArgs e)
{
((Slider)sender).MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
}
private void SL_Bat1_OnPreviewMouseUp(object sender, MouseButtonEventArgs e)
{
((Slider)sender).MoveFocus(new TraversalRequest(FocusNavigationDirection.Previous));
}
}
}
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DC19E82BBEF6FF2A37423187F34F82C16C0355D5BAA6E4960901B75C5256F333"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DE7CD6F0DEC5D61678C9DDBA502287984A8FCC40AA63AE92E37A79EA4BBB958B"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -90,7 +90,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 953 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 958 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox _Moving_pixel_;
......@@ -98,7 +98,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 1320 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 1331 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam1;
......@@ -106,7 +106,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 1505 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 1516 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam2;
......@@ -114,7 +114,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 1520 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 1531 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam3;
......@@ -200,7 +200,7 @@ namespace VIZ.FGOUT.Module {
case 6:
this._Moving_pixel_ = ((System.Windows.Controls.TextBox)(target));
#line 957 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 962 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
this._Moving_pixel_.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.Moving_pixel_OnPreviewTextInput);
#line default
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DC19E82BBEF6FF2A37423187F34F82C16C0355D5BAA6E4960901B75C5256F333"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DE7CD6F0DEC5D61678C9DDBA502287984A8FCC40AA63AE92E37A79EA4BBB958B"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -90,7 +90,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 953 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 958 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox _Moving_pixel_;
......@@ -98,7 +98,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 1320 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 1331 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam1;
......@@ -106,7 +106,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 1505 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 1516 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam2;
......@@ -114,7 +114,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 1520 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 1531 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam3;
......@@ -200,7 +200,7 @@ namespace VIZ.FGOUT.Module {
case 6:
this._Moving_pixel_ = ((System.Windows.Controls.TextBox)(target));
#line 957 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 962 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
this._Moving_pixel_.PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.Moving_pixel_OnPreviewTextInput);
#line default
......

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;;
......
......@@ -55,5 +55,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4.0")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: AssemblyVersion("1.0.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
......@@ -10,10 +10,10 @@ none
false
TRACE
9-721875057
91711917753
3-630027162
19468308608
3-1719726047
20-2028247964
Path\ArrowPathResource.xaml;Style\Button\Button_MessageBox.xaml;Style\Button\Button_Normal.xaml;Style\Button\Button_WindowTop.xaml;Style\GridSplitter\GridSplitter_None.xaml;Style\ListBox\ListBox_None.xaml;Style\ScrollView\ScrollView_Default.xaml;Style\TextBox\TextBox_None.xaml;Themes\Generic.xaml;
False
......
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
/// <summary>
/// CreateInstance
/// </summary>
protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
| (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
}
/// <summary>
/// GetPropertyValue
/// </summary>
protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// SetPropertyValue
/// </summary>
protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// CreateDelegate
/// </summary>
protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
| (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
delegateType,
handler}, null)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}

......@@ -10,11 +10,11 @@ none
false
TRACE
15-721109437
15488264905
121-1133520871
150-762123096
1212046750213
150-875198046
MessageBox\MessageBoxEx.xaml;MessageBox\MessageBoxExWindow.xaml;Themes\Generic.xaml;VideoControl\Control\VideoControl.xaml;Widgets\ColorPickButton\ColorPickButton.xaml;Widgets\ColorPickButton\ColorPickWindow.xaml;Widgets\GPIOPinTestControl\GPIOPinTestControl.xaml;Widgets\HotkeyBox\HotkeyBox.xaml;Widgets\IconButton\IconButton.xaml;Widgets\LabelValue\LabelValue.xaml;Widgets\NavigationControl\NavigationControl.xaml;Widgets\ResizeImageControl\ResizeImageControl.xaml;Widgets\ShowMessageControl\ShowMessageControl.xaml;Widgets\VideoTimeBar\VideoTimeBar.xaml;Widgets\ViewLoader\ViewLoader.xaml;
True
False
f346e34fa113c75fbb5d7583760dcedaaea8630203ca586da10c477fb77a5759
b4a4c8d137708502c14e65967b88564f799d5d7916e083641b483b608baa3d88
......@@ -10,11 +10,11 @@ none
false
TRACE
1-731644535
11882902973
212002329545
25-1969161261
212023628146
26917618797
Themes\Generic.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