Compare commits

...

2 Commits

@ -109,7 +109,7 @@
import { buildGUID } from '@/utils/uuid'; import { buildGUID } from '@/utils/uuid';
import { vDrag } from '@/utils/drag'; import { vDrag } from '@/utils/drag';
import { EventBus } from '@/utils/eventBus'; import { EventBus } from '@/utils/eventBus';
import { drcUpTopic, setTopic } from '@/utils/debugging/remote'; import { drcUpTopic, setTopic, eventsTopicSubscribe } from '@/utils/debugging/remote';
import { airPortStore } from '@/store/modules/airport'; import { airPortStore } from '@/store/modules/airport';
import { AlertOutlined, RadarChartOutlined } from '@ant-design/icons-vue'; import { AlertOutlined, RadarChartOutlined } from '@ant-design/icons-vue';
import { endHandFlyTask } from '@/api/workmanagement/droneDock'; import { endHandFlyTask } from '@/api/workmanagement/droneDock';
@ -156,6 +156,7 @@
socket.disconnect(); socket.disconnect();
} }
airPortStoreVal.setTaskId(null); airPortStoreVal.setTaskId(null);
stopPatrolVisible.value = false;
} }
}); });
} else { } else {
@ -175,8 +176,8 @@
patrolVisible.value = false; patrolVisible.value = false;
}; };
onMounted(() => { onMounted(() => {
// socket = io('http://192.168.10.131:9025'); socket = io('http://192.168.10.131:9025');
socket = io('http://123.132.248.154:9309'); // socket = io('http://123.132.248.154:9309');
destroyConnection(); destroyConnection();
createConnection(connectCallback); createConnection(connectCallback);
setTimeout(() => { setTimeout(() => {
@ -314,6 +315,7 @@
const topicUAVUrl = 'thing/product/' + UAVinfo.sn + '/osd'; const topicUAVUrl = 'thing/product/' + UAVinfo.sn + '/osd';
// //
clientSubscribe(topicUAVUrl, { qos: 1 }); clientSubscribe(topicUAVUrl, { qos: 1 });
eventsTopicSubscribe();
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

@ -558,8 +558,8 @@
} }
}; };
onMounted(() => { onMounted(() => {
// socket = io('http://192.168.10.131:9025'); socket = io('http://192.168.10.131:9025');
socket = io('http://123.132.248.154:9309'); // socket = io('http://123.132.248.154:9309');
// //
document.addEventListener('keydown', handleKeyDown); document.addEventListener('keydown', handleKeyDown);
document.addEventListener('keyup', handleKeyUp); document.addEventListener('keyup', handleKeyUp);

@ -25,14 +25,10 @@
</div> </div>
<div class="inspection-content"> <div class="inspection-content">
<div class="inspection-content-left"> <div class="inspection-content-left">
<StatisticsComponent <StatisticsComponent :statisData="socketData" />
:statisData="socketData && socketData.detections ? socketData.detections : []"
/>
</div> </div>
<div class="inspection-content-right"> <div class="inspection-content-right">
<VideoStreamComponent <VideoStreamComponent :statisData="socketData" />
:statisData="socketData && socketData.detections ? socketData.detections : []"
/>
</div> </div>
</div> </div>
</div> </div>
@ -54,8 +50,8 @@
function connectWebSocket() { function connectWebSocket() {
console.log('connectWebSocket'); console.log('connectWebSocket');
// Socket // Socket
// socket = io('http://192.168.10.131:9025'); socket = io('http://192.168.10.131:9025');
socket = io('http://123.132.248.154:9309'); // socket = io('http://123.132.248.154:9309');
// //
socket.on('connect', () => { socket.on('connect', () => {

@ -20,20 +20,24 @@
const airPortStoreVal = airPortStore(); const airPortStoreVal = airPortStore();
const UAVinfo = airPortStoreVal.getUAV; const UAVinfo = airPortStoreVal.getUAV;
const chartData = ref([]); const chartData = ref([]);
const dateData = ref([]);
const props = defineProps({ const props = defineProps({
statisData: { statisData: {
type: Array, type: Object,
default: () => [], default: () => {},
}, },
}); });
watch( watch(
() => props.statisData, () => props.statisData,
(val) => { (val) => {
if (val.length > 0) { console.log('props.statisData', val);
if (val.detections) {
if (chartData.value.length >= 20) { if (chartData.value.length >= 20) {
chartData.value.shift(); chartData.value.shift();
dateData.value.shift();
} }
chartData.value.push(val.length); chartData.value.push(val.detections.length);
dateData.value.push(val.time_str);
updateChart(); updateChart();
} }
}, },
@ -43,10 +47,6 @@
var chartDom = document.getElementById('main'); var chartDom = document.getElementById('main');
myChart = echarts.init(chartDom); myChart = echarts.init(chartDom);
var option; var option;
let date = [];
for (let i = 1; i < 20; i++) {
date.push(i);
}
option = { option = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
@ -73,7 +73,7 @@
xAxis: { xAxis: {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
data: date, data: [],
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
@ -109,8 +109,10 @@
}; };
// //
function updateChart() { function updateChart() {
console.log(chartData.value);
myChart.setOption({ myChart.setOption({
xAxis: {
data: dateData.value,
},
series: [ series: [
{ {
data: chartData.value, data: chartData.value,

Loading…
Cancel
Save