statemodel

package
v0.0.0-...-de2618e Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//MovedEvent is the constant for the moved event
	MovedEvent = "moved"
	//CycleCountEvent is the constant for the cyclecount event
	CycleCountEvent = "cycle_count"
	//ArrivalEvent is the constant for the arrival event from the RSP Controller
	ArrivalEvent = "arrival"
	//DepartedEvent is the constant for the departed event
	DepartedEvent = "departed"
	//ReturnedEvent is the constant for the returned event
	ReturnedEvent = "returned"
	//UnknownQualifiedState is the constant for the qualified state to be set initially
	UnknownQualifiedState = "unknown"
	//PresentEpcState is the constant for epc state of present
	PresentEpcState = "present"
	//DepartedEpcState is the constant for epc state of present
	DepartedEpcState = "departed"
	//MaxLocationHistory is the constant for max number of location history entries
	MaxLocationHistory = 10
)

Variables

This section is empty.

Functions

func AddLocationIfNew

func AddLocationIfNew(locationHistory []tag.LocationHistory, locationToAdd tag.LocationHistory) []tag.LocationHistory

AddLocationIfNew adds the location history to the array if that location history was not the last one added or updates the timestamp of the location if it was just added. Maintains only a certain max number of items (MaxLocationHistory)

func GetEpcState

func GetEpcState(currentEpcState string, newState tag.Tag) string

GetEpcState determines the epc state value based on the event received from the RSP Controller

func GetNewTagEvent

func GetNewTagEvent(eventType string) string

GetNewTagEvent determines the event based on the event received from RSP Controller. Arrival and Departed are the only return value options

func GetUpdatedEvent

func GetUpdatedEvent(currentEpcState string, currentEvent string, newEvent string) string

GetUpdatedEvent determines event based on the current tag's even and what event was received from the RSP Controller

func IsTagWhitelisted

func IsTagWhitelisted(epc string, whiteList []string) bool

IsTagWhitelisted determines if the tag received from RSP Controller belongs to the list of whitelisted epcs and returns true or false

func UpdateTag

func UpdateTag(currentState tag.Tag, newTagEvent jsonrpc.TagEvent, source string) tag.Tag

UpdateTag updates the existing tag or creates a new tag. Sets certain fields based on current tag values and the qualified events state model nolint :gocyclo

Types

This section is empty.

Jump to

Keyboard shortcuts

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