From 44fa920bbcf6cd94c81f3a6d2f3008925a8635ca Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期四, 11 五月 2023 09:40:39 +0800 Subject: [PATCH] 四向穿梭车命令封装 --- src/main/java/com/zy/core/thread/ShuttleThread.java | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/zy/core/thread/ShuttleThread.java b/src/main/java/com/zy/core/thread/ShuttleThread.java index 2df784a..e6eac50 100644 --- a/src/main/java/com/zy/core/thread/ShuttleThread.java +++ b/src/main/java/com/zy/core/thread/ShuttleThread.java @@ -918,7 +918,7 @@ * 鑾峰彇鎵樼洏椤跺崌鍛戒护 * @param lift 1椤跺崌锛�2涓嬮檷 */ - private ShuttleCommand getPalletCommand(Short lift) { + public ShuttleCommand getPalletCommand(Short lift) { ShuttleCommand command = new ShuttleCommand(); command.setCommandWord((short) 2); command.setStartCodeNum((short) 0); @@ -938,7 +938,7 @@ * 姝e父绉诲姩鍛戒护 * @return */ - private ShuttleCommand getMoveCommand(Short startCodeNum, Short distCodeNum, Integer startToDistDistance, Short runDirection) { + public ShuttleCommand getMoveCommand(Short startCodeNum, Short distCodeNum, Integer startToDistDistance, Short runDirection) { ShuttleCommand command = new ShuttleCommand(); command.setCommandWord((short) 1); command.setStartCodeNum(startCodeNum); @@ -957,7 +957,7 @@ * 寮哄埗绉诲姩鍛戒护 * @param direction 绉诲姩鏂瑰悜 1宸︾Щ锛�2鍙崇Щ锛�3鍓嶇Щ锛�4鍚庣Щ */ - private ShuttleCommand getForceMoveCommand(Short direction) { + public ShuttleCommand getForceMoveCommand(Short direction) { ShuttleCommand command = new ShuttleCommand(); command.setCommandWord((short) 3); command.setStartCodeNum((short) 0); @@ -975,7 +975,7 @@ /** * 鐘舵�佸浣嶅懡浠� */ - private ShuttleCommand getResetCommand() { + public ShuttleCommand getResetCommand() { ShuttleCommand command = new ShuttleCommand(); command.setCommandWord((short) 6); command.setStartCodeNum((short) 0); @@ -998,7 +998,7 @@ * 鑾峰彇瀵诲簱浣嶅懡浠� * @param direction 1:鍚戞鏂瑰悜(宸�)瀵诲簱浣�,2:鍚戣礋鏂瑰悜(鍙�)瀵诲簱浣�,3:鍚戣礋鏂瑰悜(鍚�)瀵诲簱浣�,4:鍚戞鏂瑰悜(鍓�)瀵诲簱浣� */ - private ShuttleCommand getFindLocCommand(Short direction, Integer startToDistance, Short runSpeed) { + public ShuttleCommand getFindLocCommand(Short direction, Integer startToDistance, Short runSpeed) { ShuttleCommand command = new ShuttleCommand(); command.setCommandWord((short) 4); command.setRunDirection(direction); @@ -1012,14 +1012,14 @@ * 鑾峰彇瀵诲簱浣嶅懡浠わ紝榛樿绉诲姩璺濈3000锛岃繍琛岄�熷害1000 * @param direction 1:鍚戞鏂瑰悜(宸�)瀵诲簱浣�,2:鍚戣礋鏂瑰悜(鍙�)瀵诲簱浣�,3:鍚戣礋鏂瑰悜(鍚�)瀵诲簱浣�,4:鍚戞鏂瑰悜(鍓�)瀵诲簱浣� */ - private ShuttleCommand getFindLocCommand(Short direction) { + public ShuttleCommand getFindLocCommand(Short direction) { return getFindLocCommand(direction, 3000, (short) 1000); } /** * 鑾峰彇鍏呯數寮�鍏冲懡浠� */ - private ShuttleCommand getChargeSwitchCommand() { + public ShuttleCommand getChargeSwitchCommand() { ShuttleCommand command = new ShuttleCommand(); command.setCommandWord((short) 8); command.setIOControl((short) 4); @@ -1027,6 +1027,18 @@ return command; } + /** + * charge锛�1=>寮�濮嬪厖鐢碉紝2=>鏂紑鍏呯數 + */ + public ShuttleCommand getChargeSwitchCommand(Short charge) { + ShuttleCommand command = new ShuttleCommand(); + command.setCommandWord((short) 5);//鍏呯數 + command.setShuttleNo(shuttleProtocol.getShuttleNo()); + command.setChargeSwitch(charge);//寮�濮嬪厖鐢� + command.setCommandEnd((short) 1); + return command; + } + /******************************************************************************************/ /**************************************** 娴嬭瘯涓撶敤 *****************************************/ /*****************************************************************************************/ -- Gitblit v1.9.1