Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoSuchModel = errors.New("no such model")
)
Functions ¶
func DoModels ¶
func DoModels(f func(m *ModelElement) error) error
DoModels iterates over all the registered models and calls the specified function on each.
func RegisterModel ¶
func RegisterModel(m *ModelElement)
RegisterModel registers a new model element.
Types ¶
type BlockElement ¶
type ModelDefinitionElement ¶
type ModelDefinitionElement struct { XMLName xml.Name `xml:"sunSpecModels"` Version string `xml:"v,attr"` Models []ModelElement `xml:"model"` Strings []StringsElement `xml:"strings"` }
type ModelElement ¶
type ModelElement struct { XMLName xml.Name `xml:"model"` Id uint16 `xml:"id,attr"` Name string `xml:"name,attr"` Length uint16 `xml:"len,attr"` Blocks []BlockElement `xml:"block"` }
func GetModel ¶
func GetModel(id uint16) *ModelElement
GetModel answers the model element corresponding to the specified identifier or nil if no such element exists.
type ModelStringsElement ¶
type PointElement ¶
type PointElement struct { XMLName xml.Name `xml:"point"` Id string `xml:"id,attr"` Label string `xml:",omit"` Description string `xml:",omit"` Offset uint16 `xml:"offset,attr"` Length uint16 `xml:"len,attr"` Type string `xml:"type,attr"` ScaleFactor string `xml:"sf,attr"` Units string `xml:"units,attr"` Mandatory bool `xml:"mandatory,attr"` Access string `xml:"access,attr"` Symbols []SymbolElement `xml:"symbol"` }
type PointStringsElement ¶
type StringsElement ¶
type StringsElement struct { XMLName xml.Name `xml:"strings"` Id string `xml:"id,attr"` Locale string `xml:"locale,attr"` ModelStrings ModelStringsElement `xml:"model"` PointStrings []PointStringsElement `xml:"point"` }
Click to show internal directories.
Click to hide internal directories.