protected override void DataAvailable(DataInputPort port) { while (((DataInputPort)InputPorts[0]).Queue.Length > _inputBuffer.Length) { Process(); } }
public MetricRecorder(Graph g) : base("Recorder", g) { _portData = InputPort.Create <DataInputPort>("Data", this); _portEnable = InputPort.Create <ValueInputPort>("En", this); _set = NodeSystemSettings.Instance.SystemHost.RecordSetForGraph(Parent); }
protected override void DataAvailable(DataInputPort port) { if (_portInA.Queue.Length > _portInA.Buffer.Length && _portInB.Queue.Length > _portInB.Buffer.Length) { ProcessBuffers(_portInA.Buffer.Length); } }
public MetricHalfrate(Graph graph) : base("Half Rate", graph, InputPort.CreateMany(InputPort.Create("in", PortDataType.Array)), OutputPort.CreateMany(OutputPort.Create("out", PortDataType.Array))) { _portInp = (DataInputPort)InputPorts[0]; _portOut = (DataOutputPort)OutputPorts[0]; }
protected override void DataAvailable(DataInputPort port) { lock (this) { while (_portData.Queue.Length > _buffer.Length) { Process(); } } }
public MetricFilter(Graph graph) : base("Filter", graph, InputPort.CreateMany(InputPort.Create("in", PortDataType.Array)), OutputPort.CreateMany(OutputPort.Create("out", PortDataType.Array))) { _portInp = (DataInputPort)InputPorts[0]; _portOut = (DataOutputPort)OutputPorts[0]; Fc = 100000; }
public MetricMultiplyValue(Graph graph) : base("Multiply", graph, InputPort.CreateMany(InputPort.Create("in", PortDataType.Array), InputPort.Create("f", PortDataType.Value)), OutputPort.CreateMany(OutputPort.Create("out", PortDataType.Array))) { _portInp = (DataInputPort)InputPorts[0]; _inputValue = (ValueInputPort)InputPorts[1]; _portOut = (DataOutputPort)OutputPorts[0]; }
protected override void DataAvailable(DataInputPort port) { _inp.Queue.Dequeue(_buffer); var samples = _buffer.GetSamples(); for (int j = 0; j < _buffer.WrittenSamples; j++) { samples[j] += factor++; } _out.SendData(_buffer); }
public MetricFFT(Graph graph) : base("FFT", graph, InputPort.CreateMany( InputPort.Create("in", PortDataType.Array)), OutputPort.CreateMany( OutputPort.Create("out", PortDataType.FFT))) { _portInp = (DataInputPort)InputPorts[0]; _portOut = (FFTOutputPort)OutputPorts[0]; FFTSize = 2048; }
protected override void DataAvailable(DataInputPort port) { System.Diagnostics.Debug.WriteLine($"{Name}: DataAvailable mit {_input.Queue.Length} Samples im InputBuffer"); var timesReadable = Math.Max(1, _input.Queue.Length / _buffer.Length); for (int j = 0; j < timesReadable; j++) { _input.Queue.Dequeue(_buffer); _output.SendData(_buffer); } }
protected override void DataAvailable(DataInputPort port) { foreach (var sample in _dataIn.Read().ZipWithValueInput(_threshIn)) { if (sample.Value >= sample.Scalar) { if ((sample.Stamp - LastEventTime).AsSeconds() * 1000 > CooldownTimeMs) { System.Diagnostics.Debug.WriteLine("event triggered @ " + sample.Stamp); _eventOut.PlanEvent(sample.Stamp); LastEventTime = sample.Stamp; } } } }
protected override void DataAvailable(DataInputPort port) { System.Diagnostics.Debug.WriteLine($"{Name}: DataAvailable mit {_input.Queue.Length} Samples im InputBuffer"); var timesReadable = Math.Max(1, _input.Queue.Length / _buffer.Length); for (int j = 0; j < timesReadable; j++) { _input.Queue.Dequeue(_buffer); System.Diagnostics.Debug.WriteLine($"{Name}: DataAvailable Dequeue mit {_buffer.WrittenSamples} Samples"); var samples = _buffer.GetSamples(); for (int i = 0; i < _buffer.WrittenSamples; i++) { Sum += samples[i]; } } }
protected override void DataAvailable(DataInputPort port) { while (_portInp.Queue.Length > _bufIn.Length) { var samples = _bufOut.GetSamples(); var k = 0; _portInp.Queue.Dequeue(_bufIn); for (int i = 0; i < _bufIn.Length; i += _fft.Size) { _fft.UseData(_bufIn.GetSamples(), i, _fft.Size); var result = _fft.Transform(); for (int j = 0; j < result.Length; j++) { samples[k++] = result[j]; } } _bufOut.SetWritten(k); _portOut.SendData(_bufOut); } }
public MetricAdder(Graph graph) : base("Adder", graph) { _portInA = InputPort.Create <DataInputPort>("inA", this); _portInB = InputPort.Create <DataInputPort>("inB", this); _portOut = OutputPort.Create <DataOutputPort>("out", this); }
public PassThroughNode(Graph g) : base("Passthrough", g) { _input = InputPort.Create <DataInputPort>("Inp", this); _output = OutputPort.Create <DataOutputPort>("Out", this); }
public MetricThresholdEvent(Graph g) : base("Treshold Event", g) { _dataIn = InputPort.Create <DataInputPort>("Inp", this); _threshIn = InputPort.Create <ValueInputPort>("Thresh", this); _eventOut = OutputPort.Create <EventOutputPort>("Ev", this); }
public SinkNode(Graph g) : base("Sink", g) { _input = InputPort.Create <DataInputPort>("Inp", this); }
protected override void DataAvailable(DataInputPort port) { LastValue = port.Read().CurrentTime; UpdateUi(); }
public BasicTestNode(Graph g) : base("Test", g) { _inp = InputPort.Create <DataInputPort>("input", this); _out = OutputPort.Create <DataOutputPort>("output", this); }
protected override void DataAvailable(DataInputPort port) { //while (_portInp.Buffer.Length > _bufIn.Length) { Process(); //} }
protected override void DataAvailable(DataInputPort port) { Accumulator += port.Read().GetSamples() .Take(port.Buffer.WrittenSamples) .Sum(); }