-
Notifications
You must be signed in to change notification settings - Fork 273
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
Pan & goto with custom events #1065
base: master
Are you sure you want to change the base?
Conversation
54d5a75
to
b8aa7d4
Compare
Instead of binding the DoGoto within the |
This comment was marked as resolved.
This comment was marked as resolved.
The osx ios pipline is a sanity check. The build failure is unrelated. To the pr. In general the waypoint creation is imo ok. The tie in via inputEvents feels wrong. Also replacing the whats here button isnt friendly towards joystick users. I would have tied it in via the MapItemListWidget::OnGotoClicked() function. |
@MaxKellermann do you agree? |
Hey @lordfolken, thank you for the feedback!
I agree to that, but I wanted to start by little steps, without modifying too much, by using the existing "takeoff" pattern. Maybe I could try to refactor both later by using flags (like "home")?
I used the input event for few reasons:
It is not, but that's part of the customisation the custom events allow. The change is not enforced by this PR, the sequence posted is just an example on how to use it.
That would be an extension of this ticket, as I sort of mocked it up in the screenshot (although not really connected to this very PR). |
2f25099
to
f75728b
Compare
Hey @elgandoz this was good work. Are you ready for review? |
d762ea8
to
08901b3
Compare
Hey @lordfolken, sorry for the long absence. The PR was ready for review all along. I now fixed the refactoring conflicts by using
Unfortunately |
2e8219c
to
a65a629
Compare
Your first commit consists almost completely of code you copied. Adding redundant code is not acceptable. |
@MaxKellermann it's obviously the same pattern as the Home waypoint. Do you have at least any suggestion on how it should be done? |
b2470ad
to
ba6b286
Compare
@MaxKellermann @lordfolken, I rebased from master and adjusted the code in order to not have duplicated code. Android and Windows do not build but it doesn't seem related with this PR. |
This now looks concise. @MaxKellermann can we consider merging this? |
No, because the overall concept of this implementation is confusing and too complicated.
Now explain to me what this does, and why it is written that way. Who, except for the submitter, will ever be able to come up with this configuration? So .. what this does is (1) add a new waypoint at the current location. How do we know it's the current location? Why does it say "goto" when it's not about "goto" at all? Why doesn't it say "current location" instead? Confusing! Then (2) it does "goto" to this new waypoint. Uhhh... which waypoint? Not the "goto" waypoint, but an arbitrary waypoint whose name just happens to be "(goto)" (yes, name with parentheses). But ... why that exact name? Because it's an undocumented implementation detail of the current code, which can change any time, for example when somebody decides to translate the name. And what happens if this feature was used twice? Then we have two waypoints with that name. Which one will be used? I have no idea. This feature is too complicated, confusing, fragile and undocumented. |
I don't think it's that different from what currently already happens in the default.xci here and here
I am a bit confused by this statement... it creates a waypoint under the sight cross, where the user would like to "go to" (like the event/label name).
As I already explained in a previous comment, I used that parenthesis pattern only because the same arbitrary name is used for "takeoff" (displayed
But isn't it the same for
If used twice it removes the previously created waypoint with the same name, just like it happens for About the documentation, this is lacking and it took me a moment to understand what the current code is doing (see #509). I previously asked for recommendation on what can be done better but I received none. |
ba6b286
to
b280d2a
Compare
Hey @lordfolken, I saw you marked this for the next release. I was wondering if you still want me to:
Also, as separate PR, I can have a look into using |
Technically its the release after that. The strategy is to stabilize and fix all the current bugs in 7.42. for the moment. I also like the feature's functionality and i think it should be in XCSoar.
The string as such is fine with me to be "goto". I'm also fine with the parentheses, to indicate to the user that this waypoint is generated.
The main problem i see with extending the AddTempPoint() function, is that we currently have no way of differentiating between a user provided waypoint and a generated one. A string match isn't enough to isolate this from the user playload. (this was already a problem with the current implemenation...) There should be a flag/enum in Waypoint.hpp to indicate that this waypoint is programmatically generated.
i'd go for name as this is also in the waypoint struct.
Pan ultimate that should be the goal. |
Rebased and renamed variable |
Brief summary of the changes
goto
for theAddWaypoint
event: this creates a temporary waypoint "(goto)"and sets it as navigation target.GotoLookup
event: parameter will be looked up within the waypoints names, if provided.Further informations
The goal is to provide an easy way for the user to configure an event in order to "Pan & Go" to any point on the map, particularly useful for "improvised" XC, very common in paragliding.
5_6205962494129735712.mp4
Sample of the
custom-events.xci
used in the above demo:Download here: custom-events.xci.txt
(Remove the .txt at the end)
This functionality is a common pattern in other freeflying computers.
A possible enhancement of this feature would be enabling the "Goto" button (and maybe the first page of Details) in the "Map element at this location" dialog.
Related issues and discussions