-
Notifications
You must be signed in to change notification settings - Fork 123
Allow long-pressing on VOR Locations #259
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
base: master
Are you sure you want to change the base?
Conversation
Navaids in long-pressed - separate radial from distance with color
Fix redraw of Plan
Fix redraw of Plan (obvious bug fix)
…power consumption.
… reduce power consumption." This reverts commit 99219e0. modified: app/src/main/java/com/ds/avare/PlanActivity.java modified: app/src/main/java/com/ds/avare/webinfc/WebAppPlanInterface.java
Winds Aloft in a nicer table which can be shortened to a altitude in Preferences
| private AnimateButton mAnimateDownload; | ||
| private AnimateButton mAnimatePref; | ||
| private String mAirportPressed; | ||
| private LongPressedDestination mDestinationPressed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed because it's not only an airport which can be pressed...
| mWebView.loadUrl("javascript:plan_clear()"); | ||
| String func = "javascript:setData('" + | ||
| Helper.formatJsArgs(data.airport) + "','" + | ||
| Helper.formatJsArgs(data.destinationName) + "','" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
treat VOR name just like any other airport name displayed at the top of Long-pressed HTML page
| @@ -0,0 +1,21 @@ | |||
| package com.ds.avare.views; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a structure to facilitate passing name and type of destination in the long-pressed call chain
| } | ||
|
|
||
| String airport = null; | ||
| String destination = "", type = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
based on what we found nearby, we select a destination and its type
|
|
||
| public String airport; | ||
| public String destinationName; | ||
| public String destinationType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found having those 2 fields here is the easiest way to transit this info down the asynchronous call chain
| */ | ||
| if (!mAirportPressed.contains("&")) { | ||
| mService.setLastAfdAirport(mAirportPressed); | ||
| if (mDestinationPressed.getType() == Destination.BASE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having type of a destination pressed is nice here as we select various actions base on type; this also gets rid of checking hard-coded & character
|
|
||
| // if we are on the navaid set this as destination | ||
| for (NavAid n: navaids) { | ||
| if (Projection.getStaticDistance(lat, lon,n.getCoords().getLatitude(), n.getCoords().getLongitude()) < 0.5) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- is there an existing distance constant which would be better here?
- maybe also have priority of airport destination over VOR? i.e. check if we haven't already found an airport here
|
The code should have a way to select VOR with priority less than that of
airport.
…On Dec 4, 2016 9:01 PM, "pasniak" ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In app/src/main/java/com/ds/avare/views/LocationView.java
<#259 (review)>:
> }
}
navaids = mService.getDBResource().findNavaidsNearby(lat, lon);
+ // if we are on the navaid set this as destination
+ for (NavAid n: navaids) {
+ if (Projection.getStaticDistance(lat, lon,n.getCoords().getLatitude(), n.getCoords().getLongitude()) < 0.5) {
1. is there an existing distance constant which would be better here?
2. maybe also have priority of airport destination over VOR? i.e.
check if we haven't already found an airport here
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#259 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACz4z3gkGEVJXnEyjFdKTP7NEuIZELlFks5rE3CSgaJpZM4LDk2z>
.
|
|
I added a commit to prefer apt. I tried to use existing MIN_TOUCH_MOVEMENT_SQ_DISTANCE = 0.001 or rather square root of it but the precision was too great for click selection, at least that was an effect on the Nexus 7 sim. It is still not perfect as some tiny airports "hide" VORs. |
|
I think ANY airport hiding VORs is fine, given there are features associated with the last airport in a plan. |
to allow adding them to plan or as destination