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
c0d3cd8e
Commit
c0d3cd8e
authored
Mar 08, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
切换场景逻辑
parent
d0c67204
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
363 additions
and
52 deletions
+363
-52
VIZ.Package.Domain/ApplicationConstants.cs
+5
-0
VIZ.Package.Domain/ApplicationDomainEx.Action.cs
+64
-0
VIZ.Package.Domain/ApplicationDomainEx.cs
+8
-0
VIZ.Package.Domain/Expand/PageModelExpand.cs
+48
-0
VIZ.Package.Domain/Model/Scene/TransitionLogicLayerInfo.cs
+99
-0
VIZ.Package.Domain/Model/Scene/TransitionLogicModel.cs
+29
-0
VIZ.Package.Domain/Model/Scene/TransitionLogicSceneInfoModel.cs
+29
-0
VIZ.Package.Domain/VIZ.Package.Domain.csproj
+4
-0
VIZ.Package.Module/Control/Controller/ControlController.cs
+0
-0
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
+8
-8
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
+9
-0
VIZ.Package.Service/DB/RecordLog/RecordLogWriter.cs
+1
-1
VIZ.Package.Service/Viz/VizCommandControlObjectService.cs
+25
-18
VIZ.Package.Service/Viz/VizCommandService.cs
+34
-25
No files found.
VIZ.Package.Domain/ApplicationConstants.cs
View file @
c0d3cd8e
...
@@ -48,6 +48,11 @@ namespace VIZ.Package.Domain
...
@@ -48,6 +48,11 @@ namespace VIZ.Package.Domain
public
const
string
VIZ_COMMAND_CUSTOM_CONTROL_FIELD_SET
=
"VIZ_CUSTOM_CONTROL_FIELD_SET"
;
public
const
string
VIZ_COMMAND_CUSTOM_CONTROL_FIELD_SET
=
"VIZ_CUSTOM_CONTROL_FIELD_SET"
;
/// <summary>
/// <summary>
/// VIZ切换逻辑默认出点
/// </summary>
public
const
string
VIZ_TRANSITIONLOGIC_DEFAULT_OUT
=
"O"
;
/// <summary>
/// Viz 层集合
/// Viz 层集合
/// </summary>
/// </summary>
public
readonly
static
List
<
VizLayer
>
VIZ_LAYERS
=
new
List
<
VizLayer
>
{
VizLayer
.
FRONT_LAYER
,
VizLayer
.
MAIN_LAYER
,
VizLayer
.
BACK_LAYER
};
public
readonly
static
List
<
VizLayer
>
VIZ_LAYERS
=
new
List
<
VizLayer
>
{
VizLayer
.
FRONT_LAYER
,
VizLayer
.
MAIN_LAYER
,
VizLayer
.
BACK_LAYER
};
...
...
VIZ.Package.Domain/ApplicationDomainEx.Action.cs
View file @
c0d3cd8e
...
@@ -38,5 +38,69 @@ namespace VIZ.Package.Domain
...
@@ -38,5 +38,69 @@ namespace VIZ.Package.Domain
return
sceneInfo
;
return
sceneInfo
;
}
}
/// <summary>
/// 根据场景模板获取场景信息
/// </summary>
/// <param name="template">模板</param>
/// <returns>场景信息</returns>
public
static
SceneInfoModel
GetSceneInfo
(
PageTemplateModel
template
)
{
ConnGroupModel
group
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
IsDefault
);
if
(
group
==
null
)
return
null
;
SceneInfoModel
sceneInfo
=
ApplicationDomainEx
.
SceneInfoList
.
FirstOrDefault
(
p
=>
p
.
ScenePath
==
template
.
ScenePath
&&
p
.
ConnGroupID
==
group
.
GroupID
);
if
(
sceneInfo
!=
null
)
return
sceneInfo
;
lock
(
ApplicationDomainEx
.
SceneInfoList
)
{
SceneInfoModel
sceneInfoInner
=
ApplicationDomainEx
.
SceneInfoList
.
FirstOrDefault
(
p
=>
p
.
ScenePath
==
template
.
ScenePath
&&
p
.
ConnGroupID
==
p
.
ConnGroupID
);
if
(
sceneInfoInner
!=
null
)
return
sceneInfoInner
;
sceneInfo
=
new
SceneInfoModel
();
sceneInfo
.
ConnGroupID
=
group
.
GroupID
;
sceneInfo
.
Scene
=
template
.
Scene
;
sceneInfo
.
ScenePath
=
template
.
ScenePath
;
ApplicationDomainEx
.
SceneInfoList
.
Add
(
sceneInfo
);
}
return
sceneInfo
;
}
/// <summary>
/// 根据页或模板获取背景场景信息
/// </summary>
/// <param name="pageBase">页或模板</param>
/// <returns>背景场景信息</returns>
public
static
TransitionLogicSceneInfoModel
GetSceneInfoWithTransitionLogic
(
PageModelBase
pageBase
)
{
if
(
string
.
IsNullOrWhiteSpace
(
pageBase
.
BackgroundScene
))
return
null
;
string
bgScenePath
=
$"
{
pageBase
.
GetSceneParent
()}
/
{
pageBase
.
BackgroundScene
}
"
;
TransitionLogicSceneInfoModel
sceneInfo
=
ApplicationDomainEx
.
SceneInfoListWithTransitionLogic
.
FirstOrDefault
(
p
=>
p
.
ScenePath
==
bgScenePath
);
if
(
sceneInfo
!=
null
)
return
sceneInfo
;
lock
(
ApplicationDomainEx
.
SceneInfoList
)
{
TransitionLogicSceneInfoModel
sceneInfoInner
=
ApplicationDomainEx
.
SceneInfoListWithTransitionLogic
.
FirstOrDefault
(
p
=>
p
.
ScenePath
==
bgScenePath
);
if
(
sceneInfoInner
!=
null
)
return
sceneInfoInner
;
sceneInfo
=
new
TransitionLogicSceneInfoModel
();
sceneInfo
.
Scene
=
pageBase
.
BackgroundScene
;
sceneInfo
.
ScenePath
=
bgScenePath
;
ApplicationDomainEx
.
SceneInfoListWithTransitionLogic
.
Add
(
sceneInfo
);
}
return
sceneInfo
;
}
}
}
}
}
VIZ.Package.Domain/ApplicationDomainEx.cs
View file @
c0d3cd8e
...
@@ -160,5 +160,13 @@ namespace VIZ.Package.Domain
...
@@ -160,5 +160,13 @@ namespace VIZ.Package.Domain
/// 该值不会入库,仅在内存中保留
/// 该值不会入库,仅在内存中保留
/// </remarks>
/// </remarks>
public
static
List
<
SceneInfoModel
>
SceneInfoList
{
get
;
private
set
;
}
=
new
List
<
SceneInfoModel
>();
public
static
List
<
SceneInfoModel
>
SceneInfoList
{
get
;
private
set
;
}
=
new
List
<
SceneInfoModel
>();
/// <summary>
/// 切换逻辑背景场景信息
/// </summary>
/// <remarks>
/// 该值不会入库,仅在内存中保留
/// </remarks>
public
static
List
<
TransitionLogicSceneInfoModel
>
SceneInfoListWithTransitionLogic
{
get
;
private
set
;
}
=
new
List
<
TransitionLogicSceneInfoModel
>();
}
}
}
}
VIZ.Package.Domain/Expand/PageModelExpand.cs
0 → 100644
View file @
c0d3cd8e
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 页模型扩展
/// </summary>
public
static
class
PageModelExpand
{
/// <summary>
/// 获取场景信息
/// </summary>
/// <param name="pageBase">场景模型基类</param>
/// <returns>场景信息</returns>
public
static
SceneInfoModel
GetSceneInfo
(
this
PageModelBase
pageBase
)
{
if
(
pageBase
is
PageModel
page
)
{
return
page
.
SceneInfo
;
}
else
if
(
pageBase
is
PageTemplateModel
template
)
{
return
ApplicationDomainEx
.
GetSceneInfo
(
template
);
}
else
{
return
null
;
}
}
/// <summary>
/// 获取场景父级
/// </summary>
/// <param name="pageBase">场景父级</param>
/// <returns>场景父级</returns>
public
static
string
GetSceneParent
(
this
PageModelBase
pageBase
)
{
string
parent
=
ApplicationDomainEx
.
CurrentPage
.
ScenePath
.
Substring
(
0
,
ApplicationDomainEx
.
CurrentPage
.
ScenePath
.
LastIndexOf
(
'/'
));
return
parent
;
}
}
}
VIZ.Package.Domain/Model/Scene/TransitionLogicLayerInfo.cs
0 → 100644
View file @
c0d3cd8e
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Core
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 切换场景层信息
/// </summary>
public
class
TransitionLogicLayerInfo
:
ModelBase
{
#
region
BackgroundScene
--
所属背景层
private
string
backgroundScene
;
/// <summary>
/// 所属背景层
/// </summary>
public
string
BackgroundScene
{
get
{
return
backgroundScene
;
}
set
{
backgroundScene
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
BackgroundScene
));
}
}
#
endregion
#
region
LayerIdentifier
--
逻辑层
private
string
layerIdentifier
;
/// <summary>
/// 逻辑层
/// </summary>
public
string
LayerIdentifier
{
get
{
return
layerIdentifier
;
}
set
{
layerIdentifier
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
LayerIdentifier
));
}
}
#
endregion
#
region
StateIdentifier
--
状态点
private
string
stateIdentifier
;
/// <summary>
/// 触发器Geom值
/// </summary>
public
string
StateIdentifier
{
get
{
return
stateIdentifier
;
}
set
{
stateIdentifier
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
StateIdentifier
));
}
}
#
endregion
#
region
SceneIdentifier
--
场景
private
string
sceneIdentifier
;
/// <summary>
/// 场景
/// </summary>
public
string
SceneIdentifier
{
get
{
return
sceneIdentifier
;
}
set
{
sceneIdentifier
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
SceneIdentifier
));
}
}
#
endregion
#
region
ControlObject
--
控制对象值
private
string
controlObject
;
/// <summary>
/// 控制对象值
/// </summary>
public
string
ControlObject
{
get
{
return
controlObject
;
}
set
{
controlObject
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ControlObject
));
}
}
#
endregion
#
region
IsContinued
--
是否点击了继续
private
bool
isContinued
;
/// <summary>
/// 是否点击了继续
/// </summary>
public
bool
IsContinued
{
get
{
return
isContinued
;
}
set
{
isContinued
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsContinued
));
}
}
#
endregion
}
}
VIZ.Package.Domain/Model/Scene/TransitionLogicModel.cs
0 → 100644
View file @
c0d3cd8e
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Core
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 切换逻辑层模型
/// </summary>
public
class
TransitionLogicModel
:
ModelBase
{
#
region
LayerInfos
--
层信息
private
List
<
TransitionLogicLayerInfo
>
layerInfos
=
new
List
<
TransitionLogicLayerInfo
>();
/// <summary>
/// 层信息
/// </summary>
public
List
<
TransitionLogicLayerInfo
>
LayerInfos
{
get
{
return
layerInfos
;
}
set
{
layerInfos
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
LayerInfos
));
}
}
#
endregion
}
}
VIZ.Package.Domain/Model/Scene/TransitionLogicSceneInfoModel.cs
0 → 100644
View file @
c0d3cd8e
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Core
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 切换场景场景信息
/// </summary>
public
class
TransitionLogicSceneInfoModel
:
SceneInfoModel
{
#
region
TransitionLogic
--
切换逻辑
private
TransitionLogicModel
transitionLogic
=
new
TransitionLogicModel
();
/// <summary>
/// 切换逻辑
/// </summary>
public
TransitionLogicModel
TransitionLogic
{
get
{
return
transitionLogic
;
}
set
{
transitionLogic
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
TransitionLogic
));
}
}
#
endregion
}
}
VIZ.Package.Domain/VIZ.Package.Domain.csproj
View file @
c0d3cd8e
...
@@ -112,6 +112,7 @@
...
@@ -112,6 +112,7 @@
<Compile Include="Model\Page\PageGroupModel.cs" />
<Compile Include="Model\Page\PageGroupModel.cs" />
<Compile Include="Model\Page\PageModel.cs" />
<Compile Include="Model\Page\PageModel.cs" />
<Compile Include="Model\Page\PageModelBase.cs" />
<Compile Include="Model\Page\PageModelBase.cs" />
<Compile Include="Expand\PageModelExpand.cs" />
<Compile Include="Model\Page\PageTemplateModel.cs" />
<Compile Include="Model\Page\PageTemplateModel.cs" />
<Compile Include="Model\Resource\Enum\ResourceFileSelectionMode.cs" />
<Compile Include="Model\Resource\Enum\ResourceFileSelectionMode.cs" />
<Compile Include="Model\Resource\Enum\ResourceFileType.cs" />
<Compile Include="Model\Resource\Enum\ResourceFileType.cs" />
...
@@ -124,6 +125,9 @@
...
@@ -124,6 +125,9 @@
<Compile Include="Model\Resource\ResourceFileModelBase.cs" />
<Compile Include="Model\Resource\ResourceFileModelBase.cs" />
<Compile Include="Model\Resource\ResourceFolderModelBase.cs" />
<Compile Include="Model\Resource\ResourceFolderModelBase.cs" />
<Compile Include="Model\Scene\SceneInfoModel.cs" />
<Compile Include="Model\Scene\SceneInfoModel.cs" />
<Compile Include="Model\Scene\TransitionLogicLayerInfo.cs" />
<Compile Include="Model\Scene\TransitionLogicModel.cs" />
<Compile Include="Model\Scene\TransitionLogicSceneInfoModel.cs" />
<Compile Include="Model\Setting\SettingPageModel.cs" />
<Compile Include="Model\Setting\SettingPageModel.cs" />
<Compile Include="Model\Task\PackageTaskModel.cs" />
<Compile Include="Model\Task\PackageTaskModel.cs" />
<Compile Include="Plugin\IPluginLifeCycle.cs" />
<Compile Include="Plugin\IPluginLifeCycle.cs" />
...
...
VIZ.Package.Module/Control/Controller/ControlController.cs
View file @
c0d3cd8e
This diff is collapsed.
Click to expand it.
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
View file @
c0d3cd8e
...
@@ -115,11 +115,11 @@ namespace VIZ.Package.Module
...
@@ -115,11 +115,11 @@ namespace VIZ.Package.Module
{
{
if
(
obj
.
TransitionLogic
)
if
(
obj
.
TransitionLogic
)
{
{
this
.
controlController
.
TakeTransitionLogic
(
obj
,
view
,
conn
);
this
.
controlController
.
TakeTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
else
else
{
{
this
.
controlController
.
TakeNormal
(
obj
,
view
,
conn
);
this
.
controlController
.
TakeNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
},
},
over
:
()
=>
over
:
()
=>
...
@@ -164,11 +164,11 @@ namespace VIZ.Package.Module
...
@@ -164,11 +164,11 @@ namespace VIZ.Package.Module
{
{
if
(
obj
.
TransitionLogic
)
if
(
obj
.
TransitionLogic
)
{
{
this
.
controlController
.
ContinueTransitionLogic
(
obj
,
view
,
conn
);
this
.
controlController
.
ContinueTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
else
else
{
{
this
.
controlController
.
ContinueNormal
(
obj
,
view
,
conn
);
this
.
controlController
.
ContinueNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
},
},
over
:
null
);
over
:
null
);
...
@@ -196,11 +196,11 @@ namespace VIZ.Package.Module
...
@@ -196,11 +196,11 @@ namespace VIZ.Package.Module
{
{
if
(
obj
.
TransitionLogic
)
if
(
obj
.
TransitionLogic
)
{
{
this
.
controlController
.
TakeOutTransitionLogic
(
obj
,
view
,
conn
);
this
.
controlController
.
TakeOutTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
else
else
{
{
this
.
controlController
.
TakeOutNormal
(
obj
,
view
,
conn
);
this
.
controlController
.
TakeOutNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
},
},
over
:
()
=>
over
:
()
=>
...
@@ -248,11 +248,11 @@ namespace VIZ.Package.Module
...
@@ -248,11 +248,11 @@ namespace VIZ.Package.Module
{
{
if
(
obj
.
TransitionLogic
)
if
(
obj
.
TransitionLogic
)
{
{
this
.
controlController
.
UpdateTransitionLogic
(
obj
,
view
,
conn
);
this
.
controlController
.
UpdateTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
else
else
{
{
this
.
controlController
.
UpdateNormal
(
obj
,
view
,
conn
);
this
.
controlController
.
UpdateNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
},
},
over
:
null
);
over
:
null
);
...
...
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
View file @
c0d3cd8e
...
@@ -526,6 +526,15 @@ namespace VIZ.Package.Module
...
@@ -526,6 +526,15 @@ namespace VIZ.Package.Module
sceneInfo
.
TakeInitedMessage
=
null
;
sceneInfo
.
TakeInitedMessage
=
null
;
}
}
}
}
lock
(
ApplicationDomainEx
.
SceneInfoListWithTransitionLogic
)
{
foreach
(
TransitionLogicSceneInfoModel
sceneInfo
in
ApplicationDomainEx
.
SceneInfoListWithTransitionLogic
)
{
sceneInfo
.
TakeInitedProgress
=
0d
;
sceneInfo
.
TakeInitedMessage
=
null
;
sceneInfo
.
TransitionLogic
.
LayerInfos
.
Clear
();
}
}
// 开始清理
// 开始清理
List
<
ConnGroupModel
>
groups
=
ApplicationDomainEx
.
ConnGroups
.
ToList
();
List
<
ConnGroupModel
>
groups
=
ApplicationDomainEx
.
ConnGroups
.
ToList
();
...
...
VIZ.Package.Service/DB/RecordLog/RecordLogWriter.cs
View file @
c0d3cd8e
...
@@ -186,7 +186,7 @@ namespace VIZ.Package.Service
...
@@ -186,7 +186,7 @@ namespace VIZ.Package.Service
/// <returns>日志文件路径</returns>
/// <returns>日志文件路径</returns>
private
string
GetFileName
()
private
string
GetFileName
()
{
{
return
Path
.
Combine
(
this
.
WorkFolder
,
$"
{
DateTime
.
Now
.
ToString
(
"yyyy_MM_dd__HH_mm_ss_fffffff"
)}
.csv"
);
return
Path
.
Combine
(
this
.
WorkFolder
,
$"
{
DateTime
.
Now
.
ToString
(
"yyyy_MM_dd__HH_mm_ss_
_
fffffff"
)}
.csv"
);
}
}
}
}
}
}
VIZ.Package.Service/Viz/VizCommandControlObjectService.cs
View file @
c0d3cd8e
...
@@ -412,18 +412,16 @@ namespace VIZ.Package.Service
...
@@ -412,18 +412,16 @@ namespace VIZ.Package.Service
// 切换场景
// 切换场景
/// <summary>
/// <summary>
///
设置切换逻辑的控制对象值
///
获取控制对象值字符串
/// </summary>
/// </summary>
/// <param name="conn">连接</param>
/// <param name="obj">控制对象</param>
/// <param name="obj">控制对象</param>
/// <
param name="pageBase">页</param
>
/// <
returns>控制对象值字符串</returns
>
public
void
SetControlObjectOtherWithTransitionLogic
(
ConnModel
conn
,
ControlObjectModel
obj
,
PageModelBase
pageBase
)
public
string
GetControlObjectStringWithTransitionLogic
(
ControlObjectModel
obj
)
{
{
string
scenePathDir
=
pageBase
.
ScenePath
.
Substring
(
0
,
pageBase
.
ScenePath
.
LastIndexOf
(
'/'
));
if
(
obj
==
null
||
obj
.
AllFiledNodes
==
null
||
obj
.
AllFiledNodes
.
Count
==
0
)
string
bgScenePath
=
$"
{
scenePathDir
}
/
{
pageBase
.
BackgroundScene
}
"
;
return
string
.
Empty
;
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$"SCENE*
{
bgScenePath
}
*TREE*$
{
pageBase
.
LayerIdentifier
}
$other$object*FUNCTION*ControlObject*in SET ON "
);
foreach
(
ControlFieldNodeModel
field
in
obj
.
AllFiledNodes
)
foreach
(
ControlFieldNodeModel
field
in
obj
.
AllFiledNodes
)
{
{
// 自定义字段不通过该方法上板
// 自定义字段不通过该方法上板
...
@@ -433,6 +431,23 @@ namespace VIZ.Package.Service
...
@@ -433,6 +431,23 @@ namespace VIZ.Package.Service
sb
.
Append
(
$"
{
field
.
FieldIdentifier
}
SET
{
field
.
Value
}
\\0"
);
sb
.
Append
(
$"
{
field
.
FieldIdentifier
}
SET
{
field
.
Value
}
\\0"
);
}
}
return
sb
.
ToString
();
}
/// <summary>
/// 设置切换逻辑的控制对象值
/// </summary>
/// <param name="conn">连接</param>
/// <param name="obj">控制对象</param>
/// <param name="pageBase">页</param>
public
void
SetControlObjectOtherWithTransitionLogic
(
ConnModel
conn
,
ControlObjectModel
obj
,
PageModelBase
pageBase
)
{
string
bgScenePath
=
$"
{
pageBase
.
GetSceneParent
()}
/
{
pageBase
.
BackgroundScene
}
"
;
StringBuilder
sb
=
new
StringBuilder
();
string
value
=
this
.
GetControlObjectStringWithTransitionLogic
(
obj
);
sb
.
Append
(
$"SCENE*
{
bgScenePath
}
*TREE*$
{
pageBase
.
LayerIdentifier
}
$other$object*FUNCTION*ControlObject*in SET ON
{
value
}
"
);
conn
.
EndpointManager
.
Send
(
sb
.
ToString
());
conn
.
EndpointManager
.
Send
(
sb
.
ToString
());
}
}
...
@@ -444,19 +459,11 @@ namespace VIZ.Package.Service
...
@@ -444,19 +459,11 @@ namespace VIZ.Package.Service
/// <param name="pageBase">页</param>
/// <param name="pageBase">页</param>
public
void
SetControlObjectCurrentWithTransitionLogic
(
ConnModel
conn
,
ControlObjectModel
obj
,
PageModelBase
pageBase
)
public
void
SetControlObjectCurrentWithTransitionLogic
(
ConnModel
conn
,
ControlObjectModel
obj
,
PageModelBase
pageBase
)
{
{
string
scenePathDir
=
pageBase
.
ScenePath
.
Substring
(
0
,
pageBase
.
ScenePath
.
LastIndexOf
(
'/'
));
string
bgScenePath
=
$"
{
pageBase
.
GetSceneParent
()}
/
{
pageBase
.
BackgroundScene
}
"
;
string
bgScenePath
=
$"
{
scenePathDir
}
/
{
pageBase
.
BackgroundScene
}
"
;
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$"SCENE*
{
bgScenePath
}
*TREE*$
{
pageBase
.
LayerIdentifier
}
$current$object*FUNCTION*ControlObject*in SET ON "
);
string
value
=
this
.
GetControlObjectStringWithTransitionLogic
(
obj
);
foreach
(
ControlFieldNodeModel
field
in
obj
.
AllFiledNodes
)
sb
.
Append
(
$"SCENE*
{
bgScenePath
}
*TREE*$
{
pageBase
.
LayerIdentifier
}
$current$object*FUNCTION*ControlObject*in SET ON
{
value
}
"
);
{
// 自定义字段不通过该方法上板
if
(
field
.
IsCustom
)
continue
;
sb
.
Append
(
$"
{
field
.
FieldIdentifier
}
SET
{
field
.
Value
}
\\0"
);
}
conn
.
EndpointManager
.
Send
(
sb
.
ToString
());
conn
.
EndpointManager
.
Send
(
sb
.
ToString
());
}
}
...
...
VIZ.Package.Service/Viz/VizCommandService.cs
View file @
c0d3cd8e
...
@@ -345,53 +345,62 @@ namespace VIZ.Package.Service
...
@@ -345,53 +345,62 @@ namespace VIZ.Package.Service
/// 动画显示
/// 动画显示
/// </summary>
/// </summary>
/// <param name="conn">连接</param>
/// <param name="conn">连接</param>
/// <param name="pageBase">页</param>
/// <param name="layer">逻辑层</param>
public
void
DirectorShowWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
)
/// <param name="state">状态</param>
public
void
DirectorShowWithTransitionLogic
(
ConnModel
conn
,
string
layer
,
string
state
)
{
{
if
(
conn
==
null
)
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
if
(
string
.
IsNullOrWhiteSpace
(
layer
)
)
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
throw
new
ArgumentNullException
(
nameof
(
layer
));
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*STAGE*DIRECTOR*
{
pageBase
.
LayerIdentifier
}
SHOW $
{
pageBase
.
StateIdentifier
}
"
);
if
(
string
.
IsNullOrWhiteSpace
(
state
))
throw
new
ArgumentNullException
(
nameof
(
state
));
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*STAGE*DIRECTOR*
{
layer
}
SHOW $
{
state
}
"
);
}
}
/// <summary>
/// <summary>
/// 动画切换
/// 动画切换
/// </summary>
/// </summary>
/// <param name="conn">连接</param>
/// <param name="conn">连接</param>
/// <param name="
pageBase">页
</param>
/// <param name="
layer">逻辑层
</param>
/// <param name="
from">开始
</param>
/// <param name="
oldState">旧状态
</param>
/// <param name="
to">结束
</param>
/// <param name="
newState">新状态
</param>
public
void
DirectorGo
toTrioWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
,
string
from
,
string
to
)
public
void
DirectorGo
ToWithTransitionLogic
(
ConnModel
conn
,
string
layer
,
string
oldState
,
string
newState
)
{
{
if
(
conn
==
null
)
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
if
(
string
.
IsNullOrWhiteSpace
(
layer
))
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
throw
new
ArgumentNullException
(
nameof
(
layer
));
if
(
string
.
IsNullOrWhiteSpace
(
oldState
))
throw
new
ArgumentNullException
(
nameof
(
oldState
));
if
(
string
.
IsNullOrWhiteSpace
(
newState
))
throw
new
ArgumentNullException
(
nameof
(
newState
));
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*STAGE*DIRECTOR*
{
pageBase
.
LayerIdentifier
}
GOTO_TRIO $
{
from
}
$
{
to
}
"
);
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*STAGE*DIRECTOR*
{
layer
}
GOTO_TRIO $
{
oldState
}
$
{
newState
}
"
);
}
}
/// <summary>
/// <summary>
/// 设置切换逻辑层的GEOM
/// 设置切换逻辑层的GEOM
/// </summary>
/// </summary>
/// <param name="conn">连接</param>
/// <param name="conn">连接</param>
/// <param name="pageBase">页</param>
/// <param name="bgScene">背景场景</param>
public
void
ToggleSetGeomWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
)
/// <param name="layer">逻辑层</param>
/// <param name="scene">场景</param>
public
void
ToggleSetGeomWithTransitionLogic
(
ConnModel
conn
,
string
bgScene
,
string
layer
,
string
scene
)
{
{
if
(
conn
==
null
)
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
if
(
string
.
IsNullOrWhiteSpace
(
scene
))
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
throw
new
ArgumentNullException
(
nameof
(
scene
));
string
scenePathDir
=
pageBase
.
ScenePath
.
Substring
(
0
,
pageBase
.
ScenePath
.
LastIndexOf
(
'/'
));
string
bgScenePath
=
$"
{
scenePathDir
}
/
{
pageBase
.
BackgroundScene
}
"
;
conn
.
EndpointManager
.
Send
(
$"SCENE*
{
bgScene
Path
}
*TREE*$
{
pageBase
.
LayerIdentifier
}
*FUNCTION*Toggle*object SET GEOM*
{
pageBase
.
ScenePath
}
"
);
conn
.
EndpointManager
.
Send
(
$"SCENE*
{
bgScene
}
*TREE*$
{
layer
}
*FUNCTION*Toggle*object SET GEOM*
{
scene
}
"
);
}
}
/// <summary>
/// <summary>
...
@@ -433,16 +442,16 @@ namespace VIZ.Package.Service
...
@@ -433,16 +442,16 @@ namespace VIZ.Package.Service
/// 触发重置
/// 触发重置
/// </summary>
/// </summary>
/// <param name="conn">连接</param>
/// <param name="conn">连接</param>
/// <param name="
pageBase">页
</param>
/// <param name="
logicLayer">切换逻辑层
</param>
public
void
ToggleResetWithTransitionLogic
(
ConnModel
conn
,
PageModelBase
pageBase
)
public
void
ToggleResetWithTransitionLogic
(
ConnModel
conn
,
string
logicLayer
)
{
{
if
(
conn
==
null
)
if
(
conn
==
null
)
throw
new
ArgumentNullException
(
nameof
(
conn
));
throw
new
ArgumentNullException
(
nameof
(
conn
));
if
(
pageBase
==
null
)
if
(
string
.
IsNullOrWhiteSpace
(
logicLayer
)
)
throw
new
ArgumentNullException
(
nameof
(
pageBase
));
throw
new
ArgumentNullException
(
nameof
(
logicLayer
));
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*TREE*$
{
pageBase
.
LayerIdentifi
er
}
*FUNCTION*Toggle*reset_current INVOKE"
);
conn
.
EndpointManager
.
Send
(
$"RENDERER*MAIN_LAYER*TREE*$
{
logicLay
er
}
*FUNCTION*Toggle*reset_current INVOKE"
);
}
}
/// <summary>
/// <summary>
...
...
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