| | |
| | | private CrnSlave slave; |
| | | private CrnProtocol crnProtocol; |
| | | private boolean resetFlag = false; |
| | | public static final List<Short> staNoOne = new ArrayList<Short>() {{ |
| | | add((short) 2);add((short) 5);add((short) 8);add((short) 12);add((short) 16);add((short) 20); |
| | | public static final List<Short> rowOne = new ArrayList<Short>() {{ |
| | | add((short) 1);add((short) 5);add((short) 7);add((short) 11);add((short) 15);add((short) 19); |
| | | }}; |
| | | public static final List<Short> staNoTwo = new ArrayList<Short>() {{ |
| | | add((short) 3);add((short) 6);add((short) 9);add((short) 13);add((short) 17);add((short) 21); |
| | | public static final List<Short> rowTwo = new ArrayList<Short>() {{ |
| | | add((short) 2);add((short) 6);add((short) 8);add((short) 12);add((short) 16);add((short) 20); |
| | | }}; |
| | | public static final List<Short> rowThree = new ArrayList<Short>() {{ |
| | | add((short) 3);add((short) 9);add((short) 13);add((short) 17);add((short) 21); |
| | | }}; |
| | | public static final List<Short> rowFour = new ArrayList<Short>() {{ |
| | | add((short) 4);add((short) 10);add((short) 14);add((short) 18); |
| | | }}; |
| | | |
| | | |
| | | public SiemensCrnThread(CrnSlave slave) { |
| | | this.slave = slave; |
| | |
| | | array[2] = command.getSourcePosY(); |
| | | |
| | | |
| | | if (staNoOne.contains(command.getSourcePosX())){ |
| | | if (rowOne.contains(command.getSourcePosX())){ |
| | | array[3] = (short)1; |
| | | }else if (staNoTwo.contains(command.getSourcePosX())){ |
| | | }else if (rowTwo.contains(command.getSourcePosX())){ |
| | | array[3] = (short)2; |
| | | }else if (rowThree.contains(command.getSourcePosX())){ |
| | | array[3] = (short)3; |
| | | }else if (rowFour.contains(command.getSourcePosX())){ |
| | | array[3] = (short)4; |
| | | }else { |
| | | array[3] = command.getSourcePosX(); |
| | | } |
| | | array[4] = command.getDestinationPosZ(); |
| | | array[5] = command.getDestinationPosY(); |
| | | |
| | | if (staNoOne.contains(command.getDestinationPosX())){ |
| | | if (rowOne.contains(command.getDestinationPosX())){ |
| | | array[6] = (short)1; |
| | | }else if (staNoTwo.contains(command.getDestinationPosX())){ |
| | | }else if (rowTwo.contains(command.getDestinationPosX())){ |
| | | array[6] = (short)2; |
| | | }else if (rowThree.contains(command.getDestinationPosX())){ |
| | | array[6] = (short)3; |
| | | }else if (rowFour.contains(command.getDestinationPosX())){ |
| | | array[6] = (short)4; |
| | | }else { |
| | | array[6] = command.getDestinationPosX(); |
| | | } |