Commit ca3e4c21 by 鲁志-悦动

Replay页面跟踪框获取数据逻辑优化 And 将入点、出点、上、下、左、右快捷键加入到可配置

parent 7d27b60f
...@@ -202,9 +202,9 @@ namespace VIZ.FGOUT.Module ...@@ -202,9 +202,9 @@ namespace VIZ.FGOUT.Module
return AssembleNDIMainViewHotkeyMode(NDIMainViewHotkeys.Right); return AssembleNDIMainViewHotkeyMode(NDIMainViewHotkeys.Right);
} }
//位置标记删除命令 //位置标记删除命令
if (string.Equals("Ctrl + Z", hotkey) || string.Equals(this.Support.HotkeyConfig.Delete, hotkey)) //if (string.Equals("Ctrl + Z", hotkey) || string.Equals(this.Support.HotkeyConfig.Delete, hotkey))
if (string.Equals(this.Support.HotkeyConfig.Delete, hotkey))
{ {
return AssembleHotkeyMode(NDIViewHotkeys.Delete); return AssembleHotkeyMode(NDIViewHotkeys.Delete);
} }
......
...@@ -25,6 +25,8 @@ namespace VIZ.FGOUT.Module ...@@ -25,6 +25,8 @@ namespace VIZ.FGOUT.Module
private readonly TrackingBoxInfoBuffer _trackingBoxInfoBuffer = private readonly TrackingBoxInfoBuffer _trackingBoxInfoBuffer =
new TrackingBoxInfoBuffer(TimeSpan.FromSeconds(10)); new TrackingBoxInfoBuffer(TimeSpan.FromSeconds(10));
private List<TrackingBoxInfo> _cam3Infos = new List<TrackingBoxInfo>();
/// <summary> /// <summary>
/// 重置3D鼠标 /// 重置3D鼠标
/// </summary> /// </summary>
...@@ -253,14 +255,14 @@ namespace VIZ.FGOUT.Module ...@@ -253,14 +255,14 @@ namespace VIZ.FGOUT.Module
//遍历跟踪框队列 //遍历跟踪框队列
Queue<TrackingBoxInfo> infoBuffers = _trackingBoxInfoBuffer.GetInfos(); Queue<TrackingBoxInfo> infoBuffers = _trackingBoxInfoBuffer.GetInfos();
List<TrackingBoxInfo> infos = new List<TrackingBoxInfo>(); _cam3Infos = new List<TrackingBoxInfo>();
if (infoBuffers.Count > 0) if (infoBuffers.Count > 0)
{ {
foreach (var info in infoBuffers) foreach (var info in infoBuffers)
{ {
if (info.TimeCode == dse.TimeStamp) if (info.TimeCode == dse.TimeStamp)
{ {
infos.Add(info); _cam3Infos.Add(info);
} }
} }
} }
...@@ -280,8 +282,8 @@ namespace VIZ.FGOUT.Module ...@@ -280,8 +282,8 @@ namespace VIZ.FGOUT.Module
// 更新视频流 // 更新视频流
view3.video.UpdateVideoFrame(dsExtend, true); view3.video.UpdateVideoFrame(dsExtend, true);
// 更新视频控件跟踪框信息 // 更新视频控件跟踪框信息
if (infos.Count > 0) if (_cam3Infos.Count > 0)
view3.video.UpdateTrackingBox(infos); view3.video.UpdateTrackingBox(_cam3Infos);
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows;
using VIZ.FGOUT.Domain; using VIZ.FGOUT.Domain;
using VIZ.FGOUT.Storage; using VIZ.FGOUT.Storage;
using VIZ.Framework.Common; using VIZ.Framework.Common;
...@@ -153,7 +154,8 @@ namespace VIZ.FGOUT.Module ...@@ -153,7 +154,8 @@ namespace VIZ.FGOUT.Module
info.DrawingBorderColor = this.IsShowAlgorithmTargetBox ? this.DETECT_BOX_BORDER_COLOR : this.DETECT_BOX_BORDER_COLOR_TRANSPARENT; info.DrawingBorderColor = this.IsShowAlgorithmTargetBox ? this.DETECT_BOX_BORDER_COLOR : this.DETECT_BOX_BORDER_COLOR_TRANSPARENT;
info.TimeCode = msg.timecode; info.TimeCode = msg.timecode;
infos.Add(info); infos.Add(info);
_trackingBoxInfoBuffer.AddInfo(info); if (!view.vm.IsReplay)
_trackingBoxInfoBuffer.AddInfo(info);
} }
} }
...@@ -188,6 +190,25 @@ namespace VIZ.FGOUT.Module ...@@ -188,6 +190,25 @@ namespace VIZ.FGOUT.Module
// 更新视频控件跟踪框信息 // 更新视频控件跟踪框信息
view.video.UpdateTrackingBox(infos); view.video.UpdateTrackingBox(infos);
//if (view.vm.IsReplay)
//{
// // Replay更新画面
// WPFHelper.Invoke(() =>
// {
// try
// {
// var view3 = this.FindChild<NDIView>(Application.Current.MainWindow, NDIViewKeys.cam3);
// // 更新视频控件跟踪框信息
// if (infos.Count > 0)
// view3.video.UpdateTrackingBox(_cam3Infos);
// }
// catch (Exception ex)
// {
// log.Error(ex);
// }
// });
//}
// 更新算法帧率统计 // 更新算法帧率统计
this.AlgorithmFPS.CalcFps(); this.AlgorithmFPS.CalcFps();
} }
......
...@@ -330,6 +330,8 @@ namespace VIZ.FGOUT.Module ...@@ -330,6 +330,8 @@ namespace VIZ.FGOUT.Module
try try
{ {
if(ApplicationDomainEx.LiteDbContext == null)
return;
var config = ApplicationDomainEx.LiteDbContext.AlgorithmSaveMatImage.FindAll().FirstOrDefault(); var config = ApplicationDomainEx.LiteDbContext.AlgorithmSaveMatImage.FindAll().FirstOrDefault();
if (config == null) if (config == null)
return; return;
......
...@@ -35,16 +35,14 @@ ...@@ -35,16 +35,14 @@
<Grid Margin="45,60,40,0"> <Grid Margin="45,60,40,0">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="50" /> <RowDefinition Height="50" />
<RowDefinition Height="100" /> <RowDefinition Height="300" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- 算法裁切快捷键 --> <!-- 算法裁切快捷键 -->
<TextBlock <TextBlock
VerticalAlignment="Center" VerticalAlignment="Center"
FontSize="20" FontSize="20"
Foreground="#AAFFFFFF" Foreground="#AAFFFFFF"
Text="算法裁切快捷键" /> Text="快捷键(输入法切换到英文设置)" />
<Rectangle <Rectangle
Height="1" Height="1"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
...@@ -53,6 +51,8 @@ ...@@ -53,6 +51,8 @@
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="50" /> <RowDefinition Height="50" />
<RowDefinition Height="50" /> <RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition Height="50" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="120" /> <ColumnDefinition Width="120" />
...@@ -88,6 +88,97 @@ ...@@ -88,6 +88,97 @@
Margin="0,0,20,0" Margin="0,0,20,0"
Hotkey="{Binding Path=EndCmd, Mode=TwoWay}" Hotkey="{Binding Path=EndCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" /> Style="{StaticResource HotkeyBox_Setting}" />
<!-- 入点 -->
<TextBlock
Grid.Row="1"
VerticalAlignment="Center"
FontSize="18"
Foreground="White"
Text="入点" />
<fcommon:HotkeyBox
Grid.Row="1"
Grid.Column="1"
Height="30"
Margin="0,0,20,0"
Hotkey="{Binding Path=InPointCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" />
<!-- 出点 -->
<TextBlock
Grid.Row="1"
Grid.Column="2"
VerticalAlignment="Center"
FontSize="18"
Foreground="White"
Text="出点" />
<fcommon:HotkeyBox
Grid.Row="1"
Grid.Column="3"
Height="30"
Margin="0,0,20,0"
Hotkey="{Binding Path=OutPointCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" />
<!-- 上 -->
<TextBlock
Grid.Row="2"
VerticalAlignment="Center"
FontSize="18"
Foreground="White"
Text="上" />
<fcommon:HotkeyBox
Grid.Row="2"
Grid.Column="1"
Height="30"
Margin="0,0,20,0"
Hotkey="{Binding Path=UpCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" />
<!-- 下 -->
<TextBlock
Grid.Row="2"
Grid.Column="2"
VerticalAlignment="Center"
FontSize="18"
Foreground="White"
Text="下" />
<fcommon:HotkeyBox
Grid.Row="2"
Grid.Column="3"
Height="30"
Margin="0,0,20,0"
Hotkey="{Binding Path=DownCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" />
<!-- 左 -->
<TextBlock
Grid.Row="3"
VerticalAlignment="Center"
FontSize="18"
Foreground="White"
Text="左" />
<fcommon:HotkeyBox
Grid.Row="3"
Grid.Column="1"
Height="30"
Margin="0,0,20,0"
Hotkey="{Binding Path=LeftCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" />
<!-- 右 -->
<TextBlock
Grid.Row="3"
Grid.Column="2"
VerticalAlignment="Center"
FontSize="18"
Foreground="White"
Text="右" />
<fcommon:HotkeyBox
Grid.Row="3"
Grid.Column="3"
Height="30"
Margin="0,0,20,0"
Hotkey="{Binding Path=RightCmd, Mode=TwoWay}"
Style="{StaticResource HotkeyBox_Setting}" />
<!-- CAM 3 --> <!-- CAM 3 -->
<!--<TextBlock Text="CAM 3" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="1"></TextBlock> <!--<TextBlock Text="CAM 3" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="1"></TextBlock>
<fcommon:HotkeyBox Grid.Column="1" Hotkey="{Binding Path=AutoCAM3,Mode=TwoWay}" Height="30" Grid.Row="1" <fcommon:HotkeyBox Grid.Column="1" Hotkey="{Binding Path=AutoCAM3,Mode=TwoWay}" Height="30" Grid.Row="1"
......
...@@ -59,7 +59,7 @@ namespace VIZ.FGOUT.Module ...@@ -59,7 +59,7 @@ namespace VIZ.FGOUT.Module
private string endCmd; private string endCmd;
/// <summary> /// <summary>
/// 开始快捷键 /// 结束快捷键
/// </summary> /// </summary>
[HotkeyProperty] [HotkeyProperty]
public string EndCmd public string EndCmd
...@@ -75,10 +75,125 @@ namespace VIZ.FGOUT.Module ...@@ -75,10 +75,125 @@ namespace VIZ.FGOUT.Module
#endregion #endregion
#region 入点快捷键
private string _inPointCmd;
/// <summary>
/// 入点快捷键
/// </summary>
[HotkeyProperty]
public string InPointCmd
{
get { return _inPointCmd; }
set
{
_inPointCmd = value;
this.RaisePropertyChanged(nameof(InPointCmd));
this.CheckHotkey(nameof(InPointCmd), value);
}
}
#endregion
#region 出点快捷键
private string _outPointCmd;
/// <summary>
/// 出点快捷键
/// </summary>
[HotkeyProperty]
public string OutPointCmd
{
get { return _outPointCmd; }
set
{
_outPointCmd = value;
this.RaisePropertyChanged(nameof(OutPointCmd));
this.CheckHotkey(nameof(OutPointCmd), value);
}
}
#endregion
#region 上快捷键
private string _upCmd;
/// <summary>
/// 出点快捷键
/// </summary>
[HotkeyProperty]
public string UpCmd
{
get { return _upCmd; }
set
{
_upCmd = value;
this.RaisePropertyChanged(nameof(UpCmd));
this.CheckHotkey(nameof(UpCmd), value);
}
}
#endregion
#region 下快捷键
private string _downCmd;
/// <summary>
/// 出点快捷键
/// </summary>
[HotkeyProperty]
public string DownCmd
{
get { return _downCmd; }
set
{
_downCmd = value;
this.RaisePropertyChanged(nameof(DownCmd));
this.CheckHotkey(nameof(DownCmd), value);
}
}
#endregion
#region 左快捷键
private string _leftCmd;
/// <summary>
/// 左快捷键
/// </summary>
[HotkeyProperty]
public string LeftCmd
{
get { return _leftCmd; }
set
{
_leftCmd = value;
this.RaisePropertyChanged(nameof(LeftCmd));
this.CheckHotkey(nameof(LeftCmd), value);
}
}
#endregion
#region 右快捷键
private string _rightCmd;
/// <summary>
/// 出点快捷键
/// </summary>
[HotkeyProperty]
public string RightCmd
{
get { return _rightCmd; }
set
{
_rightCmd = value;
this.RaisePropertyChanged(nameof(RightCmd));
this.CheckHotkey(nameof(RightCmd), value);
}
}
#endregion
...@@ -107,7 +222,12 @@ namespace VIZ.FGOUT.Module ...@@ -107,7 +222,12 @@ namespace VIZ.FGOUT.Module
this.StartCmd = this.HotkeyConfig.StartCmd; this.StartCmd = this.HotkeyConfig.StartCmd;
this.EndCmd = this.HotkeyConfig.EndCmd; this.EndCmd = this.HotkeyConfig.EndCmd;
this.InPointCmd = this.HotkeyConfig.I;
this.OutPointCmd = this.HotkeyConfig.O;
this.UpCmd = this.HotkeyConfig.Up;
this.DownCmd = this.HotkeyConfig.Down;
this.LeftCmd = this.HotkeyConfig.Left;
this.RightCmd = this.HotkeyConfig.Right;
} }
#endregion #endregion
...@@ -118,12 +238,30 @@ namespace VIZ.FGOUT.Module ...@@ -118,12 +238,30 @@ namespace VIZ.FGOUT.Module
/// <returns>是否需要保存</returns> /// <returns>是否需要保存</returns>
public bool IsNeedSave() public bool IsNeedSave()
{ {
if (this.StartCmd != this.HotkeyConfig.StartCmd) if (this.StartCmd != this.HotkeyConfig.StartCmd)
return true; return true;
if (this.EndCmd != this.HotkeyConfig.EndCmd) if (this.EndCmd != this.HotkeyConfig.EndCmd)
return true; return true;
if(this.InPointCmd != this.HotkeyConfig.I)
return true;
if (this.OutPointCmd != this.HotkeyConfig.O)
return true;
if (this.UpCmd != this.HotkeyConfig.Up)
return true;
if (this.DownCmd != this.HotkeyConfig.Down)
return true;
if (this.LeftCmd != this.HotkeyConfig.Left)
return true;
if (this.RightCmd!= this.HotkeyConfig.Right)
return true;
//// 算法裁切 //// 算法裁切
//if (this.AutoCAM1 != this.HotkeyConfig.AutoCAM1) //if (this.AutoCAM1 != this.HotkeyConfig.AutoCAM1)
// return true; // return true;
...@@ -208,9 +346,14 @@ namespace VIZ.FGOUT.Module ...@@ -208,9 +346,14 @@ namespace VIZ.FGOUT.Module
//this.HotkeyConfig.ErrorTagActivedCAM = this.ErrorTagActivedCAM; //this.HotkeyConfig.ErrorTagActivedCAM = this.ErrorTagActivedCAM;
//this.HotkeyConfig.CancelErrorTagActivedCAM = this.CancelErrorTagActivedCAM; //this.HotkeyConfig.CancelErrorTagActivedCAM = this.CancelErrorTagActivedCAM;
this.HotkeyConfig.StartCmd =StartCmd; this.HotkeyConfig.StartCmd =StartCmd;
this.HotkeyConfig.EndCmd = EndCmd; this.HotkeyConfig.EndCmd = EndCmd;
this.HotkeyConfig.I = InPointCmd;
this.HotkeyConfig.O = OutPointCmd;
this.HotkeyConfig.Up = UpCmd;
this.HotkeyConfig.Down = DownCmd;
this.HotkeyConfig.Left = LeftCmd;
this.HotkeyConfig.Right = RightCmd;
// 更新配置 // 更新配置
ApplicationDomainEx.LiteDbContext.HotkeyConfig.Upsert(this.HotkeyConfig); ApplicationDomainEx.LiteDbContext.HotkeyConfig.Upsert(this.HotkeyConfig);
......
using System; namespace VIZ.FGOUT.Module
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.FGOUT.Module
{ {
/// <summary> /// <summary>
/// 系统设置 /// 系统设置
......
#pragma checksum "..\..\..\..\..\SystemSetting\View\HotkeySettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6C3CAB4B3207BC7F539B9E8EEAEEEE5EE4618DC17FD6B1E0BFFCB953F424888F" #pragma checksum "..\..\..\..\..\SystemSetting\View\HotkeySettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6B3A42FDE5E02F371E3C4F4F0B7658EA77AC7D466EA2C40F8ACFEC43C5258876"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\SystemSetting\View\HotkeySettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6C3CAB4B3207BC7F539B9E8EEAEEEE5EE4618DC17FD6B1E0BFFCB953F424888F" #pragma checksum "..\..\..\..\..\SystemSetting\View\HotkeySettingPanelView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6B3A42FDE5E02F371E3C4F4F0B7658EA77AC7D466EA2C40F8ACFEC43C5258876"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <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\NDIMainView\View\NDIMainView.xaml;;
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
2024-02-27 17:54:15,262 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":1} 
2024-02-27 17:54:15,267 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":1} \ No newline at end of file
2024-02-27 17:54:25,077 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":0}
2024-02-27 17:54:25,083 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":0}
...@@ -61,6 +61,56 @@ namespace VIZ.Framework.Common ...@@ -61,6 +61,56 @@ namespace VIZ.Framework.Common
sb.Append($"{e.Key}"); sb.Append($"{e.Key}");
} }
// Up
if (e.SystemKey == Key.Up)
{
sb.Append($"{e.SystemKey}");
}
if (e.Key == Key.Up)
{
sb.Append($"{e.Key}");
}
// Down
if (e.SystemKey == Key.Down)
{
sb.Append($"{e.SystemKey}");
}
if (e.Key == Key.Down)
{
sb.Append($"{e.Key}");
}
// Left
if (e.SystemKey == Key.Left)
{
sb.Append($"{e.SystemKey}");
}
if (e.Key == Key.Left)
{
sb.Append($"{e.Key}");
}
// Right
if (e.SystemKey == Key.Right)
{
sb.Append($"{e.SystemKey}");
}
if (e.Key == Key.Right)
{
sb.Append($"{e.Key}");
}
// Ctrl + Z
//if (e.SystemKey == Key.Right)
//{
// sb.Append($"{e.SystemKey}");
//}
//if (e.Key == Key.Right)
//{
// sb.Append($"{e.Key}");
//}
return sb.ToString(); return sb.ToString();
} }
......
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