Fix in active time detection
This commit is contained in:
@@ -20,6 +20,16 @@ function LiveTrainingView(props) {
|
||||
const laps = (analysis.peaks.size / props.peaksPerLap).toFixed(1);
|
||||
const totalMomentum = Math.trunc(analysis.totalMomentum * props.kgFactor / 10 / 60);
|
||||
|
||||
const toTimeStr = seconds => {
|
||||
let minuteStr = String(Math.floor(seconds / 60));
|
||||
if(minuteStr.length < 2)
|
||||
minuteStr = "0" + minuteStr;
|
||||
let secondStr = String(Math.floor(seconds % 60));
|
||||
if(secondStr.length < 2)
|
||||
secondStr = "0" + secondStr;
|
||||
return minuteStr + ":" + secondStr;
|
||||
}
|
||||
console.log("Active", analysis.activeTime);
|
||||
useKeepAwake();
|
||||
|
||||
return (
|
||||
@@ -37,8 +47,8 @@ function LiveTrainingView(props) {
|
||||
</CycleView>
|
||||
|
||||
<CycleView>
|
||||
<IconCard label="DAUER" value="00:42" iconName="clock" iconType="FontAwesome5" />
|
||||
<IconCard label="AKTIVE DAUER" value="42:00" iconName="stopwatch" iconType="FontAwesome5" />
|
||||
<IconCard label="DAUER" value={toTimeStr(analysis.totalTime)} iconName="clock" iconType="FontAwesome5" />
|
||||
<IconCard label="AKTIVE DAUER" value={toTimeStr(analysis.activeTime)} iconName="stopwatch" iconType="FontAwesome5" />
|
||||
</CycleView>
|
||||
<IconCard label="KRAFT" value={totalMomentum} iconName="ruler" iconType="Entypo" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user