Skip to content

Commit

Permalink
[MI-1482]: fix A axis DRO reporting wrong values when eeprom 13 enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiabeluli committed May 28, 2024
1 parent 07e8d32 commit 4a28bb6
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/app/reducers/controllerReducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4a28bb6

Please sign in to comment.