[bug]ESB模型构建bug
This commit is contained in:
parent
d706a42b1b
commit
3da710891e
|
@ -4,34 +4,34 @@ package beijing11
|
|||
type StationDeviceIndexTable struct {
|
||||
StationName string //地图数据中车站的Code属性
|
||||
WaysideCode string //通信数据中的“轨旁编号”
|
||||
TurnoutMap map[uint32]*Row
|
||||
PsdMap map[uint32]*Row
|
||||
EsbMap map[uint32]*Row
|
||||
HoldTrainMap map[uint32]*Row
|
||||
SignalMap map[uint32]*Row
|
||||
AxleSectionMap map[uint32]*Row
|
||||
WrzfMap map[uint32]*Row
|
||||
FymMap map[uint32]*Row
|
||||
SpksMap map[uint32]*Row
|
||||
CkmMap map[uint32]*Row
|
||||
XcjMap map[uint32]*Row
|
||||
TurnoutMap map[uint16]*Row
|
||||
PsdMap map[uint16]*Row
|
||||
EsbMap map[uint16]*Row
|
||||
HoldTrainMap map[uint16]*Row
|
||||
SignalMap map[uint16]*Row
|
||||
AxleSectionMap map[uint16]*Row
|
||||
WrzfMap map[uint16]*Row
|
||||
FymMap map[uint16]*Row
|
||||
SpksMap map[uint16]*Row
|
||||
CkmMap map[uint16]*Row
|
||||
XcjMap map[uint16]*Row
|
||||
}
|
||||
|
||||
func NewStationDeviceIndexTable() *StationDeviceIndexTable {
|
||||
return &StationDeviceIndexTable{
|
||||
StationName: "",
|
||||
WaysideCode: "",
|
||||
TurnoutMap: make(map[uint32]*Row),
|
||||
PsdMap: make(map[uint32]*Row),
|
||||
EsbMap: make(map[uint32]*Row),
|
||||
HoldTrainMap: make(map[uint32]*Row),
|
||||
SignalMap: make(map[uint32]*Row),
|
||||
AxleSectionMap: make(map[uint32]*Row),
|
||||
WrzfMap: make(map[uint32]*Row),
|
||||
FymMap: make(map[uint32]*Row),
|
||||
SpksMap: make(map[uint32]*Row),
|
||||
CkmMap: make(map[uint32]*Row),
|
||||
XcjMap: make(map[uint32]*Row),
|
||||
TurnoutMap: make(map[uint16]*Row),
|
||||
PsdMap: make(map[uint16]*Row),
|
||||
EsbMap: make(map[uint16]*Row),
|
||||
HoldTrainMap: make(map[uint16]*Row),
|
||||
SignalMap: make(map[uint16]*Row),
|
||||
AxleSectionMap: make(map[uint16]*Row),
|
||||
WrzfMap: make(map[uint16]*Row),
|
||||
FymMap: make(map[uint16]*Row),
|
||||
SpksMap: make(map[uint16]*Row),
|
||||
CkmMap: make(map[uint16]*Row),
|
||||
XcjMap: make(map[uint16]*Row),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,10 @@ func (s *serviceContext) handleDriveMsg(data []byte) {
|
|||
logger().Error("解析数据出错", "error", err)
|
||||
return
|
||||
}
|
||||
|
||||
//for _, cmd := range frame.TurnoutData.CmdList {
|
||||
// uid := s.deviceTable.TurnoutMap[cmd.Id].uid
|
||||
// fi.turn
|
||||
//}
|
||||
}
|
||||
|
||||
func Stop(stationCode string) {
|
||||
|
@ -117,7 +120,7 @@ func makeTable(sim *memory.VerifySimulation, stationCode string) *StationDeviceI
|
|||
for _, data := range stationGi.LianSuoData.Switchs {
|
||||
for _, station := range uids.TurnoutIds[data.Id].CentralizedStations {
|
||||
if station.Code == stationCode {
|
||||
table.TurnoutMap[data.Id] = &Row{
|
||||
table.TurnoutMap[uint16(data.Id)] = &Row{
|
||||
commonId: data.Id,
|
||||
uid: uids.TurnoutIds[data.Id].Uid,
|
||||
index: uint16(data.Index),
|
||||
|
@ -138,7 +141,7 @@ func makeTable(sim *memory.VerifySimulation, stationCode string) *StationDeviceI
|
|||
relateDeviceMap[DPB] = mkx.Pabj().Id()
|
||||
}
|
||||
}
|
||||
table.PsdMap[data.Id] = &Row{
|
||||
table.PsdMap[uint16(data.Id)] = &Row{
|
||||
commonId: data.Id,
|
||||
uid: uids.PsdIds[data.Id].Uid,
|
||||
index: uint16(data.Index),
|
||||
|
@ -151,7 +154,7 @@ func makeTable(sim *memory.VerifySimulation, stationCode string) *StationDeviceI
|
|||
for _, data := range stationGi.LianSuoData.EsbButtons {
|
||||
for _, station := range uids.EsbIds[data.Id].CentralizedStations {
|
||||
if station.Code == stationCode {
|
||||
table.EsbMap[data.Id] = &Row{
|
||||
table.EsbMap[uint16(data.Id)] = &Row{
|
||||
commonId: data.Id,
|
||||
uid: uids.EsbIds[data.Id].Uid,
|
||||
index: uint16(data.Index),
|
||||
|
@ -165,7 +168,7 @@ func makeTable(sim *memory.VerifySimulation, stationCode string) *StationDeviceI
|
|||
for _, data := range stationGi.LianSuoData.Signals {
|
||||
for _, station := range uids.SignalIds[data.Id].CentralizedStations {
|
||||
if station.Code == stationCode {
|
||||
table.SignalMap[data.Id] = &Row{
|
||||
table.SignalMap[uint16(data.Id)] = &Row{
|
||||
commonId: data.Id,
|
||||
uid: uids.SignalIds[data.Id].Uid,
|
||||
index: uint16(data.Index),
|
||||
|
@ -178,7 +181,7 @@ func makeTable(sim *memory.VerifySimulation, stationCode string) *StationDeviceI
|
|||
for _, data := range stationGi.LianSuoData.Sections {
|
||||
for _, station := range uids.PhysicalSectionIds[data.Id].CentralizedStations {
|
||||
if station.Code == stationCode {
|
||||
table.AxleSectionMap[data.Id] = &Row{
|
||||
table.AxleSectionMap[uint16(data.Id)] = &Row{
|
||||
commonId: data.Id,
|
||||
uid: uids.PhysicalSectionIds[data.Id].Uid,
|
||||
index: uint16(data.Index),
|
||||
|
@ -193,7 +196,7 @@ func makeTable(sim *memory.VerifySimulation, stationCode string) *StationDeviceI
|
|||
for _, data := range stationGi.LianSuoData.SpksSwitchs {
|
||||
for _, station := range uids.SpksIds[data.Id].CentralizedStations {
|
||||
if station.Code == stationCode {
|
||||
table.SpksMap[data.Id] = &Row{
|
||||
table.SpksMap[uint16(data.Id)] = &Row{
|
||||
commonId: data.Id,
|
||||
uid: uids.SpksIds[data.Id].Uid,
|
||||
index: uint16(data.Index),
|
||||
|
@ -308,7 +311,7 @@ func (s *serviceContext) collectDeviceState() *ToInterlockFrame {
|
|||
}
|
||||
frame.SignalStates = append(frame.SignalStates, &SignalState{
|
||||
Id: row.index,
|
||||
State: 0, //目前还不知道每种显示对应什么字节,先这样
|
||||
State: 1, //目前还不知道每种显示对应什么字节,先这样
|
||||
Current: current,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1409,7 +1409,7 @@ func fillProtoRepository(repo *proto.Repository, storage *data_proto.RtssGraphic
|
|||
for _, data := range storage.EsbButtons {
|
||||
repo.Esbs = append(repo.Esbs, &proto.Esb{
|
||||
Id: uidsMap.EsbIds[data.Common.Id].Uid,
|
||||
PlatformId: uidsMap.StationIds[data.RefStand].Uid,
|
||||
PlatformId: uidsMap.PlatformIds[data.RefStand].Uid,
|
||||
})
|
||||
}
|
||||
//SPKS
|
||||
|
|
Loading…
Reference in New Issue