仿真构建增加转辙机

This commit is contained in:
joylink_zhangsai 2023-09-28 17:45:08 +08:00
parent deda54551d
commit 5b10c74bea

View File

@ -320,12 +320,20 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
break
}
}
var switchMachineType proto.Turnout_SwitchMachineType
switch data.SwitchMachineType {
case graphicData.Turnout_ZDJ9_Single:
switchMachineType = proto.Turnout_ZDJ9_Single
case graphicData.Turnout_ZDJ9_Double:
switchMachineType = proto.Turnout_ZDJ9_Double
}
turnout := &proto.Turnout{
Id: data.Common.Id,
Km: km,
ADevicePort: convertDevicePort(data.PaRef),
BDevicePort: convertDevicePort(data.PbRef),
CDevicePort: convertDevicePort(data.PcRef),
Id: data.Common.Id,
Km: km,
ADevicePort: convertDevicePort(data.PaRef),
BDevicePort: convertDevicePort(data.PbRef),
CDevicePort: convertDevicePort(data.PcRef),
SwitchMachineType: switchMachineType,
}
repo.Turnouts = append(repo.Turnouts, converTurnoutUid(turnout, uidsMap))
}