| | |
| | | * PLC 报警定义(对应 §2.3) |
| | | */ |
| | | public enum PlcAlarmDefinition { |
| | | EMERGENCY_STOP("DB25", 1, "急停"), |
| | | LOWER_BREAKER_TRIP("DB25", 2, "低位断路器断开"), |
| | | LOWER_INVERTER_FAULT("DB25", 3, "低位变频器故障"), |
| | | CONVEYOR_TIMEOUT("DB25", 4, "输送运行超时"), |
| | | LIFT_TIMEOUT("DB25", 5, "顶升运行超时"), |
| | | TASK_REQUEST_TIMEOUT("DB25", 6, "申请任务超时"), |
| | | PALLET_PROTRUSION("DB25", 7, "托盘突出报警"), |
| | | TASK_DUPLICATE("DB25", 8, "任务重复报警"), |
| | | PRECONDITION_ERROR("DB25", 9, "入站过程中前置条件异常"); |
| | | ALL("DB25", 0, 4, "所有报警"), |
| | | EMERGENCY_STOP("DB25", 1, 4, "急停"), |
| | | LOWER_BREAKER_TRIP("DB25", 2, 4, "低位断路器断开"), |
| | | LOWER_INVERTER_FAULT("DB25", 3, 4, "低位变频器故障"), |
| | | CONVEYOR_TIMEOUT("DB25", 4, 4, "输送运行超时"), |
| | | LIFT_TIMEOUT("DB25", 5, 4, "顶升运行超时"), |
| | | TASK_REQUEST_TIMEOUT("DB25", 6, 4, "申请任务超时"), |
| | | PALLET_PROTRUSION("DB25", 7, 4, "托盘突出报警"), |
| | | TASK_DUPLICATE("DB25", 8, 4, "任务重复报警"), |
| | | PRECONDITION_ERROR("DB25", 9, 4, "入站过程中前置条件异常"); |
| | | |
| | | private final String addressPattern; |
| | | private final int index; // 报警序号(1-based) |
| | | private final int byteLength; |
| | | private final String description; |
| | | |
| | | PlcAlarmDefinition(String addressPattern, int index, String description) { |
| | | PlcAlarmDefinition(String addressPattern, int index, int byteLength, String description) { |
| | | this.addressPattern = addressPattern; |
| | | this.index = index; |
| | | this.byteLength = byteLength; |
| | | this.description = description; |
| | | } |
| | | |
| | | |
| | | public String buildAddress() { |
| | | return addressPattern + PlcConstant.ADDRESS_CONCATENATION + index; |
| | | } |
| | | |
| | | public String getAddressPattern() { |
| | | return addressPattern; |
| | | } |
| | | |
| | | public int getIndex() { |
| | | return index; |
| | | } |
| | | |
| | | public int getByteLength() { |
| | | return byteLength; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | } |