哈尔滨问题:日志、信号机灯丝熔断故障

This commit is contained in:
joylink_zhangsai 2020-12-17 18:22:55 +08:00
parent 5d94ef018a
commit 0cd9867530
11 changed files with 246 additions and 57 deletions

View File

@ -16,6 +16,7 @@ import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
import club.joylink.rtss.simulation.cbtc.script.ScriptBO; import club.joylink.rtss.simulation.cbtc.script.ScriptBO;
import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO; import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.fault.FaultRuleVO; import club.joylink.rtss.vo.client.fault.FaultRuleVO;
import club.joylink.rtss.vo.client.map.MapVO; import club.joylink.rtss.vo.client.map.MapVO;
import club.joylink.rtss.vo.client.map.newmap.MapDestinationCodeDefinitionVO; import club.joylink.rtss.vo.client.map.newmap.MapDestinationCodeDefinitionVO;
@ -23,6 +24,7 @@ import club.joylink.rtss.vo.client.map.newmap.MapStationNewVO;
import club.joylink.rtss.vo.client.runplan.PlanTripNumberVO; import club.joylink.rtss.vo.client.runplan.PlanTripNumberVO;
import club.joylink.rtss.vo.client.runplan.RunPlanEChartsDataVO; import club.joylink.rtss.vo.client.runplan.RunPlanEChartsDataVO;
import club.joylink.rtss.vo.client.simulationv1.RunAsPlanParam; import club.joylink.rtss.vo.client.simulationv1.RunAsPlanParam;
import club.joylink.rtss.vo.client.simulationv1.SimulationLogPagedQueryVO;
import club.joylink.rtss.vo.client.simulationv1.SimulationMemberVO; import club.joylink.rtss.vo.client.simulationv1.SimulationMemberVO;
import club.joylink.rtss.vo.client.simulationv1.SimulationUserVO; import club.joylink.rtss.vo.client.simulationv1.SimulationUserVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -295,7 +297,7 @@ public class SimulationV1Controller {
@ApiOperation("获取仿真日志") @ApiOperation("获取仿真日志")
@GetMapping("/{group}/log") @GetMapping("/{group}/log")
public List<SimulationLog> getLog(@PathVariable String group) { public PageVO<SimulationLog> getLog(@PathVariable String group, SimulationLogPagedQueryVO queryVO) {
return groupSimulationService.getLog(group); return groupSimulationService.getLog(group, queryVO);
} }
} }

View File

