namespace FSharp.Data.Tdms
type Group =
{ Name: string
Properties: Property seq
Channels: Channel seq }
module Group =
let tryGetPropertyValue<'t> propertyName ({ Properties = properties }: Group) =
properties
|> Seq.tryFind (fun { Name = propertyName' } -> propertyName' = propertyName)
|> Option.bind Property.tryGet<'t>
let getPropertyValue<'t> propertyName =
tryGetPropertyValue<'t> propertyName >> Option.get
/// Finds the with the given name within the . Returns None if it does not exist.
/// the name of the to get.
let tryFindChannel channelName { Channels = channels } =
channels
|> Seq.tryFind (fun { Name = channelName' } -> channelName = channelName')
/// Finds the with the given name within the .
/// the name of the to get.
let findChannel channelName =
tryFindChannel channelName >> Option.get
/// Returns all channels within the .
let getChannels { Channels = channels } = channels