From 7243e0b4bd9a267a633d2e481e17646509b6868d Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期四, 07 九月 2023 19:36:37 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java b/igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java index 762ce32..04e47b0 100644 --- a/igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java +++ b/igds-core/src/main/java/com/ld/igds/grain/GrainUtil.java @@ -293,4 +293,57 @@ return list; } + /** + * 灞傝杞崲--椤烘椂閽� + * + * @param temps + * @param cable + * @return + */ + public List<Double> convertRight(List<Double> temps, String cable) { + String[] attCable = cable.split("-"); + int cableZ = Integer.valueOf(attCable[0]); + int cableY = Integer.valueOf(attCable[1]); + int cableX = Integer.valueOf(attCable[2]); + List<Double> list = new ArrayList<>(); + + int index; + for (int x = 1; x <= cableX; x++) { + for(int z = cableZ; z >= 1; z--){ + for (int y = 1; y <= cableY; y++) { + index = z*y*x -1; + list.add(temps.get(index)); + } + } + } + + return list; + } + + /** + * 灞傝杞崲--閫嗘椂閽� + * + * @param temps + * @param cable + * @return + */ + public List<Double> convertLeft(List<Double> temps, String cable) { + String[] attCable = cable.split("-"); + int cableZ = Integer.valueOf(attCable[0]); + int cableY = Integer.valueOf(attCable[1]); + int cableX = Integer.valueOf(attCable[2]); + List<Double> list = new ArrayList<>(); + + int index; + for (int x = 1; x <= cableX; x++) { + for (int z = 1; z <= cableZ; z++) { + for (int y = cableY; y >= cableY; y--) { + index = z*y*x -1; + list.add(temps.get(index)); + } + } + } + + return list; + } } \ No newline at end of file -- Gitblit v1.9.3