Commit f874f846 by liulongfei

场景层添加

parent f3befbca
......@@ -141,7 +141,7 @@ namespace VIZ.Package.Connection
string errorMessage = null;
VizImage img = this.vizEnginePool.RequestImage(message, IMAGE_GET_TIME_OUT, ref errorMessage);
if (!string.IsNullOrWhiteSpace(errorMessage))
if (img == null || !string.IsNullOrWhiteSpace(errorMessage))
return null;
return img.Image;
......
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Package.Storage;
namespace VIZ.Package.Domain
{
......@@ -39,7 +40,7 @@ namespace VIZ.Package.Domain
/// <returns>场景父级</returns>
public static string GetSceneParent(this PageModelBase pageBase)
{
string parent = ApplicationDomainEx.CurrentPage.ScenePath.Substring(0, ApplicationDomainEx.CurrentPage.ScenePath.LastIndexOf('/'));
string parent = pageBase.ScenePath.Substring(0, pageBase.ScenePath.LastIndexOf('/'));
return parent;
}
......@@ -58,5 +59,24 @@ namespace VIZ.Package.Domain
return Guid.Empty;
}
/// <summary>
/// 获取Viz场景层
/// </summary>
/// <param name="pageBase">页模型基类</param>
/// <returns>Viz场景层</returns>
public static VizScene GetVizScene(this PageModelBase pageBase)
{
if (pageBase == null)
return VizScene.MAIN_SCENE;
switch (pageBase.Layer)
{
case VizLayer.FRONT_LAYER: return VizScene.FRONT_SCENE;
case VizLayer.MAIN_LAYER: return VizScene.MAIN_SCENE;
case VizLayer.BACK_LAYER: return VizScene.BACK_SCENE;
default: return VizScene.MAIN_SCENE;
}
}
}
}
......@@ -50,7 +50,7 @@ namespace VIZ.Package.Module
this.vizCommandService.SetObject(conn, ApplicationDomainEx.CurrentPage.ScenePath, ApplicationDomainEx.CurrentPage.Layer);
if (obj != null)
{
this.vizCommandControlObjectService.SetControlObject(conn, obj);
this.vizCommandControlObjectService.SetControlObject(conn, obj, newPageBase.GetVizScene());
this.vizCommandControlObjectService.SetCustomControlFieldValue(conn, obj.AllFiledNodes);
}
if (view != null)
......@@ -350,7 +350,7 @@ namespace VIZ.Package.Module
{
if (obj != null)
{
this.vizCommandControlObjectService.SetControlObject(conn, obj);
this.vizCommandControlObjectService.SetControlObject(conn, obj, newPageBase.GetVizScene());
this.vizCommandControlObjectService.SetCustomControlFieldValue(conn, obj.AllFiledNodes);
}
view?.TakeUpdate(conn);
......
......@@ -128,6 +128,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -170,6 +170,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -266,6 +266,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -115,6 +115,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -122,6 +122,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -171,6 +171,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -115,6 +115,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -71,6 +71,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -81,6 +81,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -69,6 +69,7 @@ namespace VIZ.Package.Module
// 向Viz发送指令
this.VizCommandControlObjectService.SetControlObjectListValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
columnDefinition.ControlObject.TreeNodePath,
columnDefinition.ControlField.FieldIdentifier,
cellData.RowData.RowHandle.Value,
......
......@@ -155,6 +155,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -128,6 +128,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -437,7 +437,10 @@ namespace VIZ.Package.Module
this.TryUpdateScrollElementPackage();
IPageTemplateService service = ApplicationDomainEx.ServiceManager.GetService<IPageTemplateService>(ViewServiceKeys.PAGE_TEMPLATE_SERVICE);
this.SceneTemplateModels = service.SceneTemplateModels.Where(p => p.ScenePath != ApplicationDomainEx.CurrentPage?.ScenePath).ToObservableCollection();
this.SceneTemplateModels = service.SceneTemplateModels.Where(p => p.ScenePath != ApplicationDomainEx.CurrentPage?.ScenePath &&
p.GetSceneParent() == ApplicationDomainEx.CurrentPage.GetSceneParent()).ToObservableCollection();
if (this.ScrollElementPackage != null)
{
this.SelectedSceneTemplateModel = this.SceneTemplateModels.FirstOrDefault(p => p.ScenePath == this.ScrollElementPackage.TemplateScenePath);
......
......@@ -117,6 +117,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -292,6 +292,7 @@ namespace VIZ.Package.Module
{
this.VizCommandControlObjectService.SetControlObjectValue(
ApplicationDomainEx.PreviewConn,
ApplicationDomainEx.CurrentPage.GetVizScene(),
this.ControlObject.TreeNodePath,
this.ControlField.FieldIdentifier,
this.ControlField.Value);
......
......@@ -174,7 +174,7 @@ namespace VIZ.Package.Module
});
// 将当前值上至预览
this.vizCommandControlObjectService.SetControlObject(ApplicationDomainEx.PreviewConn, this.ControlObject);
this.vizCommandControlObjectService.SetControlObject(ApplicationDomainEx.PreviewConn, this.ControlObject, ApplicationDomainEx.CurrentPage.GetVizScene());
// 插件处理
PageModel pageModel = msg.Page as PageModel;
......
......@@ -21,7 +21,7 @@
<!-- 系统版本 -->
<TextBlock Text="系统版本:" VerticalAlignment="Center" HorizontalAlignment="Right"
Grid.Row="1" Grid.Column="0" Margin="0,0,10,0"></TextBlock>
<TextBlock Text="V1.1.0.03171405_beta" VerticalAlignment="Center" HorizontalAlignment="Left"
<TextBlock Text="V1.2.0.03231400_beta" VerticalAlignment="Center" HorizontalAlignment="Left"
Grid.Row="1" Grid.Column="1"></TextBlock>
</Grid>
</dx:ThemedWindow>
......@@ -268,7 +268,7 @@ namespace VIZ.Package.Module
if (vm == null)
return;
ApplicationDomainEx.ProjectDbContext.Dispose();
ApplicationDomainEx.ProjectDbContext?.Dispose();
this.OpenProject(vm.SelectedFileModel.Path);
}
......
......@@ -356,7 +356,7 @@ namespace VIZ.Package.Module
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
this.vizCommandService.Start(conn, null, VizLayer.MAIN_LAYER);
this.vizCommandService.Start(conn, null, ApplicationDomainEx.CurrentPage.Layer);
view?.PreviewIn(conn);
}
......@@ -391,7 +391,7 @@ namespace VIZ.Package.Module
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
this.vizCommandService.Continue(conn, null, VizLayer.MAIN_LAYER);
this.vizCommandService.Continue(conn, null, ApplicationDomainEx.CurrentPage.Layer);
view?.PreviewContinue(conn);
}
......@@ -420,7 +420,7 @@ namespace VIZ.Package.Module
{
if (ApplicationDomainEx.CurrentPage.PageType == PageType.Scene)
{
this.vizCommandService.Stop(conn, null, VizLayer.MAIN_LAYER);
this.vizCommandService.Stop(conn, null, ApplicationDomainEx.CurrentPage.Layer);
view?.PreviewOut(conn);
}
......@@ -464,7 +464,7 @@ namespace VIZ.Package.Module
{
if (obj != null)
{
this.vizCommandControlObjectService.SetControlObject(conn, obj);
this.vizCommandControlObjectService.SetControlObject(conn, obj, ApplicationDomainEx.CurrentPage.GetVizScene());
this.vizCommandControlObjectService.SetCustomControlFieldValue(conn, obj.AllFiledNodes);
}
view?.PreviewUpdate(conn);
......@@ -575,7 +575,14 @@ namespace VIZ.Package.Module
{
if (msg.Page.PageType == PageType.Scene)
{
this.vizCommandService.SetObject(ApplicationDomainEx.PreviewConn, msg.Page.ScenePath, VizLayer.MAIN_LAYER);
List<VizLayer> layers = new List<VizLayer> { VizLayer.FRONT_LAYER, VizLayer.MAIN_LAYER, VizLayer.BACK_LAYER };
layers.Remove(msg.Page.Layer);
foreach (VizLayer layer in layers)
{
this.vizCommandService.SetObjectEmpty(ApplicationDomainEx.PreviewConn, layer);
}
this.vizCommandService.SetObject(ApplicationDomainEx.PreviewConn, msg.Page.ScenePath, msg.Page.Layer);
}
// 发送节目单项初始化完成消息
......
......@@ -31,6 +31,19 @@ namespace VIZ.Package.Service
}
/// <summary>
/// 设置空场景
/// </summary>
/// <param name="conn">连接</param>
/// <param name="layer">图层</param>
public void SetObjectEmpty(ConnModel conn, VizLayer layer)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
conn.EndpointManager.Request($"RENDERER*{layer} SET_OBJECT");
}
/// <summary>
/// 重新加载场景
/// </summary>
/// <param name="conn">连接</param>
......
......@@ -110,7 +110,7 @@ namespace VIZ.Package.Service
ConnModel conn = ApplicationDomainEx.PreviewConn;
// 获取控制对象ID
List<string> ids = this.vizCommandControlObjectService.GetControlObjectIds(conn);
List<string> ids = this.vizCommandControlObjectService.GetControlObjectIds(conn, VizScene.MAIN_SCENE);
string objectId = ids.FirstOrDefault();
if (string.IsNullOrWhiteSpace(objectId))
......@@ -122,7 +122,7 @@ namespace VIZ.Package.Service
string groupPath = this.vizCommandService.GroupAdd(conn, pageBase.ScenePath, objectId, VizGroupMoveDirection.BOTTOM);
// SCENE*TITLES/2022/YC/YC_CUP2*TREE GET
List<VizTreeNodeInfo> treeNodeList = this.vizCommandControlObjectService.GetTreeNodeList(conn);
List<VizTreeNodeInfo> treeNodeList = this.vizCommandControlObjectService.GetTreeNodeList(conn, VizScene.MAIN_SCENE);
VizTreeNodeInfo groupNode = treeNodeList.FirstOrDefault(p => p.Path == groupPath);
if (groupNode == null)
return;
......
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