DPF/command.go

27 lines
482 B
Go
Raw Permalink Normal View History

2019-11-01 13:47:11 +00:00
package main
import "time"
// Command 命令相关
type Command struct {
2019-11-04 06:29:08 +00:00
commands CommandType
2019-11-01 13:47:11 +00:00
commandTime time.Time
}
2019-11-04 06:29:08 +00:00
// CommandType 命令
type CommandType string
const (
CMDDoNothing = "不做任何操作"
CMDChaoShengBoQingXi = "超声波清洗"
CMDQingXiGuanFangShui = "清洗罐放水"
)
2019-11-02 07:48:16 +00:00
// CreateCommand 生成一个命令
2019-11-04 06:29:08 +00:00
func CreateCommand(cmdtype CommandType) *Command {
2019-11-01 13:47:11 +00:00
c := &Command{}
2019-11-04 06:29:08 +00:00
c.commands = cmdtype
c.commandTime = time.Now()
2019-11-01 13:47:11 +00:00
return c
}