|
|
@@ -434,17 +434,17 @@ export default {
|
|
|
// url = "ws://10.121.128.117:8431/ws/DHSM";
|
|
|
// }
|
|
|
|
|
|
- webSocketService.connect({
|
|
|
- url: `ws/${this.getWsUrl(stationName)}`,
|
|
|
- autoReconnect: true,
|
|
|
- maxReconnectAttempts: 5,
|
|
|
- reconnectInterval: 3000,
|
|
|
- onOpen: (event) => {
|
|
|
- console.log("✅ WebSocket 连接成功", event);
|
|
|
- },
|
|
|
- onError: (error) => {
|
|
|
- console.log("❌ WebSocket 错误:", error);
|
|
|
- // return
|
|
|
+ // webSocketService.connect({
|
|
|
+ // url: `ws/${this.getWsUrl(stationName)}`,
|
|
|
+ // autoReconnect: true,
|
|
|
+ // maxReconnectAttempts: 5,
|
|
|
+ // reconnectInterval: 3000,
|
|
|
+ // onOpen: (event) => {
|
|
|
+ // console.log("✅ WebSocket 连接成功", event);
|
|
|
+ // },
|
|
|
+ // onError: (error) => {
|
|
|
+ // console.log("❌ WebSocket 错误:", error);
|
|
|
+ // return
|
|
|
if (stationName === "MYFDC") {
|
|
|
fjLonLatJson = JSON.parse(JSON.stringify(fjMYLonLatJson));
|
|
|
} else if (stationName === "JNWHZ") {
|
|
|
@@ -458,7 +458,7 @@ export default {
|
|
|
let wtArray = JSON.parse(JSON.stringify(wsRes.windMachineList));
|
|
|
this.isFakeData = true;
|
|
|
|
|
|
- this.fakeDataTimmer = setInterval(() => {
|
|
|
+ // this.fakeDataTimmer = setInterval(() => {
|
|
|
fjLonLatJson.data.forEach((e) => {
|
|
|
let fjItem =
|
|
|
wtArray.find((findEle) => {
|
|
|
@@ -489,53 +489,53 @@ export default {
|
|
|
});
|
|
|
|
|
|
this.fjLonLatJsonArr = fjLonLatJson;
|
|
|
- }, 1000);
|
|
|
- },
|
|
|
- });
|
|
|
-
|
|
|
- webSocketService.on("message", (res) => {
|
|
|
- if (stationName === "MYFDC") {
|
|
|
- fjLonLatJson = JSON.parse(JSON.stringify(fjMYLonLatJson));
|
|
|
- } else if (stationName === "JNWHZ") {
|
|
|
- fjLonLatJson = JSON.parse(JSON.stringify(fjWHZLonLatJson));
|
|
|
- } else if (stationName === "JNYPL") {
|
|
|
- fjLonLatJson = JSON.parse(JSON.stringify(fjYPLLonLatJson));
|
|
|
- } else if (stationName === "JNSMS") {
|
|
|
- fjLonLatJson = JSON.parse(JSON.stringify(fjSMSLonLatJson));
|
|
|
- }
|
|
|
-
|
|
|
- let wtArray = JSON.parse(JSON.stringify(res.windMachineList));
|
|
|
- fjLonLatJson.data.forEach((e) => {
|
|
|
- let fjItem =
|
|
|
- wtArray.find((findEle) => {
|
|
|
- return findEle.fjbh === e.fjbh;
|
|
|
- }) || {};
|
|
|
- const fjMix = Object.assign({}, e, fjItem);
|
|
|
- fjMix.status = this.getStatus(fjMix.fjzt);
|
|
|
- e = fjMix;
|
|
|
- if (e.status) {
|
|
|
- if (e.status === 1) {
|
|
|
- this.showStatuswind(viewer, e, dj);
|
|
|
- } else if (e.status === 2) {
|
|
|
- this.showStatuswind(viewer, e, gz);
|
|
|
- } else if (e.status === 3) {
|
|
|
- this.showStatuswind(viewer, e, jx);
|
|
|
- } else if (e.status === 4) {
|
|
|
- this.showStatuswind(viewer, e, xd);
|
|
|
- } else if (e.status === 5) {
|
|
|
- this.showStatuswind(viewer, e, lx);
|
|
|
- } else if (e.status === 6) {
|
|
|
- this.showStatuswind(viewer, e, sl);
|
|
|
- } else {
|
|
|
- //并网风机
|
|
|
- this.showAnimatewind(viewer, e);
|
|
|
- }
|
|
|
- }
|
|
|
- this.changeZb(fjMix);
|
|
|
- });
|
|
|
-
|
|
|
- this.fjLonLatJsonArr = fjLonLatJson;
|
|
|
- });
|
|
|
+ // }, 1000);
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+
|
|
|
+ // webSocketService.on("message", (res) => {
|
|
|
+ // if (stationName === "MYFDC") {
|
|
|
+ // fjLonLatJson = JSON.parse(JSON.stringify(fjMYLonLatJson));
|
|
|
+ // } else if (stationName === "JNWHZ") {
|
|
|
+ // fjLonLatJson = JSON.parse(JSON.stringify(fjWHZLonLatJson));
|
|
|
+ // } else if (stationName === "JNYPL") {
|
|
|
+ // fjLonLatJson = JSON.parse(JSON.stringify(fjYPLLonLatJson));
|
|
|
+ // } else if (stationName === "JNSMS") {
|
|
|
+ // fjLonLatJson = JSON.parse(JSON.stringify(fjSMSLonLatJson));
|
|
|
+ // }
|
|
|
+
|
|
|
+ // let wtArray = JSON.parse(JSON.stringify(res.windMachineList));
|
|
|
+ // fjLonLatJson.data.forEach((e) => {
|
|
|
+ // let fjItem =
|
|
|
+ // wtArray.find((findEle) => {
|
|
|
+ // return findEle.fjbh === e.fjbh;
|
|
|
+ // }) || {};
|
|
|
+ // const fjMix = Object.assign({}, e, fjItem);
|
|
|
+ // fjMix.status = this.getStatus(fjMix.fjzt);
|
|
|
+ // e = fjMix;
|
|
|
+ // if (e.status) {
|
|
|
+ // if (e.status === 1) {
|
|
|
+ // this.showStatuswind(viewer, e, dj);
|
|
|
+ // } else if (e.status === 2) {
|
|
|
+ // this.showStatuswind(viewer, e, gz);
|
|
|
+ // } else if (e.status === 3) {
|
|
|
+ // this.showStatuswind(viewer, e, jx);
|
|
|
+ // } else if (e.status === 4) {
|
|
|
+ // this.showStatuswind(viewer, e, xd);
|
|
|
+ // } else if (e.status === 5) {
|
|
|
+ // this.showStatuswind(viewer, e, lx);
|
|
|
+ // } else if (e.status === 6) {
|
|
|
+ // this.showStatuswind(viewer, e, sl);
|
|
|
+ // } else {
|
|
|
+ // //并网风机
|
|
|
+ // this.showAnimatewind(viewer, e);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.changeZb(fjMix);
|
|
|
+ // });
|
|
|
+
|
|
|
+ // this.fjLonLatJsonArr = fjLonLatJson;
|
|
|
+ // });
|
|
|
|
|
|
// const ws = useWebSocket(url);
|
|
|
// let wtArray = ws.messages.windMachineList;
|
|
|
@@ -828,7 +828,8 @@ export default {
|
|
|
const glZb = this.viewer.entities.add({
|
|
|
position,
|
|
|
label: {
|
|
|
- text: `功率: ${glText} MW/n风速: ${fsText}/n转速: ${zsText}`,
|
|
|
+ // text: `功率: ${glText} MW/n风速: ${fsText}/n转速: ${zsText}`,
|
|
|
+ text: `功率: ${glText} MW`,
|
|
|
font: "14pt sans-serif",
|
|
|
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
|
|
outlineWidth: 2,
|
|
|
@@ -854,68 +855,68 @@ export default {
|
|
|
|
|
|
glZb.zb = "glText";
|
|
|
|
|
|
- // const fsZb = this.viewer.entities.add({
|
|
|
- // position,
|
|
|
- // label: {
|
|
|
- // text: `风速: ${fsText}`,
|
|
|
- // font: "14pt sans-serif",
|
|
|
- // style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
|
|
- // outlineWidth: 2,
|
|
|
- // verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
- // showBackground: false, // 显示背景
|
|
|
- // backgroundColor: new Cesium.Color.fromCssColorString(
|
|
|
- // "rgba(13, 38, 77, 0.5)"
|
|
|
- // ), // 背景颜色
|
|
|
- // backgroundPadding: new Cesium.Cartesian2(10, 10), // 背景内边距
|
|
|
- // verticalOrigin: Cesium.VerticalOrigin.CENTER, // 垂直对齐方式
|
|
|
- // horizontalOrigin: Cesium.HorizontalOrigin.LEFT, // 水平对齐方式
|
|
|
- // pixelOffset: new Cesium.Cartesian2(80, -20), // 原来是-20,现在改为30,向上移动
|
|
|
- // eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
|
|
|
- // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
|
- // scaleByDistance: new Cesium.NearFarScalar(
|
|
|
- // 6000, // 6000米内
|
|
|
- // 1,
|
|
|
- // 9000, // 9000米外
|
|
|
- // 0.8
|
|
|
- // ),
|
|
|
- // },
|
|
|
- // });
|
|
|
+ const fsZb = this.viewer.entities.add({
|
|
|
+ position,
|
|
|
+ label: {
|
|
|
+ text: `风速: ${fsText}`,
|
|
|
+ font: "14pt sans-serif",
|
|
|
+ style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
|
|
+ outlineWidth: 2,
|
|
|
+ verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
+ showBackground: false, // 显示背景
|
|
|
+ backgroundColor: new Cesium.Color.fromCssColorString(
|
|
|
+ "rgba(13, 38, 77, 0.5)"
|
|
|
+ ), // 背景颜色
|
|
|
+ backgroundPadding: new Cesium.Cartesian2(10, 10), // 背景内边距
|
|
|
+ verticalOrigin: Cesium.VerticalOrigin.CENTER, // 垂直对齐方式
|
|
|
+ horizontalOrigin: Cesium.HorizontalOrigin.LEFT, // 水平对齐方式
|
|
|
+ pixelOffset: new Cesium.Cartesian2(80, -20), // 原来是-20,现在改为30,向上移动
|
|
|
+ eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
|
|
|
+ heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
|
+ scaleByDistance: new Cesium.NearFarScalar(
|
|
|
+ 6000, // 6000米内
|
|
|
+ 1,
|
|
|
+ 9000, // 9000米外
|
|
|
+ 0.8
|
|
|
+ ),
|
|
|
+ },
|
|
|
+ });
|
|
|
|
|
|
- // fsZb.zb = "fsText";
|
|
|
+ fsZb.zb = "fsText";
|
|
|
|
|
|
- // const zsZb = this.viewer.entities.add({
|
|
|
- // position,
|
|
|
- // label: {
|
|
|
- // text: `转速: ${zsText}`,
|
|
|
- // font: "14pt sans-serif",
|
|
|
- // style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
|
|
- // outlineWidth: 2,
|
|
|
- // verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
- // showBackground: false, // 显示背景
|
|
|
- // backgroundColor: new Cesium.Color.fromCssColorString(
|
|
|
- // "rgba(13, 38, 77, 0.5)"
|
|
|
- // ), // 背景颜色
|
|
|
- // backgroundPadding: new Cesium.Cartesian2(10, 10), // 背景内边距
|
|
|
- // verticalOrigin: Cesium.VerticalOrigin.CENTER, // 垂直对齐方式
|
|
|
- // horizontalOrigin: Cesium.HorizontalOrigin.LEFT, // 水平对齐方式
|
|
|
- // pixelOffset: new Cesium.Cartesian2(80, 0), // 原来是-20,现在改为30,向上移动
|
|
|
- // eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
|
|
|
- // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
|
- // scaleByDistance: new Cesium.NearFarScalar(
|
|
|
- // 6000, // 6000米内
|
|
|
- // 1,
|
|
|
- // 9000, // 9000米外
|
|
|
- // 0.8
|
|
|
- // ),
|
|
|
- // },
|
|
|
- // });
|
|
|
+ const zsZb = this.viewer.entities.add({
|
|
|
+ position,
|
|
|
+ label: {
|
|
|
+ text: `转速: ${zsText}`,
|
|
|
+ font: "14pt sans-serif",
|
|
|
+ style: Cesium.LabelStyle.FILL_AND_OUTLINE,
|
|
|
+ outlineWidth: 2,
|
|
|
+ verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
+ showBackground: false, // 显示背景
|
|
|
+ backgroundColor: new Cesium.Color.fromCssColorString(
|
|
|
+ "rgba(13, 38, 77, 0.5)"
|
|
|
+ ), // 背景颜色
|
|
|
+ backgroundPadding: new Cesium.Cartesian2(10, 10), // 背景内边距
|
|
|
+ verticalOrigin: Cesium.VerticalOrigin.CENTER, // 垂直对齐方式
|
|
|
+ horizontalOrigin: Cesium.HorizontalOrigin.LEFT, // 水平对齐方式
|
|
|
+ pixelOffset: new Cesium.Cartesian2(80, 0), // 原来是-20,现在改为30,向上移动
|
|
|
+ eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
|
|
|
+ heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
|
|
+ scaleByDistance: new Cesium.NearFarScalar(
|
|
|
+ 6000, // 6000米内
|
|
|
+ 1,
|
|
|
+ 9000, // 9000米外
|
|
|
+ 0.8
|
|
|
+ ),
|
|
|
+ },
|
|
|
+ });
|
|
|
|
|
|
- // zsZb.zb = "zsText";
|
|
|
+ zsZb.zb = "zsText";
|
|
|
|
|
|
this.zbLabelList.push({
|
|
|
fjbh: model.fjbh,
|
|
|
- // zb: [wtName, glZb, fsZb, zsZb],
|
|
|
- zb: [wtName, glZb],
|
|
|
+ zb: [wtName, glZb, fsZb, zsZb],
|
|
|
+ // zb: [wtName, glZb],
|
|
|
});
|
|
|
}
|
|
|
},
|