merge
parent
317d49c50e
commit
78059c2b59
|
|
@ -19,7 +19,7 @@
|
|||
<!-- <link href="https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.css" rel="stylesheet">
|
||||
<script src="https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.js"></script> -->
|
||||
|
||||
<script src="/public/turf/turf-7.0.0.min.js"></script>
|
||||
<script src="/turf/turf-7.0.0.min.js"></script>
|
||||
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/@turf/turf@7.0.0/turf.min.js"></script> -->
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ const templateKmlConfig = ref({
|
|||
"exitOnRCLost": "goContinue",
|
||||
"executeRCLostAction": "goBack",
|
||||
"takeOffSecurityHeight": 20,
|
||||
"takeOffRefPoint": "35.134383,118.302109,74.787731",
|
||||
"takeOffRefPoint": "",
|
||||
"takeOffRefPointAGLHeight": 4.169064385,
|
||||
"globalTransitionalSpeed": 15,
|
||||
"globalRTHHeight": 100,
|
||||
|
|
|
|||
|
|
@ -485,7 +485,12 @@
|
|||
const currentFolderPath = ref(null);
|
||||
// 选择目录
|
||||
const folderClick = (item)=>{
|
||||
pageQuery.value.Folder = item.ancestor;
|
||||
if(!item.ancestor.match("/")){
|
||||
pageQuery.value.Folder = null;
|
||||
}else{
|
||||
pageQuery.value.Folder = item.ancestor;
|
||||
}
|
||||
|
||||
currentFolderPath.value = item.ancestor;
|
||||
currentFolder.value = item.id;
|
||||
getAirList();
|
||||
|
|
|
|||
|
|
@ -525,6 +525,7 @@ const handlerPointInfo = ()=>{
|
|||
message.warning("请添加航点!");
|
||||
return null;
|
||||
}
|
||||
|
||||
props.airPoints?.forEach((item,index)=>{
|
||||
|
||||
console.log("item123",item);
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@
|
|||
|
||||
<div class="title">
|
||||
<LeftOutlined @click="backPage" />
|
||||
<div>面状航线</div>
|
||||
<SaveOutlined @click="saveAirLine" />
|
||||
|
||||
<div style="flex:1;">
|
||||
<a-input v-model:value="props.airLineForm.airLineName" size="middle" placeholder="航线名称" />
|
||||
</div>
|
||||
<!-- <div>面状航线</div> -->
|
||||
<SaveOutlined @click="saveAirLine" style="font-size:20px;" />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 数据统计 -->
|
||||
|
|
@ -39,14 +40,14 @@
|
|||
<div class="area-options" >
|
||||
|
||||
<div class="item">
|
||||
<div class="label">参考起飞点
|
||||
<div class="label">选择机场
|
||||
<br/>
|
||||
<span style="font-size:12px;color:#ccc;">( {{props.templateKmlConfig?.missionConfig.takeOffRefPoint}} )</span>
|
||||
<span style="font-size:12px;color:#ccc;"> {{props.templateKmlConfig?.missionConfig.takeOffRefPoint}} </span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<a-button type="link" style="color:#408eff" @click="setTakeOffPoint()">
|
||||
<img src="./start-fly.png" style="width:24px;height:24px;position:relative;left:-2px;top:-2px;" alt="">
|
||||
设置起飞点
|
||||
选择机场
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -257,7 +258,7 @@ import JSZip from "jszip";
|
|||
import { saveAs } from "file-saver";
|
||||
import {templateStr} from '../waylineConfig/template'
|
||||
// 航线计算
|
||||
import {uavModel,calculateHeight,calculateGsd,calculateSpacing} from '../lib/calculateAirLine'
|
||||
import {uavModel,calculateHeight,calculateGsd,calculateSpacing,calculateInterval} from '../lib/calculateAirLine'
|
||||
|
||||
|
||||
const emits = defineEmits(["setTakeOffPoint","exitDraw","calculatParamChange"])
|
||||
|
|
@ -328,12 +329,23 @@ watch(
|
|||
{deep:true}
|
||||
)
|
||||
|
||||
|
||||
// 判断创建和编辑模式设置高度
|
||||
if(props.editModel == 'edit'){
|
||||
|
||||
calculatParam.value.gsd = calculateGsd(props.templateKmlConfig.Folder.Placemark.height,uavModel['m4td']);
|
||||
|
||||
calculatParam.value.overlapAngle = props.templateKmlConfig.Folder.Placemark.direction;
|
||||
}
|
||||
|
||||
// 根据gsd 计算 航线高度
|
||||
calculatParam.value.height = calculateHeight(calculatParam.value.gsd,uavModel['m4td']);
|
||||
|
||||
// 根据旁向重叠率就计算航线间距
|
||||
calculatParam.value.spacing = calculateSpacing(calculatParam.value.gsd,calculatParam.value.overlapY/100,uavModel['m4td'])
|
||||
|
||||
|
||||
|
||||
// 监听gsd改变
|
||||
const onGsdChange = ()=>{
|
||||
calculatParam.value.height = calculateHeight(calculatParam.value.gsd,uavModel['m4td']);
|
||||
|
|
@ -677,8 +689,8 @@ const handlerPointInfo = ()=>{
|
|||
}
|
||||
placemarkArray.push(point);
|
||||
});
|
||||
|
||||
folder.value.Placemark = placemarkArray;
|
||||
props.waylineWpmlConfig.Folder.Placemark = placemarkArray;
|
||||
// folder.value.Placemark = placemarkArray;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -835,7 +847,8 @@ const convertXmlToKmz =async (templateXml,waylineXml)=>{
|
|||
// 3. 生成 KMZ (ZIP) 文件
|
||||
const kmzBlob = await zip.generateAsync({ type: "blob" });
|
||||
|
||||
saveAs(kmzBlob, "output.kmz");
|
||||
// 下载航线文件
|
||||
// saveAs(kmzBlob, "output.kmz");
|
||||
|
||||
return kmzBlob;
|
||||
}
|
||||
|
|
@ -921,8 +934,11 @@ const handlerHeightMode = () => {
|
|||
};
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
handlerHeightMode();
|
||||
|
||||
// 获取地形数据
|
||||
const getDEMData = () => {
|
||||
|
||||
|
|
@ -1009,7 +1025,10 @@ const handelrAirPoint = () => {
|
|||
|
||||
// 根据高度模式 设置高度
|
||||
let height = 0;
|
||||
// 设置速度
|
||||
|
||||
// 计算间隔时间
|
||||
let spaceTime = (calculateInterval(calculatParam.value.gsd,calculatParam.value.overlapX/100,uavModel['m4td']) / props.templateKmlConfig.Folder.autoFlightSpeed)
|
||||
|
||||
|
||||
// 处理第1个航点
|
||||
if(index == 0){
|
||||
|
|
@ -1071,7 +1090,7 @@ const handelrAirPoint = () => {
|
|||
"payloadPositionIndex": 0,
|
||||
"useGlobalPayloadLensIndex": 0,
|
||||
"payloadLensIndex": "visable",
|
||||
"minShootInterval": 1.52472746372223
|
||||
"minShootInterval":spaceTime
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -1256,7 +1275,7 @@ const handelrAirPoint = () => {
|
|||
"payloadPositionIndex": 0,
|
||||
"useGlobalPayloadLensIndex": 0,
|
||||
"payloadLensIndex": "visable",
|
||||
"minShootInterval": 1.52472746372223
|
||||
"minShootInterval": spaceTime
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@
|
|||
// import * as turf from '@turf/turf';
|
||||
import airPolygon from './airPolygon.vue';
|
||||
import airPointConfig from './airPointConfig.vue';
|
||||
import { polygon } from '@turf/turf';
|
||||
|
||||
|
||||
// const props = defineProps([
|
||||
|
|
@ -1109,8 +1108,6 @@ function generateScanLines(polygon, spacing, angle = 0) {
|
|||
|
||||
let connectedLine = connectLinesManual(turf.featureCollection(coverageLines));
|
||||
|
||||
console.log("connectedLine",connectedLine);
|
||||
|
||||
|
||||
// 将航点提取并添加到airPoints
|
||||
airPoints.value = [];
|
||||
|
|
@ -1155,7 +1152,6 @@ function generateScanLines(polygon, spacing, angle = 0) {
|
|||
}
|
||||
airPoints.value?.push(lastPoint);
|
||||
|
||||
console.log("airPoints",airPoints.value);
|
||||
|
||||
// 添加最后一个点到线数据中
|
||||
connectedLine.geometry.coordinates.push([lastPoint.lng,lastPoint.lat,lastPoint.alt])
|
||||
|
|
@ -1453,33 +1449,33 @@ const handlerEditPolygonAirLine =async () => {
|
|||
handlerGetPolygonBorderInfo(geometry.coordinates[0])
|
||||
|
||||
// 加载航线
|
||||
let placemark = props.waylineInfo?.Folder?.Placemark
|
||||
// let placemark = props.waylineInfo?.Folder?.Placemark
|
||||
|
||||
placemark?.forEach((item, index) => {
|
||||
let coordinate = item.Point.coordinates.split(',');
|
||||
let airPointInfo = {
|
||||
id: item.index,
|
||||
name: '航点',
|
||||
lng: coordinate[0],
|
||||
lat: coordinate[1],
|
||||
alt: item.executeHeight,
|
||||
aircraftHorizontalAngle: 0,
|
||||
cameraHorizontalAngle: 0,
|
||||
cameraVerticalAngle: 0,
|
||||
focalLength: 2,
|
||||
};
|
||||
airPoints.value?.push(airPointInfo);
|
||||
});
|
||||
// placemark?.forEach((item, index) => {
|
||||
// let coordinate = item.Point.coordinates.split(',');
|
||||
// let airPointInfo = {
|
||||
// id: item.index,
|
||||
// name: '航点',
|
||||
// lng: coordinate[0],
|
||||
// lat: coordinate[1],
|
||||
// alt: item.executeHeight,
|
||||
// aircraftHorizontalAngle: 0,
|
||||
// cameraHorizontalAngle: 0,
|
||||
// cameraVerticalAngle: 0,
|
||||
// focalLength: 2,
|
||||
// };
|
||||
// airPoints.value?.push(airPointInfo);
|
||||
// });
|
||||
|
||||
let coordinates = [];
|
||||
// let coordinates = [];
|
||||
|
||||
airPoints.value?.forEach((item, index) => {
|
||||
coordinates.push([item.lng, item.lat]);
|
||||
});
|
||||
// airPoints.value?.forEach((item, index) => {
|
||||
// coordinates.push([item.lng, item.lat]);
|
||||
// });
|
||||
|
||||
let line = turf.lineString(coordinates);
|
||||
// let line = turf.lineString(coordinates);
|
||||
|
||||
handlerDrawPolygonLine(line);
|
||||
// handlerDrawPolygonLine(line);
|
||||
}
|
||||
|
||||
///////////////////////////////航点航线计算////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export const uavModel = {
|
|||
"focalLength":6.83,
|
||||
"sensorLength":9.85,
|
||||
"imageWidth":4032,
|
||||
"imageHeight":0,
|
||||
"imageHeight":3024,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -28,4 +28,12 @@ export const calculateSpacing = (gsd,overlap,uavModel) => {
|
|||
let groundResolution = gsd / 100;
|
||||
let lineSpacing = groundResolution * uavModel['imageWidth'] * (1 - overlap);
|
||||
return lineSpacing.toFixed(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 计算航点间距
|
||||
export const calculateInterval = (gsd,overlap,uavModel) => {
|
||||
let groundResolution = gsd / 100;
|
||||
let lineSpacing = groundResolution * uavModel['imageHeight'] * (1 - overlap);
|
||||
return lineSpacing.toFixed(2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,16 +103,18 @@ export const missionConfigOptions = {
|
|||
// 航点信息
|
||||
export const folderConfigOptions = {
|
||||
executeHeightMode:[ // 高度模式
|
||||
// {
|
||||
// label:"椭球高模式",
|
||||
// value:"EGM96"
|
||||
// },
|
||||
{
|
||||
label:"椭球高模式",
|
||||
value:"EGM96"
|
||||
},{
|
||||
label:"相对起飞点模式",
|
||||
value:"relativeToStartPoint"
|
||||
},{
|
||||
label:"相对地形模式",
|
||||
value:"realTimeFollowSurface"
|
||||
}
|
||||
},
|
||||
// {
|
||||
// label:"相对地形模式",
|
||||
// value:"realTimeFollowSurface"
|
||||
// }
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue