Added extra pump data
lagged sample in measurement
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user