profile

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 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 added in v0.2.0

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 added in v0.10.1

func (f *Field) HasComment() bool

func (*Field) HasOffset added in v0.10.1

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 added in v0.10.1

type GeneratorOption func(*generatorOptions)

func WithDebugOutput added in v0.10.1

func WithDebugOutput() GeneratorOption

func WithGenerationTimestamp added in v0.10.1

func WithGenerationTimestamp(gt bool) GeneratorOption

func WithLogger added in v0.10.1

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 added in v0.2.0

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

type PMsg added in v0.2.0

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

type PType added in v0.2.0

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 added in v0.10.1

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