diff --git a/src/renderer/src/utils/deflectionCorrection.js b/src/renderer/src/utils/deflectionCorrection.js index 1292898..4b0bcd3 100644 --- a/src/renderer/src/utils/deflectionCorrection.js +++ b/src/renderer/src/utils/deflectionCorrection.js @@ -181,12 +181,31 @@ export const applyCorrectionToSensor = (sensor, correctionFactors) => { } const normalizedFactors = sanitizeCorrectionFactors(correctionFactors) + const correctedX = correctAxisValue(sensor.xReal, normalizedFactors.xK, normalizedFactors.xB) + const correctedY = correctAxisValue(sensor.yReal, normalizedFactors.yK, normalizedFactors.yB) + + console.log('[DeflectionCorrection]', { + pos: sensor.pos ?? null, + des: sensor.des ?? '', + x: { + originalValue: sensor.xReal ?? null, + k: normalizedFactors.xK, + b: normalizedFactors.xB, + correctedValue: correctedX + }, + y: { + originalValue: sensor.yReal ?? null, + k: normalizedFactors.yK, + b: normalizedFactors.yB, + correctedValue: correctedY + } + }) return { ...sensor, appliedCorrectionFactors: normalizedFactors, - correctedX: correctAxisValue(sensor.xReal, normalizedFactors.xK, normalizedFactors.xB), - correctedY: correctAxisValue(sensor.yReal, normalizedFactors.yK, normalizedFactors.yB) + correctedX, + correctedY } }