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
d4cf00b2
Commit
d4cf00b2
authored
Mar 21, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
命令模板窗口
parent
4db1bb43
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
361 additions
and
116 deletions
+361
-116
VIZ.Package.Domain/RecordLogConstants.cs
+5
-0
VIZ.Package.Module.Resource/Converter/PageThumbnailConverter.cs
+61
-0
VIZ.Package.Module.Resource/Images/cmd_template.png
+0
-0
VIZ.Package.Module.Resource/Properties/Resources.Designer.cs
+0
-10
VIZ.Package.Module.Resource/Properties/Resources.resx
+0
-5
VIZ.Package.Module.Resource/Resources/cmd_template.jpg
+0
-0
VIZ.Package.Module.Resource/VIZ.Package.Module.Resource.csproj
+5
-3
VIZ.Package.Module/Control/Controller/ControlController.cs
+42
-24
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
+40
-24
VIZ.Package.Module/ControlObject/FieldTree/ViewModel/FieldTreeViewModel.cs
+3
-0
VIZ.Package.Module/Page/Group/Service/IPageGroupService.cs
+6
-0
VIZ.Package.Module/Page/Group/View/PageGroupView.xaml
+9
-1
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
+54
-0
VIZ.Package.Module/PageCommand/View/PageCommandView.xaml
+2
-7
VIZ.Package.Module/PageCommand/ViewModel/PageCommandViewModel.cs
+15
-0
VIZ.Package.Module/Preview/VizPreview/Controller/VizPreviewCmdController.cs
+75
-0
VIZ.Package.Module/Preview/VizPreview/ViewModel/VizPreviewViewModel.cs
+43
-42
VIZ.Package.Module/VIZ.Package.Module.csproj
+1
-0
No files found.
VIZ.Package.Domain/RecordLogConstants.cs
View file @
d4cf00b2
...
...
@@ -215,6 +215,11 @@ namespace VIZ.Package.Domain
public
const
string
OPERATE_PAGE_ADD
=
"添加页"
;
/// <summary>
/// 添加命令模板页
/// </summary>
public
const
string
OPERATE_PAGE_ADD_CMD
=
"添加命令模板页"
;
/// <summary>
/// 修改页号
/// </summary>
public
const
string
OPERATE_PAGE_CHANGE_PAGE_NUM
=
"修改页号"
;
...
...
VIZ.Package.Module.Resource/Converter/PageThumbnailConverter.cs
0 → 100644
View file @
d4cf00b2
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Globalization
;
using
System.Linq
;
using
System.Runtime.InteropServices
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Data
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
VIZ.Package.Domain
;
namespace
VIZ.Package.Module.Resource
{
/// <summary>
/// 页缩略图转化器
/// </summary>
public
class
PageThumbnailConverter
:
IValueConverter
{
[
DllImport
(
"gdi32.dll"
,
SetLastError
=
true
)]
private
static
extern
bool
DeleteObject
(
IntPtr
hObject
);
/// <summary>
/// 命令缩略图
/// </summary>
public
ImageSource
CommandThumbnail
{
get
;
set
;
}
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
PageModelBase
pageBase
=
value
as
PageModelBase
;
if
(
pageBase
==
null
)
return
null
;
if
(
pageBase
.
PageType
==
Storage
.
PageType
.
Command
)
return
this
.
CommandThumbnail
;
Bitmap
bitmap
=
pageBase
.
ThumbnailBitmap
;
if
(
bitmap
==
null
)
return
null
;
IntPtr
hBitmap
=
bitmap
.
GetHbitmap
();
ImageSource
wpfBitmap
=
System
.
Windows
.
Interop
.
Imaging
.
CreateBitmapSourceFromHBitmap
(
hBitmap
,
IntPtr
.
Zero
,
Int32Rect
.
Empty
,
BitmapSizeOptions
.
FromEmptyOptions
());
if
(!
DeleteObject
(
hBitmap
))
{
throw
new
System
.
ComponentModel
.
Win32Exception
();
}
return
wpfBitmap
;
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
throw
new
NotImplementedException
();
}
}
}
VIZ.Package.Module.Resource/Images/cmd_template.png
0 → 100644
View file @
d4cf00b2
5.59 KB
VIZ.Package.Module.Resource/Properties/Resources.Designer.cs
View file @
d4cf00b2
...
...
@@ -59,15 +59,5 @@ namespace VIZ.Package.Module.Resource.Properties {
resourceCulture
=
value
;
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
public
static
System
.
Drawing
.
Bitmap
cmd_template
{
get
{
object
obj
=
ResourceManager
.
GetObject
(
"cmd_template"
,
resourceCulture
);
return
((
System
.
Drawing
.
Bitmap
)(
obj
));
}
}
}
}
VIZ.Package.Module.Resource/Properties/Resources.resx
View file @
d4cf00b2
...
...
@@ -117,8 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="cmd_template" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\cmd_template.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
VIZ.Package.Module.Resource/Resources/cmd_template.jpg
deleted
100644 → 0
View file @
4db1bb43
15.9 KB
VIZ.Package.Module.Resource/VIZ.Package.Module.Resource.csproj
View file @
d4cf00b2
...
...
@@ -104,6 +104,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Converter\ConnGroupStatus2BrushConverter.cs" />
<Compile Include="Converter\PageThumbnailConverter.cs" />
<Compile Include="Converter\VizControlFieldTypeStringConverter.cs" />
<Compile Include="Converter\ResourceFileSelectionModeConverter.cs" />
<Compile Include="Converter\RichText2TextConverter.cs" />
...
...
@@ -138,9 +139,6 @@
<Resource Include="Icons\project_24x24.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\cmd_template.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\take_continue_30x30.png" />
<Resource Include="Icons\take_in_30x30.png" />
<Resource Include="Icons\take_out_30x30.png" />
...
...
@@ -289,5 +287,8 @@
<ItemGroup>
<Resource Include="Icons\down_32x32.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\cmd_template.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
VIZ.Package.Module/Control/Controller/ControlController.cs
View file @
d4cf00b2
...
...
@@ -64,13 +64,6 @@ namespace VIZ.Package.Module
}
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
this
.
vizCommandService
.
Start
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeCommand
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
}
/// <summary>
...
...
@@ -184,13 +177,21 @@ namespace VIZ.Package.Module
transitionLogicLayer
.
SceneIdentifier
=
newPageBase
.
Scene
;
transitionLogicLayer
.
StateIdentifier
=
newPageBase
.
StateIdentifier
;
transitionLogicLayer
.
ControlObject
=
controlObjectValue
;
}
/// <summary>
/// 上版 -- 命令
/// </summary>
/// <param name="pageBase">页</param>
/// <param name="conn">连接</param>
public
void
TakeCommnad
(
PageModelBase
pageBase
,
ConnModel
conn
)
{
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeCommand
(
ApplicationDomainEx
.
CurrentPag
e
,
conn
);
pageCommandService
.
BeginExecuteTakeCommand
(
pageBas
e
,
conn
);
}
// ---------------------------------------------------------------------------
...
...
@@ -251,6 +252,21 @@ namespace VIZ.Package.Module
pageCommandService
.
BeginExecuteTakeContinueCommand
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
}
/// <summary>
/// 继续 -- 命令
/// </summary>
/// <param name="pageBase">页</param>
/// <param name="conn">连接</param>
public
void
ContinueCommnad
(
PageModelBase
pageBase
,
ConnModel
conn
)
{
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeContinueCommand
(
pageBase
,
conn
);
}
// ---------------------------------------------------------------------------
// 下板
...
...
@@ -266,13 +282,6 @@ namespace VIZ.Package.Module
{
this
.
vizCommandService
.
TakeOut
(
conn
,
newPageBase
.
Layer
);
view
?.
TakeOut
(
conn
);
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeOutCommand
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
}
/// <summary>
...
...
@@ -306,13 +315,21 @@ namespace VIZ.Package.Module
SceneInfoModel
sceneInfo
=
newPageBase
.
GetSceneInfo
();
TransitionLogicLayerInfo
logicLayer
=
bgSceneInfo
.
TransitionLogic
.
LayerInfos
.
FirstOrDefault
(
p
=>
p
.
LayerIdentifier
==
newPageBase
.
LayerIdentifier
);
bgSceneInfo
.
TransitionLogic
.
LayerInfos
.
Remove
(
logicLayer
);
}
/// <summary>
/// 下版 -- 命令
/// </summary>
/// <param name="pageBase">页</param>
/// <param name="conn">连接</param>
public
void
TakeOutCommnad
(
PageModelBase
pageBase
,
ConnModel
conn
)
{
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeOutCommand
(
ApplicationDomainEx
.
CurrentPag
e
,
conn
);
pageCommandService
.
BeginExecuteTakeOutCommand
(
pageBas
e
,
conn
);
}
// ---------------------------------------------------------------------------
...
...
@@ -343,13 +360,6 @@ namespace VIZ.Package.Module
log
.
Error
(
ex
);
}
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeUpdateCommand
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
}
/// <summary>
...
...
@@ -376,13 +386,21 @@ namespace VIZ.Package.Module
{
view
.
TakeUpdate
(
conn
);
}
}
/// <summary>
/// 更新 -- 命令
/// </summary>
/// <param name="pageBase">页</param>
/// <param name="conn">连接</param>
public
void
UpdateCommnad
(
PageModelBase
pageBase
,
ConnModel
conn
)
{
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeUpdateCommand
(
ApplicationDomainEx
.
CurrentPag
e
,
conn
);
pageCommandService
.
BeginExecuteTakeUpdateCommand
(
pageBas
e
,
conn
);
}
}
}
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
View file @
d4cf00b2
...
...
@@ -141,14 +141,18 @@ namespace VIZ.Package.Module
this
.
Execute
(
action
:
(
obj
,
view
,
conn
)
=>
{
if
(
obj
.
TransitionLogic
)
if
(
ApplicationDomainEx
.
CurrentPage
.
PageType
==
PageType
.
Scene
)
{
this
.
controlController
.
ContinueTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
else
{
this
.
controlController
.
ContinueNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
if
(
obj
.
TransitionLogic
)
{
this
.
controlController
.
ContinueTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
else
{
this
.
controlController
.
ContinueNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
this
.
controlController
.
ContinueCommnad
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
},
over
:
null
);
}
...
...
@@ -173,14 +177,18 @@ namespace VIZ.Package.Module
this
.
Execute
(
action
:
(
obj
,
view
,
conn
)
=>
{
if
(
obj
.
TransitionLogic
)
if
(
ApplicationDomainEx
.
CurrentPage
.
PageType
==
PageType
.
Scene
)
{
this
.
controlController
.
TakeOutTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
else
{
this
.
controlController
.
TakeOutNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
if
(
obj
.
TransitionLogic
)
{
this
.
controlController
.
TakeOutTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
else
{
this
.
controlController
.
TakeOutNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
this
.
controlController
.
TakeOutCommnad
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
},
over
:
()
=>
{
...
...
@@ -225,14 +233,18 @@ namespace VIZ.Package.Module
this
.
Execute
(
action
:
(
obj
,
view
,
conn
)
=>
{
if
(
obj
.
TransitionLogic
)
if
(
ApplicationDomainEx
.
CurrentPage
.
PageType
==
PageType
.
Scene
)
{
this
.
controlController
.
UpdateTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
else
{
this
.
controlController
.
UpdateNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
if
(
obj
.
TransitionLogic
)
{
this
.
controlController
.
UpdateTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
else
{
this
.
controlController
.
UpdateNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
this
.
controlController
.
UpdateCommnad
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
},
over
:
null
);
}
...
...
@@ -363,14 +375,18 @@ namespace VIZ.Package.Module
this
.
Execute
(
action
:
(
obj
,
view
,
conn
)
=>
{
if
(
obj
.
TransitionLogic
)
if
(
ApplicationDomainEx
.
CurrentPage
.
PageType
==
PageType
.
Scene
)
{
this
.
controlController
.
TakeTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
else
{
this
.
controlController
.
TakeNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
if
(
obj
.
TransitionLogic
)
{
this
.
controlController
.
TakeTransitionLogic
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
else
{
this
.
controlController
.
TakeNormal
(
ApplicationDomainEx
.
CurrentTake
,
ApplicationDomainEx
.
CurrentPage
,
obj
,
view
,
conn
);
}
}
this
.
controlController
.
TakeCommnad
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
},
over
:
()
=>
{
...
...
VIZ.Package.Module/ControlObject/FieldTree/ViewModel/FieldTreeViewModel.cs
View file @
d4cf00b2
...
...
@@ -152,6 +152,9 @@ namespace VIZ.Package.Module
ThreadHelper
.
SafeRun
(
action
:
()
=>
{
if
(
msg
.
Page
.
PageType
!=
PageType
.
Scene
)
return
;
// 从本地数据库获取控制对象
ControlObjectEntity
entity
=
this
.
controlObjectService
.
GetControlObject
(
msg
.
Page
)?.
FirstOrDefault
();
ControlObjectModel
controlObject
=
new
ControlObjectModel
();
...
...
VIZ.Package.Module/Page/Group/Service/IPageGroupService.cs
View file @
d4cf00b2
...
...
@@ -14,6 +14,12 @@ namespace VIZ.Package.Module
public
interface
IPageGroupService
:
IService
{
/// <summary>
/// 创建并添加命令模板页
/// </summary>
/// <returns>页</returns>
PageModel
AddCmdPage
();
/// <summary>
/// 添加页
/// </summary>
/// <param name="template">模板</param>
...
...
VIZ.Package.Module/Page/Group/View/PageGroupView.xaml
View file @
d4cf00b2
...
...
@@ -31,6 +31,8 @@
</ResourceDictionary.MergedDictionaries>
<resource:RowHandleConverter x:Key="RowHandleConverter"></resource:RowHandleConverter>
<resource:PageThumbnailConverter x:Key="PageThumbnailConverter"
CommandThumbnail="/VIZ.Package.Module.Resource;component/Images/cmd_template.png"></resource:PageThumbnailConverter>
<fcore:Bitmap2ImageSourceConverter x:Key="Bitmap2ImageSourceConverter"></fcore:Bitmap2ImageSourceConverter>
<fcore:Enum2EnumDescriptionConverter x:Key="Enum2EnumDescriptionConverter" EnumType="{x:Type storage:PageType}"></fcore:Enum2EnumDescriptionConverter>
<fcore:Bool2SolidColorBrushConverter x:Key="RowHandleBgConverter"
...
...
@@ -173,7 +175,7 @@
VisibleIndex="{Binding Path=VisibleIndex,Mode=TwoWay}">
<common:GridColumnResizeMinHeight.CellTemplate>
<DataTemplate>
<fcommon:ResizeImageControl ImageSource="{Binding Path=Row
.ThumbnailBitmap,Converter={StaticResource Bitmap2ImageSource
Converter}}"
<fcommon:ResizeImageControl ImageSource="{Binding Path=Row
,Converter={StaticResource PageThumbnail
Converter}}"
IconSource="/VIZ.Package.Module.Resource;component/Icons/image_20x20.png"
ShowImageMinWidth="50" ShowImageMinHeight="50">
</fcommon:ResizeImageControl>
...
...
@@ -398,6 +400,8 @@
ColumnGeneratorTemplateSelector="{StaticResource ResourceKey=ColumnDefintionGeneratorTemplateSelector}">
<dxg:GridControl.ContextMenu>
<common:ContextMenuEx BindingTargetType="{x:Type dx:DXTabControl}">
<MenuItem Header="添加命令页" Command="{Binding Path=DataContext.CreateCmdPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type common:ContextMenuEx}}}"/>
<Separator></Separator>
<MenuItem Header="粘贴页" Command="{Binding Path=DataContext.PastePageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type common:ContextMenuEx}}}"/>
</common:ContextMenuEx>
</dxg:GridControl.ContextMenu>
...
...
@@ -439,6 +443,10 @@
Command="{Binding ElementName=uc,Path=DataContext.OpenPageCommand}"
Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/>
<dxb:BarItemLinkSeparator />
<dxb:BarButtonItem Name="CreateCmdPage" Content="添加命令页"
Command="{Binding ElementName=uc,Path=DataContext.CreateCmdPageCommand}"
Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/>
<dxb:BarItemLinkSeparator />
<dxb:BarButtonItem Name="Update" Content="更新选中页"
Command="{Binding ElementName=uc,Path=DataContext.UpdateCommand}"
Tag="{x:Static Member=common:GridControlHelper.KEEP_MENU_TAG}"/>
...
...
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
View file @
d4cf00b2
...
...
@@ -94,6 +94,7 @@ namespace VIZ.Package.Module
this
.
AddGroupCommand
=
new
VCommand
(
this
.
AddGroup
);
this
.
RenameGroupCommand
=
new
VCommand
(
this
.
RenameGroup
);
this
.
DeleteGroupCommand
=
new
VCommand
(
this
.
DeleteGroup
);
this
.
CreateCmdPageCommand
=
new
VCommand
(
this
.
CreateCmdPage
,
this
.
CanCreateCmdPage
);
this
.
DeleteItemCommand
=
new
VCommand
(
this
.
DeleteItem
);
this
.
OpenPageCommand
=
new
VCommand
(
this
.
OpenPage
,
this
.
CanOpenPage
);
this
.
OpenAndTakePageCommand
=
new
VCommand
(
this
.
OpenAndTakePage
,
this
.
CanOpenAndTakePage
);
...
...
@@ -393,6 +394,32 @@ namespace VIZ.Package.Module
#
endregion
#
region
CreateCmdPageCommand
--
创建命令模板页命令
/// <summary>
/// 创建命令模板页命令
/// </summary>
public
VCommand
CreateCmdPageCommand
{
get
;
set
;
}
/// <summary>
/// 是否可以创建命令模板页
/// </summary>
/// <returns>是否可以添加模板页</returns>
private
bool
CanCreateCmdPage
()
{
return
this
.
SelectedPageGroupModel
!=
null
;
}
/// <summary>
/// 创建命令模板页
/// </summary>
private
void
CreateCmdPage
()
{
this
.
AddCmdPage
();
}
#
endregion
#
region
DeleteItemCommand
--
刪除項命令
/// <summary>
...
...
@@ -1177,6 +1204,33 @@ namespace VIZ.Package.Module
// ======================================================================================
/// <summary>
/// 创建并添加命令模板页
/// </summary>
/// <returns>页</returns>
public
PageModel
AddCmdPage
()
{
if
(
this
.
SelectedPageGroupModel
==
null
)
return
null
;
// 记录操作日志
this
.
recordLogService
.
AppendLog
(
ApplicationConstants
.
APPLICATION_GROUP_NAME
,
RecordLogOperate
.
Operate
,
RecordLogTrigger
.
Human
,
RecordLogConstants
.
OPERATE_PAGE_ADD_CMD
);
// 根据模板拷贝页
PageModel
page
=
new
PageModel
();
page
.
PageType
=
PageType
.
Command
;
page
.
ConnGroupID
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
IsDefault
)?.
GroupID
??
Guid
.
Empty
;
page
.
PageGroupID
=
this
.
SelectedPageGroupModel
.
GroupID
;
// 页码
page
.
PageNum
=
this
.
SelectedPageGroupModel
.
Pages
.
MaxOrDefault
(
p
=>
p
.
PageNum
)
+
1
;
// 添加页
this
.
SelectedPageGroupModel
.
Pages
.
Add
(
page
);
return
page
;
}
/// <summary>
/// 添加页
/// </summary>
/// <param name="template">模板</param>
...
...
VIZ.Package.Module/PageCommand/View/PageCommandView.xaml
View file @
d4cf00b2
...
...
@@ -44,17 +44,12 @@
<TextBlock Text="{Binding PageID}" Margin="10,0,0,0" MinWidth="40" d:Foreground="White"></TextBlock>
<TextBlock Text="场景:" Margin="40,0,0,0" d:Foreground="White" Opacity="0.7"></TextBlock>
<TextBlock Text="{Binding Scene}" Margin="10,0,0,0" MinWidth="80" d:Foreground="White"></TextBlock>
<TextBlock Text="模板类型:" Margin="40,0,0,0" d:Foreground="White" Opacity="0.7"></TextBlock>
<TextBlock Text="{Binding PageType}" Margin="10,0,0,0" MinWidth="80" d:Foreground="White"></TextBlock>
</StackPanel>
</Border>
<!-- 命令输入框 -->
<dx:DXTabControl Grid.Row="1" Margin="0,10,0,0" Padding="0,5,0,0">
<dx:DXTabControl.View>
<dx:TabControlStretchView HeaderLocation="Top" ShowHeaderMenu="False"
NewButtonShowMode="NoWhere"
HideButtonShowMode="NoWhere"
PinnedTabSize="60">
</dx:TabControlStretchView>
</dx:DXTabControl.View>
<dx:DXTabItem Header="Take">
<dxe:TextEdit AcceptsReturn="True" EditValue="{Binding Path=TakeCommand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="5"
VerticalContentAlignment="Top"></dxe:TextEdit>
...
...
VIZ.Package.Module/PageCommand/ViewModel/PageCommandViewModel.cs
View file @
d4cf00b2
...
...
@@ -159,6 +159,20 @@ namespace VIZ.Package.Module
#
endregion
#
region
PageType
--
页类型
private
string
pageType
;
/// <summary>
/// 页类型
/// </summary>
public
string
PageType
{
get
{
return
pageType
;
}
set
{
pageType
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
pageType
));
}
}
#
endregion
// ======================================================================================
// Command
// ======================================================================================
...
...
@@ -183,6 +197,7 @@ namespace VIZ.Package.Module
}
this
.
Scene
=
msg
.
Page
.
Scene
;
this
.
PageType
=
msg
.
Page
.
PageType
.
GetDescription
();
Guid
templateIdOrPageId
=
msg
.
Page
.
GetTemplateIdOrPageId
();
...
...
VIZ.Package.Module/Preview/VizPreview/Controller/VizPreviewCmdController.cs
0 → 100644
View file @
d4cf00b2
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Package.Domain
;
namespace
VIZ.Package.Module
{
/// <summary>
/// Viz预览命令控制器
/// </summary>
public
class
VizPreviewCmdController
{
/// <summary>
/// 上版 -- 命令
/// </summary>
/// <param name="pageBase">页</param>
/// <param name="conn">连接</param>
public
void
TakeCommnad
(
PageModelBase
pageBase
,
ConnModel
conn
)
{
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeCommand
(
pageBase
,
conn
);
}
/// <summary>
/// 继续 -- 命令
/// </summary>
/// <param name="pageBase">页</param>
/// <param name="conn">连接</param>
public
void
ContinueCommnad
(
PageModelBase
pageBase
,
ConnModel
conn
)
{
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeContinueCommand
(
pageBase
,
conn
);
}
/// <summary>
/// 下版 -- 命令
/// </summary>
/// <param name="pageBase">页</param>
/// <param name="conn">连接</param>
public
void
TakeOutCommnad
(
PageModelBase
pageBase
,
ConnModel
conn
)
{
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeOutCommand
(
pageBase
,
conn
);
}
/// <summary>
/// 更新 -- 命令
/// </summary>
/// <param name="pageBase">页</param>
/// <param name="conn">连接</param>
public
void
UpdateCommnad
(
PageModelBase
pageBase
,
ConnModel
conn
)
{
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeUpdateCommand
(
pageBase
,
conn
);
}
}
}
VIZ.Package.Module/Preview/VizPreview/ViewModel/VizPreviewViewModel.cs
View file @
d4cf00b2
...
...
@@ -172,6 +172,11 @@ namespace VIZ.Package.Module
private
VizPreviewController
vizPreviewController
;
/// <summary>
/// Viz预览命令控制器
/// </summary>
private
VizPreviewCmdController
vizPreviewCmdController
=
new
VizPreviewCmdController
();
/// <summary>
/// VIZ命令服务
/// </summary>
private
VizCommandService
vizCommandService
=
new
VizCommandService
();
...
...
@@ -349,15 +354,13 @@ namespace VIZ.Package.Module
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
false
);
try
{
this
.
vizCommandService
.
Start
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
view
?.
PreviewIn
(
conn
);
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
if
(
ApplicationDomainEx
.
CurrentPage
.
PageType
==
PageType
.
Scene
)
{
this
.
vizCommandService
.
Start
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
view
?.
PreviewIn
(
conn
);
}
pageCommandService
.
BeginExecuteTakeComman
d
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
this
.
vizPreviewCmdController
.
TakeCommna
d
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
}
catch
(
Exception
ex
)
{
...
...
@@ -386,15 +389,13 @@ namespace VIZ.Package.Module
this
.
Execute
((
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
Continue
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
view
?.
PreviewContinue
(
conn
);
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
if
(
ApplicationDomainEx
.
CurrentPage
.
PageType
==
PageType
.
Scene
)
{
this
.
vizCommandService
.
Continue
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
view
?.
PreviewContinue
(
conn
);
}
pageCommandService
.
BeginExecuteTakeContinueComman
d
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
this
.
vizPreviewCmdController
.
ContinueCommna
d
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
});
}
...
...
@@ -417,15 +418,13 @@ namespace VIZ.Package.Module
this
.
Execute
((
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
Stop
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
view
?.
PreviewOut
(
conn
);
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
if
(
ApplicationDomainEx
.
CurrentPage
.
PageType
==
PageType
.
Scene
)
{
this
.
vizCommandService
.
Stop
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
view
?.
PreviewOut
(
conn
);
}
pageCommandService
.
BeginExecuteTakeOutComman
d
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
this
.
vizPreviewCmdController
.
TakeOutCommna
d
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
});
}
...
...
@@ -457,28 +456,27 @@ namespace VIZ.Package.Module
// 执行更新流程
this
.
Execute
((
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
false
);
try
if
(
ApplicationDomainEx
.
CurrentPage
.
PageType
==
PageType
.
Scene
)
{
if
(
obj
!=
null
)
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
false
);
try
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
this
.
vizCommandControlObjectService
.
SetCustomControlFieldValue
(
conn
,
obj
.
AllFiledNodes
);
if
(
obj
!=
null
)
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
this
.
vizCommandControlObjectService
.
SetCustomControlFieldValue
(
conn
,
obj
.
AllFiledNodes
);
}
view
?.
PreviewUpdate
(
conn
);
}
view
?.
PreviewUpdate
(
conn
);
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
}
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
// 执行命令
IPageCommandService
pageCommandService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPageCommandService
>(
ViewServiceKeys
.
PAGE_COMMAND_SERVICE
);
if
(
pageCommandService
==
null
)
return
;
pageCommandService
.
BeginExecuteTakeUpdateCommand
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
this
.
vizPreviewCmdController
.
UpdateCommnad
(
ApplicationDomainEx
.
CurrentPage
,
conn
);
});
}
...
...
@@ -575,7 +573,10 @@ namespace VIZ.Package.Module
ThreadHelper
.
SafeRun
(()
=>
{
this
.
vizCommandService
.
SetObject
(
ApplicationDomainEx
.
PreviewConn
,
msg
.
Page
.
ScenePath
,
VizLayer
.
MAIN_LAYER
);
if
(
msg
.
Page
.
PageType
==
PageType
.
Scene
)
{
this
.
vizCommandService
.
SetObject
(
ApplicationDomainEx
.
PreviewConn
,
msg
.
Page
.
ScenePath
,
VizLayer
.
MAIN_LAYER
);
}
// 发送节目单项初始化完成消息
WPFHelper
.
BeginInvoke
(()
=>
...
...
VIZ.Package.Module/VIZ.Package.Module.csproj
View file @
d4cf00b2
...
...
@@ -169,6 +169,7 @@
</Compile>
<Compile Include="Plugin\Model\PluginNavigationConfig.cs" />
<Compile Include="Plugin\Service\IPluginService.cs" />
<Compile Include="Preview\VizPreview\Controller\VizPreviewCmdController.cs" />
<Compile Include="ProjectManager\ViewModel\SaveProjectWindowModel.cs" />
<Compile Include="ProjectManager\ViewModel\ProjectTreePanelModel.cs" />
<Compile Include="ProjectManager\View\SaveProjectWindow.xaml.cs">
...
...
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