36 Q_PROPERTY(
bool active READ active WRITE setActive NOTIFY activeChanged)
37 Q_PROPERTY(QGeoCoordinate gcsPosition READ gcsPosition WRITE setGcsPosition NOTIFY gcsPositionChanged)
38 Q_PROPERTY(QGeoCoordinate vehicleCoordinate READ vehicleCoordinate WRITE setVehicleCoordinate NOTIFY
39 vehicleCoordinateChanged)
40 Q_PROPERTY(
bool allowGCSLocationCenter READ allowGCSLocationCenter WRITE setAllowGCSLocationCenter NOTIFY
41 allowGCSLocationCenterChanged)
42 Q_PROPERTY(
bool allowVehicleLocationCenter READ allowVehicleLocationCenter WRITE setAllowVehicleLocationCenter
43 NOTIFY allowVehicleLocationCenterChanged)
44 Q_PROPERTY(
bool centerGCSWhenVehicleValid READ centerGCSWhenVehicleValid WRITE setCenterGCSWhenVehicleValid NOTIFY
45 centerGCSWhenVehicleValidChanged)
46 Q_PROPERTY(
bool keepVehicleCentered READ keepVehicleCentered WRITE setKeepVehicleCentered NOTIFY
47 keepVehicleCenteredChanged)
48 Q_PROPERTY(
bool userInteracting READ userInteracting WRITE setUserInteracting NOTIFY userInteractingChanged)
49 Q_PROPERTY(
bool animating READ animating WRITE setAnimating NOTIFY animatingChanged)
50 Q_PROPERTY(
bool firstVehiclePositionReceived READ firstVehiclePositionReceived WRITE setFirstVehiclePositionReceived
51 NOTIFY firstVehiclePositionReceivedChanged)
57 static constexpr int kResumeDelayMs = 10000;
59 bool active()
const {
return _active; }
61 void setActive(
bool active);
65 void setGcsPosition(
const QGeoCoordinate& position);
69 void setVehicleCoordinate(
const QGeoCoordinate& coordinate);
73 void setAllowGCSLocationCenter(
bool allow);
77 void setAllowVehicleLocationCenter(
bool allow);
84 void setCenterGCSWhenVehicleValid(
bool center);
88 void setKeepVehicleCentered(
bool keep);
92 void setUserInteracting(
bool interacting);
97 void setAnimating(
bool animating);
103 void setFirstVehiclePositionReceived(
bool received);
110 Q_INVOKABLE
void evaluateInsetFollow(
const QPointF& vehicleScreenPoint,
const QRectF& centerRect,
111 const QVariantList& cornerRects);
113#ifdef QGC_UNITTEST_BUILD
114 void setResumeDelayMsForTest(
int ms) { _resumeTimer.setInterval(ms); }
120 void centerMap(
const QGeoCoordinate& coordinate,
bool firstPosition);
136 bool _paused()
const {
return _userInteracting || _resumeTimer.isActive(); }
139 bool _evaluateVehicleOneShot();
140 void _evaluateGCSOneShot();
141 void _resumeFollowing();
144 QGeoCoordinate _gcsPosition;
145 QGeoCoordinate _vehicleCoordinate;
146 bool _allowGCSLocationCenter =
false;
147 bool _allowVehicleLocationCenter =
false;
148 bool _centerGCSWhenVehicleValid =
false;
149 bool _keepVehicleCentered =
false;
150 bool _userInteracting =
false;
151 bool _animating =
false;
152 bool _firstVehiclePositionReceived =
false;
153 bool _firstGCSPositionReceived =
false;