| | |
| | | @Data |
| | | public class LocTypeDto { |
| | | |
| | | // 高低类型{0:未知,1:低库位,2:高库位} |
| | | // 高低类型{0:未知,1:较低库位,2:低库位,3:高库位,4: 特高库位} |
| | | private Short locType1; |
| | | |
| | | // 宽窄类型{0:未知,1:窄库位,2:宽库位} |
| | |
| | | public LocTypeDto() { |
| | | } |
| | | |
| | | public LocTypeDto(Short locType1, Short locType2, Short locType3) { |
| | | this.locType1 = locType1; |
| | | this.locType2 = locType2; |
| | | this.locType3 = locType3; |
| | | } |
| | | |
| | | public LocTypeDto(StaProtocol staProtocol) { |
| | | // if (staProtocol.isHigh() == staProtocol.isLow()) { |
| | | // throw new CoolException("plc高低检测异常"); |
| | | // } |
| | | // if (staProtocol.isLow()) { |
| | | // this.locType1 = 1; // 低库位 |
| | | // } else { |
| | | // this.locType1 = 2; // 高库位 |
| | | // } |
| | | int trueLen = 0; |
| | | if (staProtocol.isHigh()) { |
| | | trueLen++; |
| | | } |
| | | if (staProtocol.isHigh1()) { |
| | | trueLen++; |
| | | } |
| | | if (staProtocol.isLow()) { |
| | | trueLen++; |
| | | } |
| | | if (staProtocol.isLow1()) { |
| | | trueLen++; |
| | | } |
| | | if (trueLen != 1) { |
| | | throw new CoolException("plc高低检测异常"); |
| | | } |
| | | |
| | | if (staProtocol.isLow()) { |
| | | this.locType1 = 1; // 较低库位 |
| | | } else if (staProtocol.isLow1()){ |
| | | this.locType1 = 2; // 低库位 |
| | | } else if (staProtocol.isHigh()){ |
| | | this.locType1 = 3; // 高库位 |
| | | } else if (staProtocol.isHigh1()){ |
| | | this.locType1 = 4; // 特高库位 |
| | | } |
| | | } |
| | | |
| | | /** |