Skip to content

Commit

Permalink
Change repeated data handling
Browse files Browse the repository at this point in the history
Remove safeguards against infinity and NaN and let view handle those.
  • Loading branch information
Abász committed Apr 7, 2023
1 parent 5b4a887 commit 37f445b
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/common/services/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,14 @@ export class DataService {
handleForces: rowerDataDto.handleForces,
peakForce: Math.max(...rowerDataDto.handleForces),
strokeRate:
this.lastStrokeCount === 0
? 0
: ((rowerDataDto.strokeCount - this.lastStrokeCount) /
((rowerDataDto.strokeTime - this.lastStrokeTime) / 1e6)) *
60,
((rowerDataDto.strokeCount - this.lastStrokeCount) /
((rowerDataDto.strokeTime - this.lastStrokeTime) / 1e6)) *
60,
speed:
this.lastRevCount === 0
? 0
: (distance - this.lastRevCount) /
100 /
((rowerDataDto.revTime - this.lastRevTime) / 1e6),
(distance - this.lastRevCount) /
100 /
((rowerDataDto.revTime - this.lastRevTime) / 1e6),
distPerStroke:
this.lastStrokeCount === 0 ||
this.lastRevCount === 0 ||
Math.round(rowerDataDto.distance) === this.lastRevCount
? 0
: (distance - this.lastRevCount) /
Expand Down

0 comments on commit 37f445b

Please sign in to comment.