添加电池剩余飞行时间
This commit is contained in:
parent
34cba3d6a2
commit
c09f7358f1
|
|
@ -1,10 +1,13 @@
|
|||
package com.ruoyi.device.domain.model.thingsboard.attributes.battery;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 单个电池信息
|
||||
*/
|
||||
@Data
|
||||
public class BatteryInfo {
|
||||
|
||||
@JsonProperty("capacity_percent")
|
||||
|
|
@ -37,104 +40,7 @@ public class BatteryInfo {
|
|||
@JsonProperty("voltage")
|
||||
private Integer voltage;
|
||||
|
||||
// 构造方法
|
||||
public BatteryInfo() {
|
||||
}
|
||||
@JsonProperty("remain_flight_time")
|
||||
private Integer remainFlightTime;
|
||||
|
||||
// Getter和Setter方法
|
||||
public Integer getCapacityPercent() {
|
||||
return capacityPercent;
|
||||
}
|
||||
|
||||
public void setCapacityPercent(Integer capacityPercent) {
|
||||
this.capacityPercent = capacityPercent;
|
||||
}
|
||||
|
||||
public String getFirmwareVersion() {
|
||||
return firmwareVersion;
|
||||
}
|
||||
|
||||
public void setFirmwareVersion(String firmwareVersion) {
|
||||
this.firmwareVersion = firmwareVersion;
|
||||
}
|
||||
|
||||
public Integer getHighVoltageStorageDays() {
|
||||
return highVoltageStorageDays;
|
||||
}
|
||||
|
||||
public void setHighVoltageStorageDays(Integer highVoltageStorageDays) {
|
||||
this.highVoltageStorageDays = highVoltageStorageDays;
|
||||
}
|
||||
|
||||
public Integer getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(Integer index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public Integer getLoopTimes() {
|
||||
return loopTimes;
|
||||
}
|
||||
|
||||
public void setLoopTimes(Integer loopTimes) {
|
||||
this.loopTimes = loopTimes;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public Integer getSubType() {
|
||||
return subType;
|
||||
}
|
||||
|
||||
public void setSubType(Integer subType) {
|
||||
this.subType = subType;
|
||||
}
|
||||
|
||||
public Double getTemperature() {
|
||||
return temperature;
|
||||
}
|
||||
|
||||
public void setTemperature(Double temperature) {
|
||||
this.temperature = temperature;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getVoltage() {
|
||||
return voltage;
|
||||
}
|
||||
|
||||
public void setVoltage(Integer voltage) {
|
||||
this.voltage = voltage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BatteryInfo{" +
|
||||
"capacityPercent=" + capacityPercent +
|
||||
", firmwareVersion='" + firmwareVersion + '\'' +
|
||||
", highVoltageStorageDays=" + highVoltageStorageDays +
|
||||
", index=" + index +
|
||||
", loopTimes=" + loopTimes +
|
||||
", sn='" + sn + '\'' +
|
||||
", subType=" + subType +
|
||||
", temperature=" + temperature +
|
||||
", type=" + type +
|
||||
", voltage=" + voltage +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -83,7 +83,7 @@ public class AircraftDetailDTO implements Serializable
|
|||
private Integer batteryLevel;
|
||||
|
||||
/** 续航 */
|
||||
private Double flightTimeRemaining;
|
||||
private Integer flightTimeRemaining;
|
||||
|
||||
/** 电池温度 */
|
||||
private Double batteryTemperature;
|
||||
|
|
|
|||
|
|
@ -185,6 +185,7 @@ public class BufferDeviceImpl implements IBufferDeviceService
|
|||
dto.setBatteryTemperature(batteryData.getBatteries().get(0).getTemperature());
|
||||
dto.setBatteryLevel(batteryData.getBatteries().get(0).getCapacityPercent());
|
||||
dto.setCycleCount(batteryData.getBatteries().get(0).getLoopTimes());
|
||||
dto.setFlightTimeRemaining(batteryData.getBatteries().get(0).getRemainFlightTime());
|
||||
dto.setBatterySn(batterySn);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue