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
4c6a6318
Commit
4c6a6318
authored
Aug 29, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3D鼠标添加平滑函数
parent
068d8380
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
216 additions
and
63 deletions
+216
-63
VIZ.H2V.ClipTestTool/ViewModel/MainViewModel.cs
+2
-1
VIZ.H2V.Connection/UDP/Algorithm/Provider/AlgorithmProvider__crop_roi..cs
+15
-0
VIZ.H2V.Connection/UDP/Algorithm/Signal/Recv/AlgorithmRecvPackage__crop_roi.cs
+5
-0
VIZ.H2V.Domain/Message/Algorithm/AlgorithmMessage__crop_roi.cs
+5
-0
VIZ.H2V.Module/NDIView/Controller/Algorithm/AlgorithmControllerBase.cs
+3
-0
VIZ.H2V.Module/NDIView/Controller/Algorithm/IAlgorithmSupport.cs
+5
-0
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Cableway.cs
+3
-0
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Near.cs
+3
-0
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Sixteen.cs
+3
-0
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Tactics.cs
+3
-0
VIZ.H2V.Module/NDIView/Service/INDIViewService.cs
+6
-0
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Manual_NDI.cs
+46
-29
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Message.cs
+10
-0
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
+19
-0
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.cs
+27
-2
VIZ.H2V.Module/SystemSetting/View/StyleSettingPanelView.xaml
+21
-6
VIZ.H2V.Module/SystemSetting/ViewModel/StyleSettingPanelViewModel.cs
+14
-10
VIZ.H2V.Storage/LiteDB/System/SystemConfig.cs
+2
-2
VIZ.H2V/config/navigation_3d_mapping.csv
+24
-13
No files found.
VIZ.H2V.ClipTestTool/ViewModel/MainViewModel.cs
View file @
4c6a6318
...
@@ -281,7 +281,8 @@ namespace VIZ.H2V.ClipTestTool
...
@@ -281,7 +281,8 @@ namespace VIZ.H2V.ClipTestTool
view
.
video
.
UpdateClipBox
(
info
);
view
.
video
.
UpdateClipBox
(
info
);
#if DEBUG
#if DEBUG
Debug
.
WriteLine
(
$"
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss.fffffff"
)}
MappingValue
{
Navigation3DTcpManager
.
MappingValue
}
"
);
//Debug.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} MappingValue {Navigation3DTcpManager.MappingValue}");
//log.Debug($"【渲染视频帧】 时间: {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} 帧时间戳:{e.Frame.TimeStamp}");
#endif
#endif
UdpEndpointManager
manager
=
conn
.
GetEndpointManager
(
"UDP"
);
UdpEndpointManager
manager
=
conn
.
GetEndpointManager
(
"UDP"
);
...
...
VIZ.H2V.Connection/UDP/Algorithm/Provider/AlgorithmProvider__crop_roi..cs
View file @
4c6a6318
...
@@ -8,6 +8,7 @@ using VIZ.Framework.Core;
...
@@ -8,6 +8,7 @@ using VIZ.Framework.Core;
using
VIZ.Framework.Connection
;
using
VIZ.Framework.Connection
;
using
VIZ.H2V.Domain
;
using
VIZ.H2V.Domain
;
using
SharpDX.Mathematics.Interop
;
using
SharpDX.Mathematics.Interop
;
using
log4net
;
namespace
VIZ.H2V.Connection
namespace
VIZ.H2V.Connection
{
{
...
@@ -17,6 +18,11 @@ namespace VIZ.H2V.Connection
...
@@ -17,6 +18,11 @@ namespace VIZ.H2V.Connection
public
class
AlgorithmProvider__crop_roi
:
IAlgorithmPackageProvider
public
class
AlgorithmProvider__crop_roi
:
IAlgorithmPackageProvider
{
{
/// <summary>
/// <summary>
/// 日志
/// </summary>
private
static
readonly
ILog
log
=
LogManager
.
GetLogger
(
typeof
(
AlgorithmProvider__crop_roi
));
/// <summary>
/// 信号
/// 信号
/// <see cref="AlgorithmPackageSignal"/>
/// <see cref="AlgorithmPackageSignal"/>
/// </summary>
/// </summary>
...
@@ -32,6 +38,7 @@ namespace VIZ.H2V.Connection
...
@@ -32,6 +38,7 @@ namespace VIZ.H2V.Connection
AlgorithmMessage__crop_roi
message
=
new
AlgorithmMessage__crop_roi
();
AlgorithmMessage__crop_roi
message
=
new
AlgorithmMessage__crop_roi
();
message
.
AlgorithmID
=
package
.
id
;
message
.
AlgorithmID
=
package
.
id
;
message
.
timecode
=
package
.
timecode
;
if
(
package
.
roi
!=
null
&&
package
.
roi
.
Count
==
4
)
if
(
package
.
roi
!=
null
&&
package
.
roi
.
Count
==
4
)
{
{
message
.
roi
=
new
RawRectangleF
(
package
.
roi
[
0
],
package
.
roi
[
1
],
package
.
roi
[
2
],
package
.
roi
[
3
]);
message
.
roi
=
new
RawRectangleF
(
package
.
roi
[
0
],
package
.
roi
[
1
],
package
.
roi
[
2
],
package
.
roi
[
3
]);
...
@@ -42,6 +49,14 @@ namespace VIZ.H2V.Connection
...
@@ -42,6 +49,14 @@ namespace VIZ.H2V.Connection
}
}
message
.
borderline
=
package
.
borderline
;
message
.
borderline
=
package
.
borderline
;
//#if DEBUG
// if (package.id.Contains(NDIViewKeys.CAM_1))
// {
// log.Debug($"【获取裁切框】 时间: {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} 帧时间戳:{package.timecode} ------------");
// }
// //Debug.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} MappingValue {Navigation3DTcpManager.MappingValue}");
//#endif
ApplicationDomainEx
.
MessageManager
.
Send
(
message
);
ApplicationDomainEx
.
MessageManager
.
Send
(
message
);
}
}
}
}
...
...
VIZ.H2V.Connection/UDP/Algorithm/Signal/Recv/AlgorithmRecvPackage__crop_roi.cs
View file @
4c6a6318
...
@@ -32,5 +32,10 @@ namespace VIZ.H2V.Connection
...
@@ -32,5 +32,10 @@ namespace VIZ.H2V.Connection
/// 边线信息
/// 边线信息
/// </summary>
/// </summary>
public
AlgorithmInfo_borderline
borderline
{
get
;
set
;
}
public
AlgorithmInfo_borderline
borderline
{
get
;
set
;
}
/// <summary>
/// 时间码
/// </summary>
public
long
timecode
{
get
;
set
;
}
}
}
}
}
VIZ.H2V.Domain/Message/Algorithm/AlgorithmMessage__crop_roi.cs
View file @
4c6a6318
...
@@ -27,5 +27,10 @@ namespace VIZ.H2V.Domain
...
@@ -27,5 +27,10 @@ namespace VIZ.H2V.Domain
/// 边线信息
/// 边线信息
/// </summary>
/// </summary>
public
AlgorithmInfo_borderline
borderline
{
get
;
set
;
}
public
AlgorithmInfo_borderline
borderline
{
get
;
set
;
}
/// <summary>
/// 时间码
/// </summary>
public
long
timecode
{
get
;
set
;
}
}
}
}
}
VIZ.H2V.Module/NDIView/Controller/Algorithm/AlgorithmControllerBase.cs
View file @
4c6a6318
...
@@ -140,6 +140,9 @@ namespace VIZ.H2V.Module
...
@@ -140,6 +140,9 @@ namespace VIZ.H2V.Module
// TODO: 平滑系数读取
// TODO: 平滑系数读取
AlgorithmSender
.
CenterMode
(
manager
,
this
.
Support
.
ID
,
this
.
Support
.
ViewConfig
.
IsSendToCrop
,
this
.
Support
.
AlgorithmConfig
.
SmoothCoeff
);
AlgorithmSender
.
CenterMode
(
manager
,
this
.
Support
.
ID
,
this
.
Support
.
ViewConfig
.
IsSendToCrop
,
this
.
Support
.
AlgorithmConfig
.
SmoothCoeff
);
// 更新裁切框样式
this
.
Support
.
UpdateClipBoxToAutoOrCenterStyle
();
}
}
/// <summary>
/// <summary>
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/IAlgorithmSupport.cs
View file @
4c6a6318
...
@@ -90,5 +90,10 @@ namespace VIZ.H2V.Module
...
@@ -90,5 +90,10 @@ namespace VIZ.H2V.Module
/// </summary>
/// </summary>
/// <param name="context">清理视频控件上下文</param>
/// <param name="context">清理视频控件上下文</param>
void
ClearVideoControl
(
ClearVideoControlContext
context
);
void
ClearVideoControl
(
ClearVideoControlContext
context
);
/// <summary>
/// 更新裁切框样式至自动或居中模式的样式
/// </summary>
void
UpdateClipBoxToAutoOrCenterStyle
();
}
}
}
}
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Cableway.cs
View file @
4c6a6318
...
@@ -49,6 +49,9 @@ namespace VIZ.H2V.Module
...
@@ -49,6 +49,9 @@ namespace VIZ.H2V.Module
public
override
void
ChangeAutoMode
(
ChangeStrategyContext
context
)
public
override
void
ChangeAutoMode
(
ChangeStrategyContext
context
)
{
{
this
.
SetParams
();
this
.
SetParams
();
// 更新裁切框样式
this
.
Support
.
UpdateClipBoxToAutoOrCenterStyle
();
}
}
/// <summary>
/// <summary>
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Near.cs
View file @
4c6a6318
...
@@ -50,6 +50,9 @@ namespace VIZ.H2V.Module
...
@@ -50,6 +50,9 @@ namespace VIZ.H2V.Module
public
override
void
ChangeAutoMode
(
ChangeStrategyContext
context
)
public
override
void
ChangeAutoMode
(
ChangeStrategyContext
context
)
{
{
this
.
SetParams
();
this
.
SetParams
();
// 更新裁切框样式
this
.
Support
.
UpdateClipBoxToAutoOrCenterStyle
();
}
}
/// <summary>
/// <summary>
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Sixteen.cs
View file @
4c6a6318
...
@@ -50,6 +50,9 @@ namespace VIZ.H2V.Module
...
@@ -50,6 +50,9 @@ namespace VIZ.H2V.Module
public
override
void
ChangeAutoMode
(
ChangeStrategyContext
context
)
public
override
void
ChangeAutoMode
(
ChangeStrategyContext
context
)
{
{
this
.
SetParams
();
this
.
SetParams
();
// 更新裁切框样式
this
.
Support
.
UpdateClipBoxToAutoOrCenterStyle
();
}
}
/// <summary>
/// <summary>
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/Strategy/AlgorithmController_Tactics.cs
View file @
4c6a6318
...
@@ -50,6 +50,9 @@ namespace VIZ.H2V.Module
...
@@ -50,6 +50,9 @@ namespace VIZ.H2V.Module
public
override
void
ChangeAutoMode
(
ChangeStrategyContext
context
)
public
override
void
ChangeAutoMode
(
ChangeStrategyContext
context
)
{
{
this
.
SetParams
();
this
.
SetParams
();
// 更新裁切框样式
this
.
Support
.
UpdateClipBoxToAutoOrCenterStyle
();
}
}
/// <summary>
/// <summary>
...
...
VIZ.H2V.Module/NDIView/Service/INDIViewService.cs
View file @
4c6a6318
...
@@ -60,6 +60,12 @@ namespace VIZ.H2V.Module
...
@@ -60,6 +60,12 @@ namespace VIZ.H2V.Module
void
LoadStyle
();
void
LoadStyle
();
/// <summary>
/// <summary>
/// 更新裁切框平滑系数
/// </summary>
/// <param name="minCutoff">平滑系数</param>
void
LoadClipBoxSmooth
(
double
minCutoff
);
/// <summary>
/// 停止算法
/// 停止算法
/// </summary>
/// </summary>
void
StopAlgorithm
();
void
StopAlgorithm
();
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Manual_NDI.cs
View file @
4c6a6318
...
@@ -27,16 +27,20 @@ namespace VIZ.H2V.Module
...
@@ -27,16 +27,20 @@ namespace VIZ.H2V.Module
/// </summary>
/// </summary>
public
void
Reset3DMouse
()
public
void
Reset3DMouse
()
{
{
//
NDIView view = this.GetView<NDIView>();
NDIView
view
=
this
.
GetView
<
NDIView
>();
//
if (view == null)
if
(
view
==
null
)
//
return;
return
;
//VideoRenderInfo renderInfo = view.video.GetRenderInfo();
VideoRenderInfo
renderInfo
=
view
.
video
.
GetRenderInfo
();
//if (renderInfo == null)
if
(
renderInfo
==
null
)
//{
{
// view.video.ClearClipBox();
view
.
video
.
ClearClipBox
();
// return;
return
;
//}
}
this
.
ClipBoxX
=
this
.
GetClipX
(
renderInfo
);
this
.
ClipBoxTargetX
=
this
.
ClipBoxX
.
Value
;
this
.
ClipBoxSmooth
.
Init
(
this
.
ClipBoxTargetX
,
this
.
ClipBoxTargetX
,
this
.
ClipBoxSmooth
.
MinCutoff
);
//if (this.ClipBoxX == null)
//if (this.ClipBoxX == null)
//{
//{
...
@@ -58,6 +62,11 @@ namespace VIZ.H2V.Module
...
@@ -58,6 +62,11 @@ namespace VIZ.H2V.Module
/// </summary>
/// </summary>
private
void
InitManual
()
private
void
InitManual
()
{
{
SystemConfig
config
=
ApplicationDomainEx
.
LiteDbContext
.
SystemConfig
.
FindAll
().
FirstOrDefault
();
this
.
ClipBoxSmooth
=
new
Navigation3DSmooth
();
this
.
ClipBoxSmooth
.
Init
(
0
,
0
,
config
.
ManualSmoothCoeff
);
// 是否启用平滑
// 是否启用平滑
//SystemConfig config = ApplicationDomainEx.LiteDbContext.SystemConfig.FindAll().FirstOrDefault();
//SystemConfig config = ApplicationDomainEx.LiteDbContext.SystemConfig.FindAll().FirstOrDefault();
//Navigation3DManager.Navigation3DModel.IsUseSmooth = config.IsManualUseSmooth;
//Navigation3DManager.Navigation3DModel.IsUseSmooth = config.IsManualUseSmooth;
...
@@ -106,26 +115,10 @@ namespace VIZ.H2V.Module
...
@@ -106,26 +115,10 @@ namespace VIZ.H2V.Module
return
;
return
;
}
}
//double p = (renderInfo.Frame.Width - this.CLIP_BOX_WIDTH) / (2 * Navigation3DManager.Navigation3DModel.MaxX);
double
x
=
this
.
ClipBoxTargetX
+
Navigation3DTcpManager
.
MappingValue
;
x
=
MathHelper
.
Clip
(
0d
,
renderInfo
.
Frame
.
Width
-
this
.
CLIP_BOX_WIDTH
,
x
);
////////////////////////////////////////////////////////////////////////
this
.
ClipBoxTargetX
=
x
;
// DEBUG
this
.
ClipBoxX
=
this
.
ClipBoxSmooth
.
Call
(
this
.
ClipBoxTargetX
,
1
);
//double test_1 = this.clipBoxX ?? 0;
////////////////////////////////////////////////////////////////////////
//double diff = Navigation3DManager.UpdateRenderTime();
//Navigation3DManager.Navigation3DModel.UpdateSmooth(diff / 5d);
//if (this.ClipBoxX == null)
//{
// this.ClipBoxX = renderInfo.Frame.Width / 2d - this.CLIP_BOX_WIDTH / 2d;
//}
//this.ClipBoxX = ((Navigation3DManager.Navigation3DModel.SmoothCamera.Position.X + Navigation3DManager.Navigation3DModel.MaxX) * p);
int
x
=
(
int
)(
this
.
ClipBoxX
+
Navigation3DTcpManager
.
MappingValue
);
x
=
x
<=
0
?
0
:
x
;
x
=
x
>=
(
renderInfo
.
Frame
.
Width
-
this
.
CLIP_BOX_WIDTH
)
?
(
int
)(
renderInfo
.
Frame
.
Width
-
this
.
CLIP_BOX_WIDTH
)
:
x
;
this
.
ClipBoxX
=
x
;
ClipBoxInfo
clipBox
=
new
ClipBoxInfo
();
ClipBoxInfo
clipBox
=
new
ClipBoxInfo
();
clipBox
.
DrawingBorderWidth
=
this
.
CLIP_BOX_BORDER_WIDTH
;
clipBox
.
DrawingBorderWidth
=
this
.
CLIP_BOX_BORDER_WIDTH
;
...
@@ -148,6 +141,14 @@ namespace VIZ.H2V.Module
...
@@ -148,6 +141,14 @@ namespace VIZ.H2V.Module
// 更新画面
// 更新画面
view
.
video
.
UpdateVideoFrame
(
e
.
Frame
);
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鼠标准备完毕 时才处理
// 仅手动模式下处理 & 需要进行裁切 & 3D鼠标准备完毕 时才处理
//if (this.StrategyMode == AlgorithmStrategyMode.manual_mode && this.IsUseClip && Navigation3DManager.Navigation3DModel.IsReady)
//if (this.StrategyMode == AlgorithmStrategyMode.manual_mode && this.IsUseClip && Navigation3DManager.Navigation3DModel.IsReady)
...
@@ -180,5 +181,21 @@ namespace VIZ.H2V.Module
...
@@ -180,5 +181,21 @@ namespace VIZ.H2V.Module
// 统计裁切FPS
// 统计裁切FPS
this
.
ClipFPS
.
CalcFps
();
this
.
ClipFPS
.
CalcFps
();
}
}
/// <summary>
/// 获取默认的裁切坐标
/// </summary>
/// <param name="renderInfo">渲染信息</param>
/// <returns>默认裁切坐标</returns>
private
double
GetClipX
(
VideoRenderInfo
renderInfo
)
{
if
(
this
.
ClipBoxX
!=
null
)
return
this
.
ClipBoxX
.
Value
;
if
(
renderInfo
==
null
||
renderInfo
.
Frame
==
null
)
return
0d
;
return
(
renderInfo
.
Frame
.
Width
-
this
.
CLIP_BOX_WIDTH
)
/
2d
;
}
}
}
}
}
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Message.cs
View file @
4c6a6318
...
@@ -160,6 +160,14 @@ namespace VIZ.H2V.Module
...
@@ -160,6 +160,14 @@ namespace VIZ.H2V.Module
// 更新算法帧率统计
// 更新算法帧率统计
this
.
AlgorithmFPS
.
CalcFps
();
this
.
AlgorithmFPS
.
CalcFps
();
//#if DEBUG
// if (this.ViewKey == NDIViewKeys.CAM_1)
// {
// log.Debug($"【渲染裁切框】 时间: {DateTime.Now.ToString("yyyy*MM*dd HH:mm:ss.fffffff")} 帧时间戳:{msg.timecode} ************");
// }
// //Debug.WriteLine($"{DateTime.Now.ToString("yyyy*MM*dd HH:mm:ss.fffffff")} MappingValue {Navigation3DTcpManager.MappingValue}");
//#endif
}
}
/// <summary>
/// <summary>
...
@@ -187,6 +195,7 @@ namespace VIZ.H2V.Module
...
@@ -187,6 +195,7 @@ namespace VIZ.H2V.Module
ClipBoxInfo
info
=
new
ClipBoxInfo
();
ClipBoxInfo
info
=
new
ClipBoxInfo
();
info
.
SrcRect
=
rect
;
info
.
SrcRect
=
rect
;
info
.
TimeCode
=
msg
.
timecode
;
info
.
DrawingBorderWidth
=
(
float
)
this
.
CLIP_BOX_BORDER_WIDTH
;
info
.
DrawingBorderWidth
=
(
float
)
this
.
CLIP_BOX_BORDER_WIDTH
;
info
.
DrawingBorderColor
=
this
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
?
this
.
ClipBoxStrokeColor_Manual
:
this
.
ClipBoxStrokeColor_Normal
;
info
.
DrawingBorderColor
=
this
.
StrategyMode
==
AlgorithmStrategyMode
.
manual_mode
?
this
.
ClipBoxStrokeColor_Manual
:
this
.
ClipBoxStrokeColor_Normal
;
info
.
MaskColor
=
this
.
CLIP_BOX_MASK_COLOR
;
info
.
MaskColor
=
this
.
CLIP_BOX_MASK_COLOR
;
...
@@ -197,6 +206,7 @@ namespace VIZ.H2V.Module
...
@@ -197,6 +206,7 @@ namespace VIZ.H2V.Module
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
this
.
ClipBoxX
=
rect
.
Left
;
this
.
ClipBoxX
=
rect
.
Left
;
this
.
ClipBoxTargetX
=
rect
.
Left
;
view
.
video
.
UpdateClipBox
(
info
);
view
.
video
.
UpdateClipBox
(
info
);
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
View file @
4c6a6318
...
@@ -84,6 +84,11 @@ namespace VIZ.H2V.Module
...
@@ -84,6 +84,11 @@ namespace VIZ.H2V.Module
/// </summary>
/// </summary>
private
RawColor4
BorderSceneColor
;
private
RawColor4
BorderSceneColor
;
/// <summary>
/// 裁切框平滑
/// </summary>
private
Navigation3DSmooth
ClipBoxSmooth
;
// ======================================================================================
// ======================================================================================
// === Controller ===
// === Controller ===
// ======================================================================================
// ======================================================================================
...
@@ -262,6 +267,20 @@ namespace VIZ.H2V.Module
...
@@ -262,6 +267,20 @@ namespace VIZ.H2V.Module
#
endregion
#
endregion
#
region
ClipBoxTargetX
--
裁切框目标
X
坐标
private
double
clipBoxTargetX
;
/// <summary>
/// 裁切框目标X坐标
/// </summary>
public
double
ClipBoxTargetX
{
get
{
return
clipBoxTargetX
;
}
set
{
clipBoxTargetX
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ClipBoxTargetX
));
}
}
#
endregion
#
region
FootballFiledPanelModel
--
足球场视图模型
#
region
FootballFiledPanelModel
--
足球场视图模型
private
FootballFieldPanelModel
footballFieldPanelModel
=
new
FootballFieldPanelModel
();
private
FootballFieldPanelModel
footballFieldPanelModel
=
new
FootballFieldPanelModel
();
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.cs
View file @
4c6a6318
...
@@ -122,7 +122,7 @@ namespace VIZ.H2V.Module
...
@@ -122,7 +122,7 @@ namespace VIZ.H2V.Module
this
.
WriteLogOperation
();
this
.
WriteLogOperation
();
// 停止3D鼠标更新
// 停止3D鼠标更新
//Navigation3DManager.Navigation3DModel.IsReady
= false;
this
.
ClipBoxSmooth
.
IsEnabled
=
false
;
// ----------------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------------
// Step 1. 更新属性 & 缓存
// Step 1. 更新属性 & 缓存
...
@@ -204,7 +204,7 @@ namespace VIZ.H2V.Module
...
@@ -204,7 +204,7 @@ namespace VIZ.H2V.Module
finally
finally
{
{
// 启动3D鼠标更新
// 启动3D鼠标更新
//Navigation3DManager.Navigation3DModel.IsReady
= true;
this
.
ClipBoxSmooth
.
IsEnabled
=
true
;
}
}
}
}
...
@@ -274,6 +274,31 @@ namespace VIZ.H2V.Module
...
@@ -274,6 +274,31 @@ namespace VIZ.H2V.Module
}
}
/// <summary>
/// <summary>
/// 更新裁切框平滑系数
/// </summary>
/// <param name="minCutoff">平滑系数</param>
public
void
LoadClipBoxSmooth
(
double
minCutoff
)
{
this
.
ClipBoxSmooth
.
MinCutoff
=
minCutoff
;
}
/// <summary>
/// 更新裁切框样式至自动或居中模式的样式
/// </summary>
public
void
UpdateClipBoxToAutoOrCenterStyle
()
{
NDIView
view
=
this
.
GetView
<
NDIView
>();
if
(
view
==
null
)
return
;
VideoRenderInfo
renderInfo
=
view
.
video
.
GetRenderInfo
();
if
(
renderInfo
==
null
)
return
;
view
.
video
.
UpdateClipBoxBorderColor
(
this
.
ClipBoxStrokeColor_Normal
);
}
/// <summary>
/// 停止算法
/// 停止算法
/// </summary>
/// </summary>
public
void
StopAlgorithm
()
public
void
StopAlgorithm
()
...
...
VIZ.H2V.Module/SystemSetting/View/StyleSettingPanelView.xaml
View file @
4c6a6318
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,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>
<!-- 剪切框颜色 -->
<!-- 剪切框颜色 -->
...
@@ -71,15 +72,29 @@
...
@@ -71,15 +72,29 @@
<TextBlock Text="边线检测区域颜色" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="2"></TextBlock>
<TextBlock Text="边线检测区域颜色" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="2"></TextBlock>
<fcommon:ColorPickButton Grid.Column="1" Color="{Binding Path=BorderSceneColor,Mode=TwoWay}" Height="30" Grid.Row="2"></fcommon:ColorPickButton>
<fcommon:ColorPickButton Grid.Column="1" Color="{Binding Path=BorderSceneColor,Mode=TwoWay}" Height="30" Grid.Row="2"></fcommon:ColorPickButton>
</Grid>
</Grid>
<!-- 是否使用平滑 -->
<!-- 裁切框移动 -->
<Grid Grid.Row="3">
<TextBlock Text="裁切框移动" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="3"></TextBlock>
<Grid Grid.Row="4">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="
30
0"></ColumnDefinition>
<ColumnDefinition Width="
8
0"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
</Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<TextBlock Text="手动裁切是否使用平滑" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="0"></TextBlock>
<TextBlock Text="非常平滑,移动速度慢" Foreground="#aaffffff" FontSize="14" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="18,0,0,0"></TextBlock>
<CheckBox Grid.Column="1" HorizontalAlignment="Right" Style="{StaticResource CheckBox_Setting}"
<TextBlock Text="一般平滑,移动速度快" Foreground="#aaffffff" FontSize="14" Grid.ColumnSpan="2" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,24,0"></TextBlock>
IsChecked="{Binding Path=IsManualUseSmooth,Mode=TwoWay}"></CheckBox>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="0.001" Foreground="White" FontSize="16" Grid.Row="1"></TextBlock>
<Slider Grid.Column="1" VerticalAlignment="Center" Margin="10,0,10,0" Style="{StaticResource Slider_Setting}" Grid.Row="1"
Minimum="0.001" Maximum="0.2" IsSnapToTickEnabled="True" TickFrequency="0.001"
Value="{Binding Path=ManualSmoothCoeff,Mode=TwoWay}"></Slider>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="0.2" Foreground="White" FontSize="16" Grid.Column="2" Grid.Row="1"></TextBlock>
<fcommon:NumberBox Grid.Column="3" Height="40" IsShowUpAndDownButton="False" Grid.Row="1"
MinValue="0.001" MaxValue="0.2" Interval="0.001"
Value="{Binding Path=ManualSmoothCoeff,Mode=TwoWay}"></fcommon:NumberBox>
</Grid>
</Grid>
</Grid>
</Grid>
</Border>
</Border>
...
...
VIZ.H2V.Module/SystemSetting/ViewModel/StyleSettingPanelViewModel.cs
View file @
4c6a6318
...
@@ -90,16 +90,16 @@ namespace VIZ.H2V.Module
...
@@ -90,16 +90,16 @@ namespace VIZ.H2V.Module
#
endregion
#
endregion
#
region
IsManualUseSmooth
--
手动裁切是否使用平滑
#
region
ManualSmoothCoeff
--
手动裁切平滑系数
private
bool
isManualUseSmooth
;
private
double
manualSmoothCoeff
;
/// <summary>
/// <summary>
/// 手动裁切
是否使用平滑
/// 手动裁切
平滑系数
/// </summary>
/// </summary>
public
bool
IsManualUseSmooth
public
double
ManualSmoothCoeff
{
{
get
{
return
isManualUseSmooth
;
}
get
{
return
manualSmoothCoeff
;
}
set
{
isManualUseSmooth
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsManualUseSmooth
));
}
set
{
manualSmoothCoeff
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ManualSmoothCoeff
));
}
}
}
#
endregion
#
endregion
...
@@ -130,7 +130,7 @@ namespace VIZ.H2V.Module
...
@@ -130,7 +130,7 @@ namespace VIZ.H2V.Module
this
.
ClipManualColor
=
(
Color
)
ColorConverter
.
ConvertFromString
(
this
.
SystemConfig
.
ClipManualColor
);
this
.
ClipManualColor
=
(
Color
)
ColorConverter
.
ConvertFromString
(
this
.
SystemConfig
.
ClipManualColor
);
this
.
BorderSceneColor
=
(
Color
)
ColorConverter
.
ConvertFromString
(
this
.
SystemConfig
.
BorderSceneColor
);
this
.
BorderSceneColor
=
(
Color
)
ColorConverter
.
ConvertFromString
(
this
.
SystemConfig
.
BorderSceneColor
);
this
.
IsManualUseSmooth
=
this
.
SystemConfig
.
IsManualUseSmooth
;
this
.
ManualSmoothCoeff
=
this
.
SystemConfig
.
ManualSmoothCoeff
;
}
}
#
endregion
#
endregion
...
@@ -157,7 +157,7 @@ namespace VIZ.H2V.Module
...
@@ -157,7 +157,7 @@ namespace VIZ.H2V.Module
if
(
this
.
BorderSceneColor
.
ToString
()
!=
this
.
SystemConfig
.
BorderSceneColor
)
if
(
this
.
BorderSceneColor
.
ToString
()
!=
this
.
SystemConfig
.
BorderSceneColor
)
return
true
;
return
true
;
if
(
this
.
IsManualUseSmooth
!=
this
.
SystemConfig
.
IsManualUseSmooth
)
if
(
this
.
ManualSmoothCoeff
!=
this
.
SystemConfig
.
ManualSmoothCoeff
)
return
true
;
return
true
;
return
false
;
return
false
;
...
@@ -174,12 +174,16 @@ namespace VIZ.H2V.Module
...
@@ -174,12 +174,16 @@ namespace VIZ.H2V.Module
this
.
SystemConfig
.
ClipExceptionColor
=
this
.
ClipExceptionColor
.
ToString
();
this
.
SystemConfig
.
ClipExceptionColor
=
this
.
ClipExceptionColor
.
ToString
();
this
.
SystemConfig
.
ClipManualColor
=
this
.
ClipManualColor
.
ToString
();
this
.
SystemConfig
.
ClipManualColor
=
this
.
ClipManualColor
.
ToString
();
this
.
SystemConfig
.
BorderSceneColor
=
this
.
BorderSceneColor
.
ToString
();
this
.
SystemConfig
.
BorderSceneColor
=
this
.
BorderSceneColor
.
ToString
();
this
.
SystemConfig
.
IsManualUseSmooth
=
this
.
IsManualUseSmooth
;
this
.
SystemConfig
.
ManualSmoothCoeff
=
this
.
ManualSmoothCoeff
;
ApplicationDomainEx
.
LiteDbContext
.
SystemConfig
.
Update
(
this
.
SystemConfig
);
ApplicationDomainEx
.
LiteDbContext
.
SystemConfig
.
Update
(
this
.
SystemConfig
);
// 应用
// 应用
ApplicationDomainEx
.
ServiceManager
.
GetServiceList
<
INDIViewService
>().
ForEach
(
p
=>
p
.
LoadStyle
());
ApplicationDomainEx
.
ServiceManager
.
GetServiceList
<
INDIViewService
>().
ForEach
(
p
=>
{
p
.
LoadStyle
();
p
.
LoadClipBoxSmooth
(
this
.
ManualSmoothCoeff
);
});
//Navigation3DManager.Navigation3DModel.IsUseSmooth = this.IsManualUseSmooth;
//Navigation3DManager.Navigation3DModel.IsUseSmooth = this.IsManualUseSmooth;
// 返回
// 返回
...
...
VIZ.H2V.Storage/LiteDB/System/SystemConfig.cs
View file @
4c6a6318
...
@@ -38,8 +38,8 @@ namespace VIZ.H2V.Storage
...
@@ -38,8 +38,8 @@ namespace VIZ.H2V.Storage
public
string
BorderSceneColor
{
get
;
set
;
}
=
"#FFFF000000"
;
public
string
BorderSceneColor
{
get
;
set
;
}
=
"#FFFF000000"
;
/// <summary>
/// <summary>
/// 手动裁切
是否使用平滑
/// 手动裁切
平滑系数
/// </summary>
/// </summary>
public
bool
IsManualUseSmooth
{
get
;
set
;
}
=
true
;
public
double
ManualSmoothCoeff
{
get
;
set
;
}
=
0.07
;
}
}
}
}
VIZ.H2V/config/navigation_3d_mapping.csv
View file @
4c6a6318
ID,MinValue,MaxValue,MappingValue
ID,MinValue,MaxValue,MappingValue
1,50,200,1
1,100,200,1
2,200,400,2
2,200,300,2
3,400,600,3
3,300,400,3
4,600,800,5
4,400,500,4
5,800,1000,7
5,500,600,5
6,1000,1200,10
6,600,700,6
7,1200,1400,13
7,700,800,7
8,1400,1600,17
8,800,900,8
9,1800,2000,21
9,900,1000,9
10,2000,2200,26
10,1000,1100,10
12,2200,2400,31
11,1100,1200,12
13,2400,9000,37
12,1200,1300,14
\ No newline at end of file
13,1300,1400,16
14,1400,1500,18
15,1500,1600,20
16,1600,1700,22
17,1700,1800,24
18,1800,1900,26
19,1900,2000,28
20,2000,2100,30
21,2100,2200,32
22,2200,2300,34
23,2300,2400,36
\ No newline at end of file
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