public TimeDisplayWaterfall(Graph g) : base("Waterfall", g) { _port = new InputPortDataFFT(this, "In"); _attrDbMax = new AttributeValueDouble(this, "dB max", "dB"); _attrDbMin = new AttributeValueDouble(this, "dB min", "dB"); _attrTimeWindow = new AttributeValueInt(this, "Window Length", "ms"); _attrDbMin.Changed += (s, e) => { if (_attrDbMin.TypedGet() >= _attrDbMax.TypedGet()) { _attrDbMin.Set(_attrDbMax.TypedGet() - 0.0001); } if (_wnd != null) { _wnd.DbMin = (float)_attrDbMin.TypedGet(); } }; _attrDbMax.Changed += (s, e) => { if (_attrDbMax.TypedGet() <= _attrDbMin.TypedGet()) { _attrDbMax.Set(_attrDbMin.TypedGet() + 0.0001); } if (_wnd != null) { _wnd.DbMax = (float)_attrDbMax.TypedGet(); } }; _attrTimeWindow.Changed += (s, e) => { UpdateWindowSettings(); }; _attrTimeWindow.SetRuntimeReadonly(); }
public MetricDisplay2(Graph g) : base("Display", g) { var dataInp = new InputPortData1D(this, "Dinp 1"); var valueInp = new InputPortValueDouble(this, "Vinp 1"); _attrLookAheadFactor = new AttributeValueDouble(this, "Look Ahead Factor", 1); _attrWindowLength = new AttributeValueInt(this, "Window Length", "ms", 1000); _attrLookAheadFactor.SetRuntimeReadonly(); _attrWindowLength.Changed += (s, e) => { lock (_processingLock) { lock (_wndLock) { if (State == Graph.State.Running) { CreateChannels(); _wnd?.PrepareProcessing(); } } } }; PortConnectionChanged += MetricDisplay2_PortConnectionChanged; try { CreateWindow(); } catch (Exception e) { throw new InvalidOperationException("Error in constructor while creating window: " + e); } }
public Resampler(Graph g) : base("Resampler", g) { _input = new InputPortData1D(this, "In"); _output = new OutputPortData1D(this, "Out"); _attrSamplerateOut = new AttributeValueInt(this, "Output Samplerate", "Hz"); _attrSamplerateOut.Changed += (s, e) => _output.Samplerate = _attrSamplerateOut.TypedGet(); }
public Recorder3(Graph g) : base("Recorder 3", g) { CreateLine(PortDataTypes.TypeIdSignal1D); CreateLine(PortDataTypes.TypeIdValueDouble); _portEnable = new NodeSystemLib2.FormatValue.InputPortValueDouble(this, "Enable"); _attrPrebufferLengthMs = new AttributeValueDouble(this, "PreBuffer", "ms", 1000); _attrNumOfLines1D = new AttributeValueInt(this, "NumOfLines1D", 1); _attrNumOfLines2D = new AttributeValueInt(this, "NumOfLines2D", 1); _attrNumOfLines1D.SetRuntimeReadonly(); _attrNumOfLines2D.SetRuntimeReadonly(); _attrNumOfLines1D.Changed += _numOfLines1D_Changed; _attrNumOfLines2D.Changed += _numOfLines2D_Changed; }
public MetricFile(Graph g) : base("File Node", g) { _portOut = new OutputPortData1D(this, "Out"); _portTrigger = new InputPortValueDouble(this, "Trig"); _attrFilePath = new AttributeValueFile(this, "Path", true); _attrSamplerate = new AttributeValueInt(this, "Samplerate", 1000); _attrDataType = new AttributeValueEnum <DataType>(this, "DataType"); _attrSamplerate.Changed += (o, e) => _portOut.Samplerate = _attrSamplerate.TypedGet(); _attrSamplerate.SetRuntimeReadonly(); _attrDataType.SetRuntimeReadonly(); _attrFilePath.SetRuntimeReadonly(); }
public MetricValueRange(Graph graph) : base("Range", graph) { _portOut = new OutputPortValueDouble(this, "Out"); _attrValue = new AttributeValueDouble(this, "Value", IsRunning); _attrMax = new AttributeValueDouble(this, "Max", IsRunning); _attrMin = new AttributeValueDouble(this, "Min", IsRunning); _attrSteps = new AttributeValueInt(this, "Steps", IsRunning); _attrValue.Changed += (s, e) => { if (State == Graph.State.Running) { SendValue(_attrValue.TypedGet()); } }; _attrMax.Changed += (s, e) => { if (_slider != null) { _slider.Max = _attrMax.TypedGet(); } }; _attrMin.Changed += (s, e) => { if (_slider != null) { _slider.Min = _attrMin.TypedGet(); } }; _attrSteps.Changed += (s, e) => { if (_slider != null) { _slider.Steps = _attrSteps.TypedGet(); } }; }
public PropertyRowNodeAttrInt(AttributeValueInt attr) { _box = new PropertyRowContainer <TextBox>(new TextBox(), attr.Unit); _attr = attr; _attr.Changed += (s, e) => Changed?.Invoke(this, new PropertyGridRowChangedEventArgs()); }