示例#1
0
 private static void SaveValueInputBuffer(ValueInputPort p, NodeState to)
 {
     if (p.Values != null)
     {
         to.WriteValue(to.PortValues, p.Name, p.Values.Clone());
     }
 }
示例#2
0
        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()
                    });
                }
            }
        }
示例#3
0
 private static void LoadValueInputBuffer(NodeState from, ValueInputPort to)
 {
     if (to.Values != null)
     {
         var values = (ConcurrentTreeBag <TimeLocatedValue>)from.PortValues[to.Name];
         to.Values = values.Clone();
     }
 }
示例#4
0
 protected virtual void ValueAvailable(ValueInputPort port)
 {
 }