public MetricAnalogOutput(NidaqSingleton.Device device, NidaqSingleton.Channel channel, Graph g) : base("AO " + channel.Path, g, UniquenessBy(channel)) { _portIn = new NodeSystemLib2.FormatData1D.InputPortData1D(this, "In"); Channel = channel; Device = device; Session = NidaqSingleton.Instance.AddToSession(this); }
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(); }
private static Func <MetricAnalogInput, bool> UniquenessBy(NidaqSingleton.Channel channel) => p => p.Channel == channel && p.Type == NidaqSingleton.Channel.ChannelType.DigitalIn;
public MetricDigitalInput(NidaqSingleton.Device device, NidaqSingleton.Channel channel, Graph g, XmlNode node) : this(device, channel, g) { }
public MetricAnalogInput(NidaqSingleton.Device device, NidaqSingleton.Channel channel, Graph g, XmlNode node) : this(device, channel, g) { _attrVMax.Deserialize(node.Attributes.GetNamedItem(_attrVMax.Name)?.Value ?? "10"); _attrVMin.Deserialize(node.Attributes.GetNamedItem(_attrVMin.Name)?.Value ?? "-10"); _attrTerminalCfg.Deserialize(node.Attributes.GetNamedItem(_attrTerminalCfg.Name)?.Value ?? NidaQmxHelper.TerminalCfg.RSE.ToString()); }
public MetricAnalogOutput(NidaqSingleton.Device device, NidaqSingleton.Channel channel, Graph g, XmlNode node) : this(device, channel, g) { VMax = double.Parse(node.Attributes.GetNamedItem("vmax")?.Value ?? "10", System.Globalization.CultureInfo.InvariantCulture); VMin = double.Parse(node.Attributes.GetNamedItem("vmin")?.Value ?? "-10", System.Globalization.CultureInfo.InvariantCulture); }