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
bb3b8139
Commit
bb3b8139
authored
Sep 06, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 添加聚焦热键
parent
1d0922c8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
214 additions
and
17 deletions
+214
-17
VIZ.H2V.Module/NDIMainView/Controller/Hotkey/HotkeyController.cs
+38
-0
VIZ.H2V.Module/NDIMainView/ViewModel/NDIMainViewModel.cs
+1
-1
VIZ.H2V.Module/NDIView/Service/INDIViewService.cs
+5
-0
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Manual_NDI.cs
+7
-16
VIZ.H2V.Module/SystemSetting/View/HotkeySettingPanelView.xaml
+37
-0
VIZ.H2V.Module/SystemSetting/ViewModel/HotkeySettingPanelViewModel.cs
+106
-0
VIZ.H2V.Storage/LiteDB/System/HotkeyConfig.cs
+20
-0
No files found.
VIZ.H2V.Module/NDIMainView/Controller/Hotkey/HotkeyController.cs
View file @
bb3b8139
...
...
@@ -112,6 +112,10 @@ namespace VIZ.H2V.Module
// 手动裁切
if
(
this
.
ExecuteManual
(
hotkey
))
return
;
// 窗口焦点
if
(
this
.
ExecuteActive
(
hotkey
))
return
;
}
/// <summary>
...
...
@@ -248,5 +252,39 @@ namespace VIZ.H2V.Module
return
true
;
}
/// <summary>
/// 处理窗口焦点
/// </summary>
/// <param name="hotkey">热键</param>
/// <returns>是否处理完成</returns>
private
bool
ExecuteActive
(
string
hotkey
)
{
INDIViewService
service
=
null
;
if
(
string
.
Equals
(
this
.
Support
.
HotkeyConfig
.
ActiveCAM1
,
hotkey
))
{
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIViewService
>(
NDIViewKeys
.
CAM_1
);
}
if
(
string
.
Equals
(
this
.
Support
.
HotkeyConfig
.
ActiveCAM2
,
hotkey
))
{
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIViewService
>(
NDIViewKeys
.
CAM_2
);
}
if
(
string
.
Equals
(
this
.
Support
.
HotkeyConfig
.
ActiveCAM3
,
hotkey
))
{
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIViewService
>(
NDIViewKeys
.
CAM_3
);
}
if
(
string
.
Equals
(
this
.
Support
.
HotkeyConfig
.
ActiveCAM4
,
hotkey
))
{
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIViewService
>(
NDIViewKeys
.
CAM_4
);
}
if
(
service
==
null
)
return
false
;
service
.
IsActive
=
true
;
return
true
;
}
}
}
VIZ.H2V.Module/NDIMainView/ViewModel/NDIMainViewModel.cs
View file @
bb3b8139
...
...
@@ -217,7 +217,7 @@ namespace VIZ.H2V.Module
private
void
Setting
()
{
SystemSettingView
view
=
new
SystemSettingView
();
NoneWindow
window
=
new
NoneWindow
(
1200
,
9
00
,
view
);
NoneWindow
window
=
new
NoneWindow
(
1200
,
10
00
,
view
);
window
.
Owner
=
this
.
GetWindow
();
window
.
ShowDialog
();
...
...
VIZ.H2V.Module/NDIView/Service/INDIViewService.cs
View file @
bb3b8139
...
...
@@ -30,6 +30,11 @@ namespace VIZ.H2V.Module
bool
IsUseClip
{
get
;
}
/// <summary>
/// 是否被激活
/// </summary>
bool
IsActive
{
get
;
set
;
}
/// <summary>
/// 算法类型
/// </summary>
AlgorithmStrategyType
StrategyType
{
get
;
set
;
}
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Manual_NDI.cs
View file @
bb3b8139
...
...
@@ -51,22 +51,6 @@ namespace VIZ.H2V.Module
this
.
ManualController
.
ClipBoxSmooth
.
Init
(
555
,
555
,
config
.
ManualSmoothCoeff
);
this
.
ManualController
.
ClipBoxTargetX
=
555
;
CompositionTarget
.
Rendering
-=
CompositionTarget_Rendering
;
CompositionTarget
.
Rendering
+=
CompositionTarget_Rendering
;
}
/// <summary>
/// 渲染处理
/// </summary>
private
void
CompositionTarget_Rendering
(
object
sender
,
EventArgs
e
)
{
// 更新手动裁切框
// 仅手动模式下处理 & 需要进行裁切 & 3D鼠标准备完毕 时才处理
if
(
this
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
&&
this
.
IsUseClip
)
{
this
.
UpdateClipBoxWithManual
();
}
}
/// <summary>
...
...
@@ -119,6 +103,13 @@ namespace VIZ.H2V.Module
// 更新画面
view
.
video
.
UpdateVideoFrame
(
e
.
Frame
);
// 更新手动裁切框
// 仅手动模式下处理 & 需要进行裁切 & 3D鼠标准备完毕 时才处理
if
(
this
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
&&
this
.
IsUseClip
)
{
this
.
UpdateClipBoxWithManual
();
}
// 如果当前模式为手动模式且处于接收裁切信号状态,并且需要进行裁切,那么发送手动裁切信号
if
(
e
.
Frame
!=
null
&&
this
.
ViewConfig
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
&&
this
.
ViewStatus
==
NDIViewStatus
.
CropRoi
&&
this
.
IsUseClip
)
{
...
...
VIZ.H2V.Module/SystemSetting/View/HotkeySettingPanelView.xaml
View file @
bb3b8139
...
...
@@ -32,6 +32,8 @@
<RowDefinition Height="120"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="120"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="120"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 算法裁切快捷键 -->
...
...
@@ -65,6 +67,7 @@
<fcommon:HotkeyBox Grid.Column="3" Hotkey="{Binding Path=AutoCAM4,Mode=TwoWay}" Height="30" Grid.Row="1"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
</Grid>
<!-- 居中裁切快捷键 -->
<TextBlock Text="居中裁切快捷键" Foreground="White" FontSize="20" VerticalAlignment="Center" Grid.Row="2"></TextBlock>
<Rectangle Grid.Row="2" VerticalAlignment="Bottom" Height="2" Fill="#ff364051"></Rectangle>
...
...
@@ -96,6 +99,7 @@
<fcommon:HotkeyBox Grid.Column="3" Hotkey="{Binding Path=CenterCAM4,Mode=TwoWay}" Height="30" Grid.Row="1"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
</Grid>
<!-- 手动裁切快捷键 -->
<TextBlock Text="手动裁切快捷键" Foreground="White" FontSize="20" VerticalAlignment="Center" Grid.Row="4"></TextBlock>
<Rectangle Grid.Row="4" VerticalAlignment="Bottom" Height="2" Fill="#ff364051"></Rectangle>
...
...
@@ -127,6 +131,38 @@
<fcommon:HotkeyBox Grid.Column="3" Hotkey="{Binding Path=ManualCAM4,Mode=TwoWay}" Height="30" Grid.Row="1"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
</Grid>
<!-- 窗口聚焦快捷键 -->
<TextBlock Text="窗口聚焦快捷键" Foreground="White" FontSize="20" VerticalAlignment="Center" Grid.Row="6"></TextBlock>
<Rectangle Grid.Row="6" VerticalAlignment="Bottom" Height="2" Fill="#ff364051"></Rectangle>
<Grid Grid.Row="7">
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- CAM 1 -->
<TextBlock Text="CAM 1" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="0"></TextBlock>
<fcommon:HotkeyBox Grid.Column="1" Hotkey="{Binding Path=ActiveCAM1,Mode=TwoWay}" Height="30"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
<!-- CAM 2 -->
<TextBlock Text="CAM 2" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="0" Grid.Column="2"></TextBlock>
<fcommon:HotkeyBox Grid.Column="3" Hotkey="{Binding Path=ActiveCAM2,Mode=TwoWay}" Height="30" Grid.Row="0"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
<!-- CAM 3 -->
<TextBlock Text="CAM 3" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="1"></TextBlock>
<fcommon:HotkeyBox Grid.Column="1" Hotkey="{Binding Path=ActiveCAM3,Mode=TwoWay}" Height="30" Grid.Row="1"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
<!-- CAM 4 -->
<TextBlock Text="CAM 4" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="1" Grid.Column="2"></TextBlock>
<fcommon:HotkeyBox Grid.Column="3" Hotkey="{Binding Path=ActiveCAM4,Mode=TwoWay}" Height="30" Grid.Row="1"
Style="{StaticResource HotkeyBox_Setting}" Margin="0,0,20,0"></fcommon:HotkeyBox>
</Grid>
</Grid>
</Border>
</UserControl>
\ No newline at end of file
VIZ.H2V.Module/SystemSetting/ViewModel/HotkeySettingPanelViewModel.cs
View file @
bb3b8139
...
...
@@ -289,6 +289,93 @@ namespace VIZ.H2V.Module
#
endregion
// -----------------------------------------------------------------------
// 窗口聚焦
#
region
ActiveCAM1
--
窗口聚焦
视图
1
private
string
activeCAM1
;
/// <summary>
/// 窗口聚焦 视图1
/// </summary>
[
HotkeyProperty
]
public
string
ActiveCAM1
{
get
{
return
activeCAM1
;
}
set
{
activeCAM1
=
value
;
activeCAM1
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ActiveCAM1
));
this
.
CheckHotkey
(
nameof
(
ActiveCAM1
),
value
);
}
}
#
endregion
#
region
ActiveCAM2
--
窗口聚焦
视图
2
private
string
activeCAM2
;
/// <summary>
/// 窗口聚焦 视图2
/// </summary>
[
HotkeyProperty
]
public
string
ActiveCAM2
{
get
{
return
activeCAM2
;
}
set
{
activeCAM2
=
value
;
activeCAM2
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ActiveCAM2
));
this
.
CheckHotkey
(
nameof
(
ActiveCAM2
),
value
);
}
}
#
endregion
#
region
ActiveCAM3
--
窗口聚焦
视图
3
private
string
activeCAM3
;
/// <summary>
/// 窗口聚焦 视图3
/// </summary>
[
HotkeyProperty
]
public
string
ActiveCAM3
{
get
{
return
activeCAM3
;
}
set
{
activeCAM3
=
value
;
activeCAM3
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ActiveCAM3
));
this
.
CheckHotkey
(
nameof
(
ActiveCAM3
),
value
);
}
}
#
endregion
#
region
ActiveCAM4
--
窗口聚焦
视图
4
private
string
activeCAM4
;
/// <summary>
/// 窗口聚焦 视图4
/// </summary>
[
HotkeyProperty
]
public
string
ActiveCAM4
{
get
{
return
activeCAM4
;
}
set
{
activeCAM4
=
value
;
activeCAM4
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ActiveCAM4
));
this
.
CheckHotkey
(
nameof
(
ActiveCAM4
),
value
);
}
}
#
endregion
// ======================================================================================
// === Commond ===
// ======================================================================================
...
...
@@ -324,6 +411,11 @@ namespace VIZ.H2V.Module
this
.
ManualCAM2
=
this
.
HotkeyConfig
.
ManualCAM2
;
this
.
ManualCAM3
=
this
.
HotkeyConfig
.
ManualCAM3
;
this
.
ManualCAM4
=
this
.
HotkeyConfig
.
ManualCAM4
;
this
.
ActiveCAM1
=
this
.
HotkeyConfig
.
ActiveCAM1
;
this
.
ActiveCAM2
=
this
.
HotkeyConfig
.
ActiveCAM2
;
this
.
ActiveCAM3
=
this
.
HotkeyConfig
.
ActiveCAM3
;
this
.
ActiveCAM4
=
this
.
HotkeyConfig
.
ActiveCAM4
;
}
#
endregion
...
...
@@ -361,6 +453,15 @@ namespace VIZ.H2V.Module
if
(
this
.
ManualCAM4
!=
this
.
HotkeyConfig
.
ManualCAM4
)
return
true
;
if
(
this
.
ActiveCAM1
!=
this
.
HotkeyConfig
.
ActiveCAM1
)
return
true
;
if
(
this
.
ActiveCAM2
!=
this
.
HotkeyConfig
.
ActiveCAM2
)
return
true
;
if
(
this
.
ActiveCAM3
!=
this
.
HotkeyConfig
.
ActiveCAM3
)
return
true
;
if
(
this
.
ActiveCAM4
!=
this
.
HotkeyConfig
.
ActiveCAM4
)
return
true
;
return
false
;
}
...
...
@@ -385,6 +486,11 @@ namespace VIZ.H2V.Module
this
.
HotkeyConfig
.
ManualCAM3
=
this
.
ManualCAM3
;
this
.
HotkeyConfig
.
ManualCAM4
=
this
.
ManualCAM4
;
this
.
HotkeyConfig
.
ActiveCAM1
=
this
.
ActiveCAM1
;
this
.
HotkeyConfig
.
ActiveCAM2
=
this
.
ActiveCAM2
;
this
.
HotkeyConfig
.
ActiveCAM3
=
this
.
ActiveCAM3
;
this
.
HotkeyConfig
.
ActiveCAM4
=
this
.
ActiveCAM4
;
ApplicationDomainEx
.
LiteDbContext
.
HotkeyConfig
.
Upsert
(
this
.
HotkeyConfig
);
INDIMainViewService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIMainViewService
>(
NDIViewKeys
.
MainView
);
...
...
VIZ.H2V.Storage/LiteDB/System/HotkeyConfig.cs
View file @
bb3b8139
...
...
@@ -76,5 +76,25 @@ namespace VIZ.H2V.Storage
/// 手动裁切 视图4
/// </summary>
public
string
ManualCAM4
{
get
;
set
;
}
=
"D4"
;
/// <summary>
/// 窗口聚焦 视图1
/// </summary>
public
string
ActiveCAM1
{
get
;
set
;
}
=
"F1"
;
/// <summary>
/// 窗口聚焦 视图2
/// </summary>
public
string
ActiveCAM2
{
get
;
set
;
}
=
"F2"
;
/// <summary>
/// 窗口聚焦 视图3
/// </summary>
public
string
ActiveCAM3
{
get
;
set
;
}
=
"F3"
;
/// <summary>
/// 窗口聚焦 视图4
/// </summary>
public
string
ActiveCAM4
{
get
;
set
;
}
=
"F4"
;
}
}
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