Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.H2V
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.H2V
Commits
ef52c28d
Commit
ef52c28d
authored
Aug 22, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
是否显示边线检测区域
parent
b649afff
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
123 additions
and
23 deletions
+123
-23
VIZ.H2V.Common/Widgets/FootballFieldPanel/FootballFieldPanelModel.cs
+14
-0
VIZ.H2V.Module.Resource/Style/Button/Button_NdiView.xaml
+1
-1
VIZ.H2V.Module.Resource/Style/CheckBox/CheckBox_NdiView.xaml
+28
-0
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Single.cs
+1
-1
VIZ.H2V.Module/NDIView/Info/ClearVideoControlContext.cs
+14
-4
VIZ.H2V.Module/NDIView/View/NDIView.xaml
+20
-5
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Command.cs
+26
-2
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Message.cs
+1
-1
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.cs
+3
-2
VIZ.H2V.Module/Setup/Provider/AppSetup_InitCsv.cs
+1
-1
VIZ.H2V.Storage/CSV/CsvContext.cs
+14
-6
No files found.
VIZ.H2V.Common/Widgets/FootballFieldPanel/FootballFieldPanelModel.cs
View file @
ef52c28d
...
...
@@ -69,6 +69,20 @@ namespace VIZ.H2V.Common
#
endregion
#
region
IsShowBorder
--
是否显示边框
private
bool
isShowBorder
;
/// <summary>
/// 是否显示边框
/// </summary>
public
bool
IsShowBorder
{
get
{
return
isShowBorder
;
}
set
{
isShowBorder
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsShowBorder
));
}
}
#
endregion
/// <summary>
/// 是否有选中的项
/// </summary>
...
...
VIZ.H2V.Module.Resource/Style/Button/Button_NdiView.xaml
View file @
ef52c28d
...
...
@@ -13,7 +13,7 @@
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="BorderBrush" Value="#
aa
ffc000"></Setter>
<Setter TargetName="border" Property="BorderBrush" Value="#
cc
ffc000"></Setter>
<Setter TargetName="border" Property="Background" Value="#11ffffff"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
...
...
VIZ.H2V.Module.Resource/Style/CheckBox/CheckBox_NdiView.xaml
View file @
ef52c28d
...
...
@@ -46,4 +46,31 @@
</Setter>
</Style>
<Style x:Key="CheckBox_Eye" TargetType="CheckBox">
<Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
<Setter Property="Width" Value="30"></Setter>
<Setter Property="Height" Value="30"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<Border x:Name="border" Background="Transparent">
<Ellipse Width="12" Height="12" x:Name="ellipse" Fill="#44ffc000"
HorizontalAlignment="Center" VerticalAlignment="Center"></Ellipse>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="ellipse" Property="Fill" Value="#aaffc000"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ellipse" Property="Opacity" Value="0.7"></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#11ffffff"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Single.cs
View file @
ef52c28d
...
...
@@ -62,7 +62,7 @@ namespace VIZ.H2V.Module
this
.
Detect
();
// 清理视图控件
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
();
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
(
true
);
this
.
Support
.
ClearVideoControl
(
clear_context
);
}
...
...
VIZ.H2V.Module/NDIView/Info/ClearVideoControlContext.cs
View file @
ef52c28d
...
...
@@ -12,18 +12,28 @@ namespace VIZ.H2V.Module
public
class
ClearVideoControlContext
{
/// <summary>
///
是否清理跟踪框
///
清理视图控件上下文
/// </summary>
public
bool
IsClearTrackingBox
{
get
;
set
;
}
=
true
;
/// <param name="defaultValue">默认值</param>
public
ClearVideoControlContext
(
bool
defaultValue
)
{
this
.
IsClearTrackingBox
=
defaultValue
;
this
.
IsClearClipBox
=
defaultValue
;
this
.
IsClearSideCheckPolygon
=
defaultValue
;
}
/// <summary>
/// 是否清理跟踪框
/// </summary>
public
bool
IsClearTrackingBox
{
get
;
set
;
}
/// <summary>
/// 是否清理裁切框
/// </summary>
public
bool
IsClearClipBox
{
get
;
set
;
}
=
true
;
public
bool
IsClearClipBox
{
get
;
set
;
}
/// <summary>
/// 是否清理边线检测多边形
/// </summary>
public
bool
IsClearSideCheckPolygon
{
get
;
set
;
}
=
true
;
public
bool
IsClearSideCheckPolygon
{
get
;
set
;
}
}
}
VIZ.H2V.Module/NDIView/View/NDIView.xaml
View file @
ef52c28d
...
...
@@ -172,11 +172,26 @@
<fcommon:VideoControl x:Name="video"></fcommon:VideoControl>
</Border>
<!-- 显示组 -->
<StackPanel Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,5">
<CheckBox Style="{StaticResource CheckBox_Eye}" Width="30" Height="30"
IsEnabled="{Binding Path=ViewStatus,Converter={StaticResource NDIViewStatus2IsEnabledConverter}}"
IsChecked="{Binding Path=FootballFieldPanelModel.IsShowBorder,Mode=TwoWay}">
<behaviors:Interaction.Triggers>
<behaviors:EventTrigger EventName="Unchecked">
<behaviors:InvokeCommandAction Command="{Binding ClearSideCheckPolygonCommand}" />
</behaviors:EventTrigger>
</behaviors:Interaction.Triggers>
</CheckBox>
</StackPanel>
<!-- 设置 -->
<Button Height="40" Width="40" Grid.Column="2" Grid.Row="1" VerticalAlignment="Top"
IsEnabled="{Binding Path=ViewStatus,Converter={StaticResource NDIViewStatus2IsEnabledConverter_SettingButton}}"
Style="{StaticResource Button_Setting_Open}"
Command="{Binding Path=SettingCommand,Mode=OneWay}"
CommandParameter="{Binding ElementName=uc,Path=NDIKey,Mode=OneWay}"></Button>
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Grid.Column="2" Grid.Row="1" >
<Button Height="40" Width="40" HorizontalAlignment="Center"
IsEnabled="{Binding Path=ViewStatus,Converter={StaticResource NDIViewStatus2IsEnabledConverter_SettingButton}}"
Style="{StaticResource Button_Setting_Open}"
Command="{Binding Path=SettingCommand,Mode=OneWay}"
CommandParameter="{Binding ElementName=uc,Path=NDIKey,Mode=OneWay}"></Button>
</StackPanel>
</Grid>
</UserControl>
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Command.cs
View file @
ef52c28d
...
...
@@ -249,7 +249,7 @@ namespace VIZ.H2V.Module
return
;
// 清理视频控件
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
();
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
(
true
);
this
.
ClearVideoControl
(
clear_context
);
// 切换自动模式
...
...
@@ -275,8 +275,12 @@ namespace VIZ.H2V.Module
/// </summary>
private
void
Restart
()
{
MessageBoxExResult
result
=
MessageBoxEx
.
ShowDialog
(
"提示"
,
"重启算法进程需要大概(1 min),是否继续?"
,
MessageBoxExButtons
.
YES_CANCEL
);
if
(
result
==
MessageBoxExResult
.
CANCEL
)
return
;
// 清理视频控件
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
();
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
(
true
);
this
.
ClearVideoControl
(
clear_context
);
// 算法重启
...
...
@@ -284,5 +288,25 @@ namespace VIZ.H2V.Module
}
#
endregion
#
region
ClearSideCheckPolygonCommand
--
清理边线检测多边形命令
/// <summary>
/// 清理边线检测多边形命令
/// </summary>
public
VCommand
ClearSideCheckPolygonCommand
{
get
;
set
;
}
/// <summary>
/// 清理边线检测多边形
/// </summary>
private
void
ClearSideCheckPolygon
()
{
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
(
false
);
clear_context
.
IsClearSideCheckPolygon
=
true
;
this
.
ClearVideoControl
(
clear_context
);
}
#
endregion
}
}
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Message.cs
View file @
ef52c28d
...
...
@@ -248,7 +248,7 @@ namespace VIZ.H2V.Module
/// <param name="view">视图</param>
private
void
OnAlgorithmMessage__crop_roi__borderline
(
AlgorithmMessage__crop_roi
msg
,
VideoRenderInfo
renderInfo
,
NDIView
view
)
{
if
(
msg
.
borderline
==
null
)
if
(
msg
.
borderline
==
null
||
!
this
.
FootballFieldPanelModel
.
IsShowBorder
)
{
view
.
video
.
ClearSideCheckPolygon
();
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.cs
View file @
ef52c28d
...
...
@@ -58,6 +58,7 @@ namespace VIZ.H2V.Module
this
.
SettingCommand
=
new
VCommand
<
string
>(
this
.
Setting
);
this
.
DetectCommand
=
new
VCommand
(
this
.
Detect
);
this
.
RestartCommand
=
new
VCommand
(
this
.
Restart
);
this
.
ClearSideCheckPolygonCommand
=
new
VCommand
(
this
.
ClearSideCheckPolygon
);
}
/// <summary>
...
...
@@ -139,7 +140,7 @@ namespace VIZ.H2V.Module
// ----------------------------------------------------------------------------------------------
// 清理视频控件
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
();
ClearVideoControlContext
clear_context
=
new
ClearVideoControlContext
(
true
);
// 当前处于裁切状态时不需要清理裁切框
clear_context
.
IsClearClipBox
=
this
.
ViewStatus
!=
NDIViewStatus
.
CropRoi
;
this
.
ClearVideoControl
(
clear_context
);
...
...
@@ -333,7 +334,7 @@ namespace VIZ.H2V.Module
log
.
Operation
=
last_mode
.
GetDescription
();
log
.
BeginTime
=
now
;
ApplicationDomainEx
.
CsvContext
.
LogOperations
.
Add
(
log
);
ApplicationDomainEx
.
CsvContext
.
LogOperations
.
Enqueue
(
log
);
}
}
}
...
...
VIZ.H2V.Module/Setup/Provider/AppSetup_InitCsv.cs
View file @
ef52c28d
...
...
@@ -76,7 +76,7 @@ namespace VIZ.H2V.Module
/// </summary>
private
void
WriteLogOperations
()
{
ApplicationDomainEx
.
CsvContext
.
FlushLogOperations
();
ApplicationDomainEx
.
CsvContext
.
FlushLogOperations
(
false
);
}
}
}
VIZ.H2V.Storage/CSV/CsvContext.cs
View file @
ef52c28d
...
...
@@ -39,7 +39,7 @@ namespace VIZ.H2V.Storage
/// 操作日志
/// </summary>
[
Csv
(
Scene
=
CsvScene
.
Write
)]
public
List
<
LogOperation
>
LogOperations
{
get
;
private
set
;
}
public
Queue
<
LogOperation
>
LogOperations
{
get
;
private
set
;
}
/// <summary>
/// 加载算法信息
...
...
@@ -105,23 +105,31 @@ namespace VIZ.H2V.Storage
CsvWriter
writer
=
new
CsvWriter
(
new
StreamWriter
(
fileName
,
false
,
Encoding
.
Default
),
config
);
writer
.
Context
.
RegisterClassMap
(
new
LogOperationMap
());
this
.
LogOperations
=
new
List
<
LogOperation
>();
this
.
LogOperations
=
new
Queue
<
LogOperation
>();
this
.
logOperationsWriter
=
writer
;
}
/// <summary>
/// 输出操作日志
/// </summary>
public
void
FlushLogOperations
()
/// <param name="writeLast">是否写入最后一个数据</param>
public
void
FlushLogOperations
(
bool
writeLast
)
{
if
(
this
.
logOperationsWriter
==
null
||
this
.
LogOperations
==
null
||
this
.
LogOperations
.
Count
==
0
)
return
;
List
<
LogOperation
>
list
=
new
List
<
LogOperation
>();
lock
(
this
.
LogOperations
)
{
this
.
logOperationsWriter
.
WriteRecords
(
this
.
LogOperations
)
;
int
count
=
writeLast
?
0
:
1
;
this
.
LogOperations
.
Clear
();
while
(
this
.
LogOperations
.
Count
>
count
)
{
LogOperation
log
=
this
.
LogOperations
.
Dequeue
();
list
.
Add
(
log
);
}
this
.
logOperationsWriter
.
WriteRecords
(
list
);
}
}
...
...
@@ -130,7 +138,7 @@ namespace VIZ.H2V.Storage
/// </summary>
public
void
CloseLogOperations
()
{
this
.
FlushLogOperations
();
this
.
FlushLogOperations
(
true
);
this
.
logOperationsWriter
?.
Flush
();
this
.
logOperationsWriter
?.
Dispose
();
this
.
logOperationsWriter
=
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment