| | |
| | | package com.zy.core.thread; |
| | | |
| | | import com.zy.core.Slave; |
| | | import com.zy.core.ThreadHandler; |
| | | import com.zy.core.model.CommandResponse; |
| | | import com.zy.core.model.command.CrnCommand; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/8/4 |
| | | */ |
| | | public class CrnThread implements Runnable, ThreadHandler { |
| | | public interface CrnThread extends ThreadHandler { |
| | | |
| | | private Slave slave; |
| | | CrnProtocol getStatus(); |
| | | |
| | | public CrnThread(Slave slave) { |
| | | this.slave = slave; |
| | | } |
| | | CrnCommand getPickAndPutCommand(String sourceLocNo, String targetLocNo, Integer taskNo, Integer crnNo);//取放货 |
| | | |
| | | @Override |
| | | @SuppressWarnings("InfiniteLoopStatement") |
| | | public void run() { |
| | | while (true) { |
| | | try { |
| | | System.out.println("线程"+slave.getId()+"正在运行"); |
| | | CrnCommand getMoveCommand(String targetLocNo, Integer taskNo, Integer crnNo);//移动 |
| | | |
| | | CrnCommand getResetCommand(Integer crnNo);//复位 |
| | | |
| | | CommandResponse sendCommand(CrnCommand command);//下发命令 |
| | | |
| | | |
| | | |
| | | Thread.sleep(1000); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void close() { |
| | | } |
| | | } |