コード例 #1
0
 public MetricSustainedThreshold(Graph g) : base("Sustained Threshold", g)
 {
     _portIn     = new InputPortData1D(this, "In");
     _portThresh = new InputPortValueDouble(this, "Thresh");
     _portOut    = new OutputPortValueDouble(this, "Out");
     _attrActiveDurationMillis = new AttributeValueDouble(this, "SustainDuration", "ms", 1000);
     _attrStartAt = new AttributeValueEnum <SustainMode>(this, "SustainStart");
 }
コード例 #2
0
ファイル: MetricFile.cs プロジェクト: muba24/flumin-master
        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();
        }
コード例 #3
0
        public MetricFilter(Graph graph) : base("Filter", graph)
        {
            _portInp = new InputPortData1D(this, "In");
            _portOut = new OutputPortData1D(this, "Out");

            _portInp.SamplerateChanged += portInp_SamplerateChanged;

            _attrCenterFrequency = new AttributeValueDouble(this, "Center", "Hz");
            _attrPeakGainDb      = new AttributeValueDouble(this, "Gain", "dB");
            _attrQFactor         = new AttributeValueDouble(this, "Q");
            _attrType            = new AttributeValueEnum <Biquad.BiquadType>(this, "Type");

            _attrCenterFrequency.Changed += (s, e) => _bpf.Fc = _portOut.Samplerate > 0 ? _attrCenterFrequency.TypedGet() / _portOut.Samplerate : 0;
            _attrPeakGainDb.Changed      += (s, e) => _bpf.PeakGainDb = _attrPeakGainDb.TypedGet();
            _attrQFactor.Changed         += (s, e) => _bpf.Q = _attrQFactor.TypedGet();
            _attrType.Changed            += (s, e) => _bpf.Type = _attrType.TypedGet();
        }
コード例 #4
0
        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();
        }