补全DeviceFault的注解

This commit is contained in:
thesai 2021-11-25 17:19:40 +08:00
parent f7cb5fca15
commit 53726f14fc
2 changed files with 28 additions and 17 deletions

View File

@ -33,10 +33,21 @@ public abstract class MayOutOfOrderDevice extends StatusDevice {
@JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$2"),
@JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$3"),
@JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$4"),
@JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$5"),
@JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$6"),
@JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$7"),
@JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$8"),
@JsonSubTypes.Type(value = Section.AxleFault.class, name = "Section$AxleFault$1"),
@JsonSubTypes.Type(value = Section.AxleFault.class, name = "Section$AxleFault$2"),
@JsonSubTypes.Type(value = Section.AxleFault.class, name = "Section$AxleFault$3"),
@JsonSubTypes.Type(value = Section.AxleFault.class, name = "Section$AxleFault$4"),
@JsonSubTypes.Type(value = Stand.Fault.class, name = "Stand$Fault$1"),
@JsonSubTypes.Type(value = Stand.Fault.class, name = "Stand$Fault$2"),
@JsonSubTypes.Type(value = Stand.Fault.class, name = "Stand$Fault$3"),
@JsonSubTypes.Type(value = Signal.SignalFault.class, name = "Signal$SignalFault$1"),
@JsonSubTypes.Type(value = Signal.SignalFault.class, name = "Signal$SignalFault$2"),
@JsonSubTypes.Type(value = Signal.SignalFault.class, name = "Signal$SignalFault$3"),
@JsonSubTypes.Type(value = Signal.SignalFault.class, name = "Signal$SignalFault$4"),
@JsonSubTypes.Type(value = Catenary.CatenaryFault.class, name = "Catenary$CatenaryFault$1"),
@JsonSubTypes.Type(value = ZC.Fault.class, name = "ZC$Fault$1")
})

View File

@ -568,23 +568,6 @@ public class Switch extends DelayUnlockDevice {
}
},
/**
* 转动4次后恢复的失表故障
*/
SPLIT_4{
@Override
public boolean apply(MayOutOfOrderDevice device) {
Switch aSwitch = (Switch) device;
if (Objects.equals(aSwitch.getFault(), this)) {
return false;
}
aSwitch.setFault(this);
aSwitch.setPos(SwitchIndication.NO);
aSwitch.setTurnTimes(new AtomicInteger(0));
return true;
}
},
/**
* 定位失表
*/
@ -683,6 +666,23 @@ public class Switch extends DelayUnlockDevice {
}
},
/**
* 转动4次后恢复的失表故障
*/
SPLIT_4{
@Override
public boolean apply(MayOutOfOrderDevice device) {
Switch aSwitch = (Switch) device;
if (Objects.equals(aSwitch.getFault(), this)) {
return false;
}
aSwitch.setFault(this);
aSwitch.setPos(SwitchIndication.NO);
aSwitch.setTurnTimes(new AtomicInteger(0));
return true;
}
},
/**
* 道岔区段灰显
*/