Skip to content

Commit

Permalink
Add missing documentation, improve background mode documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Dec 27, 2024
1 parent 54611d4 commit 838cf8f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
12 changes: 9 additions & 3 deletions src/core/positioning/positioning.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,23 @@ class Positioning : public QObject
void setLogging( bool logging );

/**
* Returns TRUE if the background mode is active.
* Returns TRUE if the background mode is active. When activated, position information details
* will not be signaled but instead saved to disk until deactivated.
* \see getBackgroundPositionInformation()
*/
bool backgroundMode() const;

/**
* Sets whether the background mode is active.
* Sets whether the background mode is active. When activated, position information details
* will not be signaled but instead saved to disk until deactivated.
* \see getBackgroundPositionInformation()
*/
void setBackgroundMode( bool backgroundMode );

/**
* Returns a list of position information collected while background mode is turned on.
* Returns a list of position information collected while background mode is active.
* \see backgroundMode()
* \see setBackgroundMode()
*/
Q_INVOKABLE QList<GnssPositionInformation> getBackgroundPositionInformation() const;

Expand Down
12 changes: 9 additions & 3 deletions src/core/positioning/positioningsource.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,23 @@ class PositioningSource : public QObject
void setLogging( bool logging );

/**
* Returns TRUE if the background mode is active.
* Returns TRUE if the background mode is active. When activated, position information details
* will not be signaled but instead saved to disk until deactivated.
* \see getBackgroundPositionInformation()
*/
bool backgroundMode() const { return mBackgroundMode; }

/**
* Sets whether the background mode is active.
* Sets whether the background mode is active. When activated, position information details
* will not be signaled but instead saved to disk until deactivated.
* \see getBackgroundPositionInformation()
*/
void setBackgroundMode( bool backgroundMode );

/**
* Returns a list of position information collected while background mode is turned on.
* Returns a list of position information collected while background mode is active.
* \see backgroundMode()
* \see setBackgroundMode()
*/
Q_INVOKABLE QList<GnssPositionInformation> getBackgroundPositionInformation() const;

Expand Down
9 changes: 9 additions & 0 deletions src/core/tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ class Tracker : public QObject

explicit Tracker( QgsVectorLayer *vectorLayer );

//! Returns the rubber band model used to generate the track geometry
RubberbandModel *rubberbandModel() const;
//! Sets the rubber band model used to generate the track geometry
void setRubberbandModel( RubberbandModel *rubberbandModel );

//! Returns the feature model used to generate the track attributes
FeatureModel *featureModel() const;
//! Sets the feature model used to generate the track attributes
void setFeatureModel( FeatureModel *featureModel );

//! Returns the minimum time interval constraint between each tracked point
Expand Down Expand Up @@ -133,10 +137,15 @@ class Tracker : public QObject
//! Returns whether the tracker is replaying positions
bool isReplaying() const { return mIsReplaying; }

//! Starts tracking
void start();
//! Stops tracking
void stop();

//! Process the given position information and projected position passed onto the tracker
Q_INVOKABLE void processPositionInformation( const GnssPositionInformation &positionInformation, const QgsPoint &projectedPosition );

//! Replays a list of position information taking into account the tracker settings
void replayPositionInformationList( const QList<GnssPositionInformation> &positionInformationList, QgsQuickCoordinateTransformer *coordinateTransformer = nullptr );

signals:
Expand Down
5 changes: 3 additions & 2 deletions src/core/trackingmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class TrackingModel : public QAbstractItemModel
Q_INVOKABLE void startTracker( QgsVectorLayer *layer );
//! Stops the tracking session of the provided vector \a layer.
Q_INVOKABLE void stopTracker( QgsVectorLayer *layer );
//! Stops the tracking session of the provided vector \a layer.
Q_INVOKABLE void replayPositionInformationList( const QList<GnssPositionInformation> &positionInformationList, QgsQuickCoordinateTransformer *coordinateTransformer = nullptr );
//! Sets whether the tracking session rubber band is \a visible.
Q_INVOKABLE void setTrackerVisibility( QgsVectorLayer *layer, bool visible );
//! Returns TRUE if the \a featureId is attached to a vector \a layer tracking session.
Expand All @@ -70,6 +68,9 @@ class TrackingModel : public QAbstractItemModel
//! Returns the tracker for the vector \a layer if a tracking session is present, otherwise returns NULLPTR.
Tracker *trackerForLayer( QgsVectorLayer *layer );

//! Replays a list of position information for all active trackers
Q_INVOKABLE void replayPositionInformationList( const QList<GnssPositionInformation> &positionInformationList, QgsQuickCoordinateTransformer *coordinateTransformer = nullptr );

void reset();

/**
Expand Down

0 comments on commit 838cf8f

Please sign in to comment.