Commit d4cf00b2 by liulongfei

命令模板窗口

parent 4db1bb43
......@@ -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 = "修改页号";
......
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();
}
}
}
......@@ -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));
}
}
}
}
......@@ -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
......@@ -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
......@@ -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.CurrentPage, conn);
pageCommandService.BeginExecuteTakeCommand(pageBase, 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.CurrentPage, conn);
pageCommandService.BeginExecuteTakeOutCommand(pageBase, 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.CurrentPage, conn);
pageCommandService.BeginExecuteTakeUpdateCommand(pageBase, conn);
}
}
}
......@@ -141,6 +141,8 @@ namespace VIZ.Package.Module
this.Execute(
action: (obj, view, conn) =>
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
if (obj.TransitionLogic)
{
this.controlController.ContinueTransitionLogic(ApplicationDomainEx.CurrentTake, ApplicationDomainEx.CurrentPage, obj, view, conn);
......@@ -149,6 +151,8 @@ namespace VIZ.Package.Module
{
this.controlController.ContinueNormal(ApplicationDomainEx.CurrentTake, ApplicationDomainEx.CurrentPage, obj, view, conn);
}
}
this.controlController.ContinueCommnad(ApplicationDomainEx.CurrentPage, conn);
},
over: null);
}
......@@ -173,6 +177,8 @@ namespace VIZ.Package.Module
this.Execute(
action: (obj, view, conn) =>
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
if (obj.TransitionLogic)
{
this.controlController.TakeOutTransitionLogic(ApplicationDomainEx.CurrentTake, ApplicationDomainEx.CurrentPage, obj, view, conn);
......@@ -181,6 +187,8 @@ namespace VIZ.Package.Module
{
this.controlController.TakeOutNormal(ApplicationDomainEx.CurrentTake, ApplicationDomainEx.CurrentPage, obj, view, conn);
}
}
this.controlController.TakeOutCommnad(ApplicationDomainEx.CurrentPage, conn);
},
over: () =>
{
......@@ -225,6 +233,8 @@ namespace VIZ.Package.Module
this.Execute(
action: (obj, view, conn) =>
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
if (obj.TransitionLogic)
{
this.controlController.UpdateTransitionLogic(ApplicationDomainEx.CurrentTake, ApplicationDomainEx.CurrentPage, obj, view, conn);
......@@ -233,6 +243,8 @@ namespace VIZ.Package.Module
{
this.controlController.UpdateNormal(ApplicationDomainEx.CurrentTake, ApplicationDomainEx.CurrentPage, obj, view, conn);
}
}
this.controlController.UpdateCommnad(ApplicationDomainEx.CurrentPage, conn);
},
over: null);
}
......@@ -363,6 +375,8 @@ namespace VIZ.Package.Module
this.Execute(
action: (obj, view, conn) =>
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
if (obj.TransitionLogic)
{
this.controlController.TakeTransitionLogic(ApplicationDomainEx.CurrentTake, ApplicationDomainEx.CurrentPage, obj, view, conn);
......@@ -371,6 +385,8 @@ namespace VIZ.Package.Module
{
this.controlController.TakeNormal(ApplicationDomainEx.CurrentTake, ApplicationDomainEx.CurrentPage, obj, view, conn);
}
}
this.controlController.TakeCommnad(ApplicationDomainEx.CurrentPage, conn);
},
over: () =>
{
......
......@@ -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();
......
......@@ -14,6 +14,12 @@ namespace VIZ.Package.Module
public interface IPageGroupService : IService
{
/// <summary>
/// 创建并添加命令模板页
/// </summary>
/// <returns>页</returns>
PageModel AddCmdPage();
/// <summary>
/// 添加页
/// </summary>
/// <param name="template">模板</param>
......
......@@ -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 Bitmap2ImageSourceConverter}}"
<fcommon:ResizeImageControl ImageSource="{Binding Path=Row,Converter={StaticResource PageThumbnailConverter}}"
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}"/>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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();
......
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);
}
}
}
......@@ -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
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
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;
pageCommandService.BeginExecuteTakeCommand(ApplicationDomainEx.CurrentPage, conn);
this.vizPreviewCmdController.TakeCommnad(ApplicationDomainEx.CurrentPage, conn);
}
catch (Exception ex)
{
......@@ -386,15 +389,13 @@ namespace VIZ.Package.Module
this.Execute((obj, view, conn) =>
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
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;
pageCommandService.BeginExecuteTakeContinueCommand(ApplicationDomainEx.CurrentPage, conn);
this.vizPreviewCmdController.ContinueCommnad(ApplicationDomainEx.CurrentPage, conn);
});
}
......@@ -417,15 +418,13 @@ namespace VIZ.Package.Module
this.Execute((obj, view, conn) =>
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
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;
pageCommandService.BeginExecuteTakeOutCommand(ApplicationDomainEx.CurrentPage, conn);
this.vizPreviewCmdController.TakeOutCommnad(ApplicationDomainEx.CurrentPage, conn);
});
}
......@@ -457,6 +456,9 @@ namespace VIZ.Package.Module
// 执行更新流程
this.Execute((obj, view, conn) =>
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
this.vizCommandService.SetEnabledUpdate(conn, false);
try
{
......@@ -472,13 +474,9 @@ 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);
this.vizPreviewCmdController.UpdateCommnad(ApplicationDomainEx.CurrentPage, conn);
});
}
......@@ -575,7 +573,10 @@ namespace VIZ.Package.Module
ThreadHelper.SafeRun(() =>
{
if (msg.Page.PageType == PageType.Scene)
{
this.vizCommandService.SetObject(ApplicationDomainEx.PreviewConn, msg.Page.ScenePath, VizLayer.MAIN_LAYER);
}
// 发送节目单项初始化完成消息
WPFHelper.BeginInvoke(() =>
......
......@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment