btm
This commit is contained in:
parent
901009ce13
commit
7a75716196
@ -58,8 +58,10 @@ type TrainBtm struct {
|
|||||||
lastTelegram *TrainBaliseTelegram
|
lastTelegram *TrainBaliseTelegram
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const SB_LEN = 16
|
||||||
|
|
||||||
func NewTrainBtm() *TrainBtm {
|
func NewTrainBtm() *TrainBtm {
|
||||||
return &TrainBtm{scannedBalises: make(chan *TrainBaliseTelegram, 16)}
|
return &TrainBtm{scannedBalises: make(chan *TrainBaliseTelegram, SB_LEN)}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 应答器计数器加1,[0,255]
|
// 应答器计数器加1,[0,255]
|
||||||
@ -95,7 +97,9 @@ func (t *TrainBtm) Scanning(aboveBalise bool, telegram *TrainBaliseTelegram) {
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
if isNewTbt {
|
if isNewTbt {
|
||||||
t.scannedBalises <- telegram
|
if len(t.scannedBalises) < SB_LEN {
|
||||||
|
t.scannedBalises <- telegram
|
||||||
|
}
|
||||||
t.baliseMessageCounterAdd1()
|
t.baliseMessageCounterAdd1()
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user