Skip to content

Conversation

@pasniak
Copy link
Contributor

@pasniak pasniak commented Dec 4, 2016

to allow adding them to plan or as destination

apps4av and others added 20 commits November 15, 2016 15:04
Navaids in long-pressed - separate radial from distance with color
Fix redraw of Plan (obvious bug fix)
… 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;
Copy link
Contributor Author

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) + "','" +
Copy link
Contributor Author

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;
Copy link
Contributor Author

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 = "";
Copy link
Contributor Author

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;
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  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

@apps4av
Copy link
Owner

apps4av commented Dec 5, 2016 via email

@pasniak
Copy link
Contributor Author

pasniak commented Dec 5, 2016

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.

@pasniak
Copy link
Contributor Author

pasniak commented Dec 6, 2016

I think ANY airport hiding VORs is fine, given there are features associated with the last airport in a plan.

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.

2 participants