|
|
|
@ -21,7 +21,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="left">
|
|
|
|
|
<Ruler/>
|
|
|
|
|
<Ruler :box-pos="locationData"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<div v-if="itemsId === 1" class="tabsItem">
|
|
|
|
@ -305,6 +305,83 @@
|
|
|
|
|
import Ruler from "@/components/ruler.vue";
|
|
|
|
|
import {ref} from "vue";
|
|
|
|
|
|
|
|
|
|
const socketData = [
|
|
|
|
|
{
|
|
|
|
|
"TimeQuality": 19124,
|
|
|
|
|
"GpsWeek": 2378,
|
|
|
|
|
"GpsSeconds": 443388.33,
|
|
|
|
|
"Latitude": 28.24388795549,
|
|
|
|
|
"Longitude": 113.00382002762,
|
|
|
|
|
"EllipsoidHeight": 14.6323,
|
|
|
|
|
"VelocityNorth": -0.1931,
|
|
|
|
|
"VelocityEast": 3.2447,
|
|
|
|
|
"ActualSpeed": 11.701587,
|
|
|
|
|
"RollAngle": 1.047412,
|
|
|
|
|
"HeadingAngle": 92.054855,
|
|
|
|
|
"IncludedAngle": 0.0,
|
|
|
|
|
"SolutionStatus": "",
|
|
|
|
|
"Fps": 3.485E-42,
|
|
|
|
|
"FpsNum": 0.0,
|
|
|
|
|
"MotorPitchAngle": 0.0,
|
|
|
|
|
"MotorAzimuthAngle": 0.0,
|
|
|
|
|
"ty": 3
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"radar_type": 0,
|
|
|
|
|
"radar_ver": "0.1.1",
|
|
|
|
|
"arm_ver": "0.0.0",
|
|
|
|
|
"al_ver": "0.0.0",
|
|
|
|
|
"pwc_ver": "0.0.0",
|
|
|
|
|
"cd_ver": "0.0.0",
|
|
|
|
|
"v1": 0,
|
|
|
|
|
"v2": 0,
|
|
|
|
|
"v3": 0,
|
|
|
|
|
"v4": 0,
|
|
|
|
|
"radar_total_vol": 23.5,
|
|
|
|
|
"radar_total_cur": 0.0,
|
|
|
|
|
"nx_vol": 0.0,
|
|
|
|
|
"nx_cur": 0.0,
|
|
|
|
|
"nx_temp": 25.0,
|
|
|
|
|
"arm_vol": 23.5,
|
|
|
|
|
"arm_cur": 0.0,
|
|
|
|
|
"arm_temp": 25.0,
|
|
|
|
|
"ant_vol": 23.5,
|
|
|
|
|
"ant_cur": 0.0,
|
|
|
|
|
"ant_temp": 0.0,
|
|
|
|
|
"at_work_area_status": 0,
|
|
|
|
|
"pwb_err_code": 0,
|
|
|
|
|
"pwa_err_code": 0,
|
|
|
|
|
"al_err_code": 0,
|
|
|
|
|
"arm_err_code": 0,
|
|
|
|
|
"radar_err_code": 0,
|
|
|
|
|
"radar_work_state": 0,
|
|
|
|
|
"ty": 1
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"Seq": 3.0,
|
|
|
|
|
"MD5": null,
|
|
|
|
|
"TimeStamp": 5.644776E+24,
|
|
|
|
|
"MissionID": 5.644776E+24,
|
|
|
|
|
"RngRes": 0.075,
|
|
|
|
|
"RngNum": 0.0,
|
|
|
|
|
"RngMin": 15.0,
|
|
|
|
|
"AziRes": 0.1,
|
|
|
|
|
"AziNum": 0.0,
|
|
|
|
|
"AziMin": 600.0,
|
|
|
|
|
"DataType": 2.8E-44,
|
|
|
|
|
"LonMin": 112.99582,
|
|
|
|
|
"LatMin": 28.242912,
|
|
|
|
|
"TarNum": 6E-45,
|
|
|
|
|
"ty": 4
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
let area = {
|
|
|
|
|
"LatMin": 36.830189,
|
|
|
|
|
"LatMax": 36.884255,
|
|
|
|
|
"LonMin": 117.210504,
|
|
|
|
|
"LonMax": 117.221718,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const list = ref([
|
|
|
|
|
{
|
|
|
|
|
value1: '点位1',
|
|
|
|
@ -363,6 +440,58 @@ const date1 = ref([])
|
|
|
|
|
const setItemsId = (e) => {
|
|
|
|
|
itemsId.value = e
|
|
|
|
|
}
|
|
|
|
|
const locationData = ref({})
|
|
|
|
|
const processData = (data) => {
|
|
|
|
|
if (data.ty === 1) {
|
|
|
|
|
}
|
|
|
|
|
if (data.ty === 2) {
|
|
|
|
|
}
|
|
|
|
|
if (data.ty === 3) {
|
|
|
|
|
console.log(data.Longitude > area.LonMin, data.Longitude < area.LonMax, data.Latitude > area.LatMin, data.Latitude < area.LatMax)
|
|
|
|
|
if (data.Longitude > area.LonMin && data.Longitude < area.LonMax && data.Latitude > area.LatMin && data.Latitude < area.LatMax) {
|
|
|
|
|
let location = {
|
|
|
|
|
x: 300 - (area.LonMax - data.Longitude) / ((area.LonMax - area.LonMin) / 300),
|
|
|
|
|
y: 1800 - (area.LatMax - data.Latitude) / ((area.LatMax - area.LatMin) / 1800),
|
|
|
|
|
rotate: data.HeadingAngle
|
|
|
|
|
// rotate: 0
|
|
|
|
|
}
|
|
|
|
|
console.log(location)
|
|
|
|
|
locationData.value = location
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (data.ty === 4) {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
processData(socketData[0])
|
|
|
|
|
|
|
|
|
|
const ad = () => {
|
|
|
|
|
|
|
|
|
|
// 1. 创建 WebSocket 连接(ws:// 或 wss://)
|
|
|
|
|
const socket = new WebSocket("ws://192.168.0.11:7789/ws");
|
|
|
|
|
|
|
|
|
|
// 2. 连接成功时触发
|
|
|
|
|
socket.addEventListener("open", () => {
|
|
|
|
|
console.log("✅ WebSocket 连接成功");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 3. 接收消息
|
|
|
|
|
socket.addEventListener("message", (event) => {
|
|
|
|
|
console.log("📩 收到消息:", event.data);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 4. 连接关闭时触发
|
|
|
|
|
socket.addEventListener("close", () => {
|
|
|
|
|
console.log("❌ WebSocket 已关闭");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 5. 出错时触发
|
|
|
|
|
socket.addEventListener("error", (error) => {
|
|
|
|
|
console.error("⚠️ WebSocket 出错:", error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.app-container {
|
|
|
|
|