Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rayforge/machine/models/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,7 @@ def to_dict(self, include_frozen_dialect: bool = True) -> dict[str, Any]:
"soft_limits": list(self._soft_limits)
if self._soft_limits
else None,
"soft_limits_enabled": self.soft_limits_enabled,
"origin": self.origin.value,
"panel_orientation": self.panel.orientation.value,
"reverse_x_axis": self.reverse_x_axis,
Expand Down
32 changes: 24 additions & 8 deletions rayforge/ui_gtk/machine/hardware_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,12 @@ def __init__(self, machine: Machine, **kwargs):
soft_limits_group.add(self.soft_limits_enabled_row)

self.soft_x_min_row = LengthSpinRow(
_("X Min"),
_("Minimum X coordinate"),
_("X Min Distance from Origin"),
_(
"Distance from the origin corner into the bed "
"(not a coordinate). Fixed to the physical bed, "
"independent of the WCS."
),
upper=self.machine.axis_extents[0],
value_in_base=limits[0],
)
Expand All @@ -249,8 +253,12 @@ def __init__(self, machine: Machine, **kwargs):
soft_limits_group.add(self.soft_x_min_row)

self.soft_y_min_row = LengthSpinRow(
_("Y Min"),
_("Minimum Y coordinate"),
_("Y Min Distance from Origin"),
_(
"Distance from the origin corner into the bed "
"(not a coordinate). Fixed to the physical bed, "
"independent of the WCS."
),
upper=self.machine.axis_extents[1],
value_in_base=limits[1],
)
Expand All @@ -259,8 +267,12 @@ def __init__(self, machine: Machine, **kwargs):
soft_limits_group.add(self.soft_y_min_row)

self.soft_x_max_row = LengthSpinRow(
_("X Max"),
_("Maximum X coordinate"),
_("X Max Distance from Origin"),
_(
"Distance from the origin corner into the bed "
"(not a coordinate). Fixed to the physical bed, "
"independent of the WCS."
),
upper=self.machine.axis_extents[0],
value_in_base=limits[2],
)
Expand All @@ -269,8 +281,12 @@ def __init__(self, machine: Machine, **kwargs):
soft_limits_group.add(self.soft_x_max_row)

self.soft_y_max_row = LengthSpinRow(
_("Y Max"),
_("Maximum Y coordinate"),
_("Y Max Distance from Origin"),
_(
"Distance from the origin corner into the bed "
"(not a coordinate). Fixed to the physical bed, "
"independent of the WCS."
),
upper=self.machine.axis_extents[1],
value_in_base=limits[3],
)
Expand Down
28 changes: 24 additions & 4 deletions rayforge/ui_gtk/machine/wizard_pages/hardware_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,36 @@ def build_ui(self) -> None:
self.soft_limits_group.add(self.soft_limits_enabled_row)

self.soft_x_min_row = self._build_soft_limit_row(
_("X Min"), _("Minimum X coordinate")
_("X Min Distance from Origin"),
_(
"Distance from the origin corner into the bed "
"(not a coordinate). Fixed to the physical bed, "
"independent of the WCS."
),
)
self.soft_y_min_row = self._build_soft_limit_row(
_("Y Min"), _("Minimum Y coordinate")
_("Y Min Distance from Origin"),
_(
"Distance from the origin corner into the bed "
"(not a coordinate). Fixed to the physical bed, "
"independent of the WCS."
),
)
self.soft_x_max_row = self._build_soft_limit_row(
_("X Max"), _("Maximum X coordinate")
_("X Max Distance from Origin"),
_(
"Distance from the origin corner into the bed "
"(not a coordinate). Fixed to the physical bed, "
"independent of the WCS."
),
)
self.soft_y_max_row = self._build_soft_limit_row(
_("Y Max"), _("Maximum Y coordinate")
_("Y Max Distance from Origin"),
_(
"Distance from the origin corner into the bed "
"(not a coordinate). Fixed to the physical bed, "
"independent of the WCS."
),
)

# Speeds / accel.
Expand Down
16 changes: 16 additions & 0 deletions tests/machine/models/test_machine_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,22 @@ def test_from_dict_reads_work_margins(self, lite_context):
assert machine.work_margins == (50, 50, 50, 50)
assert machine.soft_limits == (10, 10, 280, 380)

def test_soft_limits_enabled_persists_through_serialization(
self, lite_context
):
"""Test that a disabled soft-limits toggle survives a restart."""
machine = Machine(lite_context)
assert machine.soft_limits_enabled is True
machine.set_soft_limits_enabled(False)

data = machine.to_dict()["machine"]
assert data["soft_limits_enabled"] is False

restored = Machine.from_dict(
{"machine": dict(data)}, context=lite_context
)
assert restored.soft_limits_enabled is False

def test_usb_id_serialization_uses_hex(self, lite_context):
"""USB ids serialize as hex strings and round-trip; legacy
integer values are still accepted on load."""
Expand Down
4 changes: 2 additions & 2 deletions website/docs/machine/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ Configurable safety bounds for jogging the machine head. When enabled, the jog c
movement outside these limits. When disabled, jogging is not limited.

- **Enable Soft Limits**: Toggle jog limit checks on or off
- **X/Y Min**: Minimum coordinate for each axis
- **X/Y Max**: Maximum coordinate for each axis
- **X/Y Min Distance from Origin**: Closest allowed distance from the origin corner along each axis
- **X/Y Max Distance from Origin**: Farthest allowed distance from the origin corner along each axis

Soft limits are evaluated in machine coordinates and stay anchored to the physical bed, so they do
not move when the work origin is re-zeroed. Values are entered as distances from the coordinate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ die Jog-Steuerungen Bewegungen außerhalb dieser Grenzen. Wenn deaktiviert, ist
begrenzt.

