任务相关
This commit is contained in:
parent
011b3089af
commit
da06586d27
|
|
@ -14,7 +14,6 @@ import com.hivekion.enums.WsCmdTypeEnum;
|
||||||
import com.hivekion.room.RoomManager;
|
import com.hivekion.room.RoomManager;
|
||||||
import com.hivekion.room.func.TaskAction;
|
import com.hivekion.room.func.TaskAction;
|
||||||
import com.hivekion.scenario.entity.ScenarioTask;
|
import com.hivekion.scenario.entity.ScenarioTask;
|
||||||
import com.hivekion.statistic.bean.StatisticBean;
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
@ -46,6 +45,7 @@ import org.springframework.web.reactive.function.client.WebClient;
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public abstract class AbtParentTask implements TaskAction {
|
public abstract class AbtParentTask implements TaskAction {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始点坐标
|
* 开始点坐标
|
||||||
*/
|
*/
|
||||||
|
|
@ -125,7 +125,7 @@ public abstract class AbtParentTask implements TaskAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void initPath(){
|
protected void initPath() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
String url = SpringUtil.getBean(Environment.class).getProperty("path.planning.url");
|
String url = SpringUtil.getBean(Environment.class).getProperty("path.planning.url");
|
||||||
|
|
@ -195,7 +195,8 @@ public abstract class AbtParentTask implements TaskAction {
|
||||||
log.error("error::", e);
|
log.error("error::", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected void updatePath(double speed) {
|
|
||||||
|
protected void updatePath(double speed, TaskAction action) {
|
||||||
|
|
||||||
ScheduledExecutorService schedule = Executors.newScheduledThreadPool(
|
ScheduledExecutorService schedule = Executors.newScheduledThreadPool(
|
||||||
1);
|
1);
|
||||||
|
|
@ -264,6 +265,9 @@ public abstract class AbtParentTask implements TaskAction {
|
||||||
scenarioTask.getScenarioId(), dataMap));
|
scenarioTask.getScenarioId(), dataMap));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if (action != null) {
|
||||||
|
action.doSomeThing();
|
||||||
|
}
|
||||||
//完成路径
|
//完成路径
|
||||||
Global.sendCmdInfoQueue.add(
|
Global.sendCmdInfoQueue.add(
|
||||||
ResponseCmdInfo.create(WsCmdTypeEnum.PATH_FINISHED.getCode(), roomId,
|
ResponseCmdInfo.create(WsCmdTypeEnum.PATH_FINISHED.getCode(), roomId,
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ public class MoveRootTask extends AbtParentTask implements TaskAction {
|
||||||
|
|
||||||
initEnv(); //初始化环境
|
initEnv(); //初始化环境
|
||||||
initPath(); //初始化路径
|
initPath(); //初始化路径
|
||||||
updatePath(SPEED); //更新路径
|
updatePath(SPEED,null); //更新路径
|
||||||
fuelConsumption();//油品消耗
|
fuelConsumption();//油品消耗
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user