models

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

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderType      = "order"
	StateOrderType = "stateOrder"
	NumericKind    = "numeric"
	BooleanKind    = "boolean"
	EnumKind       = "enum"
)

Variables

This section is empty.

Functions

func IsNumeric

func IsNumeric(kind string) bool

Types

type BoardOrders

type BoardOrders struct {
	Name        string                  `json:"name"`
	Orders      []OrderDescription      `json:"orders"`
	StateOrders []StateOrderDescription `json:"stateOrders"`
}

type BooleanDescription

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

type EnumDescription

type EnumDescription struct {
	Options []string `json:"options"`
	// contains filtered or unexported fields
}

type Equals

type Equals struct {
	Value float64 `json:"value"`
}

type Error

type Error = string

type Field

type Field struct {
	Value     any  `json:"value"`
	IsEnabled bool `json:"isEnabled"`
}

type Info

type Info = string

type InfoMessage

type InfoMessage struct {
	Board     string    `json:"board"`
	Timestamp Timestamp `json:"timestamp"`
	Msg       string    `json:"msg"`
	Kind      string    `json:"kind"`
}

type LowerBound

type LowerBound struct {
	Value float64 `json:"value"`
	Bound float64 `json:"bound"`
}

type NotEquals

type NotEquals struct {
	Value float64 `json:"value"`
	Want  float64 `json:"want"`
}

type NumericDescription

type NumericDescription struct {
	VarType      string     `json:"type"`
	SafeRange    []*float64 `json:"safeRange"`
	WarningRange []*float64 `json:"warningRange"`
	// contains filtered or unexported fields
}

type Order

type Order struct {
	ID     uint16           `json:"id"`
	Fields map[string]Field `json:"fields"`
}

type OrderData

type OrderData struct {
	Orders      map[string]OrderDescription `json:"orders"`
	StateOrders map[string]OrderDescription `json:"stateOrders"`
}

type OrderDescription

type OrderDescription struct {
	Id     uint16         `json:"id"`
	Name   string         `json:"name"`
	Fields map[string]any `json:"fields"`
}

type OutOfBounds

type OutOfBounds struct {
	Value  float64    `json:"value"`
	Bounds [2]float64 `json:"bounds"`
}

type PacketUpdate

type PacketUpdate struct {
	Metadata packet.Metadata
	HexValue []byte
	Values   map[string]packet.Value
}

type Protection

type Protection struct {
	Kind string `json:"kind"`
	Data any    `json:"data"`
}

type ProtectionMessage

type ProtectionMessage struct {
	Board     string    `json:"board"`
	Name      string    `json:"name"`
	Timestamp Timestamp `json:"timestamp"`

	Kind       string     `json:"kind"`
	Protection Protection `json:"protection"`
}

type StateOrderDescription

type StateOrderDescription struct {
	OrderDescription
	Enabled bool `json:"enabled"`
}

type StateOrdersMessage

type StateOrdersMessage struct {
	BoardId string   `json:"board"`
	Orders  []uint16 `json:"orders"`
}

type StateSpace

type StateSpace [8][15]float32

func NewStateSpace

func NewStateSpace(buf []byte) StateSpace

type TimeLimit

type TimeLimit struct {
	Value     float64 `json:"value"`
	Bound     float64 `json:"bound"`
	TimeLimit float64 `json:"timelimit"`
}

type Timestamp

type Timestamp struct {
	Counter uint16 `json:"counter"`
	Second  uint8  `json:"second"`
	Minute  uint8  `json:"minute"`
	Hour    uint8  `json:"hour"`
	Day     uint8  `json:"day"`
	Month   uint8  `json:"month"`
	Year    uint16 `json:"year"`
}

type TransmittedOrder

type TransmittedOrder struct {
	Metadata packet.Metadata
	HexValue []byte
	Values   map[string]packet.Value
}

type UpperBound

type UpperBound struct {
	Value float64 `json:"value"`
	Bound float64 `json:"bound"`
}

type VehicleOrders

type VehicleOrders struct {
	Boards []BoardOrders `json:"boards"`
}

func NewVehicleOrders

func NewVehicleOrders(boards []pod_data.Board, blcuName string) (VehicleOrders, error)

Jump to

Keyboard shortcuts

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