private static void SaveValueInputBuffer(ValueInputPort p, NodeState to) { if (p.Values != null) { to.WriteValue(to.PortValues, p.Name, p.Values.Clone()); } }
public IEnumerable <TimeLocatedBufferValueWithScalar> ZipWithValueInput(ValueInputPort p) { var currentSampleTime = new TimeLocatedValue(0, new TimeStamp(0)); for (int i = 0; i < WrittenSamples; i++) { var stamp = StampForSample(i); currentSampleTime.SetStamp(stamp); TimeLocatedValue value; if (p.Values.SafeTryWeakPredecessor(currentSampleTime, out value)) { yield return(new TimeLocatedBufferValueWithScalar { Scalar = value.Value, Value = _buffer[i], Stamp = stamp }); p.Values.SafeRemoveRangeTo(value); } else { yield return(new TimeLocatedBufferValueWithScalar { Scalar = 0, Value = _buffer[i], Stamp = TimeStamp.Zero() }); } } }
private static void LoadValueInputBuffer(NodeState from, ValueInputPort to) { if (to.Values != null) { var values = (ConcurrentTreeBag <TimeLocatedValue>)from.PortValues[to.Name]; to.Values = values.Clone(); } }
protected virtual void ValueAvailable(ValueInputPort port) { }