| | |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.News; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.enums.CrnTaskModeType; |
| | | import com.zy.core.enums.DualCrnTaskModeType; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.model.CommandResponse; |
| | | import com.zy.core.model.command.DualCrnCommand; |
| | |
| | | crnStatus.setXDuration((double) siemensNet.getByteTransform().TransSingle(result.Content, 62)); |
| | | crnStatus.setYDuration((double) siemensNet.getByteTransform().TransSingle(result.Content, 66)); |
| | | |
| | | if ((crnStatus.getStatus() == 0 || crnStatus.getStatus() == 20) && crnStatus.getTaskReceive() == 0) { |
| | | if (crnStatus.getTaskReceive() == 1) { |
| | | OperateResultExOne<byte[]> taskResult = siemensNet.Read("DB100.0", (short) 18); |
| | | if (taskResult.IsSuccess) { |
| | | short taskNo = siemensNet.getByteTransform().TransInt16(taskResult.Content, 0); |
| | |
| | | array[7] = (short) 0; |
| | | array[8] = (short) 0; |
| | | |
| | | boolean clear = false; |
| | | if (taskMode == DualCrnTaskModeType.CONFIRM.id && crnStatus.getStatus() == 0) { |
| | | |
| | | } |
| | | |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | Object lock = redisUtil.get(RedisKeyType.DUAL_CRN_SEND_COMMAND_LOCK.key + deviceConfig.getDeviceNo()); |
| | | if (lock == null) { |
| | |
| | | } |
| | | } |
| | | |
| | | if ((crnStatus.getStatusTwo() == 0 || crnStatus.getStatusTwo() == 20) && crnStatus.getTaskReceiveTwo() == 0) { |
| | | if (crnStatus.getTaskReceiveTwo() == 1) { |
| | | OperateResultExOne<byte[]> taskResult = siemensNet.Read("DB100.18", (short) 18); |
| | | if (taskResult.IsSuccess) { |
| | | short taskNo = siemensNet.getByteTransform().TransInt16(taskResult.Content, 0); |
| | |
| | | Object lock = redisUtil.get(RedisKeyType.DUAL_CRN_SEND_COMMAND_LOCK.key + deviceConfig.getDeviceNo()); |
| | | if (lock == null) { |
| | | OperateResult taskClearResult = siemensNet.Write("DB100.18", array); |
| | | redisUtil.set(RedisKeyType.CLEAR_DUAL_CRN_TASK_LIMIT.key + deviceConfig.getDeviceNo(), "lock", 3); |
| | | } |
| | | } |
| | | } |