Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
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();
        }