Commit c1db4d55 by liulongfei

1. 样式调整

2. 目标丢失指示灯延时1秒生效
parent aaed881f
......@@ -60,5 +60,10 @@ namespace VIZ.H2V.Connection
/// 错误标记
/// </summary>
public const string wrong_target = "wrong_target";
/// <summary>
/// 取消错误标记
/// </summary>
public const string reset = "reset";
}
}
......@@ -6,26 +6,32 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using VIZ.H2V.Domain;
using VIZ.H2V.Storage;
namespace VIZ.H2V.Module.Resource
{
/// <summary>
/// 算法是否拥有目标框转化器
/// values[0] : IsAlgorithmTargetBoxExists
/// values[0] : AlgorithmTargetBoxLostFrame
/// values[1] : ViewStatus
/// </summary>
public class AlgorithmTargetBoxExistsConverter : IMultiValueConverter
public class AlgorithmTargetBoxLostFrameConverter : IMultiValueConverter
{
/// <summary>
/// 算法目标框连续丢失帧数(如果目标框连续丢失则改变指示灯状态)
/// </summary>
private readonly int ALGORITHM_TARGET_BOX_LOST_FRAME = ApplicationDomainEx.IniStorage.GetValue<AlgorithmConfig, int>(p => p.ALGORITHM_TARGET_BOX_LOST_FRAME);
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values == null || values.Length != 2)
return false;
bool isAlgorithmTargetBoxExists = (bool)values[0];
int lost = (int)values[0];
NDIViewStatus viewStatus = (NDIViewStatus)values[1];
// 在裁切状态,且拥有目标框时才显示绿灯,否则为红灯
return viewStatus == NDIViewStatus.CropRoi && isAlgorithmTargetBoxExists;
// 在裁切状态,且目标框丢失次数小于 ALGORITHM_TARGET_BOX_LOST_FRAME 时显示绿灯,否则为红灯
return viewStatus == NDIViewStatus.CropRoi && lost <= ALGORITHM_TARGET_BOX_LOST_FRAME;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
......
......@@ -150,7 +150,7 @@
<Compile Include="Converter\AlgorithmStrategyTagStringConverter.cs" />
<Compile Include="Converter\AlgorithmStrategyType2FootballFieldHeightConverter.cs" />
<Compile Include="Converter\AlgorithmStrategyType2FootballFieldOrientationConverter.cs" />
<Compile Include="Converter\AlgorithmTargetBoxExistsConverter.cs" />
<Compile Include="Converter\AlgorithmTargetBoxLostFrameConverter.cs" />
<Compile Include="Converter\ServiceFps2VisibilityConverter.cs" />
<Compile Include="Converter\ServiceFps2SolidBrushConverter.cs" />
<Compile Include="Converter\TallyColor2RadialGradientBrushConverter.cs" />
......@@ -211,6 +211,14 @@
<Project>{92834c05-703e-4f05-9224-f36220939d8f}</Project>
<Name>VIZ.Framework.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Domain\VIZ.Framework.Domain.csproj">
<Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project>
<Name>VIZ.Framework.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.H2V.Domain\VIZ.H2V.Domain.csproj">
<Project>{3C61290E-D9C3-4F00-83CB-AE5F64C3298C}</Project>
<Name>VIZ.H2V.Domain</Name>
......
......@@ -101,6 +101,10 @@ namespace VIZ.H2V.Module
// 错误标记
if (this.ExecuteErrorTag(hotkey))
return;
// 取消错误标记
if (this.ExecuteCancelErrorTag(hotkey))
return;
}
/// <summary>
......@@ -281,22 +285,6 @@ namespace VIZ.H2V.Module
{
INDIViewService service = null;
if (string.Equals(this.Support.HotkeyConfig.ErrorTagCAM1, hotkey))
{
service = ApplicationDomainEx.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
}
if (string.Equals(this.Support.HotkeyConfig.ErrorTagCAM2, hotkey))
{
service = ApplicationDomainEx.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_2);
}
if (string.Equals(this.Support.HotkeyConfig.ErrorTagCAM3, hotkey))
{
service = ApplicationDomainEx.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_3);
}
if (string.Equals(this.Support.HotkeyConfig.ErrorTagCAM4, hotkey))
{
service = ApplicationDomainEx.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_4);
}
if (string.Equals(this.Support.HotkeyConfig.ErrorTagActivedCAM, hotkey))
{
service = NDIViewModel.ActiveViewModel;
......@@ -310,5 +298,28 @@ namespace VIZ.H2V.Module
return true;
}
/// <summary>
/// 处理取消错误标记
/// </summary>
/// <param name="hotkey">热键</param>
/// <returns>是否处理完成</returns>
private bool ExecuteCancelErrorTag(string hotkey)
{
INDIViewService service = null;
if (string.Equals(this.Support.HotkeyConfig.CancelErrorTagActivedCAM, hotkey))
{
service = NDIViewModel.ActiveViewModel;
}
if (service == null)
return false;
// 发送取消错误标记
service.SendCancelErrorTag();
return true;
}
}
}
......@@ -77,8 +77,8 @@ namespace VIZ.H2V.Module
// 检测3D鼠标值
this.Check3DNavigation();
// 更新算法是否拥有目标框
this.UpdateIsAlgorithmTargetBoxExists();
// 更新算法目标框连续丢失次数
this.UpdateAlgorithmTargetBoxLostFrame();
// 等待
Task.Delay(100).Wait();
......@@ -138,15 +138,15 @@ namespace VIZ.H2V.Module
}
/// <summary>
/// 更新算法是否拥有目标框
/// 更新算法目标框连续丢失次数
/// </summary>
private void UpdateIsAlgorithmTargetBoxExists()
private void UpdateAlgorithmTargetBoxLostFrame()
{
List<INDIViewService> services = ApplicationDomainEx.ServiceManager.GetServiceList<INDIViewService>();
if (services == null)
return;
services.ForEach(p => p.UpdateIsAlgorithmTargetBoxExists());
services.ForEach(p => p.UpdateAlgorithmTargetBoxLostFrame());
}
/// <summary>
......
......@@ -64,7 +64,7 @@
</StackPanel>
</Grid>
<!-- 主体 -->
<Grid Grid.Row="1" Margin="25,10,25,10">
<Grid Grid.Row="1" Margin="40,0,40,10">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
......@@ -73,10 +73,10 @@
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<local:NDIView x:Name="view_CAM_1" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_1}" Grid.Row="0" Grid.Column="0" Margin="5,5,20,5"></local:NDIView>
<local:NDIView x:Name="view_CAM_2" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_3}" Grid.Row="1" Grid.Column="0" Margin="5,5,20,5"></local:NDIView>
<local:NDIView x:Name="view_CAM_3" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_4}" Grid.Row="1" Grid.Column="1" Margin="20,5,5,5"></local:NDIView>
<local:NDIView x:Name="view_CAM_4" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_2}" Grid.Row="0" Grid.Column="1" Margin="20,5,5,5"></local:NDIView>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_1}" Grid.Row="0" Grid.Column="0" Margin="10,10,15,10"></local:NDIView>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_2}" Grid.Row="0" Grid.Column="1" Margin="15,10,10,10"></local:NDIView>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_3}" Grid.Row="1" Grid.Column="0" Margin="10,10,15,10"></local:NDIView>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_4}" Grid.Row="1" Grid.Column="1" Margin="15,10,10,10"></local:NDIView>
</Grid>
<!-- 底部 -->
<Border Grid.Row="2" Background="#ff12202d">
......
......@@ -208,6 +208,12 @@ namespace VIZ.H2V.Module
public abstract void ErrorTag(List<int> target_bbox, long timeCode);
/// <summary>
/// 取消错误标记
/// </summary>
/// <param name="timeCode">时间码</param>
public abstract void CancelErrorTag(long timeCode);
/// <summary>
/// 手动校准
/// </summary>
/// <param name="info">手动校准信息</param>
......
......@@ -78,6 +78,12 @@ namespace VIZ.H2V.Module
void ErrorTag(List<int> target_bbox, long timeCode);
/// <summary>
/// 取消错误标记
/// </summary>
/// <param name="timeCode">时间码</param>
void CancelErrorTag(long timeCode);
/// <summary>
/// 初始化算法
/// </summary>
/// <remarks>
......
......@@ -135,6 +135,22 @@ namespace VIZ.H2V.Module
}
/// <summary>
/// 取消错误标记
/// </summary>
/// <param name="timeCode">时间码</param>
public override void CancelErrorTag(long timeCode)
{
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(this.Support.ViewKey);
AlgorithmSenderOption option = new AlgorithmSenderOption();
option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
option.timecode = timeCode;
AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.reset, null), option);
}
/// <summary>
/// 手动校准
/// </summary>
/// <param name="info">手动校准信息</param>
......
......@@ -145,6 +145,22 @@ namespace VIZ.H2V.Module
}
/// <summary>
/// 取消错误标记
/// </summary>
/// <param name="timeCode">时间码</param>
public override void CancelErrorTag(long timeCode)
{
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(this.Support.ViewKey);
AlgorithmSenderOption option = new AlgorithmSenderOption();
option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
option.timecode = timeCode;
AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.reset, null, null), option);
}
/// <summary>
/// 手动校准
/// </summary>
/// <param name="info">手动校准信息</param>
......
......@@ -182,6 +182,22 @@ namespace VIZ.H2V.Module
}
/// <summary>
/// 取消错误标记
/// </summary>
/// <param name="timeCode">时间码</param>
public override void CancelErrorTag(long timeCode)
{
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(this.Support.ViewKey);
AlgorithmSenderOption option = new AlgorithmSenderOption();
option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
option.timecode = timeCode;
AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.reset, null), option);
}
/// <summary>
/// 手动校准
/// </summary>
/// <param name="info">手动校准信息</param>
......
......@@ -145,6 +145,22 @@ namespace VIZ.H2V.Module
}
/// <summary>
/// 取消错误标记
/// </summary>
/// <param name="timeCode">时间码</param>
public override void CancelErrorTag(long timeCode)
{
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(this.Support.ViewKey);
AlgorithmSenderOption option = new AlgorithmSenderOption();
option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
option.timecode = timeCode;
AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.reset, null, null), option);
}
/// <summary>
/// 手动校准
/// </summary>
/// <param name="info">手动校准信息</param>
......
......@@ -106,6 +106,22 @@ namespace VIZ.H2V.Module
}
/// <summary>
/// 取消错误标记
/// </summary>
/// <param name="timeCode">时间码</param>
public override void CancelErrorTag(long timeCode)
{
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(this.Support.ViewKey);
AlgorithmSenderOption option = new AlgorithmSenderOption();
option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
option.timecode = timeCode;
AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.reset, null, null), option);
}
/// <summary>
/// 边线检测校准
/// </summary>
/// <param name="borderpoint">边线检测校准点</param>
......
......@@ -119,7 +119,7 @@ namespace VIZ.H2V.Module
/// <summary>
/// 更新算法是否拥有目标框
/// </summary>
void UpdateIsAlgorithmTargetBoxExists();
void UpdateAlgorithmTargetBoxLostFrame();
/// <summary>
/// 停止算法
......@@ -144,6 +144,11 @@ namespace VIZ.H2V.Module
void SendErrorTag();
/// <summary>
/// 发送取消错误标记
/// </summary>
void SendCancelErrorTag();
/// <summary>
/// 当算法停止时处理
/// </summary>
void WhenAlgorithmStop();
......
......@@ -71,7 +71,7 @@
StrategyModeListString="center_mode">
</resource:NDIViewProperty2VisibilityConverter>
<!-- 目标框丢失指示灯 -->
<resource:AlgorithmTargetBoxExistsConverter x:Key="AlgorithmTargetBoxExistsConverter"></resource:AlgorithmTargetBoxExistsConverter>
<resource:AlgorithmTargetBoxLostFrameConverter x:Key="AlgorithmTargetBoxLostFrameConverter"></resource:AlgorithmTargetBoxLostFrameConverter>
</ResourceDictionary>
</UserControl.Resources>
......@@ -83,7 +83,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80"></RowDefinition>
<RowDefinition Height="70"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
......@@ -133,7 +133,7 @@
MaxWidth="300"></TextBlock>
</Grid>
<!-- 算法 -->
<Grid Grid.RowSpan="2" Margin="0,20,0,0">
<Grid Grid.RowSpan="2" Margin="0,16,-6,0">
<Grid IsEnabled="{Binding Path=ViewStatus,Converter={StaticResource NDIViewStatus2IsEnabledConverter}}">
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
......@@ -160,8 +160,8 @@
IsHitTestVisible="False"
HorizontalAlignment="Left" VerticalAlignment="Center" Margin="25,0,0,0">
<CheckBox.IsChecked>
<MultiBinding Converter="{StaticResource AlgorithmTargetBoxExistsConverter}">
<Binding Path="IsAlgorithmTargetBoxExists"></Binding>
<MultiBinding Converter="{StaticResource AlgorithmTargetBoxLostFrameConverter}">
<Binding Path="AlgorithmTargetBoxLostFrame"></Binding>
<Binding Path="ViewStatus"></Binding>
</MultiBinding>
</CheckBox.IsChecked>
......
......@@ -488,70 +488,5 @@ namespace VIZ.H2V.Module
}
#endregion
#region AlgorithmErrorTagCommand -- 算法错误标记命令
/// <summary>
/// 算法错误标记命令
/// </summary>
public VCommand AlgorithmErrorTagCommand { get; set; }
/// <summary>
/// 算法错误标记
/// </summary>
private void AlgorithmErrorTag()
{
// 只有在自动模式下可以标记
if (this.StrategyMode != AlgorithmStrategyMode.auto_mode)
return;
// 只有裁切状态下可以标记
if (this.ViewStatus != NDIViewStatus.CropRoi)
return;
// 目前单人机位不支持错误标记
if (this.StrategyType == AlgorithmStrategyType.Single)
return;
NDIView view = this.GetView<NDIView>();
if (view == null)
return;
VideoRenderInfo renderInfo = view.video.GetRenderInfo();
if (renderInfo == null)
return;
TrackingBoxPlugin trackingBoxPlugin = view.video.GetPlugin<TrackingBoxPlugin>(VideoControlPluginNames.TrackingBox);
if (trackingBoxPlugin == null)
return;
List<TrackingBoxInfo> trackingBoxInfos = trackingBoxPlugin.GetTrackingBoxInfos();
if (trackingBoxInfos == null || trackingBoxInfos.Count == 0)
return;
TrackingBoxInfo boxInfo = trackingBoxInfos[0];
// 标记错误
List<int> box = new List<int>();
box.Add((int)boxInfo.SrcRect.Left);
box.Add((int)boxInfo.SrcRect.Top);
box.Add((int)boxInfo.SrcRect.Right);
box.Add((int)boxInfo.SrcRect.Bottom);
this.AlgorithmControllerDic[this.StrategyType].ErrorTag(box, renderInfo.Frame.TimeStamp);
//====================================================================
// CODE: SYSTEM_LOG | 记录日志
//====================================================================
// 记录日志: 算法错误标记 | [类型:{0}],<坐标:({1},{2},{3},{4}), 时码: {5}>
string system_log = string.Format(SystemLogStringFormats.ALGORITHM_ERROR_TAG,
this.StrategyType.GetDescription(),
box[0], box[1], box[2], box[3],
renderInfo.Frame.TimeStamp);
ApplicationDomainEx.CsvContext.AppendSystemLog(this.ViewKey, this.DisplayName, system_log);
//====================================================================
}
#endregion
}
}
......@@ -221,8 +221,15 @@ namespace VIZ.H2V.Module
/// <param name="view">视图</param>
private void OnAlgorithmMessage__crop_roi__target_bbox(AlgorithmMessage__crop_roi msg, VideoRenderInfo renderInfo, NDIView view)
{
// 当前是否拥有目标框
this.isAlgorithmTargetBoxExists_cache = msg.target_bbox != null;
// 当前是否拥有目标框,如果没有目标框则记录当前丢失目标框帧数
if (msg.target_bbox == null)
{
++this.algorithmTargetBoxLostFrame_cache;
}
else
{
this.algorithmTargetBoxLostFrame_cache = 0;
}
// 没有目标框 || 配置是否显示目标框
if (msg.target_bbox == null || !this.IsShowAlgorithmTargetBox)
......
......@@ -380,23 +380,25 @@ namespace VIZ.H2V.Module
#endregion
#region IsAlgorithmTargetBoxExists -- 算法目标框是否存在
#region AlgorithmTargetBoxLostFrame -- 算法目标框连续丢失帧数
private bool isAlgorithmTargetBoxExists_cache;
/// <summary>
/// 算法目标框连续丢失帧数 缓存
/// </summary>
/// <remarks>
/// 算法目标框连续丢失帧数 值首先记录在cache中
/// 真实值更新则在 NDIMainViewModel 的 LoopController 中
/// </remarks>
private int algorithmTargetBoxLostFrame_cache;
private bool isAlgorithmTargetBoxExists;
private int algorithmTargetBoxLostFrame;
/// <summary>
/// 算法目标框是否存在
/// 算法目标框连续丢失帧数
/// </summary>
public bool IsAlgorithmTargetBoxExists
public int AlgorithmTargetBoxLostFrame
{
get { return isAlgorithmTargetBoxExists; }
set
{
isAlgorithmTargetBoxExists = value;
isAlgorithmTargetBoxExists_cache = value;
this.RaisePropertySaveChanged(nameof(IsAlgorithmTargetBoxExists));
}
get { return algorithmTargetBoxLostFrame; }
set { algorithmTargetBoxLostFrame = value; this.RaisePropertyChanged(nameof(AlgorithmTargetBoxLostFrame)); }
}
#endregion
......
......@@ -82,7 +82,6 @@ namespace VIZ.H2V.Module
this.IsAreaCorrectionEnabledChangedCommand = new VCommand(this.IsAreaCorrectionEnabledChanged);
this.SaveAlgorithmConfigCommand = new VCommand(this.SaveAlgorithmConfig);
this.SetActiveCommand = new VCommand(this.SetActive);
this.AlgorithmErrorTagCommand = new VCommand(this.AlgorithmErrorTag);
}
/// <summary>
......@@ -399,12 +398,12 @@ namespace VIZ.H2V.Module
/// <summary>
/// 更新算法是否拥有目标框
/// </summary>
public void UpdateIsAlgorithmTargetBoxExists()
public void UpdateAlgorithmTargetBoxLostFrame()
{
if (this.IsAlgorithmTargetBoxExists == this.isAlgorithmTargetBoxExists_cache)
if (this.AlgorithmTargetBoxLostFrame == this.algorithmTargetBoxLostFrame_cache)
return;
this.IsAlgorithmTargetBoxExists = this.isAlgorithmTargetBoxExists_cache;
this.AlgorithmTargetBoxLostFrame = this.algorithmTargetBoxLostFrame_cache;
}
/// <summary>
......@@ -420,7 +419,92 @@ namespace VIZ.H2V.Module
/// </summary>
public void SendErrorTag()
{
this.AlgorithmErrorTag();
// 只有在自动模式下可以标记
if (this.StrategyMode != AlgorithmStrategyMode.auto_mode)
return;
// 只有裁切状态下可以标记
if (this.ViewStatus != NDIViewStatus.CropRoi)
return;
// 目前单人机位不支持错误标记
if (this.StrategyType == AlgorithmStrategyType.Single)
return;
NDIView view = this.GetView<NDIView>();
if (view == null)
return;
VideoRenderInfo renderInfo = view.video.GetRenderInfo();
if (renderInfo == null)
return;
TrackingBoxPlugin trackingBoxPlugin = view.video.GetPlugin<TrackingBoxPlugin>(VideoControlPluginNames.TrackingBox);
if (trackingBoxPlugin == null)
return;
List<TrackingBoxInfo> trackingBoxInfos = trackingBoxPlugin.GetTrackingBoxInfos();
if (trackingBoxInfos == null || trackingBoxInfos.Count == 0)
return;
TrackingBoxInfo boxInfo = trackingBoxInfos[0];
// 标记错误
List<int> box = new List<int>();
box.Add((int)boxInfo.SrcRect.Left);
box.Add((int)boxInfo.SrcRect.Top);
box.Add((int)boxInfo.SrcRect.Right);
box.Add((int)boxInfo.SrcRect.Bottom);
this.AlgorithmControllerDic[this.StrategyType].ErrorTag(box, renderInfo.Frame.TimeStamp);
//====================================================================
// CODE: SYSTEM_LOG | 记录日志
//====================================================================
// 记录日志: 算法错误标记 | [类型:{0}],<坐标:({1},{2},{3},{4}), 时码: {5}>
string system_log = string.Format(SystemLogStringFormats.ALGORITHM_ERROR_TAG,
this.StrategyType.GetDescription(),
box[0], box[1], box[2], box[3],
renderInfo.Frame.TimeStamp);
ApplicationDomainEx.CsvContext.AppendSystemLog(this.ViewKey, this.DisplayName, system_log);
//====================================================================
}
/// <summary>
/// 发送取消错误标记
/// </summary>
public void SendCancelErrorTag()
{
// 只有在自动模式下可以标记
if (this.StrategyMode != AlgorithmStrategyMode.auto_mode)
return;
// 只有裁切状态下可以标记
if (this.ViewStatus != NDIViewStatus.CropRoi)
return;
// 目前单人机位不支持错误标记
if (this.StrategyType == AlgorithmStrategyType.Single)
return;
NDIView view = this.GetView<NDIView>();
if (view == null)
return;
VideoRenderInfo renderInfo = view.video.GetRenderInfo();
if (renderInfo == null)
return;
this.AlgorithmControllerDic[this.StrategyType].CancelErrorTag(renderInfo.Frame.TimeStamp);
//====================================================================
// CODE: SYSTEM_LOG | 记录日志
//====================================================================
// 记录日志: 算法取消错误标记,[类型:{0}],<时码: {1}>
string system_log = string.Format(SystemLogStringFormats.ALGORITHM_CANCEL_ERROR_TAG,
this.StrategyType.GetDescription(), renderInfo.Frame.TimeStamp);
ApplicationDomainEx.CsvContext.AppendSystemLog(this.ViewKey, this.DisplayName, system_log);
//====================================================================
}
/// <summary>
......@@ -428,8 +512,8 @@ namespace VIZ.H2V.Module
/// </summary>
public void WhenAlgorithmStop()
{
// 清理目标跟踪框信息
this.isAlgorithmTargetBoxExists_cache = false;
// 从新统计目标框丢失帧数
this.algorithmTargetBoxLostFrame_cache = 0;
}
/// <summary>
......
......@@ -167,13 +167,11 @@
</Grid>
<!-- 标记误检快捷键 -->
<TextBlock Text="标记误检快捷键" Foreground="#AAFFFFFF" FontSize="20" VerticalAlignment="Center" Grid.Row="8"></TextBlock>
<TextBlock Text="标记当前窗口误检快捷键" Foreground="#AAFFFFFF" FontSize="20" VerticalAlignment="Center" Grid.Row="8"></TextBlock>
<Rectangle Grid.Row="8" VerticalAlignment="Bottom" Height="2" Fill="#ff364051"></Rectangle>
<Grid Grid.Row="9">
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
......@@ -181,26 +179,14 @@
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- CAM 1 -->
<TextBlock Text="CAM 1" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="0"></TextBlock>
<fcommon:HotkeyBox Grid.Column="1" Hotkey="{Binding Path=ErrorTagCAM1,Mode=TwoWay}" Height="30"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
<!-- CAM 2 -->
<TextBlock Text="CAM 2" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="0" Grid.Column="2"></TextBlock>
<fcommon:HotkeyBox Grid.Column="3" Hotkey="{Binding Path=ErrorTagCAM2,Mode=TwoWay}" Height="30" Grid.Row="0"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
<!-- CAM 3 -->
<TextBlock Text="CAM 3" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="1"></TextBlock>
<fcommon:HotkeyBox Grid.Column="1" Hotkey="{Binding Path=ErrorTagCAM3,Mode=TwoWay}" Height="30" Grid.Row="1"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
<!-- CAM 4 -->
<TextBlock Text="CAM 4" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="1" Grid.Column="2"></TextBlock>
<fcommon:HotkeyBox Grid.Column="3" Hotkey="{Binding Path=ErrorTagCAM4,Mode=TwoWay}" Height="30" Grid.Row="1"
<!-- 标记 -->
<TextBlock Text="标记" Foreground="White" FontSize="18" VerticalAlignment="Center"></TextBlock>
<fcommon:HotkeyBox Grid.Column="1" Hotkey="{Binding Path=ErrorTagActivedCAM,Mode=TwoWay}" Height="30"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
<!-- 当前激活窗口 -->
<TextBlock Text="当前激活窗口" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="2"></TextBlock>
<fcommon:HotkeyBox Grid.Column="1" Hotkey="{Binding Path=ErrorTagActivedCAM,Mode=TwoWay}" Height="30" Grid.Row="2"
<!-- 取消标记 -->
<TextBlock Text="取消标记" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Column="2"></TextBlock>
<fcommon:HotkeyBox Grid.Column="3" Hotkey="{Binding Path=CancelErrorTagActivedCAM,Mode=TwoWay}" Height="30"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
</Grid>
</Grid>
......
......@@ -379,77 +379,32 @@ namespace VIZ.H2V.Module
// -----------------------------------------------------------------------
// 错误标记
#region ErrorTagCAM1 -- 错误标记 视图1
private string errorTagCAM1;
/// <summary>
/// 错误标记 视图1
/// </summary>
[HotkeyProperty]
public string ErrorTagCAM1
{
get { return errorTagCAM1; }
set { errorTagCAM1 = value; this.RaisePropertyChanged(nameof(ErrorTagCAM1)); }
}
#endregion
#region ErrorTagCAM2 -- 错误标记 视图2
private string errorTagCAM2;
/// <summary>
/// 错误标记 视图2
/// </summary>
[HotkeyProperty]
public string ErrorTagCAM2
{
get { return errorTagCAM2; }
set { errorTagCAM2 = value; this.RaisePropertyChanged(nameof(ErrorTagCAM2)); }
}
#endregion
#region ErrorTagCAM3 -- 错误标记 视图3
private string errorTagCAM3;
/// <summary>
/// 错误标记 视图3
/// </summary>
[HotkeyProperty]
public string ErrorTagCAM3
{
get { return errorTagCAM3; }
set { errorTagCAM3 = value; this.RaisePropertyChanged(nameof(ErrorTagCAM3)); }
}
#endregion
#region ErrorTagCAM4 -- 错误标记 视图4
#region ErrorTagActivedCAM -- 错误标记 当前激活的视图
private string errorTagCAM4;
private string errorTagActivedCAM;
/// <summary>
/// 错误标记 视图4
/// 错误标记 当前激活的视图
/// </summary>
[HotkeyProperty]
public string ErrorTagCAM4
public string ErrorTagActivedCAM
{
get { return errorTagCAM4; }
set { errorTagCAM4 = value; this.RaisePropertyChanged(nameof(ErrorTagCAM4)); }
get { return errorTagActivedCAM; }
set { errorTagActivedCAM = value; this.RaisePropertyChanged(nameof(ErrorTagActivedCAM)); }
}
#endregion
#region ErrorTagActivedCAM -- 错误标记 当前激活的视图
#region CancelErrorTagActivedCAM -- 取消错误标记 当前激活对的视图
private string errorTagActivedCAM;
private string cancelErrorTagActivedCAM;
/// <summary>
/// 错误标记 当前激活的视图
/// 取消错误标记 当前激活对的视图
/// </summary>
[HotkeyProperty]
public string ErrorTagActivedCAM
public string CancelErrorTagActivedCAM
{
get { return errorTagActivedCAM; }
set { errorTagActivedCAM = value; this.RaisePropertyChanged(nameof(ErrorTagActivedCAM)); }
get { return cancelErrorTagActivedCAM; }
set { cancelErrorTagActivedCAM = value; this.RaisePropertyChanged(nameof(CancelErrorTagActivedCAM)); }
}
#endregion
......@@ -500,11 +455,8 @@ namespace VIZ.H2V.Module
this.ActiveCAM4 = this.HotkeyConfig.ActiveCAM4;
// 错误标记
this.ErrorTagCAM1 = this.HotkeyConfig.ErrorTagCAM1;
this.ErrorTagCAM2 = this.HotkeyConfig.ErrorTagCAM2;
this.ErrorTagCAM3 = this.HotkeyConfig.ErrorTagCAM3;
this.ErrorTagCAM4 = this.HotkeyConfig.ErrorTagCAM4;
this.ErrorTagActivedCAM = this.HotkeyConfig.ErrorTagActivedCAM;
this.CancelErrorTagActivedCAM = this.HotkeyConfig.CancelErrorTagActivedCAM;
}
#endregion
......@@ -556,16 +508,10 @@ namespace VIZ.H2V.Module
return true;
// 错误标记
if (this.ErrorTagCAM1 != this.HotkeyConfig.ErrorTagCAM1)
return true;
if (this.ErrorTagCAM2 != this.HotkeyConfig.ErrorTagCAM2)
return true;
if (this.ErrorTagCAM3 != this.HotkeyConfig.ErrorTagCAM3)
return true;
if (this.ErrorTagCAM4 != this.HotkeyConfig.ErrorTagCAM4)
return true;
if (this.ErrorTagActivedCAM != this.HotkeyConfig.ErrorTagActivedCAM)
return true;
if (this.CancelErrorTagActivedCAM != this.HotkeyConfig.CancelErrorTagActivedCAM)
return true;
// 不需要保存
return false;
......@@ -602,11 +548,8 @@ namespace VIZ.H2V.Module
this.HotkeyConfig.ActiveCAM4 = this.ActiveCAM4;
// 错误标记
this.HotkeyConfig.ErrorTagCAM1 = this.ErrorTagCAM1;
this.HotkeyConfig.ErrorTagCAM2 = this.ErrorTagCAM2;
this.HotkeyConfig.ErrorTagCAM3 = this.ErrorTagCAM3;
this.HotkeyConfig.ErrorTagCAM4 = this.ErrorTagCAM4;
this.HotkeyConfig.ErrorTagActivedCAM = this.ErrorTagActivedCAM;
this.HotkeyConfig.CancelErrorTagActivedCAM = this.CancelErrorTagActivedCAM;
// 更新配置
ApplicationDomainEx.LiteDbContext.HotkeyConfig.Upsert(this.HotkeyConfig);
......
......@@ -70,5 +70,10 @@ namespace VIZ.H2V.Storage
/// 算法错误标记
/// </summary>
public const string ALGORITHM_ERROR_TAG = "算法错误标记,[类型:{0}],<坐标:({1},{2},{3},{4}), 时码: {5}>";
/// <summary>
/// 算法取消错误标记
/// </summary>
public const string ALGORITHM_CANCEL_ERROR_TAG = "算法取消错误标记,[类型:{0}],<时码: {1}>";
}
}
......@@ -23,5 +23,11 @@ namespace VIZ.H2V.Storage
/// </summary>
[Ini(Section = "Algorithm", DefaultValue = "30000", Type = typeof(int))]
public string ALGORITHM_STOP_TIMEOUT { get; set; }
/// <summary>
/// ALGORITHM_TARGET_BOX_LOST_FRAME
/// </summary>
[Ini(Section = "Algorithm", DefaultValue = "25", Type = typeof(int))]
public string ALGORITHM_TARGET_BOX_LOST_FRAME { get; set; }
}
}
......@@ -98,28 +98,13 @@ namespace VIZ.H2V.Storage
public string ActiveCAM4 { get; set; } = "F4";
/// <summary>
/// 错误标记 视图1
/// </summary>
public string ErrorTagCAM1 { get; set; } = "Ctrl + D1";
/// <summary>
/// 错误标记 视图2
/// </summary>
public string ErrorTagCAM2 { get; set; } = "Ctrl + D2";
/// <summary>
/// 错误标记 视图3
/// </summary>
public string ErrorTagCAM3 { get; set; } = "Ctrl + D3";
/// <summary>
/// 错误标记 视图4
/// 错误标记 当前激活的视图
/// </summary>
public string ErrorTagCAM4 { get; set; } = "Ctrl + D4";
public string ErrorTagActivedCAM { get; set; } = "Q";
/// <summary>
/// 错误标记 当前激活的视图
/// 取消错误标记 当前激活的窗口
/// </summary>
public string ErrorTagActivedCAM { get; set; } = "Q";
public string CancelErrorTagActivedCAM { get; set; } = "R";
}
}
......@@ -80,4 +80,6 @@ ALGORITHM_PYTHON_PATH=E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.
;算法停止超时时间(单位:毫秒)
ALGORITHM_STOP_TIMEOUT=5000
;是否显示目标框
ALGORITHM_IS_SHOW_TARGET_BOX=true
\ No newline at end of file
ALGORITHM_IS_SHOW_TARGET_BOX=true
;算法目标框连续丢失帧数(如果目标框连续丢失则改变指示灯状态)
ALGORITHM_TARGET_BOX_LOST_FRAME=25
\ No newline at end of file
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