ui

package
v0.211022.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: CC0-1.0 Imports: 24 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 Cook

func Cook(ctx context.Context) error

func FillMenu

func FillMenu(ctx context.Context)

func Init added in v0.210928.0

func Init(ctx context.Context) error

func ScaleTuneRate

func ScaleTuneRate(value, max, center uint8) float32

func VisualHash

func VisualHash(input, salt []byte) string

Types

type Menu map[string]MenuItem
type MenuItem struct {
	Name  string
	D     engine.Doer
	Price currency.Amount
	Code  string
}
func (mi *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 (ui *UI) Init(ctx context.Context) error

func (*UI) LockDecrementWait

func (ui *UI) LockDecrementWait()

func (*UI) LockEnd

func (ui *UI) LockEnd()

LockEnd Stop locked state ignoring call balance

func (*UI) LockFunc

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

func (*UI) LockWait

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

func (*UI) Loop

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

func (*UI) ScheduleSync

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

func (*UI) State

func (ui *UI) State() State

func (*UI) XXX_testSetState

func (ui *UI) XXX_testSetState(new State)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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