profile

package
v0.0.0-...-0d74649 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransformTypes

func TransformTypes(ptypes []*PType) (map[string]*Type, error)

Types

type Component

type Component struct {
	Name       string
	Bits       string
	BitsInt    int
	Scale      string
	Offset     string
	Accumulate bool
}

type Field

type Field struct {
	DefNum string
	Name   string
	CCName string
	Array  string
	Scale  string
	Offset string
	Units  string

	TypeName string
	FType    types.Fit
	Length   string

	Components []Component

	Subfields     []*Field // Not set for subfields
	RefFieldName  []string // Only set for subfields
	RefFieldValue []string // Only set for subfields

	Comment string
	Example string
	// contains filtered or unexported fields
}

func (*Field) HasComment

func (f *Field) HasComment() bool

func (*Field) HasOffset

func (f *Field) HasOffset() bool

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(sdkMajVer, sdkMinVer int, workbookData []byte, opts ...GeneratorOption) (*Generator, error)

func (*Generator) GenerateProfile

func (g *Generator) GenerateProfile() (*Profile, error)

type GeneratorOption

type GeneratorOption func(*generatorOptions)

func WithDebugOutput

func WithDebugOutput() GeneratorOption

func WithGenerationTimestamp

func WithGenerationTimestamp(gt bool) GeneratorOption

func WithLogger

func WithLogger(logger *log.Logger) GeneratorOption

type Msg

type Msg struct {
	Name        string
	CCName      string
	Fields      []*Field
	FieldByName map[string]*Field
}

func TransformMsgs

func TransformMsgs(pmsgs []*PMsg, ftypes map[string]*Type, logger *log.Logger) ([]*Msg, error)

type PField

type PField struct {
	Field     []string
	Subfields [][]string
}

type PMsg

type PMsg struct {
	Header []string
	Fields []*PField
}

type PType

type PType struct {
	Header []string
	Fields [][]string
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewMsgParser

func NewMsgParser(input [][]string) (*Parser, error)

func NewTypeParser

func NewTypeParser(input [][]string) (*Parser, error)

func (*Parser) ParseMsg

func (p *Parser) ParseMsg() (*PMsg, error)

func (*Parser) ParseType

func (p *Parser) ParseType() (*PType, error)

type Profile

type Profile struct {
	TypesSource            []byte
	MessagesSource         []byte
	ProfileSource          []byte
	StringerInput          []string
	MesgNumsWithoutMessage []string
}

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

func NewMsgScanner

func NewMsgScanner(input [][]string) (*Scanner, error)

func NewTypeScanner

func NewTypeScanner(input [][]string) (*Scanner, error)

func (*Scanner) Scan

func (s *Scanner) Scan() (line int, token Token, literal []string)

type Token

type Token int
const (
	// Common
	ILLEGAL Token = iota
	EOF
	EMPTY
	PROFILEHDR

	// Types
	THDR
	TFIELD

	// Messages
	FMSGSHDR
	MSGHDR
	MSGFIELD
	DYNMSGFIELD
)

func (Token) String

func (t Token) String() string

type Type

type Type struct {
	Name     string
	OrigName string
	BaseType types.Base
	Values   []ValueTriple
	// contains filtered or unexported fields
}

type ValueTriple

type ValueTriple struct {
	Name, Value, Comment string
}

Jump to

Keyboard shortcuts

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