Documentation
¶
Index ¶
- type Attribute
- func NewEnumAttribute(kind AttributeKind, name string, values []string) *Attribute
- func NewFloatAttribute(kind AttributeKind, name string, from float64, to float64) *Attribute
- func NewHexAttribute(kind AttributeKind, name string, from int, to int) *Attribute
- func NewIntAttribute(kind AttributeKind, name string, from int, to int) *Attribute
- func NewStringAttribute(kind AttributeKind, name string) *Attribute
- func (a *Attribute) SetEnumDefault(def string) error
- func (a *Attribute) SetFloatDefault(def float64) error
- func (a *Attribute) SetHexDefault(def int) error
- func (a *Attribute) SetIntDefault(def int) error
- func (a *Attribute) SetStringDefault(def string) error
- func (a *Attribute) ToDBC() (*dbc.Attribute, *dbc.AttributeDefault)
- type AttributeDefault
- type AttributeEnum
- type AttributeKind
- type AttributeMap
- type AttributeNumber
- type AttributeType
- type AttributeValue
- func NewEnumAttributeValue(att *Attribute, value int) (*AttributeValue, error)
- func NewFloatAttributeValue(att *Attribute, value float64) (*AttributeValue, error)
- func NewHexAttributeValue(att *Attribute, value int) (*AttributeValue, error)
- func NewIntAttributeValue(att *Attribute, value int) (*AttributeValue, error)
- func NewStringAttributeValue(att *Attribute, value string) (*AttributeValue, error)
- type CAN
- func (c *CAN) AddAttribute(att *Attribute) error
- func (c *CAN) AddMessage(msg *Message) error
- func (c *CAN) AddNode(node *Node) error
- func (c *CAN) GetAttribute(attName string) (*Attribute, error)
- func (c *CAN) GetMessage(msgID MessageID) (*Message, error)
- func (c *CAN) GetNode(nodeName string) (*Node, error)
- func (c *CAN) SetBaudrate(baudrate uint)
- func (c *CAN) SetVersionString(versionString string)
- func (c *CAN) ToDBC(dbcFilename string) error
- type Description
- type Message
- type MessageID
- type Node
- type Signal
- type SignalByteOrder
- type SignalValueType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct { Type AttributeType Kind AttributeKind Name string Int *AttributeNumber[int] Hex *AttributeNumber[int] Float *AttributeNumber[float64] String *AttributeDefault[string] Enum *AttributeEnum }
func NewEnumAttribute ¶
func NewEnumAttribute(kind AttributeKind, name string, values []string) *Attribute
func NewFloatAttribute ¶
func NewFloatAttribute(kind AttributeKind, name string, from float64, to float64) *Attribute
func NewHexAttribute ¶
func NewHexAttribute(kind AttributeKind, name string, from int, to int) *Attribute
func NewIntAttribute ¶
func NewIntAttribute(kind AttributeKind, name string, from int, to int) *Attribute
func NewStringAttribute ¶
func NewStringAttribute(kind AttributeKind, name string) *Attribute
func (*Attribute) SetEnumDefault ¶
func (*Attribute) SetFloatDefault ¶
func (*Attribute) SetHexDefault ¶
func (*Attribute) SetIntDefault ¶
func (*Attribute) SetStringDefault ¶
type AttributeDefault ¶
type AttributeEnum ¶
type AttributeEnum struct { AttributeDefault[string] Values []string }
type AttributeKind ¶
type AttributeKind uint
const ( AttributeKindGeneral AttributeKind = iota AttributeKindNode AttributeKindMessage AttributeKindSignal )
func (AttributeKind) ToDBC ¶
func (ak AttributeKind) ToDBC() dbc.AttributeKind
type AttributeMap ¶
type AttributeMap struct {
Attributes map[string]*AttributeValue
}
func (*AttributeMap) AssignAttribute ¶
func (am *AttributeMap) AssignAttribute(att *AttributeValue)
func (*AttributeMap) GetAttributeValues ¶
func (am *AttributeMap) GetAttributeValues() map[string]*AttributeValue
type AttributeNumber ¶
type AttributeNumber[T int | float64] struct { AttributeDefault[T] From T To T }
type AttributeType ¶
type AttributeType uint
const ( AttributeTypeInt AttributeType = iota AttributeTypeHex AttributeTypeFloat AttributeTypeString AttributeTypeEnum )
type AttributeValue ¶
type AttributeValue struct { Definition *Attribute IntValue int HexValue int FloatValue float64 StringValue string EnumValue int }
func NewEnumAttributeValue ¶
func NewEnumAttributeValue(att *Attribute, value int) (*AttributeValue, error)
func NewFloatAttributeValue ¶
func NewFloatAttributeValue(att *Attribute, value float64) (*AttributeValue, error)
func NewHexAttributeValue ¶
func NewHexAttributeValue(att *Attribute, value int) (*AttributeValue, error)
func NewIntAttributeValue ¶
func NewIntAttributeValue(att *Attribute, value int) (*AttributeValue, error)
func NewStringAttributeValue ¶
func NewStringAttributeValue(att *Attribute, value string) (*AttributeValue, error)
func (*AttributeValue) ToDBC ¶
func (av *AttributeValue) ToDBC() *dbc.AttributeValue
type CAN ¶
type CAN struct { Description AttributeMap VersionString string Baudrate uint Nodes map[string]*Node Messages map[MessageID]*Message Attributes map[string]*Attribute }
func NewCANFromDBC ¶
func (*CAN) AddAttribute ¶
func (*CAN) AddMessage ¶
func (*CAN) SetBaudrate ¶
func (*CAN) SetVersionString ¶
type Description ¶
type Description struct {
Description string
}
func (*Description) GetDescription ¶
func (d *Description) GetDescription() string
func (*Description) HasDescription ¶
func (d *Description) HasDescription() bool
func (*Description) SetDescription ¶
func (d *Description) SetDescription(desc string)
type Message ¶
type Message struct { Description AttributeMap ID MessageID Name string Size uint Period uint Signals map[string]*Signal Transmitter *Node // contains filtered or unexported fields }
func (*Message) HasExtendedMuxSignals ¶
func (*Message) HasMuxSignals ¶
type Node ¶
type Node struct { Description AttributeMap Name string TxMessages []*Message RxSignals []*Signal }
func (*Node) AddRxSignal ¶
func (*Node) AddTxMessage ¶
type Signal ¶
type Signal struct { Description AttributeMap Name string Size uint StartBit uint ByteOrder SignalByteOrder ValueType SignalValueType Factor float64 Offset float64 Min float64 Max float64 Unit string Receivers []*Node MapValues map[uint]string IsMultiplexor bool IsMultiplexed bool MuxSignals []*Signal Multiplexor *Signal MuxIndexes []uint }
func (*Signal) AddMuxSignal ¶
func (*Signal) SetIsMultiplexed ¶
func (s *Signal) SetIsMultiplexed()
func (*Signal) SetIsMultiplexor ¶
func (s *Signal) SetIsMultiplexor()
type SignalByteOrder ¶
type SignalByteOrder uint
const ( LittleEndian SignalByteOrder = iota BigEndian )
Click to show internal directories.
Click to hide internal directories.