GithubHelp home page GithubHelp logo

gomdf's Introduction

GoMDF - Read and Write ASAM MF4 FILES

Go package for reading ASAM MF4 files.

Installation

⚠️ The package not finalized !!! ⚠️

go get github.com/LincolnG4/GoMDF

Usage

package main

import (
	"fmt"
	"os"

	mf4 "github.com/LincolnG4/GoMDF"
)

func main() {
	file, err := os.Open("sample1.mf4")
	if err != nil {
		panic(err)
	}

	m, err := mf4.ReadFile(file, &mf4.ReadOptions{})
	if err != nil {
		panic(err)
	}


	fmt.Println()
	// Get channel samples
	channels := m.ListAllChannels()

	for _, channel := range channels {
		samples, err := channel.Sample()
		if err != nil {
			panic(err)
		}

		fmt.Println(samples[:10])
	}

	sample, err := m.GetChannelSample(2, "EngTripFuel")
	if err != nil {
		panic(err)
	}
	fmt.Println(sample[:10])
	// Download attachments
	//att := m.GetAttachments()[0]
	//m.SaveAttachmentTo(att, "/PATH/TO/BE/SAVE/")

	// Read Change logs
	// m.ReadChangeLog()
	// Access metadata
	fmt.Println(m.Version())
	fmt.Println("Version ID --> ", m.MdfVersion())
	fmt.Println("Start Time NS --> ", m.GetStartTimeNs())
	fmt.Println("Start StartTimeLT --> ", m.GetStartTimeLT())
	fmt.Println()
	fmt.Println("List Names -->", m.ListAllChannelsNames())
	fmt.Println("Mapped Channels -->", m.MapAllChannels())
}

Features

  • Parse MF4 file format and load metadata
  • Extract channel sample data
  • Support for attachments
  • Support for Events
  • Access to common metadata fields
  • Documentation
  • Documentation is available at https://godoc.org/github.com/LincolnG4/GoMDF

Contributing

Pull requests are welcome! Please open any issues.

This provides a high-level overview of how to use the package from Go code along with installation instructions. Let me know if any part of the README explanation could be improved!

References

ASAM MDF
MDF Validator

gomdf's People

Contributors

lincolng4 avatar

Stargazers

 avatar Jijo Sunny George avatar MA Jianjun avatar  avatar shashi.satyam avatar  avatar Fuming Xiang avatar feichenxue avatar  avatar

Watchers

 avatar shashi.satyam avatar  avatar

gomdf's Issues

why readSingleDataBlock and readDataList are private methods

Hi, I am a data engineer in a vehicle company. We use "asammdf" in python to analyze MDF file. I noticed this GO version and try to optimize the processing speed with GO. I found the signal related methods are all private. asammdf in python opened the signal reading methods. Will you consider make it public methods in the future?

my question

Hello, may I ask, is there any sample code for this package?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.