信号机模型枚举

This commit is contained in:
xzb 2023-11-16 17:21:05 +08:00
parent 1a03f7ad56
commit cf43b850aa
1 changed files with 22 additions and 6 deletions

View File

@ -1435,20 +1435,36 @@ func findTurnoutIds(axleCountingMap map[string]*graphicData.AxleCounting, axleId
return turnoutIds
}
/*
enum Model{
HL = 0; //2XH-1 红绿
HLU_FU = 1; //2XH-1 红绿黄,封黄灯,无引导
HLU_DU_YY = 2; //3XH-1 红绿黄,不封灯,有单黄,带引导
HLU_YY = 3; //3XH-2或JDXH 红绿黄,不封灯,无单黄,带引导
HLU_FL_DU_YY = 4;//3XH-3 红绿黄,封绿灯,有单黄,带引导
HLU_DU = 5; //3XH-4 红绿黄,不封灯,有单黄,无引导
AB = 6; //DXCH 蓝白
HBU_DU = 7; //JCKXH 红白黄,不封灯,有单黄,无引导
}
*/
func convertToProtoSignalModel(gSmt graphicData.Signal_Model) proto.Signal_Model {
switch gSmt {
case graphicData.Signal_HLU:
return proto.Signal_HLU
case graphicData.Signal_HL:
return proto.Signal_HL
case graphicData.Signal_HLU_FU:
return proto.Signal_HLU_FU
case graphicData.Signal_HLU_FL:
return proto.Signal_HLU_FL
case graphicData.Signal_HLU_DU_YY:
return proto.Signal_HLU_DU_YY
case graphicData.Signal_HLU_YY:
return proto.Signal_HLU_YY
case graphicData.Signal_HLU_FL_DU_YY:
return proto.Signal_HLU_FL_DU_YY
case graphicData.Signal_HLU_DU:
return proto.Signal_HLU_DU
case graphicData.Signal_AB:
return proto.Signal_AB
case graphicData.Signal_HBU:
return proto.Signal_HBU
case graphicData.Signal_HBU_DU:
return proto.Signal_HBU_DU
default:
panic(fmt.Sprintf("graphicData.Signal_Model[%d]无法映射到proto.Signal_Model", gSmt))
}