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
d5b75707
Commit
d5b75707
authored
Jan 09, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. NDI流IP获取逻辑调整
2. 单窗口全屏模式切换
parent
8c7fba49
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
122 additions
and
30 deletions
+122
-30
VIZ.H2V.Module.Resource/Icons/full_four_24x24.png
+0
-0
VIZ.H2V.Module.Resource/Icons/full_one_24x24.png
+0
-0
VIZ.H2V.Module.Resource/Style/CheckBox/CheckBox_WindowTop.xaml
+27
-0
VIZ.H2V.Module.Resource/VIZ.H2V.Module.Resource.csproj
+7
-0
VIZ.H2V.Module/NDIMainView/View/NDIMainView.xaml
+9
-4
VIZ.H2V.Module/NDIMainView/ViewModel/NDIMainViewModel.cs
+47
-0
VIZ.H2V.Module/NDISettingView/ViewModel/NDISettingPanelViewModel.cs
+0
-1
VIZ.H2V.Module/NDIView/Controller/Algorithm/AlgorithmControllerBase.cs
+21
-1
VIZ.H2V.Module/NDIView/View/NDIView.xaml
+1
-1
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Command.cs
+1
-1
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
+1
-0
VIZ.H2V.Storage/Init/Config/UdpConfig.cs
+1
-1
VIZ.H2V.Storage/LiteDB/NdiView/NdiViewConfig.cs
+0
-5
VIZ.H2V.Storage/LiteDB/System/SystemConfig.cs
+5
-0
VIZ.H2V.UdpTestTool/ViewModel/MainViewModel.cs
+2
-1
VIZ.H2V.sln
+0
-15
No files found.
VIZ.H2V.Module.Resource/Icons/full_four_24x24.png
0 → 100644
View file @
d5b75707
2.86 KB
VIZ.H2V.Module.Resource/Icons/full_one_24x24.png
0 → 100644
View file @
d5b75707
243 Bytes
VIZ.H2V.Module.Resource/Style/CheckBox/CheckBox_WindowTop.xaml
View file @
d5b75707
...
...
@@ -28,4 +28,30 @@
</Setter>
</Style>
<Style x:Key="CheckBox_One_Four" TargetType="CheckBox">
<Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
<Setter Property="Width" Value="50"></Setter>
<Setter Property="Height" Value="40"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<Grid x:Name="bd" SnapsToDevicePixels="True" Background="Transparent" >
<Image x:Name="img_hide" Width="24" Height="24" VerticalAlignment="Center" HorizontalAlignment="Center"
Source="/VIZ.H2V.Module.Resource;component/Icons/full_four_24x24.png" Visibility="Visible"></Image>
<Image x:Name="img_show" Width="24" Height="24" VerticalAlignment="Center" HorizontalAlignment="Center"
Source="/VIZ.H2V.Module.Resource;component/Icons/full_one_24x24.png" Visibility="Hidden"></Image>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="img_hide" Property="Visibility" Value="Hidden"></Setter>
<Setter TargetName="img_show" Property="Visibility" Value="Visible"></Setter>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bd" Property="Background" Value="#22ffffff"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
VIZ.H2V.Module.Resource/VIZ.H2V.Module.Resource.csproj
View file @
d5b75707
...
...
@@ -266,5 +266,11 @@
<ItemGroup>
<Resource Include="Icons\touch_32x32.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\full_one_24x24.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\full_four_24x24.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
VIZ.H2V.Module/NDIMainView/View/NDIMainView.xaml
View file @
d5b75707
...
...
@@ -45,6 +45,10 @@
<!-- 顶部 -->
<TextBox x:Name="tbFocus" Visibility="Collapsed"></TextBox>
<Grid Background="#ff12202d">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<CheckBox Height="30" Style="{StaticResource CheckBox_One_Four}" ToolTip="窗口模式"
IsChecked="{Binding Path=IsOneScreenMode,Mode=TwoWay}"></CheckBox>
</StackPanel>
<TextBlock Text="横转竖智能裁切系统" FontSize="12" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
<StackPanel Orientation="Horizontal" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top">
<CheckBox Height="30" Style="{StaticResource ResourceKey=CheckBox_Eye}"
...
...
@@ -73,10 +77,11 @@
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_1}" Grid.Row="0" Grid.Column="0" Margin="10,10,15,10"></local:NDIView>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_2}" Grid.Row="0" Grid.Column="1" Margin="15,10,10,10"></local:NDIView>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_3}" Grid.Row="1" Grid.Column="0" Margin="10,10,15,10"></local:NDIView>
<local:NDIView NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_4}" Grid.Row="1" Grid.Column="1" Margin="15,10,10,10"></local:NDIView>
<local:NDIView x:Name="cam2" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_2}" Grid.Row="0" Grid.Column="1" Margin="15,10,10,10"></local:NDIView>
<local:NDIView x:Name="cam3" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_3}" Grid.Row="1" Grid.Column="0" Margin="10,10,15,10"></local:NDIView>
<local:NDIView x:Name="cam4" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_4}" Grid.Row="1" Grid.Column="1" Margin="15,10,10,10"></local:NDIView>
<!-- CAM_1 会作为单一窗口时的主窗口 -->
<local:NDIView x:Name="cam1" NDIKey="{x:Static Member=domain:NDIViewKeys.CAM_1}" Grid.Row="0" Grid.Column="0" Margin="10,10,15,10"></local:NDIView>
</Grid>
<!-- 底部 -->
<Border Grid.Row="2" Background="#ff12202d">
...
...
VIZ.H2V.Module/NDIMainView/ViewModel/NDIMainViewModel.cs
View file @
d5b75707
...
...
@@ -15,6 +15,7 @@ using Gma.System.MouseKeyHook;
using
System.Windows.Interop
;
using
log4net
;
using
System.Threading
;
using
System.Windows.Controls
;
namespace
VIZ.H2V.Module
{
...
...
@@ -241,6 +242,50 @@ namespace VIZ.H2V.Module
#
endregion
#
region
IsOneScreenMode
--
是否是单窗口模式
private
bool
isOneScreenMode
;
/// <summary>
/// 是否是单窗口模式
/// </summary>
public
bool
IsOneScreenMode
{
get
{
return
isOneScreenMode
;
}
set
{
isOneScreenMode
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsOneScreenMode
));
this
.
ChangeScreenMode
();
}
}
/// <summary>
/// 切换视图模式
/// </summary>
private
void
ChangeScreenMode
()
{
NDIMainView
view
=
this
.
GetView
<
NDIMainView
>();
if
(
view
==
null
)
return
;
if
(
this
.
IsOneScreenMode
)
{
view
.
cam1
.
SetValue
(
Grid
.
RowSpanProperty
,
2
);
view
.
cam1
.
SetValue
(
Grid
.
ColumnSpanProperty
,
2
);
}
else
{
view
.
cam1
.
SetValue
(
Grid
.
RowSpanProperty
,
1
);
view
.
cam1
.
SetValue
(
Grid
.
ColumnSpanProperty
,
1
);
}
SystemConfig
config
=
ApplicationDomainEx
.
LiteDbContext
.
SystemConfig
.
FindAll
().
FirstOrDefault
();
config
.
IsOneScreenMode
=
this
.
IsOneScreenMode
;
ApplicationDomainEx
.
LiteDbContext
.
SystemConfig
.
Update
(
config
);
}
#
endregion
// ======================================================================================
// === Command ===
// ======================================================================================
...
...
@@ -552,6 +597,8 @@ namespace VIZ.H2V.Module
this
.
isShowAlgorithmTargetBox
=
config
.
IsShowAlgorithmTargetBox
;
this
.
RaisePropertyChanged
(
nameof
(
IsShowAlgorithmTargetBox
));
this
.
IsOneScreenMode
=
config
.
IsOneScreenMode
;
}
}
}
VIZ.H2V.Module/NDISettingView/ViewModel/NDISettingPanelViewModel.cs
View file @
d5b75707
...
...
@@ -341,7 +341,6 @@ namespace VIZ.H2V.Module
int
delay
=
this
.
SelectedNDIDelayInfo
==
null
?
0
:
this
.
SelectedNDIDelayInfo
.
Value
;
// 保存配置
this
.
ViewConfig
.
StreamAddress
=
streamAddress
;
this
.
ViewConfig
.
DisplayName
=
this
.
NdiDispalyName
;
this
.
ViewConfig
.
StreamName
=
streamName
;
this
.
ViewConfig
.
DelayFrame
=
delay
;
...
...
VIZ.H2V.Module/NDIView/Controller/Algorithm/AlgorithmControllerBase.cs
View file @
d5b75707
...
...
@@ -444,7 +444,27 @@ namespace VIZ.H2V.Module
{
clientIP
=
NetHelper
.
GetLocalFirstIPv4Address
();
}
string
streamIP
=
(
this
.
Support
.
ViewConfig
.
StreamAddress
??
string
.
Empty
).
Split
(
':'
).
FirstOrDefault
()?.
Trim
();
// 从配置文件中获取流的目标
string
streamIP
=
null
;
NDIStream
ndiStream
=
VideoStreamManager
.
Get
<
NDIStream
>(
this
.
Support
.
ViewKey
);
// 尝试5次从流信息中获取流的IP
int
count
=
0
;
while
(
count
<
5
&&
!
string
.
IsNullOrWhiteSpace
(
this
.
Support
.
ViewConfig
.
StreamName
))
{
NDIStreamInfo
streamInfo
=
ndiStream
.
StreamInfos
.
FirstOrDefault
(
p
=>
p
.
FullName
==
this
.
Support
.
ViewConfig
.
StreamName
);
if
(
streamInfo
==
null
)
{
System
.
Threading
.
Thread
.
Sleep
(
1000
);
++
count
;
continue
;
}
streamIP
=
(
streamInfo
.
Address
??
string
.
Empty
).
Split
(
':'
).
FirstOrDefault
()?.
Trim
();
break
;
}
AlgorithmStrategy
strategy
=
ApplicationDomainEx
.
CsvContext
.
AlgorithmStrategys
.
FirstOrDefault
(
p
=>
p
.
Type
==
this
.
Support
.
ViewConfig
.
StrategyType
);
if
(
strategy
==
null
)
...
...
VIZ.H2V.Module/NDIView/View/NDIView.xaml
View file @
d5b75707
...
...
@@ -12,7 +12,7 @@
xmlns:storage="clr-namespace:VIZ.H2V.Storage;assembly=VIZ.H2V.Storage"
xmlns:resource="clr-namespace:VIZ.H2V.Module.Resource;assembly=VIZ.H2V.Module.Resource"
d:DataContext="{d:DesignInstance Type=local:NDIViewModel}"
x:Name="uc"
x:Name="uc"
Background="#ff172532"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1000">
<UserControl.Resources>
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Command.cs
View file @
d5b75707
...
...
@@ -147,7 +147,7 @@ namespace VIZ.H2V.Module
/// </summary>
private
void
Loaded_InitModeChecked
()
{
//
跟下
模式属性
//
更新
模式属性
this
.
UpdateModeProperty
();
// 重启算法
...
...
VIZ.H2V.Module/NDIView/VieweModel/NDIViewModel.Property.cs
View file @
d5b75707
...
...
@@ -11,6 +11,7 @@ using VIZ.Framework.Storage;
using
VIZ.H2V.Domain
;
using
VIZ.H2V.Storage
;
using
VIZ.H2V.Common
;
using
TDx.SpaceMouse.Navigation3D
;
namespace
VIZ.H2V.Module
{
...
...
VIZ.H2V.Storage/Init/Config/UdpConfig.cs
View file @
d5b75707
...
...
@@ -17,7 +17,7 @@ namespace VIZ.H2V.Storage
/// <summary>
/// UDP本机绑定IP
/// </summary>
[
Ini
(
Section
=
"UDP"
,
DefaultValue
=
"
127.0.0.1
"
,
Type
=
typeof
(
string
))]
[
Ini
(
Section
=
"UDP"
,
DefaultValue
=
""
,
Type
=
typeof
(
string
))]
public
string
UDP_BINDING_IP
{
get
;
set
;
}
/// <summary>
...
...
VIZ.H2V.Storage/LiteDB/NdiView/NdiViewConfig.cs
View file @
d5b75707
...
...
@@ -29,11 +29,6 @@ namespace VIZ.H2V.Storage
public
string
DisplayName
{
get
;
set
;
}
/// <summary>
/// NDI流地址
/// </summary>
public
string
StreamAddress
{
get
;
set
;
}
/// <summary>
/// NDI流名称
/// </summary>
public
string
StreamName
{
get
;
set
;
}
...
...
VIZ.H2V.Storage/LiteDB/System/SystemConfig.cs
View file @
d5b75707
...
...
@@ -81,6 +81,11 @@ namespace VIZ.H2V.Storage
public
bool
IsShowAlgorithmTargetBox
{
get
;
set
;
}
=
true
;
/// <summary>
/// 是否是单视图模式
/// </summary>
public
bool
IsOneScreenMode
{
get
;
set
;
}
=
false
;
/// <summary>
/// Tally信息 -- 窗口1
/// </summary>
public
TallyInfo
TallyInfo1
{
get
;
set
;
}
=
new
TallyInfo
();
...
...
VIZ.H2V.UdpTestTool/ViewModel/MainViewModel.cs
View file @
d5b75707
...
...
@@ -43,7 +43,8 @@ namespace VIZ.H2V.UdpTestTool
UdpConnection
conn
=
new
UdpConnection
();
conn
.
PackageProvider
=
new
ConnSingleJsonPackageProvider
();
string
clientIP
=
ApplicationDomain
.
IniStorage
.
GetValue
<
UdpConfig
,
string
>(
p
=>
p
.
UDP_BINDING_IP
);
//string clientIP = ApplicationDomain.IniStorage.GetValue<UdpConfig, string>(p => p.UDP_BINDING_IP);
string
clientIP
=
NetHelper
.
GetLocalFirstIPv4Address
();
int
clientPort
=
ApplicationDomain
.
IniStorage
.
GetValue
<
UdpConfig
,
int
>(
p
=>
p
.
UDP_BINDING_PORT
);
log
.
Info
(
$"
{
DateTime
.
Now
}
-- ip:
{
clientIP
}
, port:
{
UdpTestApplicationDomain
.
Port
}
"
);
...
...
VIZ.H2V.sln
View file @
d5b75707
...
...
@@ -63,8 +63,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.H2V.Common", "VIZ.H2V.C
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.Framework.MacTool", "..\VIZ.Framework\VIZ.Framework.MacTool\VIZ.Framework.MacTool.csproj", "{6B864E7B-164B-4B1E-B7D6-1563D824F567}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.H2V.ClipTestTool", "VIZ.H2V.ClipTestTool\VIZ.H2V.ClipTestTool.csproj", "{16CDC661-A7D8-49DA-A269-0F9F4E798977}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VIZ.Framework.Core.Navigation3D", "..\VIZ.Framework\VIZ.Framework.Core.Navigation3D\VIZ.Framework.Core.Navigation3D.vcxproj", "{D1AA6399-2000-42BA-A577-D50BC5FCA393}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "03-Driver", "03-Driver", "{EA9A2679-B43B-4D2C-A418-6CA223D55104}"
...
...
@@ -307,18 +305,6 @@ Global
{6B864E7B-164B-4B1E-B7D6-1563D824F567}.Release|x64.Build.0 = Release|x64
{6B864E7B-164B-4B1E-B7D6-1563D824F567}.Release|x86.ActiveCfg = Release|Any CPU
{6B864E7B-164B-4B1E-B7D6-1563D824F567}.Release|x86.Build.0 = Release|Any CPU
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Debug|Any CPU.Build.0 = Debug|Any CPU
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Debug|x64.ActiveCfg = Debug|x64
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Debug|x64.Build.0 = Debug|x64
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Debug|x86.ActiveCfg = Debug|Any CPU
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Debug|x86.Build.0 = Debug|Any CPU
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Release|Any CPU.ActiveCfg = Release|Any CPU
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Release|Any CPU.Build.0 = Release|Any CPU
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Release|x64.ActiveCfg = Release|Any CPU
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Release|x64.Build.0 = Release|Any CPU
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Release|x86.ActiveCfg = Release|Any CPU
{16CDC661-A7D8-49DA-A269-0F9F4E798977}.Release|x86.Build.0 = Release|Any CPU
{D1AA6399-2000-42BA-A577-D50BC5FCA393}.Debug|Any CPU.ActiveCfg = Debug|x64
{D1AA6399-2000-42BA-A577-D50BC5FCA393}.Debug|Any CPU.Build.0 = Debug|x64
{D1AA6399-2000-42BA-A577-D50BC5FCA393}.Debug|x64.ActiveCfg = Debug|x64
...
...
@@ -355,7 +341,6 @@ Global
{8FC38D2A-D2E5-44D0-86E4-7136A6D19F2E} = {13A90A3F-66CC-445C-9900-39A23DA82C40}
{750ECE65-60DD-425A-B1D3-68E5158B6E9B} = {CB121805-63D4-4D8E-9F37-2C3CDE7733D1}
{6B864E7B-164B-4B1E-B7D6-1563D824F567} = {13A90A3F-66CC-445C-9900-39A23DA82C40}
{16CDC661-A7D8-49DA-A269-0F9F4E798977} = {13A90A3F-66CC-445C-9900-39A23DA82C40}
{D1AA6399-2000-42BA-A577-D50BC5FCA393} = {22C4088C-4CB2-488E-A7EE-102116434C09}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
...
...
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