From 830646551447cc2e83173689a2585c535cf68803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gil=20Benk=C3=B6?= <38266358+GilBenkoe@users.noreply.github.com> Date: Tue, 27 Jul 2021 17:00:58 +0200 Subject: [PATCH] TouchOffDialog: Align use of axisNames with AxisRadioGroup.qml, DigitalReadOut.qml. --- src/applicationcontrols/TouchOffDialog.qml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/applicationcontrols/TouchOffDialog.qml b/src/applicationcontrols/TouchOffDialog.qml index 8c8980e2..2823b625 100644 --- a/src/applicationcontrols/TouchOffDialog.qml +++ b/src/applicationcontrols/TouchOffDialog.qml @@ -34,6 +34,7 @@ Dialog { property int axis: 0 property var axisNames: helper.ready ? helper.axisNamesUpper : ["X", "Y", "Z"] property var _axisNames: helper.ready ? helper.axisNames : ["x", "y", "z"] + property int _index: helper.ready ? helper.axisIndices.indexOf(axis) : 0 property bool _ready: status.synced && command.connected property bool _done: true @@ -56,10 +57,10 @@ Dialog { if (status.task.taskMode !== ApplicationStatus.TaskModeMdi) { command.setTaskMode('execute', ApplicationCommand.TaskModeMdi); } - var axisName = _axisNames[axis]; + var axisName = _axisNames[_index]; var position = status.motion.position[axisName] - status.motion.g92Offset[axisName] - status.io.toolOffset[axisName]; var newOffset = (position - coordinateSpin.value); - var mdi = "G10 L2 P" + (coordinateSystemCombo.currentIndex + 1) + " " + axisNames[axis] + newOffset.toFixed(6); + var mdi = "G10 L2 P" + (coordinateSystemCombo.currentIndex + 1) + " " + axisNames[_index] + newOffset.toFixed(6); command.executeMdi('execute', mdi); } @@ -69,7 +70,7 @@ Dialog { ColumnLayout { anchors.fill: parent Label { - text: qsTr("Enter %1 coordinate relative to workpiece:").arg(dialog.axisNames[dialog.axis]) + text: qsTr("Enter %1 coordinate relative to workpiece:").arg(dialog.axisNames[dialog._index]) } SpinBox { id: coordinateSpin