From bdf6fec96c1e508f68c867a565e0cb4768918755 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Tue, 16 Jun 2026 12:27:32 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/utils/deflectionCorrection.js | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) 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 } }