ui

package
v0.210504.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: CC0-1.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCream = 4
	MaxCream     = 6
	DefaultSugar = 4
	MaxSugar     = 8
)
View Source
const (
	MsgError = "error"
)

Variables

View Source
var ScaleAlpha = []byte{
	0x94,
	0x95,
	0x96,
	0x97,
}

Functions

func ScaleTuneRate

func ScaleTuneRate(value, max, center uint8) float32

func VisualHash

func VisualHash(input, salt []byte) string

Types

type Menu map[string]MenuItem
func (self Menu) Add(code string, name string, price currency.Amount, d engine.Doer)
func (self Menu) Init(ctx context.Context) error
type MenuItem struct {
	Name  string
	D     engine.Doer
	Price currency.Amount
	Code  string
}
func (self *MenuItem) String() string

type State

type State uint32
const (
	StateDefault State = iota

	StateBoot   // t=onstart +onstartOk=FrontHello +onstartError+retry=Boot +retryMax=Broken
	StateBroken // t=tele/input +inputService=ServiceBegin
	StateLocked // t=tele

	StateFrontBegin   // t=checkVariables +=FrontHello
	StateFrontSelect  // t=input/money/timeout +inputService=ServiceBegin +input=... +money=... +inputAccept=FrontAccept +timeout=FrontTimeout
	StateFrontTune    // t=input/money/timeout +inputTune=FrontTune ->FrontSelect
	StateFrontAccept  // t=engine.Exec(Item) +OK=FrontEnd +err=Broken
	StateFrontTimeout // t=saveMoney ->FrontEnd
	StateFrontEnd     // ->FrontBegin

	StateServiceBegin // t=input/timeout ->ServiceAuth
	StateServiceAuth  // +inputAccept+OK=ServiceMenu
	StateServiceMenu
	StateServiceInventory
	StateServiceTest
	StateServiceReboot
	StateServiceNetwork
	StateServiceMoneyLoad
	StateServiceReport
	StateServiceEnd // +askReport=ServiceReport ->FrontBegin

	StateStop

	StateFrontLock
)

func (State) String

func (i State) String() string

type UI

type UI struct {
	FrontMaxPrice currency.Amount
	FrontResult   UIMenuResult
	Service       uiService

	XXX_testHook func(State)
	// contains filtered or unexported fields
}

func (*UI) Init

func (self *UI) Init(ctx context.Context) error

func (*UI) LockDecrementWait

func (self *UI) LockDecrementWait()

func (*UI) LockEnd

func (self *UI) LockEnd()

Stop locked state ignoring call balance

func (*UI) LockFunc

func (self *UI) LockFunc(pri tele_api.Priority, fun func()) bool

func (*UI) LockWait

func (self *UI) LockWait(pri tele_api.Priority) bool

func (*UI) Loop

func (self *UI) Loop(ctx context.Context)

func (*UI) ScheduleSync

func (self *UI) ScheduleSync(ctx context.Context, priority tele_api.Priority, fun types.TaskFunc) error

func (*UI) State

func (self *UI) State() State

func (*UI) XXX_testSetState

func (self *UI) XXX_testSetState(new State)

type UIMenuResult

type UIMenuResult struct {
	Item  MenuItem
	Cream uint8
	Sugar uint8
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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