types

package
v0.210925.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterrupted = fmt.Errorf("scheduler interrupted, ignore like EPIPE")

Functions

func SetLight

func SetLight(v bool)

func ShowEnvs

func ShowEnvs() string

Types

type DeviceOfflineError

type DeviceOfflineError struct {
	Device Devicer
}

func (DeviceOfflineError) Error

func (oe DeviceOfflineError) Error() string

type Devicer

type Devicer interface {
	Name() string
}

type Doer

type Doer interface {
	Validate() error
	Do(context.Context) error
	String() string // for logs
}

type Event

type Event struct {
	Input  InputEvent
	Amount currency.Amount
	Kind   EventKind
}

func (*Event) String

func (e *Event) String() string

type EventKind

type EventKind uint8
const (
	EventInvalid EventKind = iota
	EventInput
	EventMoneyCredit
	EventTime
	EventLock
	EventService
	EventStop
	EventFrontLock
	EventUiTimerStop
)

func (EventKind) String

func (i EventKind) String() string

type InputEvent

type InputEvent struct {
	Source string
	Key    InputKey
	Up     bool
}

func (*InputEvent) IsDigit

func (e *InputEvent) IsDigit() bool

func (*InputEvent) IsDot

func (e *InputEvent) IsDot() bool

func (*InputEvent) IsZero

func (e *InputEvent) IsZero() bool

type InputKey

type InputKey uint16
type MenuItemType struct {
	Name  string
	D     Doer
	Price currency.Amount
	Code  string
}
func (self *MenuItemType) String() string

type Scheduler

type Scheduler interface {
	// Schedule(context.Context, tele_api.Priority, TaskFunc) <-chan error
	ScheduleSync(context.Context, tele_api.Priority, TaskFunc) error
}

type TaskFunc

type TaskFunc = func(context.Context) error

type UIMenuResult

type UIMenuResult struct {
	Item  MenuItemType
	Cream uint8
	Sugar uint8
}

type UIer

type UIer interface {
	Loop(context.Context)
	Scheduler
}

type UItype

type UItype struct {
	FrontResult UIMenuResult
	Menu        map[string]MenuItemType
}
var UI *UItype = nil

type VMCType

type VMCType struct {
	Version string
	Lock    bool
	State   uint32
	Client  struct {
		WorkTime time.Time
		Input    string
		Light    bool
	}
	HW struct {
		Input   bool
		Display struct {
			L1 string
			L2 string
		}
		Elevator struct {
			Position uint8
		}
		Temperature int
	}
	MonSys struct {
		BillOn  bool
		BillRun bool
	}
}
var VMC *VMCType = nil

Jump to

Keyboard shortcuts

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