Added extra pump data

lagged sample in measurement
This commit is contained in:
znetsixe
2025-11-03 15:22:51 +01:00
parent 48a227d519
commit 9610e7138d
5 changed files with 880 additions and 3 deletions

View File

@@ -87,6 +87,7 @@ autoContainer
.distance(0.5)
.value(1.5, Date.now(), 'bar'); // Input: 1.5 bar → Auto-stored as ~21.76 psi
const converted = autoContainer
.type('pressure')
.variant('measured')
@@ -274,8 +275,8 @@ console.log(` History: [${allValues.values.join(', ')}]\n`);
console.log('--- Lagged sample comparison ---');
const latest = stats.getCurrentValue(); // existing helper
const prevSample = stats.getLaggedValue(2); // new helper
const prevPrevSample = stats.getLaggedValue(3); // optional
const prevSample = stats.getLaggedValue(1); // new helper
const prevPrevSample = stats.getLaggedValue(2); // optional
if (prevSample) {
const delta = latest - prevSample.value;