ui

package
v0.220731.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 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 Cook

func Cook(ctx context.Context) error

func Cook(ctx context.Context, rm *tele_api.FromRoboMessage) error {

func CreateOrderMessageAndFillSelected added in v0.220427.0

func CreateOrderMessageAndFillSelected() tele_api.FromRoboMessage

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   // 1 t=onstart +onstartOk=FrontHello +onstartError+retry=Boot +retryMax=Broken
	StateBroken // 2 t=tele/input +inputService=ServiceBegin
	StateLocked // 3 t=tele

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

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

	StateStop //21

	StateFrontLock
)

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(fun func()) bool

func (*UI) Loop

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

func (*UI) ScheduleSync

func (ui *UI) ScheduleSync(ctx context.Context, 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