34 lines
659 B
Go
34 lines
659 B
Go
package card_device
|
|
|
|
type LineGroup struct {
|
|
Name string
|
|
OutOK int
|
|
Lower int
|
|
Error int
|
|
Empty int
|
|
|
|
Push int
|
|
Reset int
|
|
Pull int
|
|
}
|
|
|
|
func (g *LineGroup) AllInLines() []int {
|
|
return []int{g.OutOK, g.Lower, g.Error, g.Empty}
|
|
}
|
|
|
|
func (g *LineGroup) AllLabel() map[int]string {
|
|
labels := make(map[int]string)
|
|
labels[g.OutOK] = "OutOk"
|
|
labels[g.Lower] = "Lower"
|
|
labels[g.Error] = "Error"
|
|
labels[g.Empty] = "Empty"
|
|
labels[g.Push] = "Push"
|
|
labels[g.Reset] = "Reset"
|
|
labels[g.Pull] = "Pull"
|
|
return labels
|
|
}
|
|
|
|
func (g *LineGroup) Ok() bool {
|
|
return g.OutOK > 1 && g.Lower > 1 && g.Error > 1 && g.Empty > 1 && g.Push > 1 && g.Reset > 1 && g.Pull > 1
|
|
}
|