fix: 堆垛机清点位校验、开始线程不判断状态
This commit is contained in:
@@ -34,17 +34,18 @@ public class AutoRunServiceImpl implements AutoRunService, ApplicationAutoInitia
|
|||||||
*/
|
*/
|
||||||
private List<AbstractAutoRunnable> thread_autoRun = new ArrayList();
|
private List<AbstractAutoRunnable> thread_autoRun = new ArrayList();
|
||||||
/**
|
/**
|
||||||
* key
|
* key
|
||||||
*/
|
*/
|
||||||
private List<String> autoRun_code_index = new ArrayList();
|
private List<String> autoRun_code_index = new ArrayList();
|
||||||
/**
|
/**
|
||||||
* 运行线程
|
* 运行线程
|
||||||
*/
|
*/
|
||||||
private List<Thread> threads = new ArrayList();
|
private List<Thread> threads = new ArrayList();
|
||||||
/**
|
/**
|
||||||
* key
|
* key
|
||||||
*/
|
*/
|
||||||
private List<String> thread_code_index = new ArrayList();
|
private List<String> thread_code_index = new ArrayList();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void startThread(String threadCode) {
|
public synchronized void startThread(String threadCode) {
|
||||||
Thread thread = this.getThreadByCode(threadCode);
|
Thread thread = this.getThreadByCode(threadCode);
|
||||||
@@ -65,24 +66,23 @@ public class AutoRunServiceImpl implements AutoRunService, ApplicationAutoInitia
|
|||||||
Thread thread = this.getThreadByCode(threadCode);
|
Thread thread = this.getThreadByCode(threadCode);
|
||||||
if (thread == null) {
|
if (thread == null) {
|
||||||
throw new BadRequestException(LangProcess.msg("error_isNull", threadCode));
|
throw new BadRequestException(LangProcess.msg("error_isNull", threadCode));
|
||||||
} else if (!thread.isAlive()) {
|
}
|
||||||
throw new BadRequestException(LangProcess.msg("error_status", threadCode));
|
try {
|
||||||
} else {
|
|
||||||
AbstractAutoRunnable runable = this.getRunablebyCode(threadCode);
|
AbstractAutoRunnable runable = this.getRunablebyCode(threadCode);
|
||||||
runable.stop();
|
runable.stop();
|
||||||
thread.stop();
|
thread.stop();
|
||||||
thread.interrupt();
|
thread.interrupt();
|
||||||
|
thread.join();
|
||||||
try {
|
|
||||||
thread.join();
|
|
||||||
} catch (InterruptedException arg4) {
|
|
||||||
arg4.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
runable.setStopMessage("人工停止");
|
runable.setStopMessage("人工停止");
|
||||||
runable.setStopTime(new Date());
|
runable.setStopTime(new Date());
|
||||||
|
} catch (Exception arg4) {
|
||||||
|
arg4.printStackTrace();
|
||||||
|
throw new BadRequestException(LangProcess.msg("error_status", threadCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -358,7 +358,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
|
|
||||||
if (!command.equals(last_command)) {
|
if (!command.equals(last_command)) {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
if (command == 0) {
|
Instruction byCodeFromCache = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
|
if (command == 0 && byCodeFromCache==null) {
|
||||||
clearWrite();
|
clearWrite();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user