public MetricFFTBandEnergy(Graph graph) : base("Band Energy", graph) { _portInp = new NodeSystemLib2.FormatDataFFT.InputPortDataFFT(this, "In"); _portOut = new NodeSystemLib2.FormatData1D.OutputPortData1D(this, "Out"); _portInp.SamplerateChanged += (s, e) => _portOut.Samplerate = e.NewSamplerate / _portInp.FFTSize; _attrBandwidth = new AttributeValueDouble(this, "Bandwidth", "Hz"); _attrCenterFrequency = new AttributeValueDouble(this, "Center Frequency", "Hz"); }
public MetricDigitalInput(NidaqSingleton.Device device, NidaqSingleton.Channel channel, Graph g) : base("DI " + channel.Path, g, UniquenessBy(channel)) { _portOut = new NodeSystemLib2.FormatData1D.OutputPortData1D(this, "Out"); Channel = channel; Device = device; lineNum = int.Parse(Channel.Path.Split('/').Last().Last().ToString()); // only add to session after the initialization is done Session = NidaqSingleton.Instance.AddToSession(this); _portOut.Samplerate = Session.GetTask <NidaqSessionDigitalIn>(Device).ClockRate; }
public MetricAnalogInput(NidaqSingleton.Device device, NidaqSingleton.Channel channel, Graph g) : base("AI " + channel.Path, g, UniquenessBy(channel)) { _portOut = new NodeSystemLib2.FormatData1D.OutputPortData1D(this, "Out"); Channel = channel; Device = device; // only add to session after the initialization is done Session = NidaqSingleton.Instance.AddToSession(this); _attrVMax = new AttributeValueDouble(this, "Vmax"); _attrVMin = new AttributeValueDouble(this, "Vmin"); _attrTerminalCfg = new AttributeValueEnum <NidaQmxHelper.TerminalCfg>(this, "TerminalConfig"); _attrVMax.SetRuntimeReadonly(); _attrVMin.SetRuntimeReadonly(); _attrTerminalCfg.SetRuntimeReadonly(); }