Commit ab7e1d33bb5954dbabd36f88f59cf510b2d77036

Authored by 权海
1 parent 0ee11056

feat(ui):hrv 、hr 提供数据时向下取整

... ... @@ -438,15 +438,15 @@ class LocalHealthDataConvert {
..sort((a, b) => a.endTime.compareTo(b.endTime));
return V2HealthData(
hrvAvg: _averageOrNull(hrvPoints.map((e) => e.result).toList())?.round(),
hrvAvg: _averageOrNull(hrvPoints.map((e) => e.result).toList())?.floor(),
lastRestingHrValue:
dayRestingHr.isEmpty ? null : dayRestingHr.last.value?.round(),
dayRestingHr.isEmpty ? null : dayRestingHr.last.value?.floor(),
hrAvg: _averageOrNull(
_sleepHeartRate(sleepSummary.sleepIntervals, sleepingHeartRate)
.map((e) => e.value)
.whereType<num>()
.toList(),
)?.round(),
)?.floor(),
move: activitySummary.move.round(),
exercise: activitySummary.exerciseSeconds.round(),
stand: activitySummary.standHours.round(),
... ... @@ -486,12 +486,12 @@ class LocalHealthDataConvert {
..sort((a, b) => a.endTime.compareTo(b.endTime));
return V2HealthData(
hrvAvg: _averageOrNull(hrvPoints.map((e) => e.result).toList())?.round(),
hrvAvg: _averageOrNull(hrvPoints.map((e) => e.result).toList())?.floor(),
lastRestingHrValue:
dayRestingHr.isEmpty ? null : dayRestingHr.last.value?.round(),
dayRestingHr.isEmpty ? null : dayRestingHr.last.value?.floor(),
hrAvg: _averageOrNull(
sleepHr.map((e) => e.value).whereType<num>().toList(),
)?.round(),
)?.floor(),
move: activitySummary.move.round(),
exercise: activitySummary.exerciseSeconds.round(),
stand: activitySummary.standHours.round(),
... ... @@ -512,7 +512,7 @@ class LocalHealthDataConvert {
V2HrvTrendItem(
time: point.rawEndTime,
rawHrv: point.rawHrv,
trendHrv: point.result.round(),
trendHrv: point.result.floor(),
state: point.state.value,
),
],
... ... @@ -524,7 +524,7 @@ class LocalHealthDataConvert {
) {
final latest = _latestHrvByRawEndTime(hrvPoints);
return V2LatestHrvData(
latestHrv: latest?.result,
latestHrv: (latest?.result ?? 0).floor().toDouble(),
latestDataTime: latest?.rawEndTime,
state: latest?.state.value,
);
... ... @@ -538,7 +538,7 @@ class LocalHealthDataConvert {
for (final point in realtimePoints)
V2RealtimeStressItem(
time: point.rawEndTime,
value: point.result.round(),
value: point.result.floor(),
state: point.state.value,
isWorkout: point.isWorkout ? 1 : 0,
isWorkoutRecovery: point.isWorkoutRecovery ? 1 : 0,
... ...