feat(diagnosis): 按新协议实现多光谱诊断算法+分区差异化下发+报告面罩图

- 新协议《协议简述-添加扫描时光色》落地: FFE4 Byte17 高3位=扫描光色(1红/2红外/3紫外/4暖黄),
  低5位保留贴合状态; Byte18=0xFF 故障; auto-scan 按光色分桶采集(旧固件无标识归 red 桶降级)
- diagnosis.js 重写: PD极性(值大=吸收多,固件已确认) NR=本区/本色5区平均-1;
  每区4色argmax>0.10判定; 3路PD区几何平均+MAD剔奇异(3σ对n=3失效,审计实证);
  严重度0.05/0.15/0.30仅展示; 全参数走 diagnosis_config 热调(极性/阈值/PD映射/亮度)
- buildVendorCommand 支持 plan 多区多色单命令下发(每IO独立 红/红外/紫外/暖黄);
  builder层安全硬上限 治疗亮度≤204(80%) 时长≤600s
- 区域映射修正: 掩码=IO纵列 左0x01/中上0x02/中0x04/中下0x08/右0x10,
  修复 treatment-setup/manual/treating/getRegionName/i18n 共7处标签错位, FULL_FACE 0x7F→0x1F
- 扫描报告页: 新增分区面罩示意图(5区按推荐光着色+模式名+严重度,点击跳光疗介绍),
  推荐护理改一条命令多色下发(亮度204); 扫描中设备故障即时中止
- schema.sql diagnosis_config 种子更新(新结构); i18n 清理死键,中英对齐25/24键
这个提交包含在:
Guoguo
2026-07-28 04:36:51 -07:00
父节点 b5416f56af
当前提交 6b91ebe35d
修改 19 个文件,包含 505 行新增234 行删除
+2
查看文件
@@ -17,6 +17,7 @@ module.exports = {
doneStatusPost: ' 帧),正在启动治疗...',
notWorn: '面膜未佩戴好,请重新佩戴后再试',
timeout: '检测超时,未收到数据,请重试',
deviceFault: '设备异常,扫描已停止,请重启设备后再试',
cmdFailed: '检测命令发送失败'
},
en: {
@@ -35,6 +36,7 @@ module.exports = {
doneStatusPost: ' frames), starting treatment...',
notWorn: 'The mask is not worn properly. Please re-fit and try again',
timeout: 'Scan timed out with no data. Please try again',
deviceFault: 'Device error — scan stopped. Please restart the device and try again',
cmdFailed: 'Failed to send scan command'
}
}
+8 -6
查看文件
@@ -18,12 +18,14 @@ module.exports = {
saveFailed: '保存失败',
networkError: '网络异常,请重试',
deviceNotConnected: '设备未连接',
// 区域 = IO 纵列布局:left=IO1(0x01) top=IO2(0x02中上) middle=IO3(0x04中)
// bottom=IO4(0x08中下) right=IO5(0x10)。key 名沿用,语义以掩码为准。
regions: {
right: '右区',
left: '左区',
top: '上区',
top: '上区',
middle: '中区',
bottom: '下区'
bottom: '下区',
right: '右区'
},
wavelengths: {
red: '红光',
@@ -51,11 +53,11 @@ module.exports = {
networkError: 'Network error, please retry',
deviceNotConnected: 'Device not connected',
regions: {
right: 'Right',
left: 'Left',
top: 'Top',
top: 'Upper Center',
middle: 'Center',
bottom: 'Bottom'
bottom: 'Lower Center',
right: 'Right'
},
wavelengths: {
red: 'Red',
+16 -12
查看文件
@@ -5,6 +5,9 @@ module.exports = {
subtitle: '基于多光谱反射的肤质倾向参考',
scannedAt: '扫描时间',
overallTitle: '整体倾向',
faceTitle: '分区光疗方案',
faceTapHint: '点击分区可查看该光的功效介绍',
allNormalHint: '未发现明显问题区域,可进行日常舒缓养护',
regionTitle: '分区分析',
recommendTitle: '推荐护理',
noProblem: '未见明显倾向',
@@ -19,12 +22,11 @@ module.exports = {
pigment: '色素 / 暗黄',
deep: '深层循环 / 疲劳'
},
regionNames: {
right: '右脸',
left: '左脸',
top: '额头',
middle: '鼻区',
bottom: '下巴'
modeNames: {
red: '嫩肤焕亮',
ir: '深层焕活',
uv: '净痘控油',
yellow: '匀净提亮'
}
},
en: {
@@ -32,6 +34,9 @@ module.exports = {
subtitle: 'Skin-tendency reference from multispectral reflection',
scannedAt: 'Scanned at',
overallTitle: 'Overall Tendency',
faceTitle: 'Zone Care Map',
faceTapHint: 'Tap a zone to learn about its light',
allNormalHint: 'No notable concerns found — a gentle daily care session works well',
regionTitle: 'Zone Analysis',
recommendTitle: 'Recommended Care',
noProblem: 'No notable tendency',
@@ -46,12 +51,11 @@ module.exports = {
pigment: 'Pigment / Sallowness',
deep: 'Deep circulation / Fatigue'
},
regionNames: {
right: 'Right cheek',
left: 'Left cheek',
top: 'Forehead',
middle: 'Nose',
bottom: 'Chin'
modeNames: {
red: 'Glow & Firm',
ir: 'Deep Revive',
uv: 'Clear & Balance',
yellow: 'Even & Brighten'
}
}
}
-4
查看文件
@@ -7,8 +7,6 @@ module.exports = {
smartMode: '✨ 智能模式',
normalMode: '🔄 普通模式',
allRegions: '全区域',
regionTopLeft: '左上区',
regionTopRight: '右上区',
relax1: '请放松心情',
relax2: '享受美好时光',
stopBtn: '停止使用',
@@ -35,8 +33,6 @@ module.exports = {
smartMode: '✨ Smart Mode',
normalMode: '🔄 Normal Mode',
allRegions: 'All regions',
regionTopLeft: 'Top-left',
regionTopRight: 'Top-right',
relax1: 'Relax and unwind',
relax2: 'Enjoy your moment',
stopBtn: 'Stop',