extern crate tdms;
use std::path::Path;
use tdms::data_type::TdmsDataType;
use tdms::TDMSFile;
fn main() {
let file = match TDMSFile::from_path(Path::new("data/standard.tdms")) {
Ok(f) => f,
Err(e) => panic!("{:?}", e),
};
let groups = file.groups();
for group in groups {
let channels = file.channels(&group);
for (_, channel) in channels {
let full_channel = match channel.data_type {
TdmsDataType::DoubleFloat(_) => file.channel_data_double_float(channel),
_ => {
panic!("{}", "channel for data type unimplemented")
}
};
let full_channel_iterator = match full_channel {
Ok(i) => i,
Err(e) => {
panic!("{:?}", e)
}
};
println!("{:?}", full_channel_iterator.count());
}
}
}