Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
tiger_zhou 2024-05-23 19:09:37 +08:00
commit a4b761f720

View File

@ -53,6 +53,7 @@ type interlockProxy struct {
// 驱动信息进行转发 // 驱动信息进行转发
func (i *interlockProxy) handleDriverInfo(b []byte) { func (i *interlockProxy) handleDriverInfo(b []byte) {
slog.Info("收到联锁驱动继电器数据:", fmt.Sprintf("%x", b))
handler := i.manager handler := i.manager
if handler != nil { if handler != nil {
handler.HandleInterlockDriverInfo(i.runConfig.Code, b) handler.HandleInterlockDriverInfo(i.runConfig.Code, b)
@ -101,7 +102,12 @@ func (i *interlockProxy) collectInfoStateTask(ctx context.Context) {
if collectInfoState != nil { if collectInfoState != nil {
serialNumber++ serialNumber++
collectInfoState.SetSerialNumber(serialNumber) collectInfoState.SetSerialNumber(serialNumber)
i.sendCollectUdpClient.SendMsg(collectInfoState) err := i.sendCollectUdpClient.SendMsg(collectInfoState)
if err != nil {
slog.Error("向联锁发送继电器状态失败:", err)
} else {
slog.Error("向联锁发送继电器数据成功:", fmt.Sprintf("%x", collectInfoState.Encode()))
}
} }
time.Sleep(time.Millisecond * InterlockMessageSendInterval) time.Sleep(time.Millisecond * InterlockMessageSendInterval)
} }