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
88c5bb42
Commit
88c5bb42
authored
Mar 02, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
切换场景支持
parent
8751edaf
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
563 additions
and
37 deletions
+563
-37
VIZ.Package.Module/Control/Controller/ControlController.cs
+210
-0
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
+29
-31
VIZ.Package.Module/Page/Group/Controller/PageModelCopyController.cs
+4
-0
VIZ.Package.Module/Page/Group/View/PageAddWindow.xaml
+21
-1
VIZ.Package.Module/Page/Group/View/PageGroupView.xaml
+45
-2
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
+1
-0
VIZ.Package.Module/Page/Templage/View/PageTemplateView.xaml
+44
-2
VIZ.Package.Module/VIZ.Package.Module.csproj
+1
-0
VIZ.Package.Service/Viz/VizCommandControlObjectService.cs
+78
-0
VIZ.Package.Service/Viz/VizCommandService.cs
+130
-1
No files found.
VIZ.Package.Module/Control/Controller/ControlController.cs
0 → 100644
View file @
88c5bb42
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Service
;
using
VIZ.Package.Storage
;
namespace
VIZ.Package.Module
{
/// <summary>
/// 播出控制控制器
/// </summary>
public
class
ControlController
{
/// <summary>
/// 日志
/// </summary>
private
readonly
static
ILog
log
=
LogManager
.
GetLogger
(
typeof
(
ControlController
));
/// <summary>
/// Viz命令服务
/// </summary>
private
VizCommandService
vizCommandService
=
new
VizCommandService
();
/// <summary>
/// Viz控制对象命令服务
/// </summary>
private
VizCommandControlObjectService
vizCommandControlObjectService
=
new
VizCommandControlObjectService
();
// ---------------------------------------------------------------------------
// 上版
/// <summary>
/// 上版 -- 正常板子
/// </summary>
/// <param name="obj">控制对象</param>
/// <param name="view">插件视图</param>
/// <param name="conn">连接</param>
public
void
TakeNormal
(
ControlObjectModel
obj
,
IPluginView
view
,
ConnModel
conn
)
{
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
false
);
try
{
this
.
vizCommandService
.
SetObject
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
ScenePath
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
if
(
obj
!=
null
)
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
this
.
vizCommandControlObjectService
.
SetCustomControlFieldValue
(
conn
,
obj
.
AllFiledNodes
);
}
if
(
view
!=
null
)
{
view
.
TakIn
(
conn
);
}
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
this
.
vizCommandService
.
Start
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
}
/// <summary>
/// 上版 -- 切换逻辑
/// </summary>
/// <param name="obj">控制对象</param>
/// <param name="view">插件视图</param>
/// <param name="conn">连接</param>
public
void
TakeTransitionLogic
(
ControlObjectModel
obj
,
IPluginView
view
,
ConnModel
conn
)
{
string
scenePathDir
=
ApplicationDomainEx
.
CurrentPage
.
ScenePath
.
Substring
(
0
,
ApplicationDomainEx
.
CurrentPage
.
ScenePath
.
LastIndexOf
(
'/'
));
string
bgScenePath
=
$"
{
scenePathDir
}
/
{
ApplicationDomainEx
.
CurrentPage
.
BackgroundScene
}
"
;
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
this
.
vizCommandService
.
SetObject
(
conn
,
bgScenePath
,
VizLayer
.
MAIN_LAYER
);
this
.
vizCommandService
.
ToggleResetWithTransitionLogic
(
conn
,
ApplicationDomainEx
.
CurrentPage
);
this
.
vizCommandService
.
ToggleSetGeomWithTransitionLogic
(
conn
,
ApplicationDomainEx
.
CurrentPage
);
if
(
obj
!=
null
)
{
this
.
vizCommandControlObjectService
.
SetControlObjectOtherWithTransitionLogic
(
conn
,
obj
,
ApplicationDomainEx
.
CurrentPage
);
this
.
vizCommandControlObjectService
.
SetCustomControlObjectWithTransitionLogic
(
conn
,
obj
,
ApplicationDomainEx
.
CurrentPage
);
}
if
(
view
!=
null
)
{
view
.
TakIn
(
conn
);
}
this
.
vizCommandService
.
DirectorShowWithTransitionLogic
(
conn
,
ApplicationDomainEx
.
CurrentPage
);
this
.
vizCommandService
.
DirectorGotoTrioWithTransitionLogic
(
conn
,
ApplicationDomainEx
.
CurrentPage
,
"O"
,
ApplicationDomainEx
.
CurrentPage
.
StateIdentifier
);
}
// ---------------------------------------------------------------------------
// 继续
/// <summary>
/// 继续 -- 正常板子
/// </summary>
/// <param name="obj">控制对象</param>
/// <param name="view">插件视图</param>
/// <param name="conn">连接</param>
public
void
ContinueNormal
(
ControlObjectModel
obj
,
IPluginView
view
,
ConnModel
conn
)
{
this
.
vizCommandService
.
TakeContinue
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
view
?.
TakeContinue
(
conn
);
}
/// <summary>
/// 继续 -- 切换逻辑
/// </summary>
/// <param name="obj">控制对象</param>
/// <param name="view">插件视图</param>
/// <param name="conn">连接</param>
public
void
ContinueTransitionLogic
(
ControlObjectModel
obj
,
IPluginView
view
,
ConnModel
conn
)
{
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
this
.
vizCommandService
.
ToggleContinueWithTransitionLogic
(
conn
,
ApplicationDomainEx
.
CurrentPage
);
if
(
view
!=
null
)
{
view
.
TakeContinue
(
conn
);
}
}
// ---------------------------------------------------------------------------
// 下板
/// <summary>
/// 下板 -- 正常板子
/// </summary>
/// <param name="obj">控制对象</param>
/// <param name="view">插件视图</param>
/// <param name="conn">连接</param>
public
void
TakeOutNormal
(
ControlObjectModel
obj
,
IPluginView
view
,
ConnModel
conn
)
{
this
.
vizCommandService
.
TakeOut
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
view
?.
TakeOut
(
conn
);
}
/// <summary>
/// 下板 -- 切换逻辑
/// </summary>
/// <param name="obj">控制对象</param>
/// <param name="view">插件视图</param>
/// <param name="conn">连接</param>
public
void
TakeOutTransitionLogic
(
ControlObjectModel
obj
,
IPluginView
view
,
ConnModel
conn
)
{
string
scenePathDir
=
ApplicationDomainEx
.
CurrentPage
.
ScenePath
.
Substring
(
0
,
ApplicationDomainEx
.
CurrentPage
.
ScenePath
.
LastIndexOf
(
'/'
));
string
bgScenePath
=
$"
{
scenePathDir
}
/
{
ApplicationDomainEx
.
CurrentPage
.
BackgroundScene
}
"
;
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
this
.
vizCommandService
.
SetObject
(
conn
,
bgScenePath
,
VizLayer
.
MAIN_LAYER
);
this
.
vizCommandService
.
ToggleSetWithTransitionLogic
(
conn
,
ApplicationDomainEx
.
CurrentPage
);
this
.
vizCommandService
.
DirectorGotoTrioWithTransitionLogic
(
conn
,
ApplicationDomainEx
.
CurrentPage
,
ApplicationDomainEx
.
CurrentPage
.
StateIdentifier
,
"O"
);
view
?.
TakeOut
(
conn
);
}
// ---------------------------------------------------------------------------
// 更新
/// <summary>
/// 更新 -- 正常板子
/// </summary>
/// <param name="obj">控制对象</param>
/// <param name="view">插件视图</param>
/// <param name="conn">连接</param>
public
void
UpdateNormal
(
ControlObjectModel
obj
,
IPluginView
view
,
ConnModel
conn
)
{
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
false
);
try
{
if
(
obj
!=
null
)
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
this
.
vizCommandControlObjectService
.
SetCustomControlFieldValue
(
conn
,
obj
.
AllFiledNodes
);
}
view
?.
TakeUpdate
(
conn
);
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
}
/// <summary>
/// 更新 -- 切换逻辑
/// </summary>
/// <param name="obj">控制对象</param>
/// <param name="view">插件视图</param>
/// <param name="conn">连接</param>
public
void
UpdateTransitionLogic
(
ControlObjectModel
obj
,
IPluginView
view
,
ConnModel
conn
)
{
string
scenePathDir
=
ApplicationDomainEx
.
CurrentPage
.
ScenePath
.
Substring
(
0
,
ApplicationDomainEx
.
CurrentPage
.
ScenePath
.
LastIndexOf
(
'/'
));
string
bgScenePath
=
$"
{
scenePathDir
}
/
{
ApplicationDomainEx
.
CurrentPage
.
BackgroundScene
}
"
;
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
this
.
vizCommandService
.
SetObject
(
conn
,
bgScenePath
,
VizLayer
.
MAIN_LAYER
);
if
(
obj
!=
null
)
{
this
.
vizCommandControlObjectService
.
SetControlObjectCurrentWithTransitionLogic
(
conn
,
obj
,
ApplicationDomainEx
.
CurrentPage
);
this
.
vizCommandControlObjectService
.
SetCustomControlObjectWithTransitionLogic
(
conn
,
obj
,
ApplicationDomainEx
.
CurrentPage
);
}
if
(
view
!=
null
)
{
view
.
TakeUpdate
(
conn
);
}
}
}
}
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
View file @
88c5bb42
...
...
@@ -73,6 +73,11 @@ namespace VIZ.Package.Module
/// </summary>
private
RecordLogService
recordLogService
=
new
RecordLogService
();
/// <summary>
/// 播出控制器
/// </summary>
private
ControlController
controlController
=
new
ControlController
();
// ==============================================================
// Property
// ==============================================================
...
...
@@ -108,26 +113,14 @@ namespace VIZ.Package.Module
this
.
Execute
(
action
:
(
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
false
);
try
if
(
obj
.
TransitionLogic
)
{
this
.
vizCommandService
.
SetObject
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
ScenePath
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
if
(
obj
!=
null
)
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
this
.
vizCommandControlObjectService
.
SetCustomControlFieldValue
(
conn
,
obj
.
AllFiledNodes
);
}
if
(
view
!=
null
)
{
view
.
TakIn
(
conn
);
}
this
.
controlController
.
TakeTransitionLogic
(
obj
,
view
,
conn
);
}
catch
(
Exception
ex
)
else
{
log
.
Error
(
ex
);
this
.
controlController
.
TakeNormal
(
obj
,
view
,
conn
);
}
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
this
.
vizCommandService
.
Start
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
},
over
:
()
=>
{
...
...
@@ -169,8 +162,14 @@ namespace VIZ.Package.Module
this
.
Execute
(
action
:
(
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
TakeContinue
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
view
?.
TakeContinue
(
conn
);
if
(
obj
.
TransitionLogic
)
{
this
.
controlController
.
ContinueTransitionLogic
(
obj
,
view
,
conn
);
}
else
{
this
.
controlController
.
ContinueNormal
(
obj
,
view
,
conn
);
}
},
over
:
null
);
}
...
...
@@ -195,8 +194,14 @@ namespace VIZ.Package.Module
this
.
Execute
(
action
:
(
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
TakeOut
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
view
?.
TakeOut
(
conn
);
if
(
obj
.
TransitionLogic
)
{
this
.
controlController
.
TakeOutTransitionLogic
(
obj
,
view
,
conn
);
}
else
{
this
.
controlController
.
TakeOutNormal
(
obj
,
view
,
conn
);
}
},
over
:
()
=>
{
...
...
@@ -241,21 +246,14 @@ namespace VIZ.Package.Module
this
.
Execute
(
action
:
(
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
false
);
try
if
(
obj
.
TransitionLogic
)
{
if
(
obj
!=
null
)
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
this
.
vizCommandControlObjectService
.
SetCustomControlFieldValue
(
conn
,
obj
.
AllFiledNodes
);
}
view
?.
TakeUpdate
(
conn
);
this
.
controlController
.
UpdateTransitionLogic
(
obj
,
view
,
conn
);
}
catch
(
Exception
ex
)
else
{
log
.
Error
(
ex
);
this
.
controlController
.
UpdateNormal
(
obj
,
view
,
conn
);
}
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
},
over
:
null
);
}
...
...
VIZ.Package.Module/Page/Group/Controller/PageModelCopyController.cs
View file @
88c5bb42
...
...
@@ -74,6 +74,10 @@ namespace VIZ.Package.Module
page
.
PluginID
=
vm
.
SelectedTemplatePlugin
?.
ID
;
page
.
PluginName
=
vm
.
SelectedTemplatePlugin
?.
Name
;
page
.
PageNum
=
pageGroup
.
Pages
.
Count
==
0
?
1
:
(
pageGroup
.
Pages
.
MaxOrDefault
(
p
=>
p
.
PageNum
)
+
1
);
page
.
TransitionLogic
=
template
.
TransitionLogic
;
page
.
LayerIdentifier
=
template
.
LayerIdentifier
;
page
.
StateIdentifier
=
template
.
StateIdentifier
;
page
.
BackgroundScene
=
template
.
BackgroundScene
;
// 关联连接分组
ConnGroupModel
conn
=
ApplicationDomainEx
.
ConnGroups
?.
FirstOrDefault
(
p
=>
p
.
IsDefault
);
...
...
VIZ.Package.Module/Page/Group/View/PageAddWindow.xaml
View file @
88c5bb42
...
...
@@ -22,7 +22,27 @@
<fcore:Bool2ControlTemplateConverter x:Key="Bool2ControlTemplateConverter_Layer">
<fcore:Bool2ControlTemplateConverter.TrueResult>
<ControlTemplate>
<dxe:TextEdit EditValue="{Binding Path=LayerIdentifier}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2,0,2,0" IsReadOnly="True"></dxe:TextEdit>
<dxe:TextEdit EditValue="{Binding Path=LayerIdentifier}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="2,0,2,0" IsReadOnly="True">
<dxe:TextEdit.ToolTip>
<Grid Height="75" MinWidth="220">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Layer identifier:" Foreground="#88ffffff" HorizontalAlignment="Right"></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=Row.LayerIdentifier,Mode=OneWay}" Margin="10,0,10,0"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="0" Text="State identifier:" Foreground="#88ffffff" HorizontalAlignment="Right"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=Row.StateIdentifier,Mode=OneWay}" Margin="10,0,10,0"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="0" Text="Background scene:" Foreground="#88ffffff" HorizontalAlignment="Right"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=Row.BackgroundScene,Mode=OneWay}" Margin="10,0,10,0"></TextBlock>
</Grid>
</dxe:TextEdit.ToolTip>
</dxe:TextEdit>
</ControlTemplate>
</fcore:Bool2ControlTemplateConverter.TrueResult>
<fcore:Bool2ControlTemplateConverter.FalseResult>
...
...
VIZ.Package.Module/Page/Group/View/PageGroupView.xaml
View file @
88c5bb42
...
...
@@ -42,10 +42,32 @@
<fcore:Bool2BoolConverter x:Key="Bool2BoolConverter"></fcore:Bool2BoolConverter>
<!-- 层模板 -->
<!-- 层模板 -->
<fcore:Bool2ControlTemplateConverter x:Key="Bool2ControlTemplateConverter_LayerColumnCellTemplate">
<fcore:Bool2ControlTemplateConverter.TrueResult>
<ControlTemplate>
<TextBlock Text="{Binding Path=Row.LayerIdentifier}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="4,0,4,0"></TextBlock>
<Border Background="Transparent">
<TextBlock Text="{Binding Path=Row.LayerIdentifier}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="4,0,4,0"></TextBlock>
<Border.ToolTip>
<Grid Height="75" MinWidth="220">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Layer identifier:" Foreground="#88ffffff" HorizontalAlignment="Right"></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=Row.LayerIdentifier,Mode=OneWay}" Margin="10,0,10,0"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="0" Text="State identifier:" Foreground="#88ffffff" HorizontalAlignment="Right"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=Row.StateIdentifier,Mode=OneWay}" Margin="10,0,10,0"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="0" Text="Background scene:" Foreground="#88ffffff" HorizontalAlignment="Right"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=Row.BackgroundScene,Mode=OneWay}" Margin="10,0,10,0"></TextBlock>
</Grid>
</Border.ToolTip>
</Border>
</ControlTemplate>
</fcore:Bool2ControlTemplateConverter.TrueResult>
<fcore:Bool2ControlTemplateConverter.FalseResult>
...
...
@@ -58,7 +80,28 @@
<fcore:Bool2ControlTemplateConverter x:Key="Bool2ControlTemplateConverter_LayerColumnCellEditTemplate">
<fcore:Bool2ControlTemplateConverter.TrueResult>
<ControlTemplate>
<TextBlock Text="{Binding Path=Row.LayerIdentifier}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="4,0,4,0"></TextBlock>
<Border Background="Transparent">
<TextBlock Text="{Binding Path=Row.LayerIdentifier}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="4,0,4,0"></TextBlock>
<Border.ToolTip>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Layer identifier:" Foreground="#aaffffff"></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=Row.LayerIdentifier,Mode=OneWay}"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="0" Text="State identifier:" Foreground="#aaffffff"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=Row.StateIdentifier,Mode=OneWay}"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="0" Text="Background scene:" Foreground="#aaffffff"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=Row.BackgroundScene,Mode=OneWay}"></TextBlock>
</Grid>
</Border.ToolTip>
</Border>
</ControlTemplate>
</fcore:Bool2ControlTemplateConverter.TrueResult>
<fcore:Bool2ControlTemplateConverter.FalseResult>
...
...
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
View file @
88c5bb42
...
...
@@ -1002,6 +1002,7 @@ namespace VIZ.Package.Module
// 根据模板拷贝页
PageModel
destPage
=
this
.
pageModelCopyController
.
CopyPage
(
template
,
vm
,
this
.
SelectedPageGroupModel
);
// 页码
destPage
.
PageNum
=
this
.
SelectedPageGroupModel
.
Pages
.
MaxOrDefault
(
p
=>
p
.
PageNum
)
+
1
;
...
...
VIZ.Package.Module/Page/Templage/View/PageTemplateView.xaml
View file @
88c5bb42
...
...
@@ -39,7 +39,28 @@
<fcore:Bool2ControlTemplateConverter x:Key="Bool2ControlTemplateConverter_LayerColumnCellTemplate">
<fcore:Bool2ControlTemplateConverter.TrueResult>
<ControlTemplate>
<TextBlock Text="{Binding Path=Row.LayerIdentifier}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="4,0,4,0"></TextBlock>
<Border Background="Transparent">
<TextBlock Text="{Binding Path=Row.LayerIdentifier}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="4,0,4,0"></TextBlock>
<Border.ToolTip>
<Grid Height="75" MinWidth="220">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Layer identifier:" Foreground="#88ffffff" HorizontalAlignment="Right"></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=Row.LayerIdentifier,Mode=OneWay}" Margin="10,0,10,0"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="0" Text="State identifier:" Foreground="#88ffffff" HorizontalAlignment="Right"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=Row.StateIdentifier,Mode=OneWay}" Margin="10,0,10,0"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="0" Text="Background scene:" Foreground="#88ffffff" HorizontalAlignment="Right"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=Row.BackgroundScene,Mode=OneWay}" Margin="10,0,10,0"></TextBlock>
</Grid>
</Border.ToolTip>
</Border>
</ControlTemplate>
</fcore:Bool2ControlTemplateConverter.TrueResult>
<fcore:Bool2ControlTemplateConverter.FalseResult>
...
...
@@ -52,7 +73,28 @@
<fcore:Bool2ControlTemplateConverter x:Key="Bool2ControlTemplateConverter_LayerColumnCellEditTemplate">
<fcore:Bool2ControlTemplateConverter.TrueResult>
<ControlTemplate>
<TextBlock Text="{Binding Path=Row.LayerIdentifier}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="4,0,4,0"></TextBlock>
<Border Background="Transparent">
<TextBlock Text="{Binding Path=Row.LayerIdentifier}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="4,0,4,0"></TextBlock>
<Border.ToolTip>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="Layer identifier:" Foreground="#aaffffff"></TextBlock>
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Path=Row.LayerIdentifier,Mode=OneWay}"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="0" Text="State identifier:" Foreground="#aaffffff"></TextBlock>
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=Row.StateIdentifier,Mode=OneWay}"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="0" Text="Background scene:" Foreground="#aaffffff"></TextBlock>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=Row.BackgroundScene,Mode=OneWay}"></TextBlock>
</Grid>
</Border.ToolTip>
</Border>
</ControlTemplate>
</fcore:Bool2ControlTemplateConverter.TrueResult>
<fcore:Bool2ControlTemplateConverter.FalseResult>
...
...
VIZ.Package.Module/VIZ.Package.Module.csproj
View file @
88c5bb42
...
...
@@ -111,6 +111,7 @@
<Compile Include="ControlObject\FieldEdit\Edit\ListEdit\CellEdit\FontListCellEdit.xaml.cs">
<DependentUpon>FontListCellEdit.xaml</DependentUpon>
</Compile>
<Compile Include="Control\Controller\ControlController.cs" />
<Compile Include="Control\Service\IControlService.cs" />
<Compile Include="Help\About\ViewModel\AboutCustomControlFieldWindowModel.cs" />
<Compile Include="Help\About\View\AboutCustomControlFieldWindow.xaml.cs">
...
...
VIZ.Package.Service/Viz/VizCommandControlObjectService.cs
View file @
88c5bb42
...
...
@@ -8,6 +8,7 @@ using System.Text;
using
System.Threading.Tasks
;
using
System.Web.UI.WebControls
;
using
System.Xml.Linq
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Storage
;
...
...
@@ -407,6 +408,83 @@ namespace VIZ.Package.Service
}
}
// --------------------------------------------------------------------------------------------------
// 切换场景
/// <summary>
/// 设置切换逻辑的控制对象值
/// </summary>
/// <param name="conn">连接</param>
/// <param name="obj">控制对象</param>
/// <param name="pageBase">页</param>
public
void
SetControlObjectOtherWithTransitionLogic
(
ConnModel
conn
,
ControlObjectModel
obj
,
PageModelBase
pageBase
)
{
string
scenePathDir
=
pageBase
.
ScenePath
.
Substring
(
0
,
pageBase
.
ScenePath
.
LastIndexOf
(
'/'
));
string
bgScenePath
=
$"
{
scenePathDir
}
/
{
pageBase
.
BackgroundScene
}
"
;
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$"SCENE*
{
bgScenePath
}
*TREE*$
{
pageBase
.
LayerIdentifier
}
$other$object*FUNCTION*ControlObject*in SET ON "
);
foreach
(
ControlFieldNodeModel
field
in
obj
.
AllFiledNodes
)
{
// 自定义字段不通过该方法上板
if
(
field
.
IsCustom
)
continue
;
sb
.
Append
(
$"
{
field
.
FieldIdentifier
}
SET
{
field
.
Value
}
\\0"
);
}
conn
.
EndpointManager
.
Send
(
sb
.
ToString
());
}
/// <summary>
/// 设置切换逻辑的控制对象值
/// </summary>
/// <param name="conn">连接</param>
/// <param name="obj">控制对象</param>
/// <param name="pageBase">页</param>
public
void
SetControlObjectCurrentWithTransitionLogic
(
ConnModel
conn
,
ControlObjectModel
obj
,
PageModelBase
pageBase
)
{
string
scenePathDir
=
pageBase
.
ScenePath
.
Substring
(
0
,
pageBase
.
ScenePath
.
LastIndexOf
(
'/'
));
string
bgScenePath
=
$"
{
scenePathDir
}
/
{
pageBase
.
BackgroundScene
}
"
;
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$"SCENE*
{
bgScenePath
}
*TREE*$
{
pageBase
.
LayerIdentifier
}
$current$object*FUNCTION*ControlObject*in SET ON "
);
foreach
(
ControlFieldNodeModel
field
in
obj
.
AllFiledNodes
)
{
// 自定义字段不通过该方法上板
if
(
field
.
IsCustom
)
continue
;
sb
.
Append
(
$"
{
field
.
FieldIdentifier
}
SET
{
field
.
Value
}
\\0"
);
}
conn
.
EndpointManager
.
Send
(
sb
.
ToString
());
}
/// <summary>
/// 设置切换逻辑的控制对象值
/// </summary>
/// <param name="conn">连接</param>
/// <param name="obj">控制对象</param>
/// <param name="pageBase">页</param>
public
void
SetCustomControlObjectWithTransitionLogic
(
ConnModel
conn
,
ControlObjectModel
obj
,
PageModelBase
pageBase
)
{
if
(
obj
.
AllFiledNodes
==
null
||
obj
.
AllFiledNodes
.
Count
==
0
)
return
;
List
<
ControlFieldNodeModel
>
list
=
obj
.
AllFiledNodes
.
Where
(
p
=>
p
.
IsCustom
).
ToList
();
if
(
list
.
Count
==
0
)
return
;
// FieldIdentifier|Value*FieldIdentifier|Value
List
<
string
>
field_infos
=
list
.
Select
(
p
=>
string
.
Format
(
"{0}|{1}"
,
p
.
FieldIdentifier
,
p
.
Value
)).
ToList
();
string
command
=
string
.
Join
(
"*"
,
field_infos
);
conn
.
EndpointManager
.
Send
(
string
.
Format
(
VizEngineCommands
.
SCRIPT_INVOKE
,
ApplicationConstants
.
VIZ_COMMAND_CUSTOM_CONTROL_FIELD_SET
,
command
));
}
/// <summary>
/// 获取控制字段类型
/// </summary>
...
...
VIZ.Package.Service/Viz/VizCommandService.cs
View file @
88c5bb42
...
...
@@ -24,7 +24,9 @@ namespace VIZ.Package.Service
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
// 需要等待结果
if
(
string
.
IsNullOrWhiteSpace
(
scene
))
throw
new
ArgumentNullException
(
nameof
(
scene
));
conn
.
EndpointManager
.
Request
(
$"RENDERER*
{
layer
}
SET_OBJECT SCENE*
{
scene
}
"
);
}
...
...
@@ -35,6 +37,9 @@ namespace VIZ.Package.Service
/// <param name="scene">场景</param>
public
void
Reload
(
ConnModel
conn
,
string
scene
)
{
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
conn
.
EndpointManager
.
Send
(
$"SCENE**
{
scene
}
RELOAD"
);
}
...
...
@@ -304,6 +309,7 @@ namespace VIZ.Package.Service
return
sceneName
;
}
/// <summary>
/// 清理页
/// </summary>
...
...
@@ -331,5 +337,128 @@ namespace VIZ.Package.Service
{
return
conn
.
EndpointManager
.
Request
(
$"SCENE*
{
scene
}
LOAD"
);
}
// --------------------------------------------------------------------------------------------------
// 切换场景
/// <summary>
/// 动画显示
/// </summary>
/// <param name="conn">连接</param>
/// <param name="pageBase">页</param>
public
void
DirectorShowWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
)
{
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*STAGE*DIRECTOR*
{
pageBase
.
LayerIdentifier
}
SHOW $
{
pageBase
.
StateIdentifier
}
"
);
}
/// <summary>
/// 动画切换
/// </summary>
/// <param name="conn">连接</param>
/// <param name="pageBase">页</param>
/// <param name="from">开始</param>
/// <param name="to">结束</param>
public
void
DirectorGotoTrioWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
,
string
from
,
string
to
)
{
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*STAGE*DIRECTOR*
{
pageBase
.
LayerIdentifier
}
GOTO_TRIO $
{
from
}
$
{
to
}
"
);
}
/// <summary>
/// 设置切换逻辑层的GEOM
/// </summary>
/// <param name="conn">连接</param>
/// <param name="pageBase">页</param>
public
void
ToggleSetGeomWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
)
{
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
string
scenePathDir
=
pageBase
.
ScenePath
.
Substring
(
0
,
pageBase
.
ScenePath
.
LastIndexOf
(
'/'
));
string
bgScenePath
=
$"
{
scenePathDir
}
/
{
pageBase
.
BackgroundScene
}
"
;
conn
.
EndpointManager
.
Send
(
$"SCENE*
{
bgScenePath
}
*TREE*$
{
pageBase
.
LayerIdentifier
}
*FUNCTION*Toggle*object SET GEOM*
{
pageBase
.
ScenePath
}
"
);
}
/// <summary>
/// 设置切换逻辑层的对象
/// </summary>
/// <param name="conn">连接</param>
/// <param name="pageBase">页</param>
public
void
ToggleSetWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
)
{
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
string
scenePathDir
=
pageBase
.
ScenePath
.
Substring
(
0
,
pageBase
.
ScenePath
.
LastIndexOf
(
'/'
));
string
bgScenePath
=
$"
{
scenePathDir
}
/
{
pageBase
.
BackgroundScene
}
"
;
conn
.
EndpointManager
.
Send
(
$"SCENE*
{
bgScenePath
}
*TREE*$
{
pageBase
.
LayerIdentifier
}
*FUNCTION*Toggle*object SET"
);
}
/// <summary>
/// 触发切换
/// </summary>
/// <param name="conn">连接</param>
/// <param name="pageBase">页</param>
public
void
ToggleSwitchWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
)
{
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*TREE*$
{
pageBase
.
LayerIdentifier
}
*FUNCTION*Toggle*switch INVOKE"
);
}
/// <summary>
/// 触发重置
/// </summary>
/// <param name="conn">连接</param>
/// <param name="pageBase">页</param>
public
void
ToggleResetWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
)
{
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*TREE*$
{
pageBase
.
LayerIdentifier
}
*FUNCTION*Toggle*reset_current INVOKE"
);
}
/// <summary>
/// 触发继续
/// </summary>
/// <param name="conn">连接</param>
/// <param name="pageBase">页</param>
public
void
ToggleContinueWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
)
{
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*TREE*$
{
pageBase
.
LayerIdentifier
}
*FUNCTION*Toggle*continue INVOKE"
);
}
}
}
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