Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Package
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.Package
Commits
08d3b117
Commit
08d3b117
authored
Jan 30, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页添加分组
parent
e8f8a419
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
471 additions
and
165 deletions
+471
-165
VIZ.Package.Domain/ApplicationDomainEx.cs
+5
-0
VIZ.Package.Domain/Enum/ConnGroupStatus.cs
+29
-0
VIZ.Package.Domain/Message/Conn/ConnChangedMessage.cs
+0
-8
VIZ.Package.Domain/Model/Conn/ConnGroupModel.cs
+65
-0
VIZ.Package.Domain/Model/Conn/ConnModel.cs
+26
-1
VIZ.Package.Domain/Model/Page/PageModel.cs
+14
-0
VIZ.Package.Domain/Plugin/IPluginView.cs
+4
-4
VIZ.Package.Domain/VIZ.Package.Domain.csproj
+1
-0
VIZ.Package.Module.Resource/Converter/ConnGroupStatus2BrushConverter.cs
+52
-0
VIZ.Package.Module.Resource/Icons/preview_connection_32x32.png
+0
-0
VIZ.Package.Module.Resource/Icons/preview_local_32x32.png
+0
-0
VIZ.Package.Module.Resource/Icons/preview_remote_32x32.png
+0
-0
VIZ.Package.Module.Resource/VIZ.Package.Module.Resource.csproj
+9
-1
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
+54
-46
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ListEdit/ListEditPanel.xaml
+1
-1
VIZ.Package.Module/ControlObject/FieldTree/View/FieldTreeView.xaml
+1
-1
VIZ.Package.Module/Main/View/MainConnView.xaml
+65
-10
VIZ.Package.Module/Main/ViewModel/MainConnViewModel.cs
+28
-23
VIZ.Package.Module/Page/Group/View/PageGroupView.xaml
+7
-1
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
+33
-0
VIZ.Package.Module/Page/Templage/View/PageTemplateView.xaml
+2
-2
VIZ.Package.Module/Preview/VizPreview/ViewModel/VizPreviewViewModel.cs
+47
-47
VIZ.Package.Module/Setting/Conn/View/ConnSettingView.xaml
+14
-9
VIZ.Package.Module/Setting/Conn/ViewModel/ConnSettingViewModel.cs
+7
-11
VIZ.Package.Service/DB/Page/PageService.cs
+2
-0
VIZ.Package.Storage/Entity/Page/PageEntity.cs
+5
-0
No files found.
VIZ.Package.Domain/ApplicationDomainEx.cs
View file @
08d3b117
...
@@ -88,6 +88,11 @@ namespace VIZ.Package.Domain
...
@@ -88,6 +88,11 @@ namespace VIZ.Package.Domain
// =============================================================
// =============================================================
/// <summary>
/// <summary>
/// 预览连接分组
/// </summary>
public
static
ConnGroupModel
PreviewConnGroup
{
get
;
set
;
}
/// <summary>
/// 预览连接
/// 预览连接
/// </summary>
/// </summary>
public
static
ConnModel
PreviewConn
{
get
;
set
;
}
public
static
ConnModel
PreviewConn
{
get
;
set
;
}
...
...
VIZ.Package.Domain/Enum/ConnGroupStatus.cs
0 → 100644
View file @
08d3b117
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 连接分组状态
/// </summary>
public
enum
ConnGroupStatus
{
/// <summary>
/// 全部断开
/// </summary>
AllDisconnection
,
/// <summary>
/// 有至少一个处于连接状态
/// </summary>
AnyConnection
,
/// <summary>
/// 全部处于连接状态
/// </summary>
AllConnection
}
}
VIZ.Package.Domain/Message/Conn/ConnChangedMessage.cs
View file @
08d3b117
...
@@ -12,14 +12,6 @@ namespace VIZ.Package.Domain
...
@@ -12,14 +12,6 @@ namespace VIZ.Package.Domain
/// </summary>
/// </summary>
public
class
ConnChangedMessage
public
class
ConnChangedMessage
{
{
/// <summary>
/// 老的连接分组
/// </summary>
public
ConnGroupModel
OldGroup
{
get
;
set
;
}
/// <summary>
/// 新的连接分组
/// </summary>
public
ConnGroupModel
NewGroup
{
get
;
set
;
}
}
}
}
}
VIZ.Package.Domain/Model/Conn/ConnGroupModel.cs
View file @
08d3b117
...
@@ -56,6 +56,20 @@ namespace VIZ.Package.Domain
...
@@ -56,6 +56,20 @@ namespace VIZ.Package.Domain
#
endregion
#
endregion
#
region
IsDefault
--
是否是默认分组
private
bool
isDefault
;
/// <summary>
/// 是否是默认分组
/// </summary>
public
bool
IsDefault
{
get
{
return
isDefault
;
}
set
{
isDefault
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsDefault
));
}
}
#
endregion
#
region
EngineType
--
引擎类型
#
region
EngineType
--
引擎类型
private
EngineType
engineType
;
private
EngineType
engineType
;
...
@@ -84,5 +98,56 @@ namespace VIZ.Package.Domain
...
@@ -84,5 +98,56 @@ namespace VIZ.Package.Domain
}
}
#
endregion
#
endregion
#
region
IsLocalPreview
--
是否是本地预览
private
bool
isLocalPreview
;
/// <summary>
/// 是否是本地预览
/// </summary>
public
bool
IsLocalPreview
{
get
{
return
isLocalPreview
;
}
set
{
isLocalPreview
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsLocalPreview
));
}
}
#
endregion
#
region
Status
--
状态
private
ConnGroupStatus
status
;
/// <summary>
/// 状态
/// </summary>
public
ConnGroupStatus
Status
{
get
{
return
status
;
}
set
{
status
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
Status
));
}
}
#
endregion
/// <summary>
/// 更新状态
/// </summary>
public
void
UpdateStatus
()
{
// 没有连接项 | 全断开
if
(
this
.
Items
.
Count
==
0
||
this
.
Items
.
Where
(
p
=>
p
.
IsEnabled
).
All
(
p
=>
!
p
.
IsConnected
))
{
this
.
Status
=
ConnGroupStatus
.
AllDisconnection
;
return
;
}
// 全连接
if
(
this
.
Items
.
Where
(
p
=>
p
.
IsEnabled
).
All
(
p
=>
p
.
IsConnected
))
{
this
.
Status
=
ConnGroupStatus
.
AllConnection
;
return
;
}
// 部分连接
this
.
Status
=
ConnGroupStatus
.
AnyConnection
;
}
}
}
}
}
VIZ.Package.Domain/Model/Conn/ConnModel.cs
View file @
08d3b117
...
@@ -125,6 +125,20 @@ namespace VIZ.Package.Domain
...
@@ -125,6 +125,20 @@ namespace VIZ.Package.Domain
#
endregion
#
endregion
#
region
ErrorMessage
--
错误信息
private
string
errorMessage
;
/// <summary>
/// 错误信息
/// </summary>
public
string
ErrorMessage
{
get
{
return
errorMessage
;
}
set
{
errorMessage
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ErrorMessage
));
}
}
#
endregion
// ============================================================================
// ============================================================================
#
region
IsLoading
--
是否正在等待
#
region
IsLoading
--
是否正在等待
...
@@ -147,11 +161,19 @@ namespace VIZ.Package.Domain
...
@@ -147,11 +161,19 @@ namespace VIZ.Package.Domain
public
IPackageEndpointManager
EndpointManager
{
get
;
private
set
;
}
public
IPackageEndpointManager
EndpointManager
{
get
;
private
set
;
}
/// <summary>
/// <summary>
/// 所属分组
/// </summary>
public
ConnGroupModel
OwnerGroup
{
get
;
set
;
}
/// <summary>
/// 初始化终结点管理器
/// 初始化终结点管理器
/// </summary>
/// </summary>
/// <param name="groupModel">分组</param>
/// <param name="endpointManager">终结点管理器</param>
/// <param name="endpointManager">终结点管理器</param>
public
void
InitEndpointManager
(
IPackageEndpointManager
endpointManager
)
public
void
InitEndpointManager
(
ConnGroupModel
groupModel
,
IPackageEndpointManager
endpointManager
)
{
{
this
.
OwnerGroup
=
groupModel
;
if
(
this
.
EndpointManager
!=
null
)
if
(
this
.
EndpointManager
!=
null
)
{
{
this
.
EndpointManager
.
ConnectionStateChanged
-=
EndpointManager_ConnectionStateChanged
;
this
.
EndpointManager
.
ConnectionStateChanged
-=
EndpointManager_ConnectionStateChanged
;
...
@@ -179,6 +201,9 @@ namespace VIZ.Package.Domain
...
@@ -179,6 +201,9 @@ namespace VIZ.Package.Domain
WPFHelper
.
BeginInvoke
(()
=>
WPFHelper
.
BeginInvoke
(()
=>
{
{
this
.
IsConnected
=
e
.
IsConnected
;
this
.
IsConnected
=
e
.
IsConnected
;
this
.
ErrorMessage
=
e
.
Exception
?.
Message
;
this
.
OwnerGroup
?.
UpdateStatus
();
});
});
}
}
}
}
...
...
VIZ.Package.Domain/Model/Page/PageModel.cs
View file @
08d3b117
...
@@ -96,5 +96,19 @@ namespace VIZ.Package.Domain
...
@@ -96,5 +96,19 @@ namespace VIZ.Package.Domain
}
}
#
endregion
#
endregion
#
region
ConnGroupID
--
连接分组
ID
private
Guid
connGroupID
;
/// <summary>
/// 连接分组ID
/// </summary>
public
Guid
ConnGroupID
{
get
{
return
connGroupID
;
}
set
{
connGroupID
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ConnGroupID
));
}
}
#
endregion
}
}
}
}
VIZ.Package.Domain/Plugin/IPluginView.cs
View file @
08d3b117
...
@@ -15,25 +15,25 @@ namespace VIZ.Package.Domain
...
@@ -15,25 +15,25 @@ namespace VIZ.Package.Domain
/// 上版
/// 上版
/// </summary>
/// </summary>
/// <param name="conns">连接</param>
/// <param name="conns">连接</param>
void
TakIn
(
IList
<
ConnModel
>
conns
);
void
TakIn
(
ConnModel
conns
);
/// <summary>
/// <summary>
/// 继续
/// 继续
/// </summary>
/// </summary>
/// <param name="conns">连接</param>
/// <param name="conns">连接</param>
void
TakeContinue
(
IList
<
ConnModel
>
conns
);
void
TakeContinue
(
ConnModel
conns
);
/// <summary>
/// <summary>
/// 下版子
/// 下版子
/// </summary>
/// </summary>
/// <param name="conns">连接</param>
/// <param name="conns">连接</param>
void
TakeOut
(
IList
<
ConnModel
>
conns
);
void
TakeOut
(
ConnModel
conns
);
/// <summary>
/// <summary>
/// 更新
/// 更新
/// </summary>
/// </summary>
/// <param name="conns">连接</param>
/// <param name="conns">连接</param>
void
TakeUpdate
(
IList
<
ConnModel
>
conns
);
void
TakeUpdate
(
ConnModel
conns
);
/// <summary>
/// <summary>
/// 预览上版子
/// 预览上版子
...
...
VIZ.Package.Domain/VIZ.Package.Domain.csproj
View file @
08d3b117
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
<Compile Include="ApplicationConstants.cs" />
<Compile Include="ApplicationConstants.cs" />
<Compile Include="ApplicationDomainEx.cs" />
<Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Core\GridColumnDefinition.cs" />
<Compile Include="Core\GridColumnDefinition.cs" />
<Compile Include="Enum\ConnGroupStatus.cs" />
<Compile Include="Enum\ModulePluginIds.cs" />
<Compile Include="Enum\ModulePluginIds.cs" />
<Compile Include="Enum\ViewServiceKeys.cs" />
<Compile Include="Enum\ViewServiceKeys.cs" />
<Compile Include="Info\VizTreeNodeInfo.cs" />
<Compile Include="Info\VizTreeNodeInfo.cs" />
...
...
VIZ.Package.Module.Resource/Converter/ConnGroupStatus2BrushConverter.cs
0 → 100644
View file @
08d3b117
using
System
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Data
;
using
System.Windows.Media
;
using
VIZ.Package.Domain
;
namespace
VIZ.Package.Module.Resource
{
/// <summary>
/// 连接分组状态 到 纯色画刷转化器
/// </summary>
public
class
ConnGroupStatus2BrushConverter
:
IValueConverter
{
/// <summary>
/// 全断开画刷
/// </summary>
public
SolidColorBrush
AllDisconnectionBrush
{
get
;
set
;
}
/// <summary>
/// 部分连接画刷
/// </summary>
public
SolidColorBrush
AnyConnectionBrush
{
get
;
set
;
}
/// <summary>
/// 全连接画刷
/// </summary>
public
SolidColorBrush
AllConnectionBrush
{
get
;
set
;
}
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
if
(!(
value
is
ConnGroupStatus
status
))
return
null
;
switch
(
status
)
{
case
ConnGroupStatus
.
AllDisconnection
:
return
this
.
AllDisconnectionBrush
;
case
ConnGroupStatus
.
AnyConnection
:
return
this
.
AnyConnectionBrush
;
case
ConnGroupStatus
.
AllConnection
:
return
this
.
AllConnectionBrush
;
default
:
return
null
;
}
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
throw
new
NotImplementedException
();
}
}
}
VIZ.Package.Module.Resource/Icons/preview_connection_32x32.png
0 → 100644
View file @
08d3b117
352 Bytes
VIZ.Package.Module.Resource/Icons/preview_local_32x32.png
0 → 100644
View file @
08d3b117
319 Bytes
VIZ.Package.Module.Resource/Icons/preview_remote_32x32.png
0 → 100644
View file @
08d3b117
655 Bytes
VIZ.Package.Module.Resource/VIZ.Package.Module.Resource.csproj
View file @
08d3b117
...
@@ -99,6 +99,7 @@
...
@@ -99,6 +99,7 @@
</Page>
</Page>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile Include="Converter\ConnGroupStatus2BrushConverter.cs" />
<Compile Include="Converter\ResourceFileSelectionModeConverter.cs" />
<Compile Include="Converter\ResourceFileSelectionModeConverter.cs" />
<Compile Include="Converter\RichText2TextConverter.cs" />
<Compile Include="Converter\RichText2TextConverter.cs" />
<Compile Include="Converter\RowHandleConverter.cs" />
<Compile Include="Converter\RowHandleConverter.cs" />
...
@@ -207,6 +208,12 @@
...
@@ -207,6 +208,12 @@
<ItemGroup>
<ItemGroup>
<Resource Include="Icons\icon_save_as_hover_30x30.png" />
<Resource Include="Icons\icon_save_as_hover_30x30.png" />
</ItemGroup>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="Icons\preview_local_32x32.png" />
<Resource Include="Icons\preview_remote_32x32.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\preview_connection_32x32.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
\ No newline at end of file
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
View file @
08d3b117
...
@@ -82,18 +82,20 @@ namespace VIZ.Package.Module
...
@@ -82,18 +82,20 @@ namespace VIZ.Package.Module
service
.
TryUpdateControlFieldListValue
();
service
.
TryUpdateControlFieldListValue
();
// 执行上版流程
// 执行上版流程
this
.
Execute
(
this
.
Execute
((
obj
,
view
,
conn
)
=>
controlObjectAction
:
(
obj
,
conn
)
=>
{
{
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
false
);
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
false
);
this
.
vizCommandService
.
SetObject
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
ScenePath
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
this
.
vizCommandService
.
SetObject
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
ScenePath
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
if
(
obj
!=
null
)
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
}
if
(
view
!=
null
)
{
view
.
TakIn
(
conn
);
}
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
this
.
vizCommandService
.
Start
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
this
.
vizCommandService
.
Start
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
},
pluginAction
:
(
view
,
conns
)
=>
{
view
.
TakIn
(
conns
);
});
});
}
}
...
@@ -111,14 +113,10 @@ namespace VIZ.Package.Module
...
@@ -111,14 +113,10 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
private
void
Continue
()
private
void
Continue
()
{
{
this
.
Execute
(
this
.
Execute
((
obj
,
view
,
conn
)
=>
controlObjectAction
:
(
obj
,
conn
)
=>
{
{
this
.
vizCommandService
.
TakeContinue
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
this
.
vizCommandService
.
TakeContinue
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
},
view
?.
TakeContinue
(
conn
);
pluginAction
:
(
view
,
conns
)
=>
{
view
.
TakeContinue
(
conns
);
});
});
}
}
...
@@ -136,14 +134,10 @@ namespace VIZ.Package.Module
...
@@ -136,14 +134,10 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
private
void
TakeOut
()
private
void
TakeOut
()
{
{
this
.
Execute
(
this
.
Execute
((
obj
,
view
,
conn
)
=>
controlObjectAction
:
(
obj
,
conn
)
=>
{
{
this
.
vizCommandService
.
TakeOut
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
this
.
vizCommandService
.
TakeOut
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
},
view
?.
TakeOut
(
conn
);
pluginAction
:
(
view
,
conns
)
=>
{
view
.
TakeOut
(
conns
);
});
});
}
}
...
@@ -170,14 +164,13 @@ namespace VIZ.Package.Module
...
@@ -170,14 +164,13 @@ namespace VIZ.Package.Module
service
.
TryUpdateControlFieldListValue
();
service
.
TryUpdateControlFieldListValue
();
// 执行更新流程
// 执行更新流程
this
.
Execute
(
this
.
Execute
((
obj
,
view
,
conn
)
=>
controlObjectAction
:
(
obj
,
conn
)
=>
{
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
if
(
obj
!=
null
)
},
pluginAction
:
(
view
,
conns
)
=>
{
{
view
.
TakeUpdate
(
conns
);
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
}
view
?.
TakeOut
(
conn
);
});
});
}
}
...
@@ -190,25 +183,33 @@ namespace VIZ.Package.Module
...
@@ -190,25 +183,33 @@ namespace VIZ.Package.Module
/// <summary>
/// <summary>
/// 执行
/// 执行
/// </summary>
/// </summary>
/// <param name="controlObjectAction">控制对象行为</param>
/// <param name="action">行为</param>
/// <param name="pluginAction">插件行为</param>
private
void
Execute
(
Action
<
ControlObjectModel
,
IPluginView
,
ConnModel
>
action
)
private
void
Execute
(
Action
<
ControlObjectModel
,
ConnModel
>
controlObjectAction
,
Action
<
IPluginView
,
IList
<
ConnModel
>>
pluginAction
)
{
{
// 是否拥有打开的页或模板页
// 是否拥有打开的页或模板页
if
(
ApplicationDomainEx
.
CurrentPage
==
null
)
if
(
ApplicationDomainEx
.
CurrentPage
==
null
)
return
;
return
;
//
是否有启用的连接分组
//
插件服务
ConnGroupModel
group
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
IsEnabled
);
IPluginService
pluginService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPluginService
>(
ViewServiceKeys
.
PLUGIN_SERVICE
);
if
(
group
==
null
)
if
(
pluginService
==
null
)
return
;
return
;
// 控制字段树服务
IFieldTreeService
fieldTreeService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IFieldTreeService
>(
ViewServiceKeys
.
FIELD_TREE_SERVICE
);
IFieldTreeService
fieldTreeService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IFieldTreeService
>(
ViewServiceKeys
.
FIELD_TREE_SERVICE
);
ControlObjectModel
controlObject
=
fieldTreeService
?.
GetControlObject
();
if
(
fieldTreeService
==
null
)
return
;
// Step 1. 处理控制对象
ControlObjectModel
controlObject
=
fieldTreeService
.
GetControlObject
();
if
(
controlObject
!=
null
)
// 模板
if
(
ApplicationDomainEx
.
CurrentPage
is
PageTemplateModel
template
)
{
{
// 模板上版等操作使用默认分组
ConnGroupModel
group
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
IsDefault
);
if
(
group
==
null
)
return
;
foreach
(
var
item
in
group
.
Items
)
foreach
(
var
item
in
group
.
Items
)
{
{
if
(!
item
.
IsEnabled
||
!
item
.
IsConnected
)
if
(!
item
.
IsEnabled
||
!
item
.
IsConnected
)
...
@@ -216,7 +217,7 @@ namespace VIZ.Package.Module
...
@@ -216,7 +217,7 @@ namespace VIZ.Package.Module
try
try
{
{
controlObjectAction
(
controlObject
,
item
);
action
(
controlObject
,
null
,
item
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
@@ -224,25 +225,29 @@ namespace VIZ.Package.Module
...
@@ -224,25 +225,29 @@ namespace VIZ.Package.Module
}
}
}
}
}
}
// 页
else
if
(
ApplicationDomainEx
.
CurrentPage
is
PageModel
page
)
{
// 模板上版等操作使用默认分组
ConnGroupModel
group
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
GroupID
==
page
.
ConnGroupID
);
if
(
group
==
null
)
{
// 记录日志
log
.
Error
(
$"ConnGroupID:
{
page
.
ConnGroupID
}
is not found."
);
// Step 2. 执行插件脚本
if
(!(
ApplicationDomainEx
.
CurrentPage
is
PageModel
page
))
return
;
if
(
string
.
IsNullOrWhiteSpace
(
page
.
PluginID
))
return
;
IPluginService
pluginService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPluginService
>(
ViewServiceKeys
.
PLUGIN_SERVICE
);
if
(
pluginService
==
null
)
return
;
return
;
}
IPluginView
view
=
pluginService
.
GetCurrentPluginView
()
as
IPluginView
;
IPluginView
view
=
pluginService
.
GetCurrentPluginView
()
as
IPluginView
;
if
(
view
==
null
)
return
;
foreach
(
var
item
in
group
.
Items
)
{
if
(!
item
.
IsEnabled
||
!
item
.
IsConnected
)
continue
;
try
try
{
{
pluginAction
(
view
,
group
.
Items
.
Where
(
p
=>
p
.
IsEnabled
&&
p
.
IsConnected
).
ToList
()
);
action
(
controlObject
,
view
,
item
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
@@ -250,4 +255,6 @@ namespace VIZ.Package.Module
...
@@ -250,4 +255,6 @@ namespace VIZ.Package.Module
}
}
}
}
}
}
}
}
}
}
\ No newline at end of file
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ListEdit/ListEditPanel.xaml
View file @
08d3b117
...
@@ -125,7 +125,7 @@
...
@@ -125,7 +125,7 @@
<dxg:GridControl.View>
<dxg:GridControl.View>
<dxg:TableView x:Name="tabView" AllowEditing="True" ShowIndicator="False"
<dxg:TableView x:Name="tabView" AllowEditing="True" ShowIndicator="False"
IsColumnMenuEnabled="False"
IsColumnMenuEnabled="False"
NavigationStyle="Cell" EditorShowMode="MouseDown"
NavigationStyle="Cell" EditorShowMode="MouseDown"
ShowVerticalLines="False"
ShowGroupPanel="False"
ShowGroupPanel="False"
AllowDrop="True"
AllowDrop="True"
ShowBandsPanel="False"
ShowBandsPanel="False"
...
...
VIZ.Package.Module/ControlObject/FieldTree/View/FieldTreeView.xaml
View file @
08d3b117
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
<dxg:GridControl.View>
<dxg:GridControl.View>
<dxg:TreeListView AllowEditing="False" ShowIndicator="False"
<dxg:TreeListView AllowEditing="False" ShowIndicator="False"
IsColumnMenuEnabled="False"
IsColumnMenuEnabled="False"
NavigationStyle="Row"
NavigationStyle="Row"
ShowVerticalLines="False"
ShowBandsPanel="False"
ShowBandsPanel="False"
ShowTotalSummary="False"
ShowTotalSummary="False"
ShowFixedTotalSummary="False"
ShowFixedTotalSummary="False"
...
...
VIZ.Package.Module/Main/View/MainConnView.xaml
View file @
08d3b117
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:plugin="clr-namespace:VIZ.Package.Plugin;assembly=VIZ.Package.Plugin"
xmlns:plugin="clr-namespace:VIZ.Package.Plugin;assembly=VIZ.Package.Plugin"
xmlns:resource="clr-namespace:VIZ.Package.Module.Resource;assembly=VIZ.Package.Module.Resource"
xmlns:local="clr-namespace:VIZ.Package.Module"
xmlns:local="clr-namespace:VIZ.Package.Module"
d:DataContext="{d:DesignInstance Type=local:MainConnViewModel}"
d:DataContext="{d:DesignInstance Type=local:MainConnViewModel}"
mc:Ignorable="d" x:Name="uc"
mc:Ignorable="d" x:Name="uc"
...
@@ -22,15 +23,16 @@
...
@@ -22,15 +23,16 @@
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary.MergedDictionaries>
<fcore:Bool2BoolConverter x:Key="Bool2BoolConverter"></fcore:Bool2BoolConverter>
<fcore:Bool2BoolConverter x:Key="Bool2BoolConverter"></fcore:Bool2BoolConverter>
<fcore:Bool2SolidColorBrushConverter x:Key="Bool2SolidColorBrushConverter"
TrueBrush="#FF92FF3D"
<resource:ConnGroupStatus2BrushConverter x:Key="ConnGroupStatus2BrushConverter"
FalseBrush="#FFFF5353"
AllDisconnectionBrush="#FFFF5353"
NoneBrush="#FFFF5353"></fcore:Bool2SolidColorBrushConverter>
AnyConnectionBrush="Yellow"
AllConnectionBrush="#FF92FF3D"></resource:ConnGroupStatus2BrushConverter>
</ResourceDictionary>
</ResourceDictionary>
</UserControl.Resources>
</UserControl.Resources>
<Grid>
<Grid>
<ListBox Style="{StaticResource ListBox_None}"
<ListBox Style="{StaticResource ListBox_None}"
Margin="10,0,0,0"
ItemsSource="{Binding Path=ItemsSrouce}"
ItemsSource="{Binding Path=ItemsSrouce}"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden">
ScrollViewer.VerticalScrollBarVisibility="Hidden">
...
@@ -41,12 +43,49 @@
...
@@ -41,12 +43,49 @@
</ListBox.ItemsPanel>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<ListBox.ItemTemplate>
<DataTemplate>
<DataTemplate>
<Border>
<Grid Background="Transparent" x:Name="root">
<StackPanel Orientation="Horizontal" Background="Transparent" VerticalAlignment="Center"
<!-- 内容 -->
<StackPanel Orientation="Horizontal">
<Border Width="16" Height="16" VerticalAlignment="Center"
Background="{Binding Path=Status,Converter={StaticResource ConnGroupStatus2BrushConverter}}">
<Border.OpacityMask>
<ImageBrush ImageSource="/VIZ.Package.Module.Resource;component/Icons/preview_connection_32x32.png"></ImageBrush>
</Border.OpacityMask>
</Border>
<TextBlock Text="{Binding Path=Name}" Grid.Column="1" VerticalAlignment="Center" Margin="10,0,50,0"
MaxWidth="200"
Foreground="{Binding Path=Status,Converter={StaticResource ConnGroupStatus2BrushConverter}}"
TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"></TextBlock>
</StackPanel>
<!-- 弹出框 -->
<Popup AllowsTransparency="True"
PopupAnimation="Fade"
PlacementTarget="{Binding ElementName=root}"
Placement="Top"
Width="320"
MinHeight="200"
IsOpen="{Binding ElementName=root, Path=IsMouseOver, Mode=OneWay}">
<Border Background="#FF252526" BorderBrush="#FF4E4BDE" BorderThickness="1" Width="300">
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<TextBlock Text="分组: " Foreground="#aaffffff"></TextBlock>
<TextBlock Text="{Binding Path=Name}" Margin="10,0,10,0" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"></TextBlock>
</StackPanel>
<ListBox Style="{StaticResource ListBox_None}" ItemsSource="{Binding Path=Items}" Grid.Row="1">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel x:Name="innerRoot"
Orientation="Horizontal" Background="Transparent" VerticalAlignment="Center"
IsEnabled="{Binding Path=IsLoading,Converter={StaticResource Bool2BoolConverter}}"
IsEnabled="{Binding Path=IsLoading,Converter={StaticResource Bool2BoolConverter}}"
TextBlock.Foreground="{Binding Path=IsConnected,Converter={StaticResource Bool2SolidColorBrushConverter}}
"
TextBlock.Foreground="#FFFF5353
"
TextBlock.FontSize="12
"
TextBlock.FontSize="12" Height="24
"
Cursor="Hand" MinWidth="120" Margin="10,0,0,0
">
Cursor="Hand
">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand Event="PreviewMouseLeftButtonDown"
<dxmvvm:EventToCommand Event="PreviewMouseLeftButtonDown"
CommandParameter="{Binding .}"
CommandParameter="{Binding .}"
...
@@ -59,7 +98,23 @@
...
@@ -59,7 +98,23 @@
<TextBlock Text="{Binding Path=Remark}" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="{Binding Path=Remark}" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="]" Margin="3,0,3,0" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="]" Margin="3,0,3,0" VerticalAlignment="Center"></TextBlock>
</StackPanel>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=IsConnected}" Value="True">
<Setter Property="TextBlock.Foreground" TargetName="innerRoot" Value="#FF92FF3D"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsEnabled}" Value="False">
<Setter Property="IsEnabled" Value="False"></Setter>
<Setter Property="Opacity" Value="0.4"></Setter>
<Setter Property="TextBlock.Foreground" TargetName="innerRoot" Value="White"></Setter>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Border>
</Border>
</Popup>
</Grid>
</DataTemplate>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox.ItemTemplate>
</ListBox>
</ListBox>
...
...
VIZ.Package.Module/Main/ViewModel/MainConnViewModel.cs
View file @
08d3b117
...
@@ -63,11 +63,11 @@ namespace VIZ.Package.Module
...
@@ -63,11 +63,11 @@ namespace VIZ.Package.Module
#
region
ItemsSrouce
--
数据源
#
region
ItemsSrouce
--
数据源
private
ObservableCollection
<
Conn
Model
>
itemsSrouce
=
new
ObservableCollection
<
Conn
Model
>();
private
ObservableCollection
<
Conn
GroupModel
>
itemsSrouce
=
new
ObservableCollection
<
ConnGroup
Model
>();
/// <summary>
/// <summary>
/// 数据源
/// 数据源
/// </summary>
/// </summary>
public
ObservableCollection
<
ConnModel
>
ItemsSrouce
public
ObservableCollection
<
Conn
Group
Model
>
ItemsSrouce
{
{
get
{
return
itemsSrouce
;
}
get
{
return
itemsSrouce
;
}
set
{
itemsSrouce
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ItemsSrouce
));
}
set
{
itemsSrouce
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ItemsSrouce
));
}
...
@@ -122,15 +122,7 @@ namespace VIZ.Package.Module
...
@@ -122,15 +122,7 @@ namespace VIZ.Package.Module
/// <param name="msg">消息</param>
/// <param name="msg">消息</param>
private
void
OnConnChangedMessage
(
ConnChangedMessage
msg
)
private
void
OnConnChangedMessage
(
ConnChangedMessage
msg
)
{
{
if
(
msg
.
OldGroup
!=
null
)
this
.
InitAndConnnectGroups
();
{
foreach
(
ConnModel
item
in
msg
.
OldGroup
.
Items
)
{
item
.
Dispose
();
}
}
this
.
InitAndConnnectGroups
(
msg
.
NewGroup
);
}
}
/// <summary>
/// <summary>
...
@@ -142,33 +134,43 @@ namespace VIZ.Package.Module
...
@@ -142,33 +134,43 @@ namespace VIZ.Package.Module
List
<
ConnGroupModel
>
groups
=
this
.
connService
.
LoadGroups
();
List
<
ConnGroupModel
>
groups
=
this
.
connService
.
LoadGroups
();
ApplicationDomainEx
.
ConnGroups
=
groups
;
ApplicationDomainEx
.
ConnGroups
=
groups
;
ConnGroupModel
group
=
groups
.
FirstOrDefault
(
p
=>
p
.
IsEnabled
==
true
);
this
.
InitAndConnnectGroups
();
this
.
InitAndConnnectGroups
(
group
);
}
}
/// <summary>
/// <summary>
/// 初始化 & 连接
/// 初始化 & 连接
/// </summary>
/// </summary>
/// <param name="group">连接分组</param>
private
void
InitAndConnnectGroups
()
private
void
InitAndConnnectGroups
(
ConnGroupModel
group
)
{
// 清理之前的连接
foreach
(
ConnGroupModel
group
in
this
.
ItemsSrouce
)
{
{
foreach
(
ConnModel
item
in
group
.
Items
)
{
if
(
item
==
ApplicationDomainEx
.
PreviewConn
)
continue
;
item
.
Dispose
();
}
}
this
.
ItemsSrouce
.
Clear
();
this
.
ItemsSrouce
.
Clear
();
// 预览
连接
// 预览
分组
this
.
ItemsSrouce
.
Add
(
ApplicationDomainEx
.
PreviewConn
);
this
.
ItemsSrouce
.
Add
(
ApplicationDomainEx
.
PreviewConn
Group
);
if
(
group
==
null
)
// 其他分组
return
;
foreach
(
ConnGroupModel
group
in
ApplicationDomainEx
.
ConnGroups
)
{
if
(!
group
.
IsEnabled
)
continue
;
foreach
(
ConnModel
item
in
group
.
Items
)
foreach
(
ConnModel
item
in
group
.
Items
)
{
{
if
(!
item
.
IsEnabled
)
if
(!
item
.
IsEnabled
)
continue
;
continue
;
item
.
InitEndpointManager
(
new
VizEndpointManager
(
item
.
ConnID
.
ToString
(),
item
.
IP
,
item
.
Port
));
item
.
InitEndpointManager
(
group
,
new
VizEndpointManager
(
item
.
ConnID
.
ToString
(),
item
.
IP
,
item
.
Port
));
this
.
ItemsSrouce
.
Add
(
item
);
// 启动连接
// 启动连接
ThreadHelper
.
SafeRun
(()
=>
ThreadHelper
.
SafeRun
(()
=>
...
@@ -183,6 +185,9 @@ namespace VIZ.Package.Module
...
@@ -183,6 +185,9 @@ namespace VIZ.Package.Module
}
}
});
});
}
}
this
.
ItemsSrouce
.
Add
(
group
);
}
}
}
}
}
}
}
VIZ.Package.Module/Page/Group/View/PageGroupView.xaml
View file @
08d3b117
...
@@ -99,6 +99,12 @@
...
@@ -99,6 +99,12 @@
IsTextEditable="False"></dxe:ComboBoxEditSettings>
IsTextEditable="False"></dxe:ComboBoxEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridColumn>
<dxg:GridColumn Header="连接" FieldName="ConnGroupID" AllowSorting="False" AllowColumnFiltering="False">
<dxg:GridColumn.EditSettings>
<dxe:ComboBoxEditSettings ItemsSource="{Binding ElementName=uc, Path=DataContext.ConnGroups,Mode=TwoWay}"
DisplayMember="Name" ValueMember="GroupID" IsTextEditable="False"></dxe:ComboBoxEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Header="引擎类型" FieldName="EngineType" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False"></dxg:GridColumn>
<dxg:GridColumn Header="引擎类型" FieldName="EngineType" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False"></dxg:GridColumn>
<dxg:GridColumn Header="模板类型" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False"
<dxg:GridColumn Header="模板类型" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False"
Binding="{Binding Path=TemplateType,Converter={StaticResource Enum2EnumDescriptionConverter}}">
Binding="{Binding Path=TemplateType,Converter={StaticResource Enum2EnumDescriptionConverter}}">
...
@@ -108,7 +114,7 @@
...
@@ -108,7 +114,7 @@
<dxg:GridControl.View>
<dxg:GridControl.View>
<dxg:TableView IsColumnMenuEnabled="False"
<dxg:TableView IsColumnMenuEnabled="False"
AllowEditing="True" ShowIndicator="False"
AllowEditing="True" ShowIndicator="False"
NavigationStyle="Cell"
NavigationStyle="Cell"
ShowVerticalLines="False"
ShowGroupPanel="False" EditorShowMode="MouseUp"
ShowGroupPanel="False" EditorShowMode="MouseUp"
AllowDragDrop="True"
AllowDragDrop="True"
ShowBandsPanel="False"
ShowBandsPanel="False"
...
...
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
View file @
08d3b117
...
@@ -58,6 +58,7 @@ namespace VIZ.Package.Module
...
@@ -58,6 +58,7 @@ namespace VIZ.Package.Module
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectCloseMessage
>(
this
,
this
.
OnProjectCloseMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectCloseMessage
>(
this
,
this
.
OnProjectCloseMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectSaveMessage
>(
this
,
this
.
OnProjectSaveMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectSaveMessage
>(
this
,
this
.
OnProjectSaveMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ConnChangedMessage
>(
this
,
this
.
OnConnChangedMessage
);
}
}
// ======================================================================================
// ======================================================================================
...
@@ -159,6 +160,20 @@ namespace VIZ.Package.Module
...
@@ -159,6 +160,20 @@ namespace VIZ.Package.Module
#
endregion
#
endregion
#
region
ConnGroups
--
连接分组集合
private
List
<
ConnGroupModel
>
connGroups
;
/// <summary>
/// 连接分组集合
/// </summary>
public
List
<
ConnGroupModel
>
ConnGroups
{
get
{
return
connGroups
;
}
set
{
connGroups
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ConnGroups
));
}
}
#
endregion
// ======================================================================================
// ======================================================================================
// Command
// Command
// ======================================================================================
// ======================================================================================
...
@@ -316,6 +331,7 @@ namespace VIZ.Package.Module
...
@@ -316,6 +331,7 @@ namespace VIZ.Package.Module
this
.
SelectedPageGroupModel
=
null
;
this
.
SelectedPageGroupModel
=
null
;
this
.
SelectedPageModel
=
null
;
this
.
SelectedPageModel
=
null
;
this
.
IsLoading
=
true
;
this
.
IsLoading
=
true
;
this
.
UpdateConnGroups
();
ThreadHelper
.
SafeRun
(()
=>
ThreadHelper
.
SafeRun
(()
=>
{
{
...
@@ -370,6 +386,15 @@ namespace VIZ.Package.Module
...
@@ -370,6 +386,15 @@ namespace VIZ.Package.Module
this
.
pageService
.
SavePageGroups
(
this
.
PageGroupModels
);
this
.
pageService
.
SavePageGroups
(
this
.
PageGroupModels
);
}
}
/// <summary>
/// 连接切换消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnConnChangedMessage
(
ConnChangedMessage
msg
)
{
this
.
UpdateConnGroups
();
}
// ======================================================================================
// ======================================================================================
// Public Function
// Public Function
// ======================================================================================
// ======================================================================================
...
@@ -509,5 +534,13 @@ namespace VIZ.Package.Module
...
@@ -509,5 +534,13 @@ namespace VIZ.Package.Module
return
false
;
return
false
;
}
}
/// <summary>
/// 更新连接分组
/// </summary>
public
void
UpdateConnGroups
()
{
this
.
ConnGroups
=
ApplicationDomainEx
.
ConnGroups
;
}
}
}
}
}
VIZ.Package.Module/Page/Templage/View/PageTemplateView.xaml
View file @
08d3b117
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
<dxg:GridControl.View>
<dxg:GridControl.View>
<dxg:TableView IsColumnMenuEnabled="False"
<dxg:TableView IsColumnMenuEnabled="False"
AllowEditing="True" ShowIndicator="False"
AllowEditing="True" ShowIndicator="False"
NavigationStyle="Cell"
NavigationStyle="Cell"
ShowVerticalLines="False"
ShowGroupPanel="False" EditorShowMode="MouseUp"
ShowGroupPanel="False" EditorShowMode="MouseUp"
AllowDragDrop="True"
AllowDragDrop="True"
ShowBandsPanel="False"
ShowBandsPanel="False"
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
<dxg:GridControl.View>
<dxg:GridControl.View>
<dxg:TableView IsColumnMenuEnabled="False"
<dxg:TableView IsColumnMenuEnabled="False"
AllowEditing="True" ShowIndicator="False"
AllowEditing="True" ShowIndicator="False"
NavigationStyle="Cell"
NavigationStyle="Cell"
ShowVerticalLines="False"
ShowGroupPanel="False" EditorShowMode="MouseUp"
ShowGroupPanel="False" EditorShowMode="MouseUp"
AllowDragDrop="False"
AllowDragDrop="False"
ShowBandsPanel="False"
ShowBandsPanel="False"
...
...
VIZ.Package.Module/Preview/VizPreview/ViewModel/VizPreviewViewModel.cs
View file @
08d3b117
...
@@ -259,14 +259,10 @@ namespace VIZ.Package.Module
...
@@ -259,14 +259,10 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
private
void
Play
()
private
void
Play
()
{
{
this
.
Execute
(
this
.
Execute
((
obj
,
view
,
conn
)
=>
action
:
(
conn
)
=>
{
{
this
.
vizCommandService
.
Start
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
this
.
vizCommandService
.
Start
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
},
view
?.
PreviewIn
(
conn
);
pluginAction
:
(
view
,
conn
)
=>
{
view
.
PreviewIn
(
conn
);
});
});
}
}
...
@@ -284,14 +280,10 @@ namespace VIZ.Package.Module
...
@@ -284,14 +280,10 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
private
void
Continue
()
private
void
Continue
()
{
{
this
.
Execute
(
this
.
Execute
((
obj
,
view
,
conn
)
=>
action
:
(
conn
)
=>
{
{
this
.
vizCommandService
.
Continue
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
this
.
vizCommandService
.
Continue
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
},
view
?.
PreviewContinue
(
conn
);
pluginAction
:
(
view
,
conn
)
=>
{
view
.
PreviewContinue
(
conn
);
});
});
}
}
...
@@ -309,14 +301,10 @@ namespace VIZ.Package.Module
...
@@ -309,14 +301,10 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
private
void
Stop
()
private
void
Stop
()
{
{
this
.
Execute
(
this
.
Execute
((
obj
,
view
,
conn
)
=>
action
:
(
conn
)
=>
{
{
this
.
vizCommandService
.
Stop
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
this
.
vizCommandService
.
Stop
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
},
view
?.
PreviewOut
(
conn
);
pluginAction
:
(
view
,
conn
)
=>
{
view
.
PreviewOut
(
conn
);
});
});
}
}
...
@@ -489,6 +477,14 @@ namespace VIZ.Package.Module
...
@@ -489,6 +477,14 @@ namespace VIZ.Package.Module
return
;
return
;
VizConfigEntity
vizConfig
=
ApplicationDomainEx
.
VizConfig
;
VizConfigEntity
vizConfig
=
ApplicationDomainEx
.
VizConfig
;
ConnGroupModel
connGroup
=
ApplicationDomainEx
.
PreviewConnGroup
;
if
(
connGroup
==
null
)
{
connGroup
=
new
ConnGroupModel
();
connGroup
.
Name
=
"预览"
;
connGroup
.
IsEnabled
=
true
;
connGroup
.
IsLocalPreview
=
true
;
}
ConnModel
conn
=
ApplicationDomainEx
.
PreviewConn
;
ConnModel
conn
=
ApplicationDomainEx
.
PreviewConn
;
if
(
conn
!=
null
)
if
(
conn
!=
null
)
{
{
...
@@ -499,8 +495,13 @@ namespace VIZ.Package.Module
...
@@ -499,8 +495,13 @@ namespace VIZ.Package.Module
conn
.
IP
=
vizConfig
.
VIZ_IP
;
conn
.
IP
=
vizConfig
.
VIZ_IP
;
conn
.
Port
=
vizConfig
.
VIZ_Port
;
conn
.
Port
=
vizConfig
.
VIZ_Port
;
conn
.
Remark
=
"预览"
;
conn
.
Remark
=
"预览"
;
conn
.
InitEndpointManager
(
new
VizEndpointManager
(
"local"
,
vizConfig
.
VIZ_IP
,
vizConfig
.
VIZ_Port
));
conn
.
IsEnabled
=
true
;
conn
.
InitEndpointManager
(
connGroup
,
new
VizEndpointManager
(
"local"
,
vizConfig
.
VIZ_IP
,
vizConfig
.
VIZ_Port
));
connGroup
.
Items
.
Clear
();
connGroup
.
Items
.
Add
(
conn
);
ApplicationDomainEx
.
PreviewConnGroup
=
connGroup
;
ApplicationDomainEx
.
PreviewConn
=
conn
;
ApplicationDomainEx
.
PreviewConn
=
conn
;
string
path
=
null
;
string
path
=
null
;
...
@@ -521,52 +522,51 @@ namespace VIZ.Package.Module
...
@@ -521,52 +522,51 @@ namespace VIZ.Package.Module
/// <summary>
/// <summary>
/// 执行
/// 执行
/// </summary>
/// </summary>
/// <param name="action">播放行为</param>
/// <param name="action">行为</param>
/// <param name="pluginAction">插件行为</param>
private
void
Execute
(
Action
<
ControlObjectModel
,
IPluginView
,
ConnModel
>
action
)
private
void
Execute
(
Action
<
ConnModel
>
action
,
Action
<
IPluginView
,
ConnModel
>
pluginAction
)
{
{
//
引擎未准备好 || 当前没有选中的节目单项目 则不处理
//
是否拥有打开的页或模板页
if
(
!
this
.
IsEngineReady
||
ApplicationDomainEx
.
CurrentPage
==
null
)
if
(
ApplicationDomainEx
.
CurrentPage
==
null
)
return
;
return
;
// 预览连接为准备好
// 插件服务
if
(
ApplicationDomainEx
.
PreviewConn
==
null
||
!
ApplicationDomainEx
.
PreviewConn
.
IsConnected
)
IPluginService
pluginService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPluginService
>(
ViewServiceKeys
.
PLUGIN_SERVICE
);
return
;
if
(
pluginService
==
null
)
// Step 1. 播放行为
try
{
action
(
ApplicationDomainEx
.
PreviewConn
);
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
// Step 2. 插件行为
if
(!(
ApplicationDomainEx
.
CurrentPage
is
PageModel
page
))
return
;
return
;
if
(
string
.
IsNullOrWhiteSpace
(
page
.
PluginID
))
// 控制字段树服务
IFieldTreeService
fieldTreeService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IFieldTreeService
>(
ViewServiceKeys
.
FIELD_TREE_SERVICE
);
if
(
fieldTreeService
==
null
)
return
;
return
;
IPluginService
pluginService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPluginService
>(
ViewServiceKeys
.
PLUGIN_SERVICE
);
ControlObjectModel
controlObject
=
fieldTreeService
.
GetControlObject
();
if
(
pluginService
==
null
)
return
;
// 模板
if
(
ApplicationDomainEx
.
CurrentPage
is
PageTemplateModel
template
)
{
if
(
ApplicationDomainEx
.
PreviewConn
!=
null
&&
ApplicationDomainEx
.
PreviewConn
.
IsConnected
)
{
action
(
controlObject
,
null
,
ApplicationDomainEx
.
PreviewConn
);
}
}
// 页
else
if
(
ApplicationDomainEx
.
CurrentPage
is
PageModel
page
)
{
IPluginView
view
=
pluginService
.
GetCurrentPluginView
()
as
IPluginView
;
IPluginView
view
=
pluginService
.
GetCurrentPluginView
()
as
IPluginView
;
if
(
view
==
null
)
return
;
try
try
{
{
pluginAction
(
view
,
ApplicationDomainEx
.
PreviewConn
);
if
(
ApplicationDomainEx
.
PreviewConn
!=
null
&&
ApplicationDomainEx
.
PreviewConn
.
IsConnected
)
{
action
(
controlObject
,
view
,
ApplicationDomainEx
.
PreviewConn
);
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
log
.
Error
(
ex
);
log
.
Error
(
ex
);
}
}
}
}
}
/// <summary>
/// <summary>
/// 是否显示安全框改变
/// 是否显示安全框改变
...
...
VIZ.Package.Module/Setting/Conn/View/ConnSettingView.xaml
View file @
08d3b117
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<ResourceDictionary Source="/VIZ.Framework.Common.Resource;component/Style/GridSplitter/GridSplitter_None.xaml"></ResourceDictionary>
<ResourceDictionary Source="/VIZ.Framework.Common.Resource;component/Style/GridSplitter/GridSplitter_None.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary.MergedDictionaries>
<resource:RowHandleConverter x:Key="RowHandleConverter"></resource:RowHandleConverter>
<resource:RowHandleConverter x:Key="RowHandleConverter"></resource:RowHandleConverter>
<fcore:Bool2StringConverter x:Key="Bool2StringConverter" TrueResult="
启用
"></fcore:Bool2StringConverter>
<fcore:Bool2StringConverter x:Key="Bool2StringConverter" TrueResult="
默认
"></fcore:Bool2StringConverter>
</ResourceDictionary>
</ResourceDictionary>
</UserControl.Resources>
</UserControl.Resources>
...
@@ -33,11 +33,11 @@
...
@@ -33,11 +33,11 @@
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="
450
" MinWidth="450" MaxWidth="800"></ColumnDefinition>
<ColumnDefinition Width="
*
" MinWidth="450" MaxWidth="800"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<GroupBox Header="分组" Margin="
10,10,10,10" Padding="10
">
<GroupBox Header="分组" Margin="
5" Padding="5
">
<dxg:GridControl ItemsSource="{Binding Path=Groups}" ShowBorder="False"
<dxg:GridControl ItemsSource="{Binding Path=Groups}" ShowBorder="False"
SelectedItem="{Binding Path=SelectedGroup,Mode=TwoWay}">
SelectedItem="{Binding Path=SelectedGroup,Mode=TwoWay}">
<dxg:GridControl.ContextMenu>
<dxg:GridControl.ContextMenu>
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
<MenuItem Header="添加分组" Command="{Binding Path=PlacementTarget.DataContext.AddGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="添加分组" Command="{Binding Path=PlacementTarget.DataContext.AddGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="删除分组" Command="{Binding Path=PlacementTarget.DataContext.DeleteGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="删除分组" Command="{Binding Path=PlacementTarget.DataContext.DeleteGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator/>
<Separator/>
<MenuItem Header="
启用" Command="{Binding Path=PlacementTarget.DataContext.Enabled
GroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="
设为默认分组" Command="{Binding Path=PlacementTarget.DataContext.SetDefault
GroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
</ContextMenu>
</ContextMenu>
</dxg:GridControl.ContextMenu>
</dxg:GridControl.ContextMenu>
<dxg:GridControl.Columns>
<dxg:GridControl.Columns>
...
@@ -62,8 +62,13 @@
...
@@ -62,8 +62,13 @@
HorizontalContentAlignment="Left"></dxe:TextEditSettings>
HorizontalContentAlignment="Left"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridColumn>
<dxg:GridColumn Header="
是否启用" Width="80" Binding="{Binding IsEnabled
,Converter={StaticResource Bool2StringConverter}}"
<dxg:GridColumn Header="
默认分组" Width="80" Binding="{Binding IsDefault
,Converter={StaticResource Bool2StringConverter}}"
AllowSorting="False" AllowColumnFiltering="False" ReadOnly="True"></dxg:GridColumn>
AllowSorting="False" AllowColumnFiltering="False" ReadOnly="True"></dxg:GridColumn>
<dxg:GridColumn Header="是否启用" FieldName="IsEnabled" Width="80" AllowSorting="False" AllowColumnFiltering="False">
<dxg:GridColumn.EditSettings>
<dxe:CheckEditSettings></dxe:CheckEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Header="引擎类型" FieldName="EngineType" AllowSorting="False" AllowColumnFiltering="False"
<dxg:GridColumn Header="引擎类型" FieldName="EngineType" AllowSorting="False" AllowColumnFiltering="False"
ReadOnly="True"></dxg:GridColumn>
ReadOnly="True"></dxg:GridColumn>
</dxg:GridControl.Columns>
</dxg:GridControl.Columns>
...
@@ -71,7 +76,7 @@
...
@@ -71,7 +76,7 @@
<dxg:TableView AllowEditing="True" ShowIndicator="True"
<dxg:TableView AllowEditing="True" ShowIndicator="True"
IsColumnMenuEnabled="False"
IsColumnMenuEnabled="False"
ShowGroupPanelsForUngroupedDetails="False"
ShowGroupPanelsForUngroupedDetails="False"
NavigationStyle="Cell"
NavigationStyle="Cell"
ShowVerticalLines="False"
ShowGroupPanel="False"
ShowGroupPanel="False"
AllowDragDrop="False"
AllowDragDrop="False"
ShowBandsPanel="False"
ShowBandsPanel="False"
...
@@ -84,10 +89,10 @@
...
@@ -84,10 +89,10 @@
</dxg:GridControl>
</dxg:GridControl>
</GroupBox>
</GroupBox>
<GridSplitter HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="
10
"
<GridSplitter HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="
5
"
Style="{StaticResource GridSplitter_None}"></GridSplitter>
Style="{StaticResource GridSplitter_None}"></GridSplitter>
<GroupBox Header="项" Margin="
10" Padding="10
" Grid.Column="1">
<GroupBox Header="项" Margin="
5" Padding="5
" Grid.Column="1">
<dxg:GridControl ItemsSource="{Binding Path=SelectedGroup.Items}" ShowBorder="False" Grid.Column="1"
<dxg:GridControl ItemsSource="{Binding Path=SelectedGroup.Items}" ShowBorder="False" Grid.Column="1"
SelectedItem="{Binding Path=SelectedItem,Mode=TwoWay}">
SelectedItem="{Binding Path=SelectedItem,Mode=TwoWay}">
<dxg:GridControl.ContextMenu>
<dxg:GridControl.ContextMenu>
...
@@ -131,7 +136,7 @@
...
@@ -131,7 +136,7 @@
<dxg:GridControl.View>
<dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True"
<dxg:TableView AllowEditing="True" ShowIndicator="True"
IsColumnMenuEnabled="False"
IsColumnMenuEnabled="False"
NavigationStyle="Cell"
NavigationStyle="Cell"
ShowVerticalLines="False"
ShowGroupPanel="False"
ShowGroupPanel="False"
AllowDragDrop="False"
AllowDragDrop="False"
ShowBandsPanel="False"
ShowBandsPanel="False"
...
...
VIZ.Package.Module/Setting/Conn/ViewModel/ConnSettingViewModel.cs
View file @
08d3b117
...
@@ -36,7 +36,7 @@ namespace VIZ.Package.Module
...
@@ -36,7 +36,7 @@ namespace VIZ.Package.Module
this
.
LoadedCommand
=
new
VCommand
(
this
.
Loaded
);
this
.
LoadedCommand
=
new
VCommand
(
this
.
Loaded
);
this
.
AddGroupCommand
=
new
VCommand
(
this
.
AddGroup
);
this
.
AddGroupCommand
=
new
VCommand
(
this
.
AddGroup
);
this
.
DeleteGroupCommand
=
new
VCommand
(
this
.
DeleteGroup
);
this
.
DeleteGroupCommand
=
new
VCommand
(
this
.
DeleteGroup
);
this
.
EnabledGroupCommand
=
new
VCommand
(
this
.
Enabled
Group
);
this
.
SetDefaultGroupCommand
=
new
VCommand
(
this
.
SetDefault
Group
);
this
.
AddItemCommand
=
new
VCommand
(
this
.
AddItem
);
this
.
AddItemCommand
=
new
VCommand
(
this
.
AddItem
);
this
.
DeleteItemCommand
=
new
VCommand
(
this
.
DeleteItem
);
this
.
DeleteItemCommand
=
new
VCommand
(
this
.
DeleteItem
);
}
}
...
@@ -162,24 +162,24 @@ namespace VIZ.Package.Module
...
@@ -162,24 +162,24 @@ namespace VIZ.Package.Module
#
endregion
#
endregion
#
region
Enabled
GroupCommand
--
启用组命令
#
region
SetDefault
GroupCommand
--
启用组命令
/// <summary>
/// <summary>
///
启用
组命令
///
设置默认分
组命令
/// </summary>
/// </summary>
public
VCommand
Enabled
GroupCommand
{
get
;
set
;
}
public
VCommand
SetDefault
GroupCommand
{
get
;
set
;
}
/// <summary>
/// <summary>
///
启用
组
///
设置默认分
组
/// </summary>
/// </summary>
private
void
Enabled
Group
()
private
void
SetDefault
Group
()
{
{
if
(
this
.
SelectedGroup
==
null
)
if
(
this
.
SelectedGroup
==
null
)
return
;
return
;
foreach
(
var
group
in
this
.
Groups
)
foreach
(
var
group
in
this
.
Groups
)
{
{
group
.
Is
Enabled
=
group
==
this
.
SelectedGroup
;
group
.
Is
Default
=
group
==
this
.
SelectedGroup
;
}
}
}
}
...
@@ -243,14 +243,10 @@ namespace VIZ.Package.Module
...
@@ -243,14 +243,10 @@ namespace VIZ.Package.Module
// 保存配置
// 保存配置
this
.
connService
.
SaveGroups
(
this
.
Groups
);
this
.
connService
.
SaveGroups
(
this
.
Groups
);
ConnGroupModel
oldGroup
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
IsEnabled
);
ConnGroupModel
newGroup
=
this
.
Groups
.
FirstOrDefault
(
p
=>
p
.
IsEnabled
);
ApplicationDomainEx
.
ConnGroups
=
this
.
Groups
.
ToList
();
ApplicationDomainEx
.
ConnGroups
=
this
.
Groups
.
ToList
();
// 发送连接改变消息
// 发送连接改变消息
ConnChangedMessage
msg
=
new
ConnChangedMessage
();
ConnChangedMessage
msg
=
new
ConnChangedMessage
();
msg
.
OldGroup
=
oldGroup
;
msg
.
NewGroup
=
newGroup
;
ApplicationDomainEx
.
MessageManager
.
Send
(
msg
);
ApplicationDomainEx
.
MessageManager
.
Send
(
msg
);
}
}
}
}
...
...
VIZ.Package.Service/DB/Page/PageService.cs
View file @
08d3b117
...
@@ -121,6 +121,7 @@ namespace VIZ.Package.Service
...
@@ -121,6 +121,7 @@ namespace VIZ.Package.Service
model
.
Order
=
entity
.
Order
;
model
.
Order
=
entity
.
Order
;
model
.
PluginName
=
ApplicationDomainEx
.
PluginInfos
.
FirstOrDefault
(
p
=>
p
.
ID
==
entity
.
PluginID
)?.
Name
;
model
.
PluginName
=
ApplicationDomainEx
.
PluginInfos
.
FirstOrDefault
(
p
=>
p
.
ID
==
entity
.
PluginID
)?.
Name
;
model
.
PageNum
=
entity
.
PageNum
;
model
.
PageNum
=
entity
.
PageNum
;
model
.
ConnGroupID
=
entity
.
ConnGroupID
;
groupModel
.
Pages
.
Add
(
model
);
groupModel
.
Pages
.
Add
(
model
);
}
}
...
@@ -177,6 +178,7 @@ namespace VIZ.Package.Service
...
@@ -177,6 +178,7 @@ namespace VIZ.Package.Service
pageEntity
.
TemplateID
=
pageModel
.
TemplateID
;
pageEntity
.
TemplateID
=
pageModel
.
TemplateID
;
pageEntity
.
PluginID
=
pageModel
.
PluginID
;
pageEntity
.
PluginID
=
pageModel
.
PluginID
;
pageEntity
.
PageNum
=
pageModel
.
PageNum
;
pageEntity
.
PageNum
=
pageModel
.
PageNum
;
pageEntity
.
ConnGroupID
=
pageModel
.
ConnGroupID
;
pageEntity
.
Order
=
j
;
pageEntity
.
Order
=
j
;
pages
.
Add
(
pageEntity
);
pages
.
Add
(
pageEntity
);
...
...
VIZ.Package.Storage/Entity/Page/PageEntity.cs
View file @
08d3b117
...
@@ -36,5 +36,10 @@ namespace VIZ.Package.Storage
...
@@ -36,5 +36,10 @@ namespace VIZ.Package.Storage
/// 页号
/// 页号
/// </summary>
/// </summary>
public
int
PageNum
{
get
;
set
;
}
public
int
PageNum
{
get
;
set
;
}
/// <summary>
/// 连接分组ID
/// </summary>
public
Guid
ConnGroupID
{
get
;
set
;
}
}
}
}
}
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