Commit d0350da0 by liulongfei

上版下绊控制

parent a9a2bb83
...@@ -21,7 +21,7 @@ namespace VIZ.Package.Domain ...@@ -21,7 +21,7 @@ namespace VIZ.Package.Domain
/// 继续 /// 继续
/// </summary> /// </summary>
/// <param name="conn">连接</param> /// <param name="conn">连接</param>
void Continue(ConnModel conn); void TakeContinue(ConnModel conn);
/// <summary> /// <summary>
/// 下版子 /// 下版子
...@@ -33,6 +33,24 @@ namespace VIZ.Package.Domain ...@@ -33,6 +33,24 @@ namespace VIZ.Package.Domain
/// 更新 /// 更新
/// </summary> /// </summary>
/// <param name="conn">连接</param> /// <param name="conn">连接</param>
void Update(ConnModel conn); void TakeUpdate(ConnModel conn);
/// <summary>
/// 预览上版子
/// </summary>
/// <param name="conn">连接</param>
void PreviewIn(ConnModel conn);
/// <summary>
/// 预览继续
/// </summary>
/// <param name="conn">连接</param>
void PreviewContinue(ConnModel conn);
/// <summary>
/// 预览下版
/// </summary>
/// <param name="conn">连接</param>
void PreviewOut(ConnModel conn);
} }
} }
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
d:DesignHeight="35" d:DesignWidth="800"> d:DesignHeight="35" d:DesignWidth="800">
<Grid> <Grid>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Button Height="30" Width="80" Content="Take" Margin="10,0,10,0" <Button Height="20" Width="80" Content="Take" Margin="10,0,10,0"
Command="{Binding TakeCommand}"></Button> Command="{Binding TakeCommand}"></Button>
<Button Height="30" Width="80" Content="Continue" Margin="10,0,10,0" <Button Height="20" Width="80" Content="Continue" Margin="10,0,10,0"
Command="{Binding ContinueCommand}"></Button> Command="{Binding ContinueCommand}"></Button>
<Button Height="30" Width="80" Content="Take Out" Margin="10,0,10,0" <Button Height="20" Width="80" Content="Take Out" Margin="10,0,10,0"
Command="{Binding TakeOutCommand}"></Button> Command="{Binding TakeOutCommand}"></Button>
<Button Height="30" Width="80" Content="Update" Margin="10,0,10,0" <Button Height="20" Width="80" Content="Update" Margin="10,0,10,0"
Command="{Binding UpdateCommand}"></Button> Command="{Binding UpdateCommand}"></Button>
</StackPanel> </StackPanel>
</Grid> </Grid>
......
...@@ -104,7 +104,7 @@ namespace VIZ.Package.Module ...@@ -104,7 +104,7 @@ namespace VIZ.Package.Module
}, },
pluginAction: (view, conn) => pluginAction: (view, conn) =>
{ {
view.Continue(conn); view.TakeContinue(conn);
}); });
} }
...@@ -154,7 +154,7 @@ namespace VIZ.Package.Module ...@@ -154,7 +154,7 @@ namespace VIZ.Package.Module
}, },
pluginAction: (view, conn) => pluginAction: (view, conn) =>
{ {
view.Update(conn); view.TakeUpdate(conn);
}); });
} }
......
...@@ -107,6 +107,7 @@ ...@@ -107,6 +107,7 @@
</dxg:GridControl.ContextMenu> </dxg:GridControl.ContextMenu>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
IsColumnMenuEnabled="False"
NavigationStyle="Cell" EditorShowMode="MouseDown" NavigationStyle="Cell" EditorShowMode="MouseDown"
ShowGroupPanel="False" ShowGroupPanel="False"
AllowDrop="True" AllowDrop="True"
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TreeListView AllowEditing="False" ShowIndicator="True" <dxg:TreeListView AllowEditing="False" ShowIndicator="True"
IsColumnMenuEnabled="False"
NavigationStyle="Row" NavigationStyle="Row"
ShowBandsPanel="False" ShowBandsPanel="False"
ShowTotalSummary="False" ShowTotalSummary="False"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
xmlns:local="clr-namespace:VIZ.Package.Module" xmlns:local="clr-namespace:VIZ.Package.Module"
d:DataContext="{d:DesignInstance Type=local:PageAddViewModel}" d:DataContext="{d:DesignInstance Type=local:PageAddViewModel}"
mc:Ignorable="d" WindowStartupLocation="CenterScreen" mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="添加页" Height="300" Width="600"> Title="添加页" Height="330" Width="600">
<dxmvvm:Interaction.Behaviors> <dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Loaded" Command="{Binding Path=LoadedCommand}"></dxmvvm:EventToCommand> <dxmvvm:EventToCommand EventName="Loaded" Command="{Binding Path=LoadedCommand}"></dxmvvm:EventToCommand>
......
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
IsColumnMenuEnabled="False"
NavigationStyle="Cell" EditorShowMode="MouseDown" NavigationStyle="Cell" EditorShowMode="MouseDown"
ShowGroupPanel="False" ShowGroupPanel="False"
AllowDragDrop="True" AllowDragDrop="True"
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
IsColumnMenuEnabled="False"
NavigationStyle="Cell" EditorShowMode="MouseDown" NavigationStyle="Cell" EditorShowMode="MouseDown"
ShowGroupPanel="False" ShowGroupPanel="False"
AllowDragDrop="True" AllowDragDrop="True"
...@@ -116,6 +117,7 @@ ...@@ -116,6 +117,7 @@
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
IsColumnMenuEnabled="False"
NavigationStyle="Cell" EditorShowMode="MouseDown" NavigationStyle="Cell" EditorShowMode="MouseDown"
ShowGroupPanel="False" ShowGroupPanel="False"
AllowDragDrop="True" AllowDragDrop="True"
......
using System; using log4net;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
...@@ -16,6 +17,11 @@ namespace VIZ.Package.Module ...@@ -16,6 +17,11 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
public class VizPreviewViewModel : ViewModelBase public class VizPreviewViewModel : ViewModelBase
{ {
/// <summary>
/// 日志
/// </summary>
private readonly static ILog log = LogManager.GetLogger(typeof(VizPreviewViewModel));
public VizPreviewViewModel() public VizPreviewViewModel()
{ {
// 初始化控制器 // 初始化控制器
...@@ -192,11 +198,15 @@ namespace VIZ.Package.Module ...@@ -192,11 +198,15 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void Play() private void Play()
{ {
// 引擎未准备好 || 当前没有选中的节目单项目 则不处理 this.Execute(
if (!this.IsEngineReady || ApplicationDomainEx.CurrentPage == null) action: (conn) =>
return; {
this.vizCommandService.Start(conn, null, VizLayer.MAIN_LAYER);
this.vizCommandService.Start(ApplicationDomainEx.PreviewConn, null, VizLayer.MAIN_LAYER); },
pluginAction: (view, conn) =>
{
view.PreviewIn(conn);
});
} }
#endregion #endregion
...@@ -213,11 +223,15 @@ namespace VIZ.Package.Module ...@@ -213,11 +223,15 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void Continue() private void Continue()
{ {
// 引擎未准备好 || 当前没有选中的节目单项目 则不处理 this.Execute(
if (!this.IsEngineReady || ApplicationDomainEx.CurrentPage == null) action: (conn) =>
return; {
this.vizCommandService.Continue(conn, null, VizLayer.MAIN_LAYER);
this.vizCommandService.Continue(ApplicationDomainEx.PreviewConn, null, VizLayer.MAIN_LAYER); },
pluginAction: (view, conn) =>
{
view.PreviewContinue(conn);
});
} }
#endregion #endregion
...@@ -234,11 +248,15 @@ namespace VIZ.Package.Module ...@@ -234,11 +248,15 @@ namespace VIZ.Package.Module
/// </summary> /// </summary>
private void Stop() private void Stop()
{ {
// 引擎未准备好 || 当前没有选中的节目单项目 则不处理 this.Execute(
if (!this.IsEngineReady || ApplicationDomainEx.CurrentPage == null) action: (conn) =>
return; {
this.vizCommandService.Stop(conn, null, VizLayer.MAIN_LAYER);
this.vizCommandService.Stop(ApplicationDomainEx.PreviewConn, null, VizLayer.MAIN_LAYER); },
pluginAction: (view, conn) =>
{
view.PreviewOut(conn);
});
} }
#endregion #endregion
...@@ -509,5 +527,58 @@ namespace VIZ.Package.Module ...@@ -509,5 +527,58 @@ namespace VIZ.Package.Module
this.vizPreviewController.StartVizEngine(view, path, conn); this.vizPreviewController.StartVizEngine(view, path, conn);
} }
// ================================================================================
// Private Function
// ================================================================================
/// <summary>
/// 执行
/// </summary>
/// <param name="action">播放行为</param>
/// <param name="pluginAction">插件行为</param>
private void Execute(Action<ConnModel> action, Action<IPluginView, ConnModel> pluginAction)
{
// 引擎未准备好 || 当前没有选中的节目单项目 则不处理
if (!this.IsEngineReady || ApplicationDomainEx.CurrentPage == null)
return;
// 预览连接为准备好
if (ApplicationDomainEx.PreviewConn == null || !ApplicationDomainEx.PreviewConn.IsConnected)
return;
// Step 1. 播放行为
try
{
action(ApplicationDomainEx.PreviewConn);
}
catch (Exception ex)
{
log.Error(ex);
}
// Step 2. 插件行为
if (!(ApplicationDomainEx.CurrentPage is PageModel page))
return;
if (string.IsNullOrWhiteSpace(page.PluginID))
return;
IPluginService pluginService = ApplicationDomainEx.ServiceManager.GetService<IPluginService>(ViewServiceKeys.PLUGIN_SERVICE);
if (pluginService == null)
return;
IPluginView view = pluginService.GetCurrentPluginView() as IPluginView;
if (view == null)
return;
try
{
pluginAction(view, ApplicationDomainEx.PreviewConn);
}
catch (Exception ex)
{
log.Error(ex);
}
}
} }
} }
...@@ -62,19 +62,23 @@ ...@@ -62,19 +62,23 @@
HorizontalContentAlignment="Left"></dxe:TextEditSettings> HorizontalContentAlignment="Left"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings> </dxg:GridColumn.EditSettings>
</dxg:GridColumn> </dxg:GridColumn>
<dxg:GridColumn Header="是否启用" Width="80" Binding="{Binding IsEnabled,Converter={StaticResource Bool2StringConverter}}" AllowSorting="False" AllowColumnFiltering="False"></dxg:GridColumn> <dxg:GridColumn Header="是否启用" Width="80" Binding="{Binding IsEnabled,Converter={StaticResource Bool2StringConverter}}"
<dxg:GridColumn Header="引擎类型" FieldName="EngineType" AllowSorting="False" AllowColumnFiltering="False"></dxg:GridColumn> AllowSorting="False" AllowColumnFiltering="False" ReadOnly="True"></dxg:GridColumn>
<dxg:GridColumn Header="引擎类型" FieldName="EngineType" AllowSorting="False" AllowColumnFiltering="False"
ReadOnly="True"></dxg:GridColumn>
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
NavigationStyle="Cell" IsColumnMenuEnabled="False"
ShowGroupPanel="False" ShowGroupPanelsForUngroupedDetails="False"
AllowDragDrop="False" NavigationStyle="Cell"
ShowBandsPanel="False" ShowGroupPanel="False"
ShowTotalSummary="False" AllowDragDrop="False"
ShowFixedTotalSummary="False" ShowBandsPanel="False"
ShowDragDropHint="False" ShowTotalSummary="False"
ShowTargetInfoInDragDropHint="false"> ShowFixedTotalSummary="False"
ShowDragDropHint="False"
ShowTargetInfoInDragDropHint="false">
</dxg:TableView> </dxg:TableView>
</dxg:GridControl.View> </dxg:GridControl.View>
</dxg:GridControl> </dxg:GridControl>
...@@ -126,14 +130,15 @@ ...@@ -126,14 +130,15 @@
</dxg:GridControl.Columns> </dxg:GridControl.Columns>
<dxg:GridControl.View> <dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True" <dxg:TableView AllowEditing="True" ShowIndicator="True"
NavigationStyle="Cell" IsColumnMenuEnabled="False"
ShowGroupPanel="False" NavigationStyle="Cell"
AllowDragDrop="False" ShowGroupPanel="False"
ShowBandsPanel="False" AllowDragDrop="False"
ShowTotalSummary="False" ShowBandsPanel="False"
ShowFixedTotalSummary="False" ShowTotalSummary="False"
ShowDragDropHint="False" ShowFixedTotalSummary="False"
ShowTargetInfoInDragDropHint="false"> ShowDragDropHint="False"
ShowTargetInfoInDragDropHint="false">
</dxg:TableView> </dxg:TableView>
</dxg:GridControl.View> </dxg:GridControl.View>
</dxg:GridControl> </dxg:GridControl>
......
...@@ -170,10 +170,6 @@ ...@@ -170,10 +170,6 @@
<Project>{327ea1f4-f23c-418a-a2ef-da4f1039b333}</Project> <Project>{327ea1f4-f23c-418a-a2ef-da4f1039b333}</Project>
<Name>VIZ.Package.Module.Resource</Name> <Name>VIZ.Package.Module.Resource</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\VIZ.Package.Module\VIZ.Package.Module.csproj">
<Project>{6fd4c0f0-8a00-4db8-924b-a3cd9a45297f}</Project>
<Name>VIZ.Package.Module</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Plugin\VIZ.Package.Plugin.csproj"> <ProjectReference Include="..\VIZ.Package.Plugin\VIZ.Package.Plugin.csproj">
<Project>{9c7d3994-340a-480f-8d06-92c562137810}</Project> <Project>{9c7d3994-340a-480f-8d06-92c562137810}</Project>
<Name>VIZ.Package.Plugin</Name> <Name>VIZ.Package.Plugin</Name>
......
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