I have two meta points P1 P2 that get logged when and if 2 input context points P1a, P2a are logged on change (they increment). I now want a third meta point P3 that logs the value of either P1 or P2 context points whenever either are logged. Only p1 or p2 can be logged at any one timestamp controlled at the source.
My issue is real time and history recalculation must both work and I can get real time to work but not a history with the correct timestamp on p3.
var timestamp = Number(CONTEXT.getTimestamp());
if (Math.abs(timestamp - Number(p1.time)) < 1000)
p3 += p1.value;
if(Math.abs(timestamp - Number(p2.time)) < 1000)
p3 += p2.value;
This logs all data and p1 or p2 updates p3 CONTEXT when either is logged and they are only logged if their CONTEXT points have logged and this only happens when they have changed. So the plan is that p3 will log the value and timestamp of either p1 or p2 whichever triggers the update. So far I cannot get this to work. Any advice would be helpful.