分析里目标检测数据来源unity修改

This commit is contained in:
qiudan 2024-02-27 09:37:09 +08:00
parent 65c0f3d47c
commit eea792408a
5 changed files with 142 additions and 131 deletions

View File

@ -209,6 +209,10 @@
// numberNew 判断2-模拟区1-画布区 // numberNew 判断2-模拟区1-画布区
window.parent.getFigure(string, string1, string2, 1); window.parent.getFigure(string, string1, string2, 1);
} }
//获取分析状态
function Status(jsonString) {
window.parent.getStatus(jsonString);
}
//新增图形传图形id //新增图形传图形id
function postFigureId(string) { function postFigureId(string) {
console.log("图形id", string) console.log("图形id", string)

View File

@ -1,9 +1,16 @@
<template> <template>
<div class="statusMain"> <div class="statusMain">
<div> <div>
<!-- <p>节点源</p> --> <!-- <p>节点源</p> -->
<!-- <h3>节点源</h3> --> <!-- <h3>节点源</h3> -->
<el-descriptions title="目标检测" :column="5" border> <el-descriptions title="目标检测" :column="5" border>
<el-descriptions-item label="图片fps">{{ getUnityData.fpsPicture }}</el-descriptions-item>
<el-descriptions-item label="运行时间(s)">{{ getUnityData.time }}</el-descriptions-item>
<el-descriptions-item label="场景FPS">{{ getUnityData.fpsCount }}</el-descriptions-item>
<el-descriptions-item label="数据fps">{{ getUnityData.fpsData }}</el-descriptions-item>
<el-descriptions-item label="当前处理帧编号">{{ getUnityData.frameNum }}</el-descriptions-item>
</el-descriptions>
<!-- <el-descriptions title="目标检测" :column="5" border>
<el-descriptions-item label="视频地址"> <el-descriptions-item label="视频地址">
{{ form.target_detection.video_address }}</el-descriptions-item {{ form.target_detection.video_address }}</el-descriptions-item
> >
@ -31,9 +38,9 @@
<el-descriptions-item label="最后一帧分析时间">{{ <el-descriptions-item label="最后一帧分析时间">{{
form.target_detection.last_frame_analysis_time form.target_detection.last_frame_analysis_time
}}</el-descriptions-item> }}</el-descriptions-item>
</el-descriptions> </el-descriptions> -->
<el-descriptions title="交通分析" :column="5" border> <!-- <el-descriptions title="交通分析" :column="5" border>
<el-descriptions-item label="分析帧速率"> <el-descriptions-item label="分析帧速率">
{{ form.traffic_analysis.analyze_frame_rate }}</el-descriptions-item {{ form.traffic_analysis.analyze_frame_rate }}</el-descriptions-item
> >
@ -46,149 +53,149 @@
<el-descriptions-item label="最后一帧分析时间">{{ <el-descriptions-item label="最后一帧分析时间">{{
form.traffic_analysis.last_frame_analysis_time form.traffic_analysis.last_frame_analysis_time
}}</el-descriptions-item> }}</el-descriptions-item>
</el-descriptions> </el-descriptions> -->
<el-descriptions title="数据同步" :column="5" border> <el-descriptions title="数据同步" :column="5" border>
<el-descriptions-item label="上次同步时间"> <el-descriptions-item label="上次同步时间"> {{ form.data_sync.lastSyncTime }}</el-descriptions-item>
{{ form.data_sync.lastSyncTime }}</el-descriptions-item <el-descriptions-item label="本次同步时间">{{ form.data_sync.currentSyncStatus }}</el-descriptions-item>
> <el-descriptions-item label="下次同步时间">{{ form.data_sync.nextSyncTime }}</el-descriptions-item>
<el-descriptions-item label="本次同步时间">{{ </el-descriptions>
form.data_sync.currentSyncStatus
}}</el-descriptions-item>
<el-descriptions-item label="下次同步时间">{{
form.data_sync.nextSyncTime
}}</el-descriptions-item>
</el-descriptions>
<!-- <el-button @click="showUpdateCertificate = true" type="primary" style="margin-top:15px">更新证书</el-button> --> <!-- <el-button @click="showUpdateCertificate = true" type="primary" style="margin-top:15px">更新证书</el-button> -->
<el-dialog title="提示" :visible.sync="showUpdateCertificate" width="30%"> <el-dialog title="提示" :visible.sync="showUpdateCertificate" width="30%">
<el-row> <el-row>
<el-col :span="6"> 文件选择 </el-col> <el-col :span="6"> 文件选择 </el-col>
<el-col :span="18"> <el-col :span="18">
<el-upload action="https://jsonplaceholder.typicode.com/posts/"> <el-upload action="https://jsonplaceholder.typicode.com/posts/">
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
</el-col> </el-col>
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="showUpdateCertificate = false" <el-button type="primary" @click="showUpdateCertificate = false"> </el-button>
> </el-button </span>
> </el-dialog>
</span> </div>
</el-dialog>
</div> </div>
</div>
</template> </template>
<script> <script>
import { getAnalysisStatus } from "../../api/index"; import { getAnalysisStatus } from '../../api/index';
export default { export default {
props: { props: {
trafficAnalysisStatusData: { trafficAnalysisStatusData: {
type: Object, type: Object,
default: {}, default: {}
},
targetAnalysisStatusData: {
type: Object,
default: {},
},
},
data() {
return {
form: {
target_detection: {
video_id: "",
video_address: "",
encoding_format: "",
code_tate: "",
frame_rate: "",
resolution_ratio: "",
neural_network: "",
decoder_frame_rate: "",
detector_frame_rate: "",
last_frame_analysis_time: "",
}, },
traffic_analysis: { targetAnalysisStatusData: {
video_id: "", type: Object,
analyze_frame_rate: "", default: {}
cache_capacity: "",
cache_records_number: "",
last_frame_analysis_time: "",
},
data_sync: {
lastSyncTime: "",
currentSyncStatus: "",
nextSyncTime: "",
},
},
showUpdateCertificate: false,
};
},
created() {},
mounted() {
this.getData();
// 1
const now = new Date();
const oneAMTomorrow = new Date(now);
oneAMTomorrow.setDate(oneAMTomorrow.getDate() + 1);
oneAMTomorrow.setHours(1, 0, 0, 0);
const timeUntilOneAMTomorrow = oneAMTomorrow - now;
setTimeout(() => {
this.getData(); //
setInterval(() => {
this.getData(); // 24
}, 24 * 60 * 60 * 1000);
}, timeUntilOneAMTomorrow);
},
methods: {
//
getData() {
let videoId = this.$route.query.id;
getAnalysisStatus(videoId).then((res) => {
if (res.data.code == 200) {
// this.form = res.data.data;
if (res.data.data.target_detection !=null) {
this.form.target_detection = res.data.data.target_detection
}
if (res.data.data.traffic_analysis !=null) {
this.form.traffic_analysis = res.data.data.traffic_analysis
}
if (res.data.data.data_sync !=null) {
this.form.data_sync = res.data.data.data_sync
}
} }
});
}, },
}, data() {
watch: { return {
trafficAnalysisStatusData: { form: {
// target_detection: {
handler: function (val) { video_id: '',
console.log(val, "交通分析数据"); video_address: '',
this.form.traffic_analysis = val encoding_format: '',
}, code_tate: '',
frame_rate: '',
resolution_ratio: '',
neural_network: '',
decoder_frame_rate: '',
detector_frame_rate: '',
last_frame_analysis_time: ''
},
traffic_analysis: {
video_id: '',
analyze_frame_rate: '',
cache_capacity: '',
cache_records_number: '',
last_frame_analysis_time: ''
},
data_sync: {
lastSyncTime: '',
currentSyncStatus: '',
nextSyncTime: ''
}
},
showUpdateCertificate: false,
getUnityData: {}
};
}, },
targetAnalysisStatusData: { created() {
// window.getStatus = this.getStatusFun;
handler: function (val) {
console.log(val, "目标监测数据");
this.form.target_detection = val
},
}, },
}, mounted() {
this.getData();
// 1
const now = new Date();
const oneAMTomorrow = new Date(now);
oneAMTomorrow.setDate(oneAMTomorrow.getDate() + 1);
oneAMTomorrow.setHours(1, 0, 0, 0);
const timeUntilOneAMTomorrow = oneAMTomorrow - now;
setTimeout(() => {
this.getData(); //
setInterval(() => {
this.getData(); // 24
}, 24 * 60 * 60 * 1000);
}, timeUntilOneAMTomorrow);
},
methods: {
//unity
getStatusFun(jsonString) {
// console.log('jsonString', jsonString);
this.getUnityData = JSON.parse(jsonString);
},
//
getData() {
let videoId = this.$route.query.id;
getAnalysisStatus(videoId).then((res) => {
if (res.data.code == 200) {
// this.form = res.data.data;
if (res.data.data.target_detection != null) {
this.form.target_detection = res.data.data.target_detection;
}
if (res.data.data.traffic_analysis != null) {
this.form.traffic_analysis = res.data.data.traffic_analysis;
}
if (res.data.data.data_sync != null) {
this.form.data_sync = res.data.data.data_sync;
}
}
});
}
},
watch: {
trafficAnalysisStatusData: {
//
handler: function (val) {
console.log(val, '交通分析数据');
this.form.traffic_analysis = val;
}
},
targetAnalysisStatusData: {
//
handler: function (val) {
console.log(val, '目标监测数据');
this.form.target_detection = val;
}
}
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.statusMain { .statusMain {
width: 100%; width: 100%;
height: 100%; height: 100%;
.el-descriptions { .el-descriptions {
margin-top: 15px !important; margin-top: 15px !important;
} }
} }
// .test-div i { // .test-div i {
// font-size: 25px; // font-size: 25px;