| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.List; |
| | | import java.util.function.Supplier; |
| | | |
| | | @Slf4j |
| | | public class Plcdownglass extends Thread { |
| | |
| | | @Autowired |
| | | private DownStorageCageService downStorageCageService; |
| | | @Autowired |
| | | private DownWorkstationService downWorkstationService; |
| | | private DownWorkstationService downWorkstationService; |
| | | |
| | | |
| | | // private final Supplier<DownWorkstationService> plcServiceSupplier; |
| | | // |
| | | // public Plcdownglass() { |
| | | // this.plcServiceSupplier = () -> WebSocketServer.applicationContext.getBean(DownWorkstationService.class); |
| | | // } |
| | | |
| | | |
| | | |
| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | | Thread.sleep(100); |
| | | |
| | | String result = S7control.getinstance().ReadWord("DB14.0", 1).get(0) + ""; |
| | | String number = S7control.getinstance().ReadWord("DB14.2", 1).get(0) + ""; |
| | | |
| | | downWorkstationService = WebSocketServer.applicationContext.getBean(DownWorkstationService.class); |
| | | downStorageCageService = WebSocketServer.applicationContext.getBean(DownStorageCageService.class); |
| | | // String result = S7control.getinstance().ReadWord("DB14.0", 1).get(0) + ""; |
| | | // String number = S7control.getinstance().ReadWord("DB14.2", 1).get(0) + ""; |
| | | String result ="1"; |
| | | String number ="1"; |
| | | // 进片请求 |
| | | if (RESULT_IN.equals(result)) { |
| | | downStorageCageService.processInto(number); |