十字准星 模式 作业区域模式 一系列完成
This commit is contained in:
@@ -339,16 +339,12 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
|||||||
)
|
)
|
||||||
.toList(),
|
.toList(),
|
||||||
),
|
),
|
||||||
|
|
||||||
'outer': jsonEncode(
|
'outer': jsonEncode(
|
||||||
_markedPoints
|
gcjOuterPoints.map((point) {
|
||||||
.map(
|
final wgs84 = gcj02ToWgs84(point.latitude, point.longitude);
|
||||||
(point) => {
|
return {'lng': wgs84.longitude, 'lat': wgs84.latitude};
|
||||||
// 外边界点数组
|
}).toList(),
|
||||||
'lng': point.longitude,
|
|
||||||
'lat': point.latitude,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.toList(),
|
|
||||||
),
|
),
|
||||||
'planModel': _currentWorkMode == WorkMode.bow ? 0 : 2, // 作业模式值
|
'planModel': _currentWorkMode == WorkMode.bow ? 0 : 2, // 作业模式值
|
||||||
};
|
};
|
||||||
@@ -429,6 +425,9 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_markedPoints.clear(); // 清空打点
|
_markedPoints.clear(); // 清空打点
|
||||||
gcjPathPoints.clear(); // 清空路径
|
gcjPathPoints.clear(); // 清空路径
|
||||||
|
gcjOuterPoints.clear(); // 清空外边界
|
||||||
|
|
||||||
|
_isPanelOpen = false; // 关闭操作面板
|
||||||
});
|
});
|
||||||
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('地块「$plotName」保存成功!'), backgroundColor: Colors.green));
|
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('地块「$plotName」保存成功!'), backgroundColor: Colors.green));
|
||||||
@@ -825,6 +824,7 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
|||||||
_selectedPlot = plot;
|
_selectedPlot = plot;
|
||||||
_isListBoxOpen = false;
|
_isListBoxOpen = false;
|
||||||
_isWorkPanelOpen = true;
|
_isWorkPanelOpen = true;
|
||||||
|
_isPanelOpen = false; // 关闭操作面板,专注作业界面
|
||||||
});
|
});
|
||||||
// 移动地图到中心
|
// 移动地图到中心
|
||||||
List<LatLng> allPoints = [];
|
List<LatLng> allPoints = [];
|
||||||
@@ -843,6 +843,7 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
|||||||
_selectedPlot = plot;
|
_selectedPlot = plot;
|
||||||
_isListBoxOpen = false;
|
_isListBoxOpen = false;
|
||||||
_isWorkPanelOpen = true;
|
_isWorkPanelOpen = true;
|
||||||
|
_isPanelOpen = false; // 关闭操作面板,专注作业界面
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -852,6 +853,7 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
|||||||
_selectedPlot = plot;
|
_selectedPlot = plot;
|
||||||
_isListBoxOpen = false;
|
_isListBoxOpen = false;
|
||||||
_isWorkPanelOpen = true;
|
_isWorkPanelOpen = true;
|
||||||
|
_isPanelOpen = false; // 关闭操作面板,专注作业界面
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1317,6 +1319,7 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
|||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
gcjOuterPoints = List.from(_markedPoints);
|
gcjOuterPoints = List.from(_markedPoints);
|
||||||
|
_markedPoints.clear();
|
||||||
});
|
});
|
||||||
moveMapToPointsCenter(gcjPathPoints);
|
moveMapToPointsCenter(gcjPathPoints);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,10 +80,7 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
_buildTabContent(),
|
_buildTabContent(),
|
||||||
// 底部标签页切换(修复背景色切换+状态更新)
|
// 底部标签页切换(修复背景色切换+状态更新)
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: Colors.grey[200], borderRadius: BorderRadius.circular(8)),
|
||||||
color: Colors.grey[200],
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -98,20 +95,9 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
// 选中地块时背景为白色,否则透明
|
// 选中地块时背景为白色,否则透明
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: _currentTab == '地块' ? Colors.white : Colors.transparent, borderRadius: BorderRadius.circular(8)),
|
||||||
color: _currentTab == '地块'
|
|
||||||
? Colors.white
|
|
||||||
: Colors.transparent,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: const Center(
|
child: const Center(
|
||||||
child: Text(
|
child: Text('地块', style: TextStyle(color: Colors.black87, fontSize: 16)),
|
||||||
'地块',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.black87,
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -128,20 +114,9 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
// 选中航线时背景为白色,否则透明
|
// 选中航线时背景为白色,否则透明
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: _currentTab == '航线' ? Colors.white : Colors.transparent, borderRadius: BorderRadius.circular(8)),
|
||||||
color: _currentTab == '航线'
|
|
||||||
? Colors.white
|
|
||||||
: Colors.transparent,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: const Center(
|
child: const Center(
|
||||||
child: Text(
|
child: Text('航线', style: TextStyle(color: Colors.black87, fontSize: 16)),
|
||||||
'航线',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.black87,
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -168,7 +143,7 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
DropdownButton<RobotMode>(
|
DropdownButton<RobotMode>(
|
||||||
value: _robotMode,
|
value: _robotMode,
|
||||||
items: const [
|
items: const [
|
||||||
DropdownMenuItem(value: RobotMode.point, child: Text("地图打点")),
|
DropdownMenuItem(value: RobotMode.point, child: Text("十字准星")),
|
||||||
DropdownMenuItem(value: RobotMode.robot, child: Text("机器人模式")),
|
DropdownMenuItem(value: RobotMode.robot, child: Text("机器人模式")),
|
||||||
],
|
],
|
||||||
onChanged: (v) {
|
onChanged: (v) {
|
||||||
@@ -187,10 +162,7 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(color: Color(0xFF00C853), shape: BoxShape.circle),
|
||||||
color: Color(0xFF00C853),
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
child: const Icon(Icons.add, color: Colors.white, size: 32),
|
child: const Icon(Icons.add, color: Colors.white, size: 32),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -246,10 +218,7 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
const Text(
|
const Text('作业行距(米)', style: TextStyle(fontSize: 16, color: Colors.black87)),
|
||||||
'作业行距(米)',
|
|
||||||
style: TextStyle(fontSize: 16, color: Colors.black87),
|
|
||||||
),
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
// 减号按钮
|
// 减号按钮
|
||||||
@@ -265,23 +234,13 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: 30,
|
width: 30,
|
||||||
height: 30,
|
height: 30,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: Colors.grey[200], shape: BoxShape.circle),
|
||||||
color: Colors.grey[200],
|
child: const Icon(Icons.remove, size: 16, color: Colors.black87),
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
child: const Icon(
|
|
||||||
Icons.remove,
|
|
||||||
size: 16,
|
|
||||||
color: Colors.black87,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
// 行距数值
|
// 行距数值
|
||||||
Text(
|
Text('${_operationDistance.toStringAsFixed(1)}', style: const TextStyle(fontSize: 16, color: Colors.black87)),
|
||||||
'${_operationDistance.toStringAsFixed(1)}',
|
|
||||||
style: const TextStyle(fontSize: 16, color: Colors.black87),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
// 加号按钮
|
// 加号按钮
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
@@ -294,15 +253,8 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: 30,
|
width: 30,
|
||||||
height: 30,
|
height: 30,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: Colors.grey[200], shape: BoxShape.circle),
|
||||||
color: Colors.grey[200],
|
child: const Icon(Icons.add, size: 16, color: Colors.black87),
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
child: const Icon(
|
|
||||||
Icons.add,
|
|
||||||
size: 16,
|
|
||||||
color: Colors.black87,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -314,10 +266,7 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
const Text(
|
const Text('航线方向', style: TextStyle(fontSize: 16, color: Colors.black87)),
|
||||||
'航线方向',
|
|
||||||
style: TextStyle(fontSize: 16, color: Colors.black87),
|
|
||||||
),
|
|
||||||
// 设置按钮
|
// 设置按钮
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@@ -328,9 +277,7 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: const Color(0xFF00C853),
|
backgroundColor: const Color(0xFF00C853),
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
|
||||||
borderRadius: BorderRadius.circular(6),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: const Text('设置'),
|
child: const Text('设置'),
|
||||||
),
|
),
|
||||||
@@ -342,12 +289,7 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 构建操作按钮
|
// 构建操作按钮
|
||||||
Widget _buildActionButton(
|
Widget _buildActionButton(IconData icon, String label, bool isEnabled, VoidCallback onTap) {
|
||||||
IconData icon,
|
|
||||||
String label,
|
|
||||||
bool isEnabled,
|
|
||||||
VoidCallback onTap,
|
|
||||||
) {
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: isEnabled ? onTap : null,
|
onTap: isEnabled ? onTap : null,
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -355,17 +297,11 @@ class _BottomOperationPanelState extends State<BottomOperationPanel> {
|
|||||||
Container(
|
Container(
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: isEnabled ? Colors.blue : Colors.grey[300], shape: BoxShape.circle),
|
||||||
color: isEnabled ? Colors.blue : Colors.grey[300],
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
child: Icon(icon, color: Colors.white),
|
child: Icon(icon, color: Colors.white),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
Text(
|
Text(label, style: TextStyle(color: isEnabled ? Colors.black : Colors.grey)),
|
||||||
label,
|
|
||||||
style: TextStyle(color: isEnabled ? Colors.black : Colors.grey),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user