From 51f0aef1ace8e8f02e9e3a64e9d9cf7a182355af Mon Sep 17 00:00:00 2001 From: vincent <1341870251@qq.com> Date: 星期二, 18 八月 2020 14:36:40 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/CrnThread.java | 103 ++++++++++++++++++++++++++++++++++++--------------- src/main/resources/application.yml | 2 2 files changed, 73 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/zy/core/thread/CrnThread.java b/src/main/java/com/zy/core/thread/CrnThread.java index ae3930b..46a00f7 100644 --- a/src/main/java/com/zy/core/thread/CrnThread.java +++ b/src/main/java/com/zy/core/thread/CrnThread.java @@ -212,23 +212,80 @@ crnThread.connect(); crnThread.readStatus(); System.out.println(JSON.toJSONString(crnThread.crnProtocol)); + Thread.sleep(3000L); + + // 1.鍏ュ簱 婧愬拰鐩爣閮藉彂 +// CrnCommand command = new CrnCommand(); +// command.setCrnNo(1); // 鍫嗗灈鏈虹紪鍙� +// command.setTaskNo((short) 0); // 宸ヤ綔鍙� +// command.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� +// command.setTaskMode(CrnTaskModeType.PAKIN); // 浠诲姟妯″紡 +// command.setSourcePosX((short) 1); // 婧愬簱浣嶆帓 +// command.setSourcePosY((short) 0); // 婧愬簱浣嶅垪 +// command.setSourcePosZ((short) 1); // 婧愬簱浣嶅眰 +// command.setDestinationPosX((short) 2); // 鐩爣搴撲綅鎺� +// command.setDestinationPosY((short) 3); // 鐩爣搴撲綅鍒� +// command.setDestinationPosZ((short) 1); // 鐩爣搴撲綅灞� +// crnThread.write(command); + + // 2.鍑哄簱 婧愬拰鐩爣閮藉彂 +// CrnCommand command = new CrnCommand(); +// command.setCrnNo(1); // 鍫嗗灈鏈虹紪鍙� +// command.setTaskNo((short) 0); // 宸ヤ綔鍙� +// command.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� +// command.setTaskMode(CrnTaskModeType.PAKOUT); // 浠诲姟妯″紡 +// command.setSourcePosX((short) 2); // 婧愬簱浣嶆帓 +// command.setSourcePosY((short) 4); // 婧愬簱浣嶅垪 +// command.setSourcePosZ((short) 3); // 婧愬簱浣嶅眰 +// command.setDestinationPosX((short) 1); // 鐩爣搴撲綅鎺� +// command.setDestinationPosY((short) 0); // 鐩爣搴撲綅鍒� +// command.setDestinationPosZ((short) 1); // 鐩爣搴撲綅灞� +// crnThread.write(command); - Thread.sleep(5000L); - CrnCommand command = new CrnCommand(); - command.setCrnNo(1); // 鍫嗗灈鏈虹紪鍙� - command.setTaskNo((short) 0); // 宸ヤ綔鍙� - command.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� - command.setTaskMode(CrnTaskModeType.OFFSET_MOVE); // 浠诲姟妯″紡 - command.setSourcePosX((short) 0); // 婧愬簱浣嶆帓 - command.setSourcePosY((short) 0); // 婧愬簱浣嶅垪 - command.setSourcePosZ((short) 0); // 婧愬簱浣嶅眰 - command.setDestinationPosX((short) 1); // 鐩爣搴撲綅鎺� - command.setDestinationPosY((short) 7); // 鐩爣搴撲綅鍒� - command.setDestinationPosZ((short) 2); // 鐩爣搴撲綅灞� - crnThread.write(command); +// // 3.搴撲綅绉昏浆 婧愬拰鐩爣閮藉彂 +// CrnCommand command = new CrnCommand(); +// command.setCrnNo(slave.getId()); // 鍫嗗灈鏈虹紪鍙� +// command.setTaskNo((short) 0); // 宸ヤ綔鍙� +// command.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� +// command.setTaskMode(CrnTaskModeType.LOC_MOVE); // 浠诲姟妯″紡: 搴撲綅绉昏浆 +// command.setSourcePosX((short)1); // 婧愬簱浣嶆帓 +// command.setSourcePosY((short)2); // 婧愬簱浣嶅垪 +// command.setSourcePosZ((short)2); // 婧愬簱浣嶅眰 +// command.setDestinationPosX((short)2); // 鐩爣搴撲綅鎺� +// command.setDestinationPosY((short)3); // 鐩爣搴撲綅鍒� +// command.setDestinationPosZ((short)3); // 鐩爣搴撲綅灞� +// crnThread.write(command); + // 4.绔欎綅绉昏浆 婧愬拰鐩爣閮藉彂 +// CrnCommand command = new CrnCommand(); +// command.setCrnNo(slave.getId()); // 鍫嗗灈鏈虹紪鍙� +// command.setTaskNo((short) 0); // 宸ヤ綔鍙� +// command.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� +// command.setTaskMode(CrnTaskModeType.SITE_MOVE); // 浠诲姟妯″紡: 搴撲綅绉昏浆 +// command.setSourcePosX((short)1); // 婧愬簱浣嶆帓 +// command.setSourcePosY((short)0); // 婧愬簱浣嶅垪 +// command.setSourcePosZ((short)1); // 婧愬簱浣嶅眰 +// command.setDestinationPosX((short)2); // 鐩爣搴撲綅鎺� +// command.setDestinationPosY((short)0); // 鐩爣搴撲綅鍒� +// command.setDestinationPosZ((short)1); // 鐩爣搴撲綅灞� +// crnThread.write(command); +// // 5.鍥炲師鐐� 涓嶇敤鍙� pass +// CrnCommand command = new CrnCommand(); +// command.setCrnNo(1); // 鍫嗗灈鏈虹紪鍙� +// command.setTaskNo((short) 0); // 宸ヤ綔鍙� +// command.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� +// command.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 浠诲姟妯″紡 +// command.setSourcePosX((short) 0); // 婧愬簱浣嶆帓 +// command.setSourcePosY((short) 0); // 婧愬簱浣嶅垪 +// command.setSourcePosZ((short) 0); // 婧愬簱浣嶅眰 +// command.setDestinationPosX((short) 2); // 鐩爣搴撲綅鎺� +// command.setDestinationPosY((short) 1); // 鐩爣搴撲綅鍒� +// command.setDestinationPosZ((short) 1); // 鐩爣搴撲綅灞� +// crnThread.write(command); + +// // 7.鍧愭爣绉昏 鐩爣鍙� pass // CrnCommand command = new CrnCommand(); // command.setCrnNo(1); // 鍫嗗灈鏈虹紪鍙� // command.setTaskNo((short) 0); // 宸ヤ綔鍙� @@ -237,26 +294,10 @@ // command.setSourcePosX((short) 0); // 婧愬簱浣嶆帓 // command.setSourcePosY((short) 0); // 婧愬簱浣嶅垪 // command.setSourcePosZ((short) 0); // 婧愬簱浣嶅眰 -// command.setDestinationPosX((short) 0); // 鐩爣搴撲綅鎺� -// command.setDestinationPosY((short) 5); // 鐩爣搴撲綅鍒� +// command.setDestinationPosX((short) 2); // 鐩爣搴撲綅鎺� +// command.setDestinationPosY((short) 1); // 鐩爣搴撲綅鍒� // command.setDestinationPosZ((short) 1); // 鐩爣搴撲綅灞� // crnThread.write(command); - - -// // 鍐� -// CrnCommand command = new CrnCommand(); -// command.setCrnNo(slave.getId()); // 鍫嗗灈鏈虹紪鍙� -// command.setTaskNo((short) 0); // 宸ヤ綔鍙� -// command.setAckFinish((short) 1); // 浠诲姟瀹屾垚纭浣� -// command.setTaskMode(CrnTaskModeType.NONE); // 浠诲姟妯″紡: 搴撲綅绉昏浆 -// command.setSourcePosX((short)0); // 婧愬簱浣嶆帓 -// command.setSourcePosY((short)0); // 婧愬簱浣嶅垪 -// command.setSourcePosZ((short)0); // 婧愬簱浣嶅眰 -// command.setDestinationPosX((short)0); // 鐩爣搴撲綅鎺� -// command.setDestinationPosY((short)0); // 鐩爣搴撲綅鍒� -// command.setDestinationPosZ((short)0); // 鐩爣搴撲綅灞� -// crnThread.write(command); - } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index d717142..fa30c1c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -8,7 +8,7 @@ datasource: # sql-server driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver - url: jdbc:sqlserver://192.168.2.250:1433;databasename=gdasrs + url: jdbc:sqlserver://192.168.6.101:1433;databasename=jsasrs username: sa password: sa@123 mvc: -- Gitblit v1.9.1