Merge branch 'master' of https://git.code.tencent.com/xian-ncc-da/xian-ncc-da-server into master-zy
This commit is contained in:
commit
f4c54a0424
@ -1,6 +1,7 @@
|
||||
package club.joylink.xiannccda.ats.message.line3;
|
||||
|
||||
import club.joylink.xiannccda.ats.message.MessageResponse;
|
||||
import club.joylink.xiannccda.ats.message.rep.device.DeviceStatus;
|
||||
import club.joylink.xiannccda.ats.message.rep.device.DeviceType;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import lombok.Getter;
|
||||
@ -104,7 +105,12 @@ public class TrainIndicationUpdateResponse extends MessageResponse {
|
||||
* 预留(2)
|
||||
*/
|
||||
private byte[] reserve = new byte[2];
|
||||
|
||||
/**
|
||||
* 列车是否有 trainMode对应的状态
|
||||
*/
|
||||
public boolean havingState(final DeviceStatus.TRAIN_MODE trainMode){
|
||||
return trainMode.is(mode);
|
||||
}
|
||||
@Override
|
||||
public void decode2(ByteBuf buf) throws Exception {
|
||||
short devType;
|
||||
|
@ -469,6 +469,12 @@ public class DeviceStatus {
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
/**
|
||||
* mode中是否有该枚举定义的状态
|
||||
*/
|
||||
public boolean is(final int mode){
|
||||
return (mode & value) == value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user