@ -1,6 +1,6 @@
package club.joylink.rtss.simulation.cbtc.ATS.data; package club.joylink.rtss.simulation.cbtc.ATS.data;
import club.joylink.rtss.simulation.cbtc.member.SimulationMember; import club.joylink.rtss.vo.client.simulationv1.SimulationMemberVO;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@ -17,7 +17,7 @@ import java.util.Map;
public class SimulationLog { public class SimulationLog {
private Integer id; private Integer id;
private SimulationMember member; private SimulationMemberVO member;
private LocalDateTime time; private LocalDateTime time;

View File

@ -12,6 +12,7 @@ import club.joylink.rtss.simulation.cbtc.member.SimulationUser;
import club.joylink.rtss.simulation.cbtc.script.ScriptBO; import club.joylink.rtss.simulation.cbtc.script.ScriptBO;
import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO; import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.fault.FaultRuleVO; import club.joylink.rtss.vo.client.fault.FaultRuleVO;
import club.joylink.rtss.vo.client.map.MapVO; import club.joylink.rtss.vo.client.map.MapVO;
import club.joylink.rtss.vo.client.map.newmap.MapDestinationCodeDefinitionVO; import club.joylink.rtss.vo.client.map.newmap.MapDestinationCodeDefinitionVO;
@ -271,7 +272,7 @@ public interface GroupSimulationService {
* 获取仿真日志 * 获取仿真日志
* @return * @return
*/ */
List<SimulationLog> getLog(String group); PageVO<SimulationLog> getLog(String group, SimulationLogPagedQueryVO queryVO);
void changePassengerFlow(String group, Long passengerFlowId); void changePassengerFlow(String group, Long passengerFlowId);
} }

View File

@ -392,7 +392,7 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
public void triggeringAutoFault(Simulation simulation, FaultRuleVO faultRule) { public void triggeringAutoFault(Simulation simulation, FaultRuleVO faultRule) {
faultRule.setTriggeringTime(simulation.getCorrectSystemTime()); faultRule.setTriggeringTime(simulation.getCorrectSystemTime());
this.stompMessageService.sendToUser(String.valueOf(simulation.getCreator().getId()), this.stompMessageService.sendToUser(String.valueOf(simulation.getCreator().getId()),
SocketMessageFactory.build(WebSocketMessageType.Simulation_AutoFault_Trigger, simulation.getGroup(), faultRule.getId()+"::"+faultRule.getTriggeringTime())); SocketMessageFactory.build(WebSocketMessageType.Simulation_AutoFault_Trigger, simulation.getGroup(), faultRule.getId() + "::" + faultRule.getTriggeringTime()));
} }
@Override @Override
@ -888,7 +888,47 @@ public class GroupSimulationServiceImpl implements GroupSimulationService {
} }
@Override @Override
public List<SimulationLog> getLog(String group) { public PageVO<SimulationLog> getLog(String group, SimulationLogPagedQueryVO queryVO) {
return getSimulationByGroup(group).getLogs(); List<SimulationLog> logs = getSimulationByGroup(group).getLogs();
//根据时间筛选
if (!CollectionUtils.isEmpty(logs)) {
if (queryVO.getStartTime() != null || queryVO.getEndTime() != null) {
logs = logs.stream().filter(log->{
boolean flag = true;
if (queryVO.getStartTime() != null) {
flag = flag && !log.getTime().isBefore(queryVO.getStartTime());
}
if (queryVO.getEndTime() != null) {
flag = flag && !log.getTime().isAfter(queryVO.getEndTime());
}
return flag;
}).collect(Collectors.toList());
}
}
PageVO<SimulationLog> pageVO = new PageVO<>();
pageVO.setPageSize(queryVO.getPageSize());
if (CollectionUtils.isEmpty(logs)) {
pageVO.setPageNum(1);
pageVO.setList(new ArrayList<>());
pageVO.setTotal(0);
} else {
//根据分页信息筛选
int maxPageNum = logs.size() / queryVO.getPageSize() + 1;
int pageNum = Math.min(maxPageNum, queryVO.getPageNum());
int start = (pageNum - 1) * queryVO.getPageSize();
int end = pageNum * queryVO.getPageSize();
start = Math.min(start, logs.size() - 1);
end = Math.min(end, logs.size());
if (start >= logs.size()) {
start = logs.size() - 1;
}
pageVO.setPageNum(pageNum);
pageVO.setTotal(logs.size());
pageVO.setList(logs.subList(start, end));
}
return pageVO;
} }
} }

View File

