| | |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.framework.exception.CoolException; |
| | | import com.zy.acs.manager.common.utils.MapDataUtils; |
| | | import com.zy.acs.manager.core.domain.PathDto; |
| | | import com.zy.acs.manager.core.service.astart.domain.DynamicNode; |
| | | import com.zy.acs.manager.core.utils.RouteGenerator; |
| | | import com.zy.acs.manager.manager.entity.Code; |
| | |
| | | import com.zy.acs.manager.manager.service.RouteService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.boot.context.event.ApplicationReadyEvent; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | |
| | | return codeMatrixIdxList; |
| | | } |
| | | |
| | | public void modifyDynamicMatrix(Integer lev, List<int[]> codeIdxList, String vehicle) { |
| | | this.modifyDynamicMatrix(lev, codeIdxList, vehicle, false); |
| | | public void modifyDynamicMatrix(Integer lev, List<int[]> codeIdxList, String vehicle, List<PathDto> pathTrace) { |
| | | this.modifyDynamicMatrix(lev, codeIdxList, vehicle, false, pathTrace); |
| | | } |
| | | |
| | | public synchronized void modifyDynamicMatrix(Integer lev, List<int[]> codeIdxList, String vehicle, boolean reset) { |
| | | this.modifyDynamicMatrix(lev, codeIdxList, vehicle, reset, null); |
| | | } |
| | | |
| | | private synchronized void modifyDynamicMatrix(Integer lev, List<int[]> codeIdxList, String vehicle, boolean reset, List<PathDto> pathTrace) { |
| | | if (Cools.isEmpty(vehicle)) { |
| | | return; |
| | | } |
| | |
| | | DynamicNode[][] dynamicMatrix = getDynamicMatrix(lev); |
| | | |
| | | if (!reset) { |
| | | // long time = System.currentTimeMillis() / 1000; |
| | | int serial = 1; |
| | | for (int[] codeMatrixIdx : codeIdxList) { |
| | | dynamicMatrix[codeMatrixIdx[0]][codeMatrixIdx[1]] = new DynamicNode(vehicle, serial); |
| | | for (int i = 0; i < codeIdxList.size(); i++) { |
| | | int[] codeMatrixIdx = codeIdxList.get(i); |
| | | |
| | | PathDto pathDto = (pathTrace != null && i < pathTrace.size()) ? pathTrace.get(i) : null; |
| | | Double direction = pathDto == null ? null : pathDto.getDirection(); |
| | | boolean turn = pathDto != null && pathDto.isTurn(); |
| | | |
| | | dynamicMatrix[codeMatrixIdx[0]][codeMatrixIdx[1]] = new DynamicNode(vehicle, serial, direction, turn); |
| | | serial++; |
| | | } |
| | | } else { |
| | |
| | | } |
| | | |
| | | public void clearDynamicMatrixByCodeList(Integer lev, List<int[]> codeIdxList) { |
| | | this.modifyDynamicMatrix(lev, codeIdxList, DynamicNodeType.ACCESS.val); |
| | | this.modifyDynamicMatrix(lev, codeIdxList, DynamicNodeType.ACCESS.val, false, null); |
| | | } |
| | | |
| | | public int[][] filterMapData(int[][] mapMatrix, Integer lev, List<String> lockNodes) { |