clean up
This commit is contained in:
parent
8353884769
commit
c6b85b5a34
15 changed files with 36 additions and 74 deletions
|
@ -11,6 +11,6 @@ The translations are managed on [Weblate](https://hosted.weblate.org/projects/tr
|
|||
Help is very welcome. Be it in the form of code, or artwork, or enhancements to the website, or tutorial videos, or whatever.
|
||||
**But please** suggest new features or enhancements in advance on the [Issue Tracker](https://github.com/y20k/trackbook/issues) before implementing them.
|
||||
|
||||
### Credt for your contributions
|
||||
Contributors - like the main translators for a certain language - are listed as co-autors of this project in [AUTHORS.md](https://github.com/y20k/trackbook/blob/master/AUTHORS.md). Bonus: If you are on this list, you are automatically eligable for a free German beverage.
|
||||
### Credit for your contributions
|
||||
Contributors - like the main translators for a certain language - are listed as co-authors of this project in [AUTHORS.md](https://github.com/y20k/trackbook/blob/master/AUTHORS.md). Bonus: If you are on this list, you are automatically eligible for a free German beverage.
|
||||
To be redeemed in Stuttgart.
|
|
@ -380,7 +380,7 @@ public class MainActivityTrackFragment extends Fragment implements AdapterView.O
|
|||
mMinAltitudeView.setText(mTrack.getMinAltitudeString());
|
||||
|
||||
// show/hide elevation views depending on file format version
|
||||
if (mTrack.getTrackFormatVersion() > 1 || mTrack.getMinAltitude() > 0) {
|
||||
if (mTrack.getTrackFormatVersion() > 1 && mTrack.getMinAltitude() > 0) {
|
||||
// show elevation views
|
||||
mElevationDataViews.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
|
|
|
@ -189,12 +189,12 @@ public class Track implements TrackbookKeys, Parcelable {
|
|||
|
||||
|
||||
/* Setter for negative elevation of recording (cumulative altitude difference) */
|
||||
public void setNegativeElevation(double megativeElevation) {
|
||||
mNegativeElevation = megativeElevation;
|
||||
public void setNegativeElevation(double negativeElevation) {
|
||||
mNegativeElevation = negativeElevation;
|
||||
}
|
||||
|
||||
|
||||
/* Getter for file/track fornat version */
|
||||
/* Getter for file/track format version */
|
||||
public int getTrackFormatVersion() {
|
||||
return mTrackFormatVersion;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import android.util.Log;
|
|||
*/
|
||||
public final class LogHelper {
|
||||
|
||||
private final static boolean mTesting = false;
|
||||
private final static boolean mTesting = true;
|
||||
|
||||
public static void d(final String tag, String message) {
|
||||
// include logging only in debug versions
|
||||
|
|
|
@ -367,7 +367,7 @@ public class StorageHelper implements TrackbookKeys {
|
|||
double positiveElevation = 0;
|
||||
double negativeElevation = 0;
|
||||
|
||||
if (track != null && track.getWayPoints().size() > 0 && track.getWayPointLocation(0).getAltitude() != 0) {
|
||||
if (track != null && track.getWayPoints().size() > 0) {
|
||||
double previousLocationHeight;
|
||||
double currentLocationHeight;
|
||||
long previousTimeStamp;
|
||||
|
@ -398,7 +398,8 @@ public class StorageHelper implements TrackbookKeys {
|
|||
// check for new min and max heights
|
||||
if (currentLocationHeight > maxAltitude) {
|
||||
maxAltitude = currentLocationHeight;
|
||||
} else if (minAltitude == 0 || currentLocationHeight < minAltitude) {
|
||||
}
|
||||
if (minAltitude == 0 || currentLocationHeight < minAltitude) {
|
||||
minAltitude = currentLocationHeight;
|
||||
}
|
||||
|
||||
|
@ -406,9 +407,11 @@ public class StorageHelper implements TrackbookKeys {
|
|||
double altitudeDiff = currentLocationHeight - previousLocationHeight;
|
||||
if (altitudeDiff > 0 && altitudeDiff < MEASUREMENT_ERROR_THRESHOLD * timeDiffFactor && currentLocationHeight != 0) {
|
||||
positiveElevation = positiveElevation + altitudeDiff;
|
||||
} else if (altitudeDiff < 0 && altitudeDiff > -MEASUREMENT_ERROR_THRESHOLD * timeDiffFactor && currentLocationHeight != 0) {
|
||||
}
|
||||
if (altitudeDiff < 0 && altitudeDiff > -MEASUREMENT_ERROR_THRESHOLD * timeDiffFactor && currentLocationHeight != 0) {
|
||||
negativeElevation = negativeElevation + altitudeDiff;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// store elevation data in track
|
||||
|
@ -422,18 +425,18 @@ public class StorageHelper implements TrackbookKeys {
|
|||
|
||||
/* Tries to smooth the elevation data using a low pass filter */
|
||||
private Track lowPass(Track input, float dt, float rc) {
|
||||
/* The following code is adapted from https://en.wikipedia.org/wiki/Low-pass_filter
|
||||
*
|
||||
* // Return RC low-pass filter output samples, given input samples,
|
||||
* // time interval dt, and time constant RC
|
||||
* function lowpass(real[0..n] x, real dt, real RC)
|
||||
* var real[0..n] y
|
||||
* var real α := dt / (RC + dt)
|
||||
* y[0] := α * x[0]
|
||||
* for i from 1 to n
|
||||
* y[i] := α * x[i] + (1-α) * y[i-1]
|
||||
* return y
|
||||
*/
|
||||
|
||||
// The following code is adapted from https://en.wikipedia.org/wiki/Low-pass_filter
|
||||
//
|
||||
// // Return RC low-pass filter output samples, given input samples,
|
||||
// // time interval dt, and time constant RC
|
||||
// function lowpass(real[0..n] x, real dt, real RC)
|
||||
// var real[0..n] y
|
||||
// var real α := dt / (RC + dt)
|
||||
// y[0] := α * x[0]
|
||||
// for i from 1 to n
|
||||
// y[i] := α * x[i] + (1-α) * y[i-1]
|
||||
// return y
|
||||
|
||||
// copy input track
|
||||
Track output = new Track(input);
|
||||
|
@ -442,8 +445,8 @@ public class StorageHelper implements TrackbookKeys {
|
|||
float alpha = dt / (rc + dt);
|
||||
|
||||
// set initial value for first waypoint
|
||||
double outputInitialAltituteValue = alpha * input.getWayPoints().get(0).getLocation().getAltitude();
|
||||
output.getWayPoints().get(0).getLocation().setAltitude(outputInitialAltituteValue);
|
||||
double outputInitialAltitudeValue = alpha * input.getWayPoints().get(0).getLocation().getAltitude();
|
||||
output.getWayPoints().get(0).getLocation().setAltitude(outputInitialAltitudeValue);
|
||||
|
||||
double inputCurrentAltitudeValue;
|
||||
double outputPreviousAltitudeValue;
|
||||
|
@ -460,5 +463,4 @@ public class StorageHelper implements TrackbookKeys {
|
|||
return output;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
android:layout_marginEnd="8dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:contentDescription="@string/descr_fab_sub_menu_button_1"
|
||||
android:contentDescription="@string/descr_fab_sub_menu_label_1"
|
||||
app:cardBackgroundColor="@color/trackbook_white"
|
||||
app:cardCornerRadius="4dp"
|
||||
app:cardElevation="4dp"
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
android:layout_height="fill_parent"
|
||||
tools:context=".MainActivityMapFragment">
|
||||
|
||||
<org.osmdroid.views.MapView android:id="@+id/map"
|
||||
<org.osmdroid.views.MapView
|
||||
android:id="@+id/map"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:contentDescription="@string/descr_map_current_track" />
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginTop="4dp"
|
||||
android:contentDescription="@string/descr_track_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/export_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<resources>
|
||||
<!-- activities -->
|
||||
<string name="app_name">Trackbook</string> <!-- please do not translate app_name - transcription into different alphabet types is fine though -->
|
||||
<string name="title_activity_infosheet">Infosheet</string>
|
||||
|
||||
<!-- menu entries -->
|
||||
|
||||
<!-- headers -->
|
||||
|
||||
<!-- tabs -->
|
||||
<string name="tab_map">Karte</string>
|
||||
|
@ -16,7 +11,6 @@
|
|||
<string name="notification_title_trackbook_not_running">Trackbook ist inaktiv</string>
|
||||
<string name="notification_title_trackbook_running">Trackbook ist aktiv</string>
|
||||
<string name="notification_stop">Stopp</string>
|
||||
<string name="notification_swipe_to_clear_map">(Ausblenden setzt Kartenansicht zurück)</string>
|
||||
<string name="notification_content_duration">Dauer</string>
|
||||
<string name="notification_content_distance">Entfernung</string>
|
||||
<string name="notification_channel_recording_name">Status der Aufzeichnung</string>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<resources>
|
||||
<!-- activities -->
|
||||
<string name="app_name">Trackbook</string>
|
||||
<string name="title_activity_infosheet">Infosheet</string>
|
||||
|
||||
<!-- menu entries -->
|
||||
|
||||
<!-- headers -->
|
||||
|
||||
<!-- tabs -->
|
||||
<string name="tab_map">Peta</string>
|
||||
|
@ -16,7 +11,6 @@
|
|||
<string name="notification_title_trackbook_running">Trackbook aktif</string>
|
||||
<string name="notification_title_trackbook_not_running">Trackbook tidak aktif</string>
|
||||
<string name="notification_stop">Berhenti</string>
|
||||
<string name="notification_swipe_to_clear_map">(geser untuk menghapus peta)</string>
|
||||
<string name="notification_content_duration">Durasi</string>
|
||||
<string name="notification_content_distance">Jarak</string>
|
||||
<string name="notification_channel_recording_name">Movement Recording State</string>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<resources>
|
||||
<!-- activities -->
|
||||
<string name="app_name">Trackbook</string> <!-- please do not translate app_name - transcription into different alphabet types is fine though -->
|
||||
<string name="title_activity_infosheet">Scheda informativa</string>
|
||||
|
||||
<!-- menu entries -->
|
||||
|
||||
<!-- headers -->
|
||||
|
||||
<!-- tabs -->
|
||||
<string name="tab_map">Mappa</string>
|
||||
|
@ -16,7 +11,6 @@
|
|||
<string name="notification_title_trackbook_running">Trackbook in esecuzione</string>
|
||||
<string name="notification_title_trackbook_not_running">Trackbook non in esecuzione</string>
|
||||
<string name="notification_stop">Stop</string>
|
||||
<string name="notification_swipe_to_clear_map">(scorri per spostare la mappa)</string>
|
||||
<string name="notification_content_duration">Durata</string>
|
||||
<string name="notification_content_distance">Distanza</string>
|
||||
<string name="notification_channel_recording_name">Stato registrazione</string>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<resources>
|
||||
<!-- activities -->
|
||||
<string name="app_name">Trackbook</string> <!-- please do not translate app_name - transcription into different alphabet types is fine though -->
|
||||
<string name="title_activity_infosheet">情報シート</string>
|
||||
|
||||
<!-- menu entries -->
|
||||
|
||||
<!-- headers -->
|
||||
|
||||
<!-- tabs -->
|
||||
<string name="tab_map">地図</string>
|
||||
|
@ -16,7 +11,6 @@
|
|||
<string name="notification_title_trackbook_running">Trackbook 実行中</string>
|
||||
<string name="notification_title_trackbook_not_running">Trackbook は実行していません</string>
|
||||
<string name="notification_stop">停止</string>
|
||||
<string name="notification_swipe_to_clear_map">(スワイプしてマップをクリア)</string>
|
||||
<string name="notification_content_duration">期間</string>
|
||||
<string name="notification_content_distance">距離</string>
|
||||
<string name="notification_channel_recording_name">Movement Recording State</string>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<resources>
|
||||
<!-- activities -->
|
||||
<string name="app_name">Trackbook</string> <!-- please do not translate app_name - transcription into different alphabet types is fine though -->
|
||||
<string name="title_activity_infosheet">Infoark</string>
|
||||
|
||||
<!-- menu entries -->
|
||||
|
||||
<!-- headers -->
|
||||
|
||||
<!-- tabs -->
|
||||
<string name="tab_map">Kart</string>
|
||||
|
@ -16,7 +11,6 @@
|
|||
<string name="notification_title_trackbook_running">Trackbook kjører</string>
|
||||
<string name="notification_title_trackbook_not_running">Trackbook kjører ikke</string>
|
||||
<string name="notification_stop">Stopp</string>
|
||||
<string name="notification_swipe_to_clear_map">(sveip for å tømme kart)</string>
|
||||
<string name="notification_content_duration">Varighet</string>
|
||||
<string name="notification_content_distance">Distanse</string>
|
||||
<string name="notification_channel_recording_name">Bevegelsesopptakstilstand</string>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<resources>
|
||||
<!-- activities -->
|
||||
<string name="app_name">Trackbook</string> <!-- please do not translate app_name - transcription into different alphabet types is fine though -->
|
||||
<string name="title_activity_infosheet">Informatieblad</string>
|
||||
|
||||
<!-- menu entries -->
|
||||
|
||||
<!-- headers -->
|
||||
|
||||
<!-- tabs -->
|
||||
<string name="tab_map">Kaart</string>
|
||||
|
@ -16,7 +11,6 @@
|
|||
<string name="notification_title_trackbook_running">Trackbook is actief</string>
|
||||
<string name="notification_title_trackbook_not_running">Trackbook is niet actief</string>
|
||||
<string name="notification_stop">Stoppen</string>
|
||||
<string name="notification_swipe_to_clear_map">(veeg om kaart te wissen)</string>
|
||||
<string name="notification_content_duration">Duur</string>
|
||||
<string name="notification_content_distance">Afstand</string>
|
||||
<string name="notification_channel_recording_name">Movement Recording State</string>
|
||||
|
@ -119,12 +113,12 @@
|
|||
<string name="descr_statistics_sheet_p_duration_value">Waarde: duur</string>
|
||||
<string name="descr_statistics_sheet_p_recording_start_value">Waarde: beginnen met bijhouden</string>
|
||||
<string name="descr_statistics_sheet_p_recording_end_value">Waarde: stoppen met bijhouden</string>
|
||||
<string name="descr_statistics_sheet_p_max_altitude">Waarde: hoogste wegpunt</string>
|
||||
<string name="descr_statistics_sheet_p_min_altitude">Waarde: laagste wegpunt</string>
|
||||
<string name="descr_statistics_sheet_p_positive_elevation">Waarde: hoogte (heuvel-op)</string>
|
||||
<string name="descr_statistics_sheet_p_negative_elevation">Waarde: hoogte (heuvel-af)</string>
|
||||
<string name="descr_track_selector">Uitrolmenu voor verdere banen</string>
|
||||
<string name="descr_export_button">Track export button</string>
|
||||
<string name="descr_delete_button">Baan - verwijderknop</string>
|
||||
|
||||
<string name="descr_statistics_sheet_p_max_altitude">Waarde: hoogste wegpunt</string>
|
||||
<string name="descr_statistics_sheet_p_min_altitude">Waarde: laagste wegpunt</string>
|
||||
<string name="descr_statistics_sheet_p_positive_elevation">Waarde: hoogte (heuvel-op)</string>
|
||||
<string name="descr_statistics_sheet_p_negative_elevation">Waarde: hoogte (heuvel-af)</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<resources>
|
||||
<!-- activities -->
|
||||
<string name="app_name">Trackbook</string> <!-- please do not translate app_name - transcription into different alphabet types is fine though -->
|
||||
<string name="title_activity_infosheet">Info Sheet</string>
|
||||
|
||||
<!-- menu entries -->
|
||||
|
||||
<!-- headers -->
|
||||
|
||||
<!-- tabs -->
|
||||
<string name="tab_map">Map</string>
|
||||
|
@ -16,7 +11,6 @@
|
|||
<string name="notification_title_trackbook_running">Trackbook running</string>
|
||||
<string name="notification_title_trackbook_not_running">Trackbook not running</string>
|
||||
<string name="notification_stop">Stop</string>
|
||||
<string name="notification_swipe_to_clear_map">(swipe to clear map)</string>
|
||||
<string name="notification_content_duration">Duration</string>
|
||||
<string name="notification_content_distance">Distance</string>
|
||||
<string name="notification_channel_recording_name">Movement Recording State</string>
|
||||
|
|
Loading…
Reference in a new issue