测试问题优化

main
刘妍 2 months ago
parent aea2fa0d32
commit b545ba822d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@ -6,7 +6,7 @@
<div class="anticon" :class="getAppLogoClass" @click="goHome">
<img :src="VITE_GLOB_APP_LOGO" />
<div class="ml-2 truncate md:opacity-100" :class="getTitleClass" v-show="showTitle">
{{ subjectLogoTitle ? subjectLogoTitle : title }}
{{ subjectLogoTitle ? subjectLogoTitle : shortName }}
</div>
</div>
</template>
@ -42,7 +42,7 @@
const { prefixCls } = useDesign('app-logo');
const { getCollapsedShowTitle } = useMenuSetting();
const userStore = useUserStore();
const { title } = useGlobSetting();
const { shortName } = useGlobSetting();
const subjectLogoTitle = getAuthCache(SUBJECT_LOGO_TITLE);
const go = useGo();

@ -3,14 +3,20 @@ import type { GlobConfig } from '#/config';
import { getAppEnvConfig } from '@/utils/env';
export const useGlobSetting = (): Readonly<GlobConfig> => {
const { VITE_GLOB_APP_TITLE, VITE_GLOB_API_URL, VITE_GLOB_API_URL_PREFIX, VITE_GLOB_UPLOAD_URL } =
getAppEnvConfig();
const {
VITE_GLOB_APP_TITLE,
VITE_GLOB_API_URL,
VITE_GLOB_API_URL_PREFIX,
VITE_GLOB_UPLOAD_URL,
VITE_GLOB_APP_HEADER_TITLE,
} = getAppEnvConfig();
// Take global configuration
const glob: Readonly<GlobConfig> = {
title: VITE_GLOB_APP_TITLE,
apiUrl: VITE_GLOB_API_URL,
shortName: VITE_GLOB_APP_TITLE.replace(/\s/g, '_').replace(/-/g, '_'),
// shortName: VITE_GLOB_APP_TITLE.replace(/\s/g, '_').replace(/-/g, '_'),
shortName: VITE_GLOB_APP_HEADER_TITLE,
urlPrefix: VITE_GLOB_API_URL_PREFIX,
uploadUrl: VITE_GLOB_UPLOAD_URL,
};

@ -41,6 +41,7 @@ export function getAppEnvConfig() {
VITE_GLOB_APP_TECHINICAL_SUPPORT,
VITE_GLOB_APP_VERSIONS,
VITE_GLOB_FILE_PREVIEW,
VITE_GLOB_APP_HEADER_TITLE,
} = ENV;
let { VITE_GLOB_API_URL } = ENV;
if (localStorage.getItem(API_ADDRESS)) {
@ -59,6 +60,7 @@ export function getAppEnvConfig() {
VITE_GLOB_APP_TECHINICAL_SUPPORT,
VITE_GLOB_APP_VERSIONS,
VITE_GLOB_FILE_PREVIEW,
VITE_GLOB_APP_HEADER_TITLE,
};
}

@ -15,6 +15,7 @@
@changeLive="changeAirportLive"
@changeRemote="changeRemote"
:msgData="msgData"
v-if="changeSelectValue"
/>
<UAVInformation
:msgData="msgData"
@ -22,6 +23,7 @@
@changeLoadControl="changeLoadControl"
@changeFlightControl="changeFlightControl"
@loadLiveStreaming="loadLiveStreaming"
v-if="changeSelectValue"
/>
<!-- 远程调试 -->
<!-- <div v-if="remoteVisible">
@ -32,6 +34,7 @@
v-if="loadControlVisible"
@changeLoadControl="changeLoadControl"
:msgData="msgData"
:uavStatus="uavStatus"
:cameraType="cameraType"
/>
<!-- 飞行控制 -->
@ -39,6 +42,7 @@
@changeFlightControl="changeFlightControl"
@clickTakeOff="clickTakeOff"
@clickFlyTo="clickFlyTo"
:uavStatus="uavStatus"
v-if="flightControlVisible"
/>
<!-- 一键起飞表单 -->
@ -116,10 +120,10 @@
longitude: null,
});
const uavTrack = ref({});
const connected = ref(false)
const connected = ref(false);
const connectCallback = () => {
connected.value = true
}
connected.value = true;
};
onMounted(() => {
destroyConnection();
createConnection(connectCallback);
@ -127,12 +131,15 @@
// changeSelect();
// }, 1000);
});
watch(() => connected.value, (value) => {
if(value){
console.log('start')
changeSelect()
}
})
watch(
() => connected.value,
(value) => {
if (value) {
console.log('start');
changeSelect();
}
},
);
onBeforeUnmount(() => {
destroyConnection();
});
@ -195,6 +202,7 @@
};
const msgData = ref({});
const changeSelect = async (value?: any) => {
createConnection(connectCallback);
//
//
airportLiveVisible.value = false;
@ -220,27 +228,32 @@
//
clientSubscribe(topicUAVUrl, { qos: 0 });
//
getClient().on('message', (topic, message) => {
const rs = JSON.parse(message);
if (rs) {
msgData.value = {
topic: topic,
message: rs,
};
if (!value) {
//
getClient().on('message', (topic, message) => {
const rs = JSON.parse(message);
if (rs) {
msgData.value = {
topic: topic,
message: rs,
};
if (topic == topicUAVUrl) {
if (rs.data.latitude && rs.data.longitude) {
uavTrack.value = rs.data;
}
} else if (topic == topicUrl) {
if (rs.data.latitude && rs.data.longitude) {
airPort.value.latitude = rs.data.latitude;
airPort.value.longitude = rs.data.longitude;
if (topic == topicUAVUrl) {
if (rs.data.latitude && rs.data.longitude) {
uavTrack.value = rs.data;
}
} else if (topic == topicUrl) {
if (rs.data.latitude && rs.data.longitude) {
airPort.value.latitude = rs.data.latitude;
airPort.value.longitude = rs.data.longitude;
}
if (rs.data.sub_device) {
uavStatus.value = rs.data.sub_device.device_online_status;
}
}
}
}
});
});
}
};
</script>
<style lang="less" scoped>

@ -44,7 +44,7 @@
>关闭</a-button
>
<a-button type="primary" style="background: #3a57e8; width: 40%" @click="takeOff"
>起飞</a-button
>执行</a-button
>
</div>
</div>
@ -97,6 +97,9 @@
createMessage.warning('请先选择目标点');
return;
}
data.points[0].latitude = Number(data.points[0].latitude);
data.points[0].longitude = Number(data.points[0].longitude);
data.points[0].height = Number(data.points[0].height);
const querys = {
bid: buildGUID(),
data: data,
@ -118,9 +121,9 @@
onMounted(() => {
//
EventBus.on('obtainTheLocation', (val: any) => {
data.points[0].latitude = val.lat;
data.points[0].longitude = val.lng;
data.points[0].height = val.alt;
data.points[0].latitude = val.lat.toFixed(6);
data.points[0].longitude = val.lng.toFixed(6);
data.points[0].height = val.alt.toFixed(2);
});
});
</script>

@ -256,7 +256,7 @@
setTopic(querys);
}
setTimeout(() => {
startLiveFun();
// startLiveFun();
playVideo();
getClient().on('message', (topic, message) => {
const rs = JSON.parse(message);

@ -24,27 +24,63 @@
<a-button @click="singleShot"></a-button>
</div>
<div class="direction-controller">
<img src="@/assets/images/flightoperation/direction_controller.png" alt="" />
<img
class="controller-bg"
src="@/assets/images/flightoperation/direction_controller.png"
alt=""
/>
<div
class="direction-controller-top"
title="俯视"
@click="changeDrc('pitch_speed', 'up')"
></div>
@mousedown="changeDrc('pitch_speed', 'up', '俯视')"
@mouseup="changeDrc('pitch_speed', 'up', '')"
>
<img
src="@/assets/images/flightoperation/p-top-active.png"
alt=""
v-if="selectName == '俯视'"
/>
<img src="@/assets/images/flightoperation/p-top.png" alt="" v-else />
</div>
<div
class="direction-controller-right"
title="右移"
@click="changeDrc('yaw_speed', 'up')"
></div>
@mousedown="changeDrc('yaw_speed', 'up', '右移')"
@mouseup="changeDrc('yaw_speed', 'up', '')"
>
<img
src="@/assets/images/flightoperation/p-right-active.png"
alt=""
v-if="selectName == '右移'"
/>
<img src="@/assets/images/flightoperation/p-right.png" alt="" v-else />
</div>
<div
class="direction-controller-bottom"
title="仰视"
@click="changeDrc('pitch_speed', 'down')"
></div>
@mousedown="changeDrc('pitch_speed', 'down', '仰视')"
@mouseup="changeDrc('pitch_speed', 'down', '')"
>
<img
src="@/assets/images/flightoperation/p-bottom-active.png"
alt=""
v-if="selectName == '仰视'"
/>
<img src="@/assets/images/flightoperation/p-bottom.png" alt="" v-else />
</div>
<div
class="direction-controller-left"
title="左移"
@click="changeDrc('yaw_speed', 'down')"
></div>
@mousedown="changeDrc('yaw_speed', 'down', '左移')"
@mouseup="changeDrc('yaw_speed', 'down', '')"
>
<img
src="@/assets/images/flightoperation/p-left-active.png"
alt=""
v-if="selectName == '左移'"
/>
<img src="@/assets/images/flightoperation/p-left.png" alt="" v-else />
</div>
</div>
<div class="zoom">
<a-slider
@ -96,6 +132,7 @@
const airPort = airPortStoreVal.getAirport;
const uav = airPortStoreVal.getUAV;
const selectName = ref('');
const userStore = useUserStore();
const userInfo = userStore.getUserInfo;
const redisUser = ref({});
@ -104,6 +141,7 @@
const props = defineProps({
msgData: Object,
cameraType: String,
uavStatus: Number,
});
const monitorDRC = ref(false);
//
@ -135,13 +173,13 @@
style: {
color: '#f50',
},
label: createVNode('strong', {}, '100'),
label: createVNode('strong', {}, '10'),
},
20: {
style: {
color: '#f50',
},
label: createVNode('strong', {}, '200'),
label: createVNode('strong', {}, '20'),
},
});
watch(
@ -207,6 +245,10 @@
createMessage.warning('当前有用户正在操作,请稍后再试');
return;
}
if (!props.uavStatus) {
createMessage.warning('飞行器未开机');
return;
}
if (grabBtn.value) {
createMessage.warning('已经获取了飞行器控制权');
return;
@ -252,12 +294,50 @@
services_replyTopicReize();
};
let timer;
const longPressTimer = ref();
const longPressInterval = ref();
const longPressDuration = ref(1000); //
//
const changeDrc = (type, val) => {
if (!flightGrab.value) {
createMessage.warning('请先获取相机控制权');
return;
const changeDrc = (type, val, name) => {
selectName.value = name;
if (name !== '') {
if (!flightGrab.value) {
createMessage.warning('请先获取相机控制权');
return;
}
let isLongPress = false;
longPressTimer.value = setTimeout(() => {
console.log('长按事件触发!');
isLongPress = true;
longPressInterval.value = setInterval(() => {
let querys = getDRCFlightQuery(type, val);
servicesTopicReize(querys);
createMessage.info(name + '指令已发送');
}, 1000);
}, longPressDuration.value);
if (isLongPress) {
isLongPress = false;
return;
}
//
let querys = getDRCFlightQuery(type, val);
servicesTopicReize(querys);
createMessage.info(name + '指令已发送');
} else {
if (longPressTimer.value) {
clearTimeout(longPressTimer.value);
longPressTimer.value = null;
console.log('清除延时器');
}
if (longPressInterval.value) {
clearTimeout(longPressInterval.value);
longPressInterval.value = null;
console.log('清除定时器');
}
console.log('鼠标松开');
}
};
const getDRCFlightQuery = (type, val) => {
let data = {
payload_index: uav.camera_index,
locked: true,
@ -269,15 +349,15 @@
} else {
data[type] = -8;
}
console.log('data', data);
//
servicesTopicReize({
const querys = {
bid: buildGUID(),
method: 'camera_screen_drag',
tid: buildGUID(),
timestamp: new Date().getTime(),
data: data,
});
};
console.log(querys);
return querys;
};
onMounted(() => {
// mqtt
@ -382,41 +462,45 @@
.direction-controller {
position: relative;
margin-top: 20px;
img {
.controller-bg {
margin-left: 60px;
width: 200px;
}
.direction-controller-top {
width: 50px;
height: 50px;
position: absolute;
top: 20px;
left: 130px;
top: 43px;
left: 120px;
cursor: pointer;
img {
width: 80px;
}
}
.direction-controller-right {
width: 50px;
height: 50px;
position: absolute;
top: 70px;
right: 100px;
top: 60px;
right: 127px;
cursor: pointer;
img {
width: 38px;
}
}
.direction-controller-bottom {
width: 50px;
height: 50px;
position: absolute;
bottom: 20px;
right: 160px;
bottom: 44px;
left: 120px;
cursor: pointer;
img {
width: 80px;
}
}
.direction-controller-left {
width: 50px;
height: 50px;
position: absolute;
top: 80px;
left: 80px;
top: 60px;
left: 103px;
cursor: pointer;
img {
width: 38px;
}
}
}
.zoom {

@ -217,6 +217,9 @@
createMessage.warning('请先选择目标点');
return;
}
data.target_height = Number(data.target_height);
data.target_latitude = Number(data.target_latitude);
data.target_longitude = Number(data.target_longitude);
const querys = {
bid: buildGUID(),
data: data,
@ -238,9 +241,9 @@
onMounted(() => {
//
EventBus.on('obtainTheLocation', (val: any) => {
data.target_latitude = val.lat;
data.target_longitude = val.lng;
data.target_height = val.alt;
data.target_latitude = val.lat.toFixed(6);
data.target_longitude = val.lng.toFixed(6);
data.target_height = val.alt.toFixed(2);
});
});
</script>

@ -121,10 +121,7 @@
>
</div>
<div class="content-button">
<a-button
type="primary"
style="background: #3a57e8; width: 100%"
@click="emits('loadLiveStreaming', uavInformation.sub_device.device_online_status)"
<a-button type="primary" style="background: #3a57e8; width: 100%" @click="liveStreaming"
>负载直播</a-button
>
</div>
@ -132,15 +129,21 @@
</div>
</template>
<script setup lang="ts">
import { reactive, ref, watch } from 'vue';
import { reactive, ref, watch, onMounted } from 'vue';
import { CopyOutlined, EditOutlined } from '@ant-design/icons-vue';
import { timestampToFormattedDate } from '@/utils/index';
import { airPortStore } from '@/store/modules/airport';
import { buildGUID } from '@/utils/uuid';
import { servicesTopic, services_replyTopic, errorName } from '@/utils/debugging/remote';
import { getClient } from '@/utils/mqtt';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
const airPortStoreVal = airPortStore();
const airPort = airPortStoreVal.getAirport;
const uav = airPortStoreVal.getUAV;
const live_info = airPortStoreVal.getLiveInfo;
const liveCode = ref('6');
const emits = defineEmits(['changeLoadControl', 'changeFlightControl', 'loadLiveStreaming']);
const props = defineProps({
msgData: Object,
@ -203,11 +206,49 @@
watch(
() => props.uavTrack,
(val) => {
uavLocation.value.longitude = val.longitude;
uavLocation.value.latitude = val.latitude;
uavLocation.value.height = val.height;
uavLocation.value.longitude = val.longitude.toFixed(6);
uavLocation.value.latitude = val.latitude.toFixed(6);
uavLocation.value.height = val.height.toFixed(2);
},
);
const startTid = buildGUID();
const liveStreaming = () => {
createMessage.info('正在开启负载直播,请稍后');
const querys = {
bid: buildGUID(),
method: 'live_start_push',
tid: startTid,
timestamp: new Date().getTime(),
data: {
url_type: 1, // 0 = RTMP 1GB28181 3WebRTC 4
url: live_info.rtmp + liveCode.value,
video_id: uav.video_id,
video_quality: 3, // 0=1=2=3=4=
},
};
console.log(querys);
servicesTopic(querys);
services_replyTopic();
};
onMounted(() => {
setTimeout(() => {
getClient().on('message', (topic, message) => {
const rs = JSON.parse(message);
if (rs.method == 'live_start_push' && rs.tid == startTid) {
console.log(rs);
if (rs.data.result == 0) {
createMessage.success('无人机开始直播成功');
emits('loadLiveStreaming', uavInformation.value.sub_device.device_online_status);
} else if (rs.data.result == 513003) {
createMessage.success('无人机直播已开启');
emits('loadLiveStreaming', uavInformation.value.sub_device.device_online_status);
} else {
createMessage.error('开始直播失败,' + errorName(rs.data.result));
}
}
});
}, 1000);
});
</script>
<style lang="less" scoped>
.airport-information {

@ -36,6 +36,7 @@
import { buildUUID } from '@/utils/uuid';
import airPoint from './airPoint.vue';
import * as mars3d from 'mars3d';
import { EventBus } from '@/utils/eventBus';
import 'mars3d-space';
@ -257,6 +258,12 @@ const generatePreviewPoint = (placemark)=>{
onMounted(() => {
initMap();
EventBus.on('closeTranslation', (val: any) => {
if (moveTool) {
moveTool.destroy();
moveTool = null;
}
});
});
const initMap = () => {
@ -1561,6 +1568,9 @@ const loadChangGuangLayer = ()=>{
if(!graphicLayer){
return
}
if(props.airPort.longitude == null){
return;
}
let point = graphicLayer.getGraphicById('set-airport');
// //
let position = [props.airPort.longitude, props.airPort.latitude, 70];

Loading…
Cancel
Save