Exemple #1
0
        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);
            }
        }
Exemple #2
0
        public MetricBuffer(Graph graph) : base(graph)
        {
            _portOut    = new OutputPortData1D(this, "out");
            _portInp    = new InputPortData1D(this, "inp");
            _attrMillis = new AttributeValueDouble(this, "Milliseconds", "ms", 1000);
            _attrMillis.SetRuntimeReadonly();

            _portInp.SamplerateChanged += (sender, ev) => _portOut.Samplerate = _portInp.Samplerate;
        }
Exemple #3
0
        public MetricRms(Graph g) : base("RMS", g)
        {
            _portIn  = new InputPortData1D(this, "In");
            _portOut = new OutputPortData1D(this, "Out");

            _portIn.SamplerateChanged += (s, e) => UpdateSamplerate();

            _attrMilliseconds          = new AttributeValueDouble(this, "Window Length", "ms");
            _attrMilliseconds.Changed += (s, e) => UpdateSamplerate();
            _attrMilliseconds.SetRuntimeReadonly();
        }
        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();
        }