过/欠标调整
Some checks failed
local-test分支打包构建docker并发布运行 / Docker-Build (push) Has been cancelled

This commit is contained in:
tiger_zhou 2024-10-17 16:54:50 +08:00
parent 27322532e0
commit c2fc8f61dd
4 changed files with 43 additions and 24 deletions

View File

@ -22,7 +22,8 @@ type LineBaseInfo struct {
LinkList []*Link `json:"linkList"` LinkList []*Link `json:"linkList"`
SlopeList []*Slope `json:"slopeList"` SlopeList []*Slope `json:"slopeList"`
CurveList []*Curve `json:"curveList"` CurveList []*Curve `json:"curveList"`
StopPosition []*StopPosition `json:"stopPositionList"` //StopPosition []*StopPosition `json:"stopPositionList"`
StopPosition []*StopPosition `json:"stopList"`
} }
type StopPosition struct { type StopPosition struct {
Id int32 `json:"id"` Id int32 `json:"id"`

View File

@ -57,6 +57,7 @@ type StationUidStructure struct {
IbpIds map[uint32]*DeviceRelationship IbpIds map[uint32]*DeviceRelationship
CkmIds map[uint32]*DeviceRelationship CkmIds map[uint32]*DeviceRelationship
XcjIds map[uint32]*DeviceRelationship XcjIds map[uint32]*DeviceRelationship
StopPoint map[uint32]*DeviceRelationship
} }
type RelayUidStructure struct { type RelayUidStructure struct {
@ -270,6 +271,7 @@ func initStationUid(data *data_proto.RtssGraphicStorage) *StationUidStructure {
IbpIds: make(map[uint32]*DeviceRelationship, len(data.IbpBoxs)), IbpIds: make(map[uint32]*DeviceRelationship, len(data.IbpBoxs)),
CkmIds: make(map[uint32]*DeviceRelationship, len(data.GarageDoors)), CkmIds: make(map[uint32]*DeviceRelationship, len(data.GarageDoors)),
XcjIds: make(map[uint32]*DeviceRelationship, len(data.CarWashings)), XcjIds: make(map[uint32]*DeviceRelationship, len(data.CarWashings)),
StopPoint: make(map[uint32]*DeviceRelationship, len(data.StopPositions)),
} }
city, lineId, _ := getUIdPrefix(data.UniqueIdPrefix) 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 { for _, a := range data.AxleCountings {
eid := GetMapElementId(a.Common) eid := GetMapElementId(a.Common)

View File

@ -321,7 +321,7 @@ func UpdateTrainStateByDynamics(vs *VerifySimulation, trainId string, info *mess
//pointTO 指的是是否ab或是否到岔心 //pointTO 指的是是否ab或是否到岔心
_, pointTo := QueryDirectionAndABByDevice(vs.Repo, id, port, info.Up) _, 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 trainHeadActUp := true
if info.TrainActToMax || info.TrainActToMin { if info.TrainActToMax || info.TrainActToMin {
if info.TrainActToMin { if info.TrainActToMin {

View File

@ -1126,25 +1126,7 @@ func fillProtoRepository(repo *proto.Repository, storage *data_proto.RtssGraphic
} }
repo.CheckPoints = append(repo.CheckPoints, cp) 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 { for _, data := range storage.Section {
var turnoutUids []string var turnoutUids []string
@ -1174,6 +1156,27 @@ func fillProtoRepository(repo *proto.Repository, storage *data_proto.RtssGraphic
} }
repo.PhysicalSections = append(repo.PhysicalSections, physicalSection) 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 { for _, data := range storage.AxleCountingSections {
var axleCountingIds []string var axleCountingIds []string