| | |
| | | */ |
| | | public enum TaskField { |
| | | TASK_NUMBER("DB13", 0, 4), |
| | | START_STATION("DB13", 4, 2), |
| | | START_STATION("DB13", 4, 2), |
| | | DEST_STATION("DB13", 6, 2), |
| | | DIRECTION("DB13", 8, 1), |
| | | DIRECTION("DB13", 8, 1), |
| | | ROUTE_NUMBER("DB13", 10, 2); |
| | | |
| | | private final String addressPattern; |
| | | private final int offset; |
| | | private final int byteLength; |
| | | |
| | | TaskField(String addressPattern, int offset, int byteLength) { |
| | | TaskField(String addressPattern, int offset, int byteLength) { |
| | | this.addressPattern = addressPattern; |
| | | this.offset = offset; |
| | | this.byteLength = byteLength; |
| | |
| | | |
| | | /** |
| | | * 根据 DB 块编号和站点偏移生成具体地址 |
| | | * @param dbBlock DB块编号 |
| | | * |
| | | * @param dbBlock DB块编号 |
| | | * @param stationBaseOffset 站点基址偏移(站点号*站点长度) |
| | | * @return PLC4X 地址字符串,如 "DB100.DBD0" |
| | | */ |