mf4

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel added in v0.0.2

type Channel struct {
	Name         string
	Block        *CN.Block
	Convertion   CC.Conversion
	DataGroup    *DG.Block
	ChannelGroup *CG.Block
	SourceInfo   SI.SourceInfo
	Comment      string
	MdComment    string
}

type ChannelGroup

type ChannelGroup struct {
	Block      *CG.Block
	Channels   map[string]*Channel
	DataGroup  *DG.Block
	SourceInfo SI.SourceInfo
	Comment    string
}

type MF4

type MF4 struct {
	File           *os.File
	Header         *HD.Block
	Identification *ID.Block
	//Address to First File History Block
	FileHistory  int64
	ChannelGroup []*ChannelGroup
}

func ReadFile

func ReadFile(file *os.File) (*MF4, error)

func (*MF4) ChannelNames

func (m *MF4) ChannelNames() map[int][]string

ChannelNames returns a map of channels of each datagroup

map[key]value
key = Datagroup number
value = array with channel names

func (*MF4) CreatedBy

func (m *MF4) CreatedBy() string

CreatedBy method returns the MDF Program identifier

func (*MF4) DaylightOffsetMin

func (m *MF4) DaylightOffsetMin(tFlag uint8) (int16, error)

Daylight saving time (DST) offset in minutes for the starting timestamp. During the summer months, many regions observe a DST offset of 60 minutes (1 hour).

func (*MF4) GetAttachments

func (m *MF4) GetAttachments() []AT.AttFile

GetAttachmemts iterates over all AT blocks and return to an array

func (*MF4) GetChannelSample

func (m *MF4) GetChannelSample(indexDataGroup int, channelName string) ([]interface{}, error)

GetChannelSample loads sample by DataGroupName and ChannelName

func (*MF4) GetMeasureComment

func (m *MF4) GetMeasureComment() string

func (*MF4) GetStartTimeLT added in v0.0.2

func (m *MF4) GetStartTimeLT() time.Time

func (*MF4) GetStartTimeNs added in v0.0.2

func (m *MF4) GetStartTimeNs() int64

StartTimeNs returns the start timestamp of measurement in nanoseconds

func (*MF4) GetTimeNs

func (m *MF4) GetTimeNs(t uint64, tzo uint64, dlo uint64, tf uint8) int64

func (*MF4) ID

func (m *MF4) ID() string

ID method returns the MDF file ID

func (*MF4) IsFinalized

func (m *MF4) IsFinalized() bool

isUnfinalized method returns Standard flags for unfinalized MDF

func (*MF4) MdfVersion

func (m *MF4) MdfVersion() uint16

VersionNumber method returns the Version number of the MDF format, i.e. 420

func (*MF4) ReadChangeLog

func (m *MF4) ReadChangeLog()

ReadChangeLog reads and prints the change log entries from the MF4 file. The change log is stored in FHBLOCK structures, each representing a change made to the MDF file. The function iterates through the linked list of FHBLOCKs starting from the first one referenced by the HDBLOCK, printing the chronological change history.

Parameters:

m: A pointer to the MF4 instance containing the file change log.

func (*MF4) SaveAttachment

func (m *MF4) SaveAttachment(attachment AT.AttFile, outputPath string) AT.AttFile

Saves attachment file input to output path

func (*MF4) StartAngleRad

func (m *MF4) StartAngleRad() (float64, error)

Start angle in radians at the beginning of the measurement serves as the reference point for angle synchronous measurements.

func (*MF4) StartDistanceM

func (m *MF4) StartDistanceM() (float64, error)

Start distance in meters in meters at the beginning of the measurement serves as the reference point for distance synchronous measurements.

func (*MF4) TimezoneOffsetMin

func (m *MF4) TimezoneOffsetMin(tzo int16, timeFlag uint8) (int16, error)

Time zone offset in minutes. Range (-840, 840) minutes. For instance, a value of 60 minutes implies UTC+1 time zone, corresponding to Central European Time (CET).

func (*MF4) Version

func (m *MF4) Version() string

Version method returns the MDF file version

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL