导航场景映射与嵌入画布模式支持优化
- .gitignore 忽略 wwwroot,前端产物不入库 - 导航方式映射调整,磁导航/二维码/激光场景合并 - active-scenes.json 默认加入 scene.device - SimpleLite 启动支持 --migu 嵌入画布模式 - 新增 EmbeddedCanvas 配置项,默认启用
This commit is contained in:
@@ -35,15 +35,17 @@ public record DeploymentProfile(
|
||||
UpdatedBy: "");
|
||||
|
||||
/// <summary>
|
||||
/// 导航方式 → SimpleLite 场景 id 映射。与 <c>scene.json.id</c>、<c>SimpleCore.Navigation.NavKind</c>
|
||||
/// 导航方式 → SimpleLite 场景 id 映射。与 <c>*.scene.json.id</c>、<c>SimpleCore.Navigation.NavKind</c>
|
||||
/// 以及内核 <c>active-scenes.json.activeScenes</c> 一致;这是平台与内核之间「导航选型」的契约约定。
|
||||
/// <para>两平台制(StandardScene 拆分落地):磁导航 → <c>scene.mag</c>;
|
||||
/// 二维码与激光共用融合平台 <c>scene.qrlidar</c>(激光坐标导航 + 二维码按轨道逐段触发,可融合可单用)。</para>
|
||||
/// </summary>
|
||||
public static readonly IReadOnlyDictionary<string, string> NavKindToSceneId =
|
||||
new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
["magnetic"] = "scene.magnetic",
|
||||
["qrcode"] = "scene.qrcode",
|
||||
["laser"] = "scene.laser",
|
||||
["magnetic"] = "scene.mag",
|
||||
["qrcode"] = "scene.qrlidar",
|
||||
["laser"] = "scene.qrlidar",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -83,7 +83,10 @@ public class WizardController : ControllerBase
|
||||
|
||||
// 平台 → 内核联动:把导航选型写入 SimpleLite 的 plugins/active-scenes.json(下次启动选择性加载;
|
||||
// 已运行实例可由前端再调 POST /api/sl/projection/scenes/apply 触发增量 reload)。
|
||||
var sceneIds = profile.ToActiveSceneIds();
|
||||
// scene.device(门/充电桩/按钮盒驱动)为各类项目通用能力,向导暂无独立选项,固定并入激活集合;
|
||||
// scene.vda5050 等协议插件保持按需(不在集合则不加载)。基座 StandardScene.dll 由内核按
|
||||
// 清单 requiresCore 自动 alwaysLoad,无需在此声明。
|
||||
var sceneIds = profile.ToActiveSceneIds().Concat(new[] { "scene.device" }).Distinct().ToList();
|
||||
var write = _launcher.WriteActiveScenes(sceneIds, alwaysLoad: null, source: "deployment-profile");
|
||||
|
||||
_log.LogInformation("部署向导已保存 by={User} nav=[{Nav}] scenes=[{Scenes}] activeScenesWritten={Ok}",
|
||||
|
||||
@@ -261,6 +261,9 @@ public sealed class SimpleLiteLauncher : IDisposable
|
||||
private string BuildArguments(string displayMode, string extra)
|
||||
{
|
||||
var args = $"--display-mode={displayMode}";
|
||||
// 迷榖嵌入:平台 iframe 场景默认带 --migu,让 SimpleLite WebTerminal 默认纯画布(隐藏 ImGui panel),
|
||||
// 业务 UI 由 Vue 平台前端接管;declare 时序失败时也安全回退到画布。可用 appsettings:SimpleLite:EmbeddedCanvas=false 关闭。
|
||||
if (_opts.EmbeddedCanvas) args += " --migu";
|
||||
// 选择性加载:把平台写入的 plugins/active-scenes.json 同步透传为 --scenes(命令行优先级最高,与文件一致,双保险)。
|
||||
var sceneArg = ReadActiveScenesArg();
|
||||
if (!string.IsNullOrEmpty(sceneArg)) args += " " + sceneArg;
|
||||
|
||||
@@ -57,4 +57,15 @@ public sealed class SimpleLiteOptions
|
||||
/// 一般只在临时联调期 / CI 流水线想自动清理时打开。
|
||||
/// </summary>
|
||||
public bool FollowParent { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 平台拉起 SimpleLite 时是否以「迷榖嵌入画布」模式运行(透传命令行 <c>--migu</c>),默认 <b>true</b>。
|
||||
///
|
||||
/// true:平台 iframe 嵌入场景,SimpleLite WebTerminal 默认只显示 3D 画布、隐藏所有 ImGui panel,
|
||||
/// 业务 UI 全部由 Vue 平台前端接管;declare 时序失败时也安全回退到纯画布。
|
||||
/// false:平台拉起的 SimpleLite web 端默认显示完整 panel(便于把平台拉起的实例直连 :8223 调试)。
|
||||
///
|
||||
/// 与 LaunchMode(web / web+local,是否保留本地调试窗口)正交,可任意组合。
|
||||
/// </summary>
|
||||
public bool EmbeddedCanvas { get; set; } = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user