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
24af89f7
Commit
24af89f7
authored
Aug 29, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3D 鼠标接入
parent
4c6a6318
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
128 additions
and
35 deletions
+128
-35
Lib/VIZ.Framework.Core.Navigation3D.dll
+0
-0
VIZ.H2V.ClipTestTool/MainWindow.xaml.cs
+1
-1
VIZ.H2V.Module/NDIView/Controller/Manual/IManualController.cs
+20
-0
VIZ.H2V.Module/NDIView/Controller/Manual/IManualSupport.cs
+16
-0
VIZ.H2V.Module/NDIView/Controller/Manual/ManualController.cs
+71
-0
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Manual_NDI.cs
+2
-30
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
+6
-1
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.cs
+3
-1
VIZ.H2V.Module/VIZ.H2V.Module.csproj
+3
-0
VIZ.H2V.sln
+0
-0
VIZ.H2V/App.xaml.cs
+5
-1
VIZ.H2V/MainWindow.xaml.cs
+1
-1
No files found.
Lib/VIZ.Framework.Core.Navigation3D.dll
0 → 100644
View file @
24af89f7
File added
VIZ.H2V.ClipTestTool/MainWindow.xaml.cs
View file @
24af89f7
...
...
@@ -32,7 +32,7 @@ namespace VIZ.H2V.ClipTestTool
private
void
MainWindow_Loaded
(
object
sender
,
RoutedEventArgs
e
)
{
// 執行加载流程
AppSetupContext
context
=
AppSetup
.
Load
();
AppSetupContext
context
=
AppSetup
.
Load
(
this
);
if
(
context
.
Exception
!=
null
)
{
...
...
VIZ.H2V.Module/NDIView/Controller/Manual/IManualController.cs
0 → 100644
View file @
24af89f7
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.H2V.Module
{
/// <summary>
/// 手动裁切控制器
/// </summary>
public
interface
IManualController
{
/// <summary>
/// 获取映射值
/// </summary>
/// <returns>映射值</returns>
int
GetMappingValue
();
}
}
VIZ.H2V.Module/NDIView/Controller/Manual/IManualSupport.cs
0 → 100644
View file @
24af89f7
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.H2V.Module
{
/// <summary>
/// 手动裁切控制器支持
/// </summary>
public
interface
IManualSupport
{
}
}
VIZ.H2V.Module/NDIView/Controller/Manual/ManualController.cs
0 → 100644
View file @
24af89f7
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Management.Instrumentation
;
using
System.Security.Policy
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Core
;
using
VIZ.H2V.Domain
;
namespace
VIZ.H2V.Module
{
/// <summary>
/// 手动控制器
/// </summary>
public
class
ManualController
:
IManualController
{
/// <summary>
/// 手动控制器
/// </summary>
/// <param name="support"></param>
public
ManualController
(
IManualSupport
support
)
{
this
.
Support
=
support
;
}
/// <summary>
/// 支持
/// </summary>
public
IManualSupport
Support
{
get
;
private
set
;
}
//long lScaleData = pEvent->u.spwData.mData[SI_TY];
//long lFuncData = pEvent->u.spwData.mData[SI_RZ];
//long lPosData0 = pEvent->u.spwData.mData[SI_RX];
//long lPosData1 = pEvent->u.spwData.mData[SI_RZ];
//long lRotData0 = pEvent->u.spwData.mData[SI_TX];
//long lRotData1 = pEvent->u.spwData.mData[SI_RY];
/// <summary>
/// 获取映射值
/// </summary>
/// <returns>映射值</returns>
public
int
GetMappingValue
()
{
int
symbol
=
Navigation3DManager
.
Info
.
rz
>=
0
?
1
:
-
1
;
int
value
=
Math
.
Abs
(
Navigation3DManager
.
Info
.
rz
);
Navigation3DMapping
first
=
ApplicationDomainEx
.
CsvContext
.
Navigation3DMappings
.
FirstOrDefault
();
Navigation3DMapping
last
=
ApplicationDomainEx
.
CsvContext
.
Navigation3DMappings
.
LastOrDefault
();
if
(
value
==
0
||
value
<
first
.
MinValue
)
{
return
0
;
}
if
(
value
>=
last
.
MaxValue
)
{
return
last
.
MappingValue
*
symbol
;
}
Navigation3DMapping
mapping
=
ApplicationDomainEx
.
CsvContext
.
Navigation3DMappings
.
FirstOrDefault
(
p
=>
value
>=
p
.
MinValue
&&
value
<
p
.
MaxValue
);
if
(
mapping
==
null
)
return
0
;
return
mapping
.
MappingValue
*
symbol
;
}
}
}
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Manual_NDI.cs
View file @
24af89f7
...
...
@@ -66,14 +66,6 @@ namespace VIZ.H2V.Module
this
.
ClipBoxSmooth
=
new
Navigation3DSmooth
();
this
.
ClipBoxSmooth
.
Init
(
0
,
0
,
config
.
ManualSmoothCoeff
);
// 是否启用平滑
//SystemConfig config = ApplicationDomainEx.LiteDbContext.SystemConfig.FindAll().FirstOrDefault();
//Navigation3DManager.Navigation3DModel.IsUseSmooth = config.IsManualUseSmooth;
// 注册WPF渲染事件,用于处理3D鼠标
//CompositionTarget.Rendering -= CompositionTarget_Rendering;
//CompositionTarget.Rendering += CompositionTarget_Rendering;
}
/// <summary>
...
...
@@ -88,18 +80,6 @@ namespace VIZ.H2V.Module
}
/// <summary>
/// WPF渲染事件
/// </summary>
//private void CompositionTarget_Rendering(object sender, EventArgs e)
//{
// // 仅手动模式下处理 & 需要进行裁切 & 3D鼠标准备完毕 时才处理
// if (this.StrategyMode != AlgorithmStrategyMode.manual_mode || !this.IsUseClip || !Navigation3DManager.Navigation3DModel.IsReady)
// return;
// this.UpdateClipBoxWithManual();
//}
/// <summary>
/// 手动模式更新裁切框
/// </summary>
private
void
UpdateClipBoxWithManual
()
...
...
@@ -115,7 +95,8 @@ namespace VIZ.H2V.Module
return
;
}
double
x
=
this
.
ClipBoxTargetX
+
Navigation3DTcpManager
.
MappingValue
;
//double x = this.ClipBoxTargetX + Navigation3DTcpManager.MappingValue;
double
x
=
this
.
ClipBoxTargetX
+
this
.
ManualController
.
GetMappingValue
();
x
=
MathHelper
.
Clip
(
0d
,
renderInfo
.
Frame
.
Width
-
this
.
CLIP_BOX_WIDTH
,
x
);
this
.
ClipBoxTargetX
=
x
;
this
.
ClipBoxX
=
this
.
ClipBoxSmooth
.
Call
(
this
.
ClipBoxTargetX
,
1
);
...
...
@@ -141,17 +122,8 @@ namespace VIZ.H2V.Module
// 更新画面
view
.
video
.
UpdateVideoFrame
(
e
.
Frame
);
//#if DEBUG
// //Debug.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} MappingValue {Navigation3DTcpManager.MappingValue}");
// if (this.ViewKey == NDIViewKeys.CAM_1)
// {
// log.Debug($"【渲染视频帧】 时间: {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} 帧时间戳:{e.Frame.TimeStamp}");
// }
//#endif
// 更新手动裁切框
// 仅手动模式下处理 & 需要进行裁切 & 3D鼠标准备完毕 时才处理
//if (this.StrategyMode == AlgorithmStrategyMode.manual_mode && this.IsUseClip && Navigation3DManager.Navigation3DModel.IsReady)
if
(
this
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
&&
this
.
IsUseClip
)
{
this
.
UpdateClipBoxWithManual
();
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
View file @
24af89f7
...
...
@@ -98,6 +98,11 @@ namespace VIZ.H2V.Module
/// </summary>
private
readonly
Dictionary
<
AlgorithmStrategyType
,
IAlgorithmController
>
AlgorithmControllerDic
=
new
Dictionary
<
AlgorithmStrategyType
,
IAlgorithmController
>();
/// <summary>
/// 手动裁切控制器
/// </summary>
private
IManualController
ManualController
;
// ======================================================================================
// === Property ===
// ======================================================================================
...
...
@@ -269,7 +274,7 @@ namespace VIZ.H2V.Module
#
region
ClipBoxTargetX
--
裁切框目标
X
坐标
private
double
clipBoxTargetX
;
private
double
clipBoxTargetX
=
555
;
/// <summary>
/// 裁切框目标X坐标
/// </summary>
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.cs
View file @
24af89f7
...
...
@@ -15,7 +15,7 @@ namespace VIZ.H2V.Module
/// <summary>
/// NDI视图模型
/// </summary>
public
partial
class
NDIViewModel
:
ViewModelBase
,
INDIViewService
,
IAlgorithmSupport
public
partial
class
NDIViewModel
:
ViewModelBase
,
INDIViewService
,
IAlgorithmSupport
,
IManualSupport
{
/// <summary>
/// 日志
...
...
@@ -73,6 +73,8 @@ namespace VIZ.H2V.Module
this
.
AlgorithmControllerDic
.
Add
(
AlgorithmStrategyType
.
Sixteen
,
new
AlgorithmController_Sixteen
(
this
));
this
.
AlgorithmControllerDic
.
Add
(
AlgorithmStrategyType
.
Tactics
,
new
AlgorithmController_Tactics
(
this
));
this
.
AlgorithmControllerDic
.
Add
(
AlgorithmStrategyType
.
Cableway
,
new
AlgorithmController_Cableway
(
this
));
this
.
ManualController
=
new
ManualController
(
this
);
}
/// <summary>
...
...
VIZ.H2V.Module/VIZ.H2V.Module.csproj
View file @
24af89f7
...
...
@@ -207,6 +207,9 @@
<Compile Include="NDIView\Controller\Algorithm\Strategy\AlgorithmController_Sixteen.cs" />
<Compile Include="NDIView\Controller\Algorithm\Strategy\AlgorithmController_Near.cs" />
<Compile Include="NDIView\Controller\Algorithm\Strategy\AlgorithmController_Single.cs" />
<Compile Include="NDIView\Controller\Manual\IManualController.cs" />
<Compile Include="NDIView\Controller\Manual\IManualSupport.cs" />
<Compile Include="NDIView\Controller\Manual\ManualController.cs" />
<Compile Include="NDIView\Enum\NDIViewScene.cs" />
<Compile Include="NDIView\Info\ChangeStrategyContext.cs" />
<Compile Include="NDIView\Info\ClearVideoControlContext.cs" />
...
...
VIZ.H2V.sln
View file @
24af89f7
This diff is collapsed.
Click to expand it.
VIZ.H2V/App.xaml.cs
View file @
24af89f7
...
...
@@ -31,9 +31,13 @@ namespace VIZ.H2V
// 初始化UDP
AppSetup
.
AppendSetup
(
new
AppSetup_InitUDP
());
// 初始化3D鼠标
AppSetup
.
AppendSetup
(
new
AppSetup_Navigation3D_TCP
());
//AppSetup.AppendSetup(new AppSetup_Navigation3D_TCP());
// 初始化系统监控
AppSetup
.
AppendLoad
(
new
AppSetup_Monitor
());
// 初始化3D鼠标
AppSetup
.
AppendLoad
(
new
AppSetup_Navigation3D
());
// 执行启动流程
AppSetupContext
context
=
AppSetup
.
Setup
();
...
...
VIZ.H2V/MainWindow.xaml.cs
View file @
24af89f7
...
...
@@ -33,7 +33,7 @@ namespace VIZ.H2V
private
void
MainWindow_Loaded
(
object
sender
,
RoutedEventArgs
e
)
{
// 執行加载流程
AppSetupContext
context
=
AppSetup
.
Load
();
AppSetupContext
context
=
AppSetup
.
Load
(
this
);
if
(
context
.
Exception
!=
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