REPOSITORY
tymict/agri-hmi Private
[참조 MVP] 농기계 운용 HMI — ICU 텔레메트리를 운전자용 상태·경보·진행률 View Model로 변환합니다.
https://git.agrithing.ai/tymict/agri-hmi.git 42be0a1 feat: adopt typescript HMI SDV reference implementation
07d7c72 ci: add language-specific static and dynamic analysis
cfe9cc6 docs: define component scope and interface contract
79b0483 ci: verify contract tests and evidence package
781167f feat: add executable reference MVP
7b0c599 docs: define component scope and interface contract
2 items · main
·/ src/component.mjs
javascript · 490 B · 6576807 Download
export function toViewModel(input) { const total = Math.max(Number(input.total_area_ha ?? 0), 0); const completed = Math.max(Number(input.completed_area_ha ?? 0), 0); const faults = input.faults ?? []; return { mode: input.mode ?? 'MANUAL', system: faults.length ? 'ALERT' : 'NORMAL', speed_mps: Number(input.speed_mps ?? 0), progress_percent: total === 0 ? 0 : Math.min(100, Math.round(completed / total * 100)), alerts: faults.map((code) => ({ code, severity: 'critical' })) };}