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
f4a9c5e9
Commit
f4a9c5e9
authored
Nov 08, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加触碰摇杆时自动切换至手动模式
parent
a7bea142
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
226 additions
and
23 deletions
+226
-23
VIZ.H2V.Module/NDIMainView/Controller/Hotkey/HotkeyController.cs
+0
-4
VIZ.H2V.Module/NDIMainView/Controller/Navigation3DCheck/INavigation3DCheckSupport.cs
+15
-0
VIZ.H2V.Module/NDIMainView/Controller/Navigation3DCheck/Navigation3DCheckController.cs
+140
-0
VIZ.H2V.Module/NDIMainView/Service/INDIMainViewService.cs
+6
-0
VIZ.H2V.Module/NDIMainView/ViewModel/NDIMainViewModel.cs
+21
-2
VIZ.H2V.Module/NDIView/Enum/NDIViewScene.cs
+5
-1
VIZ.H2V.Module/NDIView/View/NDIView.xaml
+1
-2
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
+0
-14
VIZ.H2V.Module/SystemSetting/View/StyleSettingPanelView.xaml
+11
-0
VIZ.H2V.Module/SystemSetting/ViewModel/StyleSettingPanelViewModel.cs
+20
-0
VIZ.H2V.Module/VIZ.H2V.Module.csproj
+2
-0
VIZ.H2V.Storage/LiteDB/System/SystemConfig.cs
+5
-0
No files found.
VIZ.H2V.Module/NDIMainView/Controller/Hotkey/HotkeyController.cs
View file @
f4a9c5e9
...
@@ -45,8 +45,6 @@ namespace VIZ.H2V.Module
...
@@ -45,8 +45,6 @@ namespace VIZ.H2V.Module
if
(
this
.
focusNDIViewModel
==
null
)
if
(
this
.
focusNDIViewModel
==
null
)
return
;
return
;
this
.
focusNDIViewModel
.
IsFocus
=
true
;
// 切换为手动模式
// 切换为手动模式
ChangeStrategyContext
context
=
new
ChangeStrategyContext
();
ChangeStrategyContext
context
=
new
ChangeStrategyContext
();
context
.
IsUseClip
=
this
.
focusNDIViewModel
.
IsUseClip
;
context
.
IsUseClip
=
this
.
focusNDIViewModel
.
IsUseClip
;
...
@@ -72,8 +70,6 @@ namespace VIZ.H2V.Module
...
@@ -72,8 +70,6 @@ namespace VIZ.H2V.Module
context
.
TriggerScene
=
NDIViewScene
.
SpaceHotkey
;
context
.
TriggerScene
=
NDIViewScene
.
SpaceHotkey
;
this
.
focusNDIViewModel
.
ChangeStrategyMode
(
context
);
this
.
focusNDIViewModel
.
ChangeStrategyMode
(
context
);
this
.
focusNDIViewModel
.
IsFocus
=
false
;
this
.
focusNDIViewModel
=
null
;
this
.
focusNDIViewModel
=
null
;
}
}
...
...
VIZ.H2V.Module/NDIMainView/Controller/Navigation3DCheck/INavigation3DCheckSupport.cs
0 → 100644
View file @
f4a9c5e9
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.H2V.Module
{
/// <summary>
/// 3D鼠标支持
/// </summary>
public
interface
INavigation3DCheckSupport
{
}
}
VIZ.H2V.Module/NDIMainView/Controller/Navigation3DCheck/Navigation3DCheckController.cs
0 → 100644
View file @
f4a9c5e9
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Core
;
using
VIZ.H2V.Domain
;
using
VIZ.H2V.Storage
;
namespace
VIZ.H2V.Module
{
/// <summary>
/// 3D鼠标检测控制器
/// </summary>
public
class
Navigation3DCheckController
:
IDisposable
{
/// <summary>
/// 日志
/// </summary>
private
readonly
static
ILog
log
=
LogManager
.
GetLogger
(
typeof
(
Navigation3DCheckController
));
/// <summary>
/// 3D鼠标检测控制器
/// </summary>
/// <param name="support">支持</param>
public
Navigation3DCheckController
(
INavigation3DCheckSupport
support
)
{
// 注册到对象池
ApplicationDomainEx
.
ObjectPoolManager
.
Add
(
"Navigation3DCheckController"
,
this
);
this
.
Support
=
support
;
this
.
taskInfo
=
new
TaskInfo
();
this
.
executeTask
=
Task
.
Run
(
this
.
ExecuteCheck
);
}
/// <summary>
/// 支持
/// </summary>
public
INavigation3DCheckSupport
Support
{
get
;
private
set
;
}
/// <summary>
/// 是否启用
/// </summary>
public
bool
IsEnabled
{
get
;
set
;
}
/// <summary>
/// 任务信息
/// </summary>
private
TaskInfo
taskInfo
;
/// <summary>
/// 执行任务
/// </summary>
private
Task
executeTask
;
/// <summary>
/// 执行检测
/// </summary>
private
void
ExecuteCheck
()
{
TaskInfo
info
=
this
.
taskInfo
;
while
(!
info
.
IsCancel
)
{
try
{
this
.
_executeCheck
();
Task
.
Delay
(
100
).
Wait
();
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
}
}
/// <summary>
/// 执行检测
/// </summary>
private
void
_executeCheck
()
{
// 如果未启用,那么不处理
if
(!
this
.
IsEnabled
)
return
;
List
<
Navigation3DMapping
>
mappingList
=
ApplicationDomainEx
.
Navigation3DMapping
.
Mappings
;
// 如果没有映射信息,那么不处理
if
(
mappingList
==
null
)
return
;
int
value
=
Math
.
Abs
(
Navigation3DManager
.
Info
.
rz
);
Navigation3DMapping
first
=
mappingList
.
FirstOrDefault
();
// 如果移动值在最小值以内,那么不处理
if
(
value
<
first
.
MinValue
)
return
;
List
<
INDIViewService
>
services
=
ApplicationDomainEx
.
ServiceManager
.
GetServiceList
<
INDIViewService
>();
if
(
services
==
null
)
return
;
// 当前激活的视图
INDIViewService
service
=
services
.
FirstOrDefault
(
p
=>
p
.
IsActive
);
// 如果当前模式不处于算法模式,那么不处理
if
(
service
.
StrategyMode
!=
AlgorithmStrategyMode
.
auto_mode
)
return
;
// 如果当前状态不处于裁切状态或,检测状态那么不处理
if
(
service
.
ViewStatus
!=
NDIViewStatus
.
CropRoi
&&
service
.
ViewStatus
!=
NDIViewStatus
.
Detect
)
return
;
WPFHelper
.
BeginInvoke
(()
=>
{
ChangeStrategyContext
context
=
new
ChangeStrategyContext
();
context
.
IsUseClip
=
service
.
IsUseClip
;
context
.
Mode
=
AlgorithmStrategyMode
.
manual_mode
;
context
.
IsNeedRestart
=
false
;
context
.
TriggerScene
=
NDIViewScene
.
Navigation3D
;
service
.
ChangeStrategyMode
(
context
);
});
}
/// <summary>
/// 销毁
/// </summary>
public
void
Dispose
()
{
if
(
this
.
taskInfo
!=
null
)
{
this
.
taskInfo
.
IsCancel
=
true
;
}
this
.
taskInfo
=
null
;
this
.
executeTask
=
null
;
}
}
}
VIZ.H2V.Module/NDIMainView/Service/INDIMainViewService.cs
View file @
f4a9c5e9
...
@@ -17,5 +17,11 @@ namespace VIZ.H2V.Module
...
@@ -17,5 +17,11 @@ namespace VIZ.H2V.Module
/// 热键配置
/// 热键配置
/// </summary>
/// </summary>
HotkeyConfig
HotkeyConfig
{
get
;
set
;
}
HotkeyConfig
HotkeyConfig
{
get
;
set
;
}
/// <summary>
/// 设置3D鼠标检测是否生效
/// </summary>
/// <param name="isEnabled">是否生效</param>
void
SetNavigation3DCheckEnabled
(
bool
isEnabled
);
}
}
}
}
VIZ.H2V.Module/NDIMainView/ViewModel/NDIMainViewModel.cs
View file @
f4a9c5e9
...
@@ -21,7 +21,7 @@ namespace VIZ.H2V.Module
...
@@ -21,7 +21,7 @@ namespace VIZ.H2V.Module
/// <summary>
/// <summary>
/// NDI主视图模型
/// NDI主视图模型
/// </summary>
/// </summary>
public
class
NDIMainViewModel
:
ViewModelBase
,
INDIMainViewService
,
IHotkeySupport
,
IGpioSupport
public
class
NDIMainViewModel
:
ViewModelBase
,
INDIMainViewService
,
IHotkeySupport
,
IGpioSupport
,
INavigation3DCheckSupport
{
{
/// <summary>
/// <summary>
/// 日志
/// 日志
...
@@ -91,6 +91,7 @@ namespace VIZ.H2V.Module
...
@@ -91,6 +91,7 @@ namespace VIZ.H2V.Module
{
{
this
.
hotkeyController
=
new
HotkeyController
(
this
);
this
.
hotkeyController
=
new
HotkeyController
(
this
);
this
.
gpioController
=
new
GpioController
(
this
);
this
.
gpioController
=
new
GpioController
(
this
);
this
.
navigation3DCheckController
=
new
Navigation3DCheckController
(
this
);
}
}
/// <summary>
/// <summary>
...
@@ -127,6 +128,11 @@ namespace VIZ.H2V.Module
...
@@ -127,6 +128,11 @@ namespace VIZ.H2V.Module
/// </summary>
/// </summary>
private
GpioController
gpioController
;
private
GpioController
gpioController
;
/// <summary>
/// 3D鼠标检测控制器
/// </summary>
private
Navigation3DCheckController
navigation3DCheckController
;
// ======================================================================================
// ======================================================================================
// === Property ===
// === Property ===
// ======================================================================================
// ======================================================================================
...
@@ -324,7 +330,20 @@ namespace VIZ.H2V.Module
...
@@ -324,7 +330,20 @@ namespace VIZ.H2V.Module
#
endregion
#
endregion
// ======================================================================================
// ======================================================================================
// === Privatee Function ===
// === Public Function ===
// ======================================================================================
/// <summary>
/// 设置3D鼠标检测是否生效
/// </summary>
/// <param name="isEnabled">是否生效</param>
public
void
SetNavigation3DCheckEnabled
(
bool
isEnabled
)
{
this
.
navigation3DCheckController
.
IsEnabled
=
isEnabled
;
}
// ======================================================================================
// === Private Function ===
// ======================================================================================
// ======================================================================================
/// <summary>
/// <summary>
...
...
VIZ.H2V.Module/NDIView/Enum/NDIViewScene.cs
View file @
f4a9c5e9
...
@@ -26,6 +26,10 @@ namespace VIZ.H2V.Module
...
@@ -26,6 +26,10 @@ namespace VIZ.H2V.Module
/// <summary>
/// <summary>
/// 空格热键
/// 空格热键
/// </summary>
/// </summary>
SpaceHotkey
SpaceHotkey
,
/// <summary>
/// 摇杆触发
/// </summary>
Navigation3D
}
}
}
}
VIZ.H2V.Module/NDIView/View/NDIView.xaml
View file @
f4a9c5e9
...
@@ -131,8 +131,7 @@
...
@@ -131,8 +131,7 @@
MaxWidth="300"></TextBlock>
MaxWidth="300"></TextBlock>
</Grid>
</Grid>
<!-- 算法 -->
<!-- 算法 -->
<Grid Grid.RowSpan="2" Margin="0,20,0,0"
<Grid Grid.RowSpan="2" Margin="0,20,0,0">
IsEnabled="{Binding Path=IsFocus,Converter={StaticResource Bool2BoolConverter}}">
<Grid IsEnabled="{Binding Path=ViewStatus,Converter={StaticResource NDIViewStatus2IsEnabledConverter}}">
<Grid IsEnabled="{Binding Path=ViewStatus,Converter={StaticResource NDIViewStatus2IsEnabledConverter}}">
<Grid.RowDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
View file @
f4a9c5e9
...
@@ -361,20 +361,6 @@ namespace VIZ.H2V.Module
...
@@ -361,20 +361,6 @@ namespace VIZ.H2V.Module
#
endregion
#
endregion
#
region
IsFocus
--
是否聚焦
private
bool
isFocus
;
/// <summary>
/// 是否聚焦
/// </summary>
public
bool
IsFocus
{
get
{
return
isFocus
;
}
set
{
isFocus
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsFocus
));
}
}
#
endregion
// --------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------
#
region
IsUseClip
--
是否使用裁切
#
region
IsUseClip
--
是否使用裁切
...
...
VIZ.H2V.Module/SystemSetting/View/StyleSettingPanelView.xaml
View file @
f4a9c5e9
...
@@ -148,6 +148,16 @@
...
@@ -148,6 +148,16 @@
Minimum="0.001" Maximum="0.2" Increment="0.001"
Minimum="0.001" Maximum="0.2" Increment="0.001"
Value="{Binding Path=ManualSmoothCoeff,Mode=TwoWay}"></toolkit:DoubleUpDown>
Value="{Binding Path=ManualSmoothCoeff,Mode=TwoWay}"></toolkit:DoubleUpDown>
</Grid>
</Grid>
<!-- 是否在触碰摇杆时切换至手动模式 -->
<Grid Grid.Row="9">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="500"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="是否在触碰摇杆时由自动模式切换至手动模式" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="2"></TextBlock>
<CheckBox Grid.Column="1" Style="{StaticResource CheckBox_Setting}" HorizontalAlignment="Right"
IsChecked="{Binding Path=IsWhenNavigationTouchedChangeToManualMode,Mode=TwoWay}"></CheckBox>
</Grid>
</Grid>
</Grid>
</Border>
</Border>
</UserControl>
</UserControl>
\ No newline at end of file
VIZ.H2V.Module/SystemSetting/ViewModel/StyleSettingPanelViewModel.cs
View file @
f4a9c5e9
...
@@ -174,6 +174,20 @@ namespace VIZ.H2V.Module
...
@@ -174,6 +174,20 @@ namespace VIZ.H2V.Module
#
endregion
#
endregion
#
region
IsWhenNavigationTouchedChangeToManualMode
--
是否当触碰到摇杆时由自动模式切换至手动模式
private
bool
isWhenNavigationTouchedChangeToManualMode
;
/// <summary>
/// 是否当触碰到摇杆时由自动模式切换至手动模式
/// </summary>
public
bool
IsWhenNavigationTouchedChangeToManualMode
{
get
{
return
isWhenNavigationTouchedChangeToManualMode
;
}
set
{
isWhenNavigationTouchedChangeToManualMode
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsWhenNavigationTouchedChangeToManualMode
));
}
}
#
endregion
// ======================================================================================
// ======================================================================================
// === Commond ===
// === Commond ===
// ======================================================================================
// ======================================================================================
...
@@ -203,6 +217,7 @@ namespace VIZ.H2V.Module
...
@@ -203,6 +217,7 @@ namespace VIZ.H2V.Module
this
.
ClipCenterAxisColor
=
(
Color
)
ColorConverter
.
ConvertFromString
(
this
.
SystemConfig
.
ClipCenterAxisColor
);
this
.
ClipCenterAxisColor
=
(
Color
)
ColorConverter
.
ConvertFromString
(
this
.
SystemConfig
.
ClipCenterAxisColor
);
this
.
ManualSmoothCoeff
=
this
.
SystemConfig
.
ManualSmoothCoeff
;
this
.
ManualSmoothCoeff
=
this
.
SystemConfig
.
ManualSmoothCoeff
;
this
.
IsWhenNavigationTouchedChangeToManualMode
=
this
.
SystemConfig
.
IsWhenNavigationTouchedChangeToManualMode
;
// 加载3D鼠标映射模型
// 加载3D鼠标映射模型
this
.
Load3DNavigationMapping
();
this
.
Load3DNavigationMapping
();
...
@@ -268,6 +283,9 @@ namespace VIZ.H2V.Module
...
@@ -268,6 +283,9 @@ namespace VIZ.H2V.Module
if
(
this
.
Navigation3DMappingMultiple
!=
this
.
SystemConfig
.
ManualNavigation3DMappingMultiple
)
if
(
this
.
Navigation3DMappingMultiple
!=
this
.
SystemConfig
.
ManualNavigation3DMappingMultiple
)
return
true
;
return
true
;
if
(
this
.
IsWhenNavigationTouchedChangeToManualMode
!=
this
.
SystemConfig
.
IsWhenNavigationTouchedChangeToManualMode
)
return
true
;
return
false
;
return
false
;
}
}
...
@@ -287,6 +305,7 @@ namespace VIZ.H2V.Module
...
@@ -287,6 +305,7 @@ namespace VIZ.H2V.Module
this
.
SystemConfig
.
ManualSmoothCoeff
=
this
.
ManualSmoothCoeff
;
this
.
SystemConfig
.
ManualSmoothCoeff
=
this
.
ManualSmoothCoeff
;
this
.
SystemConfig
.
ManualNavigation3DMappingName
=
this
.
SelectedNavigation3DMappingGroupModel
.
Name
;
this
.
SystemConfig
.
ManualNavigation3DMappingName
=
this
.
SelectedNavigation3DMappingGroupModel
.
Name
;
this
.
SystemConfig
.
ManualNavigation3DMappingMultiple
=
this
.
Navigation3DMappingMultiple
;
this
.
SystemConfig
.
ManualNavigation3DMappingMultiple
=
this
.
Navigation3DMappingMultiple
;
this
.
SystemConfig
.
IsWhenNavigationTouchedChangeToManualMode
=
this
.
IsWhenNavigationTouchedChangeToManualMode
;
ApplicationDomainEx
.
LiteDbContext
.
SystemConfig
.
Update
(
this
.
SystemConfig
);
ApplicationDomainEx
.
LiteDbContext
.
SystemConfig
.
Update
(
this
.
SystemConfig
);
...
@@ -299,6 +318,7 @@ namespace VIZ.H2V.Module
...
@@ -299,6 +318,7 @@ namespace VIZ.H2V.Module
ApplicationDomainEx
.
Navigation3DMapping
.
Name
=
this
.
SelectedNavigation3DMappingGroupModel
.
Name
;
ApplicationDomainEx
.
Navigation3DMapping
.
Name
=
this
.
SelectedNavigation3DMappingGroupModel
.
Name
;
ApplicationDomainEx
.
Navigation3DMapping
.
Multiple
=
this
.
Navigation3DMappingMultiple
;
ApplicationDomainEx
.
Navigation3DMapping
.
Multiple
=
this
.
Navigation3DMappingMultiple
;
ApplicationDomainEx
.
Navigation3DMapping
.
Mappings
=
this
.
SelectedNavigation3DMappingGroupModel
.
Mappings
;
ApplicationDomainEx
.
Navigation3DMapping
.
Mappings
=
this
.
SelectedNavigation3DMappingGroupModel
.
Mappings
;
ApplicationDomainEx
.
ServiceManager
.
GetService
<
INDIMainViewService
>(
NDIViewKeys
.
MainView
).
SetNavigation3DCheckEnabled
(
this
.
IsWhenNavigationTouchedChangeToManualMode
);
// 返回
// 返回
return
true
;
return
true
;
...
...
VIZ.H2V.Module/VIZ.H2V.Module.csproj
View file @
f4a9c5e9
...
@@ -202,6 +202,8 @@
...
@@ -202,6 +202,8 @@
<Compile Include="NDIMainView\Controller\Gpio\IGpioSupport.cs" />
<Compile Include="NDIMainView\Controller\Gpio\IGpioSupport.cs" />
<Compile Include="NDIMainView\Controller\Hotkey\HotkeyController.cs" />
<Compile Include="NDIMainView\Controller\Hotkey\HotkeyController.cs" />
<Compile Include="NDIMainView\Controller\Hotkey\IHotkeySupport.cs" />
<Compile Include="NDIMainView\Controller\Hotkey\IHotkeySupport.cs" />
<Compile Include="NDIMainView\Controller\Navigation3DCheck\INavigation3DCheckSupport.cs" />
<Compile Include="NDIMainView\Controller\Navigation3DCheck\Navigation3DCheckController.cs" />
<Compile Include="NDIMainView\Service\INDIMainViewService.cs" />
<Compile Include="NDIMainView\Service\INDIMainViewService.cs" />
<Compile Include="NDISettingView\ViewModel\Algorithm\AlgorithmCablewayPanelViewModel.cs" />
<Compile Include="NDISettingView\ViewModel\Algorithm\AlgorithmCablewayPanelViewModel.cs" />
<Compile Include="NDISettingView\ViewModel\Algorithm\AlgorithmTacticsPanelViewModel.cs" />
<Compile Include="NDISettingView\ViewModel\Algorithm\AlgorithmTacticsPanelViewModel.cs" />
...
...
VIZ.H2V.Storage/LiteDB/System/SystemConfig.cs
View file @
f4a9c5e9
...
@@ -66,6 +66,11 @@ namespace VIZ.H2V.Storage
...
@@ -66,6 +66,11 @@ namespace VIZ.H2V.Storage
public
double
ManualNavigation3DMappingMultiple
{
get
;
set
;
}
=
1d
;
public
double
ManualNavigation3DMappingMultiple
{
get
;
set
;
}
=
1d
;
/// <summary>
/// <summary>
/// 是否当触碰到摇杆时由自动模式切换至手动模式
/// </summary>
public
bool
IsWhenNavigationTouchedChangeToManualMode
{
get
;
set
;
}
=
false
;
/// <summary>
/// Tally信息 -- 窗口1
/// Tally信息 -- 窗口1
/// </summary>
/// </summary>
public
TallyInfo
TallyInfo1
{
get
;
set
;
}
=
new
TallyInfo
();
public
TallyInfo
TallyInfo1
{
get
;
set
;
}
=
new
TallyInfo
();
...
...
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