Commit ea748a40 by liulongfei

对viz4支持

parent ddb79947
......@@ -41,6 +41,11 @@ namespace VIZ.TVP.Domain
public static SelectionManager SelectionManager { get; private set; } = new SelectionManager();
/// <summary>
/// 本地VIZ渲染器管理器
/// </summary>
public static LocalVizManager LocalVizManager { get; private set; } = new LocalVizManager();
/// <summary>
/// 当前项目领域
/// </summary>
public static ProjectDomain CurrentProjectDomain { get; set; }
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 本地VIZ管理器
/// </summary>
public class LocalVizManager
{
/// <summary>
/// VIZ渲染器名字
/// </summary>
public string VizRendererName { get; set; }
}
}
......@@ -75,6 +75,7 @@
<Compile Include="Enum\PluginIDs.cs" />
<Compile Include="Enum\ServiceKeys.cs" />
<Compile Include="Manager\DataBaseManager.cs" />
<Compile Include="Manager\LocalVizManager.cs" />
<Compile Include="Manager\PluginManager.cs" />
<Compile Include="Manager\SelectionManager.cs" />
<Compile Include="Manager\TVPConnectionManager.cs" />
......
using DevExpress.Mvvm.Native;
using DevExpress.Printing.StreamingPagination;
using log4net;
using System;
using System.Collections.Generic;
......@@ -51,8 +52,6 @@ namespace VIZ.TVP.Module
/// <param name="connectionModel">连接模型</param>
public void StartVizEngine(VizRenderView view, string path, TVPConnectionModel connectionModel)
{
LocalInfoEntity info = ApplicationDomainEx.DataBaseManager.LocalInfo;
this.Support.IsEngineReady = false;
var dpi = WPFHelper.GetDpiByGraphics();
......@@ -66,6 +65,8 @@ namespace VIZ.TVP.Module
ThreadHelper.SafeRun(() =>
{
LocalInfoEntity info = ApplicationDomainEx.DataBaseManager.LocalInfo;
// Step 1. 启动进程
this.VizProcess = new Process();
this.VizProcess.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(path);
......@@ -99,8 +100,18 @@ namespace VIZ.TVP.Module
{
System.Threading.Thread.Sleep(1000);
string cmd = $"RENDERER WINDOW_OPEN_ON_PARENT 0x{hWnd.ToString("X6")} {width} {height} ONAIR";
connectionModel.EndpointManager.Send(cmd);
if (info.LocalEngineType == LocalEngineType.Eng3)
{
string cmd = $"RENDERER WINDOW_OPEN_ON_PARENT 0x{hWnd.ToString("X6")} {width} {height} ONAIR";
connectionModel.EndpointManager.Send(cmd);
}
else if (info.LocalEngineType == LocalEngineType.Eng4)
{
// 创建 EDITOR
ApplicationDomainEx.LocalVizManager.VizRendererName = connectionModel.EndpointManager.Request("EDITOR CREATE RENDERER");
string cmd = $"{ApplicationDomainEx.LocalVizManager.VizRendererName} WINDOW_OPEN_ON_PARENT 0x{hWnd.ToString("X6")} {width} {height} ONAIR";
connectionModel.EndpointManager.Send(cmd);
}
WPFHelper.Invoke(() =>
{
......
......@@ -157,6 +157,7 @@ namespace VIZ.TVP.Module
/// </summary>
private void WindowHostSizeChanged(System.Windows.SizeChangedEventArgs e)
{
LocalInfoEntity info = ApplicationDomainEx.DataBaseManager.LocalInfo;
TVPConnectionModel local = ApplicationDomainEx.TVPConnectionManager.LocalConnection;
if (local == null || !local.IsConnected)
......@@ -169,7 +170,14 @@ namespace VIZ.TVP.Module
ImageHelper.AdjustSize(width, height, 1920, 1080, out width, out height);
local.EndpointManager.Send($"RENDERER WINDOW_RESIZE {width} {height}");
if (info.LocalEngineType == LocalEngineType.Eng3)
{
local.EndpointManager.Send($"RENDERER WINDOW_RESIZE {width} {height}");
}
else
{
local.EndpointManager.Send($"{ApplicationDomainEx.LocalVizManager.VizRendererName} WINDOW_RESIZE {width} {height}");
}
}
#endregion
......
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