- **Software-Limits aktivieren**: Schaltet die Jog-Limit-Prüfung ein oder aus
- **X/Y Min**: Minimale Koordinate für jede Achse
- **X/Y Max**: Maximale Koordinate für jede Achse
- **X/Y Mindestabstand vom Ursprung**: Kleinster zulässiger Abstand von der Ursprungsecke je Achse
- **X/Y Maximalabstand vom Ursprung**: Größter zulässiger Abstand von der Ursprungsecke je Achse

Software-Limits werden in Maschinenkoordinaten ausgewertet und bleiben an der physischen Maschine
verankert, sie verschieben sich also nicht, wenn der Arbeitsursprung neu genullt wird. Werte werden
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ los controles de desplazamiento impedirán el movimiento fuera de estos límites
deshabilitados, el desplazamiento no está limitado.

- **Habilitar Límites Suaves**: Activa o desactiva la comprobación de límites de desplazamiento
- **X/Y Mín**: Coordenada mínima para cada eje
- **X/Y Máx**: Coordenada máxima para cada eje
- **X/Y Distancia Mín desde el Origen**: Distancia mínima permitida desde la esquina del origen en
cada eje
- **X/Y Distancia Máx desde el Origen**: Distancia máxima permitida desde la esquina del origen en
cada eje

Los límites suaves se evalúan en coordenadas de máquina y permanecen anclados a la cama física, por
lo que no se mueven cuando el origen de trabajo se restablece. Los valores se introducen como
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ désactivées, le déplacement n'est pas limité.

- **Activer les Limites Logicielles** : Active ou désactive la vérification des limites de
déplacement
- **X/Y Min** : Coordonnée minimum pour chaque axe
- **X/Y Max** : Coordonnée maximum pour chaque axe
- **X/Y Distance Min de l'Origine** : Distance minimale depuis le coin de l'origine pour chaque axe
- **X/Y Distance Max de l'Origine** : Distance maximale depuis le coin de l'origine pour chaque axe

Les limites logicielles sont évaluées en coordonnées machine et restent ancrées à la table physique
: elles ne bougent pas lorsque l'origine de travail est remise à zéro. Les valeurs sont saisies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ description:
बाहर गति रोक देंगे. अक्षम होने पर, जॉगिंग सीमित नहीं होती है.

- **सॉफ़्ट लिमिट सक्षम करें**: जॉग लिमिट जाँच चालू या बंद करता है
- **X/Y न्यूनतम**: प्रत्येक अक्ष का न्यूनतम निर्देशांक
- **X/Y अधिकतम**: प्रत्येक अक्ष का अधिकतम निर्देशांक
- **X/Y मूल बिंदु से न्यूनतम दूरी**: प्रत्येक अक्ष पर मूल कोने से अनुमत न्यूनतम दूरी
- **X/Y मूल बिंदु से अधिकतम दूरी**: प्रत्येक अक्ष पर मूल कोने से अनुमत अधिकतम दूरी

सॉफ़्ट लिमिट का मूल्यांकन मशीन निर्देशांकों में किया जाता है और ये भौतिक बेड से बंधे रहते हैं, इसलिए
कार्य मूल बिंदु को फिर से शून्य पर सेट करने पर ये नहीं हिलते. मान निर्देशांक मूल कोने से बेड की ओर
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Limites de segurança configuráveis para mover a cabeça da máquina. Quando ha
de jog impedirão movimento fora desses limites. Quando desabilitados, o jog não é limitado.

- **Habilitar Limites de Software**: Ativa ou desativa a verificação dos limites de jog
- **X/Y Mín**: Coordenada mínima para cada eixo
- **X/Y Máx**: Coordenada máxima para cada eixo
- **X/Y Distância Mín da Origem**: Distância mínima permitida do canto da origem em cada eixo
- **X/Y Distância Máx da Origem**: Distância máxima permitida do canto da origem em cada eixo

Os limites de software são avaliados em coordenadas de máquina e permanecem ancorados à mesa física,
por isso não se movem quando a origem de trabalho é redefinida. Os valores são inseridos como
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@
переміщенням запобігатимуть руху за межами цих обмежень. Коли вимкнено, переміщення не обмежується.

- **Увімкнути програмні обмеження**: Вмикає або вимикає перевірку обмежень переміщення
- **X/Y Мін**: Мінімальна координата для кожної осі
- **X/Y Макс**: Максимальна координата для кожної осі
- **X/Y Мінімальна відстань від початку**: Найменша допустима відстань від кута початку координат по
кожній осі
- **X/Y Максимальна відстань від початку**: Найбільша допустима відстань від кута початку координат
по кожній осі

Програмні обмеження оцінюються в машинних координатах і залишаються прив'язаними до фізичної
станини, тому вони не переміщуються, коли робочий початок скидається на нуль. Значення вводяться як
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
可配置的点动机器头的安全边界。启用后,点动控制将阻止超出这些限制的移动。禁用后,点动不受限制。

- **启用软限位**:开启或关闭点动限制检查
- **X/Y 最小值**:每个轴的最小坐标
- **X/Y 最大值**:每个轴的最大坐标
- **X/Y 距原点最小距离**:每个轴允许的距原点角的最小距离
- **X/Y 距原点最大距离**:每个轴允许的距原点角的最大距离

软限位在机器坐标中计算,并固定在物理工作台上,因此在重新设置工作原点时它们不会移动。数值以距坐标原点角向工作台内部的距离输入。启用但没有自定义边界时,使用轴范围。限位自动限制在轴范围内(0 到范围值)。

Expand Down
Loading