Commit 3b537ef3 by liulongfei

1. Excel 配置文件改为 CSV文件

2. 添加霄云中心两台测试机MAC地址
3. 添加算法命令 set_params
4. 添加算法场景设置
5. 修复手动模式切换为自动模式时界面闪烁的问题
6. 添加裁切FPS、算法FPS统计
parent 6c2a9b5c
...@@ -28,6 +28,14 @@ namespace VIZ.H2V.Connection ...@@ -28,6 +28,14 @@ namespace VIZ.H2V.Connection
public const string tracking = "tracking"; public const string tracking = "tracking";
/// <summary> /// <summary>
/// 设置参数
/// </summary>
/// <remarks>
/// 1. 目前只有单人机位生效
/// </remarks>
public const string set_params = "set_params";
/// <summary>
/// 边线检测 /// 边线检测
/// <see cref="VIZ.H2V.Storage.AlgorithmStrategyType"/> /// <see cref="VIZ.H2V.Storage.AlgorithmStrategyType"/>
/// </summary> /// </summary>
......
...@@ -25,6 +25,6 @@ namespace VIZ.H2V.Connection ...@@ -25,6 +25,6 @@ namespace VIZ.H2V.Connection
/// <summary> /// <summary>
/// 边线检测点 /// 边线检测点
/// </summary> /// </summary>
public AlgorithmInfo_boarderpoint boarderpoint { get; set; } public AlgorithmInfo_borderpoint borderpoint { get; set; }
} }
} }
...@@ -48,6 +48,6 @@ namespace VIZ.H2V.Connection ...@@ -48,6 +48,6 @@ namespace VIZ.H2V.Connection
/// <remarks> /// <remarks>
/// 对应 cmd = borderline_correction 时有值 /// 对应 cmd = borderline_correction 时有值
/// </remarks> /// </remarks>
public AlgorithmInfo_boarderpoint boarderpoint { get; set; } public AlgorithmInfo_borderpoint borderpoint { get; set; }
} }
} }
...@@ -48,6 +48,6 @@ namespace VIZ.H2V.Connection ...@@ -48,6 +48,6 @@ namespace VIZ.H2V.Connection
/// <remarks> /// <remarks>
/// 对应 cmd = borderline_correction 时有值 /// 对应 cmd = borderline_correction 时有值
/// </remarks> /// </remarks>
public AlgorithmInfo_boarderpoint boarderpoint { get; set; } public AlgorithmInfo_borderpoint borderpoint { get; set; }
} }
} }
...@@ -48,6 +48,6 @@ namespace VIZ.H2V.Connection ...@@ -48,6 +48,6 @@ namespace VIZ.H2V.Connection
/// <remarks> /// <remarks>
/// 对应 cmd = borderline_correction 时有值 /// 对应 cmd = borderline_correction 时有值
/// </remarks> /// </remarks>
public AlgorithmInfo_boarderpoint boarderpoint { get; set; } public AlgorithmInfo_borderpoint borderpoint { get; set; }
} }
} }
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
...@@ -19,8 +19,8 @@ namespace VIZ.H2V.Domain ...@@ -19,8 +19,8 @@ namespace VIZ.H2V.Domain
public static LiteDbContext LiteDbContext { get; set; } public static LiteDbContext LiteDbContext { get; set; }
/// <summary> /// <summary>
/// Exceel数据上下文 /// CSV数据上下文
/// </summary> /// </summary>
public static ExcelContext ExcelContext { get; set; } public static CsvContext CsvContext { get; set; }
} }
} }
...@@ -9,7 +9,7 @@ namespace VIZ.H2V.Domain ...@@ -9,7 +9,7 @@ namespace VIZ.H2V.Domain
/// <summary> /// <summary>
/// 算法信息,边线点,在边线检测点击边线是发送 /// 算法信息,边线点,在边线检测点击边线是发送
/// </summary> /// </summary>
public class AlgorithmInfo_boarderpoint public class AlgorithmInfo_borderpoint
{ {
/// <summary> /// <summary>
/// 上方线 坐标点 /// 上方线 坐标点
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<Compile Include="Enum\NDIViewKeys.cs" /> <Compile Include="Enum\NDIViewKeys.cs" />
<Compile Include="Enum\NDIViewStatus.cs" /> <Compile Include="Enum\NDIViewStatus.cs" />
<Compile Include="Enum\ServiceKeys.cs" /> <Compile Include="Enum\ServiceKeys.cs" />
<Compile Include="Info\AlgorithmInfo_boarderpoint.cs" /> <Compile Include="Info\AlgorithmInfo_borderpoint.cs" />
<Compile Include="Info\AlgorithmInfo_borderline.cs" /> <Compile Include="Info\AlgorithmInfo_borderline.cs" />
<Compile Include="Message\Algorithm\AlgorithmMessageBase.cs" /> <Compile Include="Message\Algorithm\AlgorithmMessageBase.cs" />
<Compile Include="Message\Algorithm\AlgorithmMessage__detect.cs" /> <Compile Include="Message\Algorithm\AlgorithmMessage__detect.cs" />
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
...@@ -137,6 +137,7 @@ ...@@ -137,6 +137,7 @@
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
...@@ -52,10 +52,10 @@ ...@@ -52,10 +52,10 @@
<ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_1}" Grid.Row="0" Grid.Column="0" Margin="30"></local:NDIView> <local:NDIView x:Name="view_CAM_1" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_1}" Grid.Row="0" Grid.Column="0" Margin="30"></local:NDIView>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_2}" Grid.Row="0" Grid.Column="1" Margin="30"></local:NDIView> <local:NDIView x:Name="view_CAM_2" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_3}" Grid.Row="1" Grid.Column="0" Margin="30"></local:NDIView>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_3}" Grid.Row="1" Grid.Column="0" Margin="30"></local:NDIView> <local:NDIView x:Name="view_CAM_3" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_4}" Grid.Row="1" Grid.Column="1" Margin="30"></local:NDIView>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_4}" Grid.Row="1" Grid.Column="1" Margin="30"></local:NDIView> <local:NDIView x:Name="view_CAM_4" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_2}" Grid.Row="0" Grid.Column="1" Margin="30"></local:NDIView>
</Grid> </Grid>
<!-- 底部 --> <!-- 底部 -->
<Border Grid.Row="2" Background="#ff12202d"> <Border Grid.Row="2" Background="#ff12202d">
...@@ -66,13 +66,13 @@ ...@@ -66,13 +66,13 @@
<ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- 算法服务监控 --> <!-- 算法服务监控 -->
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal" Background="Transparent">
<Image Width="18" Height="18" VerticalAlignment="Center" <Image Width="18" Height="18" VerticalAlignment="Center"
Source="/VIZ.H2V.Module.Resource;component/Icons/status_25x22.png"></Image> Source="/VIZ.H2V.Module.Resource;component/Icons/status_25x22.png"></Image>
<TextBlock Text="算法服务" VerticalAlignment="Center" Foreground="White" FontSize="12" Margin="10,0,0,0"></TextBlock> <TextBlock Text="算法服务" VerticalAlignment="Center" Foreground="White" FontSize="12" Margin="10,0,0,0"></TextBlock>
</StackPanel> </StackPanel>
<!-- 剪切服务监控 --> <!-- 剪切服务监控 -->
<StackPanel Orientation="Horizontal" Grid.Column="1"> <StackPanel Orientation="Horizontal" Grid.Column="1" Background="Transparent">
<Image Width="18" Height="18" VerticalAlignment="Center" <Image Width="18" Height="18" VerticalAlignment="Center"
Source="/VIZ.H2V.Module.Resource;component/Icons/status_25x22.png"></Image> Source="/VIZ.H2V.Module.Resource;component/Icons/status_25x22.png"></Image>
<TextBlock Text="剪切服务" VerticalAlignment="Center" Foreground="White" FontSize="12" Margin="10,0,0,0"></TextBlock> <TextBlock Text="剪切服务" VerticalAlignment="Center" Foreground="White" FontSize="12" Margin="10,0,0,0"></TextBlock>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:VIZ.H2V.Module" xmlns:local="clr-namespace:VIZ.H2V.Module"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common" xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
d:DataContext="{d:DesignInstance Type=local:AlgorithmSettingPanelViewModel}" d:DataContext="{d:DesignInstance Type=local:AlgorithmSixteenPanelViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1000"> d:DesignHeight="800" d:DesignWidth="1000">
<UserControl.Resources> <UserControl.Resources>
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- 无球时自动跟人 --> <!-- 无球时自动跟人 -->
...@@ -142,6 +143,27 @@ ...@@ -142,6 +143,27 @@
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
</Grid> </Grid>
<!-- 场景 -->
<Grid Grid.Row="7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="380"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="场景" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="6"></TextBlock>
<ComboBox Grid.Column="1" Style="{StaticResource ComboBox_Setting}" Height="40"
ItemsSource="{Binding Path=Scences,Mode=OneWay}"
SelectedValue="{Binding Path=SelectedScence,Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Grid Background="Transparent" IsHitTestVisible="False">
<TextBlock Text="{Binding .}" VerticalAlignment="Center" HorizontalAlignment="Left"
Grid.Column="3" Foreground="White" FontSize="14"></TextBlock>
</Grid>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</Grid> </Grid>
</Border> </Border>
</UserControl> </UserControl>
\ No newline at end of file
...@@ -139,6 +139,14 @@ namespace VIZ.H2V.Module ...@@ -139,6 +139,14 @@ namespace VIZ.H2V.Module
this.NoBallAutoChangeToPerson = config.NoBallAutoChangeToPerson; this.NoBallAutoChangeToPerson = config.NoBallAutoChangeToPerson;
this.SmoothCoeff = config.SmoothCoeff; this.SmoothCoeff = config.SmoothCoeff;
this.KeepPrevFrame = config.KeepPrevFrame; this.KeepPrevFrame = config.KeepPrevFrame;
// 场景信息
AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.StrategyType);
if (strategy == null)
return;
this.Scences = strategy.Scenes?.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)?.ToList();
this.SelectedScence = (this.Scences?.Contains(this.Config.Scene) == true) ? this.Config.Scene : this.Scences?.FirstOrDefault();
} }
/// <summary> /// <summary>
...@@ -177,6 +185,9 @@ namespace VIZ.H2V.Module ...@@ -177,6 +185,9 @@ namespace VIZ.H2V.Module
if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU) if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU)
return true; return true;
if (this.SelectedScence != this.Config.Scene)
return true;
return false; return false;
} }
...@@ -189,6 +200,9 @@ namespace VIZ.H2V.Module ...@@ -189,6 +200,9 @@ namespace VIZ.H2V.Module
if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU) if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU)
return true; return true;
if (this.SelectedScence != this.Config.Scene)
return true;
return false; return false;
} }
...@@ -213,6 +227,7 @@ namespace VIZ.H2V.Module ...@@ -213,6 +227,7 @@ namespace VIZ.H2V.Module
this.Config.NoBallAutoChangeToPerson = this.NoBallAutoChangeToPerson; this.Config.NoBallAutoChangeToPerson = this.NoBallAutoChangeToPerson;
this.Config.SmoothCoeff = this.SmoothCoeff; this.Config.SmoothCoeff = this.SmoothCoeff;
this.Config.KeepPrevFrame = this.KeepPrevFrame; this.Config.KeepPrevFrame = this.KeepPrevFrame;
this.Config.Scene = this.SelectedScence;
this.ViewConfig.GPU = this.SelectedGpuInfo?.Physics ?? 0; this.ViewConfig.GPU = this.SelectedGpuInfo?.Physics ?? 0;
ApplicationDomainEx.LiteDbContext.AlgorithmCableway.Upsert(this.Config); ApplicationDomainEx.LiteDbContext.AlgorithmCableway.Upsert(this.Config);
......
...@@ -141,6 +141,14 @@ namespace VIZ.H2V.Module ...@@ -141,6 +141,14 @@ namespace VIZ.H2V.Module
this.NoBallAutoChangeToPerson = config.NoBallAutoChangeToPerson; this.NoBallAutoChangeToPerson = config.NoBallAutoChangeToPerson;
this.SmoothCoeff = config.SmoothCoeff; this.SmoothCoeff = config.SmoothCoeff;
this.KeepPrevFrame = config.KeepPrevFrame; this.KeepPrevFrame = config.KeepPrevFrame;
// 场景信息
AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.StrategyType);
if (strategy == null)
return;
this.Scences = strategy.Scenes?.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)?.ToList();
this.SelectedScence = (this.Scences?.Contains(this.Config.Scene) == true) ? this.Config.Scene : this.Scences?.FirstOrDefault();
} }
/// <summary> /// <summary>
...@@ -179,6 +187,9 @@ namespace VIZ.H2V.Module ...@@ -179,6 +187,9 @@ namespace VIZ.H2V.Module
if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU) if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU)
return true; return true;
if (this.SelectedScence != this.Config.Scene)
return true;
return false; return false;
} }
...@@ -191,6 +202,9 @@ namespace VIZ.H2V.Module ...@@ -191,6 +202,9 @@ namespace VIZ.H2V.Module
if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU) if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU)
return true; return true;
if (this.SelectedScence != this.Config.Scene)
return true;
return false; return false;
} }
...@@ -215,6 +229,7 @@ namespace VIZ.H2V.Module ...@@ -215,6 +229,7 @@ namespace VIZ.H2V.Module
this.Config.NoBallAutoChangeToPerson = this.NoBallAutoChangeToPerson; this.Config.NoBallAutoChangeToPerson = this.NoBallAutoChangeToPerson;
this.Config.SmoothCoeff = this.SmoothCoeff; this.Config.SmoothCoeff = this.SmoothCoeff;
this.Config.KeepPrevFrame = this.KeepPrevFrame; this.Config.KeepPrevFrame = this.KeepPrevFrame;
this.Config.Scene = this.SelectedScence;
ApplicationDomainEx.LiteDbContext.AlgorithmNear.Upsert(this.Config); ApplicationDomainEx.LiteDbContext.AlgorithmNear.Upsert(this.Config);
......
...@@ -90,6 +90,34 @@ namespace VIZ.H2V.Module ...@@ -90,6 +90,34 @@ namespace VIZ.H2V.Module
#endregion #endregion
#region Scences -- 场景信息集合
private List<string> scence;
/// <summary>
/// 场景信息集合
/// </summary>
public List<string> Scences
{
get { return scence; }
set { scence = value; this.RaisePropertyChanged(nameof(Scences)); }
}
#endregion
#region SelectedScence -- 选中的场景
private string selectedScence;
/// <summary>
/// 选中的场景
/// </summary>
public string SelectedScence
{
get { return selectedScence; }
set { selectedScence = value; this.RaisePropertyChanged(nameof(SelectedScence)); }
}
#endregion
#region KeepPrevFrame -- 维持上一帧位置 #region KeepPrevFrame -- 维持上一帧位置
private int keepPrevFrame; private int keepPrevFrame;
......
...@@ -40,6 +40,14 @@ namespace VIZ.H2V.Module ...@@ -40,6 +40,14 @@ namespace VIZ.H2V.Module
this.SmoothCoeff = config.SmoothCoeff; this.SmoothCoeff = config.SmoothCoeff;
this.KeepPrevFrame = config.KeepPrevFrame; this.KeepPrevFrame = config.KeepPrevFrame;
// 场景信息
AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.StrategyType);
if (strategy == null)
return;
this.Scences = strategy.Scenes?.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)?.ToList();
this.SelectedScence = (this.Scences?.Contains(this.Config.Scene) == true) ? this.Config.Scene : this.Scences?.FirstOrDefault();
} }
/// <summary> /// <summary>
...@@ -60,6 +68,9 @@ namespace VIZ.H2V.Module ...@@ -60,6 +68,9 @@ namespace VIZ.H2V.Module
if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU) if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU)
return true; return true;
if (this.SelectedScence != this.Config.Scene)
return true;
return false; return false;
} }
...@@ -72,6 +83,9 @@ namespace VIZ.H2V.Module ...@@ -72,6 +83,9 @@ namespace VIZ.H2V.Module
if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU) if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU)
return true; return true;
if (this.SelectedScence != this.Config.Scene)
return true;
return false; return false;
} }
...@@ -83,6 +97,7 @@ namespace VIZ.H2V.Module ...@@ -83,6 +97,7 @@ namespace VIZ.H2V.Module
// 保存值 // 保存值
this.Config.SmoothCoeff = this.SmoothCoeff; this.Config.SmoothCoeff = this.SmoothCoeff;
this.Config.KeepPrevFrame = this.KeepPrevFrame; this.Config.KeepPrevFrame = this.KeepPrevFrame;
this.Config.Scene = this.SelectedScence;
this.ViewConfig.GPU = this.SelectedGpuInfo?.Physics ?? 0; this.ViewConfig.GPU = this.SelectedGpuInfo?.Physics ?? 0;
ApplicationDomainEx.LiteDbContext.AlgorithmSingle.Upsert(this.Config); ApplicationDomainEx.LiteDbContext.AlgorithmSingle.Upsert(this.Config);
......
...@@ -139,6 +139,14 @@ namespace VIZ.H2V.Module ...@@ -139,6 +139,14 @@ namespace VIZ.H2V.Module
this.NoBallAutoChangeToPerson = config.NoBallAutoChangeToPerson; this.NoBallAutoChangeToPerson = config.NoBallAutoChangeToPerson;
this.SmoothCoeff = config.SmoothCoeff; this.SmoothCoeff = config.SmoothCoeff;
this.KeepPrevFrame = config.KeepPrevFrame; this.KeepPrevFrame = config.KeepPrevFrame;
// 场景信息
AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.StrategyType);
if (strategy == null)
return;
this.Scences = strategy.Scenes?.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)?.ToList();
this.SelectedScence = (this.Scences?.Contains(this.Config.Scene) == true) ? this.Config.Scene : this.Scences?.FirstOrDefault();
} }
/// <summary> /// <summary>
...@@ -177,6 +185,9 @@ namespace VIZ.H2V.Module ...@@ -177,6 +185,9 @@ namespace VIZ.H2V.Module
if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU) if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU)
return true; return true;
if (this.SelectedScence != this.Config.Scene)
return true;
return false; return false;
} }
...@@ -189,6 +200,9 @@ namespace VIZ.H2V.Module ...@@ -189,6 +200,9 @@ namespace VIZ.H2V.Module
if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU) if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU)
return true; return true;
if (this.SelectedScence != this.Config.Scene)
return true;
return false; return false;
} }
...@@ -213,6 +227,7 @@ namespace VIZ.H2V.Module ...@@ -213,6 +227,7 @@ namespace VIZ.H2V.Module
this.Config.NoBallAutoChangeToPerson = this.NoBallAutoChangeToPerson; this.Config.NoBallAutoChangeToPerson = this.NoBallAutoChangeToPerson;
this.Config.SmoothCoeff = this.SmoothCoeff; this.Config.SmoothCoeff = this.SmoothCoeff;
this.Config.KeepPrevFrame = this.KeepPrevFrame; this.Config.KeepPrevFrame = this.KeepPrevFrame;
this.Config.Scene = this.SelectedScence;
this.ViewConfig.GPU = this.SelectedGpuInfo?.Physics ?? 0; this.ViewConfig.GPU = this.SelectedGpuInfo?.Physics ?? 0;
ApplicationDomainEx.LiteDbContext.AlgorithmSixteen.Upsert(this.Config); ApplicationDomainEx.LiteDbContext.AlgorithmSixteen.Upsert(this.Config);
......
...@@ -139,6 +139,14 @@ namespace VIZ.H2V.Module ...@@ -139,6 +139,14 @@ namespace VIZ.H2V.Module
this.NoBallAutoChangeToPerson = config.NoBallAutoChangeToPerson; this.NoBallAutoChangeToPerson = config.NoBallAutoChangeToPerson;
this.SmoothCoeff = config.SmoothCoeff; this.SmoothCoeff = config.SmoothCoeff;
this.KeepPrevFrame = config.KeepPrevFrame; this.KeepPrevFrame = config.KeepPrevFrame;
// 场景信息
AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.StrategyType);
if (strategy == null)
return;
this.Scences = strategy.Scenes?.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)?.ToList();
this.SelectedScence = (this.Scences?.Contains(this.Config.Scene) == true) ? this.Config.Scene : this.Scences?.FirstOrDefault();
} }
/// <summary> /// <summary>
...@@ -177,6 +185,9 @@ namespace VIZ.H2V.Module ...@@ -177,6 +185,9 @@ namespace VIZ.H2V.Module
if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU) if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU)
return true; return true;
if (this.SelectedScence != this.Config.Scene)
return true;
return false; return false;
} }
...@@ -189,6 +200,9 @@ namespace VIZ.H2V.Module ...@@ -189,6 +200,9 @@ namespace VIZ.H2V.Module
if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU) if (this.SelectedGpuInfo.Physics != this.ViewConfig.GPU)
return true; return true;
if (this.SelectedScence != this.Config.Scene)
return true;
return false; return false;
} }
...@@ -213,6 +227,7 @@ namespace VIZ.H2V.Module ...@@ -213,6 +227,7 @@ namespace VIZ.H2V.Module
this.Config.NoBallAutoChangeToPerson = this.NoBallAutoChangeToPerson; this.Config.NoBallAutoChangeToPerson = this.NoBallAutoChangeToPerson;
this.Config.SmoothCoeff = this.SmoothCoeff; this.Config.SmoothCoeff = this.SmoothCoeff;
this.Config.KeepPrevFrame = this.KeepPrevFrame; this.Config.KeepPrevFrame = this.KeepPrevFrame;
this.Config.Scene = this.SelectedScence;
this.ViewConfig.GPU = this.SelectedGpuInfo?.Physics ?? 0; this.ViewConfig.GPU = this.SelectedGpuInfo?.Physics ?? 0;
ApplicationDomainEx.LiteDbContext.AlgorithmTactics.Upsert(this.Config); ApplicationDomainEx.LiteDbContext.AlgorithmTactics.Upsert(this.Config);
......
...@@ -116,12 +116,12 @@ namespace VIZ.H2V.Module ...@@ -116,12 +116,12 @@ namespace VIZ.H2V.Module
vm.Settings.Add(this); vm.Settings.Add(this);
// 加载算法分类信息 // 加载算法分类信息
if (ApplicationDomainEx.ExcelContext.AlgorithmStrategys == null) if (ApplicationDomainEx.CsvContext.AlgorithmStrategys == null)
return; return;
List<AlgorithmStrategyModel> list = new List<AlgorithmStrategyModel>(); List<AlgorithmStrategyModel> list = new List<AlgorithmStrategyModel>();
AlgorithmStrategyModel selected = null; AlgorithmStrategyModel selected = null;
foreach (AlgorithmStrategy entity in ApplicationDomainEx.ExcelContext.AlgorithmStrategys) foreach (AlgorithmStrategy entity in ApplicationDomainEx.CsvContext.AlgorithmStrategys)
{ {
AlgorithmStrategyModel model = new AlgorithmStrategyModel(); AlgorithmStrategyModel model = new AlgorithmStrategyModel();
model.ID = entity.ID; model.ID = entity.ID;
...@@ -219,7 +219,7 @@ namespace VIZ.H2V.Module ...@@ -219,7 +219,7 @@ namespace VIZ.H2V.Module
if (service == null) if (service == null)
return false; return false;
AlgorithmStrategy strategy = ApplicationDomainEx.ExcelContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.ViewConfig.StrategyType); AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.ViewConfig.StrategyType);
if (strategy != null) if (strategy != null)
{ {
// 设置算法显示名称 // 设置算法显示名称
......
...@@ -41,6 +41,11 @@ namespace VIZ.H2V.Module ...@@ -41,6 +41,11 @@ namespace VIZ.H2V.Module
} }
/// <summary> /// <summary>
/// 算法python.exe路径(绝对路径)
/// </summary>
protected readonly string ALGORITHM_PYTHON_PATH = ApplicationDomainEx.IniStorage.GetValue<AlgorithmConfig, string>(p => p.ALGORITHM_PYTHON_PATH);
/// <summary>
/// 算法停止超时时间 /// 算法停止超时时间
/// </summary> /// </summary>
protected readonly int ALGORITHM_STOP_TIMEOUT = ApplicationDomainEx.IniStorage.GetValue<AlgorithmConfig, int>(p => p.ALGORITHM_STOP_TIMEOUT); protected readonly int ALGORITHM_STOP_TIMEOUT = ApplicationDomainEx.IniStorage.GetValue<AlgorithmConfig, int>(p => p.ALGORITHM_STOP_TIMEOUT);
...@@ -172,10 +177,21 @@ namespace VIZ.H2V.Module ...@@ -172,10 +177,21 @@ namespace VIZ.H2V.Module
public abstract void Tracking(TrackingBoxInfo box); public abstract void Tracking(TrackingBoxInfo box);
/// <summary> /// <summary>
/// 设置参数
/// </summary>
public abstract void SetParams();
/// <summary>
/// 边线检测 /// 边线检测
/// </summary> /// </summary>
/// <param name="boarderpoint">边线检测点</param> /// <param name="boarderpoint">边线检测点</param>
public abstract void BorderPoint(AlgorithmInfo_boarderpoint boarderpoint); public abstract void BorderPoint(AlgorithmInfo_borderpoint boarderpoint);
/// <summary>
/// 获取配置信息
/// </summary>
/// <returns>配置信息</returns>
public abstract AlgorithmBase GetConfig();
/// <summary> /// <summary>
/// 执行重启算法 /// 执行重启算法
...@@ -322,7 +338,7 @@ namespace VIZ.H2V.Module ...@@ -322,7 +338,7 @@ namespace VIZ.H2V.Module
private bool ExecuteRestartAlgorithm_StartProcess() private bool ExecuteRestartAlgorithm_StartProcess()
{ {
// 算法配置 // 算法配置
AlgorithmStrategy strategy = ApplicationDomainEx.ExcelContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.Support.ViewConfig.StrategyType); AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.Support.ViewConfig.StrategyType);
if (strategy == null) if (strategy == null)
{ {
log.Error($"未找到对应算法'{this.Support.ViewConfig.StrategyType}'的配置信息"); log.Error($"未找到对应算法'{this.Support.ViewConfig.StrategyType}'的配置信息");
...@@ -337,6 +353,9 @@ namespace VIZ.H2V.Module ...@@ -337,6 +353,9 @@ namespace VIZ.H2V.Module
return false; return false;
} }
// 获取配置
AlgorithmBase config = this.GetConfig();
// 端口 // 端口
int port = this.Support.ProcessModel.Port; int port = this.Support.ProcessModel.Port;
// NDI流名称 // NDI流名称
...@@ -357,14 +376,10 @@ namespace VIZ.H2V.Module ...@@ -357,14 +376,10 @@ namespace VIZ.H2V.Module
fullPath = new Uri(new Uri(AppDomain.CurrentDomain.BaseDirectory), uri).LocalPath; fullPath = new Uri(new Uri(AppDomain.CurrentDomain.BaseDirectory), uri).LocalPath;
} }
string dir = System.IO.Path.GetDirectoryName(fullPath);
string fileName = System.IO.Path.GetFileName(fullPath);
Process proc = new Process(); Process proc = new Process();
proc.StartInfo.WorkingDirectory = dir;
proc.StartInfo.UseShellExecute = true; proc.StartInfo.UseShellExecute = true;
proc.StartInfo.FileName = fileName; proc.StartInfo.FileName = ALGORITHM_PYTHON_PATH;
proc.StartInfo.Arguments = $"--port=\"{port}\" --ndi_name=\"{ndi_name}\" --id=\"{id}\" --device=\"{device}\" --vis_port=\"{CLIENT_PORT}\""; proc.StartInfo.Arguments = $"\"{fullPath}\" --port=\"{port}\" --ndi_name=\"{ndi_name}\" --id=\"{id}\" --device=\"{device}\" --vis_port=\"{CLIENT_PORT}\" --scenes=\"{config.Scene ?? string.Empty}\"";
proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal; proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
if (!proc.Start()) if (!proc.Start())
...@@ -395,7 +410,7 @@ namespace VIZ.H2V.Module ...@@ -395,7 +410,7 @@ namespace VIZ.H2V.Module
{ {
// 添加新的UDP管理器 // 添加新的UDP管理器
string clientIP = ApplicationDomainEx.IniStorage.GetValue<UdpConfig, string>(p => p.UDP_BINDING_IP); string clientIP = ApplicationDomainEx.IniStorage.GetValue<UdpConfig, string>(p => p.UDP_BINDING_IP);
AlgorithmStrategy strategy = ApplicationDomainEx.ExcelContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.Support.ViewConfig.StrategyType); AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.Support.ViewConfig.StrategyType);
if (strategy == null) if (strategy == null)
{ {
...@@ -416,7 +431,7 @@ namespace VIZ.H2V.Module ...@@ -416,7 +431,7 @@ namespace VIZ.H2V.Module
} }
// 添加裁切系统UDP管理器 // 添加裁切系统UDP管理器
ClipSystem clip = ApplicationDomainEx.ExcelContext.ClipSystems.FirstOrDefault(p => (this.Support.ViewConfig?.StreamName ?? string.Empty).Contains(p.NDI_NAME)); ClipSystem clip = ApplicationDomainEx.CsvContext.ClipSystems.FirstOrDefault(p => (this.Support.ViewConfig?.StreamName ?? string.Empty).Contains(p.NDI_NAME));
if (clip == null) if (clip == null)
{ {
log.Error($"未找到NDI流: {this.Support.ViewConfig.StreamName} 对应裁切系统端口"); log.Error($"未找到NDI流: {this.Support.ViewConfig.StreamName} 对应裁切系统端口");
......
...@@ -54,10 +54,15 @@ namespace VIZ.H2V.Module ...@@ -54,10 +54,15 @@ namespace VIZ.H2V.Module
void Tracking(TrackingBoxInfo box); void Tracking(TrackingBoxInfo box);
/// <summary> /// <summary>
/// 设置参数
/// </summary>
void SetParams();
/// <summary>
/// 边线检测 /// 边线检测
/// </summary> /// </summary>
/// <param name="boarderpoint">边线检测点</param> /// <param name="boarderpoint">边线检测点</param>
void BorderPoint(AlgorithmInfo_boarderpoint boarderpoint); void BorderPoint(AlgorithmInfo_borderpoint boarderpoint);
/// <summary> /// <summary>
/// 切换至无模式 /// 切换至无模式
...@@ -79,5 +84,11 @@ namespace VIZ.H2V.Module ...@@ -79,5 +84,11 @@ namespace VIZ.H2V.Module
/// </summary> /// </summary>
/// <param name="context">切换模式上下文</param> /// <param name="context">切换模式上下文</param>
void ChangeAutoMode(ChangeStrategyContext context); void ChangeAutoMode(ChangeStrategyContext context);
/// <summary>
/// 获取配置信息
/// </summary>
/// <returns>配置信息</returns>
AlgorithmBase GetConfig();
} }
} }
...@@ -79,5 +79,11 @@ namespace VIZ.H2V.Module ...@@ -79,5 +79,11 @@ namespace VIZ.H2V.Module
/// 重置3D鼠标 /// 重置3D鼠标
/// </summary> /// </summary>
void Reset3DMouse(); void Reset3DMouse();
/// <summary>
/// 清理视频控件
/// </summary>
/// <param name="context">清理视频控件上下文</param>
void ClearVideoControl(ClearVideoControlContext context);
} }
} }
...@@ -12,12 +12,12 @@ using VIZ.H2V.Storage; ...@@ -12,12 +12,12 @@ using VIZ.H2V.Storage;
namespace VIZ.H2V.Module namespace VIZ.H2V.Module
{ {
/// <summary> /// <summary>
/// 算法控制器 -- 16米机位 /// 算法控制器 -- 索道机位
/// </summary> /// </summary>
public class AlgorithmController_Cableway : AlgorithmControllerBase public class AlgorithmController_Cableway : AlgorithmControllerBase
{ {
/// <summary> /// <summary>
/// 算法控制器 -- 16米机位 /// 算法控制器 -- 索道机位
/// </summary> /// </summary>
/// <param name="support">算法支持</param> /// <param name="support">算法支持</param>
public AlgorithmController_Cableway(IAlgorithmSupport support) : base(support, AlgorithmStrategyType.Cableway) public AlgorithmController_Cableway(IAlgorithmSupport support) : base(support, AlgorithmStrategyType.Cableway)
...@@ -35,7 +35,7 @@ namespace VIZ.H2V.Module ...@@ -35,7 +35,7 @@ namespace VIZ.H2V.Module
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
AlgorithmSender.AutoMode(manager, this.BuildPackage(), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params), option);
} }
/// <summary> /// <summary>
...@@ -51,7 +51,7 @@ namespace VIZ.H2V.Module ...@@ -51,7 +51,7 @@ namespace VIZ.H2V.Module
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
AlgorithmSender.AutoMode(manager, this.BuildPackage(), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params), option);
} }
/// <summary> /// <summary>
...@@ -72,25 +72,44 @@ namespace VIZ.H2V.Module ...@@ -72,25 +72,44 @@ namespace VIZ.H2V.Module
} }
/// <summary> /// <summary>
/// 设置参数
/// </summary>
public override void SetParams()
{
}
/// <summary>
/// 边线检测校准 /// 边线检测校准
/// </summary> /// </summary>
/// <param name="boarderpoint">边线检测校准点</param> /// <param name="boarderpoint">边线检测校准点</param>
public override void BorderPoint(AlgorithmInfo_boarderpoint boarderpoint) public override void BorderPoint(AlgorithmInfo_borderpoint boarderpoint)
{ {
} }
/// <summary> /// <summary>
/// 获取配置信息
/// </summary>
/// <returns>配置信息</returns>
public override AlgorithmBase GetConfig()
{
return ApplicationDomainEx.LiteDbContext.AlgorithmCableway.FindOne(p => p.ViewKey == this.Support.ViewKey);
}
/// <summary>
/// 构建数据包 /// 构建数据包
/// </summary> /// </summary>
/// <param name="cmd">命令<see cref="AlgorithmAutoModeCmd"/></param>
/// <returns>数据包</returns> /// <returns>数据包</returns>
public AlgorithmPackage__auto_mode_Cableway BuildPackage() public AlgorithmPackage__auto_mode_Cableway BuildPackage(string cmd)
{ {
AlgorithmCableway config = ApplicationDomainEx.LiteDbContext.AlgorithmCableway.FindOne(p => p.ViewKey == this.Support.ViewKey); AlgorithmCableway config = ApplicationDomainEx.LiteDbContext.AlgorithmCableway.FindOne(p => p.ViewKey == this.Support.ViewKey);
if (config == null) if (config == null)
return null; return null;
AlgorithmPackage__auto_mode_Cableway package = new AlgorithmPackage__auto_mode_Cableway(); AlgorithmPackage__auto_mode_Cableway package = new AlgorithmPackage__auto_mode_Cableway();
package.cmd = cmd;
package.smooth = config.SmoothCoeff; package.smooth = config.SmoothCoeff;
package.max_fixed_frames = config.KeepPrevFrame; package.max_fixed_frames = config.KeepPrevFrame;
package.min_human_area = config.PersonAreaProportion / 100d; package.min_human_area = config.PersonAreaProportion / 100d;
......
...@@ -35,7 +35,7 @@ namespace VIZ.H2V.Module ...@@ -35,7 +35,7 @@ namespace VIZ.H2V.Module
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
AlgorithmSender.AutoMode(manager, this.BuildPackage(null), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params, null), option);
} }
/// <summary> /// <summary>
...@@ -51,7 +51,7 @@ namespace VIZ.H2V.Module ...@@ -51,7 +51,7 @@ namespace VIZ.H2V.Module
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
AlgorithmSender.AutoMode(manager, this.BuildPackage(null), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params, null), option);
} }
/// <summary> /// <summary>
...@@ -72,10 +72,18 @@ namespace VIZ.H2V.Module ...@@ -72,10 +72,18 @@ namespace VIZ.H2V.Module
} }
/// <summary> /// <summary>
/// 设置参数
/// </summary>
public override void SetParams()
{
}
/// <summary>
/// 边线检测校准 /// 边线检测校准
/// </summary> /// </summary>
/// <param name="boarderpoint">边线检测校准点</param> /// <param name="boarderpoint">边线检测校准点</param>
public override void BorderPoint(AlgorithmInfo_boarderpoint boarderpoint) public override void BorderPoint(AlgorithmInfo_borderpoint boarderpoint)
{ {
if (boarderpoint == null) if (boarderpoint == null)
return; return;
...@@ -85,23 +93,34 @@ namespace VIZ.H2V.Module ...@@ -85,23 +93,34 @@ namespace VIZ.H2V.Module
AlgorithmSenderOption option = new AlgorithmSenderOption(); AlgorithmSenderOption option = new AlgorithmSenderOption();
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
option.boarderpoint = new AlgorithmInfo_boarderpoint(); option.borderpoint = new AlgorithmInfo_borderpoint();
AlgorithmSender.AutoMode(manager, this.BuildPackage(boarderpoint), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params, boarderpoint), option);
}
/// <summary>
/// 获取配置信息
/// </summary>
/// <returns>配置信息</returns>
public override AlgorithmBase GetConfig()
{
return ApplicationDomainEx.LiteDbContext.AlgorithmNear.FindOne(p => p.ViewKey == this.Support.ViewKey);
} }
/// <summary> /// <summary>
/// 构建数据包 /// 构建数据包
/// </summary> /// </summary>
/// <param name="cmd">命令<see cref="AlgorithmAutoModeCmd"/></param>
/// <param name="boarderpoint">边框检测点</param> /// <param name="boarderpoint">边框检测点</param>
/// <returns>数据包</returns> /// <returns>数据包</returns>
private AlgorithmPackage__auto_mode_Near BuildPackage(AlgorithmInfo_boarderpoint boarderpoint) private AlgorithmPackage__auto_mode_Near BuildPackage(string cmd, AlgorithmInfo_borderpoint boarderpoint)
{ {
AlgorithmNear config = ApplicationDomainEx.LiteDbContext.AlgorithmNear.FindOne(p => p.ViewKey == this.Support.ViewKey); AlgorithmNear config = ApplicationDomainEx.LiteDbContext.AlgorithmNear.FindOne(p => p.ViewKey == this.Support.ViewKey);
if (config == null) if (config == null)
return null; return null;
AlgorithmPackage__auto_mode_Near package = new AlgorithmPackage__auto_mode_Near(); AlgorithmPackage__auto_mode_Near package = new AlgorithmPackage__auto_mode_Near();
package.cmd = cmd;
package.smooth = config.SmoothCoeff; package.smooth = config.SmoothCoeff;
package.max_fixed_frames = config.KeepPrevFrame; package.max_fixed_frames = config.KeepPrevFrame;
package.min_human_area = config.PersonAreaProportion / 100d; package.min_human_area = config.PersonAreaProportion / 100d;
...@@ -110,7 +129,7 @@ namespace VIZ.H2V.Module ...@@ -110,7 +129,7 @@ namespace VIZ.H2V.Module
package.weight_conf = config.ConfidenceWeight / 100d; package.weight_conf = config.ConfidenceWeight / 100d;
package.weight_distance = config.PositionToCenterWeight / 100d; package.weight_distance = config.PositionToCenterWeight / 100d;
package.auto_follow_human = config.NoBallAutoChangeToPerson ? 1 : 0; package.auto_follow_human = config.NoBallAutoChangeToPerson ? 1 : 0;
package.boarderpoint = boarderpoint; package.borderpoint = boarderpoint;
return package; return package;
} }
......
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using TDx.SpaceMouse.Navigation3D;
using VIZ.Framework.Common; using VIZ.Framework.Common;
using VIZ.Framework.Connection; using VIZ.Framework.Connection;
using VIZ.H2V.Connection; using VIZ.H2V.Connection;
...@@ -29,27 +30,16 @@ namespace VIZ.H2V.Module ...@@ -29,27 +30,16 @@ namespace VIZ.H2V.Module
/// <param name="context">切换模式上下文</param> /// <param name="context">切换模式上下文</param>
public override void ChangeAutoMode(ChangeStrategyContext context) public override void ChangeAutoMode(ChangeStrategyContext context)
{ {
// 视频面板触发需要进入检测状态 // 设置面板触发,那么需要发送设置参数指令
if (context.TriggerScene == NDIViewScene.VideoPanel) if (context.TriggerScene == NDIViewScene.SettingPanel)
{ {
this.Detect(); this.SetParams();
return; return;
} }
// 设置面板触发则根据当前状态确定 // 其他方式触发则切换为检测模式
if (this.Support.ViewStatus == NDIViewStatus.Detect) this.Detect();
{
this.Detect();
return;
}
// 单人机位跟踪命令可以不设置跟踪框
if (this.Support.ViewStatus == NDIViewStatus.CropRoi)
{
this.Tracking(null);
}
} }
/// <summary> /// <summary>
...@@ -93,18 +83,41 @@ namespace VIZ.H2V.Module ...@@ -93,18 +83,41 @@ namespace VIZ.H2V.Module
} }
/// <summary> /// <summary>
/// 设置参数
/// </summary>
public override void SetParams()
{
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;
AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params, null), option);
}
/// <summary>
/// 边线检测校准 /// 边线检测校准
/// </summary> /// </summary>
/// <param name="boarderpoint">边线检测校准点</param> /// <param name="boarderpoint">边线检测校准点</param>
public override void BorderPoint(AlgorithmInfo_boarderpoint boarderpoint) public override void BorderPoint(AlgorithmInfo_borderpoint boarderpoint)
{ {
} }
/// <summary> /// <summary>
/// 获取配置信息
/// </summary>
/// <returns>配置信息</returns>
public override AlgorithmBase GetConfig()
{
return ApplicationDomainEx.LiteDbContext.AlgorithmSingle.FindOne(p => p.ViewKey == this.Support.ViewKey);
}
/// <summary>
/// 构建数据包 /// 构建数据包
/// </summary> /// </summary>
/// <param name="cmd">命令</param> /// <param name="cmd">命令<see cref="AlgorithmAutoModeCmd"/></param>
/// <param name="box">跟踪框</param> /// <param name="box">跟踪框</param>
/// <returns>数据包</returns> /// <returns>数据包</returns>
public AlgorithmPackage__auto_mode_Single BuildPackage(string cmd, TrackingBoxInfo box) public AlgorithmPackage__auto_mode_Single BuildPackage(string cmd, TrackingBoxInfo box)
......
...@@ -35,7 +35,7 @@ namespace VIZ.H2V.Module ...@@ -35,7 +35,7 @@ namespace VIZ.H2V.Module
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
AlgorithmSender.AutoMode(manager, this.BuildPackage(null), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params, null), option);
} }
/// <summary> /// <summary>
...@@ -51,7 +51,7 @@ namespace VIZ.H2V.Module ...@@ -51,7 +51,7 @@ namespace VIZ.H2V.Module
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
AlgorithmSender.AutoMode(manager, this.BuildPackage(null), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params, null), option);
} }
/// <summary> /// <summary>
...@@ -72,10 +72,18 @@ namespace VIZ.H2V.Module ...@@ -72,10 +72,18 @@ namespace VIZ.H2V.Module
} }
/// <summary> /// <summary>
/// 设置参数
/// </summary>
public override void SetParams()
{
}
/// <summary>
/// 边线检测校准 /// 边线检测校准
/// </summary> /// </summary>
/// <param name="boarderpoint">边线检测校准点</param> /// <param name="boarderpoint">边线检测校准点</param>
public override void BorderPoint(AlgorithmInfo_boarderpoint boarderpoint) public override void BorderPoint(AlgorithmInfo_borderpoint boarderpoint)
{ {
if (boarderpoint == null) if (boarderpoint == null)
return; return;
...@@ -85,23 +93,34 @@ namespace VIZ.H2V.Module ...@@ -85,23 +93,34 @@ namespace VIZ.H2V.Module
AlgorithmSenderOption option = new AlgorithmSenderOption(); AlgorithmSenderOption option = new AlgorithmSenderOption();
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
option.boarderpoint = new AlgorithmInfo_boarderpoint(); option.borderpoint = new AlgorithmInfo_borderpoint();
AlgorithmSender.AutoMode(manager, this.BuildPackage(boarderpoint), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params, boarderpoint), option);
}
/// <summary>
/// 获取配置信息
/// </summary>
/// <returns>配置信息</returns>
public override AlgorithmBase GetConfig()
{
return ApplicationDomainEx.LiteDbContext.AlgorithmSixteen.FindOne(p => p.ViewKey == this.Support.ViewKey);
} }
/// <summary> /// <summary>
/// 构建数据包 /// 构建数据包
/// </summary> /// </summary>
/// <param name="cmd">命令<see cref="AlgorithmAutoModeCmd"/></param>
/// <param name="boarderpoint">边框检测点</param> /// <param name="boarderpoint">边框检测点</param>
/// <returns>数据包</returns> /// <returns>数据包</returns>
public AlgorithmPackage__auto_mode_Sixteen BuildPackage(AlgorithmInfo_boarderpoint boarderpoint) public AlgorithmPackage__auto_mode_Sixteen BuildPackage(string cmd, AlgorithmInfo_borderpoint boarderpoint)
{ {
AlgorithmSixteen config = ApplicationDomainEx.LiteDbContext.AlgorithmSixteen.FindOne(p => p.ViewKey == this.Support.ViewKey); AlgorithmSixteen config = ApplicationDomainEx.LiteDbContext.AlgorithmSixteen.FindOne(p => p.ViewKey == this.Support.ViewKey);
if (config == null) if (config == null)
return null; return null;
AlgorithmPackage__auto_mode_Sixteen package = new AlgorithmPackage__auto_mode_Sixteen(); AlgorithmPackage__auto_mode_Sixteen package = new AlgorithmPackage__auto_mode_Sixteen();
package.cmd = cmd;
package.smooth = config.SmoothCoeff; package.smooth = config.SmoothCoeff;
package.max_fixed_frames = config.KeepPrevFrame; package.max_fixed_frames = config.KeepPrevFrame;
package.min_human_area = config.PersonAreaProportion / 100d; package.min_human_area = config.PersonAreaProportion / 100d;
...@@ -110,7 +129,7 @@ namespace VIZ.H2V.Module ...@@ -110,7 +129,7 @@ namespace VIZ.H2V.Module
package.weight_conf = config.ConfidenceWeight / 100d; package.weight_conf = config.ConfidenceWeight / 100d;
package.weight_distance = config.PositionToCenterWeight / 100d; package.weight_distance = config.PositionToCenterWeight / 100d;
package.auto_follow_human = config.NoBallAutoChangeToPerson ? 1 : 0; package.auto_follow_human = config.NoBallAutoChangeToPerson ? 1 : 0;
package.boarderpoint = boarderpoint; package.borderpoint = boarderpoint;
return package; return package;
} }
......
...@@ -35,7 +35,7 @@ namespace VIZ.H2V.Module ...@@ -35,7 +35,7 @@ namespace VIZ.H2V.Module
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
AlgorithmSender.AutoMode(manager, this.BuildPackage(null), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params, null), option);
} }
/// <summary> /// <summary>
...@@ -51,7 +51,7 @@ namespace VIZ.H2V.Module ...@@ -51,7 +51,7 @@ namespace VIZ.H2V.Module
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
AlgorithmSender.AutoMode(manager, this.BuildPackage(null), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params, null), option);
} }
/// <summary> /// <summary>
...@@ -72,10 +72,18 @@ namespace VIZ.H2V.Module ...@@ -72,10 +72,18 @@ namespace VIZ.H2V.Module
} }
/// <summary> /// <summary>
/// 设置参数
/// </summary>
public override void SetParams()
{
}
/// <summary>
/// 边线检测校准 /// 边线检测校准
/// </summary> /// </summary>
/// <param name="boarderpoint">边线检测校准点</param> /// <param name="boarderpoint">边线检测校准点</param>
public override void BorderPoint(AlgorithmInfo_boarderpoint boarderpoint) public override void BorderPoint(AlgorithmInfo_borderpoint boarderpoint)
{ {
if (boarderpoint == null) if (boarderpoint == null)
return; return;
...@@ -85,23 +93,34 @@ namespace VIZ.H2V.Module ...@@ -85,23 +93,34 @@ namespace VIZ.H2V.Module
AlgorithmSenderOption option = new AlgorithmSenderOption(); AlgorithmSenderOption option = new AlgorithmSenderOption();
option.id = this.Support.ID; option.id = this.Support.ID;
option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop; option.enable_sendto_crop = this.Support.ViewConfig.IsSendToCrop;
option.boarderpoint = new AlgorithmInfo_boarderpoint(); option.borderpoint = new AlgorithmInfo_borderpoint();
AlgorithmSender.AutoMode(manager, this.BuildPackage(boarderpoint), option); AlgorithmSender.AutoMode(manager, this.BuildPackage(AlgorithmAutoModeCmd.set_params, boarderpoint), option);
}
/// <summary>
/// 获取配置信息
/// </summary>
/// <returns>配置信息</returns>
public override AlgorithmBase GetConfig()
{
return ApplicationDomainEx.LiteDbContext.AlgorithmTactics.FindOne(p => p.ViewKey == this.Support.ViewKey);
} }
/// <summary> /// <summary>
/// 构建数据包 /// 构建数据包
/// </summary> /// </summary>
/// <param name="cmd">命令<see cref="AlgorithmAutoModeCmd"/></param>
/// <param name="boarderpoint">边框检测点</param> /// <param name="boarderpoint">边框检测点</param>
/// <returns>数据包</returns> /// <returns>数据包</returns>
public AlgorithmPackage__auto_mode_Tactics BuildPackage(AlgorithmInfo_boarderpoint boarderpoint) public AlgorithmPackage__auto_mode_Tactics BuildPackage(string cmd, AlgorithmInfo_borderpoint boarderpoint)
{ {
AlgorithmTactics config = ApplicationDomainEx.LiteDbContext.AlgorithmTactics.FindOne(p => p.ViewKey == this.Support.ViewKey); AlgorithmTactics config = ApplicationDomainEx.LiteDbContext.AlgorithmTactics.FindOne(p => p.ViewKey == this.Support.ViewKey);
if (config == null) if (config == null)
return null; return null;
AlgorithmPackage__auto_mode_Tactics package = new AlgorithmPackage__auto_mode_Tactics(); AlgorithmPackage__auto_mode_Tactics package = new AlgorithmPackage__auto_mode_Tactics();
package.cmd = cmd;
package.smooth = config.SmoothCoeff; package.smooth = config.SmoothCoeff;
package.max_fixed_frames = config.KeepPrevFrame; package.max_fixed_frames = config.KeepPrevFrame;
package.min_human_area = config.PersonAreaProportion / 100d; package.min_human_area = config.PersonAreaProportion / 100d;
...@@ -110,7 +129,7 @@ namespace VIZ.H2V.Module ...@@ -110,7 +129,7 @@ namespace VIZ.H2V.Module
package.weight_conf = config.ConfidenceWeight / 100d; package.weight_conf = config.ConfidenceWeight / 100d;
package.weight_distance = config.PositionToCenterWeight / 100d; package.weight_distance = config.PositionToCenterWeight / 100d;
package.auto_follow_human = config.NoBallAutoChangeToPerson ? 1 : 0; package.auto_follow_human = config.NoBallAutoChangeToPerson ? 1 : 0;
package.boarderpoint = boarderpoint; package.borderpoint = boarderpoint;
return package; return package;
} }
......
...@@ -12,7 +12,7 @@ namespace VIZ.H2V.Module ...@@ -12,7 +12,7 @@ namespace VIZ.H2V.Module
public enum NDIViewScene public enum NDIViewScene
{ {
/// <summary> /// <summary>
/// 视频面板 /// 视频面板,在视频面板切换自动模式、手动模式、居中模式或不裁切时触发
/// </summary> /// </summary>
VideoPanel, VideoPanel,
/// <summary> /// <summary>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.H2V.Module
{
/// <summary>
/// 清理视图控件上下文
/// </summary>
public class ClearVideoControlContext
{
/// <summary>
/// 是否清理跟踪框
/// </summary>
public bool IsClearTrackingBox { get; set; } = true;
/// <summary>
/// 是否清理裁切框
/// </summary>
public bool IsClearClipBox { get; set; } = true;
/// <summary>
/// 是否清理边线检测多边形
/// </summary>
public bool IsClearSideCheckPolygon { get; set; } = true;
}
}
...@@ -71,14 +71,18 @@ ...@@ -71,14 +71,18 @@
<Button Width="60" Height="30" Margin="0,0,30,0" Content="算法重启" <Button Width="60" Height="30" Margin="0,0,30,0" Content="算法重启"
IsEnabled="{Binding Path=ViewStatus,Converter={StaticResource NDIViewStatus2IsEnabledConverter_SettingButton}}" IsEnabled="{Binding Path=ViewStatus,Converter={StaticResource NDIViewStatus2IsEnabledConverter_SettingButton}}"
Command="{Binding RestartCommand}"></Button> Command="{Binding RestartCommand}"></Button>
<TextBlock Text="调试信息 -- " Foreground="Red" FontSize="16" Opacity="0.86" VerticalAlignment="Center"></TextBlock> <TextBlock Text="裁切FPS:" Foreground="Red" FontSize="16" Margin="0,0,0,0" Opacity="0.86" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="视图状态:" Foreground="Red" FontSize="16" Margin="10,0,0,0" Opacity="0.86" VerticalAlignment="Center"></TextBlock> <TextBlock Foreground="Red" FontSize="16" Margin="10,0,0,0" VerticalAlignment="Center"
Text="{Binding ClipFPS.FPS}" Width="30"></TextBlock>
<TextBlock Text="算法FPS:" Foreground="Red" FontSize="16" Margin="10,0,0,0" Opacity="0.86" VerticalAlignment="Center"></TextBlock>
<TextBlock Foreground="Red" FontSize="16" Margin="10,0,0,0" VerticalAlignment="Center" <TextBlock Foreground="Red" FontSize="16" Margin="10,0,0,0" VerticalAlignment="Center"
Text="{Binding ViewStatus}"></TextBlock> Text="{Binding AlgorithmFPS.FPS}" Width="30"></TextBlock>
<TextBlock Text="手动裁切 FPS:" Foreground="Red" FontSize="16" Margin="10,0,0,0" Opacity="0.86" VerticalAlignment="Center"></TextBlock> <TextBlock Text="|" Foreground="Red" FontSize="16" Margin="5,0,5,0" Opacity="0.86" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="视图状态:" Foreground="Red" FontSize="16" Margin="10,0,0,0" Opacity="0.86" VerticalAlignment="Center"></TextBlock>
<TextBlock Foreground="Red" FontSize="16" Margin="10,0,0,0" VerticalAlignment="Center" <TextBlock Foreground="Red" FontSize="16" Margin="10,0,0,0" VerticalAlignment="Center"
Text="{Binding ManualFPS.FPS}"></TextBlock> Text="{Binding ViewStatus}" Width="140"></TextBlock>
<TextBlock Text="日志日志:" Foreground="Red" FontSize="16" Margin="10,0,0,0" Opacity="0.86" VerticalAlignment="Center"></TextBlock> <TextBlock Text="|" Foreground="Red" FontSize="16" Margin="5,0,5,0" Opacity="0.86" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="调试日志:" Foreground="Red" FontSize="16" Margin="10,0,0,0" Opacity="0.86" VerticalAlignment="Center"></TextBlock>
<TextBlock Foreground="Red" FontSize="16" Margin="10,0,0,0" VerticalAlignment="Center" <TextBlock Foreground="Red" FontSize="16" Margin="10,0,0,0" VerticalAlignment="Center"
Text="{Binding DebugLog}"></TextBlock> Text="{Binding DebugLog}"></TextBlock>
</StackPanel> </StackPanel>
......
...@@ -87,7 +87,7 @@ namespace VIZ.H2V.Module ...@@ -87,7 +87,7 @@ namespace VIZ.H2V.Module
/// </summary> /// </summary>
private void Loaded_Property() private void Loaded_Property()
{ {
AlgorithmStrategy strategy = ApplicationDomainEx.ExcelContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.ViewConfig.StrategyType); AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.ID == (int)this.ViewConfig.StrategyType);
// 算法ID // 算法ID
this.ID = $"{NetHelper.GetUsedOrLastMacAddress()}__{this.ViewKey}"; this.ID = $"{NetHelper.GetUsedOrLastMacAddress()}__{this.ViewKey}";
...@@ -171,7 +171,7 @@ namespace VIZ.H2V.Module ...@@ -171,7 +171,7 @@ namespace VIZ.H2V.Module
if (!this.FootballFieldPanelModel.HasSelected()) if (!this.FootballFieldPanelModel.HasSelected())
return; return;
AlgorithmInfo_boarderpoint boarderpoint = new AlgorithmInfo_boarderpoint(); AlgorithmInfo_borderpoint boarderpoint = new AlgorithmInfo_borderpoint();
if (this.FootballFieldPanelModel.IsTopSelected) if (this.FootballFieldPanelModel.IsTopSelected)
{ {
...@@ -218,7 +218,7 @@ namespace VIZ.H2V.Module ...@@ -218,7 +218,7 @@ namespace VIZ.H2V.Module
private void Setting(string key) private void Setting(string key)
{ {
NDISettingView view = new NDISettingView(key, this.ID); NDISettingView view = new NDISettingView(key, this.ID);
NoneWindow window = new NoneWindow(1200, 900, view); NoneWindow window = new NoneWindow(1200, 1000, view);
window.Owner = this.GetWindow(); window.Owner = this.GetWindow();
window.ShowDialog(); window.ShowDialog();
...@@ -243,7 +243,8 @@ namespace VIZ.H2V.Module ...@@ -243,7 +243,8 @@ namespace VIZ.H2V.Module
return; return;
// 清理视频控件 // 清理视频控件
this.ClearVideoControl(); ClearVideoControlContext clear_context = new ClearVideoControlContext();
this.ClearVideoControl(clear_context);
// 切换自动模式 // 切换自动模式
ChangeStrategyContext context = new ChangeStrategyContext(); ChangeStrategyContext context = new ChangeStrategyContext();
...@@ -269,7 +270,8 @@ namespace VIZ.H2V.Module ...@@ -269,7 +270,8 @@ namespace VIZ.H2V.Module
private void Restart() private void Restart()
{ {
// 清理视频控件 // 清理视频控件
this.ClearVideoControl(); ClearVideoControlContext clear_context = new ClearVideoControlContext();
this.ClearVideoControl(clear_context);
// 算法重启 // 算法重启
this.AlgorithmControllerDic[this.StrategyType].RestartAlgorithm(); this.AlgorithmControllerDic[this.StrategyType].RestartAlgorithm();
......
...@@ -65,13 +65,6 @@ namespace VIZ.H2V.Module ...@@ -65,13 +65,6 @@ namespace VIZ.H2V.Module
// 注册WPF渲染事件,用于处理3D鼠标 // 注册WPF渲染事件,用于处理3D鼠标
CompositionTarget.Rendering -= CompositionTarget_Rendering; CompositionTarget.Rendering -= CompositionTarget_Rendering;
CompositionTarget.Rendering += CompositionTarget_Rendering; CompositionTarget.Rendering += CompositionTarget_Rendering;
// 如果是DEBUG模式,那么开启手动裁切FPS统计
if (ApplicationDomainEx.IS_DEBUG)
{
this.ManualFPS = new FPSHelper();
this.ManualFPS.Start();
}
} }
/// <summary> /// <summary>
...@@ -173,7 +166,6 @@ namespace VIZ.H2V.Module ...@@ -173,7 +166,6 @@ namespace VIZ.H2V.Module
AlgorithmSender.ManualMode(manager, this.ID, this.ViewConfig.IsSendToCrop, this.GetManulRoi()); AlgorithmSender.ManualMode(manager, this.ID, this.ViewConfig.IsSendToCrop, this.GetManulRoi());
////////////////////////////////////////////////////////////////////////
// 在需要发送裁切框时 // 在需要发送裁切框时
if (this.viewConfig.IsSendToCrop) if (this.viewConfig.IsSendToCrop)
{ {
...@@ -183,22 +175,10 @@ namespace VIZ.H2V.Module ...@@ -183,22 +175,10 @@ namespace VIZ.H2V.Module
ClipSender.CropRoi(manager_clip, 0, this.GetManulRoi(), (int)CLIP_BOX_WIDTH, e.Frame.Height); ClipSender.CropRoi(manager_clip, 0, this.GetManulRoi(), (int)CLIP_BOX_WIDTH, e.Frame.Height);
} }
} }
////////////////////////////////////////////////////////////////////////
// 在DEBUG模式下显示手动裁切FPS
if (!ApplicationDomainEx.IS_DEBUG)
return;
this.ManualFPS.CalcFps();
////////////////////////////////////////////////////////////////////////
// DEBUG
//Debug.WriteLine($"发送: {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} | [ {this.clipBoxX} ]");
//log.Debug($"发送: {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff")} | [ {this.clipBoxX} ]");
//Debug.WriteLine($"{this.ClipBoxX ?? 0}");
//log.Debug($"{this.ClipBoxX ?? 0}");
////////////////////////////////////////////////////////////////////////
} }
// 统计裁切FPS
this.ClipFPS.CalcFps();
} }
} }
} }
...@@ -119,6 +119,9 @@ namespace VIZ.H2V.Module ...@@ -119,6 +119,9 @@ namespace VIZ.H2V.Module
} }
view.video.UpdateTrackingBox(infos); view.video.UpdateTrackingBox(infos);
// 更新算法帧率统计
this.AlgorithmFPS.CalcFps();
} }
/// <summary> /// <summary>
...@@ -151,6 +154,9 @@ namespace VIZ.H2V.Module ...@@ -151,6 +154,9 @@ namespace VIZ.H2V.Module
// 更新边线检测框 // 更新边线检测框
this.OnAlgorithmMessage__crop_roi__borderline(msg, renderInfo, view); this.OnAlgorithmMessage__crop_roi__borderline(msg, renderInfo, view);
// 更新算法帧率统计
this.AlgorithmFPS.CalcFps();
} }
/// <summary> /// <summary>
......
...@@ -417,16 +417,30 @@ namespace VIZ.H2V.Module ...@@ -417,16 +417,30 @@ namespace VIZ.H2V.Module
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
#region ManualFPS -- 手动裁切FPS #region ClipFPS -- NDI FPS
private FPSHelper manualFPS; private FPSHelper clipFPS;
/// <summary> /// <summary>
/// 手动裁切FPS /// NDI FPS
/// </summary> /// </summary>
public FPSHelper ManualFPS public FPSHelper ClipFPS
{ {
get { return manualFPS; } get { return clipFPS; }
set { manualFPS = value; this.RaisePropertyChanged(nameof(ManualFPS)); } set { clipFPS = value; this.RaisePropertyChanged(nameof(ClipFPS)); }
}
#endregion
#region AlgorithmFPS -- 算法FPS
private FPSHelper algorithmFPS;
/// <summary>
/// 算法FPS
/// </summary>
public FPSHelper AlgorithmFPS
{
get { return algorithmFPS; }
set { algorithmFPS = value; this.RaisePropertyChanged(nameof(AlgorithmFPS)); }
} }
#endregion #endregion
......
...@@ -91,7 +91,13 @@ namespace VIZ.H2V.Module ...@@ -91,7 +91,13 @@ namespace VIZ.H2V.Module
/// </summary> /// </summary>
private void InitProperty() private void InitProperty()
{ {
// 裁切FPS统计
this.ClipFPS = new FPSHelper();
this.ClipFPS.Start();
// 算法FPS统计
this.AlgorithmFPS = new FPSHelper();
this.AlgorithmFPS.Start();
} }
/// <summary> /// <summary>
...@@ -129,7 +135,10 @@ namespace VIZ.H2V.Module ...@@ -129,7 +135,10 @@ namespace VIZ.H2V.Module
// ---------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------
// 清理视频控件 // 清理视频控件
this.ClearVideoControl(); ClearVideoControlContext clear_context = new ClearVideoControlContext();
// 当前处于裁切状态时不需要清理裁切框
clear_context.IsClearClipBox = this.ViewStatus != NDIViewStatus.CropRoi;
this.ClearVideoControl(clear_context);
// 发送切换手动消息 // 发送切换手动消息
AlgorithmStrategyChangedToManualMessage msg = new AlgorithmStrategyChangedToManualMessage(); AlgorithmStrategyChangedToManualMessage msg = new AlgorithmStrategyChangedToManualMessage();
...@@ -212,7 +221,8 @@ namespace VIZ.H2V.Module ...@@ -212,7 +221,8 @@ namespace VIZ.H2V.Module
/// <summary> /// <summary>
/// 清理视频控件 /// 清理视频控件
/// </summary> /// </summary>
public void ClearVideoControl() /// <param name="context">清理视频控件上下文</param>
public void ClearVideoControl(ClearVideoControlContext context)
{ {
WPFHelper.Invoke(() => WPFHelper.Invoke(() =>
{ {
...@@ -220,8 +230,23 @@ namespace VIZ.H2V.Module ...@@ -220,8 +230,23 @@ namespace VIZ.H2V.Module
if (view == null) if (view == null)
return; return;
view.video.ClearTrackingBox(); // 清理跟踪框
view.video.ClearClipBox(); if (context.IsClearTrackingBox)
{
view.video.ClearTrackingBox();
}
// 清理裁切框
if (context.IsClearClipBox)
{
view.video.ClearClipBox();
}
// 清理裁切框
if (context.IsClearSideCheckPolygon)
{
view.video.ClearSideCheckPolygon();
}
}); });
} }
......
...@@ -13,14 +13,14 @@ using VIZ.H2V.Storage; ...@@ -13,14 +13,14 @@ using VIZ.H2V.Storage;
namespace VIZ.H2V.Module namespace VIZ.H2V.Module
{ {
/// <summary> /// <summary>
/// 应用程序启动 -- 初始化Excel /// 应用程序启动 -- 初始化CSV
/// </summary> /// </summary>
public class AppSetup_InitExcel : AppSetupBase public class AppSetup_InitCsv : AppSetupBase
{ {
/// <summary> /// <summary>
/// 日志 /// 日志
/// </summary> /// </summary>
private static ILog log = LogManager.GetLogger(typeof(AppSetup_InitExcel)); private static ILog log = LogManager.GetLogger(typeof(AppSetup_InitCsv));
/// <summary> /// <summary>
/// 描述 /// 描述
...@@ -34,12 +34,12 @@ namespace VIZ.H2V.Module ...@@ -34,12 +34,12 @@ namespace VIZ.H2V.Module
/// <returns>是否成功执行</returns> /// <returns>是否成功执行</returns>
public override bool Setup(AppSetupContext context) public override bool Setup(AppSetupContext context)
{ {
string algorithm_strategy_path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config", "algorithm_strategy.xls"); string algorithm_strategy_path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config", "algorithm_strategy.csv");
string clip_system_path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config", "clip_system.xls"); string clip_system_path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config", "clip_system.csv");
ApplicationDomainEx.ExcelContext = new ExcelContext(); ApplicationDomainEx.CsvContext = new CsvContext();
ApplicationDomainEx.ExcelContext.LoadAlgorithmStrategys(algorithm_strategy_path); ApplicationDomainEx.CsvContext.LoadAlgorithmStrategys(algorithm_strategy_path);
ApplicationDomainEx.ExcelContext.LoadClipSystems(clip_system_path); ApplicationDomainEx.CsvContext.LoadClipSystems(clip_system_path);
return true; return true;
} }
......
...@@ -193,6 +193,7 @@ ...@@ -193,6 +193,7 @@
<Compile Include="NDIView\Controller\Algorithm\Strategy\AlgorithmController_Single.cs" /> <Compile Include="NDIView\Controller\Algorithm\Strategy\AlgorithmController_Single.cs" />
<Compile Include="NDIView\Enum\NDIViewScene.cs" /> <Compile Include="NDIView\Enum\NDIViewScene.cs" />
<Compile Include="NDIView\Info\ChangeStrategyContext.cs" /> <Compile Include="NDIView\Info\ChangeStrategyContext.cs" />
<Compile Include="NDIView\Info\ClearVideoControlContext.cs" />
<Compile Include="NDIView\VieweModel\NDIViewModel.Command.cs" /> <Compile Include="NDIView\VieweModel\NDIViewModel.Command.cs" />
<Compile Include="NDIView\VieweModel\NDIViewModel.Manual_NDI.cs" /> <Compile Include="NDIView\VieweModel\NDIViewModel.Manual_NDI.cs" />
<Compile Include="NDIView\VieweModel\NDIViewModel.Message.cs" /> <Compile Include="NDIView\VieweModel\NDIViewModel.Message.cs" />
...@@ -250,7 +251,7 @@ ...@@ -250,7 +251,7 @@
<Compile Include="NDIView\View\NDIView.xaml.cs"> <Compile Include="NDIView\View\NDIView.xaml.cs">
<DependentUpon>NDIView.xaml</DependentUpon> <DependentUpon>NDIView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Setup\Provider\AppSetup_InitExcel.cs" /> <Compile Include="Setup\Provider\AppSetup_InitCsv.cs" />
<Compile Include="Setup\Provider\AppSetup_InitNDI.cs" /> <Compile Include="Setup\Provider\AppSetup_InitNDI.cs" />
<Compile Include="VideoMainView\View\VideoMainView.xaml.cs"> <Compile Include="VideoMainView\View\VideoMainView.xaml.cs">
<DependentUpon>VideoMainView.xaml</DependentUpon> <DependentUpon>VideoMainView.xaml</DependentUpon>
......
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
</configuration> </configuration>
\ No newline at end of file
...@@ -31,5 +31,10 @@ namespace VIZ.H2V.Storage ...@@ -31,5 +31,10 @@ namespace VIZ.H2V.Storage
/// 启动路径(绝对路径 or 相对路径) /// 启动路径(绝对路径 or 相对路径)
/// </summary> /// </summary>
public string SetupPath { get; set; } public string SetupPath { get; set; }
/// <summary>
/// 场景选项集合,使用英文逗号分隔
/// </summary>
public string Scenes { get; set; }
} }
} }
using NPOI.HSSF.UserModel; using System;
using NPOI.SS.UserModel;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using CsvHelper;
namespace VIZ.H2V.Storage namespace VIZ.H2V.Storage
{ {
/// <summary> /// <summary>
/// Excel数据上下文 /// CSV数据上下文
/// </summary> /// </summary>
public class ExcelContext public class CsvContext
{ {
/// <summary> /// <summary>
/// 算法信息 /// 算法信息
...@@ -30,30 +30,11 @@ namespace VIZ.H2V.Storage ...@@ -30,30 +30,11 @@ namespace VIZ.H2V.Storage
/// <param name="path">文件路径</param> /// <param name="path">文件路径</param>
public void LoadAlgorithmStrategys(string path) public void LoadAlgorithmStrategys(string path)
{ {
List<AlgorithmStrategy> result = new List<AlgorithmStrategy>(); using (StreamReader sr = new StreamReader(path, Encoding.UTF8))
using (CsvReader reader = new CsvReader(sr, CultureInfo.InvariantCulture))
using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
{ {
IWorkbook workbook = new HSSFWorkbook(fs); this.AlgorithmStrategys = reader.GetRecords<AlgorithmStrategy>()?.ToList();
ISheet sheet = workbook.GetSheet("Sheet1");
for (int i = 1; i <= sheet.LastRowNum; i++)
{
IRow row = sheet.GetRow(i);
AlgorithmStrategy item = new AlgorithmStrategy();
item.ID = (int)row.GetCell(0)?.NumericCellValue;
item.Name = row.GetCell(1)?.StringCellValue;
item.DisplayName = row.GetCell(2)?.StringCellValue;
item.SetupPath = row.GetCell(3)?.StringCellValue;
result.Add(item);
}
} }
this.AlgorithmStrategys = result;
} }
/// <summary> /// <summary>
...@@ -62,29 +43,11 @@ namespace VIZ.H2V.Storage ...@@ -62,29 +43,11 @@ namespace VIZ.H2V.Storage
/// <param name="path">文件路径</param> /// <param name="path">文件路径</param>
public void LoadClipSystems(string path) public void LoadClipSystems(string path)
{ {
List<ClipSystem> result = new List<ClipSystem>(); using (StreamReader sr = new StreamReader(path, Encoding.UTF8))
using (CsvReader reader = new CsvReader(sr, CultureInfo.InvariantCulture))
using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
{ {
IWorkbook workbook = new HSSFWorkbook(fs); this.ClipSystems = reader.GetRecords<ClipSystem>()?.ToList();
ISheet sheet = workbook.GetSheet("Sheet1");
for (int i = 1; i <= sheet.LastRowNum; i++)
{
IRow row = sheet.GetRow(i);
ClipSystem item = new ClipSystem();
item.ID = (int)row.GetCell(0)?.NumericCellValue;
item.NDI_NAME = row.GetCell(1)?.StringCellValue;
item.UDP_PORT = (int)row.GetCell(2)?.NumericCellValue;
result.Add(item);
}
} }
this.ClipSystems = result;
} }
} }
} }
...@@ -13,6 +13,12 @@ namespace VIZ.H2V.Storage ...@@ -13,6 +13,12 @@ namespace VIZ.H2V.Storage
public class AlgorithmConfig : IniConfigBase public class AlgorithmConfig : IniConfigBase
{ {
/// <summary> /// <summary>
/// 算法python.exe路径(绝对路径)
/// </summary>
[Ini(Section = "Algorithm", DefaultValue = "python", Type = typeof(string))]
public string ALGORITHM_PYTHON_PATH { get; set; }
/// <summary>
/// 算法停止超时时间(单位:毫秒) /// 算法停止超时时间(单位:毫秒)
/// </summary> /// </summary>
[Ini(Section = "Algorithm", DefaultValue = "30000", Type = typeof(int))] [Ini(Section = "Algorithm", DefaultValue = "30000", Type = typeof(int))]
......
...@@ -33,5 +33,10 @@ namespace VIZ.H2V.Storage ...@@ -33,5 +33,10 @@ namespace VIZ.H2V.Storage
/// 维持上一帧位置 /// 维持上一帧位置
/// </summary> /// </summary>
public int KeepPrevFrame { get; set; } = 75; public int KeepPrevFrame { get; set; } = 75;
/// <summary>
/// 场景
/// </summary>
public string Scene { get; set; }
} }
} }
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
<Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL"> <Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll</HintPath> <HintPath>..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference> </Reference>
<Reference Include="CsvHelper, Version=28.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
<HintPath>..\packages\CsvHelper.28.0.1\lib\net47\CsvHelper.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL"> <Reference Include="ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath> <HintPath>..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference> </Reference>
...@@ -61,6 +64,12 @@ ...@@ -61,6 +64,12 @@
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.HashCode.1.0.0\lib\net461\Microsoft.Bcl.HashCode.dll</HintPath>
</Reference>
<Reference Include="NPOI, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL"> <Reference Include="NPOI, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.dll</HintPath> <HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.dll</HintPath>
</Reference> </Reference>
...@@ -74,9 +83,25 @@ ...@@ -74,9 +83,25 @@
<HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.OpenXmlFormats.dll</HintPath> <HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.OpenXmlFormats.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.0\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime" /> <Reference Include="System.Runtime" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
...@@ -86,9 +111,9 @@ ...@@ -86,9 +111,9 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Excel\Algorithm\AlgorithmStrategy.cs" /> <Compile Include="CSV\Algorithm\AlgorithmStrategy.cs" />
<Compile Include="Excel\Clip\ClipSystem.cs" /> <Compile Include="CSV\Clip\ClipSystem.cs" />
<Compile Include="Excel\ExcelContext.cs" /> <Compile Include="CSV\CsvContext.cs" />
<Compile Include="Init\Config\AlgorithmConfig.cs" /> <Compile Include="Init\Config\AlgorithmConfig.cs" />
<Compile Include="Init\Config\UdpConfig.cs" /> <Compile Include="Init\Config\UdpConfig.cs" />
<Compile Include="LiteDB\Algorithm\AlgorithmBase.cs" /> <Compile Include="LiteDB\Algorithm\AlgorithmBase.cs" />
...@@ -110,6 +135,7 @@ ...@@ -110,6 +135,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="CsvHelper" version="28.0.1" targetFramework="net48" />
<package id="LiteDB" version="5.0.12" targetFramework="net48" /> <package id="LiteDB" version="5.0.12" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" /> <package id="log4net" version="2.0.14" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net48" />
<package id="Microsoft.Bcl.HashCode" version="1.0.0" targetFramework="net48" />
<package id="Microsoft.CSharp" version="4.3.0" targetFramework="net48" />
<package id="NPOI" version="2.5.6" targetFramework="net48" /> <package id="NPOI" version="2.5.6" targetFramework="net48" />
<package id="Portable.BouncyCastle" version="1.8.9" targetFramework="net48" /> <package id="Portable.BouncyCastle" version="1.8.9" targetFramework="net48" />
<package id="SharpZipLib" version="1.3.3" targetFramework="net48" /> <package id="SharpZipLib" version="1.3.3" targetFramework="net48" />
<package id="System.Buffers" version="4.4.0" targetFramework="net48" />
<package id="System.Memory" version="4.5.0" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net48" />
</packages> </packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup> </startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> </configuration>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:VIZ.H2V.UdpTestTool" WindowStartupLocation="CenterScreen" xmlns:local="clr-namespace:VIZ.H2V.UdpTestTool" WindowStartupLocation="CenterScreen"
mc:Ignorable="d" Closed="Window_Closed" mc:Ignorable="d" Closed="Window_Closed"
Title="智能裁切系统UDP测试工具" Height="600" Width="1000"> Title="智能裁切系统UDP测试工具" Height="650" Width="1000">
<Grid> <Grid>
<local:MainView></local:MainView> <local:MainView></local:MainView>
</Grid> </Grid>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
xmlns:local="clr-namespace:VIZ.H2V.UdpTestTool" Background="White" xmlns:local="clr-namespace:VIZ.H2V.UdpTestTool" Background="White"
d:DataContext="{d:DesignInstance Type=local:MainViewModel}" d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="600" d:DesignWidth="800">
<Grid Margin="20"> <Grid Margin="20">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="30"></RowDefinition> <RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition> <ColumnDefinition Width="120"></ColumnDefinition>
...@@ -64,9 +64,13 @@ ...@@ -64,9 +64,13 @@
</StackPanel> </StackPanel>
<!-- 启动参数 --> <!-- 启动参数 -->
<StackPanel Grid.Row="5" Grid.ColumnSpan="3" VerticalAlignment="Center" Orientation="Horizontal"> <Grid Grid.Row="5" Grid.ColumnSpan="3" VerticalAlignment="Center">
<TextBlock Text="启动参数:"></TextBlock> <Grid.ColumnDefinitions>
<TextBlock Text="{Binding Path=SetupArgs}" Margin="10,0,0,0"></TextBlock> <ColumnDefinition Width="70"></ColumnDefinition>
</StackPanel> <ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="启动参数:" VerticalAlignment="Top"></TextBlock>
<TextBlock Text="{Binding Path=SetupArgs}" VerticalAlignment="Top" TextWrapping="Wrap" Margin="10,0,0,0" Grid.Column="1"></TextBlock>
</Grid>
</Grid> </Grid>
</UserControl> </UserControl>
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
</configuration> </configuration>
\ No newline at end of file
...@@ -24,8 +24,8 @@ namespace VIZ.H2V ...@@ -24,8 +24,8 @@ namespace VIZ.H2V
AppSetup.AppendSetup(new AppSetup_Navigation3D()); AppSetup.AppendSetup(new AppSetup_Navigation3D());
// 初始化LiteDB // 初始化LiteDB
AppSetup.AppendSetup(new AppSetup_InitLiteDb()); AppSetup.AppendSetup(new AppSetup_InitLiteDb());
// 初始化Excel // 初始化CSV
AppSetup.AppendSetup(new AppSetup_InitExcel()); AppSetup.AppendSetup(new AppSetup_InitCsv());
// 初始化NDI // 初始化NDI
AppSetup.AppendSetup(new AppSetup_InitNDI()); AppSetup.AppendSetup(new AppSetup_InitNDI());
// 初始化算法进程 // 初始化算法进程
......
...@@ -63,13 +63,17 @@ using VIZ.Framework.Core; ...@@ -63,13 +63,17 @@ using VIZ.Framework.Core;
[assembly: ApplicationTimeCheck("2022-9-16 00:00:00")] [assembly: ApplicationTimeCheck("2022-9-16 00:00:00")]
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
// MAC地址校验 // MAC地址校验
// 开发机: WIFI: 3C:58:C2:D7:DC:14 // 开发机: WIFI: 3C:58:C2:D7:DC:14
// 网线: 00:2B:67:7C:4E:DA // 网线: 00:2B:67:7C:4E:DA
// //
// 测试机 1: 网线:E0:4F:43:E6:4F:82 // 测试机 1(环达): 网线:E0:4F:43:E6:4F:82
// 测试机 2: 网线:E0:4F:43:E6:48:7C // 测试机 2(环达): 网线:E0:4F:43:E6:48:7C
// 测试机 3(霄云中心): 网线:04:7B:CB:46:0D:C9
// 测试机 4(霄云中心): 网线:04:7B:CB:46:0F:8E
[assembly: ApplicationMacCheck("3C:58:C2:D7:DC:14")] [assembly: ApplicationMacCheck("3C:58:C2:D7:DC:14")]
[assembly: ApplicationMacCheck("00:2B:67:7C:4E:DA")] [assembly: ApplicationMacCheck("00:2B:67:7C:4E:DA")]
[assembly: ApplicationMacCheck("E0:4F:43:E6:4F:82")] [assembly: ApplicationMacCheck("E0:4F:43:E6:4F:82")]
[assembly: ApplicationMacCheck("E0:4F:43:E6:48:7C")] [assembly: ApplicationMacCheck("E0:4F:43:E6:48:7C")]
[assembly: ApplicationMacCheck("04:7B:CB:46:0D:C9")]
[assembly: ApplicationMacCheck("04:7B:CB:46:0F:8E")]
// ===================================================================================================== // =====================================================================================================
\ No newline at end of file
...@@ -146,14 +146,14 @@ ...@@ -146,14 +146,14 @@
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="config\algorithm_strategy.xls"> <None Include="config\algorithm_strategy.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="config\clip_system.xls"> <None Include="config\clip_system.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="config\config.ini"> <None Include="config\config.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<None Include="config\log.config"> <None Include="config\log.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
......
ID,Name,DisplayName,SetupPath,Scenes
1,单人机位,单人机位,E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,single_person
2,近景机位,近景机位,E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,close_up
3,16米机位,16米机位,E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,"16m_left,16m_right"
4,战术机位,战术机位,E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,tactical
5,索道机位,索道机位,E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe,fly_cat
ID,NDI_NAME,UDP_PORT,
1,NDIOutput1,5001,
2,NDIOutput2,5002,
3,NDIOutput3,5003,
4,NDIOutput4,5004,
...@@ -54,6 +54,9 @@ UDP_BINDING_PORT=8101 ...@@ -54,6 +54,9 @@ UDP_BINDING_PORT=8101
; === Algorithm === ; === Algorithm ===
; ============================================================ ; ============================================================
[Algorithm] [Algorithm]
;算法python.exe路径(绝对路径)或者 python 命令
;ALGORITHM_PYTHON_PATH=python
ALGORITHM_PYTHON_PATH=E:\Projects\VIZ.H2V\VIZ.H2V.UdpTestTool\bin\x64\Debug\VIZ.H2V.UdpTestTool.exe
;算法停止超时时间(单位:毫秒) ;算法停止超时时间(单位:毫秒)
ALGORITHM_STOP_TIMEOUT=5000 ALGORITHM_STOP_TIMEOUT=5000
;是否显示目标框 ;是否显示目标框
......
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