Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Defragment of TDMS File #39

Open
jimkring opened this issue Feb 14, 2024 · 2 comments
Open

Support Defragment of TDMS File #39

jimkring opened this issue Feb 14, 2024 · 2 comments

Comments

@jimkring
Copy link

The npTDMS library has a defragment function (here) that's very useful. It would be great to have similar support for this in tedium. It's probably use it to create a CLI tool I can run on embedded (NI Linux RT) systems :)

@JamesMc86
Copy link
Contributor

Just for a record, at the core for the data we probably need something like:

fn copy_channel_data<D: TdmsDatatype>(source, dest, channel) {
    generic_read()
    generic_write()
}

fn copy_channel(source, dest, channel) {
    let type = source.get_channel_type();
    match source.get_channel_type(channel) {
        f64 => copy_channel_data::<f64>(source, dest, channel)
    }
}

Then at a higher level you want copy_all_properties and copy_all_channels

You could try and optimize it so the same length channels are all written in the same block but that may be a stage 2

@jimkring
Copy link
Author

Thanks @JamesMc86. I've started on this suggestion in PR #40. I'm learning Rust as I go, so the code will definitely need some refactor/cleanup :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants