controller

package
v0.0.0-...-0583f8e Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultOutputDir = "./output"

Variables

View Source
var (
	ReplaySpeed   = 1.0
	OnReplayError func(error)
)

Public variables

View Source
var ErrNotARegularFile = errors.New("file must be a regular file")
View Source
var ErrOutputChangedWhileRunning = errors.New("cannot change output file while running")
View Source
var ErrReplayRunning = errors.New("replay is running")
View Source
var ErrSerialConnectionOpened = errors.New("serial connection opened")
View Source
var (
	OnSerialError func(error)
)

Functions

func CloseConnection

func CloseConnection()

CloseConnection closes the connection to the serial port. It will NOT panic if there's no opened connection.

func Generate

func Generate() error

func GetSerialOutputFile

func GetSerialOutputFile() *os.File

func IsConnected

func IsConnected() bool

IsConnected returns whether a serial connection is open or not.

func IsGeneratorStarted

func IsGeneratorStarted() bool

func IsReplayPaused

func IsReplayPaused() bool

func IsReplayStarted

func IsReplayStarted() bool

func ListAvailablePorts

func ListAvailablePorts() []string

ListAvailablePorts lists all available serial ports.

See serial.GetPortsList

func LoadFile

func LoadFile(csvFile string) error

LoadFile TODO doc

func OpenConnection

func OpenConnection(port string) (err error)

OpenConnection opens a connection to the specified port and starts listenning for incoming data.

func PauseReplay

func PauseReplay()

func Replay

func Replay(reader io.Reader) error

func ReplayTimeSinceT0

func ReplayTimeSinceT0() time.Duration

func ResumeReplay

func ResumeReplay()

func SetActuator

func SetActuator(item state.Item, val bool, callback func())

func SetSerialOutputFile

func SetSerialOutputFile(path string, overwrite bool) error

func Shutdown

func Shutdown()

func StopGenerator

func StopGenerator()

func StopReplay

func StopReplay()

Types

type Mode

type Mode uint8
const (
	MODE_SERIAL Mode = 0b0000_0001 << iota
	MODE_REPLAY
	MODE_GENERATE
	MODE_NONE Mode = 0b0000_0000
)

func CurrentMode

func CurrentMode() Mode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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