From f4a2ce6f608049dc11f00908ee8a829060882de3 Mon Sep 17 00:00:00 2001
From: 张世豪 <979909237@qq.com>
Date: 星期四, 25 十二月 2025 16:38:32 +0800
Subject: [PATCH] 优化了部分内容
---
src/Mqttmessage/Entity/GPSData.java | 358 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 341 insertions(+), 17 deletions(-)
diff --git a/src/Mqttmessage/Entity/GPSData.java b/src/Mqttmessage/Entity/GPSData.java
index 0b8882f..7d30110 100644
--- a/src/Mqttmessage/Entity/GPSData.java
+++ b/src/Mqttmessage/Entity/GPSData.java
@@ -1,13 +1,5 @@
package Mqttmessage.Entity;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
public class GPSData{
// JSON涓殑鍘熷瀛楁
private String msg_id; // 娑堟伅鍞竴鏍囪瘑
@@ -26,6 +18,27 @@
private GGAData ggaData;
/**
+ * 榛樿鏋勯�犲嚱鏁�
+ */
+ public GPSData() {
+ }
+
+ /**
+ * 鍏ㄥ弬鏋勯�犲嚱鏁�
+ */
+ public GPSData(String msg_id, Long timestamp, String device_id, String data_type,
+ String gps_raw, IMUData imu_data, StatusInfo status, GGAData ggaData) {
+ this.msg_id = msg_id;
+ this.timestamp = timestamp;
+ this.device_id = device_id;
+ this.data_type = data_type;
+ this.gps_raw = gps_raw;
+ this.imu_data = imu_data;
+ this.status = status;
+ this.ggaData = ggaData;
+ }
+
+ /**
* 鑾峰彇鍘熷GPS鏁版嵁
* @return 鍘熷GPS鏁版嵁瀛楃涓�
*/
@@ -43,20 +56,26 @@
+
+
/**
* IMU鏁版嵁鍐呴儴绫伙紙绠�鍖栫増锛屽彧鍖呭惈瑙掑害淇℃伅锛�
*/
- @Data
- @NoArgsConstructor
public static class IMUData {
private Double roll; // 妯粴瑙� 瑙掑害
private Double pitch; // 淇话瑙� 瑙掑害
private Double yaw; // 鍋忚埅瑙� 瑙掑害
/**
- * 甯﹀弬鏁扮殑鏋勯�犲嚱鏁�
+ * 榛樿鏋勯�犲嚱鏁�
+ */
+ public IMUData() {
+ }
+
+ /**
+ * 鍏ㄥ弬鏋勯�犲嚱鏁�
* @param roll 妯粴瑙� 瑙掑害
* @param pitch 淇话瑙� 瑙掑害
* @param yaw 鍋忚埅瑙� 瑙掑害
@@ -66,13 +85,35 @@
this.pitch = pitch;
this.yaw = yaw;
}
+
+ public Double getRoll() {
+ return roll;
+ }
+
+ public void setRoll(Double roll) {
+ this.roll = roll;
+ }
+
+ public Double getPitch() {
+ return pitch;
+ }
+
+ public void setPitch(Double pitch) {
+ this.pitch = pitch;
+ }
+
+ public Double getYaw() {
+ return yaw;
+ }
+
+ public void setYaw(Double yaw) {
+ this.yaw = yaw;
+ }
}
/**
* 鐘舵�佷俊鎭唴閮ㄧ被锛堜笌StatusData涓殑StatusInfo淇濇寔涓�鑷达級
*/
- @Data
- @NoArgsConstructor
public static class StatusInfo {
private Integer battery_level; // 鐢垫睜鐢甸噺鐧惧垎姣�
private Double battery_voltage; // 鐢垫睜鐢靛帇
@@ -83,6 +124,13 @@
private Integer self_check_status; // 鑷鐘舵�侊細1-瀹屾垚锛�0-鏈畬鎴�
private Integer error_code; // 閿欒浠g爜
private String error_message; // 閿欒淇℃伅
+ private String path_id_saved; // 瀛樺偍鐨勮矾寰処D
+
+ /**
+ * 榛樿鏋勯�犲嚱鏁�
+ */
+ public StatusInfo() {
+ }
/**
* 甯﹀弬鏁扮殑鏋勯�犲嚱鏁�
@@ -95,10 +143,11 @@
* @param self_check_status 鑷鐘舵�侊細1-瀹屾垚锛�0-鏈畬鎴�
* @param error_code 閿欒浠g爜
* @param error_message 閿欒淇℃伅
+ * @param path_id_saved 瀛樺偍鐨勮矾寰処D
*/
public StatusInfo(Integer battery_level, Double battery_voltage, String operation_mode,
String motor_status, String blade_status, Integer blade_height,
- Integer self_check_status, Integer error_code, String error_message) {
+ Integer self_check_status, Integer error_code, String error_message, String path_id_saved) {
this.battery_level = battery_level;
this.battery_voltage = battery_voltage;
this.operation_mode = operation_mode;
@@ -108,15 +157,93 @@
this.self_check_status = self_check_status;
this.error_code = error_code;
this.error_message = error_message;
+ this.path_id_saved = path_id_saved;
}
+
+ public Integer getBattery_level() {
+ return battery_level;
+ }
+
+ public void setBattery_level(Integer battery_level) {
+ this.battery_level = battery_level;
+ }
+
+ public Double getBattery_voltage() {
+ return battery_voltage;
+ }
+
+ public void setBattery_voltage(Double battery_voltage) {
+ this.battery_voltage = battery_voltage;
+ }
+
+ public String getOperation_mode() {
+ return operation_mode;
+ }
+
+ public void setOperation_mode(String operation_mode) {
+ this.operation_mode = operation_mode;
+ }
+
+ public String getMotor_status() {
+ return motor_status;
+ }
+
+ public void setMotor_status(String motor_status) {
+ this.motor_status = motor_status;
+ }
+
+ public String getBlade_status() {
+ return blade_status;
+ }
+
+ public void setBlade_status(String blade_status) {
+ this.blade_status = blade_status;
+ }
+
+ public Integer getBlade_height() {
+ return blade_height;
+ }
+
+ public void setBlade_height(Integer blade_height) {
+ this.blade_height = blade_height;
+ }
+
+ public Integer getSelf_check_status() {
+ return self_check_status;
+ }
+
+ public void setSelf_check_status(Integer self_check_status) {
+ this.self_check_status = self_check_status;
+ }
+
+ public Integer getError_code() {
+ return error_code;
+ }
+
+ public void setError_code(Integer error_code) {
+ this.error_code = error_code;
+ }
+
+ public String getError_message() {
+ return error_message;
+ }
+
+ public void setError_message(String error_message) {
+ this.error_message = error_message;
+ }
+
+ public String getPath_id_saved() {
+ return path_id_saved;
+ }
+
+ public void setPath_id_saved(String path_id_saved) {
+ this.path_id_saved = path_id_saved;
+ }
}
/**
* GGA鏁版嵁瑙f瀽绫伙紙鍙�夛紝鐢ㄤ簬瀛樺偍瑙f瀽鍚庣殑GGA鏁版嵁锛�
*/
- @Data
- @NoArgsConstructor
- @AllArgsConstructor
public static class GGAData {
private String utcTime; // UTC鏃堕棿
private String latitude; // 绾害锛堝師濮嬪害鍒嗘牸寮忥級
@@ -132,5 +259,202 @@
private String geoidSepUnit;// 澶у湴姘村噯闈㈠垎绂诲崟浣�
private String age; // 宸垎GPS鏁版嵁鏈熼檺
private String stationId; // 宸垎鍙傝�冨熀绔欐爣鍙�
+
+ /**
+ * 榛樿鏋勯�犲嚱鏁�
+ */
+ public GGAData() {
+ }
+
+ /**
+ * 鍏ㄥ弬鏋勯�犲嚱鏁�
+ */
+ public GGAData(String utcTime, String latitude, String latitudeDir, String longitude,
+ String longitudeDir, Integer gpsQuality, Integer satellites, Double hdop,
+ Double altitude, String altitudeUnit, Double geoidSep, String geoidSepUnit,
+ String age, String stationId) {
+ this.utcTime = utcTime;
+ this.latitude = latitude;
+ this.latitudeDir = latitudeDir;
+ this.longitude = longitude;
+ this.longitudeDir = longitudeDir;
+ this.gpsQuality = gpsQuality;
+ this.satellites = satellites;
+ this.hdop = hdop;
+ this.altitude = altitude;
+ this.altitudeUnit = altitudeUnit;
+ this.geoidSep = geoidSep;
+ this.geoidSepUnit = geoidSepUnit;
+ this.age = age;
+ this.stationId = stationId;
+ }
+
+ public String getUtcTime() {
+ return utcTime;
+ }
+
+ public void setUtcTime(String utcTime) {
+ this.utcTime = utcTime;
+ }
+
+ public String getLatitude() {
+ return latitude;
+ }
+
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+ }
+
+ public String getLatitudeDir() {
+ return latitudeDir;
+ }
+
+ public void setLatitudeDir(String latitudeDir) {
+ this.latitudeDir = latitudeDir;
+ }
+
+ public String getLongitude() {
+ return longitude;
+ }
+
+ public void setLongitude(String longitude) {
+ this.longitude = longitude;
+ }
+
+ public String getLongitudeDir() {
+ return longitudeDir;
+ }
+
+ public void setLongitudeDir(String longitudeDir) {
+ this.longitudeDir = longitudeDir;
+ }
+
+ public Integer getGpsQuality() {
+ return gpsQuality;
+ }
+
+ public void setGpsQuality(Integer gpsQuality) {
+ this.gpsQuality = gpsQuality;
+ }
+
+ public Integer getSatellites() {
+ return satellites;
+ }
+
+ public void setSatellites(Integer satellites) {
+ this.satellites = satellites;
+ }
+
+ public Double getHdop() {
+ return hdop;
+ }
+
+ public void setHdop(Double hdop) {
+ this.hdop = hdop;
+ }
+
+ public Double getAltitude() {
+ return altitude;
+ }
+
+ public void setAltitude(Double altitude) {
+ this.altitude = altitude;
+ }
+
+ public String getAltitudeUnit() {
+ return altitudeUnit;
+ }
+
+ public void setAltitudeUnit(String altitudeUnit) {
+ this.altitudeUnit = altitudeUnit;
+ }
+
+ public Double getGeoidSep() {
+ return geoidSep;
+ }
+
+ public void setGeoidSep(Double geoidSep) {
+ this.geoidSep = geoidSep;
+ }
+
+ public String getGeoidSepUnit() {
+ return geoidSepUnit;
+ }
+
+ public void setGeoidSepUnit(String geoidSepUnit) {
+ this.geoidSepUnit = geoidSepUnit;
+ }
+
+ public String getAge() {
+ return age;
+ }
+
+ public void setAge(String age) {
+ this.age = age;
+ }
+
+ public String getStationId() {
+ return stationId;
+ }
+
+ public void setStationId(String stationId) {
+ this.stationId = stationId;
+ }
}
+
+ public String getMsg_id() {
+ return msg_id;
+ }
+
+ public void setMsg_id(String msg_id) {
+ this.msg_id = msg_id;
+ }
+
+ public Long getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(Long timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ public String getDevice_id() {
+ return device_id;
+ }
+
+ public void setDevice_id(String device_id) {
+ this.device_id = device_id;
+ }
+
+ public String getData_type() {
+ return data_type;
+ }
+
+ public void setData_type(String data_type) {
+ this.data_type = data_type;
+ }
+
+ public IMUData getImu_data() {
+ return imu_data;
+ }
+
+ public void setImu_data(IMUData imu_data) {
+ this.imu_data = imu_data;
+ }
+
+ public StatusInfo getStatus() {
+ return status;
+ }
+
+ public void setStatus(StatusInfo status) {
+ this.status = status;
+ }
+
+ public GGAData getGgaData() {
+ return ggaData;
+ }
+
+ public void setGgaData(GGAData ggaData) {
+ this.ggaData = ggaData;
+ }
}
\ No newline at end of file
--
Gitblit v1.10.0