From f43f1d57ed40757864dd429f8df3dae3a0a3a807 Mon Sep 17 00:00:00 2001 From: JayJiaJun Date: Thu, 13 Mar 2025 09:58:38 +0800 Subject: [PATCH] 3.13 --- public/web/js/MQTT_port.js | 2 +- src/assets/js/GamepadController.js | 4 +- src/views/CarControl.vue | 3 +- src/views/gateway/GatewaySetting.vue | 322 ++++++++++++++++++++------- vue.config.js | 3 +- 5 files changed, 250 insertions(+), 84 deletions(-) diff --git a/public/web/js/MQTT_port.js b/public/web/js/MQTT_port.js index 2bd07c2..88a1612 100644 --- a/public/web/js/MQTT_port.js +++ b/public/web/js/MQTT_port.js @@ -6,7 +6,7 @@ * @LastEditors: Andy * @LastEditTime: 2024-03-11 11:07:00 */ -var MQTT_MODE = 1; +var MQTT_MODE = 0; function pageName() { var a = location.href; diff --git a/src/assets/js/GamepadController.js b/src/assets/js/GamepadController.js index 70cf0c0..4de644b 100644 --- a/src/assets/js/GamepadController.js +++ b/src/assets/js/GamepadController.js @@ -112,9 +112,9 @@ class GamepadController { const axis9 = axes[9]; const roundedAxis9 = Math.round(axis9 * 100) / 100; if (roundedAxis9 <= -0.9) { - this.directionAxis9 = 0; - } else if (roundedAxis9 >= 0.0 && roundedAxis9 <= 0.2) { this.directionAxis9 = 1; + } else if (roundedAxis9 >= 0.0 && roundedAxis9 <= 0.2) { + this.directionAxis9 = 2; // } else if (roundedAxis9 >= 0.6 && roundedAxis9 <= 0.8) { // this.directionAxis9 = "左"; // } else if (roundedAxis9 >= -0.5 && roundedAxis9 <= -0.4) { diff --git a/src/views/CarControl.vue b/src/views/CarControl.vue index 8e643f5..35998cc 100644 --- a/src/views/CarControl.vue +++ b/src/views/CarControl.vue @@ -223,7 +223,8 @@ export default { initWebSocket() { try { console.log('正在连接 WebSocket...'); - this.ws = new WebSocket('ws://192.168.4.120/ws'); + // this.ws = new WebSocket('ws://192.168.4.120/ws'); + this.ws = new WebSocket('ws://192.168.1.120/ws'); // this.ws = new WebSocket('ws://192.168.1.60:81'); diff --git a/src/views/gateway/GatewaySetting.vue b/src/views/gateway/GatewaySetting.vue index 44ccd36..c9f7a8a 100644 --- a/src/views/gateway/GatewaySetting.vue +++ b/src/views/gateway/GatewaySetting.vue @@ -1,13 +1,7 @@