932 lines
26 KiB
HTML
932 lines
26 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>AGV 配置</title>
|
|
<style>
|
|
:root {
|
|
--bg: #0d1117;
|
|
--panel: #161b22;
|
|
--panel2: #1f2633;
|
|
--card: #1b2230;
|
|
--primary: #3b82f6;
|
|
--primary-hover: #2563eb;
|
|
--success: #10b981;
|
|
--warning: #f59e0b;
|
|
--danger: #ef4444;
|
|
--border: #30363d;
|
|
--text: #e6edf3;
|
|
--text-muted: #8b949e;
|
|
--text-dim: #6e7681;
|
|
--inspector-w: 360px;
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
height: 100vh;
|
|
overflow: hidden;
|
|
}
|
|
|
|
#app {
|
|
display: grid;
|
|
grid-template-rows: auto 1fr auto;
|
|
height: 100vh;
|
|
min-height: 0;
|
|
}
|
|
|
|
/* ── Top bar ── */
|
|
#topbar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
padding: 8px 12px;
|
|
background: var(--panel);
|
|
border-bottom: 1px solid var(--border);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.agv-info {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
#agvInfoName {
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
letter-spacing: 0.02em;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.agv-stats {
|
|
display: flex;
|
|
gap: 12px;
|
|
margin-top: 2px;
|
|
font-size: 11px;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.agv-stats span::before {
|
|
content: "";
|
|
display: inline-block;
|
|
width: 6px;
|
|
height: 6px;
|
|
border-radius: 50%;
|
|
background: var(--primary);
|
|
margin-right: 5px;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.agv-stats span:nth-child(2)::before {
|
|
background: var(--success);
|
|
}
|
|
|
|
.agv-stats span:nth-child(3)::before {
|
|
background: var(--warning);
|
|
}
|
|
|
|
.topbar-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
#agvModel {
|
|
background: var(--panel2);
|
|
color: var(--text);
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
padding: 5px 8px;
|
|
font-size: 12px;
|
|
min-width: 120px;
|
|
}
|
|
|
|
.topbar-link {
|
|
font-size: 11px;
|
|
color: var(--primary);
|
|
text-decoration: none;
|
|
white-space: nowrap;
|
|
padding: 5px 8px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
}
|
|
|
|
.topbar-link:hover {
|
|
background: var(--panel2);
|
|
}
|
|
|
|
#syncBaseline {
|
|
padding: 5px 14px;
|
|
border: none;
|
|
border-radius: 6px;
|
|
background: var(--primary);
|
|
color: #fff;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
#syncBaseline:hover {
|
|
background: var(--primary-hover);
|
|
}
|
|
|
|
/* ── Main layout ── */
|
|
#layout {
|
|
display: grid;
|
|
grid-template-columns: minmax(0, 1fr) var(--inspector-w);
|
|
min-height: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
#canvas-wrap {
|
|
position: relative;
|
|
min-width: 0;
|
|
min-height: 0;
|
|
background: #080b10;
|
|
border-right: 1px solid var(--border);
|
|
}
|
|
|
|
#canvas-wrap::after {
|
|
content: "点击选中 · 红X 绿Y 蓝Z";
|
|
position: absolute;
|
|
bottom: 8px;
|
|
left: 10px;
|
|
z-index: 2;
|
|
font-size: 10px;
|
|
color: var(--text-dim);
|
|
pointer-events: none;
|
|
}
|
|
|
|
#canvas-wrap canvas {
|
|
display: block;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
/* ── Inspector ── */
|
|
#inspector {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-width: 0;
|
|
min-height: 0;
|
|
background: var(--panel);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.tabs {
|
|
display: flex;
|
|
flex-shrink: 0;
|
|
border-bottom: 1px solid var(--border);
|
|
background: var(--panel);
|
|
}
|
|
|
|
.tab {
|
|
flex: 1;
|
|
padding: 9px 0;
|
|
border: none;
|
|
background: transparent;
|
|
color: var(--text-muted);
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
border-bottom: 2px solid transparent;
|
|
transition: color 0.15s;
|
|
}
|
|
|
|
.tab:hover {
|
|
color: var(--text);
|
|
background: var(--panel2);
|
|
}
|
|
|
|
.tab.active {
|
|
color: var(--text);
|
|
font-weight: 600;
|
|
border-bottom-color: var(--primary);
|
|
}
|
|
|
|
.tab-panel {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
padding: 10px;
|
|
scrollbar-gutter: stable;
|
|
}
|
|
|
|
/* ── Form elements ── */
|
|
label {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
font-size: 11px;
|
|
margin-bottom: 5px;
|
|
gap: 8px;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
label span {
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
select,
|
|
input[type="text"],
|
|
input[type="number"],
|
|
input[type="search"] {
|
|
flex: 1;
|
|
max-width: 62%;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
border: 1px solid var(--border);
|
|
border-radius: 5px;
|
|
padding: 4px 7px;
|
|
font-size: 12px;
|
|
}
|
|
|
|
input[type="color"] {
|
|
flex: none;
|
|
width: 38px;
|
|
height: 24px;
|
|
max-width: 38px;
|
|
padding: 1px;
|
|
background: var(--bg);
|
|
border: 1px solid var(--border);
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
input[type="checkbox"] {
|
|
accent-color: var(--primary);
|
|
}
|
|
|
|
button {
|
|
width: 100%;
|
|
padding: 6px 10px;
|
|
border: none;
|
|
border-radius: 6px;
|
|
background: var(--primary);
|
|
color: #fff;
|
|
cursor: pointer;
|
|
font-size: 12px;
|
|
margin-top: 6px;
|
|
}
|
|
|
|
button:hover {
|
|
background: var(--primary-hover);
|
|
}
|
|
|
|
button.secondary {
|
|
background: var(--panel2);
|
|
border: 1px solid var(--border);
|
|
color: var(--text);
|
|
}
|
|
|
|
button.secondary:hover {
|
|
background: var(--card);
|
|
}
|
|
|
|
button.primary-green {
|
|
background: #166534;
|
|
}
|
|
|
|
button.primary-green:hover {
|
|
background: #15803d;
|
|
}
|
|
|
|
.hidden {
|
|
display: none !important;
|
|
}
|
|
|
|
.hint {
|
|
color: var(--text-dim);
|
|
font-size: 10px;
|
|
line-height: 1.4;
|
|
margin: 2px 0 6px;
|
|
}
|
|
|
|
.ok {
|
|
color: var(--success);
|
|
}
|
|
|
|
.err {
|
|
color: var(--danger);
|
|
}
|
|
|
|
/* ── Setting groups ── */
|
|
.setting-group {
|
|
background: var(--panel2);
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
padding: 10px;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.setting-group-title {
|
|
font-size: 10px;
|
|
font-weight: 600;
|
|
letter-spacing: 0.06em;
|
|
text-transform: uppercase;
|
|
color: var(--text-dim);
|
|
margin-bottom: 8px;
|
|
padding-bottom: 6px;
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
|
|
/* ── Component cards ── */
|
|
.component-scroll {
|
|
max-height: 160px;
|
|
overflow-y: auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.component-card {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 8px 10px;
|
|
border-radius: 7px;
|
|
background: var(--card);
|
|
cursor: pointer;
|
|
border: 1px solid var(--border);
|
|
transition: border-color 0.12s, box-shadow 0.12s;
|
|
}
|
|
|
|
.component-card:hover {
|
|
border-color: #484f58;
|
|
background: #222b3a;
|
|
}
|
|
|
|
.component-card.active {
|
|
border-color: var(--primary);
|
|
box-shadow: 0 0 0 1px var(--primary);
|
|
background: #1a2744;
|
|
}
|
|
|
|
.component-card.in-draft {
|
|
border-color: #1d4ed8;
|
|
opacity: 0.85;
|
|
}
|
|
|
|
.component-card.compact {
|
|
padding: 6px 8px;
|
|
}
|
|
|
|
.component-card-icon {
|
|
font-size: 14px;
|
|
width: 22px;
|
|
text-align: center;
|
|
flex-shrink: 0;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.component-card-body {
|
|
min-width: 0;
|
|
flex: 1;
|
|
}
|
|
|
|
.component-card-name {
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.component-card-type {
|
|
font-size: 10px;
|
|
color: var(--text-dim);
|
|
margin-top: 1px;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.comp-meta {
|
|
font-size: 10px;
|
|
color: var(--text-muted);
|
|
margin-bottom: 6px;
|
|
word-break: break-all;
|
|
line-height: 1.45;
|
|
}
|
|
|
|
.comp-meta strong {
|
|
color: var(--text);
|
|
}
|
|
|
|
.comp-meta code {
|
|
font-size: 10px;
|
|
color: #79c0ff;
|
|
}
|
|
|
|
/* ── Workflow steps ── */
|
|
.workflow-step {
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.workflow-step-title {
|
|
font-size: 10px;
|
|
font-weight: 600;
|
|
color: var(--primary);
|
|
margin-bottom: 6px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
|
|
.workflow-step-title::before {
|
|
content: attr(data-step);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 16px;
|
|
height: 16px;
|
|
border-radius: 50%;
|
|
background: var(--primary);
|
|
color: #fff;
|
|
font-size: 9px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.row-btns {
|
|
display: flex;
|
|
gap: 6px;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.row-btns button {
|
|
flex: 1;
|
|
margin-top: 0;
|
|
}
|
|
|
|
/* ── Action cards ── */
|
|
#actionList {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 5px;
|
|
}
|
|
|
|
.action-card {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 9px 10px;
|
|
border-radius: 7px;
|
|
background: var(--card);
|
|
border: 1px solid var(--border);
|
|
cursor: pointer;
|
|
transition: border-color 0.12s;
|
|
}
|
|
|
|
.action-card:hover {
|
|
border-color: #484f58;
|
|
}
|
|
|
|
.action-card.active {
|
|
border-color: var(--success);
|
|
box-shadow: 0 0 0 1px var(--success);
|
|
}
|
|
|
|
.action-card-body {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.action-card-title {
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.action-card-meta {
|
|
font-size: 10px;
|
|
color: var(--text-dim);
|
|
margin-top: 1px;
|
|
}
|
|
|
|
.action-card-del {
|
|
width: 24px;
|
|
height: 24px;
|
|
flex-shrink: 0;
|
|
margin: 0;
|
|
padding: 0;
|
|
background: transparent;
|
|
border: 1px solid var(--border);
|
|
border-radius: 5px;
|
|
color: var(--danger);
|
|
font-size: 14px;
|
|
line-height: 1;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.action-card-del:hover {
|
|
background: #3d1515;
|
|
border-color: var(--danger);
|
|
}
|
|
|
|
.action-comp-chip {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 6px 8px;
|
|
border-radius: 6px;
|
|
background: var(--card);
|
|
border: 1px solid var(--border);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.action-comp-chip.active {
|
|
border-color: var(--success);
|
|
box-shadow: 0 0 0 1px var(--success);
|
|
}
|
|
|
|
.action-comp-chip .chip-del {
|
|
margin-left: auto;
|
|
border: none;
|
|
background: transparent;
|
|
color: var(--danger);
|
|
cursor: pointer;
|
|
font-size: 13px;
|
|
padding: 0 2px;
|
|
}
|
|
|
|
/* ── Status bar ── */
|
|
#statusbar {
|
|
padding: 4px 12px;
|
|
font-size: 10px;
|
|
color: var(--text-dim);
|
|
background: var(--panel);
|
|
border-top: 1px solid var(--border);
|
|
flex-shrink: 0;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
/* ── Toast ── */
|
|
#toast-container {
|
|
position: fixed;
|
|
bottom: 28px;
|
|
left: 12px;
|
|
z-index: 9999;
|
|
display: flex;
|
|
flex-direction: column-reverse;
|
|
align-items: flex-start;
|
|
gap: 8px;
|
|
pointer-events: none;
|
|
max-width: min(360px, calc(100vw - var(--inspector-w) - 24px));
|
|
}
|
|
|
|
.toast {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 8px;
|
|
padding: 10px 14px;
|
|
border-radius: 8px;
|
|
background: var(--panel2);
|
|
border: 1px solid var(--border);
|
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
|
|
font-size: 12px;
|
|
max-width: 320px;
|
|
opacity: 0;
|
|
transform: translateY(8px);
|
|
transition: opacity 0.25s, transform 0.25s;
|
|
}
|
|
|
|
.toast.show {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.toast-ok {
|
|
border-left: 3px solid var(--success);
|
|
}
|
|
|
|
.toast-warn {
|
|
border-left: 3px solid var(--warning);
|
|
}
|
|
|
|
.toast-err {
|
|
border-left: 3px solid var(--danger);
|
|
}
|
|
|
|
.toast-icon {
|
|
font-weight: 700;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.toast-ok .toast-icon {
|
|
color: var(--success);
|
|
}
|
|
|
|
.toast-warn .toast-icon {
|
|
color: var(--warning);
|
|
}
|
|
|
|
@media (max-width: 900px) {
|
|
#layout {
|
|
grid-template-columns: 1fr;
|
|
grid-template-rows: 1fr var(--inspector-w);
|
|
}
|
|
|
|
#canvas-wrap {
|
|
border-right: none;
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
|
|
#toast-container {
|
|
max-width: calc(100vw - 24px);
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app">
|
|
<header id="topbar">
|
|
<div class="agv-info">
|
|
<div id="agvInfoName">—</div>
|
|
<div class="agv-stats">
|
|
<span id="statComponents">组件 0</span>
|
|
<span id="statActions">动作 0</span>
|
|
<span id="statLights">灯光 0</span>
|
|
</div>
|
|
</div>
|
|
<div class="topbar-actions">
|
|
<select id="agvModel">
|
|
<option value="">加载列表...</option>
|
|
</select>
|
|
<a class="topbar-link" href="./play.html">播放</a>
|
|
<button type="button" id="syncBaseline">保存配置</button>
|
|
</div>
|
|
</header>
|
|
|
|
<div id="layout">
|
|
<div id="canvas-wrap"></div>
|
|
|
|
<aside id="inspector">
|
|
<div class="tabs">
|
|
<button type="button" id="tabBaseline" class="tab active">基础配置</button>
|
|
<button type="button" id="tabActions" class="tab">动作配置</button>
|
|
</div>
|
|
|
|
<div id="tabPanelBaseline" class="tab-panel">
|
|
<input type="search" id="componentFilter" placeholder="筛选组件 / GLB 节点 / 车壳"
|
|
style="width:100%;max-width:100%;margin-bottom:8px;" />
|
|
<div id="componentList" class="component-scroll"></div>
|
|
<p id="compMeta" class="comp-meta">—</p>
|
|
|
|
<div class="setting-group">
|
|
<div class="setting-group-title">组件类型</div>
|
|
<label><span>类型</span>
|
|
<select id="componentType">
|
|
<option value="static">静态件</option>
|
|
<option value="body">车体结构</option>
|
|
<option value="light">灯光</option>
|
|
<option value="wheel">轮子</option>
|
|
<option value="actuator">可动机构</option>
|
|
<option value="sensor">传感器</option>
|
|
<option value="safety">安全件</option>
|
|
</select>
|
|
</label>
|
|
</div>
|
|
|
|
<div class="setting-group" id="actionPanel">
|
|
<div class="setting-group-title">参数配置</div>
|
|
<div id="panelStatic" class="hint">静态件无动作参数,仅参与装配</div>
|
|
<div id="panelLight" class="hidden">
|
|
<label><span>颜色</span> <input id="compLightColor" type="color" value="#00ff55" /></label>
|
|
<label><span>光效</span>
|
|
<select id="compLightEffect">
|
|
<option value="solid">常亮</option>
|
|
<option value="breath">呼吸</option>
|
|
<option value="blink">闪烁</option>
|
|
<option value="strobe">爆闪</option>
|
|
<option value="flow_forward">前向流光</option>
|
|
<option value="flow_backward">反向流光</option>
|
|
<option value="blink_segment">分段闪</option>
|
|
</select>
|
|
</label>
|
|
<label><span>亮度</span> <input id="compLightIntensity" type="number" step="any" value="100" /></label>
|
|
<label id="compLightHzRow" class="hidden"><span>频率 Hz</span> <input id="compLightHz" type="number"
|
|
step="any" value="4" /></label>
|
|
<label id="compLightPeriodRow" class="hidden"><span>周期 s</span> <input id="compLightPeriod" type="number"
|
|
step="any" value="2" /></label>
|
|
</div>
|
|
<div id="panelWheel" class="hidden">
|
|
<label><span>旋转轴</span>
|
|
<select id="wheelAxis">
|
|
<option value="x">X</option>
|
|
<option value="y">Y</option>
|
|
<option value="z">Z</option>
|
|
</select>
|
|
</label>
|
|
<label><span>转速倍率</span> <input id="wheelSpeedFactor" type="number" step="any" value="1" /></label>
|
|
<label><span>转向角 (°)</span> <input id="wheelSteerAngleDeg" type="number" step="any" value="0" /></label>
|
|
</div>
|
|
<div id="panelMotion" class="hidden">
|
|
<label><span>机构角色</span>
|
|
<select id="componentMotionRole">
|
|
<option value="lift">顶升</option>
|
|
<option value="lidar">雷达</option>
|
|
<option value="camera">相机</option>
|
|
</select>
|
|
</label>
|
|
<label><span>运动方式</span>
|
|
<select id="componentMotionKind">
|
|
<option value="translate">平移</option>
|
|
<option value="rotate">旋转</option>
|
|
</select>
|
|
</label>
|
|
<label><span>轴向</span>
|
|
<select id="componentMotionAxis">
|
|
<option value="y">Y</option>
|
|
<option value="x">X</option>
|
|
<option value="z">Z</option>
|
|
</select>
|
|
</label>
|
|
<label id="liftStartRow" class="hidden"><span>起始 (m)</span> <input id="liftStart" type="number" step="any"
|
|
value="0" /></label>
|
|
<label id="liftEndRow" class="hidden"><span>终止 (m)</span> <input id="liftEnd" type="number" step="any"
|
|
value="0.15" /></label>
|
|
</div>
|
|
<div id="panelCamera" class="hidden">
|
|
<label><span>扫描摆动</span> <input type="checkbox" id="actionCamScan" checked /></label>
|
|
<label><span>LED 呼吸</span> <input type="checkbox" id="actionCamLedBreath" checked /></label>
|
|
<label><span>LED 颜色</span> <input id="actionCamLedColor" type="color" value="#00afff" /></label>
|
|
</div>
|
|
<div id="panelEmergency" class="hidden">
|
|
<label><span>颜色</span> <input id="actionEmerColor" type="color" value="#ff0000" /></label>
|
|
<label><span>效果</span>
|
|
<select id="actionEmerEffect">
|
|
<option value="blink">闪烁</option>
|
|
<option value="strobe">爆闪</option>
|
|
<option value="solid">常亮</option>
|
|
<option value="off">熄灭</option>
|
|
</select>
|
|
</label>
|
|
<label><span>频率 Hz</span> <input id="actionEmerHz" type="number" step="any" value="4" /></label>
|
|
</div>
|
|
</div>
|
|
<button type="button" id="applyComponent" class="primary-green">保存到基准</button>
|
|
</div>
|
|
|
|
<div id="tabPanelActions" class="tab-panel hidden">
|
|
<div class="workflow-step">
|
|
<div class="workflow-step-title" data-step="1">选择组件</div>
|
|
<div id="actionCompPickList" class="component-scroll" style="max-height:120px;"></div>
|
|
<div class="row-btns">
|
|
<button type="button" id="addAllActionComp" class="secondary">全部加入</button>
|
|
</div>
|
|
<p class="hint">点击组件加入动作 · 已选 <span id="actionSelectedCount">0</span> 个</p>
|
|
<div id="actionSelectedList" class="component-scroll" style="max-height:80px;min-height:32px;"></div>
|
|
</div>
|
|
|
|
<div class="workflow-step">
|
|
<div class="workflow-step-title" data-step="2">配置参数</div>
|
|
<div id="actionCfgBox" class="setting-group hidden">
|
|
<div class="setting-group-title" id="actionCfgTitle">—</div>
|
|
<label><span>类型</span>
|
|
<select id="actComponentType">
|
|
<option value="static">静态件</option>
|
|
<option value="body">车体结构</option>
|
|
<option value="light">灯光</option>
|
|
<option value="wheel">轮子</option>
|
|
<option value="actuator">可动机构</option>
|
|
<option value="sensor">传感器</option>
|
|
<option value="safety">安全件</option>
|
|
</select>
|
|
</label>
|
|
<div id="actPanelStatic" class="hidden">
|
|
<label><span>透明度</span> <input id="actOpacity" type="number" min="0" max="1" step="0.05"
|
|
value="0.25" /></label>
|
|
<button type="button" id="applyOpacityToAll" class="secondary">应用到全部静态件</button>
|
|
</div>
|
|
<div id="actPanelLight" class="hidden">
|
|
<label><span>颜色</span> <input id="actLightColor" type="color" value="#00ff55" /></label>
|
|
<label><span>光效</span>
|
|
<select id="actLightEffect">
|
|
<option value="solid">常亮</option>
|
|
<option value="breath">呼吸</option>
|
|
<option value="blink">闪烁</option>
|
|
<option value="strobe">爆闪</option>
|
|
<option value="flow_forward">前向流光</option>
|
|
<option value="flow_backward">反向流光</option>
|
|
<option value="blink_segment">分段闪</option>
|
|
</select>
|
|
</label>
|
|
<label><span>亮度</span> <input id="actLightIntensity" type="number" step="any" value="100" /></label>
|
|
<label id="actLightHzRow" class="hidden"><span>频率 Hz</span> <input id="actLightHz" type="number"
|
|
step="any" value="4" /></label>
|
|
<label id="actLightPeriodRow" class="hidden"><span>周期 s</span> <input id="actLightPeriod" type="number"
|
|
step="any" value="2" /></label>
|
|
</div>
|
|
<div id="actPanelWheel" class="hidden">
|
|
<p class="hint">自转轴:<span id="actWheelAxisHint">—</span> · 红X 绿Y 蓝Z</p>
|
|
<label><span>转速倍率</span> <input id="actWheelSpeedFactor" type="number" step="any" value="1" /></label>
|
|
<label><span>转向角 (°)</span> <input id="actWheelSteerAngleDeg" type="number" step="any"
|
|
value="0" /></label>
|
|
</div>
|
|
<div id="actPanelMotion" class="hidden">
|
|
<label><span>机构角色</span>
|
|
<select id="actMotionRole">
|
|
<option value="lift">顶升</option>
|
|
<option value="lidar">雷达</option>
|
|
<option value="camera">相机</option>
|
|
</select>
|
|
</label>
|
|
<label><span>运动方式</span>
|
|
<select id="actMotionKind">
|
|
<option value="translate">平移</option>
|
|
<option value="rotate">旋转</option>
|
|
</select>
|
|
</label>
|
|
<label><span>轴向</span>
|
|
<select id="actMotionAxis">
|
|
<option value="y">Y</option>
|
|
<option value="x">X</option>
|
|
<option value="z">Z</option>
|
|
</select>
|
|
</label>
|
|
<label id="actLiftStartRow" class="hidden"><span>起始 (m)</span> <input id="actLiftStart" type="number"
|
|
step="any" value="0" /></label>
|
|
<label id="actLiftEndRow" class="hidden"><span>终止 (m)</span> <input id="actLiftEnd" type="number"
|
|
step="any" value="0.15" /></label>
|
|
</div>
|
|
<div id="actPanelCamera" class="hidden">
|
|
<label><span>扫描摆动</span> <input type="checkbox" id="actCamScan" checked /></label>
|
|
<label><span>LED 呼吸</span> <input type="checkbox" id="actCamLedBreath" checked /></label>
|
|
<label><span>LED 颜色</span> <input id="actCamLedColor" type="color" value="#00afff" /></label>
|
|
</div>
|
|
<div id="actPanelEmergency" class="hidden">
|
|
<label><span>颜色</span> <input id="actEmerColor" type="color" value="#ff0000" /></label>
|
|
<label><span>效果</span>
|
|
<select id="actEmerEffect">
|
|
<option value="blink">闪烁</option>
|
|
<option value="strobe">爆闪</option>
|
|
<option value="solid">常亮</option>
|
|
<option value="off">熄灭</option>
|
|
</select>
|
|
</label>
|
|
<label><span>频率 Hz</span> <input id="actEmerHz" type="number" step="any" value="4" /></label>
|
|
</div>
|
|
<button type="button" id="saveActionDraftComp" class="primary-green">保存该组件</button>
|
|
</div>
|
|
<p id="actionCfgPlaceholder" class="hint">请先在步骤 1 选择组件</p>
|
|
</div>
|
|
|
|
<div class="workflow-step">
|
|
<div class="workflow-step-title" data-step="3">保存动作</div>
|
|
<label><span>显示名称</span>
|
|
<input type="text" id="actionLabel" lang="zh-CN" autocomplete="off" spellcheck="false"
|
|
placeholder="左转、举升" />
|
|
</label>
|
|
<div class="row-btns">
|
|
<button type="button" id="saveAsAction">保存动作</button>
|
|
<button type="button" id="clearActionDraft" class="secondary">清空</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="setting-group" style="margin-top:4px;">
|
|
<div class="setting-group-title">已定义动作</div>
|
|
<div id="actionList"></div>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
</div>
|
|
|
|
<footer id="statusbar">
|
|
<div id="status">就绪</div>
|
|
</footer>
|
|
</div>
|
|
|
|
<div id="toast-container"></div>
|
|
|
|
<!-- hidden compat elements -->
|
|
<select id="actionCompPick" class="hidden" aria-hidden="true">
|
|
<option value=""></option>
|
|
</select>
|
|
<button type="button" id="addActionComp" class="hidden" aria-hidden="true"></button>
|
|
|
|
<script type="importmap">
|
|
{ "imports": {
|
|
"three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
|
|
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/",
|
|
"pinyin-pro": "https://cdn.jsdelivr.net/npm/pinyin-pro@3.26.0/dist/index.mjs"
|
|
}}
|
|
</script>
|
|
<script type="module" src="./app.js"></script>
|
|
</body>
|
|
|
|
</html> |