| | |
| | | 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.RedisKeyType; |
| | | import com.zy.core.model.CommandResponse; |
| | | import com.zy.core.model.command.CrnCommand; |
| | |
| | | return response; |
| | | } |
| | | |
| | | Integer commandTaskNo = command.getTaskNo(); |
| | | if (command.getTaskMode().equals(CrnTaskModeType.RESET.id)) { |
| | | commandTaskNo = 0; |
| | | } |
| | | |
| | | short[] array = new short[9]; |
| | | array[0] = command.getAckFinish().shortValue(); |
| | | array[1] = command.getTaskNo().shortValue(); |
| | | array[1] = commandTaskNo.shortValue(); |
| | | array[2] = command.getTaskMode().shortValue(); |
| | | array[3] = command.getSourcePosX().shortValue(); |
| | | array[4] = command.getSourcePosY().shortValue(); |
| | |
| | | short destinationPosX = siemensNet.getByteTransform().TransInt16(resultRead.Content, 12); |
| | | short destinationPosY = siemensNet.getByteTransform().TransInt16(resultRead.Content, 14); |
| | | short destinationPosZ = siemensNet.getByteTransform().TransInt16(resultRead.Content, 16); |
| | | if (taskNo == 0 || taskMode == 0 || sourcePosX == 0 || sourcePosY == 0 || sourcePosZ == 0 || destinationPosX == 0 || destinationPosY == 0 || destinationPosZ == 0) { |
| | | if (taskNo != command.getTaskNo().shortValue() |
| | | || taskMode == command.getTaskMode().shortValue() |
| | | || sourcePosX == command.getSourcePosX().shortValue() |
| | | || sourcePosY == command.getSourcePosY().shortValue() |
| | | || sourcePosZ == command.getSourcePosZ().shortValue() |
| | | || destinationPosX == command.getDestinationPosX().shortValue() |
| | | || destinationPosY == command.getDestinationPosY().shortValue() |
| | | || destinationPosZ == command.getDestinationPosZ().shortValue()) { |
| | | result = siemensNet.Write("DB100.0", array); |
| | | } else { |
| | | commandDataResult = true; |