From 5b68893941fc3c5358a0ecacbbff9fff3b7bb6b4 Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Wed, 17 Jun 2026 14:07:36 -0700 Subject: [PATCH] =?UTF-8?q?dataforth(datasheet):=20PROPOSED=20Defect-A=20f?= =?UTF-8?q?ix=20=E2=80=94=20render=20RTD=20input=20as=20Temp=20(C),=20not?= =?UTF-8?q?=20resistance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Repo copy only (review before deploying to C:\Shares\testdatadb). Folds RTD (sensorNum 7) into the temperature path so the ACCURACY input column shows 'Temp. (C)' with signed temperature values, matching the original DOS-generated datasheets and thermocouples (3-6). raw_data stimulus is already in deg C; no conversion. getSensorNum and the i==13 ohm/ohm unit override are untouched. Verified read-only against deployed env: 8B35 SN 179553-13 now shows Temp (C); regression over 184 5B/8B renders -> 15 RTD changed (intended), 0 non-RTD changed. Does NOT address Defect B (DSCA template). See DATASHEET-RTD-BUG-DIAGNOSIS-2026-06-17.md. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../implementation/templates/datasheet-exact.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/projects/dataforth-dos/datasheet-pipeline/implementation/templates/datasheet-exact.js b/projects/dataforth-dos/datasheet-pipeline/implementation/templates/datasheet-exact.js index 9c5eeac6..876bb95f 100644 --- a/projects/dataforth-dos/datasheet-pipeline/implementation/templates/datasheet-exact.js +++ b/projects/dataforth-dos/datasheet-pipeline/implementation/templates/datasheet-exact.js @@ -438,12 +438,11 @@ function buildTSpecs(specs, family, stepResponse) { function formatAccuracyLine(point, sensorNum, maxIn) { let stimStr; - if (sensorNum >= 3 && sensorNum <= 6) { - // Temperature: +####.## + if ((sensorNum >= 3 && sensorNum <= 6) || sensorNum === 7) { + // Temperature: +####.## (thermocouples 3-6 AND RTD 7 — Dataforth RTD + // datasheets report the input as temperature, not the raw resistance. + // The .DAT/raw_data stimulus is already in degrees C, so no conversion.) stimStr = formatSigned(point.stim, 2, 8); - } else if (sensorNum === 7) { - // Resistance: #####.## - stimStr = point.stim.toFixed(2).padStart(8); } else { // Voltage/Current: +###.### const scale = (maxIn != null && maxIn < 1) ? 1000 : 1; @@ -557,12 +556,11 @@ function generateExactDatasheet(record, specs) { // Input column header based on sensor type let inputHeader; - if (sensorNum >= 3 && sensorNum <= 6) { + if ((sensorNum >= 3 && sensorNum <= 6) || sensorNum === 7) { + // RTD (7) reports temperature, same as thermocouples (3-6). inputHeader = ' Temp. (C)'; } else if (sensorNum === 2 || sensorNum === 9) { inputHeader = ' Iin (mA)'; - } else if (sensorNum === 7) { - inputHeader = ' Rin (ohms)'; } else { inputHeader = (maxIn != null && maxIn < 1) ? ' Vin (mV)' : ' Vin (V)'; }