[修改]暂时注释掉12号线联锁和计轴的大段日志

This commit is contained in:
thesai 2024-08-21 09:18:55 +08:00
parent 0de305b397
commit f8517f0ead
3 changed files with 10 additions and 11 deletions

View File

@ -95,7 +95,7 @@ func Start(simulation *memory.VerifySimulation) {
serviceCtx.msgChan = msgChan
netAConfig := rsspConfig.NetAConfig
server := udp.NewServer(fmt.Sprintf(":%d", netAConfig.LocalPort), func(b []byte) {
logger().Info(fmt.Sprintf("收到数据:%x", b))
//logger().Info(fmt.Sprintf("收到数据:%x", b))
msgChan <- b
})
client := udp.NewClient(fmt.Sprintf("%s:%d", netAConfig.RemoteIp, netAConfig.RemotePort))
@ -254,7 +254,7 @@ func (s *serviceContext) runCollectTask(ctx context.Context) {
if err != nil {
logger().Error("发送状态数据失败", "error", err)
} else {
logger().Info(fmt.Sprintf("发送数据:%x", data))
//logger().Info(fmt.Sprintf("发送数据:%x", data))
}
}
}

View File

@ -150,7 +150,7 @@ func (i *interlockProxy) collectInfoStateTask(ctx context.Context) {
if err != nil {
logger().Error(fmt.Sprintf("向联锁发送继电器状态失败:%s", err))
} else {
logger().Info(fmt.Sprintf("向联锁发送继电器数据成功:%x", collectInfoState.Encode()))
//logger().Info(fmt.Sprintf("向联锁发送继电器数据成功:%x", collectInfoState.Encode()))
}
}
}
@ -183,7 +183,7 @@ func (i *interlockProxy) initInterlockProxy() {
func (i *interlockProxy) handleFromCiData(n int, data []byte) {
data = data[:n]
logger().Info(fmt.Sprintf("收到联锁驱动及应答器报文数据,长度%d", n))
//logger().Info(fmt.Sprintf("收到联锁驱动及应答器报文数据,长度%d", n))
if len(i.fromCIBytes) != 0 { //报文头已经存进去了
i.fromCIBytes = append(i.fromCIBytes, data...)
if len(i.fromCIBytes) < fromCIBytesLen { //当存储的报文长度不足预期长度
@ -198,7 +198,7 @@ func (i *interlockProxy) handleFromCiData(n int, data []byte) {
//处理联锁报文
msg := &fromCiMsg{}
err := msg.decode(i.fromCIBytes)
logger().Info(fmt.Sprintf("解析完整联锁驱动及应答器报文数据:%x", i.fromCIBytes))
//logger().Info(fmt.Sprintf("解析完整联锁驱动及应答器报文数据:%x", i.fromCIBytes))
i.fromCIBytes = i.fromCIBytes[:0] //清空联锁报文存储
if err != nil {
logger().Error(fmt.Sprintf("解析来自CI的数据出错%s", err.Error()))
@ -206,7 +206,7 @@ func (i *interlockProxy) handleFromCiData(n int, data []byte) {
}
//处理驱动数据
if i.simulation != nil {
logger().Info(fmt.Sprintf("解析出的驱动数据:%x", msg.driveData))
//logger().Info(fmt.Sprintf("解析出的驱动数据:%x", msg.driveData))
station := i.simulation.Repo.FindStationByStationName(i.runConfig.Code)
if station != nil {
i.simulation.HandleInterlockDriverInfo(station.Id(), msg.driveData)
@ -218,12 +218,12 @@ func (i *interlockProxy) handleFromCiData(n int, data []byte) {
for _, datum := range msg.baliseTelegramData {
indexBalise2 := i.indexBalise[datum.leuIndex]
if indexBalise2 == nil {
logger().Error(fmt.Sprintf("没有leuIndex[%d]的应答器", datum.leuIndex))
//logger().Error(fmt.Sprintf("没有leuIndex[%d]的应答器", datum.leuIndex))
continue
}
balise := indexBalise2[datum.index]
if balise == nil {
logger().Error(fmt.Sprintf("没有leuIndex[%d]leu内索引[%d]的应答器", datum.leuIndex, datum.index))
//logger().Error(fmt.Sprintf("没有leuIndex[%d]leu内索引[%d]的应答器", datum.leuIndex, datum.index))
continue
}
userTelegram, err := balisecodec.Decode(datum.telegram)
@ -231,13 +231,13 @@ func (i *interlockProxy) handleFromCiData(n int, data []byte) {
logger().Error(fmt.Sprintf("解析应答器报文[%x]出错:%s", datum.telegram, err.Error()))
continue
} else {
logger().Info(fmt.Sprintf("解析出应答器[%s]的可变报文", balise.Id()))
//logger().Info(fmt.Sprintf("解析出应答器[%s]的可变报文", balise.Id()))
}
err = fi.BaliseUpdateVariableTelegram(i.simulation.World, balise.Id(), datum.telegram, userTelegram, false)
if err != nil {
logger().Error(fmt.Sprintf("更新leuIndex[%d]leu内索引[%d]的应答器[%s]数据出错:%s", datum.leuIndex, datum.index, balise.Id(), err.Error()))
} else {
logger().Info(fmt.Sprintf("更新leuIndex[%d]leu内索引[%d]的应答器[%s]数据成功", datum.leuIndex, datum.index, balise.Id()))
//logger().Info(fmt.Sprintf("更新leuIndex[%d]leu内索引[%d]的应答器[%s]数据成功", datum.leuIndex, datum.index, balise.Id()))
}
}
}

View File

@ -412,7 +412,6 @@ func (s *VerifySimulation) HandleInterlockDriverInfo(code string, driveBytes []b
driveInfo = append(driveInfo, (b&(1<<bit)) != 0)
}
}
slog.Info(fmt.Sprintf("12号线驱动数据解析结果%v", driveInfo))
for i, b := range driveInfo {
qdData := m.QdList[i]
for _, relayId := range qdData.RefRelays {