Merge branch 'main' of http://182.92.203.107:3000/libingkun/skyeyesystem
This commit is contained in:
commit
c15252b7e6
@ -86,6 +86,21 @@ public class JmJobController {
|
||||
return jobService.save(mode, e);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预览
|
||||
*/
|
||||
@PostMapping("/preview")
|
||||
public Object preview(@Valid @RequestBody JmJobDTO e) {
|
||||
JmJobModeEnum mode = EnumUtil.parseEx(JmJobModeEnum.class, e.getMode());
|
||||
clearId(e);
|
||||
// 默认执行一次性任务
|
||||
if (e.getType() == null) {
|
||||
e.setType(1);
|
||||
e.setCronExpression(null);
|
||||
}
|
||||
return jobService.preview(mode, e);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ -121,8 +136,8 @@ public class JmJobController {
|
||||
JmJobDTO job = jobService.selectDetail(id);
|
||||
if (job == null) {
|
||||
throw ServiceException.noLog("找不到任务,id=" + id);
|
||||
} else if (EnumUtil.parseEx(ExecStatusEnum.class, job.getStatus()) != ExecStatusEnum.NOT) {
|
||||
throw ServiceException.noLog("任务状态不是未执行,无法起飞");
|
||||
} else if (EnumUtil.parseEx(ExecStatusEnum.class, job.getStatus()) == ExecStatusEnum.PROCESSING) {
|
||||
throw ServiceException.noLog("任务状态为执行中,无法起飞");
|
||||
}
|
||||
jobService.start(job);
|
||||
return "开始执行";
|
||||
|
||||
@ -44,6 +44,11 @@ public interface JmJobService {
|
||||
*/
|
||||
JmJob save(JmJobModeEnum mode, JmJobDTO e);
|
||||
|
||||
/**
|
||||
* 预览
|
||||
*/
|
||||
JmJobDTO preview(JmJobModeEnum mode, JmJobDTO e);
|
||||
|
||||
/**
|
||||
* 修改(不为空的字段)
|
||||
*/
|
||||
|
||||
@ -158,6 +158,18 @@ public class JmJobServiceImpl implements JmJobService {
|
||||
return insert(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JmJobDTO preview(JmJobModeEnum jobMode, JmJobDTO e) {
|
||||
log.info("预览任务参数:{}||{}", JSON.toJSONString(jobMode), JSON.toJSONString(e));
|
||||
SarImageModeEnum imageMode = EnumUtil.parseEx(SarImageModeEnum.class, e.getImageMode());
|
||||
// 非航线模式需要调算法生成航线,需要从缓存取sar坐标
|
||||
Map<Long, List<JmAirline>> airlineGroup = jmAirlinePlanService.plan(jobMode, imageMode, e.getTargetType(),
|
||||
e.getUavList(), e.getPointList());
|
||||
// 校验并加载数据
|
||||
checkAndSetUav(e.getUavList(), airlineGroup);
|
||||
return e;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateNotNull(JmJob e) {
|
||||
jobMapper.updateNotNull(e);
|
||||
|
||||
@ -283,17 +283,23 @@ public class JmJobStatusServiceImpl implements JmJobStatusService {
|
||||
return;
|
||||
}
|
||||
endAirline(jobId, jobVo, uavVo, airlineVo, wsVo, nextAirline == null);
|
||||
} else if (isBoot == 1 && aStatus == ExecStatusEnum.PROCESSING && overButSending) {
|
||||
// 前一航线的图片没传完,就开始了新航线
|
||||
endAirline(jobId, jobVo, uavVo, airlineVo, wsVo, nextAirline == null);
|
||||
if (nextAirline != null) {
|
||||
startAirline(nextAirline, wsVo);
|
||||
} else if (isBoot == 1 && aStatus == ExecStatusEnum.PROCESSING) {
|
||||
if (overButSending) {
|
||||
// 前一航线的图片没传完,就开始了新航线
|
||||
endAirline(jobId, jobVo, uavVo, airlineVo, wsVo, nextAirline == null);
|
||||
if (nextAirline != null) {
|
||||
startAirline(nextAirline, wsVo);
|
||||
}
|
||||
}
|
||||
|
||||
// simpMessageingTemplate.convertAndSend(WebSocketKey.JM_JOB_STATUS, wsVo);
|
||||
simpMessageingTemplate.convertAndSend(WebSocketKey.JM_JOB_STATUS, curr);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
// 4.将更新后的状态推送到前端
|
||||
simpMessageingTemplate.convertAndSend(WebSocketKey.JM_JOB_STATUS, wsVo);
|
||||
// simpMessageingTemplate.convertAndSend(WebSocketKey.JM_JOB_STATUS, wsVo);
|
||||
}
|
||||
|
||||
// 开启新航线
|
||||
|
||||
@ -83,30 +83,30 @@ public class CacheKey {
|
||||
/**
|
||||
* 运动规划响应,1秒
|
||||
*/
|
||||
public static final String SMP_WAYPOINT_RES = "skyeye:smp:waypoint:";
|
||||
//public static final String SMP_WAYPOINT_RES = "skyeye:smp:waypoint:";
|
||||
|
||||
/**
|
||||
* 飞行控制响应,1秒
|
||||
*/
|
||||
public static final String SMP_FLIGHT_RES = "skyeye:smp:flight:";
|
||||
//public static final String SMP_FLIGHT_RES = "skyeye:smp:flight:";
|
||||
|
||||
/**
|
||||
* 云台控制响应,1秒
|
||||
*/
|
||||
public static final String SMP_GIMBALMGR_RES = "skyeye:smp:gimbalmgr:";
|
||||
//public static final String SMP_GIMBALMGR_RES = "skyeye:smp:gimbalmgr:";
|
||||
|
||||
/**
|
||||
* 数据订阅响应,1秒
|
||||
*/
|
||||
public static final String SMP_SUBSCRIPT_RES = "skyeye:smp:subscript:";
|
||||
//public static final String SMP_SUBSCRIPT_RES = "skyeye:smp:subscript:";
|
||||
|
||||
/**
|
||||
* 数据订阅回传数据,1秒
|
||||
*/
|
||||
public static final String SMP_SUBSCRIPT_DATA = "skyeye:smp:subscript:";
|
||||
//public static final String SMP_SUBSCRIPT_DATA = "skyeye:smp:subscript:";
|
||||
|
||||
/**
|
||||
* 相机视频流响应,1秒
|
||||
*/
|
||||
public static final String SMP_VIDEO_RES = "skyeye:smp:video:";
|
||||
//public static final String SMP_VIDEO_RES = "skyeye:smp:video:";
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ public enum ExecStatusEnum implements CodeEnum<Integer> {
|
||||
|
||||
OVER(2, "已完成"),
|
||||
|
||||
READY(3, "就绪"),
|
||||
//READY(3, "就绪"),
|
||||
;
|
||||
|
||||
/** 值 */
|
||||
|
||||
@ -12,8 +12,9 @@ public class SysFileTypeService {
|
||||
/** 文件根路径 */
|
||||
private String fileRoot;
|
||||
|
||||
|
||||
// 去掉末尾的路径分隔符
|
||||
@Value("$skyeye.file-root}")
|
||||
@Value("${skyeye.file-root}")
|
||||
public void setFileRoot(String fileRoot) {
|
||||
this.fileRoot = fileRoot.endsWith("/") || fileRoot.endsWith("\\") ? fileRoot.substring(0, fileRoot.length() - 1) : fileRoot;
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.zhangy.skyeye.sar.listen;
|
||||
|
||||
import com.zhangy.skyeye.common.extend.util.JsonUtil;
|
||||
import com.zhangy.skyeye.jm.dto.JmAirlineStatusDTO;
|
||||
import com.zhangy.skyeye.jm.entity.JmImage;
|
||||
import com.zhangy.skyeye.jm.service.JmJobStatusService;
|
||||
@ -47,7 +48,7 @@ public class SarImageUdpProcessor extends SarAbstractUdpProcessor<SarImagePacket
|
||||
JmImage imageInfo = sarImageService.parseImage(group.getSourceIp(), group.getAirlineExecId(), frameData, imageFram);
|
||||
// 推送,仅当前有任务时,jobId 和 uavId 不能为空
|
||||
if (imageInfo != null) {
|
||||
//log.info("推送图片:" + JsonUtil.toString(imageInfo));
|
||||
log.info("推送图片:" + JsonUtil.toString(imageInfo));
|
||||
sarBackWsService.sendImg(imageInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.zhangy.skyeye.sar.service.impl;
|
||||
import com.zhangy.skyeye.jm.dto.JmAirlineStatusDTO;
|
||||
import com.zhangy.skyeye.jm.dto.JmUavStatusDTO;
|
||||
import com.zhangy.skyeye.jm.entity.JmImage;
|
||||
import com.zhangy.skyeye.jm.service.JmJobStatusService;
|
||||
import com.zhangy.skyeye.publics.consts.WebSocketKey;
|
||||
import com.zhangy.skyeye.sar.context.SarTaskContextProvider;
|
||||
import com.zhangy.skyeye.sar.dto.JmSarWaveWsDTO;
|
||||
@ -33,6 +34,9 @@ public class SarBackWsServiceImpl implements ISarBackWsService {
|
||||
@Autowired
|
||||
private SarTaskContextProvider taskContextProvider;
|
||||
|
||||
@Autowired
|
||||
private JmJobStatusService jobStatusService;
|
||||
|
||||
@Override
|
||||
public void sendWave(String payloadIp, SarBackWaveFrameDTO frame, byte[] frameData) {
|
||||
JmSarWaveWsDTO wsVo = loadJobDetail(payloadIp, frame.getChannel(), frameData);
|
||||
@ -55,7 +59,8 @@ public class SarBackWsServiceImpl implements ISarBackWsService {
|
||||
* @return
|
||||
*/
|
||||
private JmSarWaveWsDTO loadJobDetail(String payloadIp, JmSarWaveWsDTO ws, byte[] frameData) {
|
||||
JmUavStatusDTO uav = taskContextProvider.getCurrentUav(payloadIp);
|
||||
// JmUavStatusDTO uav = taskContextProvider.getCurrentUav(payloadIp);
|
||||
JmUavStatusDTO uav = jobStatusService.getCurrUav(payloadIp);
|
||||
if (uav == null) { // 如果没有执行中的任务则忽略
|
||||
log.debug("IP={} 无正在执行的任务,忽略波形推送", payloadIp);
|
||||
return null;
|
||||
|
||||
@ -149,22 +149,6 @@
|
||||
placeholder="请输入任务名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="mode" label="飞行模式">
|
||||
<el-select
|
||||
popper-class="form-light"
|
||||
size="small"
|
||||
:disabled="duringDraw || airlineCreateInfo.during"
|
||||
@change="onModeChange"
|
||||
v-model="form.mode"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in jobModeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="uav" label="无人机">
|
||||
<el-select
|
||||
popper-class="form-light"
|
||||
@ -194,6 +178,22 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="mode" label="飞行模式">
|
||||
<el-select
|
||||
popper-class="form-light"
|
||||
size="small"
|
||||
:disabled="duringDraw || airlineCreateInfo.during"
|
||||
@change="onModeChange"
|
||||
v-model="form.mode"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in jobModeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="任务目标"
|
||||
v-if="form.mode === '1'"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user