ab点
This commit is contained in:
16
env.js
16
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',
|
||||
|
||||
@@ -274,9 +274,9 @@ export default function AppLayout() {
|
||||
|
||||
{/* <img src="电站图片地址" style={{ width: '100%', borderRadius: 4, marginBottom: 8 }} alt="电站" /> */}
|
||||
<div style={{ fontSize: 11, color: '#666', lineHeight: 1.8 }}>
|
||||
<div>装机容量:{currentStation.capacity || '1.00'} MWp</div>
|
||||
<div>并网时间:{currentStation.gridTime || '2024-01-15'}</div>
|
||||
<div>电站地址:{currentStation.address || '浙江省杭州市'}</div>
|
||||
{/*<div>装机容量:{currentStation.capacity || '1.00'} MWp</div>
|
||||
<div>并网时间:{currentStation.gridTime || '2024-01-15'}</div>*/}
|
||||
<div>电站地址:{currentStation.address || '河南省林州'}</div>
|
||||
<div>电站类型:{currentStation.type || '地面电站'}</div>
|
||||
<div style={{ marginTop: 4, display: 'flex', alignItems: 'center', color: '#41ad0a' }}>
|
||||
<span>运行状态:</span>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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({
|
||||
<Text type="secondary">已标记 {markedPoints.length} 个点</Text>
|
||||
</div>
|
||||
<Space size="middle">
|
||||
<Space>
|
||||
<span>作业方式</span>
|
||||
<Switch
|
||||
size="small"
|
||||
checked={isLoopMode}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
<span>{isLoopMode ? '弓字' : 'AB点'}</span>
|
||||
</Space>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={handleMarkPoint}
|
||||
@@ -778,7 +819,7 @@ export default function DeviceStatusPage({
|
||||
type="primary"
|
||||
ghost
|
||||
onClick={handleComplete}
|
||||
disabled={markedPoints.length < 3}
|
||||
disabled={markedPoints.length < 2}
|
||||
>
|
||||
完成
|
||||
</Button>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -344,7 +344,7 @@ export default function StationDashboard() {
|
||||
title="外部系统"
|
||||
/>*/}
|
||||
|
||||
<CesiumMap />
|
||||
<CesiumMap from="other" />
|
||||
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
@@ -138,7 +138,7 @@ const RealTimeMonitorPage = () => {
|
||||
/>*/}
|
||||
|
||||
|
||||
<CesiumMap />
|
||||
<CesiumMap from="other" />
|
||||
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user