机器状态数据和地图切换,系统配置页面

This commit is contained in:
2026-11-06 08:49:21 +08:00
parent 84eec7da96
commit 4e92398349
12 changed files with 3660 additions and 304 deletions

View File

@@ -0,0 +1,57 @@
import 'package:latlong2/latlong.dart';
/// 一键返航方案的领域模型:返航点 + 线上禁行区 + 场站上下文。
/// 只描述业务数据,后端字段名(size_x / source / tempObstaclePoints 等)
/// 全部留给 data 层网关映射,页面与领域层不感知。
/// 单个返航点:坐标 + 绑定的设备 SN(MC700-…)+ 名称
class ReturnRestPoint {
const ReturnRestPoint({
required this.position,
required this.alias,
this.bindDeviceId,
});
final LatLng position;
final String alias;
final String? bindDeviceId;
}
/// 单个障碍(禁行区):中心 + 尺寸(米) + 形状 + 名称 + 来源
class ReturnObstaclePoint {
const ReturnObstaclePoint({
required this.center,
required this.alias,
this.shapeType = 'rect',
this.sizeX = 0,
this.sizeY = 0,
this.source = 'platform',
});
final LatLng center;
final String alias;
final String shapeType; // rect / circle
final double sizeX; // 宽(米,对应经度方向)
final double sizeY; // 高(米,对应纬度方向)
final String source; // 默认 platform
}
/// 一次返航方案提交(对应 /system/siteMapInfo/save)
class ReturnPlanDraft {
const ReturnPlanDraft({
required this.siteId,
required this.orgId,
this.restPoints = const <ReturnRestPoint>[],
this.obstacles = const <ReturnObstaclePoint>[],
this.id,
});
/// siteMapInfo 主键:更新已有方案时传,新建传 null(省略由后端插入)
final int? id;
final int siteId;
final int orgId;
final List<ReturnRestPoint> restPoints;
final List<ReturnObstaclePoint> obstacles;
bool get isEmpty => restPoints.isEmpty && obstacles.isEmpty;
}