From 4a28bb6f774e5b31b1af352c0d7cb13b2446fcef Mon Sep 17 00:00:00 2001 From: Sophia Beluli Date: Tue, 28 May 2024 14:14:01 -0400 Subject: [PATCH] [MI-1482]: fix A axis DRO reporting wrong values when eeprom 13 enabled --- src/app/reducers/controllerReducers.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/app/reducers/controllerReducers.js b/src/app/reducers/controllerReducers.js index 7ee938d0c..5f745f753 100644 --- a/src/app/reducers/controllerReducers.js +++ b/src/app/reducers/controllerReducers.js @@ -23,7 +23,7 @@ import { createReducer } from 'redux-action'; import { ensurePositiveNumber } from 'ensure-type'; import _get from 'lodash/get'; -import _mapValues from 'lodash/mapValues'; +// import _mapValues from 'lodash/mapValues'; import { MAX_TERMINAL_INPUT_ARRAY_SIZE } from 'app/lib/constants'; import { TOOL_CHANGE, @@ -97,12 +97,21 @@ function mapPosToFeedbackUnits(pos, settings) { }; const $13 = ensurePositiveNumber(_get(settings, 'settings.$13')); - return _mapValues({ + // don't convert a-c + let newPos = { ...defaultPos, - ...pos, - }, (val) => { - return ($13 > 0) ? in2mm(val) : val; - }); + ...pos + }; + if ($13) { + newPos = { + ...newPos, + x: in2mm(newPos.x), + y: in2mm(newPos.y), + z: in2mm(newPos.z), + }; + } + + return newPos; } function mapFeedrateToFeedbackUnits(feedrate, settings) {