main
徐景良 1 month ago
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
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 = [];
airPoints.value?.forEach((item, index) => {
coordinates.push([item.lng, item.lat]);
});
let line = turf.lineString(coordinates);
handlerDrawPolygonLine(line);
// 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);
// });
// let coordinates = [];
// airPoints.value?.forEach((item, index) => {
// coordinates.push([item.lng, item.lat]);
// });
// let line = turf.lineString(coordinates);
// 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…
Cancel
Save