package Mqttmessage.Entity;
|
|
public class GPSData{
|
// JSON中的原始字段
|
private String msg_id; // 消息唯一标识
|
private Long timestamp; // 时间戳(毫秒)
|
private String device_id; // 设备编号
|
private String data_type; // 数据类型
|
private String gps_raw; // 原始GPS数据
|
|
// IMU数据内部类
|
private IMUData imu_data;
|
|
// 状态数据(新协议格式)
|
private StatusInfo status;
|
|
// NMEA GGA解析结果(可选,根据需要添加)
|
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数据字符串
|
*/
|
public String getGps_raw() {
|
return gps_raw;
|
}
|
|
/**
|
* 设置原始GPS数据
|
* @param gps_raw 原始GPS数据字符串
|
*/
|
public void setGps_raw(String gps_raw) {
|
this.gps_raw = gps_raw;
|
}
|
|
|
|
|
|
|
|
/**
|
* IMU数据内部类(简化版,只包含角度信息)
|
*/
|
public static class IMUData {
|
private Double roll; // 横滚角 角度
|
private Double pitch; // 俯仰角 角度
|
private Double yaw; // 偏航角 角度
|
|
/**
|
* 默认构造函数
|
*/
|
public IMUData() {
|
}
|
|
/**
|
* 全参构造函数
|
* @param roll 横滚角 角度
|
* @param pitch 俯仰角 角度
|
* @param yaw 偏航角 角度
|
*/
|
public IMUData(Double roll, Double pitch, Double yaw) {
|
this.roll = roll;
|
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保持一致)
|
*/
|
public static class StatusInfo {
|
private Integer battery_level; // 电池电量百分比
|
private Double battery_voltage; // 电池电压
|
private String operation_mode; // 操作模式:manual, auto, emergency_stop
|
private String motor_status; // 电机状态:stopped, running, error
|
private String blade_status; // 刀片状态:stopped, rotating
|
private Integer blade_height; // 刀盘高度 厘米
|
private Integer self_check_status; // 自检状态:1-完成,0-未完成
|
private Integer error_code; // 错误代码
|
private String error_message; // 错误信息
|
private String path_id_saved; // 存储的路径ID
|
|
/**
|
* 默认构造函数
|
*/
|
public StatusInfo() {
|
}
|
|
/**
|
* 带参数的构造函数
|
* @param battery_level 电池电量百分比
|
* @param battery_voltage 电池电压
|
* @param operation_mode 操作模式:manual, auto, emergency_stop
|
* @param motor_status 电机状态:stopped, running, error
|
* @param blade_status 刀片状态:stopped, rotating
|
* @param blade_height 刀盘高度 厘米
|
* @param self_check_status 自检状态:1-完成,0-未完成
|
* @param error_code 错误代码
|
* @param error_message 错误信息
|
* @param path_id_saved 存储的路径ID
|
*/
|
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, String path_id_saved) {
|
this.battery_level = battery_level;
|
this.battery_voltage = battery_voltage;
|
this.operation_mode = operation_mode;
|
this.motor_status = motor_status;
|
this.blade_status = blade_status;
|
this.blade_height = blade_height;
|
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数据解析类(可选,用于存储解析后的GGA数据)
|
*/
|
public static class GGAData {
|
private String utcTime; // UTC时间
|
private String latitude; // 纬度(原始度分格式)
|
private String latitudeDir; // 纬度方向
|
private String longitude; // 经度(原始度分格式)
|
private String longitudeDir;// 经度方向
|
private Integer gpsQuality; // GPS质量指示
|
private Integer satellites; // 使用的卫星数量
|
private Double hdop; // 水平精度因子
|
private Double altitude; // 海拔高度
|
private String altitudeUnit;// 海拔高度单位
|
private Double geoidSep; // 大地水准面分离
|
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;
|
}
|
}
|