From cfe80334e4e30c8f7962fb4216ef9d06410e6061 Mon Sep 17 00:00:00 2001 From: lsh <lsh123456> Date: 星期三, 26 十月 2022 13:53:48 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/SiemensCrnThread.java | 44 ++++++++++++++++++++++++++++++++++++++------ 1 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zy/core/thread/SiemensCrnThread.java b/src/main/java/com/zy/core/thread/SiemensCrnThread.java index a7a25a9..3664661 100644 --- a/src/main/java/com/zy/core/thread/SiemensCrnThread.java +++ b/src/main/java/com/zy/core/thread/SiemensCrnThread.java @@ -360,8 +360,18 @@ } else { array[0] = 0; } - array[1] = command.getSourcePosZ(); - array[2] = command.getSourcePosY(); + + if (command.getSourcePosZ()==(short)1 && command.getSourcePosY()==(short)1){ + array[1] = (short)0; + array[2] = (short)0; + }else if (command.getSourcePosZ()==(short)1 && command.getSourcePosY()==(short)41){ + array[1] = (short)0; + array[2] = (short)42; + }else { + array[1] = command.getSourcePosZ(); + array[2] = command.getSourcePosY(); + } + if (command.getSourcePosX()==(short)3){ array[3] = (short)1; }else if (command.getSourcePosX()==(short)4){ @@ -369,8 +379,18 @@ }else { array[3] = command.getSourcePosX(); } - array[4] = command.getDestinationPosZ(); - array[5] = command.getDestinationPosY(); + + if (command.getDestinationPosZ()==(short)1 && command.getDestinationPosY()==(short)1){ + array[4] = (short)0; + array[5] = (short)0; + }else if (command.getDestinationPosZ()==(short)1 && command.getDestinationPosY()==(short)41){ + array[4] = (short)0; + array[5] = (short)42; + }else { + array[4] = command.getDestinationPosZ(); + array[5] = command.getDestinationPosY(); + } + if (command.getDestinationPosX()==(short)3){ array[6] = (short)1; }else if (command.getDestinationPosX()==(short)4){ @@ -378,8 +398,20 @@ }else { array[6] = command.getDestinationPosX(); } - array[7] = command.getSourceStaNo(); - array[8] = command.getDestinationStaNo(); + if ((array[1]==(short)0 && array[2] == (short)0) || (array[1]==(short)0 && array[2] == (short)42)){ + array[7]=(short)1; + }else { + array[7]=(short)0; + } +// array[7] = command.getSourceStaNo(); + + if ((array[4]==(short)0 && array[5] == (short)0) || (array[4]==(short)0 && array[5] == (short)42)){ + array[8]=(short)1; + }else { + array[8]=(short)0; + } +// array[8] = command.getDestinationStaNo(); + // 浣滀笟淇℃伅 OperateResult result = siemensNet.Write("DB10.0", array); // 浠诲姟鍙� + 瀹屾垚浣� -- Gitblit v1.9.1