@ -1,14 +1,14 @@
package club.joylink.rtss.simulation.cbtc; package club.joylink.rtss.simulation.cbtc;
import club.joylink.rtss.simulation.cbtc.ATS.data.SimulationLog; import club.joylink.rtss.simulation.cbtc.ATS.data.SimulationLog;
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
import club.joylink.rtss.simulation.cbtc.event.SimulationOperationEvent; import club.joylink.rtss.simulation.cbtc.event.SimulationOperationEvent;
import club.joylink.rtss.simulation.cbtc.event.SimulationUserPlayChangeEvent; import club.joylink.rtss.simulation.cbtc.event.SimulationUserPlayChangeEvent;
import club.joylink.rtss.vo.client.simulationv1.SimulationMemberVO;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
/** /**
* 仿真日志监听器 * 仿真日志监听器
*/ */
@ -21,13 +21,15 @@ public class SimulationLogListener {
Simulation simulation = event.getSimulation(); Simulation simulation = event.getSimulation();
SimulationLog log = new SimulationLog(); SimulationLog log = new SimulationLog();
log.setId(simulation.getIdGenerator().generateLogId()); log.setId(simulation.getIdGenerator().generateLogId());
log.setTime(LocalDateTime.now()); log.setTime(simulation.getCorrectSystemTime());
if (event.getCancelPlayMember() == null) { //登录 if (event.getCancelPlayMember() == null) { //登录
log.setMember(event.getSimulationUser().getPlayedMember()); log.setMember(new SimulationMemberVO(event.getSimulationUser().getPlayedMember()));
log.setEvent(log.new Event(SimulationLog.EventType.LOGIN)); log.setEvent(log.new Event(SimulationLog.EventType.LOGIN));
} else { //登出 } else { //登出
log.setMember(event.getCancelPlayMember()); SimulationMemberVO memberVO = new SimulationMemberVO(event.getCancelPlayMember());
memberVO.setUserId(event.getSimulationUser().getUser().getId());
log.setMember(memberVO);
log.setEvent(log.new Event(SimulationLog.EventType.LOGOUT)); log.setEvent(log.new Event(SimulationLog.EventType.LOGOUT));
} }
simulation.addLog(log); simulation.addLog(log);
@ -38,12 +40,16 @@ public class SimulationLogListener {
public void handle(SimulationOperationEvent event) { public void handle(SimulationOperationEvent event) {
if (event.getSuccessful() == null || !event.getSuccessful()) if (event.getSuccessful() == null || !event.getSuccessful())
return; return;
String operate = event.getOperate();
if (Operation.Type.Set_Fault.name().equals(operate) || Operation.Type.Cancel_Fault.name().equals(operate))
return;
Simulation simulation = event.getSimulation(); Simulation simulation = event.getSimulation();
SimulationLog log = new SimulationLog(); SimulationLog log = new SimulationLog();
SimulationLog.Event logEvent = log.new Event(SimulationLog.EventType.OPERATE, event.getOperate(), event.getParams()); SimulationLog.Event logEvent = log.new Event(SimulationLog.EventType.OPERATE, operate, event.getParams());
log.setId(simulation.getIdGenerator().generateLogId()); log.setId(simulation.getIdGenerator().generateLogId());
log.setMember(event.getMember()); log.setMember(new SimulationMemberVO(event.getMember()));
log.setTime(event.getSimulationTime()); log.setTime(simulation.getCorrectSystemTime());
log.setEvent(logEvent); log.setEvent(logEvent);
simulation.addLog(log); simulation.addLog(log);
} }

View File

@ -30,81 +30,131 @@ public class Signal extends MayOutOfOrderDevice {
private String showName; private String showName;
/** 设备集中站 */ /**
* 设备集中站
*/
private Station deviceStation; private Station deviceStation;
/** 联锁站 */ /**
* 联锁站
*/
private Station interlockStation; private Station interlockStation;
/** 在哪个区段上 */ /**
* 在哪个区段上
*/
private Section section; private Section section;
/** 在区段上的偏移量 */ /**
* 在区段上的偏移量
*/
private Float offset; private Float offset;
/** 是否虚拟信号机 */ /**
* 是否虚拟信号机
*/
private boolean virtual; private boolean virtual;
/** 是否无延续保护 */ /**
* 是否无延续保护
*/
private boolean noOverlap; private boolean noOverlap;
/** 信号机类型 */ /**
* 信号机类型
*/
private SignalType type; private SignalType type;
/** 是否进路终端 */ /**
* 是否进路终端
*/
private boolean routeEnd; private boolean routeEnd;
/** 不生成基本进路的信号机终端 */ /**
* 不生成基本进路的信号机终端
*/
private List<String> ignoreRouteEnd; private List<String> ignoreRouteEnd;
/** 是否引导信号机 */ /**
* 是否引导信号机
*/
private boolean callOn; private boolean callOn;
/** 是否折返信号 */ /**
* 是否折返信号
*/
private boolean turnBack; private boolean turnBack;
/** 方向:true-向右false-向左 */ /**
* 方向:true-向右false-向左
*/
private boolean right; private boolean right;
/** 是否可以灭灯显示CTC级 */ /**
* 是否可以灭灯显示CTC级
*/
private boolean ctc; private boolean ctc;
/** 虚拟真实室外信号机 */ /**
* 虚拟真实室外信号机
*/
private VirtualRealitySignal virtualSignal; private VirtualRealitySignal virtualSignal;
/** 接近区段路径 */ /**
* 接近区段路径
*/
private List<SectionPath> approachPathList; private List<SectionPath> approachPathList;
/** 进路列表 */ /**
* 进路列表
*/
private List<Route> routeList; private List<Route> routeList;
/** 接近锁闭解锁时间 */ /**
* 接近锁闭解锁时间
*/
private int routeReleaseTime; private int routeReleaseTime;
/** 自动信号 */ /**
* 自动信号
*/
private AutoSignal autoSignal; private AutoSignal autoSignal;
// ------------------状态属性--------------------- // ------------------状态属性---------------------
/** 当前锁闭的进路 */ /**
* 当前锁闭的进路
*/
private Route lockedRoute; private Route lockedRoute;
/** 是否封锁 */ /**
* 是否封锁
*/
private boolean blockade; private boolean blockade;
/** 逻辑点灯/物理点灯 */ /**
* 逻辑点灯/物理点灯
*/
private boolean logicLight; private boolean logicLight;
/** 绿灯开放 */ /**
* 绿灯开放
*/
private boolean greenOpen; private boolean greenOpen;
/** 黄灯开放 */ /**
* 黄灯开放
*/
private boolean yellowOpen; private boolean yellowOpen;
/** 红灯开放 */ /**
* 红灯开放
*/
private boolean redOpen; private boolean redOpen;
/** 信号机延时解锁倒计时单位ms */ /**
* 信号机延时解锁倒计时单位ms
*/
private int delayTime; private int delayTime;
/** /**
@ -112,7 +162,9 @@ public class Signal extends MayOutOfOrderDevice {
*/ */
private int guideRemain; private int guideRemain;
/** 列车接近信息:0-无接近列车1-接近为通信车2-接近为非通信车 */ /**
* 列车接近信息:0-无接近列车1-接近为通信车2-接近为非通信车
*/
private SignalApproachMessage.ApproachMessage approachMsg; private SignalApproachMessage.ApproachMessage approachMsg;
@Override @Override
@ -135,6 +187,10 @@ public class Signal extends MayOutOfOrderDevice {
} }
public void changeLightType(boolean logic) { public void changeLightType(boolean logic) {
if (SignalFault.MAIN_FILAMENT_BROKEN.equals(getFault()) && logic) {
return;
}
if (this.isCtc()) { if (this.isCtc()) {
this.logicLight = logic; this.logicLight = logic;
} else { } else {
@ -144,6 +200,7 @@ public class Signal extends MayOutOfOrderDevice {
/** /**
* 信号是否关闭 * 信号是否关闭
*
* @return * @return
*/ */
public boolean isClose() { public boolean isClose() {
@ -221,6 +278,7 @@ public class Signal extends MayOutOfOrderDevice {
/** /**
* 是否阻挡信号机 * 是否阻挡信号机
*
* @return * @return
*/ */
public boolean isBlockingSignal() { public boolean isBlockingSignal() {
@ -229,6 +287,7 @@ public class Signal extends MayOutOfOrderDevice {
/** /**
* 是否通过信号机 * 是否通过信号机
*
* @return * @return
*/ */
public boolean isPassingSignal() { public boolean isPassingSignal() {
@ -237,6 +296,7 @@ public class Signal extends MayOutOfOrderDevice {
/** /**
* 是否防护信号机 * 是否防护信号机
*
* @return * @return
*/ */
public boolean isProtectionSignal() { public boolean isProtectionSignal() {
@ -245,6 +305,7 @@ public class Signal extends MayOutOfOrderDevice {
/** /**
* 是否与轨道常规运行方向相反 * 是否与轨道常规运行方向相反
*
* @return * @return
*/ */
public boolean isOppositeToSection() { public boolean isOppositeToSection() {
@ -254,6 +315,7 @@ public class Signal extends MayOutOfOrderDevice {
/** /**
* 是否与轨道常规运行方向相同 * 是否与轨道常规运行方向相同
*
* @return * @return
*/ */
public boolean isSameDirectionToSection() { public boolean isSameDirectionToSection() {
@ -302,17 +364,25 @@ public class Signal extends MayOutOfOrderDevice {
* 信号机类型 * 信号机类型
*/ */
public enum SignalType { public enum SignalType {
/** 防护信号机 */ /**
* 防护信号机
*/
PROTECTION, PROTECTION,
/** 阻挡信号机 */ /**
* 阻挡信号机
*/
BLOCKING, BLOCKING,
/** 通过信号机 */ /**
* 通过信号机
*/
PASSING PASSING
} }
public enum SignalFault implements DeviceFault { public enum SignalFault implements DeviceFault {
/** 主灯丝断丝故障 */ /**
MAIN_FILAMENT_BROKEN{ * 主灯丝熔断故障
*/
MAIN_FILAMENT_BROKEN {
@Override @Override
public boolean apply(MayOutOfOrderDevice device) { public boolean apply(MayOutOfOrderDevice device) {
if (Objects.equals(device.getFault(), this)) { if (Objects.equals(device.getFault(), this)) {
@ -320,10 +390,16 @@ public class Signal extends MayOutOfOrderDevice {
} }
device.setFault(this); device.setFault(this);
Signal signal = (Signal) device; Signal signal = (Signal) device;
if (!signal.isLogicLight()) { //如果是物理点灯 signal.changeLightType(false); //改为物理点灯
VirtualRealitySignal realSignal = signal.getVirtualSignal(); signal.apply(false, false, true);
realSignal.apply(false, false, true); VirtualRealitySignal realSignal = signal.getVirtualSignal();
if (realSignal != null) {
VirtualRealitySignal.Fault.MAIN_FILAMENT_BROKEN.apply(realSignal);
} }
// if (!signal.isLogicLight()) { //如果是物理点灯
// VirtualRealitySignal realSignal = signal.getVirtualSignal();
// realSignal.apply(false, false, true);
// }
return true; return true;
} }
}; };
@ -331,8 +407,12 @@ public class Signal extends MayOutOfOrderDevice {
@Override @Override
public void fix(MayOutOfOrderDevice device) { public void fix(MayOutOfOrderDevice device) {
Signal signal = (Signal) device; Signal signal = (Signal) device;
if (signal.getFault().equals(this)) { if (this.equals(signal.getFault())) {
System.out.println(); signal.setFault(null);
VirtualRealitySignal vrSignal = signal.getVirtualSignal();
if (vrSignal != null && vrSignal.getFault() != null) {
vrSignal.getFault().fix(vrSignal);
}
} }
} }
} }

View File

@ -1,12 +1,12 @@
package club.joylink.rtss.simulation.cbtc.data.storage.vr; package club.joylink.rtss.simulation.cbtc.data.storage.vr;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityDevice; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityDevice;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySignal; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySignal;
import club.joylink.rtss.util.jsonSerialize.Boolean2NumDeserializer; import club.joylink.rtss.util.jsonSerialize.Boolean2NumDeserializer;
import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer; import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@ -28,6 +28,8 @@ public class StorageVirtualRealitySignal extends StorageVirtualRealityDeviceStat
@JsonDeserialize(using = Boolean2NumDeserializer.class) @JsonDeserialize(using = Boolean2NumDeserializer.class)
private Boolean redOpen; private Boolean redOpen;
private VirtualRealitySignal.Fault fault;
public StorageVirtualRealitySignal(VirtualRealitySignal signal) { public StorageVirtualRealitySignal(VirtualRealitySignal signal) {
super(signal); super(signal);
} }
@ -47,6 +49,10 @@ public class StorageVirtualRealitySignal extends StorageVirtualRealityDeviceStat
change = true; change = true;
storageSignal.setRedOpen(signal.isRedOpen()); storageSignal.setRedOpen(signal.isRedOpen());
} }
if (signal.getFault() != null) {
change = true;
storageSignal.setFault(signal.getFault());
}
if (change) { if (change) {
return storageSignal; return storageSignal;
@ -60,5 +66,6 @@ public class StorageVirtualRealitySignal extends StorageVirtualRealityDeviceStat
signal.setGreenOpen(greenOpen != null ? greenOpen : false); signal.setGreenOpen(greenOpen != null ? greenOpen : false);
signal.setYellowOpen(yellowOpen != null ? yellowOpen : false); signal.setYellowOpen(yellowOpen != null ? yellowOpen : false);
signal.setRedOpen(redOpen != null ? redOpen : false); signal.setRedOpen(redOpen != null ? redOpen : false);
signal.setFault(fault);
} }
} }

View File

@ -185,6 +185,7 @@ public class VirtualRealityScreenDoor extends VirtualRealityDevice {
public enum Fault { public enum Fault {
CANNOT_BE_CLOSED { CANNOT_BE_CLOSED {
@Override
public void apply(VirtualRealityScreenDoor door) { public void apply(VirtualRealityScreenDoor door) {
door.setFault(this); door.setFault(this);
door.updateOpen2End(true); door.updateOpen2End(true);

View File

@ -13,15 +13,23 @@ import java.util.Objects;
@Setter @Setter
public class VirtualRealitySignal extends VirtualRealityDevice { public class VirtualRealitySignal extends VirtualRealityDevice {
/** 绿灯亮 */ /**
* 绿灯亮
*/
private boolean greenOpen; private boolean greenOpen;
/** 黄灯亮 */ /**
* 黄灯亮
*/
private boolean yellowOpen; private boolean yellowOpen;
/** 红灯亮 */ /**
* 红灯亮
*/
private boolean redOpen; private boolean redOpen;
private Fault fault;
public VirtualRealitySignal(String code, String name) { public VirtualRealitySignal(String code, String name) {
super(code, name, MapElement.DeviceType.SIGNAL); super(code, name, MapElement.DeviceType.SIGNAL);
} }
@ -31,9 +39,12 @@ public class VirtualRealitySignal extends VirtualRealityDevice {
this.greenOpen = false; this.greenOpen = false;
this.yellowOpen = false; this.yellowOpen = false;
this.redOpen = false; this.redOpen = false;
this.fault = null;
} }
public void apply(boolean greenOpen, boolean yellowOpen, boolean redOpen) { public void apply(boolean greenOpen, boolean yellowOpen, boolean redOpen) {
if (Fault.MAIN_FILAMENT_BROKEN.equals(fault))
return;
this.greenOpen = greenOpen; this.greenOpen = greenOpen;
this.yellowOpen = yellowOpen; this.yellowOpen = yellowOpen;
this.redOpen = redOpen; this.redOpen = redOpen;
@ -47,6 +58,7 @@ public class VirtualRealitySignal extends VirtualRealityDevice {
/** /**
* 是否黑灯显示 * 是否黑灯显示
*
* @return * @return
*/ */
public boolean isBlack() { public boolean isBlack() {
@ -59,4 +71,20 @@ public class VirtualRealitySignal extends VirtualRealityDevice {
return String.format("%s-%s:{red:%s, green:%s, yellow:%s}", this.getName(), this.getCode(), return String.format("%s-%s:{red:%s, green:%s, yellow:%s}", this.getName(), this.getCode(),
this.redOpen, this.greenOpen, this.yellowOpen); this.redOpen, this.greenOpen, this.yellowOpen);
} }
public enum Fault {
MAIN_FILAMENT_BROKEN {
@Override
public void apply(VirtualRealitySignal vrSignal) {
vrSignal.apply(false, false, true);
}
};
public abstract void apply(VirtualRealitySignal vrSignal);
public void fix(VirtualRealitySignal vrSignal) {
if (this.equals(vrSignal.getFault()))
vrSignal.setFault(null);
}
}
} }

View File

@ -108,6 +108,7 @@ public class ATPLogicLoop {
} }
} }
private void onboardLogicRun2(Simulation simulation, VirtualRealityTrain train) { private void onboardLogicRun2(Simulation simulation, VirtualRealityTrain train) {
this.maCheckAndChangeRunLevel(simulation, train); this.maCheckAndChangeRunLevel(simulation, train);

View File

@ -0,0 +1,23 @@
package club.joylink.rtss.vo.client.simulationv1;
import club.joylink.rtss.vo.client.PageQueryVO;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* 仿真日志分页查询对象
*/
@Getter
@Setter
@NoArgsConstructor
public class SimulationLogPagedQueryVO extends PageQueryVO {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
}