@sports-alliance/sports-lib 7.1.1 → 7.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/data/data-ground-contact-time-balance-left.d.ts +4 -0
- package/lib/cjs/data/data-ground-contact-time-balance-left.js +8 -0
- package/lib/cjs/data/data-ground-contact-time-balance-right.d.ts +4 -0
- package/lib/cjs/data/data-ground-contact-time-balance-right.js +8 -0
- package/lib/cjs/data/data-ground-contact-time-balance.d.ts +3 -0
- package/lib/cjs/data/data-ground-contact-time-balance.js +7 -0
- package/lib/cjs/data/data-stance-time-balance-left.d.ts +1 -0
- package/lib/cjs/data/data-stance-time-balance-left.js +1 -0
- package/lib/cjs/data/data-stance-time-balance-right.d.ts +1 -0
- package/lib/cjs/data/data-stance-time-balance-right.js +1 -0
- package/lib/cjs/data/data-stance-time-balance.d.ts +1 -0
- package/lib/cjs/data/data-stance-time-balance.js +1 -0
- package/lib/cjs/data/data.depth-max.d.ts +5 -0
- package/lib/cjs/data/data.depth-max.js +9 -0
- package/lib/cjs/data/data.depth.d.ts +5 -0
- package/lib/cjs/data/data.depth.js +9 -0
- package/lib/cjs/data/data.fitness-age.d.ts +5 -0
- package/lib/cjs/data/data.fitness-age.js +9 -0
- package/lib/cjs/data/data.ground-contact-time-avg.d.ts +5 -0
- package/lib/cjs/data/data.ground-contact-time-avg.js +9 -0
- package/lib/cjs/data/data.ground-contact-time-max.d.ts +5 -0
- package/lib/cjs/data/data.ground-contact-time-max.js +9 -0
- package/lib/cjs/data/data.ground-contact-time-min.d.ts +5 -0
- package/lib/cjs/data/data.ground-contact-time-min.js +9 -0
- package/lib/cjs/data/data.ground-contact-time.d.ts +5 -0
- package/lib/cjs/data/data.ground-contact-time.js +9 -0
- package/lib/cjs/data/data.max-hr-setting.d.ts +5 -0
- package/lib/cjs/data/data.max-hr-setting.js +9 -0
- package/lib/cjs/data/data.stance-time.d.ts +1 -0
- package/lib/cjs/data/data.stance-time.js +1 -0
- package/lib/cjs/data/data.store.js +39 -1
- package/lib/cjs/data/data.vertical-oscillation-avg.d.ts +5 -0
- package/lib/cjs/data/data.vertical-oscillation-avg.js +9 -0
- package/lib/cjs/data/data.vertical-oscillation-max.d.ts +5 -0
- package/lib/cjs/data/data.vertical-oscillation-max.js +9 -0
- package/lib/cjs/data/data.vertical-oscillation-min.d.ts +5 -0
- package/lib/cjs/data/data.vertical-oscillation-min.js +9 -0
- package/lib/cjs/events/adapters/importers/fit/importer.fit.js +40 -3
- package/lib/cjs/events/adapters/importers/fit/importer.fit.mapper.js +23 -0
- package/lib/cjs/events/adapters/importers/suunto/importer.suunto.integration.spec.js +87 -3
- package/lib/cjs/events/adapters/importers/suunto/importer.suunto.json.js +86 -6
- package/lib/cjs/events/utilities/activity.utilities.js +38 -2
- package/lib/esm/data/data-ground-contact-time-balance-left.d.ts +4 -0
- package/lib/esm/data/data-ground-contact-time-balance-right.d.ts +4 -0
- package/lib/esm/data/data-ground-contact-time-balance.d.ts +3 -0
- package/lib/esm/data/data-stance-time-balance-left.d.ts +1 -0
- package/lib/esm/data/data-stance-time-balance-right.d.ts +1 -0
- package/lib/esm/data/data-stance-time-balance.d.ts +1 -0
- package/lib/esm/data/data.depth-max.d.ts +5 -0
- package/lib/esm/data/data.depth.d.ts +5 -0
- package/lib/esm/data/data.fitness-age.d.ts +5 -0
- package/lib/esm/data/data.ground-contact-time-avg.d.ts +5 -0
- package/lib/esm/data/data.ground-contact-time-max.d.ts +5 -0
- package/lib/esm/data/data.ground-contact-time-min.d.ts +5 -0
- package/lib/esm/data/data.ground-contact-time.d.ts +5 -0
- package/lib/esm/data/data.max-hr-setting.d.ts +5 -0
- package/lib/esm/data/data.stance-time.d.ts +1 -0
- package/lib/esm/data/data.vertical-oscillation-avg.d.ts +5 -0
- package/lib/esm/data/data.vertical-oscillation-max.d.ts +5 -0
- package/lib/esm/data/data.vertical-oscillation-min.d.ts +5 -0
- package/lib/esm/index.js +259 -13
- package/package.json +2 -2
package/lib/esm/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
1
|
// src/data/data.interface.ts
|
|
9
2
|
var UnitSystem = /* @__PURE__ */ ((UnitSystem2) => {
|
|
10
3
|
UnitSystem2[UnitSystem2["Metric"] = 0] = "Metric";
|
|
@@ -3053,6 +3046,17 @@ var DataStanceTimeBalanceLeft = class extends DataStanceTimeBalance {
|
|
|
3053
3046
|
}
|
|
3054
3047
|
};
|
|
3055
3048
|
|
|
3049
|
+
// src/data/data-ground-contact-time-balance.ts
|
|
3050
|
+
var DataGroundContactTimeBalance = class extends DataPercent {
|
|
3051
|
+
};
|
|
3052
|
+
|
|
3053
|
+
// src/data/data-ground-contact-time-balance-left.ts
|
|
3054
|
+
var DataGroundContactTimeBalanceLeft = class extends DataGroundContactTimeBalance {
|
|
3055
|
+
static {
|
|
3056
|
+
this.type = "Ground Contact Time Balance Left";
|
|
3057
|
+
}
|
|
3058
|
+
};
|
|
3059
|
+
|
|
3056
3060
|
// src/data/data.step-length.ts
|
|
3057
3061
|
var DataStepLength = class extends DataDistance {
|
|
3058
3062
|
static {
|
|
@@ -3676,6 +3680,13 @@ var DataStanceTimeBalanceRight = class extends DataStanceTimeBalance {
|
|
|
3676
3680
|
}
|
|
3677
3681
|
};
|
|
3678
3682
|
|
|
3683
|
+
// src/data/data-ground-contact-time-balance-right.ts
|
|
3684
|
+
var DataGroundContactTimeBalanceRight = class extends DataGroundContactTimeBalance {
|
|
3685
|
+
static {
|
|
3686
|
+
this.type = "Ground Contact Time Balance Right";
|
|
3687
|
+
}
|
|
3688
|
+
};
|
|
3689
|
+
|
|
3679
3690
|
// src/data/data.rider-position-change-event.ts
|
|
3680
3691
|
var DataRiderPositionChangeEvent = class extends DataEvent {
|
|
3681
3692
|
static {
|
|
@@ -4021,6 +4032,116 @@ var DataTrainingLoadPeak = class extends DataNumber {
|
|
|
4021
4032
|
}
|
|
4022
4033
|
};
|
|
4023
4034
|
|
|
4035
|
+
// src/data/data.ground-contact-time.ts
|
|
4036
|
+
var DataGroundContactTime = class extends DataNumber {
|
|
4037
|
+
static {
|
|
4038
|
+
this.type = "Ground Contact Time";
|
|
4039
|
+
}
|
|
4040
|
+
static {
|
|
4041
|
+
this.unit = "ms";
|
|
4042
|
+
}
|
|
4043
|
+
};
|
|
4044
|
+
|
|
4045
|
+
// src/data/data.ground-contact-time-avg.ts
|
|
4046
|
+
var DataGroundContactTimeAvg = class extends DataNumber {
|
|
4047
|
+
static {
|
|
4048
|
+
this.type = "Ground Contact Time Avg";
|
|
4049
|
+
}
|
|
4050
|
+
static {
|
|
4051
|
+
this.unit = "ms";
|
|
4052
|
+
}
|
|
4053
|
+
};
|
|
4054
|
+
|
|
4055
|
+
// src/data/data.ground-contact-time-max.ts
|
|
4056
|
+
var DataGroundContactTimeMax = class extends DataNumber {
|
|
4057
|
+
static {
|
|
4058
|
+
this.type = "Ground Contact Time Max";
|
|
4059
|
+
}
|
|
4060
|
+
static {
|
|
4061
|
+
this.unit = "ms";
|
|
4062
|
+
}
|
|
4063
|
+
};
|
|
4064
|
+
|
|
4065
|
+
// src/data/data.ground-contact-time-min.ts
|
|
4066
|
+
var DataGroundContactTimeMin = class extends DataNumber {
|
|
4067
|
+
static {
|
|
4068
|
+
this.type = "Ground Contact Time Min";
|
|
4069
|
+
}
|
|
4070
|
+
static {
|
|
4071
|
+
this.unit = "ms";
|
|
4072
|
+
}
|
|
4073
|
+
};
|
|
4074
|
+
|
|
4075
|
+
// src/data/data.vertical-oscillation-avg.ts
|
|
4076
|
+
var DataVerticalOscillationAvg = class extends DataNumber {
|
|
4077
|
+
static {
|
|
4078
|
+
this.type = "Average Vertical Oscillation";
|
|
4079
|
+
}
|
|
4080
|
+
static {
|
|
4081
|
+
this.unit = "mm";
|
|
4082
|
+
}
|
|
4083
|
+
};
|
|
4084
|
+
|
|
4085
|
+
// src/data/data.vertical-oscillation-max.ts
|
|
4086
|
+
var DataVerticalOscillationMax = class extends DataNumber {
|
|
4087
|
+
static {
|
|
4088
|
+
this.type = "Maximum Vertical Oscillation";
|
|
4089
|
+
}
|
|
4090
|
+
static {
|
|
4091
|
+
this.unit = "mm";
|
|
4092
|
+
}
|
|
4093
|
+
};
|
|
4094
|
+
|
|
4095
|
+
// src/data/data.vertical-oscillation-min.ts
|
|
4096
|
+
var DataVerticalOscillationMin = class extends DataNumber {
|
|
4097
|
+
static {
|
|
4098
|
+
this.type = "Minimum Vertical Oscillation";
|
|
4099
|
+
}
|
|
4100
|
+
static {
|
|
4101
|
+
this.unit = "mm";
|
|
4102
|
+
}
|
|
4103
|
+
};
|
|
4104
|
+
|
|
4105
|
+
// src/data/data.fitness-age.ts
|
|
4106
|
+
var DataFitnessAge = class extends DataNumber {
|
|
4107
|
+
static {
|
|
4108
|
+
this.type = "Fitness Age";
|
|
4109
|
+
}
|
|
4110
|
+
static {
|
|
4111
|
+
this.unit = "years";
|
|
4112
|
+
}
|
|
4113
|
+
};
|
|
4114
|
+
|
|
4115
|
+
// src/data/data.max-hr-setting.ts
|
|
4116
|
+
var DataMaxHRSetting = class extends DataNumber {
|
|
4117
|
+
static {
|
|
4118
|
+
this.type = "Max HR Setting";
|
|
4119
|
+
}
|
|
4120
|
+
static {
|
|
4121
|
+
this.unit = "bpm";
|
|
4122
|
+
}
|
|
4123
|
+
};
|
|
4124
|
+
|
|
4125
|
+
// src/data/data.depth.ts
|
|
4126
|
+
var DataDepth = class extends DataNumber {
|
|
4127
|
+
static {
|
|
4128
|
+
this.type = "Depth";
|
|
4129
|
+
}
|
|
4130
|
+
static {
|
|
4131
|
+
this.unit = "m";
|
|
4132
|
+
}
|
|
4133
|
+
};
|
|
4134
|
+
|
|
4135
|
+
// src/data/data.depth-max.ts
|
|
4136
|
+
var DataDepthMax = class extends DataNumber {
|
|
4137
|
+
static {
|
|
4138
|
+
this.type = "Maximum Depth";
|
|
4139
|
+
}
|
|
4140
|
+
static {
|
|
4141
|
+
this.unit = "m";
|
|
4142
|
+
}
|
|
4143
|
+
};
|
|
4144
|
+
|
|
4024
4145
|
// src/data/data.store.ts
|
|
4025
4146
|
var DataTotalTrainingEffectLegacy = class extends DataAerobicTrainingEffect {
|
|
4026
4147
|
static {
|
|
@@ -4316,7 +4437,21 @@ var DataStore = {
|
|
|
4316
4437
|
DataRightTorqueEffectiveness,
|
|
4317
4438
|
DataTotalFlow,
|
|
4318
4439
|
DataTotalGrit,
|
|
4319
|
-
DataTrainingLoadPeak
|
|
4440
|
+
DataTrainingLoadPeak,
|
|
4441
|
+
DataGroundContactTime,
|
|
4442
|
+
DataGroundContactTimeAvg,
|
|
4443
|
+
DataGroundContactTimeMax,
|
|
4444
|
+
DataGroundContactTimeMin,
|
|
4445
|
+
DataGroundContactTimeBalance,
|
|
4446
|
+
DataGroundContactTimeBalanceLeft,
|
|
4447
|
+
DataGroundContactTimeBalanceRight,
|
|
4448
|
+
DataVerticalOscillationAvg,
|
|
4449
|
+
DataVerticalOscillationMax,
|
|
4450
|
+
DataVerticalOscillationMin,
|
|
4451
|
+
DataFitnessAge,
|
|
4452
|
+
DataMaxHRSetting,
|
|
4453
|
+
DataDepth,
|
|
4454
|
+
DataDepthMax
|
|
4320
4455
|
};
|
|
4321
4456
|
var DynamicDataLoader = class _DynamicDataLoader {
|
|
4322
4457
|
static {
|
|
@@ -4547,6 +4682,13 @@ var DynamicDataLoader = class _DynamicDataLoader {
|
|
|
4547
4682
|
];
|
|
4548
4683
|
}
|
|
4549
4684
|
static getDataInstanceFromDataType(dataType, opts) {
|
|
4685
|
+
if (dataType === DataStanceTime.type) {
|
|
4686
|
+
dataType = DataGroundContactTime.type;
|
|
4687
|
+
} else if (dataType === DataStanceTimeBalanceLeft.type) {
|
|
4688
|
+
dataType = DataGroundContactTimeBalanceLeft.type;
|
|
4689
|
+
} else if (dataType === DataStanceTimeBalanceRight.type) {
|
|
4690
|
+
dataType = DataGroundContactTimeBalanceRight.type;
|
|
4691
|
+
}
|
|
4550
4692
|
const className = Object.keys(DataStore).find((dataClass) => {
|
|
4551
4693
|
return DataStore[dataClass] && DataStore[dataClass].type && DataStore[dataClass].type === dataType;
|
|
4552
4694
|
});
|
|
@@ -6470,11 +6612,34 @@ var ActivityUtilities = class _ActivityUtilities {
|
|
|
6470
6612
|
activity.addStat(new DataRightBalance(avgRightBalance));
|
|
6471
6613
|
activity.addStat(new DataLeftBalance(100 - avgRightBalance));
|
|
6472
6614
|
}
|
|
6615
|
+
if (!activity.getStat(DataGroundContactTimeBalanceLeft.type) && activity.hasStreamData(DataGroundContactTimeBalanceLeft.type)) {
|
|
6616
|
+
const avgStanceTimeLeftBalance = this.round(this.getDataTypeAvg(activity, DataGroundContactTimeBalanceLeft.type), 2);
|
|
6617
|
+
activity.addStat(new DataGroundContactTimeBalanceLeft(avgStanceTimeLeftBalance));
|
|
6618
|
+
activity.addStat(new DataGroundContactTimeBalanceRight(100 - avgStanceTimeLeftBalance));
|
|
6619
|
+
}
|
|
6473
6620
|
if (!activity.getStat(DataStanceTimeBalanceLeft.type) && activity.hasStreamData(DataStanceTimeBalanceLeft.type)) {
|
|
6474
6621
|
const avgStanceTimeLeftBalance = this.round(this.getDataTypeAvg(activity, DataStanceTimeBalanceLeft.type), 2);
|
|
6475
6622
|
activity.addStat(new DataStanceTimeBalanceLeft(avgStanceTimeLeftBalance));
|
|
6476
6623
|
activity.addStat(new DataStanceTimeBalanceRight(100 - avgStanceTimeLeftBalance));
|
|
6477
6624
|
}
|
|
6625
|
+
if (!activity.getStat(DataGroundContactTimeMax.type) && activity.hasStreamData(DataGroundContactTime.type)) {
|
|
6626
|
+
activity.addStat(new DataGroundContactTimeMax(this.getDataTypeMax(activity, DataGroundContactTime.type)));
|
|
6627
|
+
}
|
|
6628
|
+
if (!activity.getStat(DataGroundContactTimeMin.type) && activity.hasStreamData(DataGroundContactTime.type)) {
|
|
6629
|
+
activity.addStat(new DataGroundContactTimeMin(this.getDataTypeMin(activity, DataGroundContactTime.type)));
|
|
6630
|
+
}
|
|
6631
|
+
if (!activity.getStat(DataGroundContactTimeAvg.type) && activity.hasStreamData(DataGroundContactTime.type)) {
|
|
6632
|
+
activity.addStat(new DataGroundContactTimeAvg(this.getDataTypeAvg(activity, DataGroundContactTime.type)));
|
|
6633
|
+
}
|
|
6634
|
+
if (!activity.getStat(DataVerticalOscillationMax.type) && activity.hasStreamData(DataVerticalOscillation.type)) {
|
|
6635
|
+
activity.addStat(new DataVerticalOscillationMax(this.getDataTypeMax(activity, DataVerticalOscillation.type)));
|
|
6636
|
+
}
|
|
6637
|
+
if (!activity.getStat(DataVerticalOscillationMin.type) && activity.hasStreamData(DataVerticalOscillation.type)) {
|
|
6638
|
+
activity.addStat(new DataVerticalOscillationMin(this.getDataTypeMin(activity, DataVerticalOscillation.type)));
|
|
6639
|
+
}
|
|
6640
|
+
if (!activity.getStat(DataVerticalOscillationAvg.type) && activity.hasStreamData(DataVerticalOscillation.type)) {
|
|
6641
|
+
activity.addStat(new DataVerticalOscillationAvg(this.getDataTypeAvg(activity, DataVerticalOscillation.type)));
|
|
6642
|
+
}
|
|
6478
6643
|
}
|
|
6479
6644
|
static generateMissingSpeedDerivedStatsForActivity(activity) {
|
|
6480
6645
|
const speedMax = activity.getStat(DataSpeedMax.type);
|
|
@@ -9608,12 +9773,32 @@ var FITSampleMapper = [
|
|
|
9608
9773
|
return sample.left_right_balance.right === false ? sample.left_right_balance.value : 100 - sample.left_right_balance.value;
|
|
9609
9774
|
}
|
|
9610
9775
|
},
|
|
9776
|
+
{
|
|
9777
|
+
dataType: DataGroundContactTime.type,
|
|
9778
|
+
getSampleValue: (sample) => {
|
|
9779
|
+
return sample.stance_time;
|
|
9780
|
+
}
|
|
9781
|
+
},
|
|
9782
|
+
// Keep DataStanceTime for backward compatibility
|
|
9611
9783
|
{
|
|
9612
9784
|
dataType: DataStanceTime.type,
|
|
9613
9785
|
getSampleValue: (sample) => {
|
|
9614
9786
|
return sample.stance_time;
|
|
9615
9787
|
}
|
|
9616
9788
|
},
|
|
9789
|
+
{
|
|
9790
|
+
dataType: DataGroundContactTimeBalanceLeft.type,
|
|
9791
|
+
getSampleValue: (sample) => {
|
|
9792
|
+
return sample.stance_time_balance;
|
|
9793
|
+
}
|
|
9794
|
+
},
|
|
9795
|
+
{
|
|
9796
|
+
dataType: DataGroundContactTimeBalanceRight.type,
|
|
9797
|
+
getSampleValue: (sample) => {
|
|
9798
|
+
return isNumber(sample.stance_time_balance) ? 100 - sample.stance_time_balance : null;
|
|
9799
|
+
}
|
|
9800
|
+
},
|
|
9801
|
+
// Keep DataStanceTimeBalanceLeft for backward compatibility
|
|
9617
9802
|
{
|
|
9618
9803
|
dataType: DataStanceTimeBalanceLeft.type,
|
|
9619
9804
|
getSampleValue: (sample) => {
|
|
@@ -9853,10 +10038,10 @@ var ImporterFitDevelopmentDeviceNames = {
|
|
|
9853
10038
|
};
|
|
9854
10039
|
|
|
9855
10040
|
// src/events/adapters/importers/fit/importer.fit.ts
|
|
9856
|
-
var FitFileParser = __require("fit-file-parser").default;
|
|
9857
10041
|
var INVALID_DATES_ELAPSED_TIME_RATIO_THRESHOLD = 1.15;
|
|
9858
10042
|
var EventImporterFIT = class {
|
|
9859
10043
|
static async getFromArrayBuffer(arrayBuffer, options = ActivityParsingOptions.DEFAULT, name = "New Event") {
|
|
10044
|
+
const { default: FitFileParser } = await import("fit-file-parser");
|
|
9860
10045
|
return new Promise((resolve, reject) => {
|
|
9861
10046
|
const fitFileParser = new FitFileParser({
|
|
9862
10047
|
force: true,
|
|
@@ -10549,6 +10734,7 @@ var EventImporterFIT = class {
|
|
|
10549
10734
|
stats.push(new DataCyclingSeatedTime(seatedTime));
|
|
10550
10735
|
}
|
|
10551
10736
|
if (Number.isFinite(object.avg_stance_time)) {
|
|
10737
|
+
stats.push(new DataGroundContactTimeAvg(object.avg_stance_time));
|
|
10552
10738
|
stats.push(new DataStanceTime(object.avg_stance_time));
|
|
10553
10739
|
}
|
|
10554
10740
|
if (Number.isFinite(object.avg_vertical_oscillation)) {
|
|
@@ -11058,9 +11244,11 @@ var EventImporterSuuntoJSON = class {
|
|
|
11058
11244
|
}).map((lapWindow) => lapWindow.Window) : [];
|
|
11059
11245
|
const activities = activityStartEventSamples.map(
|
|
11060
11246
|
(activityStartEventSample, index) => {
|
|
11247
|
+
const lastSampleTime = eventJSONObject.DeviceLog.Samples[eventJSONObject.DeviceLog.Samples.length - 1].TimeISO8601;
|
|
11248
|
+
const fallbackEndTime = stopEventSample ? stopEventSample.TimeISO8601 : lastSampleTime;
|
|
11061
11249
|
const activity = new Activity(
|
|
11062
11250
|
new Date(activityStartEventSample.TimeISO8601),
|
|
11063
|
-
activityStartEventSamples.length - 1 === index ? new Date(
|
|
11251
|
+
activityStartEventSamples.length - 1 === index ? new Date(fallbackEndTime) : new Date(activityStartEventSamples[index + 1].TimeISO8601),
|
|
11064
11252
|
ActivityTypes[ImporterSuuntoActivityIds[activityStartEventSample.Events[0].Activity.ActivityType]],
|
|
11065
11253
|
creator,
|
|
11066
11254
|
options
|
|
@@ -11181,9 +11369,6 @@ var EventImporterSuuntoJSON = class {
|
|
|
11181
11369
|
}
|
|
11182
11370
|
const event = new Event("", activities[0].startDate, activities[activities.length - 1].endDate, "suunto" /* SUUNTO */);
|
|
11183
11371
|
activities.forEach((activity) => event.addActivity(activity));
|
|
11184
|
-
this.getStats(eventJSONObject.DeviceLog.Header).forEach((stat) => {
|
|
11185
|
-
event.addStat(stat);
|
|
11186
|
-
});
|
|
11187
11372
|
if (eventJSONObject.DeviceLog.Header.Settings) {
|
|
11188
11373
|
this.getSettings(eventJSONObject.DeviceLog.Header.Settings).forEach((stat) => {
|
|
11189
11374
|
event.getActivities().forEach((activity) => activity.addStat(stat));
|
|
@@ -11196,6 +11381,9 @@ var EventImporterSuuntoJSON = class {
|
|
|
11196
11381
|
stats.forEach((stat) => activities[0].addStat(stat));
|
|
11197
11382
|
}
|
|
11198
11383
|
EventUtilities.generateStatsForAll(event);
|
|
11384
|
+
this.getStats(eventJSONObject.DeviceLog.Header).forEach((stat) => {
|
|
11385
|
+
event.addStat(stat);
|
|
11386
|
+
});
|
|
11199
11387
|
resolve(event);
|
|
11200
11388
|
});
|
|
11201
11389
|
}
|
|
@@ -11434,6 +11622,47 @@ var EventImporterSuuntoJSON = class {
|
|
|
11434
11622
|
}
|
|
11435
11623
|
}
|
|
11436
11624
|
}
|
|
11625
|
+
if (object.hasOwnProperty("GroundContactTime")) {
|
|
11626
|
+
if (Array.isArray(object.GroundContactTime)) {
|
|
11627
|
+
if (isNumber(object.GroundContactTime[0].Avg)) {
|
|
11628
|
+
stats.push(new DataGroundContactTimeAvg(object.GroundContactTime[0].Avg * 1e3));
|
|
11629
|
+
}
|
|
11630
|
+
if (isNumber(object.GroundContactTime[0].Max)) {
|
|
11631
|
+
stats.push(new DataGroundContactTimeMax(object.GroundContactTime[0].Max * 1e3));
|
|
11632
|
+
}
|
|
11633
|
+
if (isNumber(object.GroundContactTime[0].Min)) {
|
|
11634
|
+
stats.push(new DataGroundContactTimeMin(object.GroundContactTime[0].Min * 1e3));
|
|
11635
|
+
}
|
|
11636
|
+
}
|
|
11637
|
+
}
|
|
11638
|
+
if (object.hasOwnProperty("VerticalOscillation")) {
|
|
11639
|
+
if (Array.isArray(object.VerticalOscillation)) {
|
|
11640
|
+
if (isNumber(object.VerticalOscillation[0].Avg)) {
|
|
11641
|
+
stats.push(new DataVerticalOscillationAvg(object.VerticalOscillation[0].Avg * 1e3));
|
|
11642
|
+
}
|
|
11643
|
+
if (isNumber(object.VerticalOscillation[0].Max)) {
|
|
11644
|
+
stats.push(new DataVerticalOscillationMax(object.VerticalOscillation[0].Max * 1e3));
|
|
11645
|
+
}
|
|
11646
|
+
if (isNumber(object.VerticalOscillation[0].Min)) {
|
|
11647
|
+
stats.push(new DataVerticalOscillationMin(object.VerticalOscillation[0].Min * 1e3));
|
|
11648
|
+
}
|
|
11649
|
+
}
|
|
11650
|
+
}
|
|
11651
|
+
if (isNumber(object.FitnessAge)) {
|
|
11652
|
+
stats.push(new DataFitnessAge(object.FitnessAge));
|
|
11653
|
+
}
|
|
11654
|
+
if (object.Personal && isNumber(object.Personal.MaxHR)) {
|
|
11655
|
+
stats.push(new DataMaxHRSetting(object.Personal.MaxHR * 60));
|
|
11656
|
+
}
|
|
11657
|
+
if (object.hasOwnProperty("Depth")) {
|
|
11658
|
+
if (Array.isArray(object.Depth)) {
|
|
11659
|
+
if (isNumber(object.Depth[0].Max) && object.Depth[0].Max > 0) {
|
|
11660
|
+
stats.push(new DataDepthMax(object.Depth[0].Max));
|
|
11661
|
+
}
|
|
11662
|
+
} else if (isNumber(object.Depth.Max) && object.Depth.Max > 0) {
|
|
11663
|
+
stats.push(new DataDepthMax(object.Depth.Max));
|
|
11664
|
+
}
|
|
11665
|
+
}
|
|
11437
11666
|
return stats;
|
|
11438
11667
|
}
|
|
11439
11668
|
};
|
|
@@ -11625,6 +11854,23 @@ var SuuntoSampleMapper = [
|
|
|
11625
11854
|
dataType: DataBatteryVoltage.type,
|
|
11626
11855
|
sampleField: "BatteryVoltage",
|
|
11627
11856
|
convertSampleValue: (value) => Number(value)
|
|
11857
|
+
},
|
|
11858
|
+
{
|
|
11859
|
+
dataType: DataVerticalOscillation.type,
|
|
11860
|
+
sampleField: "VerticalOscillation",
|
|
11861
|
+
convertSampleValue: (value) => Number(value * 1e3)
|
|
11862
|
+
// Convert m to mm
|
|
11863
|
+
},
|
|
11864
|
+
{
|
|
11865
|
+
dataType: DataGroundContactTime.type,
|
|
11866
|
+
sampleField: "GroundContactTime",
|
|
11867
|
+
convertSampleValue: (value) => Number(value * 1e3)
|
|
11868
|
+
// Convert s to ms
|
|
11869
|
+
},
|
|
11870
|
+
{
|
|
11871
|
+
dataType: DataDepth.type,
|
|
11872
|
+
sampleField: "Depth",
|
|
11873
|
+
convertSampleValue: (value) => Number(value)
|
|
11628
11874
|
}
|
|
11629
11875
|
];
|
|
11630
11876
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sports-alliance/sports-lib",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.2",
|
|
4
4
|
"description": "A Library to for importing / exporting and processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gpx",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"fast-xml-parser": "^5.3.3",
|
|
57
|
-
"fit-file-parser": "2.2.
|
|
57
|
+
"fit-file-parser": "2.2.4",
|
|
58
58
|
"geolib": "^3.3.4",
|
|
59
59
|
"gpx-builder": "^3.7.8",
|
|
60
60
|
"kalmanjs": "^1.1.0",
|