Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
com.akaver.sportmap
SportMap-ASPNET
Commits
f62f1d35
Commit
f62f1d35
authored
Jun 06, 2020
by
Andres Käver
Browse files
bll
parent
474110c4
Pipeline
#841
passed with stages
in 1 minute and 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
BLL.App/Services/GpsLocationService.cs
View file @
f62f1d35
...
...
@@ -41,7 +41,8 @@ namespace BLL.App.Services
var
lastLocation
=
await
UOW
.
GpsLocations
.
LastInSessionAsync
(
gpsSession
.
Id
);
if
(
lastLocation
!=
null
)
// skip out of sync locations
if
(
lastLocation
!=
null
&&
lastLocation
.
RecordedAt
<
gpsLocation
.
RecordedAt
)
{
// calculate the metrics
var
distance
=
getDistance
(
gpsLocation
,
lastLocation
);
...
...
@@ -52,10 +53,10 @@ namespace BLL.App.Services
gpsSession
.
Descent
+=
Math
.
Abs
(
vertical
);
}
else
if
(
vertical
>
0
)
{
gpsSession
.
Descent
+=
vertical
;
gpsSession
.
Climb
+=
vertical
;
}
gpsSession
.
Duration
=
(
gpsSess
ion
.
RecordedAt
-
lastLocat
ion
.
RecordedAt
).
TotalSeconds
;
gpsSession
.
Duration
=
(
lastLocat
ion
.
RecordedAt
-
gpsSess
ion
.
RecordedAt
).
TotalSeconds
;
await
UOW
.
GpsSessions
.
UpdateAsync
(
gpsSession
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment