- // next way point
- if ( route->size() > 0 ) {
- SGWayPoint wp = route->get_waypoint( 0 );
- // update the property tree info
-
- wp0_id->setStringValue( wp.get_id().c_str() );
-
- accum += wp_distance;
- wp0_dist->setDoubleValue( accum * SG_METER_TO_NM );
-
- double eta = accum * SG_METER_TO_NM / get_ground_speed();
- if ( eta >= 100.0 ) { eta = 99.999; }
- int major, minor;
- if ( eta < (1.0/6.0) ) {
- // within 10 minutes, bump up to min/secs
- eta *= 60.0;
- }
- major = (int)eta;
- minor = (int)((eta - (int)eta) * 60.0);
- snprintf( eta_str, 128, "%d:%02d", major, minor );
- wp0_eta->setStringValue( eta_str );
- }
+ // update the property tree info for WP0
+ wp0_id->setStringValue( wp.get_id().c_str() );
+ double accum = wp_distance;
+ wp0_dist->setDoubleValue( accum * SG_METER_TO_NM );
+ setETAPropertyFromDistance(wp0_eta, accum);