初步完成龙台的读卡逻辑

This commit is contained in:
2024-12-09 18:28:36 +08:00
parent aa634c8860
commit 37fb40672a
15 changed files with 313 additions and 43 deletions

View File

@@ -0,0 +1,33 @@
package card_pusher
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
}