|
@@ -3,11 +3,15 @@ package com.sw.patroleditor.service.impl;
|
|
|
import com.sw.patroleditor.component.rosBridge.RobotDataCallBack;
|
|
|
import com.sw.patroleditor.component.rosBridge.RobotDataModel;
|
|
|
import com.sw.patroleditor.domain.dto.AimDTO;
|
|
|
+import com.sw.patroleditor.domain.dto.PointDTO;
|
|
|
import com.sw.patroleditor.domain.dto.ZoominDTO;
|
|
|
+import com.sw.patroleditor.domain.vo.PointVO;
|
|
|
+import com.sw.patroleditor.mapper.PointMapper;
|
|
|
import com.sw.patroleditor.service.LocationService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
/**
|
|
|
* Created by shiwn on 2024/7/26 15:08
|
|
@@ -16,42 +20,33 @@ import javax.annotation.Resource;
|
|
|
public class LocationServiceImpl implements LocationService {
|
|
|
@Resource
|
|
|
private RobotDataCallBack robotDataCallBack;
|
|
|
+ @Resource
|
|
|
+ private PointMapper pointMapper;
|
|
|
|
|
|
/**
|
|
|
- * @Description: 保存点位
|
|
|
+ * @Description: 保存停靠点
|
|
|
* @Date: 2024/7/26 15:09
|
|
|
* @Author: shiwn
|
|
|
*/
|
|
|
@Override
|
|
|
- public int save() {
|
|
|
+ public int savePoint(PointVO vo) {
|
|
|
RobotDataModel robotDataModel = robotDataCallBack.getRobotDataModel();
|
|
|
- Long id = System.currentTimeMillis();
|
|
|
- AimDTO aimDTO = new AimDTO();
|
|
|
- aimDTO.setId(id);
|
|
|
- aimDTO.setRoll(robotDataModel.getRoll());
|
|
|
- aimDTO.setPitch(robotDataModel.getPitch());
|
|
|
- aimDTO.setYaw(robotDataModel.getYaw());
|
|
|
-// aimDTO.setHeight();
|
|
|
- aimDTO.setFocus(robotDataModel.getFocalDistance());
|
|
|
- aimDTO.setRatio(robotDataModel.getRatio());
|
|
|
- aimDTO.setAperture(robotDataModel.getDiaphragm());
|
|
|
-// aimDTO.setTopleftX();
|
|
|
-// aimDTO.setTopleftY();
|
|
|
-// aimDTO.setBotrightX();
|
|
|
-// aimDTO.setBotrightY();
|
|
|
+ PointDTO dto = new PointDTO();
|
|
|
+ dto.setUuid(UUID.randomUUID().toString());
|
|
|
+ dto.setType(vo.getType());
|
|
|
+ dto.setNote(vo.getNote());
|
|
|
+ dto.setAbsolutePosX(robotDataModel.getPosX());
|
|
|
+ dto.setAbsolutePosY(robotDataModel.getPosY());
|
|
|
+ return pointMapper.insert(dto);
|
|
|
+ }
|
|
|
|
|
|
- ZoominDTO zoominDTO = new ZoominDTO();
|
|
|
- zoominDTO.setId(id);
|
|
|
- zoominDTO.setRoll(robotDataModel.getRoll());
|
|
|
- zoominDTO.setPitch(robotDataModel.getPitch());
|
|
|
- zoominDTO.setYaw(robotDataModel.getYaw());
|
|
|
- zoominDTO.setFocus(robotDataModel.getFocalDistance());
|
|
|
- zoominDTO.setRatio(robotDataModel.getRatio());
|
|
|
- zoominDTO.setAperture(robotDataModel.getDiaphragm());
|
|
|
-// zoominDTO.setTopleftX();
|
|
|
-// zoominDTO.setTopleftY();
|
|
|
-// zoominDTO.setBotrightX();
|
|
|
-// zoominDTO.setBotrightY();
|
|
|
+ /**
|
|
|
+ * @Description: 保存巡检点
|
|
|
+ * @Date: 2024/8/9 15:56
|
|
|
+ * @Author: shiwn
|
|
|
+ */
|
|
|
+ public int saveTarget() {
|
|
|
+ RobotDataModel robotDataModel = robotDataCallBack.getRobotDataModel();
|
|
|
return 1;
|
|
|
}
|
|
|
}
|