Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduction of centering to GPS when starting to record new feature #3509

Merged
merged 9 commits into from
Jun 19, 2024

Conversation

VitorVieiraZ
Copy link
Contributor

@VitorVieiraZ VitorVieiraZ commented Jun 13, 2024

newGpsCenteringFeature.1.mp4

Development and functionality of the feature based on: #3506

Resolves #3506

Copy link

Pull Request Test Coverage Report for Build 9501693256

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 59.922%

Files with Coverage Reduction New Missed Lines %
input/core/merginuserinfo.cpp 1 75.18%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: 0.008%
Covered Lines: 7676
Relevant Lines: 12810

💛 - Coveralls

2 similar comments
Copy link

Pull Request Test Coverage Report for Build 9501693256

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 59.922%

Files with Coverage Reduction New Missed Lines %
input/core/merginuserinfo.cpp 1 75.18%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: 0.008%
Covered Lines: 7676
Relevant Lines: 12810

💛 - Coveralls

Copy link

Pull Request Test Coverage Report for Build 9501693256

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 59.922%

Files with Coverage Reduction New Missed Lines %
input/core/merginuserinfo.cpp 1 75.18%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: 0.008%
Covered Lines: 7676
Relevant Lines: 12810

💛 - Coveralls

Copy link

Pull Request Test Coverage Report for Build 9503484819

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 59.922%

Files with Coverage Reduction New Missed Lines %
input/core/merginuserinfo.cpp 1 75.18%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: 0.008%
Covered Lines: 7676
Relevant Lines: 12810

💛 - Coveralls

2 similar comments
Copy link

Pull Request Test Coverage Report for Build 9503484819

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 59.922%

Files with Coverage Reduction New Missed Lines %
input/core/merginuserinfo.cpp 1 75.18%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: 0.008%
Covered Lines: 7676
Relevant Lines: 12810

💛 - Coveralls

Copy link

Pull Request Test Coverage Report for Build 9503484819

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 59.922%

Files with Coverage Reduction New Missed Lines %
input/core/merginuserinfo.cpp 1 75.18%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: 0.008%
Covered Lines: 7676
Relevant Lines: 12810

💛 - Coveralls

@VitorVieiraZ VitorVieiraZ changed the title WIP - Reintroduction of centering to GPS when starting to record new feature Reintroduction of centering to GPS when starting to record new feature Jun 13, 2024
Copy link
Collaborator

@tomasMizera tomasMizera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, thanks @VitorVieiraZ 🚀

@uclaros can I ask you to have a look at this PR too? You were adjusting the centering logic recently :)

app/qml/map/MMMapController.qml Outdated Show resolved Hide resolved
@tomasMizera tomasMizera requested a review from uclaros June 14, 2024 06:48
Copy link
Contributor

@uclaros uclaros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should the behavior be if location is not available yet? Just a message or should the map jump as soon as a location is available?

What should happen if the user moves before clicking record?

My take on those is that we should be setting MMMapController.centerToGPS = true, which means we get the green dot on the GPS button plus map position is updated when location is updated.
recordingMapTool.centeredToGPS seems to be bound to that so should be updated.

app/qml/map/MMRecordingTools.qml Outdated Show resolved Hide resolved
Copy link

Pull Request Test Coverage Report for Build 9519440944

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 59.922%

Files with Coverage Reduction New Missed Lines %
input/core/merginuserinfo.cpp 1 75.18%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: 0.008%
Covered Lines: 7676
Relevant Lines: 12810

💛 - Coveralls

2 similar comments
Copy link

Pull Request Test Coverage Report for Build 9519440944

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 59.922%

Files with Coverage Reduction New Missed Lines %
input/core/merginuserinfo.cpp 1 75.18%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: 0.008%
Covered Lines: 7676
Relevant Lines: 12810

💛 - Coveralls

Copy link

Pull Request Test Coverage Report for Build 9519440944

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 59.922%

Files with Coverage Reduction New Missed Lines %
input/core/merginuserinfo.cpp 1 75.18%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: 0.008%
Covered Lines: 7676
Relevant Lines: 12810

💛 - Coveralls

This comment was marked as outdated.

2 similar comments
Copy link

Pull Request Test Coverage Report for Build 9522267694

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.008%) to 59.906%

Files with Coverage Reduction New Missed Lines %
input/app/attributes/attributecontroller.cpp 1 77.37%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: -0.008%
Covered Lines: 7674
Relevant Lines: 12810

