Merge branch 'main' of ssh://892887cvmk08.aicp.io:24928/orisys-tech/orisys-app

This commit is contained in:
ykcheungab
2026-09-23 10:00:13 +08:00
21 changed files with 1200 additions and 59 deletions
@@ -13,7 +13,7 @@ from typing import Any
from orisys_app_shared import prefs as _prefs
from orisys_app_shared.paths import preference_path
from .motion.service import PLATFORM_AXES
from .motion.service import DEFAULT_BAS_TASK, PLATFORM_AXES, clamp_bas_task
from .motion.units import DEFAULT_ACCEL, DEFAULT_SPEED, DEFAULT_UNITS
#: Connection modes, in the order the combo offers them.
@@ -155,6 +155,11 @@ def default_preferences() -> dict[str, Any]:
# Remembered so "download the BAS program" is one click after the first
# time, instead of re-picking the file every session.
"bas_path": "",
#: The controller task the BAS program runs on. The vendor reference
#: starts it on 4 and re-initialises it with ``RUN "<file>",4``; stopping
#: any other task restarts nothing. Kept configurable because the task
#: number is a property of the project loaded on the controller.
"bas_task": DEFAULT_BAS_TASK,
#: Displayed millimetres are derived from this; it is a bench-measured
#: constant, not a calibrated length (see motion/units.py).
"units_per_mm": DEFAULT_UNITS,
@@ -245,6 +250,8 @@ def load_preferences() -> dict[str, Any]:
if value and not tool[index]:
tool[index] = value
prefs["finger_tool_xy_mm"] = tool
# A hand-edited task number must not reach the controller as typed.
prefs["bas_task"] = clamp_bas_task(prefs.get("bas_task"))
return prefs