#区域连续作业相关
This commit is contained in:
@@ -30,37 +30,37 @@ public class DeviceTask {
|
||||
|
||||
private int keepAlive;
|
||||
|
||||
/*设备状态池*/
|
||||
/* 设备状态池 */
|
||||
@Bean(FastBeeConstant.TASK.DEVICE_STATUS_TASK)
|
||||
public Executor deviceStatusTaskExecutor() {
|
||||
return builder(FastBeeConstant.TASK.DEVICE_STATUS_TASK);
|
||||
}
|
||||
|
||||
/*平台自动获取线程池(例如定时获取设备信息)*/
|
||||
/* 平台自动获取线程池(例如定时获取设备信息) */
|
||||
@Bean(FastBeeConstant.TASK.DEVICE_FETCH_PROP_TASK)
|
||||
public Executor deviceFetchTaskExecutor() {
|
||||
return builder(FastBeeConstant.TASK.DEVICE_FETCH_PROP_TASK);
|
||||
}
|
||||
|
||||
/*设备回调信息(下发指令(服务)设备应答信息)*/
|
||||
/* 设备回调信息(下发指令(服务)设备应答信息) */
|
||||
@Bean(FastBeeConstant.TASK.DEVICE_REPLY_MESSAGE_TASK)
|
||||
public Executor deviceReplyTaskExecutor() {
|
||||
return builder(FastBeeConstant.TASK.DEVICE_REPLY_MESSAGE_TASK);
|
||||
}
|
||||
|
||||
/*设备主动上报(设备数据有变化主动上报)*/
|
||||
/* 设备主动上报(设备数据有变化主动上报) */
|
||||
@Bean(FastBeeConstant.TASK.DEVICE_UP_MESSAGE_TASK)
|
||||
public Executor deviceUpMessageTaskExecutor() {
|
||||
return builder(FastBeeConstant.TASK.DEVICE_UP_MESSAGE_TASK);
|
||||
}
|
||||
|
||||
/*指令下发(服务下发)*/
|
||||
/* 指令下发(服务下发) */
|
||||
@Bean(FastBeeConstant.TASK.FUNCTION_INVOKE_TASK)
|
||||
public Executor functionInvokeTaskExecutor() {
|
||||
return builder(FastBeeConstant.TASK.FUNCTION_INVOKE_TASK);
|
||||
}
|
||||
|
||||
/*内部消费线程*/
|
||||
/* 内部消费线程 */
|
||||
@Bean(FastBeeConstant.TASK.MESSAGE_CONSUME_TASK)
|
||||
public Executor messageConsumeTaskExecutor() {
|
||||
return builder(FastBeeConstant.TASK.MESSAGE_CONSUME_TASK);
|
||||
@@ -81,7 +81,7 @@ public class DeviceTask {
|
||||
return builder(FastBeeConstant.TASK.DELAY_UPGRADE_TASK);
|
||||
}
|
||||
|
||||
/*设备其他消息处理*/
|
||||
/* 设备其他消息处理 */
|
||||
@Bean(FastBeeConstant.TASK.DEVICE_OTHER_TASK)
|
||||
public Executor deviceOtherTaskExecutor() {
|
||||
return builder(FastBeeConstant.TASK.DEVICE_OTHER_TASK);
|
||||
@@ -107,6 +107,11 @@ public class DeviceTask {
|
||||
return builder(FastBeeConstant.TASK.AUTO_RULE);
|
||||
}
|
||||
|
||||
@Bean(FastBeeConstant.TASK.REGION_CONSECUTIVE_TASK)
|
||||
public Executor regionConsecutiveTask() {
|
||||
return builder(FastBeeConstant.TASK.REGION_CONSECUTIVE_TASK);
|
||||
}
|
||||
|
||||
@Bean(FastBeeConstant.TASK.MAP_MESSAGE_PUSH)
|
||||
public Executor mapMessagePush() {
|
||||
return builder(FastBeeConstant.TASK.MAP_MESSAGE_PUSH);
|
||||
@@ -122,8 +127,7 @@ public class DeviceTask {
|
||||
return builder(FastBeeConstant.TASK.COMMON_DEVICE_MONITOR);
|
||||
}
|
||||
|
||||
|
||||
/*组装线程池*/
|
||||
/* 组装线程池 */
|
||||
private ThreadPoolTaskExecutor builder(String threadNamePrefix) {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(coreSize);
|
||||
@@ -132,7 +136,7 @@ public class DeviceTask {
|
||||
executor.setQueueCapacity(queueCapacity);
|
||||
// 线程池对拒绝任务的处理策略
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardOldestPolicy());
|
||||
//线程池名的前缀
|
||||
// 线程池名的前缀
|
||||
executor.setThreadNamePrefix(threadNamePrefix);
|
||||
executor.initialize();
|
||||
return executor;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Constant {
|
||||
public static final Long hostOfflineInterval = 10000L; // 单位毫秒
|
||||
|
||||
// ==================== 远程控制 ====================
|
||||
public static final String protocol_version = "1.4.3";
|
||||
public static final String protocol_version = "1.4.5";
|
||||
public static final String remote_control_msg_prefix = "remote-msg";
|
||||
public static final String remote_control_cmd_prefix = "remote-cmd";
|
||||
}
|
||||
|
||||
@@ -115,6 +115,11 @@ public interface FastBeeConstant {
|
||||
*/
|
||||
String AUTO_RULE = "autoRule";
|
||||
|
||||
/**
|
||||
* 区域连续任务处理
|
||||
*/
|
||||
String REGION_CONSECUTIVE_TASK = "regionConsecutiveTaskHandler";
|
||||
|
||||
/**
|
||||
* 设备任务处理线程
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.maibu.core.business;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.maibu.core.domain.OrgNoUserDO;
|
||||
import com.maibu.core.enums.DeviceTaskStaus;
|
||||
import com.maibu.utils.LongListTypeHandler;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@TableName("iot_region_consecutive_task_record")
|
||||
public class RegionConsecutiveTaskRecord extends OrgNoUserDO {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private String deviceId;
|
||||
|
||||
private Long regionId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String deviceAlias; // 别名
|
||||
|
||||
@TableField(typeHandler = LongListTypeHandler.class)
|
||||
private List<Long> routeIds; // 线路id
|
||||
|
||||
@TableField(typeHandler = LongListTypeHandler.class)
|
||||
private List<Long> taskIds; // 线路id
|
||||
|
||||
private DeviceTaskStaus taskStatus; // 任务状态
|
||||
|
||||
private int currentIndex; // 当前执行到哪一个
|
||||
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import com.maibu.core.host.MutiPointEntity;
|
||||
import com.maibu.core.host.PointEntity;
|
||||
import com.maibu.core.ota.DeviceOtaFirmware;
|
||||
import com.maibu.mapper.DevicePlanTaskMapper;
|
||||
import com.maibu.mapper.RegionConsecutiveTaskRecordMapper;
|
||||
import com.maibu.mapper.WorkRecordMapper;
|
||||
import com.maibu.memory.GlobalMemory;
|
||||
import com.maibu.memory.SiteMemory;
|
||||
@@ -68,6 +69,10 @@ public class NettyDevice extends Connector {
|
||||
@JsonIgnore
|
||||
private DevicePlanTaskMapper devicePlanTaskMapper = SpringUtils.getBean(DevicePlanTaskMapper.class);
|
||||
|
||||
@JsonIgnore
|
||||
private RegionConsecutiveTaskRecordMapper regionConsecutiveTaskRecordMapper = SpringUtils
|
||||
.getBean(RegionConsecutiveTaskRecordMapper.class);
|
||||
|
||||
@JsonIgnore
|
||||
private WorkRecordMapper workRecordMapper = SpringUtils.getBean(WorkRecordMapper.class);
|
||||
|
||||
@@ -128,6 +133,23 @@ public class NettyDevice extends Connector {
|
||||
task.setFinishTime(LocalDateTime.now());
|
||||
devicePlanTaskMapper.saveOrUpdate(task);
|
||||
SiteMemory siteMemory = GlobalMemory.getSiteMemory(task.getOrgId(), task.getSiteId());
|
||||
|
||||
// 更新当前任务的执行索引
|
||||
RegionConsecutiveTaskRecord record = siteMemory.getRegionConsecutiveTask(device.getSerialNumber());
|
||||
if (record != null && DeviceTaskStaus.EXECUTING.equals(record.getTaskStatus())) {
|
||||
int maxIndex = record.getRouteIds().size() - 1;
|
||||
int currentIndex = record.getCurrentIndex();
|
||||
record.setUpdateTime(LocalDateTime.now());
|
||||
if (currentIndex >= maxIndex) {
|
||||
record.setTaskStatus(DeviceTaskStaus.FINISH);
|
||||
siteMemory.removeRegionConsecutiveTask(device.getSerialNumber());
|
||||
} else {
|
||||
record.setCurrentIndex(currentIndex + 1);
|
||||
}
|
||||
regionConsecutiveTaskRecordMapper.saveOrUpdate(record);
|
||||
}
|
||||
|
||||
|
||||
siteMemory.removeDevicePlanExecute(task.getDeviceId());
|
||||
GlobalMemory.taskPathMap.remove(task.getId());
|
||||
task = null;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.maibu.core.business.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConsecutiveTaskDTO {
|
||||
|
||||
private String deviceId;
|
||||
|
||||
private List<Long> routeIds; // 线路id
|
||||
|
||||
private Long orgId;
|
||||
|
||||
private Long siteId;
|
||||
|
||||
private Long regionId;
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ public class DeviceMapPushDTO {
|
||||
private double b; // 电量
|
||||
private boolean ha = false;// hasAlarm 有无告警
|
||||
|
||||
private String cm;// 控制模式 manual_remote|auto
|
||||
private Integer cm;// 控制模式 manual_remote|auto
|
||||
|
||||
private String ms; // 运动状态 moving|stopped|blocked
|
||||
|
||||
|
||||
@@ -7,10 +7,16 @@ import lombok.Data;
|
||||
@Data
|
||||
public class TempObstaclePoint {
|
||||
|
||||
private LatAndLngEntity position;
|
||||
|
||||
private Double radius;
|
||||
private LatAndLngEntity center;
|
||||
|
||||
private String alias;
|
||||
|
||||
private double radius; // 半径
|
||||
|
||||
private double size_x; // x方向的长度
|
||||
|
||||
private double size_y; // y方向的长度
|
||||
|
||||
private String source = "platform"; // 数据来源 默认给平台
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import lombok.Data;
|
||||
@Data
|
||||
public class ObstacleDetectionData {
|
||||
|
||||
|
||||
private MesType mesType;
|
||||
|
||||
/**
|
||||
@@ -17,6 +16,10 @@ public class ObstacleDetectionData {
|
||||
*/
|
||||
private String fusion_status;
|
||||
|
||||
private String fusion_status_code;
|
||||
|
||||
private String fusion_status_reason;
|
||||
|
||||
/**
|
||||
* 障碍物检测状态
|
||||
*/
|
||||
|
||||
@@ -7,6 +7,8 @@ public class VehicleMessage {
|
||||
|
||||
private String deviceId;
|
||||
|
||||
private double cutter_speed;// 割刀实际转速
|
||||
|
||||
private double battery_percentage;// 实时电量百分比
|
||||
private double battery_voltage;// 实时电压
|
||||
|
||||
@@ -15,6 +17,8 @@ public class VehicleMessage {
|
||||
private double left_motor_temperature;// 实时左电机温度
|
||||
private double right_motor_temperature;// 实时右电机温度
|
||||
private double main_temperature;// 实时主温度
|
||||
|
||||
private String mcu_time; // 下位机状态中的 MCU 时间
|
||||
private double yaw;// 实时航向角度
|
||||
private double pitch;// 实时俯仰角度
|
||||
private String heading_status;// 实时航向状态
|
||||
@@ -31,7 +35,8 @@ public class VehicleMessage {
|
||||
private double left_motor_rpm;// 实时左电机转速
|
||||
private double right_motor_rpm;// 实时右电机转速
|
||||
private double roll;// 实时翻滚角度
|
||||
private String control_mode;// 遥控器拨杆对应的当前控制模式
|
||||
|
||||
private Integer control_mode;// 遥控器拨杆对应的当前控制模式 0=无控制|1=本地遥控|2=自动任务|3=远程遥控
|
||||
|
||||
private double linear_speed; // 实时线速度
|
||||
private double angular_speed; // 实时角速度
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.maibu.mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.maibu.core.business.RegionConsecutiveTaskRecord;
|
||||
import com.maibu.mybatis.mapper.BaseMapperX;
|
||||
|
||||
/**
|
||||
* 区域连续任务下发记录
|
||||
*/
|
||||
@Repository
|
||||
public interface RegionConsecutiveTaskRecordMapper extends BaseMapperX<RegionConsecutiveTaskRecord> {
|
||||
|
||||
}
|
||||
@@ -29,10 +29,10 @@ public class GlobalMemory {
|
||||
|
||||
public static InfluxDBUtil influxDBUtil;
|
||||
|
||||
// public static MqttClientUtil mqttClientUtil;
|
||||
|
||||
public static CustomMqttDeviceMonitor customMqttDeviceMonitor = null; //这里面包含了 连我们自己的mqtt 和外部的一些设备,自己的用clientId 是固定的
|
||||
// public static MqttClientUtil mqttClientUtil;
|
||||
|
||||
public static CustomMqttDeviceMonitor customMqttDeviceMonitor = null; // 这里面包含了 连我们自己的mqtt 和外部的一些设备,自己的用clientId
|
||||
// 是固定的
|
||||
|
||||
public static SiteMemory getSiteMemory(Long orgId, Long siteId) {
|
||||
if (orgId != null && siteId != null) {
|
||||
@@ -87,15 +87,16 @@ public class GlobalMemory {
|
||||
}
|
||||
}
|
||||
|
||||
public static void initMqttDeviceMonitor(String mqttHostUrl, String mqttClientId, String mqttUsername, String mqttPassword) {
|
||||
public static void initMqttDeviceMonitor(String mqttHostUrl, String mqttClientId, String mqttUsername,
|
||||
String mqttPassword) {
|
||||
if (customMqttDeviceMonitor == null) {
|
||||
// 1. 创建 MQTT 监控器和消息处理器
|
||||
customMqttDeviceMonitor = new CustomMqttDeviceMonitor();
|
||||
// customMqttDeviceMonitor.registerHandler(new GenericPropertyMessageHandler());
|
||||
customMqttDeviceMonitor.registerHandler(new HostMessageHandler()); //专门处理上位机的
|
||||
// customMqttDeviceMonitor.registerHandler(new ActionMessageHandler());
|
||||
// customMqttDeviceMonitor.registerHandler(new GenericPropertyMessageHandler());
|
||||
customMqttDeviceMonitor.registerHandler(new HostMessageHandler()); // 专门处理上位机的
|
||||
// customMqttDeviceMonitor.registerHandler(new ActionMessageHandler());
|
||||
|
||||
//单独注册 对接上位机的
|
||||
// 单独注册 对接上位机的
|
||||
// 注册设备到 MQTT 监控器
|
||||
CustomMqttDeviceConfig deviceConfig = new CustomMqttDeviceConfig();
|
||||
deviceConfig.setDeviceKey(mqttClientId);
|
||||
@@ -103,18 +104,19 @@ public class GlobalMemory {
|
||||
deviceConfig.setClientId(mqttClientId);
|
||||
deviceConfig.setUsername(mqttUsername);
|
||||
deviceConfig.setPassword(mqttPassword);
|
||||
//TODO 添加所有需要订阅的
|
||||
// TODO 添加所有需要订阅的
|
||||
deviceConfig.setSubscribeTopics(Arrays.asList(
|
||||
MqttTopic.MOWER_HEARTBEAT,//心跳
|
||||
MqttTopic.MOWER_WILDCARD_LOCATION,//位置 经纬度
|
||||
MqttTopic.MOWER_WILDCARD_TASK_ROUTE, //路径回复
|
||||
MqttTopic.MOWER_WILDCARD_TASK_STATUS,//任务状态
|
||||
MqttTopic.MOWER_WILDCARD_ERROR,//错误
|
||||
MqttTopic.MOWER_WILDCARD_REALTIME, //状态消息
|
||||
MqttTopic.MOWER_WILDCARD_TASK_TARGET_REPLY, //路径规划下发回复
|
||||
MqttTopic.MOWER_OTA_RESULT_POST
|
||||
));
|
||||
deviceConfig.setHandlerType(Constant.mqttHandleKey); //唯一的 用于处理上位机mqtt的
|
||||
MqttTopic.MOWER_HEARTBEAT, // 心跳
|
||||
MqttTopic.MOWER_WILDCARD_LOCATION, // 位置 经纬度
|
||||
MqttTopic.MOWER_WILDCARD_TASK_ROUTE, // 路径回复
|
||||
MqttTopic.MOWER_WILDCARD_TASK_STATUS, // 任务状态
|
||||
MqttTopic.MOWER_WILDCARD_ERROR, // 错误
|
||||
MqttTopic.MOWER_WILDCARD_REALTIME, // 状态消息
|
||||
MqttTopic.MOWER_WILDCARD_TASK_TARGET_REPLY, // 路径规划下发回复
|
||||
MqttTopic.MOWER_OTA_RESULT_POST, // 在线升级
|
||||
MqttTopic.MOWER_OBSTACLE
|
||||
));
|
||||
deviceConfig.setHandlerType(Constant.mqttHandleKey); // 唯一的 用于处理上位机mqtt的
|
||||
customMqttDeviceMonitor.registerDevice(deviceConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.maibu.memory;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.eclipse.paho.client.mqttv3.MqttClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -22,9 +25,12 @@ import com.maibu.core.business.ErrorIdentificationStandard;
|
||||
import com.maibu.core.business.IoTCommonDevice;
|
||||
import com.maibu.core.business.OrderModel;
|
||||
import com.maibu.core.business.Product;
|
||||
import com.maibu.core.business.RegionConsecutiveTaskRecord;
|
||||
import com.maibu.core.business.dto.ConsecutiveTaskDTO;
|
||||
import com.maibu.core.business.dto.DeviceMapPushDTO;
|
||||
import com.maibu.core.domain.entity.SysSite;
|
||||
import com.maibu.core.domain.rule.IotAutoRule;
|
||||
import com.maibu.core.enums.DeviceTaskStaus;
|
||||
import com.maibu.core.enums.ErrorSource;
|
||||
import com.maibu.core.enums.RuleType;
|
||||
import com.maibu.core.host.VehicleMessage;
|
||||
@@ -75,6 +81,34 @@ public class SiteMemory {
|
||||
|
||||
public static ConcurrentHashMap<RuleType, IotAutoRule> iotAutoRuleMap = new ConcurrentHashMap<>();
|
||||
|
||||
public static final ConcurrentHashMap<String, RegionConsecutiveTaskRecord> regionConsecutiveTaskMap = new ConcurrentHashMap<>();
|
||||
|
||||
public void saveRegionConsecutiveTask(String deviceId, ConsecutiveTaskDTO dto, String username) {
|
||||
RegionConsecutiveTaskRecord record = new RegionConsecutiveTaskRecord();
|
||||
record.setDeviceId(deviceId);
|
||||
record.setRegionId(dto.getRegionId());
|
||||
record.setRouteIds(dto.getRouteIds());
|
||||
record.setCreateBy(username);
|
||||
record.setOrgId(dto.getOrgId());
|
||||
record.setSiteId(dto.getSiteId());
|
||||
record.setRouteIds(dto.getRouteIds());
|
||||
record.setTaskStatus(DeviceTaskStaus.NEW);
|
||||
regionConsecutiveTaskMap.put(deviceId, record);
|
||||
}
|
||||
|
||||
public RegionConsecutiveTaskRecord getRegionConsecutiveTask(String deviceId) {
|
||||
return regionConsecutiveTaskMap.get(deviceId);
|
||||
}
|
||||
|
||||
public RegionConsecutiveTaskRecord removeRegionConsecutiveTask(String deviceId) {
|
||||
RegionConsecutiveTaskRecord record = getRegionConsecutiveTask(deviceId);
|
||||
if (record != null) {
|
||||
record.setTaskStatus(DeviceTaskStaus.CANCELED);
|
||||
}
|
||||
regionConsecutiveTaskMap.remove(deviceId);
|
||||
return record;
|
||||
}
|
||||
|
||||
public List<IotAutoRule> getAllIotAutoRule() {
|
||||
return new ArrayList<>(iotAutoRuleMap.values());
|
||||
}
|
||||
@@ -95,6 +129,14 @@ public class SiteMemory {
|
||||
return new ArrayList<>(vehicleMessageMap.values());
|
||||
}
|
||||
|
||||
public Integer getDeviceControlMode(String deviceId) {
|
||||
VehicleMessage v = getVehicleMessage(deviceId);
|
||||
if (v != null) {
|
||||
return v.getControl_mode();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public VehicleMessage getVehicleMessage(String deviceId) {
|
||||
return vehicleMessageMap.get(deviceId);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ public class HostMessageHandler implements CustomMqttMessageHandler {
|
||||
NettyDevice nettyDevice = deviceSessionManager.getDevice(deviceId);
|
||||
// todo error故障
|
||||
if (nettyDevice != null) {
|
||||
if (nettyDevice.getOnlineStatus() == 0) {
|
||||
if (nettyDevice.getOnlineStatus() == null || nettyDevice.getOnlineStatus() == 0) {
|
||||
status.setValue(DeviceStatusEnum.offline.getCode());
|
||||
} else {
|
||||
if (nettyDevice.getTask() != null && nettyDevice.getTask().isTaskAccepted()) {
|
||||
@@ -267,6 +267,19 @@ public class HostMessageHandler implements CustomMqttMessageHandler {
|
||||
|
||||
WebStatusMessageDTO webStatusMessageDTO = new WebStatusMessageDTO();
|
||||
List<DeviceStatusDetail> transferData = new ArrayList<>();
|
||||
|
||||
DeviceStatusDetail cutter_speed = new DeviceStatusDetail();
|
||||
cutter_speed.setName("cutter_speed");
|
||||
cutter_speed.setValue(String.valueOf(vehicleRelTimeDTO.getData().getCutter_speed()));
|
||||
cutter_speed.setUnit("");
|
||||
transferData.add(cutter_speed);
|
||||
|
||||
DeviceStatusDetail mcu_time = new DeviceStatusDetail();
|
||||
mcu_time.setName("mcu_time");
|
||||
mcu_time.setValue(String.valueOf(vehicleRelTimeDTO.getData().getMcu_time()));
|
||||
mcu_time.setUnit("");
|
||||
transferData.add(mcu_time);
|
||||
|
||||
DeviceStatusDetail voltage = new DeviceStatusDetail();
|
||||
voltage.setName("battery_percentage");
|
||||
voltage.setValue(String.valueOf(vehicleRelTimeDTO.getData().getBattery_percentage()));
|
||||
|
||||
@@ -109,6 +109,9 @@ public class MqttTopic {
|
||||
|
||||
public static final String MOWER_HEARTBEAT = "mower/+/event/heartbeat/post";
|
||||
|
||||
//障碍物
|
||||
public static final String MOWER_OBSTACLE = "mower/+/perception/obstacle/post";
|
||||
|
||||
/**
|
||||
* 格式化 Topic 模板,将 %s 替换为设备ID
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user