Documentation
¶
Index ¶
- func PutRigSystem(ctx context.Context, store datastore.Store, system *RigSystem) error
- func WithActuators(actuators ...*model.ActuatorV2) func(any) error
- func WithLocation(lat, long float64) func(any) error
- func WithPeripherals(peripherals ...*model.Device) func(any) error
- func WithRigSystemDefaults() func(any) error
- func WithSensors(sensors ...*model.SensorV2) func(any) error
- func WithVariables(variables ...*model.Variable) func(any) error
- func WithWifi(ssid, pass string) func(any) error
- type Option
- type RigSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PutRigSystem ¶
Put puts a RigSystem and all of its components into the datastore.
func WithActuators ¶
func WithActuators(actuators ...*model.ActuatorV2) func(any) error
WithActuators is a functional option that adds the passed actuators to the RigSystem.
func WithLocation ¶
WithLocation is a functional option which sets the latitude and longitude.
func WithPeripherals ¶
WithPeripherals is a functional option that adds the passed peripherals to the RigSystem.
func WithRigSystemDefaults ¶
WithRigSystemDefaults is a functional option that uses all of the current defaults for a rig system.
func WithSensors ¶
WithSensors is a functional option that adds the passed sensors to the RigSystem.
func WithVariables ¶
WithVariables is a functional option that adds the passed variables to the RigSystem.
Types ¶
type RigSystem ¶
type RigSystem struct { Controller model.Device Variables []*model.Variable Sensors []*model.SensorV2 Actuators []*model.ActuatorV2 Peripherals []*model.Device }
RigSystem represents a controller device which has associated variables, sensors, acuators, and peripherals.
func NewRigSystem ¶
NewRigSystem returns a new RigSystem with the given options. It is the callers responsibility to put the components into the datastore.
dkey, MAC and name refer to the device key, MAC Address and name of the Controller which will be the heart of the RigSystem.
func (*RigSystem) AddVariables ¶
addVariables adds variables to the rig system controller. This implements the variableHolder interface.
func (*RigSystem) SetLocation ¶
SetLocation adds the location of the system to the system controller, as well as any defined peripherals.