Skip to content

Commit

Permalink
Add speed (m/s) and movement direction instead of orientation, insure…
Browse files Browse the repository at this point in the history
… notification only shown when positioning is active
  • Loading branch information
nirvn committed Jan 12, 2025
1 parent 55e182d commit ef6d1ed
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/service/qfieldpositioningservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,15 @@ QFieldPositioningService::QFieldPositioningService( int &argc, char **argv )
}
} );
}
}

void QFieldPositioningService::triggerShowNotification()
{
if ( mPositioningSource->positionInformation()->active() )
{
const GnssPositionInformation pos = mPositioningSource->positionInformation();
QJniObject message = QJniObject::fromString( tr( "Latitude %1 | Longitude %2 | Altitude %3 | Orientation %4" ).arg( QLocale::system().toString( pos.latitude(), 'f', 7 ), QLocale::system().toString( pos.longitude(), 'f', 7 ), QLocale::system().toString( pos.elevation(), 'f', 3 ), QLocale::system().toString( mPositioningSource->orientation(), 'f', 1 ) ) );
QJniObject::callStaticMethod<void>( "ch/opengis/" APP_PACKAGE_NAME "/QFieldPositioningService",
"triggerShowNotification",
message.object<jstring>(),
true );
}
const GnssPositionInformation pos = mPositioningSource->positionInformation();
QJniObject message = QJniObject::fromString( tr( "Latitude %1 | Longitude %2 | Altitude %3 m | Speed %4 m/s | Direction %5°" ).arg( QLocale::system().toString( pos.latitude(), 'f', 7 ), QLocale::system().toString( pos.longitude(), 'f', 7 ), QLocale::system().toString( pos.elevation(), 'f', 3 ), QLocale::system().toString( pos.speed(), 'f', 1 ), QLocale::system().toString( pos.direction(), 'f', 1 ) ) );
QJniObject::callStaticMethod<void>( "ch/opengis/" APP_PACKAGE_NAME "/QFieldPositioningService",
"triggerShowNotification",
message.object<jstring>(),
true );
}

void QFieldPositioningService::triggerReturnNotification()
Expand Down

0 comments on commit ef6d1ed

Please sign in to comment.