This commit is contained in:
parent
27322532e0
commit
c2fc8f61dd
3
third_party/message/dynamics_http.go
vendored
3
third_party/message/dynamics_http.go
vendored
@ -22,7 +22,8 @@ type LineBaseInfo struct {
|
||||
LinkList []*Link `json:"linkList"`
|
||||
SlopeList []*Slope `json:"slopeList"`
|
||||
CurveList []*Curve `json:"curveList"`
|
||||
StopPosition []*StopPosition `json:"stopPositionList"`
|
||||
//StopPosition []*StopPosition `json:"stopPositionList"`
|
||||
StopPosition []*StopPosition `json:"stopList"`
|
||||
}
|
||||
type StopPosition struct {
|
||||
Id int32 `json:"id"`
|
||||
|
@ -57,6 +57,7 @@ type StationUidStructure struct {
|
||||
IbpIds map[uint32]*DeviceRelationship
|
||||
CkmIds map[uint32]*DeviceRelationship
|
||||
XcjIds map[uint32]*DeviceRelationship
|
||||
StopPoint map[uint32]*DeviceRelationship
|
||||
}
|
||||
|
||||
type RelayUidStructure struct {
|
||||
@ -270,6 +271,7 @@ func initStationUid(data *data_proto.RtssGraphicStorage) *StationUidStructure {
|
||||
IbpIds: make(map[uint32]*DeviceRelationship, len(data.IbpBoxs)),
|
||||
CkmIds: make(map[uint32]*DeviceRelationship, len(data.GarageDoors)),
|
||||
XcjIds: make(map[uint32]*DeviceRelationship, len(data.CarWashings)),
|
||||
StopPoint: make(map[uint32]*DeviceRelationship, len(data.StopPositions)),
|
||||
}
|
||||
city, lineId, _ := getUIdPrefix(data.UniqueIdPrefix)
|
||||
// 处理车站信息
|
||||
@ -291,6 +293,19 @@ func initStationUid(data *data_proto.RtssGraphicStorage) *StationUidStructure {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 初始停车点信息
|
||||
for _, a := range data.StopPositions {
|
||||
eid := GetMapElementId(a.Common)
|
||||
code := getMapELementCode(eid, a.Code)
|
||||
uid := strconv.Itoa(int(eid))
|
||||
gus.StopPoint[eid] = &DeviceRelationship{
|
||||
CommonId: eid,
|
||||
Code: code,
|
||||
//Uid: BuildUid(city, lineId, strconv.Itoa(int(eid))),
|
||||
Uid: uid,
|
||||
//CentralizedStations: gus.StationIds[platform.RefStationId].GetCentralizedStations(),
|
||||
}
|
||||
}
|
||||
// 初始化计轴信息
|
||||
for _, a := range data.AxleCountings {
|
||||
eid := GetMapElementId(a.Common)
|
||||
|
@ -321,7 +321,7 @@ func UpdateTrainStateByDynamics(vs *VerifySimulation, trainId string, info *mess
|
||||
//pointTO 指的是是否ab,或是否到岔心
|
||||
_, pointTo := QueryDirectionAndABByDevice(vs.Repo, id, port, info.Up)
|
||||
|
||||
slog.Info("处理动力学转换后的消息", "number", info.Number, "up", info.Up, "Link", info.Link, "link位置", info.LinkOffset, "outlink位置", outLinkOffset, "车头位置", id, "偏移", offset, "是否上行", true, "是否ab", pointTo, "t1Dir:", info.TrainActToMax, "t2Dir:", info.TrainActToMin)
|
||||
//slog.Info("处理动力学转换后的消息", "number", info.Number, "up", info.Up, "Link", info.Link, "link位置", info.LinkOffset, "outlink位置", outLinkOffset, "车头位置", id, "偏移", offset, "是否上行", true, "是否ab", pointTo, "t1Dir:", info.TrainActToMax, "t2Dir:", info.TrainActToMin, "acc", info.Acceleration)
|
||||
trainHeadActUp := true
|
||||
if info.TrainActToMax || info.TrainActToMin {
|
||||
if info.TrainActToMin {
|
||||
|
@ -1126,25 +1126,7 @@ func fillProtoRepository(repo *proto.Repository, storage *data_proto.RtssGraphic
|
||||
}
|
||||
repo.CheckPoints = append(repo.CheckPoints, cp)
|
||||
}
|
||||
//列车停车点
|
||||
for _, sp := range storage.StopPositions {
|
||||
id := GetMapElementId(sp.Common)
|
||||
psp := &proto.StopPosition{Id: id, Km: convertKm(sp.KilometerSystem)}
|
||||
var coachNum uint32 = 4
|
||||
if sp.CoachNum == data_proto.StopPosition_Six {
|
||||
coachNum = 6
|
||||
} else if sp.CoachNum == data_proto.StopPosition_Four {
|
||||
coachNum = 4
|
||||
} else if sp.CoachNum == data_proto.StopPosition_Eight {
|
||||
coachNum = 8
|
||||
}
|
||||
psp.CoachNum = coachNum
|
||||
switch sp.GetRefDev().DeviceType {
|
||||
case data_proto.RelatedRef_Section:
|
||||
psp.SectionId = uidsMap.PhysicalSectionIds[sp.GetRefDev().Id].Uid
|
||||
}
|
||||
repo.StopPosition = append(repo.StopPosition, psp)
|
||||
}
|
||||
|
||||
//物理区段
|
||||
for _, data := range storage.Section {
|
||||
var turnoutUids []string
|
||||
@ -1174,6 +1156,27 @@ func fillProtoRepository(repo *proto.Repository, storage *data_proto.RtssGraphic
|
||||
}
|
||||
repo.PhysicalSections = append(repo.PhysicalSections, physicalSection)
|
||||
}
|
||||
//列车停车点
|
||||
for _, sp := range storage.StopPositions {
|
||||
//id := GetMapElementId(sp.Common)
|
||||
psp := &proto.StopPosition{
|
||||
Id: uidsMap.StopPoint[GetMapElementId(sp.Common)].Uid,
|
||||
Km: convertKm(sp.KilometerSystem)}
|
||||
var coachNum uint32 = 4
|
||||
if sp.CoachNum == data_proto.StopPosition_Six {
|
||||
coachNum = 6
|
||||
} else if sp.CoachNum == data_proto.StopPosition_Four {
|
||||
coachNum = 4
|
||||
} else if sp.CoachNum == data_proto.StopPosition_Eight {
|
||||
coachNum = 8
|
||||
}
|
||||
psp.CoachNum = coachNum
|
||||
switch sp.RefDev.DeviceType {
|
||||
case data_proto.RelatedRef_Section:
|
||||
psp.SectionId = uidsMap.PhysicalSectionIds[sp.RefDev.Id].Uid
|
||||
}
|
||||
repo.StopPosition = append(repo.StopPosition, psp)
|
||||
}
|
||||
//计轴区段
|
||||
for _, data := range storage.AxleCountingSections {
|
||||
var axleCountingIds []string
|
||||
|
Loading…
Reference in New Issue
Block a user