Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.TVP
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.TVP
Commits
6cf091ef
Commit
6cf091ef
authored
Dec 09, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目搭建
parent
70f03df4
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
282 additions
and
0 deletions
+282
-0
Lib/VizConnectC.dll
+0
-0
VIZ.TVP.Connection/Protocol/ITVPEndpointManager.cs
+15
-0
VIZ.TVP.Connection/Protocol/VIZ/VizConnection.cs
+76
-0
VIZ.TVP.Connection/Protocol/VIZ/VizEndpointManager.cs
+132
-0
VIZ.TVP.Connection/TVPConnectionManager.cs
+16
-0
VIZ.TVP.Connection/VIZ.TVP.Connection.csproj
+8
-0
VIZ.TVP.Module/VIZ.TVP.Module.csproj
+3
-0
VIZ.TVP.Module/VizRender/Controller/VizController/IVizSupport.cs
+12
-0
VIZ.TVP.Module/VizRender/Controller/VizController/VizController.cs
+15
-0
VIZ.TVP.Service/VIZ.TVP.Service.csproj
+5
-0
No files found.
Lib/VizConnectC.dll
0 → 100644
View file @
6cf091ef
File added
VIZ.TVP.Connection/Protocol/ITVPEndpointManager.cs
0 → 100644
View file @
6cf091ef
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.TVP.Connection
{
/// <summary>
/// 包装终结点管理器
/// </summary>
public
interface
ITVPEndpointManager
{
}
}
VIZ.TVP.Connection/Protocol/VIZ/VizConnection.cs
0 → 100644
View file @
6cf091ef
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Connection
;
namespace
VIZ.TVP.Connection
{
/// <summary>
/// Viz连接
/// </summary>
public
class
VizConnection
{
/// <summary>
/// 终结点管理器集合
/// </summary>
private
Dictionary
<
string
,
VizEndpointManager
>
endpointManagers
=
new
Dictionary
<
string
,
VizEndpointManager
>();
/// <summary>
/// 获取VIZ终结点管理器
/// </summary>
/// <param name="key">终结点管理器键</param>
/// <returns>终结点管理器</returns>
public
VizEndpointManager
GetEndpointManager
(
string
key
)
{
this
.
endpointManagers
.
TryGetValue
(
key
,
out
VizEndpointManager
manager
);
return
manager
;
}
/// <summary>
/// 添加VIZ终结点管理器
/// </summary>
/// <param name="manager">终结点管理器</param>
public
void
AddEndpointManager
(
VizEndpointManager
manager
)
{
manager
.
VizConnection
=
this
;
lock
(
this
.
endpointManagers
)
{
this
.
endpointManagers
.
Add
(
manager
.
Key
,
manager
);
}
}
/// <summary>
/// 移除UDP终结点管理器
/// </summary>
/// <param name="key">终结点管理器键</param>
public
void
RemoveEndpointManager
(
string
key
)
{
lock
(
this
.
endpointManagers
)
{
if
(
this
.
endpointManagers
.
ContainsKey
(
key
))
{
this
.
endpointManagers
.
Remove
(
key
);
}
}
}
/// <summary>
/// 销毁
/// </summary>
public
void
Dispose
()
{
lock
(
this
.
endpointManagers
)
{
foreach
(
VizEndpointManager
manager
in
this
.
endpointManagers
.
Values
)
{
manager
.
Dispose
();
}
this
.
endpointManagers
.
Clear
();
}
}
}
}
\ No newline at end of file
VIZ.TVP.Connection/Protocol/VIZ/VizEndpointManager.cs
0 → 100644
View file @
6cf091ef
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Net.Sockets
;
using
System.Net
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Connection
;
using
VizConnectC
;
using
VIZ.Framework.Core
;
using
System.Web.WebSockets
;
namespace
VIZ.TVP.Connection
{
/// <summary>
/// Viz终结点管理器
/// </summary>
public
class
VizEndpointManager
:
ITVPEndpointManager
,
IDisposable
{
/// <summary>
/// 日志
/// </summary>
private
static
ILog
log
=
LogManager
.
GetLogger
(
typeof
(
VizEndpointManager
));
/// <summary>
/// VIZ总结点管理器
/// </summary>
/// <param name="key">键</param>
public
VizEndpointManager
(
string
key
)
{
this
.
Key
=
key
;
this
.
vizEnginePool
=
new
VizEnginePool
();
this
.
vizEnginePool
.
Connected
+=
VizEnginePool_Connected
;
this
.
vizEnginePool
.
Disconnected
+=
VizEnginePool_Disconnected
;
}
/// <summary>
/// 键
/// </summary>
public
string
Key
{
get
;
private
set
;
}
/// <summary>
/// 远端IP
/// </summary>
public
string
RemoteIP
{
get
;
private
set
;
}
/// <summary>
/// 远端端口
/// </summary>
public
int
RemotePort
{
get
;
private
set
;
}
/// <summary>
/// 是否处于连接状态
/// </summary>
public
bool
IsConnected
{
get
;
private
set
;
}
/// <summary>
/// 连接状态改变事件参数
/// </summary>
public
event
EventHandler
<
ConnectionStateChangedEventArgs
>
ConnectionStateChanged
;
/// <summary>
/// VIZ连接
/// </summary>
public
VizConnection
VizConnection
{
get
;
internal
set
;
}
/// <summary>
/// 引擎连接池
/// </summary>
private
VizEnginePool
vizEnginePool
;
/// <summary>
/// 连接
/// </summary>
/// <param name="remoteIP">远程IP</param>
/// <param name="remotePort">远程端口</param>
public
void
Connect
(
string
remoteIP
,
int
remotePort
)
{
this
.
RemoteIP
=
remoteIP
;
this
.
RemotePort
=
remotePort
;
this
.
vizEnginePool
.
AddRenderer
(
remoteIP
,
remotePort
);
this
.
vizEnginePool
.
Connect
();
}
/// <summary>
/// 断开连接
/// </summary>
public
void
Disconnect
()
{
this
.
vizEnginePool
.
Disconnect
();
}
/// <summary>
/// 发送消息
/// </summary>
/// <param name="message">消息</param>
public
void
Send
(
string
message
)
{
this
.
vizEnginePool
.
Send
(
message
);
}
/// <summary>
/// 销毁
/// </summary>
public
void
Dispose
()
{
this
.
vizEnginePool
?.
Disconnect
();
this
.
vizEnginePool
?.
Dispose
();
this
.
vizEnginePool
=
null
;
}
/// <summary>
/// 断开连接时触发
/// </summary>
private
void
VizEnginePool_Disconnected
(
object
sender
,
VizEnginePool
.
ConnectionEventArgs
e
)
{
this
.
IsConnected
=
false
;
this
.
ConnectionStateChanged
?.
Invoke
(
this
,
new
ConnectionStateChangedEventArgs
(
this
,
false
));
}
/// <summary>
/// 连接时触发
/// </summary>
private
void
VizEnginePool_Connected
(
object
sender
,
VizEnginePool
.
ConnectionEventArgs
e
)
{
this
.
IsConnected
=
true
;
this
.
ConnectionStateChanged
?.
Invoke
(
this
,
new
ConnectionStateChangedEventArgs
(
this
,
true
));
}
}
}
VIZ.TVP.Connection/TVPConnectionManager.cs
0 → 100644
View file @
6cf091ef
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.TVP.Connection
{
/// <summary>
/// 包装连接管理器
/// </summary>
public
static
class
TVPConnectionManager
{
}
}
VIZ.TVP.Connection/VIZ.TVP.Connection.csproj
View file @
6cf091ef
...
...
@@ -47,9 +47,17 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="VizConnectC, Version=0.8.0.2123, Culture=neutral, PublicKeyToken=f599d6c637d08eed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Lib\VizConnectC.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Protocol\ITVPEndpointManager.cs" />
<Compile Include="Protocol\VIZ\VizConnection.cs" />
<Compile Include="Protocol\VIZ\VizEndpointManager.cs" />
<Compile Include="TVPConnectionManager.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Connection\VIZ.Framework.Connection.csproj">
...
...
VIZ.TVP.Module/VIZ.TVP.Module.csproj
View file @
6cf091ef
...
...
@@ -138,6 +138,8 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="VizRender\Controller\VizController\IVizSupport.cs" />
<Compile Include="VizRender\Controller\VizController\VizController.cs" />
<Compile Include="VizRender\ViewModel\VizRenderViewModel.cs" />
<Compile Include="VizRender\VizRenderPluginLifeCycle.cs" />
<Compile Include="VizResource\Controller\VizResourceFile\IVizResourceFileSupport.cs" />
...
...
@@ -221,6 +223,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Connection\" />
<Folder Include="Login\Service\" />
<Folder Include="Setup\" />
</ItemGroup>
...
...
VIZ.TVP.Module/VizRender/Controller/VizController/IVizSupport.cs
0 → 100644
View file @
6cf091ef
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.TVP.Module
{
internal
class
IVizSupport
{
}
}
VIZ.TVP.Module/VizRender/Controller/VizController/VizController.cs
0 → 100644
View file @
6cf091ef
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.TVP.Module
{
/// <summary>
/// VIZ控制器
/// </summary>
public
class
VizController
{
}
}
VIZ.TVP.Service/VIZ.TVP.Service.csproj
View file @
6cf091ef
...
...
@@ -78,5 +78,9 @@
<Name>VIZ.TVP.Storage</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="VIZ\Implementation\" />
<Folder Include="VIZ\Interface\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ 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