diff --git a/env.js b/env.js
index 333d842..b0abf95 100644
--- a/env.js
+++ b/env.js
@@ -15,17 +15,17 @@ const envConfig = {
//mqtt_url: "ws://1.95.137.212:8083/mqtt",
//geoserver_url: "http://192.168.2.59:7000/geoserver"
- //baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081
- ////baseURL: 'https://serviceri.satabot.com',
- //WS_URL: 'ws://1.95.137.212:9002/ws/',
- //mqtt_url: "ws://1.95.137.212:59021/mqtt",
- //geoserver_url: "http://1.95.137.212:59018/geoserver"
-
- baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081
+ baseURL: 'http://1.95.137.212:8081',//http://192.168.2.56:8081
//baseURL: 'https://serviceri.satabot.com',
- WS_URL: 'ws://1.95.137.212:59017/ws/',
+ WS_URL: 'ws://1.95.137.212:9002/ws/',
mqtt_url: "ws://1.95.137.212:59021/mqtt",
geoserver_url: "http://1.95.137.212:59018/geoserver"
+
+ //baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081
+ ////baseURL: 'https://serviceri.satabot.com',
+ //WS_URL: 'ws://1.95.137.212:59017/ws/',
+ //mqtt_url: "ws://1.95.137.212:59021/mqtt",
+ //geoserver_url: "http://1.95.137.212:59018/geoserver"
},
[ENV.PROD]: {
//baseURL: 'https://pvcloudservice.satabot.com',
diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx
index fa1357a..e6c7d3f 100644
--- a/src/components/Layout.tsx
+++ b/src/components/Layout.tsx
@@ -274,9 +274,9 @@ export default function AppLayout() {
{/*
*/}
-
装机容量:{currentStation.capacity || '1.00'} MWp
-
并网时间:{currentStation.gridTime || '2024-01-15'}
-
电站地址:{currentStation.address || '浙江省杭州市'}
+ {/*
装机容量:{currentStation.capacity || '1.00'} MWp
+
并网时间:{currentStation.gridTime || '2024-01-15'}
*/}
+
电站地址:{currentStation.address || '河南省林州'}
电站类型:{currentStation.type || '地面电站'}
运行状态:
diff --git a/src/components/Map.jsx b/src/components/Map.jsx
index a37e4a6..3d67e5c 100644
--- a/src/components/Map.jsx
+++ b/src/components/Map.jsx
@@ -490,7 +490,7 @@ const CesiumMap = React.forwardRef(({ ifClear, ifClearPlanLine, ifClearNavLine,
const layerIdentifier = `${workspace}:${layerName}`;
let baseUrl = wmsUrl;
const cesiumLayers = [];
- if (index == 2) {
+ if (index == 2 && from == "other") {
flyToLayer(layerIdentifier, baseUrl, 100);
}
//getLayerBoundsAndFit(wmsUrl, layerName);
diff --git a/src/components/devices/DeviceStatusPage.tsx b/src/components/devices/DeviceStatusPage.tsx
index 030cb29..5816865 100644
--- a/src/components/devices/DeviceStatusPage.tsx
+++ b/src/components/devices/DeviceStatusPage.tsx
@@ -21,6 +21,7 @@ import {
Select,
message,
Modal,
+ Switch,
} from 'antd';
import {
@@ -74,6 +75,17 @@ export default function DeviceStatusPage({
const [planedevices, setPlaneDevices] = useState([]);
const [devicesAll, setDevicesAll] = useState([]);
const [arrivedPoint, setArrivedPoint] = useState(null);//完成点
+ const [isLoopMode, setIsLoopMode] = useState(true);
+
+ // 开关切换回调
+ const handleChange = (checked: boolean) => {
+ setIsLoopMode(checked);
+ if (checked) {
+ console.log('当前作业方式:回字');
+ } else {
+ console.log('当前作业方式:单点');
+ }
+ };
// 获取数据
@@ -582,69 +594,89 @@ export default function DeviceStatusPage({
// 完成功能 - 调用路径规划接口
const handleComplete = async () => {
- if (markedPoints.length < 3) {
- messageApi.warning('请至少标记 3 个点');
- return;
- }
+ //如果时弓子模式
+ if (isLoopMode) {
+ if (markedPoints.length < 3) {
+ messageApi.warning('请至少标记 3 个点');
+ return;
+ }
- try {
- // 准备路径规划请求参数
- const positionPoints = [...markedPoints];
+ try {
+ // 准备路径规划请求参数
+ const positionPoints = [...markedPoints];
- const requestParams = {
- reference: {
- lat: positionPoints[0].lat,
- lon: positionPoints[0].lon,
- },
- heading: 0,
- outer: {
- position: positionPoints.map(point => ({
- lat: point.lat,
- lon: point.lon,
- })),
- sideWidth: 0.0,
- },
- holes: [],
- workType: 0,
- };
+ const requestParams = {
+ reference: {
+ lat: positionPoints[0].lat,
+ lon: positionPoints[0].lon,
+ },
+ heading: 0,
+ outer: {
+ position: positionPoints.map(point => ({
+ lat: point.lat,
+ lon: point.lon,
+ })),
+ sideWidth: 0.0,
+ },
+ holes: [],
+ workType: 0,
+ };
- const response = await fetch('https://servicepathplan.satabot.com/api/path', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify(requestParams),
- });
+ const response = await fetch('https://servicepathplan.satabot.com/api/path', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify(requestParams),
+ });
- const result = await response.json();
+ const result = await response.json();
- if (result) {
- const path = result?.data?.path?.map(p => {
- return {
- lng: p.lon,
- lat: p.lat
- }
- })
- setPoints(path);
- setSavePath({
- path: path, // 存储返回的路径结果
- outer: requestParams?.outer?.position?.map(p => {
+ if (result) {
+ const path = result?.data?.path?.map(p => {
return {
lng: p.lon,
lat: p.lat
}
- }
- ),
- planModel: 0,
- });
- setCompleteFlag(true);
- messageApi.success('路径规划完成');
+ })
+ setPoints(path);
+ setSavePath({
+ path: path, // 存储返回的路径结果
+ outer: requestParams?.outer?.position?.map(p => {
+ return {
+ lng: p.lon,
+ lat: p.lat
+ }
+ }
+ ),
+ planModel: 0,
+ });
+ setCompleteFlag(true);
+ messageApi.success('路径规划完成');
+ }
+ } catch (error) {
+ console.error('路径规划失败:', error);
+ messageApi.error('路径规划失败,请重试');
}
- } catch (error) {
- console.error('路径规划失败:', error);
- messageApi.error('路径规划失败,请重试');
+ } else {
+ const positionPoints = [...markedPoints].map(item => {
+ return {
+ lng: item.lon,
+ lat: item.lat
+
+ }
+ });
+
+ setPoints(positionPoints);
+ setSavePath({
+ path: positionPoints, // 存储返回的路径结果
+ outer: [],
+ planModel: 2,
+ });
+ setCompleteFlag(true);
}
+
};
// 打开保存模态框
@@ -761,6 +793,15 @@ export default function DeviceStatusPage({
已标记 {markedPoints.length} 个点
+
+ 作业方式
+
+ {isLoopMode ? '弓字' : 'AB点'}
+
diff --git a/src/components/devices/RobotTaskPage.tsx b/src/components/devices/RobotTaskPage.tsx
index e703dd1..1824556 100644
--- a/src/components/devices/RobotTaskPage.tsx
+++ b/src/components/devices/RobotTaskPage.tsx
@@ -269,25 +269,25 @@ export default function RobotTaskPage() {
}
return data;
}, [robotRealtimePosition])
- useEffect(() => {
- if (robotRealtimePosition && execute) {
- let warningMsg = '';
+ //useEffect(() => {
+ // if (robotRealtimePosition && execute) {
+ // let warningMsg = '';
- if (robotRealtimePosition?.controlMode == "1") {
- warningMsg = `请切换到远程模式 `;
- } else if (robotRealtimePosition?.qual != "4") {
- warningMsg = '定位未固定';
- } else if (robotRealtimePosition?.headingStatus != "1") {
- warningMsg = '请先初始化航向角';
- }
+ // if (robotRealtimePosition?.controlMode == "1") {
+ // warningMsg = `请切换到远程模式 `;
+ // } else if (robotRealtimePosition?.qual != "4") {
+ // warningMsg = '定位未固定';
+ // } else if (robotRealtimePosition?.headingStatus != "1") {
+ // warningMsg = '请先初始化航向角';
+ // }
- if (warningMsg) {
- utils.message.destroy();
+ // if (warningMsg) {
+ // utils.message.destroy();
- utils.message.warning(warningMsg);
- }
- }
- }, [robotRealtimePosition, execute])
+ // utils.message.warning(warningMsg);
+ // }
+ // }
+ //}, [robotRealtimePosition, execute])
// 获取数据
@@ -356,6 +356,8 @@ export default function RobotTaskPage() {
const res = await getSingleRouteList({ id: selectedPathWork.id });
if (res?.code === 200 && res?.data) {
let pathPoints = [];
+ let outerPoints = [];
+ let method = '';//0弓子 2 回子
try {
// 尝试解析 JSON
if (res.data.jsonData) {
@@ -363,6 +365,9 @@ export default function RobotTaskPage() {
? JSON.parse(res.data.jsonData)
: res.data.jsonData;
pathPoints = data?.path || [];
+ outerPoints = data?.outer || [];
+ method = data?.planModel;
+
}
} catch (err) {
console.error('解析路线数据失败:', err);
@@ -371,7 +376,15 @@ export default function RobotTaskPage() {
if (pathPoints.length === 0) {
utils.message.warning('该路线暂无路径点数据');
}
+ //if (outerPoints.length === 0 && method == 2) {
+ // utils.message.warning('该路线暂无路径点数据');
+ //}
+ //if (method == 0) {
setPoints(pathPoints);
+ //} else {
+ // setPoints(outerPoints);
+
+ //}
} else {
setPoints([]);
}
@@ -475,10 +488,10 @@ export default function RobotTaskPage() {
}
}
- if (!hasPathPoints) {
- utils.message.warning('该路线没有路径点,无法执行');
- return;
- }
+ //if (!hasPathPoints) {
+ // utils.message.warning('该路线没有路径点,无法执行');
+ // return;
+ //}
} catch (err) {
diff --git a/src/components/devices/WayLinePage.tsx b/src/components/devices/WayLinePage.tsx
index 9819312..19e083a 100644
--- a/src/components/devices/WayLinePage.tsx
+++ b/src/components/devices/WayLinePage.tsx
@@ -285,7 +285,7 @@ export default function WayLinePage({ onRefresh }) {
// 航线列表相关状态
const [selectedWayline, setSelectedWayline] = useState(null);
const [rthModalVisible, setRthModalVisible] = useState(false);
- const [tempRthAltitude, setTempRthAltitude] = useState(20);
+ const [tempRthAltitude, setTempRthAltitude] = useState(100);
const [waylineSearch, setWaylineSearch] = useState('');
// 任务控制相关状态
@@ -658,7 +658,7 @@ export default function WayLinePage({ onRefresh }) {
return;
}
setSelectedWayline(wayline);
- setTempRthAltitude(20);
+ setTempRthAltitude(100);
setRthModalVisible(true);
};
useEffect(() => {
diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx
index e0d9484..cb093e0 100644
--- a/src/pages/Home.tsx
+++ b/src/pages/Home.tsx
@@ -344,7 +344,7 @@ export default function StationDashboard() {
title="外部系统"
/>*/}
-
+
diff --git a/src/pages/RealTimeMonitor.tsx b/src/pages/RealTimeMonitor.tsx
index f0b24e8..2ac5c0a 100644
--- a/src/pages/RealTimeMonitor.tsx
+++ b/src/pages/RealTimeMonitor.tsx
@@ -138,7 +138,7 @@ const RealTimeMonitorPage = () => {
/>*/}
-