parser

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentField

type ComponentField interface {
	GetComponents() []string
	GetScales() []float64
	GetOffsets() []float64
	GetAccumulate() []bool
	GetBits() []byte
}

type Field

type Field struct {
	Num        byte
	Name       string
	Type       string
	Array      string
	Components []string
	Scales     []float64
	Offsets    []float64
	Units      string
	Bits       []byte
	Accumulate []bool
	SubFields  []SubField
	Comment    string
	Product    string
	Example    string
}

func (Field) GetAccumulate

func (f Field) GetAccumulate() []bool

func (Field) GetBits

func (f Field) GetBits() []byte

func (Field) GetComponents

func (f Field) GetComponents() []string

func (Field) GetOffsets

func (f Field) GetOffsets() []float64

func (Field) GetScales

func (f Field) GetScales() []float64

type Message

type Message struct {
	Name    string
	Comment string
	Fields  []Field
}

type Parser

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

Parser is Profile.xlsx parser

func New

func New(xl *xlsxlite.XlsxLite, sheetNames map[Sheet]string) *Parser

New creates new Parser.

func (*Parser) ParseMessages

func (p *Parser) ParseMessages() ([]Message, error)

ParseTypes parse sheet "Messages" in Profile.xlsx

func (*Parser) ParseTypes

func (p *Parser) ParseTypes() ([]Type, error)

ParseTypes parse sheet "Types" in Profile.xlsx

type Sheet

type Sheet byte
const (
	SheetTypes Sheet = iota
	SheetMessages
)

type SubField

type SubField struct {
	FieldNum      byte
	Name          string
	Type          string
	Array         string
	Components    []string
	Scales        []float64
	Offsets       []float64
	Units         string
	Bits          []byte
	Accumulates   []bool
	RefFieldNames []string
	RefFieldValue []string
	Comment       string
	Product       string
	Example       string
}

func (SubField) GetAccumulate

func (f SubField) GetAccumulate() []bool

func (SubField) GetBits

func (f SubField) GetBits() []byte

func (SubField) GetComponents

func (f SubField) GetComponents() []string

func (SubField) GetOffsets

func (f SubField) GetOffsets() []float64

func (SubField) GetScales

func (f SubField) GetScales() []float64

type Type

type Type struct {
	Name     string
	BaseType string
	Values   []Value
}

type Value

type Value struct {
	Name    string
	Value   string
	Comment string
}

Jump to

Keyboard shortcuts

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