mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
Implement Basecamp GPX import
This commit is contained in:
parent
b94be44cbf
commit
b2d8f85d35
3 changed files with 7 additions and 4 deletions
|
|
@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
- The Warden error in jobs is now fixed. #1556
|
||||
- The Live Map setting is now respected.
|
||||
- The Live Map info modal is now displayed. #665
|
||||
- GPX from Basecamp is now supported. #790
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class Point < ApplicationRecord
|
|||
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, {
|
||||
unknown: 0, background_event: 1, circular_region_event: 2, beacon_event: 3,
|
||||
report_location_message_event: 4, manual_event: 5, timer_based_event: 6,
|
||||
|
|
|
|||
|
|
@ -81,8 +81,10 @@ class Gpx::TrackImporter
|
|||
def speed(point)
|
||||
return if point['extensions'].blank?
|
||||
|
||||
(
|
||||
point.dig('extensions', 'speed') || point.dig('extensions', 'TrackPointExtension', 'speed')
|
||||
).to_f.round(1)
|
||||
value = point.dig('extensions', 'speed')
|
||||
extensions = point.dig('extensions', 'TrackPointExtension')
|
||||
value ||= extensions.is_a?(Hash) ? extensions.dig('speed') : nil
|
||||
|
||||
value&.to_f&.round(1) || 0
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue