增加<添加行值角色>功能;添加ATP进路<可以自动追踪>字段的判断、赋值

This commit is contained in:
joylink_zhangsai 2021-05-18 14:02:58 +08:00
parent 358d8ce130
commit 11d5f6168b
6 changed files with 17 additions and 6 deletions

View File

@ -451,6 +451,10 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
if (!CollectionUtils.isEmpty(atpRouteList)) {
for (Route route : atpRouteList) {
route.setAtp(true);
if ((signal.isRight() && signal.getSection().isRightLine())
|| (!signal.isRight() && signal.getSection().isLeftLine())) {
route.setArs(true);
}
routeList.add(route);
}
}

View File

@ -27,6 +27,7 @@ import club.joylink.rtss.simulation.cbtc.communication.vo.fault.DeviceFaultInfo;
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.map.DestinationCodeDefinition;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.MayOutOfOrderDevice;
import club.joylink.rtss.simulation.cbtc.data.plan.TripPlan;
import club.joylink.rtss.simulation.cbtc.data.storage.StorageSimulation;
@ -780,7 +781,10 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
@Override
public SimulationMemberVO addMember(String group, MemberAddParamVO param) {
Simulation simulation = this.getSimulationByGroup(group);
SimulationMember member = this.memberManager.addRole(simulation, param.getType(), param.getName());
MapElement mapElement = null;
if (StringUtils.hasText(param.getDeviceCode()))
mapElement = simulation.getRepository().getByCode(param.getDeviceCode());
SimulationMember member = this.memberManager.addRole(simulation, param.getType(), param.getName(), mapElement);
return new SimulationMemberVO(member);
}

View File

@ -12,7 +12,7 @@ public interface SimulationConstants {
int TL_LOOP_RATE = 300;
/** 虚拟真实列车运行逻辑频率单位ms */
int TRAIN_RUNNING_RATE = 1000/60;
int TRAIN_RUNNING_RATE = 1000/50;
/** 联锁CI循环逻辑频率单位ms */
int CI_LOOP_RATE = 500;

View File

@ -94,10 +94,7 @@ public class MemberManager {
}
public SimulationMember addRole(Simulation simulation, SimulationMember.Type type, String name) {
SimulationMember member = this.addRole(simulation, type, name, null);
SimulationMemberAddEvent memberAddEvent = new SimulationMemberAddEvent(this, simulation, member);
this.applicationContext.publishEvent(memberAddEvent);
return member;
return this.addRole(simulation, type, name, null);
}
public SimulationMember addRole(Simulation simulation,
@ -128,6 +125,8 @@ public class MemberManager {
SimulationMember member = new SimulationMember(simulation.getIdGenerator().nextMemberId(), type, device);
member.setName(name);
simulation.addSimulationMember(member);
SimulationMemberAddEvent memberAddEvent = new SimulationMemberAddEvent(this, simulation, member);
this.applicationContext.publishEvent(memberAddEvent);
return member;
}

View File

@ -8,10 +8,12 @@ public class SimulationMemberVO {
String id;
String userId;
int sex;
Object role;
public SimulationMemberVO(SimulationMember member) {
this.id = member.getId();
this.userId = member.getUserId();
this.sex = member.getSex();
this.role = member.getRole();
}
}

View File

@ -22,4 +22,6 @@ public class MemberAddParamVO {
@ApiModelProperty("要添加的成员的名字")
private String name;
private String deviceCode;
}