/// <summary> /// creates a new instance of <see cref="TDMReader"/> and immediately opens the file provided in constructor parameters. /// Throws <see cref="FileNotFoundException"/> if file is not existent or <see cref="ArgumentException"/> if file is not '*.tdm' file /// </summary> /// <param name="file"></param> public TDMReader(FileInfo file) { if (!file.Exists) { throw new FileNotFoundException("Supplied file-path does not point to a file."); } if (!file.Extension.ToLowerInvariant().EndsWith($".{Constants.FileTypes.TDM.ToLowerInvariant()}")) { throw new ArgumentException($"Supplied parameter {nameof(file)} must be of type {Constants.FileTypes.TDM}.", nameof(file)); } _fileHandle = NiLibDdcWrapper.OpenFile(file.FullName); }
public IEnumerable <T> GetChannelData <T>(Channel channel) where T : IConvertible { return(NiLibDdcWrapper.GetChannelData <T>(channel)); }
public IEnumerable <Channel> GetChannels(ChannelGroup group) { return(NiLibDdcWrapper.GetChannels(group)); }
public IEnumerable <ChannelGroup> GetChannelGroups() { return(NiLibDdcWrapper.GetChannelGroups(_fileHandle)); }
public FileProperties GetFileProperties() { return(NiLibDdcWrapper.GetFileProperties(_fileHandle)); }
protected void CloseFile() { NiLibDdcWrapper.CloseFile(_fileHandle); }
public IEnumerable <T> GetChannelData <T>(Channel channel, uint firstValueIndex = 0, uint numberOfValues = 0) where T : IConvertible { return(NiLibDdcWrapper.GetChannelData <T>(channel, firstValueIndex, numberOfValues)); }