|
@@ -0,0 +1,57 @@
|
|
|
|
+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.ZoominDTO;
|
|
|
|
+import com.sw.patroleditor.service.LocationService;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Created by shiwn on 2024/7/26 15:08
|
|
|
|
+ */
|
|
|
|
+@Service
|
|
|
|
+public class LocationServiceImpl implements LocationService {
|
|
|
|
+ @Resource
|
|
|
|
+ private RobotDataCallBack robotDataCallBack;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description: 保存点位
|
|
|
|
+ * @Date: 2024/7/26 15:09
|
|
|
|
+ * @Author: shiwn
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int save() {
|
|
|
|
+ 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();
|
|
|
|
+
|
|
|
|
+ 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();
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+}
|