Upgrade to Node.js V18 (#32)
* Update install.sh * Create .npmrc * Update install.sh * Update server.js * Update config.js * Update RowingStatistics.js
This commit is contained in:
parent
4066ea5422
commit
854a8806dc
|
|
@ -370,7 +370,7 @@ function createRowingStatistics (config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMetrics () {
|
function getMetrics () {
|
||||||
const cyclePace = cycleLinearVelocity.clean() !== 0 && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? (500.0 / cycleLinearVelocity.clean()) : Infinity
|
const cyclePace = cycleLinearVelocity.clean() !== 0 && sessionStatus === 'Rowing' ? (500.0 / cycleLinearVelocity.clean()) : Infinity
|
||||||
return {
|
return {
|
||||||
sessiontype: intervalTargetDistance > 0 ? 'Distance' : (intervalTargetTime > 0 ? 'Time' : 'JustRow'),
|
sessiontype: intervalTargetDistance > 0 ? 'Distance' : (intervalTargetTime > 0 ? 'Time' : 'JustRow'),
|
||||||
sessionStatus,
|
sessionStatus,
|
||||||
|
|
@ -391,8 +391,8 @@ function createRowingStatistics (config) {
|
||||||
cycleDuration: cycleDuration.clean() > minimumStrokeTime && cycleDuration.clean() < maximumStrokeTime && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cycleDuration.clean() : NaN, // seconds
|
cycleDuration: cycleDuration.clean() > minimumStrokeTime && cycleDuration.clean() < maximumStrokeTime && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cycleDuration.clean() : NaN, // seconds
|
||||||
cycleStrokeRate: cycleDuration.clean() > minimumStrokeTime && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? (60.0 / cycleDuration.clean()) : 0, // strokeRate in SPM
|
cycleStrokeRate: cycleDuration.clean() > minimumStrokeTime && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? (60.0 / cycleDuration.clean()) : 0, // strokeRate in SPM
|
||||||
cycleDistance: cycleDistance.raw() > 0 && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cycleDistance.clean() : 0, // meters
|
cycleDistance: cycleDistance.raw() > 0 && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cycleDistance.clean() : 0, // meters
|
||||||
cycleLinearVelocity: cycleLinearVelocity.clean() > 0 && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cycleLinearVelocity.clean() : 0, // m/s
|
cycleLinearVelocity: cycleLinearVelocity.clean() > 0 && sessionStatus === 'Rowing' ? cycleLinearVelocity.clean() : 0, // m/s
|
||||||
cyclePace: cycleLinearVelocity.raw() > 0 ? cyclePace : Infinity, // seconds/50 0m
|
cyclePace: cycleLinearVelocity.clean() > 0 && sessionStatus === 'Rowing' ? cyclePace : Infinity, // seconds/500m
|
||||||
cyclePower: cyclePower.clean() > 0 && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cyclePower.clean() : 0, // watts
|
cyclePower: cyclePower.clean() > 0 && cycleLinearVelocity.raw() > 0 && sessionStatus === 'Rowing' ? cyclePower.clean() : 0, // watts
|
||||||
cycleProjectedEndTime: intervalTargetDistance > 0 ? distanceOverTime.projectY(intervalTargetDistance) : intervalTargetTime,
|
cycleProjectedEndTime: intervalTargetDistance > 0 ? distanceOverTime.projectY(intervalTargetDistance) : intervalTargetTime,
|
||||||
cycleProjectedEndLinearDistance: intervalTargetTime > 0 ? distanceOverTime.projectX(intervalTargetTime) : intervalTargetDistance,
|
cycleProjectedEndLinearDistance: intervalTargetTime > 0 ? distanceOverTime.projectX(intervalTargetTime) : intervalTargetDistance,
|
||||||
|
|
|
||||||
|
|
@ -303,7 +303,7 @@ function logMetrics (metrics) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
replayRowingSession(handleRotationImpulse, {
|
replayRowingSession(handleRotationImpulse, {
|
||||||
// filename: 'recordings/2021/04/rx800_2021-04-21_1845_Rowing_30Minutes_Damper8.csv', // 30 minutes, damper 10
|
filename: 'recordings/Concept2_RowErg_Session_2000meters.csv', // Example row from a Concept 2 RowErg, 2000 meters
|
||||||
realtime: true,
|
realtime: true,
|
||||||
loop: false
|
loop: false
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
import rowerProfiles from './rowerProfiles.js'
|
import rowerProfiles from './rowerProfiles.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
/*
|
|
||||||
// example: change the default log level:
|
// example: change the default log level:
|
||||||
loglevel: {
|
loglevel: {
|
||||||
default: 'debug'
|
default: 'debug'
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ then
|
||||||
sudo ln -sfn /opt/nodejs/bin/npm /usr/local/bin/npm
|
sudo ln -sfn /opt/nodejs/bin/npm /usr/local/bin/npm
|
||||||
else
|
else
|
||||||
print "Installing Node.js..."
|
print "Installing Node.js..."
|
||||||
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
|
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
||||||
sudo apt-get install -y nodejs
|
sudo apt-get install -y nodejs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -178,7 +178,10 @@ sudo git reset --hard origin/v1beta_updates
|
||||||
echo "export PATH=\"\$PATH:$INSTALL_DIR/bin\"" >> ~/.bashrc
|
echo "export PATH=\"\$PATH:$INSTALL_DIR/bin\"" >> ~/.bashrc
|
||||||
|
|
||||||
# otherwise node-gyp would fail while building the system dependencies
|
# otherwise node-gyp would fail while building the system dependencies
|
||||||
sudo npm config set user 0
|
# On newer nodejs versions (> Node 16) we solve this via the .npmrc file
|
||||||
|
if [[ $ARCHITECTURE == "armv6l" ]]; then
|
||||||
|
sudo npm config set user 0
|
||||||
|
fi
|
||||||
|
|
||||||
print
|
print
|
||||||
print "Downloading and compiling Runtime dependencies..."
|
print "Downloading and compiling Runtime dependencies..."
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue