|
|
@@ -376,6 +376,13 @@ public class SDKDeviceService extends AbstractDeviceService {
|
|
|
+ ",飞行器状态:" + data.getModeCode().name() + ",经度:" + data.getLongitude() + ",维度:" + data.getLatitude()
|
|
|
+ "高度:" + data.getHeight());
|
|
|
}
|
|
|
+ if(data.getModeCode().getCode() == 10) {
|
|
|
+ isAdd = true;
|
|
|
+ log.info("添加结束飞行轨迹: workspaceID:" + device.getWorkspaceId() + ",sn:" + device.getDeviceSn()
|
|
|
+ + ",间隔时间(毫秒):" + btwTime + ",采集频率(秒)" + CustomConfiguration.frequency
|
|
|
+ + ",飞行器状态:" + data.getModeCode().name() + ",经度:" + data.getLongitude() + ",维度:" + data.getLatitude()
|
|
|
+ + "高度:" + data.getHeight());
|
|
|
+ }
|
|
|
if(isSamePoint(data,lastPoint.get())) {
|
|
|
log.info("添加飞行轨迹:workspaceID:" + device.getWorkspaceId() + ",sn:" + device.getDeviceSn() +
|
|
|
"相同坐标,不做记录" + data.toString());
|
|
|
@@ -396,13 +403,15 @@ public class SDKDeviceService extends AbstractDeviceService {
|
|
|
.type(FlightPointTypeEnum.HOME.getType())
|
|
|
.createTime(System.currentTimeMillis()).build();
|
|
|
flightTaskService.addHomePoint(flightTrackEntity);
|
|
|
+ //记录添加时间
|
|
|
+ deviceRedisService.setLastDroneTrack(device.getDeviceSn(), flightTrackEntity);
|
|
|
}
|
|
|
}
|
|
|
if(!lastPoint.isPresent()) {
|
|
|
return null;
|
|
|
}
|
|
|
long btwTime = System.currentTimeMillis() - lastPoint.get().getCreateTime();
|
|
|
- if(btwTime >= CustomConfiguration.frequency * 1000) {
|
|
|
+ if(btwTime >= CustomConfiguration.frequency * 1000 || 10 == data.getModeCode().getCode()) {
|
|
|
//添加轨迹信息
|
|
|
FlightTrackEntity flightTrackEntity = FlightTrackEntity.builder()
|
|
|
.taskId(task.getId())
|
|
|
@@ -426,6 +435,7 @@ public class SDKDeviceService extends AbstractDeviceService {
|
|
|
}
|
|
|
|
|
|
private boolean isSamePoint(OsdRcDrone data,FlightTrackEntity lastPoint) {
|
|
|
+
|
|
|
return data.getLongitude().doubleValue() == lastPoint.getLongitude()
|
|
|
&& data.getLatitude().doubleValue() == lastPoint.getLatitude()
|
|
|
&& data.getHeight().doubleValue() == lastPoint.getAltitude()
|