autocal: 新增单位与换算页(默认锁定)及轴页报警与事件日志

- 设备设置新增“单位与换算”页:显示各轴 UNITS、读回值、脉冲/mm 换算与核对状态;
  默认锁定,点击“修改”后才可编辑,应用前弹窗确认,旋转轴偏离标定值时额外警告
- 轴调试页:脉冲当量改为只读并提供入口;新增报警与事件日志(报警、使能、
  回零、读取失败、单位不符等)及单位核对摘要
- 新增 motion/unit_report.py、motion/events.py 及对应测试
This commit is contained in:
ykcheungab
2026-10-19 10:14:55 +08:00
parent c6c16df753
commit 22658dbfc1
12 changed files with 1462 additions and 10 deletions
+65 -2
View File
@@ -51,7 +51,8 @@
"press_set": "Calibrated: press target = zero ± contact height.",
"press_unset": "Not calibrated: Execute holds the press axis.",
"close": "Close",
"chip_hint": "Open device setup — {name}"
"chip_hint": "Open device setup — {name}",
"tab_units": "Units"
},
"move": {
"execute": "Execute",
@@ -164,7 +165,25 @@
"home": "Home",
"controls": "Actions",
"mm_derived_tip": "Millimetres are derived from the pulse equivalent: a display value, not a calibrated length.",
"enabled_count": "{on}/{total} axes enabled"
"enabled_count": "{on}/{total} axes enabled",
"units_open": "Units…",
"units_locked_tip": "Units are locked and read-only here. Use Device setup → Units and press Modify to change them.",
"events_title": "Alarms and events",
"events_clear": "Clear log",
"events_empty": "No events yet. Changes in alarms, enable, homing, read failures and unit mismatches are logged here.",
"ev_connected": "Controller connected",
"ev_disconnected": "Controller disconnected",
"ev_alarm_on": "Axis {axis} alarm",
"ev_alarm_off": "Axis {axis} alarm cleared",
"ev_enabled": "Axis {axis} enabled",
"ev_disabled": "Axis {axis} disabled",
"ev_read_failed": "Axis {axis} read failed: {detail}",
"ev_read_ok": "Axis {axis} readable again",
"ev_home_started": "Axis {axis} homing started",
"ev_home_done": "Axis {axis} homing complete",
"ev_home_incomplete": "Axis {axis} homing ended without reporting complete",
"ev_units_mismatch": "Axis {axis} UNITS mismatch: configured {expected}, read {observed}",
"ev_units_ok": "Axis {axis} UNITS agree again"
},
"busdata": {
"title": "Bus data exchange",
@@ -911,5 +930,49 @@
"close": "Close",
"max_required": "Required; the program does not assume a value"
}
},
"units": {
"hint": "One place to check each direction's drive, its pulse equivalent (UNITS) and the resulting scale. Locked and read-only by default; press Modify to change a value, and the change is listed for confirmation before anything is written.",
"col_role": "Direction",
"col_axis": "Drive",
"col_kind": "Type",
"col_configured": "Configured UNITS",
"col_observed": "Controller read-back",
"col_scale": "Scale",
"col_check": "Check",
"kind_linear": "Linear (mm)",
"kind_rotary": "Rotary (°)",
"scale_linear": "1 unit = {mm} mm; {per} units/mm",
"scale_rotary": "1 unit = {deg}°; {per} units/°",
"status_ok": "Agree",
"status_unread": "Not read",
"status_mismatch": "Mismatch",
"status_uncalibrated": "No angle scale",
"status_invalid": "Invalid",
"status_unmapped": "Unmapped",
"tip_unread": "Not connected, or this axis's UNITS has not been read back yet.",
"tip_mismatch": "The controller reads a different UNITS from the configured one: pose moves are refused and targets are not rescaled.",
"tip_uncalibrated": "The rotary angle scale was only measured at the calibration equivalent; any other value needs a new calibration.",
"tip_invalid": "UNITS must be a finite number above 0.",
"tip_unmapped": "No drive is assigned to this direction; see Axis mapping.",
"summary_ok": "Unit check: all {total} directions agree",
"summary_bad": "Unit check: {bad} of {total} directions need attention",
"summary_unread": "Unit check: not read yet (not connected)",
"constants": "Fixed calibration constants (measured on the bench, not editable here): linear axes {ppm} pulses/mm; rotary axes {rotary}; all measured at UNITS={cal}. Millimetres and degrees are displayed values derived from these constants, not new measurements.",
"rotary_item": "axis {axis}: {units} user units = 90°",
"modify": "Modify",
"apply": "Apply to controller",
"cancel": "Cancel",
"modify_offline": "Not connected to a controller; nothing can be modified.",
"locked_note": "Locked: read-only.",
"unlocked_note": "Unlocked: enter new values in the Configured UNITS column, then press Apply to controller.",
"mapping_changed": "The axis mapping changed; unapplied edits were dropped and the page is locked again.",
"invalid": "UNITS for {role} is not valid: enter a number above 0.",
"no_change": "No change; locked again.",
"applied": "Submitted UNITS for {count} drive(s); the read-back will show after the next refresh.",
"change_line": "{role} · axis {axis}: {old} → {new}",
"confirm_title": "Write UNITS",
"confirm_body": "The following UNITS will be written to the controller:\n{changes}\n\nAfterwards every millimetre and degree reading, and every pose-move target, is recomputed with the new equivalent. Confirm that the platform is stopped and the mechanical ratio has been checked.",
"confirm_rotary": "Note: UNITS for {roles} is not the calibration equivalent {cal}; the rotary axis has no angle scale at that value, so pose moves are refused until it is recalibrated."
}
}