💛 - Coveralls

Copy link

Pull Request Test Coverage Report for Build 9522267694

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 35 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.008%) to 59.906%

Files with Coverage Reduction New Missed Lines %
input/app/attributes/attributecontroller.cpp 1 77.37%
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: -0.008%
Covered Lines: 7674
Relevant Lines: 12810

💛 - Coveralls

@tomasMizera tomasMizera self-requested a review June 17, 2024 06:09
Copy link
Collaborator

@tomasMizera tomasMizera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update the code as we discussed

Copy link

Pull Request Test Coverage Report for Build 9550028458

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 34 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 59.906%

Files with Coverage Reduction New Missed Lines %
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: -0.008%
Covered Lines: 7674
Relevant Lines: 12810

💛 - Coveralls

2 similar comments
Copy link

Pull Request Test Coverage Report for Build 9550028458

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 34 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 59.906%

Files with Coverage Reduction New Missed Lines %
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: -0.008%
Covered Lines: 7674
Relevant Lines: 12810

💛 - Coveralls

Copy link

Pull Request Test Coverage Report for Build 9550028458

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 34 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 59.906%

Files with Coverage Reduction New Missed Lines %
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: -0.008%
Covered Lines: 7674
Relevant Lines: 12810

💛 - Coveralls

Copy link

Pull Request Test Coverage Report for Build 9567578009

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 34 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 59.906%

Files with Coverage Reduction New Missed Lines %
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: -0.008%
Covered Lines: 7674
Relevant Lines: 12810

💛 - Coveralls

2 similar comments
Copy link

Pull Request Test Coverage Report for Build 9567578009

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 34 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 59.906%

Files with Coverage Reduction New Missed Lines %
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: -0.008%
Covered Lines: 7674
Relevant Lines: 12810

💛 - Coveralls

Copy link

Pull Request Test Coverage Report for Build 9567578009

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 34 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 59.906%

Files with Coverage Reduction New Missed Lines %
input/app/appsettings.cpp 34 71.12%
Totals Coverage Status
Change from base Build 9499997026: -0.008%
Covered Lines: 7674
Relevant Lines: 12810

💛 - Coveralls

@tomasMizera tomasMizera requested a review from uclaros June 19, 2024 07:31
Copy link
Collaborator

@tomasMizera tomasMizera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @uclaros, can you check once again please? It looks good to me. There is one change of logic - updatePosition() is now called after we change the state, not before. However, I could not think of a scenario where this would be an issue

Comment on lines 97 to 101
if ( __appSettings.autolockPosition ) { // center to GPS
if ( gpsStateGroup.state === "unavailable" ) {
__notificationModel.addError( "GPS currently unavailable." )
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We completely disable recording when GPS is unavailable and autolock is on?
In that case maybe we should also handle the case when GPS is lost while recording?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, no, we need to continue even without GPS signal

Comment on lines 144 to 146
// We call this first because when previous state is 'view' and `centeredToGPS` is true
// the map may still not be centered. It's only centered after a certain threshold is exceeded.
updatePosition()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is no longer true: we don't call this first, we actually call this last!
Does that mean we'll get a first point when root.recordingStarted() is called which may not be on the actual GPS position?
Why not call updatePosition() right after root.centeredToGPS = true ?

__notificationModel.addError( "GPS currently unavailable." )
}
else {
root.centeredToGPS = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we moved this out of the GPS availability check, does it mean the map would re-center as soon as gps position is actually available? If yes, that could be useful, but I'm OK with merging it as it is now!

Copy link
Contributor Author

@VitorVieiraZ VitorVieiraZ Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this scenario, it would center even if the user decides to uncheck "auto-lock" property in recording settings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I mean like:

        if ( __appSettings.autolockPosition ) { // center to GPS
          root.centeredToGPS = true
          if ( gpsStateGroup.state === "unavailable" ) {
            __notificationModel.addError( "GPS currently unavailable." )
          }
          else {
            updatePosition()
          }
        }

@tomasMizera
Copy link
Collaborator

Unrelated test failure

@tomasMizera tomasMizera merged commit eb2b626 into master Jun 19, 2024
11 of 12 checks passed
@tomasMizera tomasMizera deleted the gps/centeringFeature branch June 19, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reintroduction of centering to GPS when starting to record new feature
4 participants