完善自主作业下发、暂停恢复和轨迹保留

This commit is contained in:
2026-11-21 14:51:37 +08:00
parent a37c448391
commit 4a1ce4199d
18 changed files with 556 additions and 127 deletions

View File

@@ -53,7 +53,7 @@ void main() {
expect(recorder.hasCompletedPoints, isFalse);
});
test('首个到达点切换为到达点加最新车位,不保留之前的GPS折线', () {
test('首个到达点不清除之前的GPS折线,后续定位继续累计', () {
sync();
recorder.addPosition(a);
recorder.addPosition(b);
@@ -62,7 +62,7 @@ void main() {
expect(recorder.points, [a, b]);
recorder.addPosition(c);
recorder.addPosition(d);
expect(recorder.points, [a, d]);
expect(recorder.points, [a, b, c, d]);
});
test('仅收到一个到达点时,下一次定位就能组成绿色线段', () {
@@ -82,7 +82,7 @@ void main() {
expect(recorder.addPosition(c), isFalse);
});
test('暂停冻结尾点,恢复后接入当前位置', () {
test('暂停保留旧路线,恢复后从原路线继续累计', () {
sync(completed: [a]);
recorder.addPosition(b);
sync(recording: false, completed: [a]);
@@ -90,10 +90,10 @@ void main() {
expect(recorder.points, [a, b]);
sync(completed: [a]);
expect(recorder.addPosition(c), isTrue);
expect(recorder.points, [a, c]);
expect(recorder.points, [a, b, c]);
});
test('结束隐藏并清空,不能带着旧GPS开始下一次记录', () {
test('暂时隐藏保留同任务轨迹,显式重置后才清空', () {
sync();
recorder.addPosition(a);
recorder.addPosition(b);
@@ -101,7 +101,11 @@ void main() {
expect(recorder.points, isEmpty);
sync();
recorder.addPosition(c);
expect(recorder.points, [c]);
expect(recorder.points, [a, b, c]);
recorder.reset();
sync();
recorder.addPosition(d);
expect(recorder.points, [d]);
});
test('切换任务或设备清理之前的GPS和到达点', () {