mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Merge pull request #1567 from Freika/fix/basecamp-gpx
Implement Basecamp GPX import
This commit is contained in:
commit
f8c509912b
3 changed files with 7 additions and 5 deletions
|
|
@ -16,10 +16,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
- The Warden error in jobs is now fixed. #1556
|
- The Warden error in jobs is now fixed. #1556
|
||||||
- The Live Map setting is now respected.
|
- The Live Map setting is now respected.
|
||||||
- The Live Map info modal is now displayed. #665
|
- The Live Map info modal is now displayed. #665
|
||||||
|
- GPX from Basecamp is now supported. #790
|
||||||
- The "Delete Selected" button is now hidden when no points are selected. #1025
|
- The "Delete Selected" button is now hidden when no points are selected. #1025
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [0.30.3] - 2025-07-23
|
# [0.30.3] - 2025-07-23
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class Point < ApplicationRecord
|
||||||
index: true
|
index: true
|
||||||
}
|
}
|
||||||
|
|
||||||
enum :battery_status, { unknown: 0, unplugged: 1, charging: 2, full: 3 }, suffix: true
|
enum :battery_status, { unknown: 0, unplugged: 1, charging: 2, full: 3, connected_not_charging: 4 }, suffix: true
|
||||||
enum :trigger, {
|
enum :trigger, {
|
||||||
unknown: 0, background_event: 1, circular_region_event: 2, beacon_event: 3,
|
unknown: 0, background_event: 1, circular_region_event: 2, beacon_event: 3,
|
||||||
report_location_message_event: 4, manual_event: 5, timer_based_event: 6,
|
report_location_message_event: 4, manual_event: 5, timer_based_event: 6,
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,10 @@ class Gpx::TrackImporter
|
||||||
def speed(point)
|
def speed(point)
|
||||||
return if point['extensions'].blank?
|
return if point['extensions'].blank?
|
||||||
|
|
||||||
(
|
value = point.dig('extensions', 'speed')
|
||||||
point.dig('extensions', 'speed') || point.dig('extensions', 'TrackPointExtension', 'speed')
|
extensions = point.dig('extensions', 'TrackPointExtension')
|
||||||
).to_f.round(1)
|
value ||= extensions.is_a?(Hash) ? extensions.dig('speed') : nil
|
||||||
|
|
||||||
|
value&.to_f&.round(1) || 0.0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue