修复电阻箱模拟

This commit is contained in:
feie9454 2025-09-12 11:40:42 +08:00
parent 5159b22b6f
commit 2fd050ec6d

View File

@ -490,7 +490,7 @@ function buildNet(): BuiltNet {
resistors.push({ inst, nPlus: n0, nMinus: n3, R: Rad }) resistors.push({ inst, nPlus: n0, nMinus: n3, R: Rad })
// CD // CD
resistors.push({ inst, nPlus: n2, nMinus: n3, R: Rmax }) resistors.push({ inst, nPlus: n2, nMinus: n3, R: Rmax })
} else if (key === 'resistor' || key === 'light_bulb' || key === 'meter') { } else if (key === 'resistor' || key === 'light_bulb' || key === 'meter' || key === 'resistance_box') {
const R = Math.max(1e-6, safeNum(inst.props?.['resistance'], 0)) const R = Math.max(1e-6, safeNum(inst.props?.['resistance'], 0))
resistors.push({ inst, nPlus: n0, nMinus: n1, R }) resistors.push({ inst, nPlus: n0, nMinus: n1, R })
} else { } else {