@glandais/vcyclist-engine 4.2.1 → 5.0.0
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/README.md +141 -276
- package/index.cjs +70 -0
- package/index.d.ts +725 -0
- package/index.mjs +70 -0
- package/kotlin-kotlin-stdlib.js +41 -41
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/package.json +11 -3
- package/vcyclist-elevation.js +160 -44
- package/vcyclist-elevation.js.map +1 -1
- package/vcyclist-engine.d.ts +10 -6
- package/vcyclist-engine.js +455 -255
- package/vcyclist-engine.js.map +1 -1
- package/vcyclist-fit.js +2 -2
- package/vcyclist-fit.js.map +1 -1
- package/vcyclist-gpx.js +748 -275
- package/vcyclist-gpx.js.map +1 -1
package/vcyclist-engine.js
CHANGED
|
@@ -38,21 +38,28 @@
|
|
|
38
38
|
var initMetadataForClass = kotlin_kotlin.$_$.u6;
|
|
39
39
|
var toString = kotlin_kotlin.$_$.m7;
|
|
40
40
|
var hashCode = kotlin_kotlin.$_$.t6;
|
|
41
|
+
var ElevationGainPreset_DEM_getInstance = kotlin_io_github_glandais_gpx.$_$.c;
|
|
41
42
|
var initMetadataForObject = kotlin_kotlin.$_$.a7;
|
|
42
43
|
var getBooleanHashCode = kotlin_kotlin.$_$.p6;
|
|
43
44
|
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.a2;
|
|
44
45
|
var Unit_instance = kotlin_kotlin.$_$.g1;
|
|
46
|
+
var ElevationGainOptions = kotlin_io_github_glandais_gpx.$_$.y;
|
|
47
|
+
var isFinite = kotlin_kotlin.$_$.ma;
|
|
45
48
|
var CoroutineImpl = kotlin_kotlin.$_$.d5;
|
|
46
|
-
var PointPerDistance_instance = kotlin_io_github_glandais_gpx.$_$.
|
|
47
|
-
var ElevationStep_instance = kotlin_io_github_glandais_gpx.$_$.
|
|
49
|
+
var PointPerDistance_instance = kotlin_io_github_glandais_gpx.$_$.o;
|
|
50
|
+
var ElevationStep_instance = kotlin_io_github_glandais_gpx.$_$.l;
|
|
48
51
|
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.o4;
|
|
49
|
-
var PointPerSecond_instance = kotlin_io_github_glandais_gpx.$_$.
|
|
50
|
-
var PathSimplifier_instance = kotlin_io_github_glandais_gpx.$_$.
|
|
52
|
+
var PointPerSecond_instance = kotlin_io_github_glandais_gpx.$_$.p;
|
|
53
|
+
var PathSimplifier_instance = kotlin_io_github_glandais_gpx.$_$.m;
|
|
54
|
+
var ElevationGain_instance = kotlin_io_github_glandais_gpx.$_$.k;
|
|
51
55
|
var initMetadataForCoroutine = kotlin_kotlin.$_$.w6;
|
|
56
|
+
var Companion_instance = kotlin_kotlin.$_$.e1;
|
|
57
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.x2;
|
|
58
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.i1;
|
|
52
59
|
var enumEntries = kotlin_kotlin.$_$.f5;
|
|
53
60
|
var Enum = kotlin_kotlin.$_$.t9;
|
|
54
|
-
var
|
|
55
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
61
|
+
var noWhenBranchMatchedException = kotlin_kotlin.$_$.qa;
|
|
62
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.j1;
|
|
56
63
|
var last = kotlin_kotlin.$_$.q3;
|
|
57
64
|
var toIntArray = kotlin_kotlin.$_$.f4;
|
|
58
65
|
var sortedWith = kotlin_kotlin.$_$.b4;
|
|
@@ -60,8 +67,7 @@
|
|
|
60
67
|
var first = kotlin_kotlin.$_$.j3;
|
|
61
68
|
var removeAll = kotlin_kotlin.$_$.w3;
|
|
62
69
|
var numberRangeToNumber = kotlin_kotlin.$_$.f7;
|
|
63
|
-
var
|
|
64
|
-
var Vector3D = kotlin_io_github_glandais_elevation.$_$.g;
|
|
70
|
+
var Vector3D = kotlin_io_github_glandais_elevation.$_$.h;
|
|
65
71
|
var emptyList = kotlin_kotlin.$_$.g3;
|
|
66
72
|
var coerceIn = kotlin_kotlin.$_$.u7;
|
|
67
73
|
var DouglasPeucker_instance = kotlin_io_github_glandais_elevation.$_$.b;
|
|
@@ -73,14 +79,11 @@
|
|
|
73
79
|
var Pair = kotlin_kotlin.$_$.z9;
|
|
74
80
|
var listOf = kotlin_kotlin.$_$.r3;
|
|
75
81
|
var Default_getInstance = kotlin_kotlin.$_$.b1;
|
|
76
|
-
var Companion_instance = kotlin_kotlin.$_$.e1;
|
|
77
82
|
var equals_0 = kotlin_kotlin.$_$.p8;
|
|
78
|
-
var noWhenBranchMatchedException = kotlin_kotlin.$_$.qa;
|
|
79
83
|
var isNaN_0 = kotlin_kotlin.$_$.oa;
|
|
80
|
-
var
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var Path = kotlin_io_github_glandais_gpx.$_$.t;
|
|
84
|
+
var PointField_TEMPERATURE_getInstance = kotlin_io_github_glandais_gpx.$_$.d;
|
|
85
|
+
var get_entries = kotlin_io_github_glandais_gpx.$_$.a1;
|
|
86
|
+
var Path = kotlin_io_github_glandais_gpx.$_$.z;
|
|
84
87
|
var arrayCopy = kotlin_kotlin.$_$.t2;
|
|
85
88
|
var sort = kotlin_kotlin.$_$.d4;
|
|
86
89
|
var numberToInt = kotlin_kotlin.$_$.h7;
|
|
@@ -102,40 +105,44 @@
|
|
|
102
105
|
var zipWithNext = kotlin_kotlin.$_$.l4;
|
|
103
106
|
var toDoubleArray = kotlin_kotlin.$_$.e4;
|
|
104
107
|
var joinToString = kotlin_kotlin.$_$.m3;
|
|
105
|
-
var GpxParser_instance = kotlin_io_github_glandais_gpx.$_$.
|
|
108
|
+
var GpxParser_instance = kotlin_io_github_glandais_gpx.$_$.e;
|
|
106
109
|
var copyToArray = kotlin_kotlin.$_$.f3;
|
|
107
|
-
var firstTrackAsPath = kotlin_io_github_glandais_gpx.$_$.
|
|
108
|
-
var tracksAsPaths = kotlin_io_github_glandais_gpx.$_$.
|
|
109
|
-
var segmentsAsPaths = kotlin_io_github_glandais_gpx.$_$.
|
|
110
|
+
var firstTrackAsPath = kotlin_io_github_glandais_gpx.$_$.r;
|
|
111
|
+
var tracksAsPaths = kotlin_io_github_glandais_gpx.$_$.v;
|
|
112
|
+
var segmentsAsPaths = kotlin_io_github_glandais_gpx.$_$.t;
|
|
110
113
|
var GpxPathKind_TRACK_getInstance = kotlin_io_github_glandais_gpx.$_$.b;
|
|
111
114
|
var setOf = kotlin_kotlin.$_$.z3;
|
|
112
115
|
var GpxPathKind_ROUTE_getInstance = kotlin_io_github_glandais_gpx.$_$.a;
|
|
113
|
-
var GpxWriter_instance = kotlin_io_github_glandais_gpx.$_$.
|
|
116
|
+
var GpxWriter_instance = kotlin_io_github_glandais_gpx.$_$.g;
|
|
114
117
|
var toList = kotlin_kotlin.$_$.i4;
|
|
115
|
-
var toGpxDocument = kotlin_io_github_glandais_gpx.$_$.p;
|
|
116
118
|
var Companion_getInstance = kotlin_kotlin.$_$.d1;
|
|
119
|
+
var pathsToGpxDocument = kotlin_io_github_glandais_gpx.$_$.s;
|
|
120
|
+
var toGpxDocument = kotlin_io_github_glandais_gpx.$_$.u;
|
|
117
121
|
var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
|
|
118
122
|
var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
|
|
119
|
-
var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.
|
|
123
|
+
var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.n;
|
|
120
124
|
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.c2;
|
|
121
|
-
var
|
|
125
|
+
var CsvOptions = kotlin_io_github_glandais_gpx.$_$.w;
|
|
126
|
+
var CsvWriter_instance = kotlin_io_github_glandais_gpx.$_$.h;
|
|
122
127
|
var firstOrNull = kotlin_kotlin.$_$.q8;
|
|
123
|
-
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.b;
|
|
124
128
|
var Char = kotlin_kotlin.$_$.r9;
|
|
125
|
-
var
|
|
126
|
-
var
|
|
127
|
-
var
|
|
129
|
+
var charSequenceLength = kotlin_kotlin.$_$.i6;
|
|
130
|
+
var JsonOptions = kotlin_io_github_glandais_gpx.$_$.x;
|
|
131
|
+
var JsonWriter_instance = kotlin_io_github_glandais_gpx.$_$.i;
|
|
128
132
|
var toFitBytes = kotlin_io_github_glandais_fit.$_$.a;
|
|
129
133
|
var Companion_getInstance_1 = kotlin_kotlin.$_$.c1;
|
|
130
134
|
var DurationUnit_MILLISECONDS_getInstance = kotlin_kotlin.$_$.w;
|
|
131
135
|
var toDuration = kotlin_kotlin.$_$.q9;
|
|
132
136
|
var toFitBytes_0 = kotlin_io_github_glandais_fit.$_$.b;
|
|
133
137
|
var toNumber = kotlin_kotlin.$_$.a6;
|
|
134
|
-
var
|
|
138
|
+
var Companion_getInstance_2 = kotlin_io_github_glandais_gpx.$_$.f;
|
|
139
|
+
var GpxWaypoint = kotlin_io_github_glandais_gpx.$_$.q;
|
|
140
|
+
var Companion_instance_0 = kotlin_io_github_glandais_gpx.$_$.j;
|
|
141
|
+
var ElevationProvider = kotlin_io_github_glandais_elevation.$_$.e;
|
|
142
|
+
var ElevationProviderConfig = kotlin_io_github_glandais_elevation.$_$.d;
|
|
135
143
|
var sorted = kotlin_kotlin.$_$.c4;
|
|
136
144
|
var THROW_CCE = kotlin_kotlin.$_$.ca;
|
|
137
145
|
var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
|
|
138
|
-
var ElevationProvider = kotlin_io_github_glandais_elevation.$_$.d;
|
|
139
146
|
var initMetadataForLambda = kotlin_kotlin.$_$.z6;
|
|
140
147
|
var constructCallableReference = kotlin_kotlin.$_$.k6;
|
|
141
148
|
var setOf_0 = kotlin_kotlin.$_$.a4;
|
|
@@ -155,12 +162,13 @@
|
|
|
155
162
|
initMetadataForClass(EnhanceOptions, 'EnhanceOptions', EnhanceOptions);
|
|
156
163
|
initMetadataForCoroutine($enhanceCourseCOROUTINE$, CoroutineImpl);
|
|
157
164
|
initMetadataForObject(Enhancer, 'Enhancer', VOID, VOID, VOID, [3]);
|
|
165
|
+
initMetadataForCompanion(Companion_3);
|
|
158
166
|
initMetadataForClass(RoadCondition, 'RoadCondition', VOID, Enum);
|
|
159
167
|
initMetadataForClass(Climb, 'Climb');
|
|
160
168
|
initMetadataForClass(ClimbPart, 'ClimbPart');
|
|
161
|
-
initMetadataForCompanion(Companion_3);
|
|
162
|
-
initMetadataForClass(ClimbOptions, 'ClimbOptions', ClimbOptions);
|
|
163
169
|
initMetadataForCompanion(Companion_4);
|
|
170
|
+
initMetadataForClass(ClimbOptions, 'ClimbOptions', ClimbOptions);
|
|
171
|
+
initMetadataForCompanion(Companion_5);
|
|
164
172
|
initMetadataForClass(Profile, 'Profile');
|
|
165
173
|
initMetadataForClass(Candidate, 'Candidate');
|
|
166
174
|
initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
@@ -168,9 +176,9 @@
|
|
|
168
176
|
initMetadataForObject(ClimbDetector, 'ClimbDetector');
|
|
169
177
|
initMetadataForObject(AeroPowerProvider, 'AeroPowerProvider');
|
|
170
178
|
initMetadataForObject(AeroProviderConstant, 'AeroProviderConstant');
|
|
171
|
-
initMetadataForCompanion(Companion_5);
|
|
172
|
-
initMetadataForClass(CyclistPowerProviderBase, 'CyclistPowerProviderBase');
|
|
173
179
|
initMetadataForCompanion(Companion_6);
|
|
180
|
+
initMetadataForClass(CyclistPowerProviderBase, 'CyclistPowerProviderBase');
|
|
181
|
+
initMetadataForCompanion(Companion_7);
|
|
174
182
|
initMetadataForClass(PowerModel, 'PowerModel', VOID, Enum);
|
|
175
183
|
initMetadataForClass(CyclistPowerSpec, 'CyclistPowerSpec', CyclistPowerSpec);
|
|
176
184
|
initMetadataForObject(GravPowerProvider, 'GravPowerProvider');
|
|
@@ -179,20 +187,20 @@
|
|
|
179
187
|
initMetadataForObject(MuscularPowerProvider, 'MuscularPowerProvider');
|
|
180
188
|
initMetadataForObject(PowerComputer, 'PowerComputer');
|
|
181
189
|
initMetadataForClass(PowerProviderConstant, 'PowerProviderConstant', VOID, CyclistPowerProviderBase);
|
|
182
|
-
initMetadataForCompanion(Companion_7);
|
|
183
|
-
initMetadataForClass(PowerProviderCriticalPower, 'PowerProviderCriticalPower', VOID, CyclistPowerProviderBase);
|
|
184
190
|
initMetadataForCompanion(Companion_8);
|
|
191
|
+
initMetadataForClass(PowerProviderCriticalPower, 'PowerProviderCriticalPower', VOID, CyclistPowerProviderBase);
|
|
192
|
+
initMetadataForCompanion(Companion_9);
|
|
185
193
|
initMetadataForClass(PowerProviderDurability, 'PowerProviderDurability', VOID, CyclistPowerProviderBase);
|
|
186
194
|
initMetadataForObject(PowerProviderFromData, 'PowerProviderFromData');
|
|
187
195
|
initMetadataForClass(PowerProviderSlewLimited, 'PowerProviderSlewLimited');
|
|
188
|
-
initMetadataForCompanion(
|
|
196
|
+
initMetadataForCompanion(Companion_10);
|
|
189
197
|
initMetadataForClass(PowerProviderTerrainPacing, 'PowerProviderTerrainPacing');
|
|
190
198
|
initMetadataForObject(RhoProviderDefault, 'RhoProviderDefault');
|
|
191
199
|
initMetadataForObject(RhoProviderEstimate, 'RhoProviderEstimate');
|
|
192
200
|
initMetadataForObject(RollingResistancePowerProvider, 'RollingResistancePowerProvider');
|
|
193
201
|
initMetadataForObject(VirtualizeService, 'VirtualizeService');
|
|
194
202
|
initMetadataForObject(WheelBearingsPowerProvider, 'WheelBearingsPowerProvider');
|
|
195
|
-
initMetadataForCompanion(
|
|
203
|
+
initMetadataForCompanion(Companion_11);
|
|
196
204
|
initMetadataForClass(Wind, 'Wind');
|
|
197
205
|
initMetadataForObject(WindProviderNone, 'WindProviderNone');
|
|
198
206
|
initMetadataForClass(WindProviderConstant, 'WindProviderConstant');
|
|
@@ -205,36 +213,36 @@
|
|
|
205
213
|
initMetadataForClass(Fit, 'Fit');
|
|
206
214
|
initMetadataForObject(CurvatureEstimator, 'CurvatureEstimator');
|
|
207
215
|
initMetadataForObject(LocalFrame, 'LocalFrame');
|
|
208
|
-
initMetadataForCompanion(
|
|
216
|
+
initMetadataForCompanion(Companion_12);
|
|
209
217
|
initMetadataForClass(OffsetEnergy, 'OffsetEnergy');
|
|
210
218
|
initMetadataForClass(QpResult, 'QpResult');
|
|
211
219
|
initMetadataForObject(OffsetQp, 'OffsetQp');
|
|
212
|
-
initMetadataForCompanion(
|
|
220
|
+
initMetadataForCompanion(Companion_13);
|
|
213
221
|
initMetadataForClass(CurvatureOptions, 'CurvatureOptions', CurvatureOptions);
|
|
214
222
|
initMetadataForObject(PathCurvature, 'PathCurvature');
|
|
215
223
|
initMetadataForClass(PlanarFrame, 'PlanarFrame');
|
|
216
224
|
initMetadataForClass(RacingLineReport, 'RacingLineReport');
|
|
217
225
|
initMetadataForObject(RacingLine, 'RacingLine');
|
|
218
|
-
initMetadataForCompanion(
|
|
226
|
+
initMetadataForCompanion(Companion_14);
|
|
219
227
|
initMetadataForClass(CorridorMode, 'CorridorMode', VOID, Enum);
|
|
220
228
|
initMetadataForClass(CornerKind, 'CornerKind', VOID, Enum);
|
|
221
|
-
initMetadataForCompanion(
|
|
229
|
+
initMetadataForCompanion(Companion_15);
|
|
222
230
|
initMetadataForClass(RacingLineOptions, 'RacingLineOptions', RacingLineOptions);
|
|
223
231
|
initMetadataForLambda(enhance$slambda, CoroutineImpl, VOID, [1]);
|
|
224
232
|
initMetadataForLambda(enhanceWithCourse$slambda, CoroutineImpl, VOID, [1]);
|
|
225
233
|
//endregion
|
|
226
234
|
function Companion() {
|
|
227
|
-
|
|
235
|
+
Companion_instance_1 = this;
|
|
228
236
|
this.DEFAULT_1 = new Bike();
|
|
229
237
|
}
|
|
230
|
-
var
|
|
231
|
-
function
|
|
232
|
-
if (
|
|
238
|
+
var Companion_instance_1;
|
|
239
|
+
function Companion_getInstance_3() {
|
|
240
|
+
if (Companion_instance_1 == null)
|
|
233
241
|
new Companion();
|
|
234
|
-
return
|
|
242
|
+
return Companion_instance_1;
|
|
235
243
|
}
|
|
236
244
|
function Bike(crr, inertiaFront, inertiaRear, wheelRadiusM, efficiency, maxPedalingLeanAngleDeg) {
|
|
237
|
-
|
|
245
|
+
Companion_getInstance_3();
|
|
238
246
|
crr = crr === VOID ? 0.004 : crr;
|
|
239
247
|
inertiaFront = inertiaFront === VOID ? 0.05 : inertiaFront;
|
|
240
248
|
inertiaRear = inertiaRear === VOID ? 0.07 : inertiaRear;
|
|
@@ -291,8 +299,8 @@
|
|
|
291
299
|
return true;
|
|
292
300
|
};
|
|
293
301
|
function Course(path, cyclist, bike) {
|
|
294
|
-
cyclist = cyclist === VOID ?
|
|
295
|
-
bike = bike === VOID ?
|
|
302
|
+
cyclist = cyclist === VOID ? Companion_getInstance_5().DEFAULT_1 : cyclist;
|
|
303
|
+
bike = bike === VOID ? Companion_getInstance_3().DEFAULT_1 : bike;
|
|
296
304
|
this.path_1 = path;
|
|
297
305
|
this.cyclist_1 = cyclist;
|
|
298
306
|
this.bike_1 = bike;
|
|
@@ -329,21 +337,21 @@
|
|
|
329
337
|
return true;
|
|
330
338
|
};
|
|
331
339
|
function Companion_0() {
|
|
332
|
-
|
|
340
|
+
Companion_instance_2 = this;
|
|
333
341
|
this.DEFAULT_CYCLIST_POWER_PROVIDER_1 = new PowerProviderConstant(280.0);
|
|
334
342
|
}
|
|
335
|
-
var
|
|
336
|
-
function
|
|
337
|
-
if (
|
|
343
|
+
var Companion_instance_2;
|
|
344
|
+
function Companion_getInstance_4() {
|
|
345
|
+
if (Companion_instance_2 == null)
|
|
338
346
|
new Companion_0();
|
|
339
|
-
return
|
|
347
|
+
return Companion_instance_2;
|
|
340
348
|
}
|
|
341
349
|
function CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
|
|
342
|
-
|
|
350
|
+
Companion_getInstance_4();
|
|
343
351
|
rhoProvider = rhoProvider === VOID ? RhoProviderDefault_instance : rhoProvider;
|
|
344
352
|
aeroProvider = aeroProvider === VOID ? AeroProviderConstant_instance : aeroProvider;
|
|
345
353
|
windProvider = windProvider === VOID ? WindProviderNone_instance : windProvider;
|
|
346
|
-
cyclistPowerProvider = cyclistPowerProvider === VOID ?
|
|
354
|
+
cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_4().DEFAULT_CYCLIST_POWER_PROVIDER_1 : cyclistPowerProvider;
|
|
347
355
|
this.course_1 = course;
|
|
348
356
|
this.rhoProvider_1 = rhoProvider;
|
|
349
357
|
this.aeroProvider_1 = aeroProvider;
|
|
@@ -399,17 +407,17 @@
|
|
|
399
407
|
return true;
|
|
400
408
|
};
|
|
401
409
|
function Companion_1() {
|
|
402
|
-
|
|
410
|
+
Companion_instance_3 = this;
|
|
403
411
|
this.DEFAULT_1 = new Cyclist();
|
|
404
412
|
}
|
|
405
|
-
var
|
|
406
|
-
function
|
|
407
|
-
if (
|
|
413
|
+
var Companion_instance_3;
|
|
414
|
+
function Companion_getInstance_5() {
|
|
415
|
+
if (Companion_instance_3 == null)
|
|
408
416
|
new Companion_1();
|
|
409
|
-
return
|
|
417
|
+
return Companion_instance_3;
|
|
410
418
|
}
|
|
411
419
|
function Cyclist(massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH) {
|
|
412
|
-
|
|
420
|
+
Companion_getInstance_5();
|
|
413
421
|
massKg = massKg === VOID ? 80.0 : massKg;
|
|
414
422
|
maxBrakeG = maxBrakeG === VOID ? 0.4 : maxBrakeG;
|
|
415
423
|
cd = cd === VOID ? 0.7 : cd;
|
|
@@ -434,6 +442,18 @@
|
|
|
434
442
|
protoOf(Cyclist).get_maxSpeedMS_xz2r7y_k$ = function () {
|
|
435
443
|
return this.maxSpeedKmH_1 / 3.6;
|
|
436
444
|
};
|
|
445
|
+
protoOf(Cyclist).copy_q986iz_k$ = function (massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH) {
|
|
446
|
+
return new Cyclist(massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH);
|
|
447
|
+
};
|
|
448
|
+
protoOf(Cyclist).copy$default_8ozrtu_k$ = function (massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH, $super) {
|
|
449
|
+
massKg = massKg === VOID ? this.massKg_1 : massKg;
|
|
450
|
+
maxBrakeG = maxBrakeG === VOID ? this.maxBrakeG_1 : maxBrakeG;
|
|
451
|
+
cd = cd === VOID ? this.cd_1 : cd;
|
|
452
|
+
frontalAreaM2 = frontalAreaM2 === VOID ? this.frontalAreaM2__1 : frontalAreaM2;
|
|
453
|
+
maxLeanAngleDeg = maxLeanAngleDeg === VOID ? this.maxLeanAngleDeg_1 : maxLeanAngleDeg;
|
|
454
|
+
maxSpeedKmH = maxSpeedKmH === VOID ? this.maxSpeedKmH_1 : maxSpeedKmH;
|
|
455
|
+
return $super === VOID ? this.copy_q986iz_k$(massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH) : $super.copy_q986iz_k$.call(this, massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH);
|
|
456
|
+
};
|
|
437
457
|
protoOf(Cyclist).toString = function () {
|
|
438
458
|
return 'Cyclist(massKg=' + this.massKg_1 + ', maxBrakeG=' + this.maxBrakeG_1 + ', cd=' + this.cd_1 + ', frontalAreaM2=' + this.frontalAreaM2__1 + ', maxLeanAngleDeg=' + this.maxLeanAngleDeg_1 + ', maxSpeedKmH=' + this.maxSpeedKmH_1 + ')';
|
|
439
459
|
};
|
|
@@ -495,6 +515,7 @@
|
|
|
495
515
|
this.DEFAULT_DRAG_COEFFICIENT_1 = 0.7;
|
|
496
516
|
this.DEFAULT_FRONTAL_AREA_M2__1 = 0.5;
|
|
497
517
|
this.DEFAULT_AIR_DENSITY_1 = 1.225;
|
|
518
|
+
this.DEFAULT_ELEVATION_GAIN_PRESET_1 = ElevationGainPreset_DEM_getInstance();
|
|
498
519
|
}
|
|
499
520
|
var EngineConstants_instance;
|
|
500
521
|
function EngineConstants_getInstance() {
|
|
@@ -573,17 +594,17 @@
|
|
|
573
594
|
return true;
|
|
574
595
|
};
|
|
575
596
|
function Companion_2() {
|
|
576
|
-
|
|
597
|
+
Companion_instance_4 = this;
|
|
577
598
|
this.DEFAULT_1 = new EnhanceOptions();
|
|
578
599
|
}
|
|
579
|
-
var
|
|
580
|
-
function
|
|
581
|
-
if (
|
|
600
|
+
var Companion_instance_4;
|
|
601
|
+
function Companion_getInstance_6() {
|
|
602
|
+
if (Companion_instance_4 == null)
|
|
582
603
|
new Companion_2();
|
|
583
|
-
return
|
|
604
|
+
return Companion_instance_4;
|
|
584
605
|
}
|
|
585
|
-
function EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, wPrimeBalance, curvature, racingLine) {
|
|
586
|
-
|
|
606
|
+
function EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, wPrimeBalance, curvature, racingLine, elevationGain, elevationSmoothWindowM) {
|
|
607
|
+
Companion_getInstance_6();
|
|
587
608
|
fixElevation = fixElevation === VOID ? true : fixElevation;
|
|
588
609
|
computeMaxSpeeds = computeMaxSpeeds === VOID ? true : computeMaxSpeeds;
|
|
589
610
|
virtualizeTrack = virtualizeTrack === VOID ? true : virtualizeTrack;
|
|
@@ -592,6 +613,8 @@
|
|
|
592
613
|
wPrimeBalance = wPrimeBalance === VOID ? new WPrimeBalanceOptions() : wPrimeBalance;
|
|
593
614
|
curvature = curvature === VOID ? new CurvatureOptions() : curvature;
|
|
594
615
|
racingLine = racingLine === VOID ? new RacingLineOptions() : racingLine;
|
|
616
|
+
elevationGain = elevationGain === VOID ? new ElevationGainOptions(VOID, EngineConstants_getInstance().DEFAULT_ELEVATION_GAIN_PRESET_1) : elevationGain;
|
|
617
|
+
elevationSmoothWindowM = elevationSmoothWindowM === VOID ? 150.0 : elevationSmoothWindowM;
|
|
595
618
|
this.fixElevation_1 = fixElevation;
|
|
596
619
|
this.computeMaxSpeeds_1 = computeMaxSpeeds;
|
|
597
620
|
this.virtualizeTrack_1 = virtualizeTrack;
|
|
@@ -600,11 +623,18 @@
|
|
|
600
623
|
this.wPrimeBalance_1 = wPrimeBalance;
|
|
601
624
|
this.curvature_1 = curvature;
|
|
602
625
|
this.racingLine_1 = racingLine;
|
|
626
|
+
this.elevationGain_1 = elevationGain;
|
|
627
|
+
this.elevationSmoothWindowM_1 = elevationSmoothWindowM;
|
|
628
|
+
// Inline function 'kotlin.require' call
|
|
629
|
+
if (!(this.elevationSmoothWindowM_1 > 0.0 && isFinite(this.elevationSmoothWindowM_1))) {
|
|
630
|
+
var message = 'elevationSmoothWindowM must be finite and > 0, got ' + this.elevationSmoothWindowM_1;
|
|
631
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
632
|
+
}
|
|
603
633
|
}
|
|
604
|
-
protoOf(EnhanceOptions).
|
|
605
|
-
return new EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, wPrimeBalance, curvature, racingLine);
|
|
634
|
+
protoOf(EnhanceOptions).copy_la5bwq_k$ = function (fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, wPrimeBalance, curvature, racingLine, elevationGain, elevationSmoothWindowM) {
|
|
635
|
+
return new EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, wPrimeBalance, curvature, racingLine, elevationGain, elevationSmoothWindowM);
|
|
606
636
|
};
|
|
607
|
-
protoOf(EnhanceOptions).copy$
|
|
637
|
+
protoOf(EnhanceOptions).copy$default_31cnvc_k$ = function (fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, wPrimeBalance, curvature, racingLine, elevationGain, elevationSmoothWindowM, $super) {
|
|
608
638
|
fixElevation = fixElevation === VOID ? this.fixElevation_1 : fixElevation;
|
|
609
639
|
computeMaxSpeeds = computeMaxSpeeds === VOID ? this.computeMaxSpeeds_1 : computeMaxSpeeds;
|
|
610
640
|
virtualizeTrack = virtualizeTrack === VOID ? this.virtualizeTrack_1 : virtualizeTrack;
|
|
@@ -613,10 +643,12 @@
|
|
|
613
643
|
wPrimeBalance = wPrimeBalance === VOID ? this.wPrimeBalance_1 : wPrimeBalance;
|
|
614
644
|
curvature = curvature === VOID ? this.curvature_1 : curvature;
|
|
615
645
|
racingLine = racingLine === VOID ? this.racingLine_1 : racingLine;
|
|
616
|
-
|
|
646
|
+
elevationGain = elevationGain === VOID ? this.elevationGain_1 : elevationGain;
|
|
647
|
+
elevationSmoothWindowM = elevationSmoothWindowM === VOID ? this.elevationSmoothWindowM_1 : elevationSmoothWindowM;
|
|
648
|
+
return $super === VOID ? this.copy_la5bwq_k$(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, wPrimeBalance, curvature, racingLine, elevationGain, elevationSmoothWindowM) : $super.copy_la5bwq_k$.call(this, fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, wPrimeBalance, curvature, racingLine, elevationGain, elevationSmoothWindowM);
|
|
617
649
|
};
|
|
618
650
|
protoOf(EnhanceOptions).toString = function () {
|
|
619
|
-
return 'EnhanceOptions(fixElevation=' + this.fixElevation_1 + ', computeMaxSpeeds=' + this.computeMaxSpeeds_1 + ', virtualizeTrack=' + this.virtualizeTrack_1 + ', computeOnePointPerSecond=' + this.computeOnePointPerSecond_1 + ', simplifyPath=' + this.simplifyPath_1.toString() + ', wPrimeBalance=' + this.wPrimeBalance_1.toString() + ', curvature=' + this.curvature_1.toString() + ', racingLine=' + this.racingLine_1.toString() + ')';
|
|
651
|
+
return 'EnhanceOptions(fixElevation=' + this.fixElevation_1 + ', computeMaxSpeeds=' + this.computeMaxSpeeds_1 + ', virtualizeTrack=' + this.virtualizeTrack_1 + ', computeOnePointPerSecond=' + this.computeOnePointPerSecond_1 + ', simplifyPath=' + this.simplifyPath_1.toString() + ', wPrimeBalance=' + this.wPrimeBalance_1.toString() + ', curvature=' + this.curvature_1.toString() + ', racingLine=' + this.racingLine_1.toString() + ', elevationGain=' + this.elevationGain_1.toString() + ', elevationSmoothWindowM=' + this.elevationSmoothWindowM_1 + ')';
|
|
620
652
|
};
|
|
621
653
|
protoOf(EnhanceOptions).hashCode = function () {
|
|
622
654
|
var result = getBooleanHashCode(this.fixElevation_1);
|
|
@@ -627,6 +659,8 @@
|
|
|
627
659
|
result = imul(result, 31) + this.wPrimeBalance_1.hashCode() | 0;
|
|
628
660
|
result = imul(result, 31) + this.curvature_1.hashCode() | 0;
|
|
629
661
|
result = imul(result, 31) + this.racingLine_1.hashCode() | 0;
|
|
662
|
+
result = imul(result, 31) + this.elevationGain_1.hashCode() | 0;
|
|
663
|
+
result = imul(result, 31) + getNumberHashCode(this.elevationSmoothWindowM_1) | 0;
|
|
630
664
|
return result;
|
|
631
665
|
};
|
|
632
666
|
protoOf(EnhanceOptions).equals = function (other) {
|
|
@@ -650,6 +684,10 @@
|
|
|
650
684
|
return false;
|
|
651
685
|
if (!this.racingLine_1.equals(other.racingLine_1))
|
|
652
686
|
return false;
|
|
687
|
+
if (!this.elevationGain_1.equals(other.elevationGain_1))
|
|
688
|
+
return false;
|
|
689
|
+
if (!equals(this.elevationSmoothWindowM_1, other.elevationSmoothWindowM_1))
|
|
690
|
+
return false;
|
|
653
691
|
return true;
|
|
654
692
|
};
|
|
655
693
|
function $enhanceCourseCOROUTINE$(_this__u8e3s4, course, options, elevationProvider, resultContinuation) {
|
|
@@ -692,7 +730,7 @@
|
|
|
692
730
|
continue $sm;
|
|
693
731
|
case 2:
|
|
694
732
|
this.path0__1 = PointPerDistance_instance.compute_7vlifv_k$(this.path0__1, 1.0, 2.0);
|
|
695
|
-
this.path0__1 = ElevationStep_instance.
|
|
733
|
+
this.path0__1 = ElevationStep_instance.smoothElevation_ahln31_k$(this.path0__1, this.options_1.elevationSmoothWindowM_1);
|
|
696
734
|
var racingLineApplied = this.options_1.racingLine_1.enabled_1;
|
|
697
735
|
if (racingLineApplied) {
|
|
698
736
|
this.path0__1 = RacingLine_instance.compute_uyx32p_k$(this.path0__1, this.options_1.racingLine_1);
|
|
@@ -731,6 +769,10 @@
|
|
|
731
769
|
this.path0__1 = PathSimplifier_instance.simplify_gxhj7b_k$(this.path0__1, tolerance, this.options_1.simplifyPath_1.zExaggeration_1);
|
|
732
770
|
}
|
|
733
771
|
|
|
772
|
+
if (this.options_1.elevationGain_1.enabled_1) {
|
|
773
|
+
ElevationGain_instance.annotate_eeml8q_k$(this.path0__1, this.options_1.elevationGain_1);
|
|
774
|
+
}
|
|
775
|
+
|
|
734
776
|
return this.path0__1;
|
|
735
777
|
case 3:
|
|
736
778
|
throw this.exception_1;
|
|
@@ -752,7 +794,7 @@
|
|
|
752
794
|
return new CoursePhysics(new Course(path), RhoProviderEstimate_instance, AeroProviderConstant_instance, WindProviderNone_instance, new PowerProviderConstant(280.0));
|
|
753
795
|
};
|
|
754
796
|
protoOf(Enhancer).enhanceCourseDefault_jm937y_k$ = function (path, elevationProvider, options, $completion) {
|
|
755
|
-
return this.enhanceCourse_mout3j_k$(this.getDefaultCourse_gqi1xw_k$(path), options.copy$
|
|
797
|
+
return this.enhanceCourse_mout3j_k$(this.getDefaultCourse_gqi1xw_k$(path), options.copy$default_31cnvc_k$(options.fixElevation_1 && !(elevationProvider == null)), elevationProvider, $completion);
|
|
756
798
|
};
|
|
757
799
|
protoOf(Enhancer).enhanceCourse_mout3j_k$ = function (course, options, elevationProvider, $completion) {
|
|
758
800
|
var tmp = new $enhanceCourseCOROUTINE$(this, course, options, elevationProvider, $completion);
|
|
@@ -774,9 +816,55 @@
|
|
|
774
816
|
var tmp$ret$0 = Math.tan(x);
|
|
775
817
|
RoadCondition_DRY_instance = new RoadCondition('DRY', 0, tmp$ret$0, 0.4);
|
|
776
818
|
RoadCondition_WET_instance = new RoadCondition('WET', 1, EngineConstants_getInstance().RIDER_GRIP_FRACTION_1 * 0.36, 0.634920634920635 * 0.36);
|
|
819
|
+
if (Companion_instance_5 == null) {
|
|
820
|
+
Companion_instance;
|
|
821
|
+
new Companion_3();
|
|
822
|
+
}
|
|
777
823
|
}
|
|
778
824
|
var RoadCondition_DRY_instance;
|
|
779
825
|
var RoadCondition_WET_instance;
|
|
826
|
+
function Companion_3() {
|
|
827
|
+
Companion_instance_5 = this;
|
|
828
|
+
this.DEFAULT_1 = RoadCondition_DRY_getInstance();
|
|
829
|
+
}
|
|
830
|
+
protoOf(Companion_3).fromWire_2092k5_k$ = function (value) {
|
|
831
|
+
var tmp0 = get_entries_0();
|
|
832
|
+
var tmp$ret$0;
|
|
833
|
+
$l$block: {
|
|
834
|
+
// Inline function 'kotlin.collections.firstOrNull' call
|
|
835
|
+
var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
|
|
836
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
837
|
+
var element = _iterator__ex2g4s.next_20eer_k$();
|
|
838
|
+
var tmp = element.get_wireName_mo8n7d_k$();
|
|
839
|
+
// Inline function 'kotlin.text.lowercase' call
|
|
840
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
841
|
+
if (tmp === value.toLowerCase()) {
|
|
842
|
+
tmp$ret$0 = element;
|
|
843
|
+
break $l$block;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
tmp$ret$0 = null;
|
|
847
|
+
}
|
|
848
|
+
return tmp$ret$0;
|
|
849
|
+
};
|
|
850
|
+
protoOf(Companion_3).get_wireNames_7fokbq_k$ = function () {
|
|
851
|
+
// Inline function 'kotlin.collections.map' call
|
|
852
|
+
var this_0 = get_entries_0();
|
|
853
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
854
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
855
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
856
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
857
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
858
|
+
var tmp$ret$2 = item.get_wireName_mo8n7d_k$();
|
|
859
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
860
|
+
}
|
|
861
|
+
return destination;
|
|
862
|
+
};
|
|
863
|
+
var Companion_instance_5;
|
|
864
|
+
function Companion_getInstance_7() {
|
|
865
|
+
static_init();
|
|
866
|
+
return Companion_instance_5;
|
|
867
|
+
}
|
|
780
868
|
function values() {
|
|
781
869
|
static_init();
|
|
782
870
|
return [RoadCondition_DRY_getInstance(), RoadCondition_WET_getInstance()];
|
|
@@ -798,6 +886,32 @@
|
|
|
798
886
|
var x = this.mu_1;
|
|
799
887
|
return Math.atan(x) * 180.0 / 3.141592653589793;
|
|
800
888
|
};
|
|
889
|
+
protoOf(RoadCondition).get_wireName_mo8n7d_k$ = function () {
|
|
890
|
+
var tmp;
|
|
891
|
+
switch (this.ordinal_1) {
|
|
892
|
+
case 0:
|
|
893
|
+
tmp = 'dry';
|
|
894
|
+
break;
|
|
895
|
+
case 1:
|
|
896
|
+
tmp = 'wet';
|
|
897
|
+
break;
|
|
898
|
+
default:
|
|
899
|
+
noWhenBranchMatchedException();
|
|
900
|
+
break;
|
|
901
|
+
}
|
|
902
|
+
return tmp;
|
|
903
|
+
};
|
|
904
|
+
function applyTo(_this__u8e3s4, cyclist) {
|
|
905
|
+
var tmp;
|
|
906
|
+
if (_this__u8e3s4 == null) {
|
|
907
|
+
tmp = cyclist;
|
|
908
|
+
} else {
|
|
909
|
+
var tmp0_maxLeanAngleDeg = _this__u8e3s4.get_leanAngleDeg_9xbhfm_k$();
|
|
910
|
+
var tmp1_maxBrakeG = _this__u8e3s4.maxBrakeG_1;
|
|
911
|
+
tmp = cyclist.copy$default_8ozrtu_k$(VOID, tmp1_maxBrakeG, VOID, VOID, tmp0_maxLeanAngleDeg);
|
|
912
|
+
}
|
|
913
|
+
return tmp;
|
|
914
|
+
}
|
|
801
915
|
function RoadCondition_DRY_getInstance() {
|
|
802
916
|
static_init();
|
|
803
917
|
return RoadCondition_DRY_instance;
|
|
@@ -830,7 +944,7 @@
|
|
|
830
944
|
// Inline function 'kotlin.collections.filter' call
|
|
831
945
|
var tmp0 = this.parts_1;
|
|
832
946
|
// Inline function 'kotlin.collections.filterTo' call
|
|
833
|
-
var destination = ArrayList_init_$Create$();
|
|
947
|
+
var destination = ArrayList_init_$Create$_0();
|
|
834
948
|
var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
|
|
835
949
|
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
836
950
|
var element = _iterator__ex2g4s.next_20eer_k$();
|
|
@@ -929,18 +1043,18 @@
|
|
|
929
1043
|
return false;
|
|
930
1044
|
return true;
|
|
931
1045
|
};
|
|
932
|
-
function
|
|
933
|
-
|
|
1046
|
+
function Companion_4() {
|
|
1047
|
+
Companion_instance_6 = this;
|
|
934
1048
|
this.DEFAULT_1 = new ClimbOptions();
|
|
935
1049
|
}
|
|
936
|
-
var
|
|
937
|
-
function
|
|
938
|
-
if (
|
|
939
|
-
new
|
|
940
|
-
return
|
|
1050
|
+
var Companion_instance_6;
|
|
1051
|
+
function Companion_getInstance_8() {
|
|
1052
|
+
if (Companion_instance_6 == null)
|
|
1053
|
+
new Companion_4();
|
|
1054
|
+
return Companion_instance_6;
|
|
941
1055
|
}
|
|
942
1056
|
function ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGradeRatio, booster, maxAnalysisPoints) {
|
|
943
|
-
|
|
1057
|
+
Companion_getInstance_8();
|
|
944
1058
|
minMinClimbElevationM = minMinClimbElevationM === VOID ? 10.0 : minMinClimbElevationM;
|
|
945
1059
|
maxMinClimbElevationM = maxMinClimbElevationM === VOID ? 35.0 : maxMinClimbElevationM;
|
|
946
1060
|
minClimbElevationRatio = minClimbElevationRatio === VOID ? 100.0 : minClimbElevationRatio;
|
|
@@ -995,9 +1109,9 @@
|
|
|
995
1109
|
return false;
|
|
996
1110
|
return true;
|
|
997
1111
|
};
|
|
998
|
-
function
|
|
1112
|
+
function Companion_5() {
|
|
999
1113
|
}
|
|
1000
|
-
protoOf(
|
|
1114
|
+
protoOf(Companion_5).of_tmvbpf_k$ = function (path, maxPoints) {
|
|
1001
1115
|
var tmp;
|
|
1002
1116
|
if (path.size_1 <= maxPoints) {
|
|
1003
1117
|
var tmp_0 = 0;
|
|
@@ -1011,7 +1125,7 @@
|
|
|
1011
1125
|
tmp = tmp_2;
|
|
1012
1126
|
} else {
|
|
1013
1127
|
var stride = ((path.size_1 + maxPoints | 0) - 1 | 0) / maxPoints | 0;
|
|
1014
|
-
var kept = ArrayList_init_$Create$
|
|
1128
|
+
var kept = ArrayList_init_$Create$(maxPoints + 1 | 0);
|
|
1015
1129
|
var i = 0;
|
|
1016
1130
|
while (i < path.size_1) {
|
|
1017
1131
|
kept.add_utx5q5_k$(i);
|
|
@@ -1041,9 +1155,9 @@
|
|
|
1041
1155
|
}
|
|
1042
1156
|
return new Profile(tmp_6, tmp_10, indices);
|
|
1043
1157
|
};
|
|
1044
|
-
var
|
|
1045
|
-
function
|
|
1046
|
-
return
|
|
1158
|
+
var Companion_instance_7;
|
|
1159
|
+
function Companion_getInstance_9() {
|
|
1160
|
+
return Companion_instance_7;
|
|
1047
1161
|
}
|
|
1048
1162
|
function Profile(distance, elevation, sourceIndex) {
|
|
1049
1163
|
this.distance_1 = distance;
|
|
@@ -1102,7 +1216,7 @@
|
|
|
1102
1216
|
var tmp$ret$0 = sortedWith(candidates, tmp$ret$1);
|
|
1103
1217
|
var remaining = toMutableList(tmp$ret$0);
|
|
1104
1218
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
1105
|
-
var kept = ArrayList_init_$Create$();
|
|
1219
|
+
var kept = ArrayList_init_$Create$_0();
|
|
1106
1220
|
$l$loop: while (true) {
|
|
1107
1221
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
1108
1222
|
if (!!remaining.isEmpty_y1axqb_k$()) {
|
|
@@ -1121,7 +1235,7 @@
|
|
|
1121
1235
|
// Inline function 'kotlin.collections.map' call
|
|
1122
1236
|
var this_0 = numberRangeToNumber(startIndex, endIndex);
|
|
1123
1237
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1124
|
-
var destination = ArrayList_init_$Create$
|
|
1238
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1125
1239
|
var inductionVariable = this_0.first_1;
|
|
1126
1240
|
var last = this_0.last_1;
|
|
1127
1241
|
if (inductionVariable <= last)
|
|
@@ -1148,7 +1262,7 @@
|
|
|
1148
1262
|
break $l$block;
|
|
1149
1263
|
}
|
|
1150
1264
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
1151
|
-
var result = ArrayList_init_$Create$();
|
|
1265
|
+
var result = ArrayList_init_$Create$_0();
|
|
1152
1266
|
var current = iterator.next_20eer_k$();
|
|
1153
1267
|
while (iterator.hasNext_bitz1p_k$()) {
|
|
1154
1268
|
var next = iterator.next_20eer_k$();
|
|
@@ -1296,11 +1410,11 @@
|
|
|
1296
1410
|
// Inline function 'kotlin.comparisons.maxOf' call
|
|
1297
1411
|
var b_0 = Math.min(tmp0_0, b);
|
|
1298
1412
|
var minClimbElevation = Math.max(tmp0, b_0);
|
|
1299
|
-
var profile =
|
|
1413
|
+
var profile = Companion_instance_7.of_tmvbpf_k$(path, options.maxAnalysisPoints_1);
|
|
1300
1414
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1301
1415
|
var tmp0_1 = until(0, profile.get_size_woubt6_k$());
|
|
1302
1416
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1303
|
-
var destination = ArrayList_init_$Create$();
|
|
1417
|
+
var destination = ArrayList_init_$Create$_0();
|
|
1304
1418
|
// Inline function 'kotlin.collections.forEach' call
|
|
1305
1419
|
var inductionVariable = tmp0_1.first_1;
|
|
1306
1420
|
var last = tmp0_1.last_1;
|
|
@@ -1327,7 +1441,7 @@
|
|
|
1327
1441
|
// Inline function 'kotlin.collections.map' call
|
|
1328
1442
|
var this_1 = sortedWith(this_0, tmp$ret$10);
|
|
1329
1443
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1330
|
-
var destination_0 = ArrayList_init_$Create$
|
|
1444
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
1331
1445
|
var _iterator__ex2g4s = this_1.iterator_jk1svi_k$();
|
|
1332
1446
|
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1333
1447
|
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
@@ -1337,7 +1451,7 @@
|
|
|
1337
1451
|
return destination_0;
|
|
1338
1452
|
};
|
|
1339
1453
|
protoOf(ClimbDetector).detect$default_6ml3ny_k$ = function (path, options, $super) {
|
|
1340
|
-
options = options === VOID ?
|
|
1454
|
+
options = options === VOID ? Companion_getInstance_8().DEFAULT_1 : options;
|
|
1341
1455
|
return $super === VOID ? this.detect_llooq2_k$(path, options) : $super.detect_llooq2_k$.call(this, path, options);
|
|
1342
1456
|
};
|
|
1343
1457
|
var ClimbDetector_instance;
|
|
@@ -1490,13 +1604,13 @@
|
|
|
1490
1604
|
function AeroProviderConstant_getInstance() {
|
|
1491
1605
|
return AeroProviderConstant_instance;
|
|
1492
1606
|
}
|
|
1493
|
-
function
|
|
1607
|
+
function Companion_6() {
|
|
1494
1608
|
this.TOLERANCE_1 = 0.05;
|
|
1495
1609
|
this.MAX_MULTIPLIER_1 = 3.0;
|
|
1496
1610
|
}
|
|
1497
|
-
var
|
|
1498
|
-
function
|
|
1499
|
-
return
|
|
1611
|
+
var Companion_instance_8;
|
|
1612
|
+
function Companion_getInstance_10() {
|
|
1613
|
+
return Companion_instance_8;
|
|
1500
1614
|
}
|
|
1501
1615
|
function CyclistPowerProviderBase(useHarmonics, random) {
|
|
1502
1616
|
random = random === VOID ? Default_getInstance() : random;
|
|
@@ -1506,7 +1620,7 @@
|
|
|
1506
1620
|
if (this.useHarmonics_1) {
|
|
1507
1621
|
// Inline function 'kotlin.collections.List' call
|
|
1508
1622
|
// Inline function 'kotlin.collections.MutableList' call
|
|
1509
|
-
var list = ArrayList_init_$Create$
|
|
1623
|
+
var list = ArrayList_init_$Create$(20);
|
|
1510
1624
|
// Inline function 'kotlin.repeat' call
|
|
1511
1625
|
var inductionVariable = 0;
|
|
1512
1626
|
if (inductionVariable < 20)
|
|
@@ -1552,22 +1666,22 @@
|
|
|
1552
1666
|
PowerModel_DURABILITY_instance = new PowerModel('DURABILITY', 1, 'durability');
|
|
1553
1667
|
PowerModel_CRITICAL_POWER_instance = new PowerModel('CRITICAL_POWER', 2, 'critical-power');
|
|
1554
1668
|
PowerModel_FROM_DATA_instance = new PowerModel('FROM_DATA', 3, 'from_data');
|
|
1555
|
-
if (
|
|
1669
|
+
if (Companion_instance_9 == null) {
|
|
1556
1670
|
Companion_instance;
|
|
1557
|
-
new
|
|
1671
|
+
new Companion_7();
|
|
1558
1672
|
}
|
|
1559
1673
|
}
|
|
1560
1674
|
var PowerModel_CONSTANT_instance;
|
|
1561
1675
|
var PowerModel_DURABILITY_instance;
|
|
1562
1676
|
var PowerModel_CRITICAL_POWER_instance;
|
|
1563
1677
|
var PowerModel_FROM_DATA_instance;
|
|
1564
|
-
function
|
|
1678
|
+
function Companion_7() {
|
|
1565
1679
|
}
|
|
1566
|
-
protoOf(
|
|
1680
|
+
protoOf(Companion_7).get_ids_18j3qp_k$ = function () {
|
|
1567
1681
|
// Inline function 'kotlin.collections.map' call
|
|
1568
1682
|
var this_0 = get_entries_1();
|
|
1569
1683
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1570
|
-
var destination = ArrayList_init_$Create$
|
|
1684
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1571
1685
|
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
1572
1686
|
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1573
1687
|
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
@@ -1576,7 +1690,7 @@
|
|
|
1576
1690
|
}
|
|
1577
1691
|
return destination;
|
|
1578
1692
|
};
|
|
1579
|
-
protoOf(
|
|
1693
|
+
protoOf(Companion_7).fromIdOrNull_83jhaj_k$ = function (id) {
|
|
1580
1694
|
var tmp0 = get_entries_1();
|
|
1581
1695
|
var tmp$ret$0;
|
|
1582
1696
|
$l$block: {
|
|
@@ -1593,9 +1707,9 @@
|
|
|
1593
1707
|
}
|
|
1594
1708
|
return tmp$ret$0;
|
|
1595
1709
|
};
|
|
1596
|
-
var
|
|
1597
|
-
function
|
|
1598
|
-
return
|
|
1710
|
+
var Companion_instance_9;
|
|
1711
|
+
function Companion_getInstance_11() {
|
|
1712
|
+
return Companion_instance_9;
|
|
1599
1713
|
}
|
|
1600
1714
|
function values_0() {
|
|
1601
1715
|
static_init_0();
|
|
@@ -2014,12 +2128,12 @@
|
|
|
2014
2128
|
protoOf(PowerProviderConstant).optimalPower_36kg19_k$ = function (course, path, pointIndex) {
|
|
2015
2129
|
return this.power_1;
|
|
2016
2130
|
};
|
|
2017
|
-
function
|
|
2131
|
+
function Companion_8() {
|
|
2018
2132
|
this.DEFAULT_TAPER_START_FRACTION_1 = 0.5;
|
|
2019
2133
|
}
|
|
2020
|
-
var
|
|
2021
|
-
function
|
|
2022
|
-
return
|
|
2134
|
+
var Companion_instance_10;
|
|
2135
|
+
function Companion_getInstance_12() {
|
|
2136
|
+
return Companion_instance_10;
|
|
2023
2137
|
}
|
|
2024
2138
|
function PowerProviderCriticalPower(powerW, criticalPowerW, wPrimeJ, taperStartFraction, useHarmonics, random) {
|
|
2025
2139
|
criticalPowerW = criticalPowerW === VOID ? 250.0 : criticalPowerW;
|
|
@@ -2097,13 +2211,13 @@
|
|
|
2097
2211
|
this.lastPowerW_1 = 0.0;
|
|
2098
2212
|
this.wPrimeBalanceJ_1 = this.wPrimeJ_1;
|
|
2099
2213
|
};
|
|
2100
|
-
function
|
|
2214
|
+
function Companion_9() {
|
|
2101
2215
|
this.DEFAULT_DECLINE_PER_KJ_PER_KG_1 = 0.006666666666666667;
|
|
2102
2216
|
this.DEFAULT_MAX_DECLINE_1 = 0.2;
|
|
2103
2217
|
}
|
|
2104
|
-
var
|
|
2105
|
-
function
|
|
2106
|
-
return
|
|
2218
|
+
var Companion_instance_11;
|
|
2219
|
+
function Companion_getInstance_13() {
|
|
2220
|
+
return Companion_instance_11;
|
|
2107
2221
|
}
|
|
2108
2222
|
function PowerProviderDurability(powerW, criticalPowerW, declinePerKjPerKg, maxDecline, useHarmonics, random) {
|
|
2109
2223
|
criticalPowerW = criticalPowerW === VOID ? 250.0 : criticalPowerW;
|
|
@@ -2236,7 +2350,7 @@
|
|
|
2236
2350
|
this.lastElapsedS_1 = 0.0;
|
|
2237
2351
|
this.lastPowerW_1 = 0.0;
|
|
2238
2352
|
};
|
|
2239
|
-
function
|
|
2353
|
+
function Companion_10() {
|
|
2240
2354
|
this.DEFAULT_GRADIENT_GAIN_1 = 3.0;
|
|
2241
2355
|
this.DEFAULT_HEADWIND_GAIN_PER_MS_1 = 0.02;
|
|
2242
2356
|
this.DEFAULT_MIN_MULTIPLIER_1 = 0.5;
|
|
@@ -2244,9 +2358,9 @@
|
|
|
2244
2358
|
this.DEFAULT_RAMP_DISTANCE_M_1 = 300.0;
|
|
2245
2359
|
this.DEFAULT_ENERGY_BUDGET_SECONDS_1 = 600.0;
|
|
2246
2360
|
}
|
|
2247
|
-
var
|
|
2248
|
-
function
|
|
2249
|
-
return
|
|
2361
|
+
var Companion_instance_12;
|
|
2362
|
+
function Companion_getInstance_14() {
|
|
2363
|
+
return Companion_instance_12;
|
|
2250
2364
|
}
|
|
2251
2365
|
function PowerProviderTerrainPacing(delegate, gradientGain, headwindGainPerMS, minMultiplier, maxMultiplier, rampDistanceM, energyBudgetSeconds) {
|
|
2252
2366
|
gradientGain = gradientGain === VOID ? 3.0 : gradientGain;
|
|
@@ -2513,18 +2627,18 @@
|
|
|
2513
2627
|
function WheelBearingsPowerProvider_getInstance() {
|
|
2514
2628
|
return WheelBearingsPowerProvider_instance;
|
|
2515
2629
|
}
|
|
2516
|
-
function
|
|
2517
|
-
|
|
2630
|
+
function Companion_11() {
|
|
2631
|
+
Companion_instance_13 = this;
|
|
2518
2632
|
this.NONE_1 = new Wind(0.0, 0.0);
|
|
2519
2633
|
}
|
|
2520
|
-
var
|
|
2521
|
-
function
|
|
2522
|
-
if (
|
|
2523
|
-
new
|
|
2524
|
-
return
|
|
2634
|
+
var Companion_instance_13;
|
|
2635
|
+
function Companion_getInstance_15() {
|
|
2636
|
+
if (Companion_instance_13 == null)
|
|
2637
|
+
new Companion_11();
|
|
2638
|
+
return Companion_instance_13;
|
|
2525
2639
|
}
|
|
2526
2640
|
function Wind(speedMS, directionRad) {
|
|
2527
|
-
|
|
2641
|
+
Companion_getInstance_15();
|
|
2528
2642
|
this.speedMS_1 = speedMS;
|
|
2529
2643
|
this.directionRad_1 = directionRad;
|
|
2530
2644
|
}
|
|
@@ -2550,7 +2664,7 @@
|
|
|
2550
2664
|
function WindProviderNone() {
|
|
2551
2665
|
}
|
|
2552
2666
|
protoOf(WindProviderNone).wind_umf2tf_k$ = function (course, path, pointIndex) {
|
|
2553
|
-
return
|
|
2667
|
+
return Companion_getInstance_15().NONE_1;
|
|
2554
2668
|
};
|
|
2555
2669
|
var WindProviderNone_instance;
|
|
2556
2670
|
function WindProviderNone_getInstance() {
|
|
@@ -2804,7 +2918,7 @@
|
|
|
2804
2918
|
var exit = 1.0 / options.cornerExitRadiusM_1;
|
|
2805
2919
|
var kappa = frame.kappa_1;
|
|
2806
2920
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
2807
|
-
var raw = ArrayList_init_$Create$();
|
|
2921
|
+
var raw = ArrayList_init_$Create$_0();
|
|
2808
2922
|
var start = -1;
|
|
2809
2923
|
var sign = 0;
|
|
2810
2924
|
var inductionVariable = 0;
|
|
@@ -2848,7 +2962,7 @@
|
|
|
2848
2962
|
raw.add_utx5q5_k$(tmp$ret$3);
|
|
2849
2963
|
}
|
|
2850
2964
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
2851
|
-
var merged = ArrayList_init_$Create$();
|
|
2965
|
+
var merged = ArrayList_init_$Create$_0();
|
|
2852
2966
|
var _iterator__ex2g4s = raw.iterator_jk1svi_k$();
|
|
2853
2967
|
$l$loop: while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
2854
2968
|
var span = _iterator__ex2g4s.next_20eer_k$();
|
|
@@ -2880,7 +2994,7 @@
|
|
|
2880
2994
|
var minTurn = options.minCornerTurnDeg_1 * 3.141592653589793 / 180.0;
|
|
2881
2995
|
var hairpinTurn = options.hairpinTurnDeg_1 * 3.141592653589793 / 180.0;
|
|
2882
2996
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
2883
|
-
var out = ArrayList_init_$Create$();
|
|
2997
|
+
var out = ArrayList_init_$Create$_0();
|
|
2884
2998
|
var _iterator__ex2g4s_0 = merged.iterator_jk1svi_k$();
|
|
2885
2999
|
$l$loop_2: while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
|
|
2886
3000
|
var span_0 = _iterator__ex2g4s_0.next_20eer_k$();
|
|
@@ -2980,7 +3094,7 @@
|
|
|
2980
3094
|
var tmp;
|
|
2981
3095
|
if (value == null) {
|
|
2982
3096
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
2983
|
-
var answer = ArrayList_init_$Create$();
|
|
3097
|
+
var answer = ArrayList_init_$Create$_0();
|
|
2984
3098
|
buckets.put_4fpzoq_k$(key, answer);
|
|
2985
3099
|
tmp = answer;
|
|
2986
3100
|
} else {
|
|
@@ -3533,9 +3647,9 @@
|
|
|
3533
3647
|
function LocalFrame_getInstance() {
|
|
3534
3648
|
return LocalFrame_instance;
|
|
3535
3649
|
}
|
|
3536
|
-
function
|
|
3650
|
+
function Companion_12() {
|
|
3537
3651
|
}
|
|
3538
|
-
protoOf(
|
|
3652
|
+
protoOf(Companion_12).assemble_miimn7_k$ = function (frame, center, rho, steeringLengthM, centeringLengthM) {
|
|
3539
3653
|
var n = frame.get_size_woubt6_k$();
|
|
3540
3654
|
var h0 = new Float64Array(n);
|
|
3541
3655
|
var h1 = new Float64Array(n);
|
|
@@ -3605,9 +3719,9 @@
|
|
|
3605
3719
|
while (inductionVariable < n);
|
|
3606
3720
|
return new OffsetEnergy(h0, h1, h2, linear, constant);
|
|
3607
3721
|
};
|
|
3608
|
-
var
|
|
3609
|
-
function
|
|
3610
|
-
return
|
|
3722
|
+
var Companion_instance_14;
|
|
3723
|
+
function Companion_getInstance_16() {
|
|
3724
|
+
return Companion_instance_14;
|
|
3611
3725
|
}
|
|
3612
3726
|
function OffsetEnergy(h0, h1, h2, linear, constant) {
|
|
3613
3727
|
this.h0__1 = h0;
|
|
@@ -3863,18 +3977,18 @@
|
|
|
3863
3977
|
function OffsetQp_getInstance() {
|
|
3864
3978
|
return OffsetQp_instance;
|
|
3865
3979
|
}
|
|
3866
|
-
function
|
|
3867
|
-
|
|
3980
|
+
function Companion_13() {
|
|
3981
|
+
Companion_instance_15 = this;
|
|
3868
3982
|
this.DEFAULT_1 = new CurvatureOptions();
|
|
3869
3983
|
}
|
|
3870
|
-
var
|
|
3871
|
-
function
|
|
3872
|
-
if (
|
|
3873
|
-
new
|
|
3874
|
-
return
|
|
3984
|
+
var Companion_instance_15;
|
|
3985
|
+
function Companion_getInstance_17() {
|
|
3986
|
+
if (Companion_instance_15 == null)
|
|
3987
|
+
new Companion_13();
|
|
3988
|
+
return Companion_instance_15;
|
|
3875
3989
|
}
|
|
3876
3990
|
function CurvatureOptions(enabled, geometrySmoothWindowM, curvatureWindowsM, headingNoiseRad, curvatureSmoothWindowM) {
|
|
3877
|
-
|
|
3991
|
+
Companion_getInstance_17();
|
|
3878
3992
|
enabled = enabled === VOID ? true : enabled;
|
|
3879
3993
|
geometrySmoothWindowM = geometrySmoothWindowM === VOID ? 3.0 : geometrySmoothWindowM;
|
|
3880
3994
|
curvatureWindowsM = curvatureWindowsM === VOID ? listOf_0([3.0, 6.0, 12.0, 25.0]) : curvatureWindowsM;
|
|
@@ -4122,7 +4236,7 @@
|
|
|
4122
4236
|
tmp_3 = tmp_3 + 1 | 0;
|
|
4123
4237
|
}
|
|
4124
4238
|
var rho = tmp_5;
|
|
4125
|
-
var energy =
|
|
4239
|
+
var energy = Companion_instance_14.assemble_miimn7_k$(frame, center, rho, options.steeringLengthM_1, options.centeringLengthM_1);
|
|
4126
4240
|
var seed = center;
|
|
4127
4241
|
var solved = OffsetQp_instance.solve_j37bz7_k$(energy, bounds.lo_1, bounds.hi_1, seed, options.maxNewtonIterations_1, options.gradientTolerance_1, options.boundEpsilonM_1);
|
|
4128
4242
|
var trajectoryCurvature = measureOffsetCurvature($this, frame, solved.offset_1, options);
|
|
@@ -4241,17 +4355,17 @@
|
|
|
4241
4355
|
CorridorMode_LANE_instance = new CorridorMode('LANE', 0);
|
|
4242
4356
|
CorridorMode_LANE_LEFT_instance = new CorridorMode('LANE_LEFT', 1);
|
|
4243
4357
|
CorridorMode_FULL_ROAD_instance = new CorridorMode('FULL_ROAD', 2);
|
|
4244
|
-
if (
|
|
4358
|
+
if (Companion_instance_16 == null) {
|
|
4245
4359
|
Companion_instance;
|
|
4246
|
-
new
|
|
4360
|
+
new Companion_14();
|
|
4247
4361
|
}
|
|
4248
4362
|
}
|
|
4249
4363
|
var CorridorMode_LANE_instance;
|
|
4250
4364
|
var CorridorMode_LANE_LEFT_instance;
|
|
4251
4365
|
var CorridorMode_FULL_ROAD_instance;
|
|
4252
|
-
function
|
|
4366
|
+
function Companion_14() {
|
|
4253
4367
|
}
|
|
4254
|
-
protoOf(
|
|
4368
|
+
protoOf(Companion_14).byId_8gmd94_k$ = function (name) {
|
|
4255
4369
|
var tmp0 = get_entries_2();
|
|
4256
4370
|
var tmp$ret$0;
|
|
4257
4371
|
$l$block: {
|
|
@@ -4276,9 +4390,9 @@
|
|
|
4276
4390
|
}
|
|
4277
4391
|
return tmp;
|
|
4278
4392
|
};
|
|
4279
|
-
var
|
|
4280
|
-
function
|
|
4281
|
-
return
|
|
4393
|
+
var Companion_instance_16;
|
|
4394
|
+
function Companion_getInstance_18() {
|
|
4395
|
+
return Companion_instance_16;
|
|
4282
4396
|
}
|
|
4283
4397
|
function values_1() {
|
|
4284
4398
|
static_init_1();
|
|
@@ -4327,18 +4441,18 @@
|
|
|
4327
4441
|
function CornerKind(name, ordinal) {
|
|
4328
4442
|
Enum.call(this, name, ordinal);
|
|
4329
4443
|
}
|
|
4330
|
-
function
|
|
4331
|
-
|
|
4444
|
+
function Companion_15() {
|
|
4445
|
+
Companion_instance_17 = this;
|
|
4332
4446
|
this.DEFAULT_1 = new RacingLineOptions();
|
|
4333
4447
|
}
|
|
4334
|
-
var
|
|
4335
|
-
function
|
|
4336
|
-
if (
|
|
4337
|
-
new
|
|
4338
|
-
return
|
|
4448
|
+
var Companion_instance_17;
|
|
4449
|
+
function Companion_getInstance_19() {
|
|
4450
|
+
if (Companion_instance_17 == null)
|
|
4451
|
+
new Companion_15();
|
|
4452
|
+
return Companion_instance_17;
|
|
4339
4453
|
}
|
|
4340
4454
|
function RacingLineOptions(enabled, defaultRoadWidthM, edgeMarginM, corridor, cornerEnterRadiusM, cornerExitRadiusM, minCornerLengthM, minCornerTurnDeg, hairpinTurnDeg, gentleRadiusM, regularityFactor, selfProximityGapM, straightRunM, straightRadiusM, widthSmoothWindowM, objectiveRadiusM, steeringLengthM, centeringLengthM, maxNewtonIterations, gradientTolerance, boundEpsilonM, curvature, simplifyToleranceCapM) {
|
|
4341
|
-
|
|
4455
|
+
Companion_getInstance_19();
|
|
4342
4456
|
enabled = enabled === VOID ? false : enabled;
|
|
4343
4457
|
defaultRoadWidthM = defaultRoadWidthM === VOID ? 6.0 : defaultRoadWidthM;
|
|
4344
4458
|
edgeMarginM = edgeMarginM === VOID ? 0.5 : edgeMarginM;
|
|
@@ -4360,7 +4474,7 @@
|
|
|
4360
4474
|
maxNewtonIterations = maxNewtonIterations === VOID ? 200 : maxNewtonIterations;
|
|
4361
4475
|
gradientTolerance = gradientTolerance === VOID ? 1.0E-8 : gradientTolerance;
|
|
4362
4476
|
boundEpsilonM = boundEpsilonM === VOID ? 1.0E-6 : boundEpsilonM;
|
|
4363
|
-
curvature = curvature === VOID ?
|
|
4477
|
+
curvature = curvature === VOID ? Companion_getInstance_17().DEFAULT_1 : curvature;
|
|
4364
4478
|
simplifyToleranceCapM = simplifyToleranceCapM === VOID ? 2.0 : simplifyToleranceCapM;
|
|
4365
4479
|
this.enabled_1 = enabled;
|
|
4366
4480
|
this.defaultRoadWidthM_1 = defaultRoadWidthM;
|
|
@@ -4557,6 +4671,11 @@
|
|
|
4557
4671
|
static_init_2();
|
|
4558
4672
|
return CornerKind_HAIRPIN_instance;
|
|
4559
4673
|
}
|
|
4674
|
+
function get_WAYPOINT_KEYS() {
|
|
4675
|
+
_init_properties_EngineJsApi_kt__9bputf();
|
|
4676
|
+
return WAYPOINT_KEYS;
|
|
4677
|
+
}
|
|
4678
|
+
var WAYPOINT_KEYS;
|
|
4560
4679
|
function get_POWER_PROVIDER_KEYS() {
|
|
4561
4680
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4562
4681
|
return POWER_PROVIDER_KEYS;
|
|
@@ -4587,7 +4706,7 @@
|
|
|
4587
4706
|
// Inline function 'kotlin.collections.map' call
|
|
4588
4707
|
var this_0 = GpxParser_instance.parse$default_ez0f31_k$(xml).waypoints_1;
|
|
4589
4708
|
// Inline function 'kotlin.collections.mapTo' call
|
|
4590
|
-
var destination = ArrayList_init_$Create$
|
|
4709
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
4591
4710
|
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
4592
4711
|
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
4593
4712
|
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
@@ -4625,7 +4744,7 @@
|
|
|
4625
4744
|
var this_0 = tracksAsPaths(GpxParser_instance.parse$default_ez0f31_k$(xml), setOf(GpxPathKind_ROUTE_getInstance()));
|
|
4626
4745
|
return copyToArray(this_0);
|
|
4627
4746
|
}
|
|
4628
|
-
function writeGpxTracks(paths, waypoints, writeExtensions) {
|
|
4747
|
+
function writeGpxTracks(paths, waypoints, writeExtensions, powerSource, trackNames, startTimeEpochMs) {
|
|
4629
4748
|
var tmp;
|
|
4630
4749
|
if (waypoints === VOID) {
|
|
4631
4750
|
// Inline function 'kotlin.emptyArray' call
|
|
@@ -4635,12 +4754,16 @@
|
|
|
4635
4754
|
}
|
|
4636
4755
|
waypoints = tmp;
|
|
4637
4756
|
writeExtensions = writeExtensions === VOID ? true : writeExtensions;
|
|
4757
|
+
powerSource = powerSource === VOID ? null : powerSource;
|
|
4758
|
+
trackNames = trackNames === VOID ? null : trackNames;
|
|
4759
|
+
startTimeEpochMs = startTimeEpochMs === VOID ? null : startTimeEpochMs;
|
|
4638
4760
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4639
4761
|
var tmp_0 = GpxWriter_instance;
|
|
4640
4762
|
var tmp_1 = toList(paths);
|
|
4763
|
+
var tmp_2 = trackNames == null ? null : toList(trackNames);
|
|
4641
4764
|
// Inline function 'kotlin.collections.map' call
|
|
4642
4765
|
// Inline function 'kotlin.collections.mapTo' call
|
|
4643
|
-
var destination = ArrayList_init_$Create$
|
|
4766
|
+
var destination = ArrayList_init_$Create$(waypoints.length);
|
|
4644
4767
|
var inductionVariable = 0;
|
|
4645
4768
|
var last = waypoints.length;
|
|
4646
4769
|
while (inductionVariable < last) {
|
|
@@ -4649,7 +4772,15 @@
|
|
|
4649
4772
|
var tmp$ret$3 = toGpxWaypoint(item);
|
|
4650
4773
|
destination.add_utx5q5_k$(tmp$ret$3);
|
|
4651
4774
|
}
|
|
4652
|
-
|
|
4775
|
+
var tmp_3 = destination;
|
|
4776
|
+
var tmp_4;
|
|
4777
|
+
if (startTimeEpochMs == null) {
|
|
4778
|
+
tmp_4 = null;
|
|
4779
|
+
} else {
|
|
4780
|
+
// Inline function 'kotlin.let' call
|
|
4781
|
+
tmp_4 = Companion_getInstance().fromEpochMilliseconds_uaz65_k$(numberToLong(startTimeEpochMs));
|
|
4782
|
+
}
|
|
4783
|
+
return tmp_0.write_7y52k2_k$(pathsToGpxDocument(tmp_1, VOID, tmp_2, tmp_3, VOID, tmp_4, toGpxPowerSource(powerSource)), writeExtensions);
|
|
4653
4784
|
}
|
|
4654
4785
|
function pathSize(path) {
|
|
4655
4786
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
@@ -4671,19 +4802,41 @@
|
|
|
4671
4802
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4672
4803
|
return path.elevationLoss_1;
|
|
4673
4804
|
}
|
|
4805
|
+
function pathElevationGainFiltered(path) {
|
|
4806
|
+
_init_properties_EngineJsApi_kt__9bputf();
|
|
4807
|
+
return path.elevationGainFiltered_1;
|
|
4808
|
+
}
|
|
4809
|
+
function pathElevationLossFiltered(path) {
|
|
4810
|
+
_init_properties_EngineJsApi_kt__9bputf();
|
|
4811
|
+
return path.elevationLossFiltered_1;
|
|
4812
|
+
}
|
|
4813
|
+
function pathReportedElevationGain(path) {
|
|
4814
|
+
_init_properties_EngineJsApi_kt__9bputf();
|
|
4815
|
+
return path.get_reportedElevationGain_hffpog_k$();
|
|
4816
|
+
}
|
|
4817
|
+
function pathReportedElevationLoss(path) {
|
|
4818
|
+
_init_properties_EngineJsApi_kt__9bputf();
|
|
4819
|
+
return path.get_reportedElevationLoss_hfc84c_k$();
|
|
4820
|
+
}
|
|
4674
4821
|
function pointAt(path, i) {
|
|
4675
4822
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4676
4823
|
return pointObj(path.latitudeDeg_i25sm6_k$(i), path.longitudeDeg_ikk1un_k$(i), path.elevation_iziwkb_k$(i), path.time_ryc845_k$(i), path.speed_npav2n_k$(i), path.pComputedPower_g6dnn4_k$(i), path.distance_5s4s77_k$(i), path.grade_c4yjz5_k$(i));
|
|
4677
4824
|
}
|
|
4678
|
-
function writeGpx(path, writeExtensions) {
|
|
4825
|
+
function writeGpx(path, writeExtensions, powerSource, trackName) {
|
|
4679
4826
|
writeExtensions = writeExtensions === VOID ? true : writeExtensions;
|
|
4827
|
+
powerSource = powerSource === VOID ? null : powerSource;
|
|
4828
|
+
trackName = trackName === VOID ? null : trackName;
|
|
4680
4829
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4681
|
-
|
|
4830
|
+
var tmp = GpxWriter_instance;
|
|
4831
|
+
return tmp.write_7y52k2_k$(toGpxDocument(path, VOID, trackName == null ? 'virtualized' : trackName, VOID, toGpxPowerSource(powerSource)), writeExtensions);
|
|
4682
4832
|
}
|
|
4683
|
-
function writeGpxAt(path, startTimeEpochMs, writeExtensions) {
|
|
4833
|
+
function writeGpxAt(path, startTimeEpochMs, writeExtensions, powerSource, trackName) {
|
|
4684
4834
|
writeExtensions = writeExtensions === VOID ? true : writeExtensions;
|
|
4835
|
+
powerSource = powerSource === VOID ? null : powerSource;
|
|
4836
|
+
trackName = trackName === VOID ? null : trackName;
|
|
4685
4837
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4686
|
-
|
|
4838
|
+
var tmp = GpxWriter_instance;
|
|
4839
|
+
return tmp.write_7y52k2_k$(toGpxDocument(path, VOID, trackName == null ? 'virtualized' : trackName, Companion_getInstance().fromEpochMilliseconds_uaz65_k$(numberToLong(startTimeEpochMs)), toGpxPowerSource(powerSource)), writeExtensions);
|
|
4687
4840
|
}
|
|
4688
4841
|
function enhance(path, options) {
|
|
4689
4842
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
@@ -4714,7 +4867,7 @@
|
|
|
4714
4867
|
// Inline function 'kotlin.collections.map' call
|
|
4715
4868
|
var this_0 = get_entries();
|
|
4716
4869
|
// Inline function 'kotlin.collections.mapTo' call
|
|
4717
|
-
var destination = ArrayList_init_$Create$
|
|
4870
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
4718
4871
|
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
4719
4872
|
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
4720
4873
|
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
@@ -4740,22 +4893,45 @@
|
|
|
4740
4893
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4741
4894
|
return path.longitudeDeg_ikk1un_k$(i);
|
|
4742
4895
|
}
|
|
4743
|
-
function pathToCsv(path, separator, unitsInHeader) {
|
|
4896
|
+
function pathToCsv(path, separator, unitsInHeader, decimals, lineSeparator) {
|
|
4897
|
+
decimals = decimals === VOID ? null : decimals;
|
|
4898
|
+
lineSeparator = lineSeparator === VOID ? null : lineSeparator;
|
|
4744
4899
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4900
|
+
var defaults = new CsvOptions();
|
|
4745
4901
|
var tmp = CsvWriter_instance;
|
|
4746
4902
|
var tmp0_elvis_lhs = firstOrNull(separator);
|
|
4747
4903
|
var tmp_0;
|
|
4748
4904
|
var tmp_1 = tmp0_elvis_lhs;
|
|
4749
4905
|
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
4750
|
-
tmp_0 =
|
|
4906
|
+
tmp_0 = defaults.separator_1;
|
|
4751
4907
|
} else {
|
|
4752
4908
|
tmp_0 = tmp0_elvis_lhs;
|
|
4753
4909
|
}
|
|
4754
|
-
|
|
4910
|
+
var tmp_2 = tmp_0;
|
|
4911
|
+
var tmp_3;
|
|
4912
|
+
if (lineSeparator == null) {
|
|
4913
|
+
tmp_3 = null;
|
|
4914
|
+
} else {
|
|
4915
|
+
// Inline function 'kotlin.text.ifEmpty' call
|
|
4916
|
+
var tmp_4;
|
|
4917
|
+
// Inline function 'kotlin.text.isEmpty' call
|
|
4918
|
+
if (charSequenceLength(lineSeparator) === 0) {
|
|
4919
|
+
tmp_4 = null;
|
|
4920
|
+
} else {
|
|
4921
|
+
tmp_4 = lineSeparator;
|
|
4922
|
+
}
|
|
4923
|
+
tmp_3 = tmp_4;
|
|
4924
|
+
}
|
|
4925
|
+
var tmp2_elvis_lhs = tmp_3;
|
|
4926
|
+
return tmp.write_p5vnh4_k$(path, new CsvOptions(VOID, tmp_2, unitsInHeader, decimals, tmp2_elvis_lhs == null ? defaults.lineSeparator_1 : tmp2_elvis_lhs));
|
|
4755
4927
|
}
|
|
4756
|
-
function pathToJson(path, pretty) {
|
|
4928
|
+
function pathToJson(path, pretty, decimals, includeMeta) {
|
|
4929
|
+
decimals = decimals === VOID ? null : decimals;
|
|
4930
|
+
includeMeta = includeMeta === VOID ? null : includeMeta;
|
|
4757
4931
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4758
|
-
|
|
4932
|
+
var defaults = new JsonOptions();
|
|
4933
|
+
var tmp = JsonWriter_instance;
|
|
4934
|
+
return tmp.write_lwqeog_k$(path, new JsonOptions(VOID, pretty, decimals, includeMeta == null ? defaults.includeMeta_1 : includeMeta));
|
|
4759
4935
|
}
|
|
4760
4936
|
function pathToFit(path, name, startTimeEpochMs) {
|
|
4761
4937
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
@@ -4785,7 +4961,7 @@
|
|
|
4785
4961
|
// Inline function 'kotlin.collections.map' call
|
|
4786
4962
|
var this_0 = ClimbDetector_instance.detect$default_6ml3ny_k$(path);
|
|
4787
4963
|
// Inline function 'kotlin.collections.mapTo' call
|
|
4788
|
-
var destination = ArrayList_init_$Create$
|
|
4964
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
4789
4965
|
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
4790
4966
|
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
4791
4967
|
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
@@ -4795,12 +4971,14 @@
|
|
|
4795
4971
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
4796
4972
|
return copyToArray(destination);
|
|
4797
4973
|
}
|
|
4798
|
-
function detectClimbsWithOptions(path, minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster) {
|
|
4974
|
+
function detectClimbsWithOptions(path, minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster, maxAnalysisPoints) {
|
|
4975
|
+
maxAnalysisPoints = maxAnalysisPoints === VOID ? null : maxAnalysisPoints;
|
|
4799
4976
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4977
|
+
var tmp = ClimbDetector_instance;
|
|
4800
4978
|
// Inline function 'kotlin.collections.map' call
|
|
4801
|
-
var this_0 =
|
|
4979
|
+
var this_0 = tmp.detect_llooq2_k$(path, new ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster, maxAnalysisPoints == null ? (new ClimbOptions()).maxAnalysisPoints_1 : maxAnalysisPoints));
|
|
4802
4980
|
// Inline function 'kotlin.collections.mapTo' call
|
|
4803
|
-
var destination = ArrayList_init_$Create$
|
|
4981
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
4804
4982
|
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
4805
4983
|
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
4806
4984
|
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
@@ -4827,7 +5005,7 @@
|
|
|
4827
5005
|
// Inline function 'kotlin.collections.map' call
|
|
4828
5006
|
var this_0 = report.corners_1;
|
|
4829
5007
|
// Inline function 'kotlin.collections.mapTo' call
|
|
4830
|
-
var destination = ArrayList_init_$Create$
|
|
5008
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
4831
5009
|
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
4832
5010
|
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
4833
5011
|
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
@@ -4879,8 +5057,22 @@
|
|
|
4879
5057
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
4880
5058
|
return o;
|
|
4881
5059
|
}
|
|
5060
|
+
function toGpxPowerSource(_this__u8e3s4) {
|
|
5061
|
+
_init_properties_EngineJsApi_kt__9bputf();
|
|
5062
|
+
if (_this__u8e3s4 == null)
|
|
5063
|
+
return Companion_getInstance_2().DEFAULT_1;
|
|
5064
|
+
var tmp0_elvis_lhs = Companion_getInstance_2().fromWire_2092k5_k$(_this__u8e3s4);
|
|
5065
|
+
var tmp;
|
|
5066
|
+
if (tmp0_elvis_lhs == null) {
|
|
5067
|
+
throw IllegalArgumentException_init_$Create$('powerSource must be one of ' + joinToString(Companion_getInstance_2().get_wireNames_7fokbq_k$(), ', ') + ', got: ' + _this__u8e3s4);
|
|
5068
|
+
} else {
|
|
5069
|
+
tmp = tmp0_elvis_lhs;
|
|
5070
|
+
}
|
|
5071
|
+
return tmp;
|
|
5072
|
+
}
|
|
4882
5073
|
function toGpxWaypoint(_this__u8e3s4) {
|
|
4883
5074
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
5075
|
+
requireOnlyKeys(_this__u8e3s4, 'WaypointDto', get_WAYPOINT_KEYS());
|
|
4884
5076
|
var tmp = _this__u8e3s4.latitudeDeg;
|
|
4885
5077
|
var tmp_0 = _this__u8e3s4.longitudeDeg;
|
|
4886
5078
|
var tmp_1 = _this__u8e3s4.elevationM;
|
|
@@ -4893,45 +5085,82 @@
|
|
|
4893
5085
|
}
|
|
4894
5086
|
function toEnhanceOptions(_this__u8e3s4) {
|
|
4895
5087
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
5088
|
+
var d = defaultJsOptions();
|
|
4896
5089
|
if (_this__u8e3s4 == null)
|
|
4897
|
-
return
|
|
5090
|
+
return d;
|
|
4898
5091
|
requireOnlyKeys(_this__u8e3s4, 'EnhanceOptionsDto', get_ENHANCE_OPTIONS_KEYS());
|
|
4899
5092
|
var tmp0_elvis_lhs = _this__u8e3s4.fixElevation;
|
|
4900
|
-
var tmp = tmp0_elvis_lhs == null ?
|
|
5093
|
+
var tmp = tmp0_elvis_lhs == null ? d.fixElevation_1 : tmp0_elvis_lhs;
|
|
4901
5094
|
var tmp1_elvis_lhs = _this__u8e3s4.computeMaxSpeeds;
|
|
4902
|
-
var tmp_0 = tmp1_elvis_lhs == null ?
|
|
5095
|
+
var tmp_0 = tmp1_elvis_lhs == null ? d.computeMaxSpeeds_1 : tmp1_elvis_lhs;
|
|
4903
5096
|
var tmp2_elvis_lhs = _this__u8e3s4.virtualizeTrack;
|
|
4904
|
-
var tmp_1 = tmp2_elvis_lhs == null ?
|
|
5097
|
+
var tmp_1 = tmp2_elvis_lhs == null ? d.virtualizeTrack_1 : tmp2_elvis_lhs;
|
|
4905
5098
|
var tmp3_elvis_lhs = _this__u8e3s4.computeOnePointPerSecond;
|
|
4906
|
-
var tmp_2 = tmp3_elvis_lhs == null ?
|
|
5099
|
+
var tmp_2 = tmp3_elvis_lhs == null ? d.computeOnePointPerSecond_1 : tmp3_elvis_lhs;
|
|
4907
5100
|
var tmp4_elvis_lhs = _this__u8e3s4.simplifyEnabled;
|
|
4908
|
-
var tmp_3 = tmp4_elvis_lhs == null ?
|
|
5101
|
+
var tmp_3 = tmp4_elvis_lhs == null ? d.simplifyPath_1.enabled_1 : tmp4_elvis_lhs;
|
|
4909
5102
|
var tmp5_elvis_lhs = _this__u8e3s4.simplifyToleranceM;
|
|
4910
|
-
var tmp_4 = tmp5_elvis_lhs == null ?
|
|
5103
|
+
var tmp_4 = tmp5_elvis_lhs == null ? d.simplifyPath_1.toleranceM_1 : tmp5_elvis_lhs;
|
|
4911
5104
|
var tmp6_elvis_lhs = _this__u8e3s4.simplifyZExaggeration;
|
|
4912
|
-
var tmp_5 = new SimplifyPathOptions(tmp_3, tmp_4, tmp6_elvis_lhs == null ?
|
|
5105
|
+
var tmp_5 = new SimplifyPathOptions(tmp_3, tmp_4, tmp6_elvis_lhs == null ? d.simplifyPath_1.zExaggeration_1 : tmp6_elvis_lhs);
|
|
4913
5106
|
var tmp7_elvis_lhs = _this__u8e3s4.wPrimeBalanceEnabled;
|
|
4914
|
-
var tmp_6 = tmp7_elvis_lhs == null ?
|
|
5107
|
+
var tmp_6 = tmp7_elvis_lhs == null ? d.wPrimeBalance_1.enabled_1 : tmp7_elvis_lhs;
|
|
4915
5108
|
var tmp8_elvis_lhs = _this__u8e3s4.wPrimeBalanceCriticalPower;
|
|
4916
|
-
var tmp_7 = tmp8_elvis_lhs == null ?
|
|
5109
|
+
var tmp_7 = tmp8_elvis_lhs == null ? d.wPrimeBalance_1.criticalPowerW_1 : tmp8_elvis_lhs;
|
|
4917
5110
|
var tmp9_elvis_lhs = _this__u8e3s4.wPrimeBalanceWPrime;
|
|
4918
|
-
var tmp_8 = new WPrimeBalanceOptions(tmp_6, tmp_7, tmp9_elvis_lhs == null ?
|
|
5111
|
+
var tmp_8 = new WPrimeBalanceOptions(tmp_6, tmp_7, tmp9_elvis_lhs == null ? d.wPrimeBalance_1.wPrimeJ_1 : tmp9_elvis_lhs);
|
|
4919
5112
|
var tmp10_elvis_lhs = _this__u8e3s4.curvatureEnabled;
|
|
4920
|
-
var tmp_9 = new CurvatureOptions(tmp10_elvis_lhs == null ?
|
|
5113
|
+
var tmp_9 = new CurvatureOptions(tmp10_elvis_lhs == null ? d.curvature_1.enabled_1 : tmp10_elvis_lhs);
|
|
4921
5114
|
var tmp11_elvis_lhs = _this__u8e3s4.racingLineEnabled;
|
|
4922
|
-
var tmp13_enabled = tmp11_elvis_lhs == null ?
|
|
5115
|
+
var tmp13_enabled = tmp11_elvis_lhs == null ? d.racingLine_1.enabled_1 : tmp11_elvis_lhs;
|
|
4923
5116
|
var tmp14_corridor = parseCorridor(_this__u8e3s4.racingLineCorridor);
|
|
4924
5117
|
var tmp12_elvis_lhs = _this__u8e3s4.racingLineRoadWidthM;
|
|
4925
|
-
var tmp15_defaultRoadWidthM = tmp12_elvis_lhs == null ?
|
|
4926
|
-
|
|
5118
|
+
var tmp15_defaultRoadWidthM = tmp12_elvis_lhs == null ? d.racingLine_1.defaultRoadWidthM_1 : tmp12_elvis_lhs;
|
|
5119
|
+
var tmp_10 = new RacingLineOptions(tmp13_enabled, tmp15_defaultRoadWidthM, VOID, tmp14_corridor);
|
|
5120
|
+
// Inline function 'kotlin.run' call
|
|
5121
|
+
var tmp0_safe_receiver = _this__u8e3s4.elevationGainPreset;
|
|
5122
|
+
var tmp_11;
|
|
5123
|
+
if (tmp0_safe_receiver == null) {
|
|
5124
|
+
tmp_11 = null;
|
|
5125
|
+
} else {
|
|
5126
|
+
// Inline function 'kotlin.let' call
|
|
5127
|
+
tmp_11 = Companion_instance_0.byId_8gmd94_k$(tmp0_safe_receiver);
|
|
5128
|
+
}
|
|
5129
|
+
var named = tmp_11;
|
|
5130
|
+
var tmp1_elvis_lhs_0 = _this__u8e3s4.elevationGainEnabled;
|
|
5131
|
+
var tmp_12 = tmp1_elvis_lhs_0 == null ? d.elevationGain_1.enabled_1 : tmp1_elvis_lhs_0;
|
|
5132
|
+
var tmp_13 = named == null ? d.elevationGain_1.preset_1 : named;
|
|
5133
|
+
var tmp3_elvis_lhs_0 = _this__u8e3s4.elevationGainThresholdM;
|
|
5134
|
+
var tmp_14;
|
|
5135
|
+
if (tmp3_elvis_lhs_0 == null) {
|
|
5136
|
+
tmp_14 = named == null ? null : named.thresholdM_1;
|
|
5137
|
+
} else {
|
|
5138
|
+
tmp_14 = tmp3_elvis_lhs_0;
|
|
5139
|
+
}
|
|
5140
|
+
var tmp5_elvis_lhs_0 = tmp_14;
|
|
5141
|
+
var tmp_15 = new ElevationGainOptions(tmp_12, tmp_13, tmp5_elvis_lhs_0 == null ? d.elevationGain_1.thresholdM_1 : tmp5_elvis_lhs_0);
|
|
5142
|
+
var tmp16_elvis_lhs = _this__u8e3s4.elevationSmoothWindowM;
|
|
5143
|
+
return new EnhanceOptions(tmp, tmp_0, tmp_1, tmp_2, tmp_5, tmp_8, tmp_9, tmp_10, tmp_15, tmp16_elvis_lhs == null ? d.elevationSmoothWindowM_1 : tmp16_elvis_lhs);
|
|
5144
|
+
}
|
|
5145
|
+
function elevationProviderFor(options) {
|
|
5146
|
+
_init_properties_EngineJsApi_kt__9bputf();
|
|
5147
|
+
var tmp1_elvis_lhs = options == null ? null : options.demZoom;
|
|
5148
|
+
var tmp;
|
|
5149
|
+
if (tmp1_elvis_lhs == null) {
|
|
5150
|
+
return new ElevationProvider();
|
|
5151
|
+
} else {
|
|
5152
|
+
tmp = tmp1_elvis_lhs;
|
|
5153
|
+
}
|
|
5154
|
+
var zoom = tmp;
|
|
5155
|
+
return new ElevationProvider(new ElevationProviderConfig(zoom));
|
|
4927
5156
|
}
|
|
4928
5157
|
function parseCorridor(name) {
|
|
4929
5158
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4930
|
-
return name == null ?
|
|
5159
|
+
return name == null ? Companion_getInstance_19().DEFAULT_1.corridor_1 : Companion_instance_16.byId_8gmd94_k$(name);
|
|
4931
5160
|
}
|
|
4932
5161
|
function defaultJsOptions() {
|
|
4933
5162
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4934
|
-
return new EnhanceOptions(false, true, true, false, new SimplifyPathOptions(false), VOID, new CurvatureOptions(
|
|
5163
|
+
return new EnhanceOptions(false, true, true, false, new SimplifyPathOptions(false), VOID, new CurvatureOptions(), new RacingLineOptions());
|
|
4935
5164
|
}
|
|
4936
5165
|
function toCyclist(_this__u8e3s4) {
|
|
4937
5166
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
@@ -4939,49 +5168,15 @@
|
|
|
4939
5168
|
return new Cyclist();
|
|
4940
5169
|
requireOnlyKeys(_this__u8e3s4, 'CyclistDto', get_CYCLIST_KEYS());
|
|
4941
5170
|
var tmp0_safe_receiver = _this__u8e3s4.roadCondition;
|
|
4942
|
-
|
|
4943
|
-
var tmp = _this__u8e3s4.massKg;
|
|
4944
|
-
var tmp2_elvis_lhs = condition == null ? null : condition.maxBrakeG_1;
|
|
4945
|
-
var tmp_0 = tmp2_elvis_lhs == null ? _this__u8e3s4.maxBrakeG : tmp2_elvis_lhs;
|
|
4946
|
-
var tmp_1 = _this__u8e3s4.cd;
|
|
4947
|
-
var tmp_2 = _this__u8e3s4.frontalAreaM2;
|
|
4948
|
-
var tmp4_elvis_lhs = condition == null ? null : condition.get_leanAngleDeg_9xbhfm_k$();
|
|
4949
|
-
return new Cyclist(tmp, tmp_0, tmp_1, tmp_2, tmp4_elvis_lhs == null ? _this__u8e3s4.maxLeanAngleDeg : tmp4_elvis_lhs, _this__u8e3s4.maxSpeedKmH);
|
|
5171
|
+
return applyTo(tmp0_safe_receiver == null ? null : toRoadCondition(tmp0_safe_receiver), new Cyclist(_this__u8e3s4.massKg, _this__u8e3s4.maxBrakeG, _this__u8e3s4.cd, _this__u8e3s4.frontalAreaM2, _this__u8e3s4.maxLeanAngleDeg, _this__u8e3s4.maxSpeedKmH));
|
|
4950
5172
|
}
|
|
4951
5173
|
function toRoadCondition(_this__u8e3s4) {
|
|
4952
5174
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
4953
|
-
var
|
|
4954
|
-
var tmp$ret$0;
|
|
4955
|
-
$l$block: {
|
|
4956
|
-
// Inline function 'kotlin.collections.firstOrNull' call
|
|
4957
|
-
var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
|
|
4958
|
-
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
4959
|
-
var element = _iterator__ex2g4s.next_20eer_k$();
|
|
4960
|
-
if (equals_0(element.name_1, _this__u8e3s4, true)) {
|
|
4961
|
-
tmp$ret$0 = element;
|
|
4962
|
-
break $l$block;
|
|
4963
|
-
}
|
|
4964
|
-
}
|
|
4965
|
-
tmp$ret$0 = null;
|
|
4966
|
-
}
|
|
4967
|
-
var tmp0_elvis_lhs = tmp$ret$0;
|
|
5175
|
+
var tmp0_elvis_lhs = Companion_getInstance_7().fromWire_2092k5_k$(_this__u8e3s4);
|
|
4968
5176
|
var tmp;
|
|
4969
5177
|
if (tmp0_elvis_lhs == null) {
|
|
4970
|
-
var tmp_0 = 'Unknown CyclistDto.roadCondition: ' + _this__u8e3s4 + ' (expected one of ';
|
|
4971
|
-
// Inline function 'kotlin.collections.map' call
|
|
4972
|
-
var this_0 = get_entries_0();
|
|
4973
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
4974
|
-
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
4975
|
-
var _iterator__ex2g4s_0 = this_0.iterator_jk1svi_k$();
|
|
4976
|
-
while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
|
|
4977
|
-
var item = _iterator__ex2g4s_0.next_20eer_k$();
|
|
4978
|
-
// Inline function 'kotlin.text.lowercase' call
|
|
4979
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
4980
|
-
var tmp$ret$4 = item.name_1.toLowerCase();
|
|
4981
|
-
destination.add_utx5q5_k$(tmp$ret$4);
|
|
4982
|
-
}
|
|
4983
5178
|
// Inline function 'kotlin.error' call
|
|
4984
|
-
var message =
|
|
5179
|
+
var message = 'Unknown CyclistDto.roadCondition: ' + _this__u8e3s4 + ' (expected one of ' + toString(Companion_getInstance_7().get_wireNames_7fokbq_k$()) + ')';
|
|
4985
5180
|
throw IllegalStateException_init_$Create$(toString(message));
|
|
4986
5181
|
} else {
|
|
4987
5182
|
tmp = tmp0_elvis_lhs;
|
|
@@ -4999,7 +5194,7 @@
|
|
|
4999
5194
|
var tmp_2 = _this__u8e3s4.wheelRadiusM;
|
|
5000
5195
|
var tmp_3 = _this__u8e3s4.efficiency;
|
|
5001
5196
|
var tmp0_elvis_lhs = _this__u8e3s4.maxPedalingLeanAngleDeg;
|
|
5002
|
-
return new Bike(tmp, tmp_0, tmp_1, tmp_2, tmp_3, tmp0_elvis_lhs == null ?
|
|
5197
|
+
return new Bike(tmp, tmp_0, tmp_1, tmp_2, tmp_3, tmp0_elvis_lhs == null ? (new Bike()).maxPedalingLeanAngleDeg_1 : tmp0_elvis_lhs);
|
|
5003
5198
|
}
|
|
5004
5199
|
function toWindProvider(_this__u8e3s4) {
|
|
5005
5200
|
_init_properties_EngineJsApi_kt__9bputf();
|
|
@@ -5018,11 +5213,11 @@
|
|
|
5018
5213
|
return new CyclistPowerSpec();
|
|
5019
5214
|
requireOnlyKeys(_this__u8e3s4, 'PowerProviderDto', get_POWER_PROVIDER_KEYS());
|
|
5020
5215
|
var defaults = new CyclistPowerSpec();
|
|
5021
|
-
var tmp0_elvis_lhs =
|
|
5216
|
+
var tmp0_elvis_lhs = Companion_instance_9.fromIdOrNull_83jhaj_k$(_this__u8e3s4.type);
|
|
5022
5217
|
var tmp;
|
|
5023
5218
|
if (tmp0_elvis_lhs == null) {
|
|
5024
5219
|
// Inline function 'kotlin.error' call
|
|
5025
|
-
var message = 'Unknown PowerProviderDto.type: ' + _this__u8e3s4.type + ' (expected one of ' + toString(
|
|
5220
|
+
var message = 'Unknown PowerProviderDto.type: ' + _this__u8e3s4.type + ' (expected one of ' + toString(Companion_instance_9.get_ids_18j3qp_k$()) + ')';
|
|
5026
5221
|
throw IllegalStateException_init_$Create$(toString(message));
|
|
5027
5222
|
} else {
|
|
5028
5223
|
tmp = tmp0_elvis_lhs;
|
|
@@ -5047,7 +5242,7 @@
|
|
|
5047
5242
|
var keys = Object.keys(_this__u8e3s4);
|
|
5048
5243
|
// Inline function 'kotlin.collections.filterNot' call
|
|
5049
5244
|
// Inline function 'kotlin.collections.filterNotTo' call
|
|
5050
|
-
var destination = ArrayList_init_$Create$();
|
|
5245
|
+
var destination = ArrayList_init_$Create$_0();
|
|
5051
5246
|
var inductionVariable = 0;
|
|
5052
5247
|
var last = keys.length;
|
|
5053
5248
|
while (inductionVariable < last) {
|
|
@@ -5096,7 +5291,7 @@
|
|
|
5096
5291
|
// Inline function 'kotlin.collections.map' call
|
|
5097
5292
|
var this_0 = _this__u8e3s4.parts_1;
|
|
5098
5293
|
// Inline function 'kotlin.collections.mapTo' call
|
|
5099
|
-
var destination = ArrayList_init_$Create$
|
|
5294
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
5100
5295
|
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
5101
5296
|
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
5102
5297
|
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
@@ -5146,7 +5341,7 @@
|
|
|
5146
5341
|
case 0:
|
|
5147
5342
|
this.exceptionState_1 = 2;
|
|
5148
5343
|
var opts = toEnhanceOptions(this.$options_1);
|
|
5149
|
-
var provider = opts.fixElevation_1 ?
|
|
5344
|
+
var provider = opts.fixElevation_1 ? elevationProviderFor(this.$options_1) : null;
|
|
5150
5345
|
this.state_1 = 1;
|
|
5151
5346
|
suspendResult = Enhancer_instance.enhanceCourseDefault_jm937y_k$(this.$path_1, provider, opts, this);
|
|
5152
5347
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
@@ -5208,7 +5403,7 @@
|
|
|
5208
5403
|
case 0:
|
|
5209
5404
|
this.exceptionState_1 = 2;
|
|
5210
5405
|
var opts = toEnhanceOptions(this.$options_1);
|
|
5211
|
-
var provider = opts.fixElevation_1 ?
|
|
5406
|
+
var provider = opts.fixElevation_1 ? elevationProviderFor(this.$options_1) : null;
|
|
5212
5407
|
var course = new CoursePhysics(new Course(this.$path_1, toCyclist(this.$cyclist_1), toBike(this.$bike_1)), RhoProviderEstimate_instance, AeroProviderConstant_instance, toWindProvider(this.$wind_1), toCyclistPowerProvider(this.$power_1));
|
|
5213
5408
|
this.state_1 = 1;
|
|
5214
5409
|
suspendResult = Enhancer_instance.enhanceCourse_mout3j_k$(course, opts, provider, this);
|
|
@@ -5248,29 +5443,30 @@
|
|
|
5248
5443
|
function _init_properties_EngineJsApi_kt__9bputf() {
|
|
5249
5444
|
if (!properties_initialized_EngineJsApi_kt_2x4hj5) {
|
|
5250
5445
|
properties_initialized_EngineJsApi_kt_2x4hj5 = true;
|
|
5446
|
+
WAYPOINT_KEYS = setOf_0(['latitudeDeg', 'longitudeDeg', 'elevationM', 'name', 'description', 'symbol', 'type', 'timeEpochMs']);
|
|
5251
5447
|
POWER_PROVIDER_KEYS = setOf_0(['type', 'power', 'useHarmonics', 'criticalPower', 'wPrime', 'pacing', 'maxSlewWPerS']);
|
|
5252
5448
|
CYCLIST_KEYS = setOf_0(['massKg', 'cd', 'frontalAreaM2', 'maxLeanAngleDeg', 'maxBrakeG', 'maxSpeedKmH', 'roadCondition']);
|
|
5253
5449
|
BIKE_KEYS = setOf_0(['crr', 'inertiaFront', 'inertiaRear', 'wheelRadiusM', 'efficiency', 'maxPedalingLeanAngleDeg']);
|
|
5254
5450
|
WIND_KEYS = setOf_0(['windSpeed', 'windDirection']);
|
|
5255
|
-
ENHANCE_OPTIONS_KEYS = setOf_0(['fixElevation', 'computeMaxSpeeds', 'virtualizeTrack', 'computeOnePointPerSecond', 'simplifyEnabled', 'simplifyToleranceM', 'simplifyZExaggeration', 'wPrimeBalanceEnabled', 'wPrimeBalanceCriticalPower', 'wPrimeBalanceWPrime', 'curvatureEnabled', 'racingLineEnabled', 'racingLineCorridor', 'racingLineRoadWidthM']);
|
|
5451
|
+
ENHANCE_OPTIONS_KEYS = setOf_0(['fixElevation', 'computeMaxSpeeds', 'virtualizeTrack', 'computeOnePointPerSecond', 'simplifyEnabled', 'simplifyToleranceM', 'simplifyZExaggeration', 'wPrimeBalanceEnabled', 'wPrimeBalanceCriticalPower', 'wPrimeBalanceWPrime', 'curvatureEnabled', 'racingLineEnabled', 'racingLineCorridor', 'racingLineRoadWidthM', 'elevationGainPreset', 'elevationGainThresholdM', 'elevationGainEnabled', 'elevationSmoothWindowM', 'demZoom']);
|
|
5256
5452
|
}
|
|
5257
5453
|
}
|
|
5258
5454
|
//region block: init
|
|
5259
5455
|
Enhancer_instance = new Enhancer();
|
|
5260
|
-
|
|
5456
|
+
Companion_instance_7 = new Companion_5();
|
|
5261
5457
|
ClimbDetector_instance = new ClimbDetector();
|
|
5262
5458
|
AeroPowerProvider_instance = new AeroPowerProvider();
|
|
5263
5459
|
AeroProviderConstant_instance = new AeroProviderConstant();
|
|
5264
|
-
|
|
5265
|
-
|
|
5460
|
+
Companion_instance_8 = new Companion_6();
|
|
5461
|
+
Companion_instance_9 = new Companion_7();
|
|
5266
5462
|
GravPowerProvider_instance = new GravPowerProvider();
|
|
5267
5463
|
MaxSpeedComputer_instance = new MaxSpeedComputer();
|
|
5268
5464
|
MuscularPowerProvider_instance = new MuscularPowerProvider();
|
|
5269
5465
|
PowerComputer_instance = new PowerComputer();
|
|
5270
|
-
|
|
5271
|
-
|
|
5466
|
+
Companion_instance_10 = new Companion_8();
|
|
5467
|
+
Companion_instance_11 = new Companion_9();
|
|
5272
5468
|
PowerProviderFromData_instance = new PowerProviderFromData();
|
|
5273
|
-
|
|
5469
|
+
Companion_instance_12 = new Companion_10();
|
|
5274
5470
|
RhoProviderDefault_instance = new RhoProviderDefault();
|
|
5275
5471
|
RhoProviderEstimate_instance = new RhoProviderEstimate();
|
|
5276
5472
|
RollingResistancePowerProvider_instance = new RollingResistancePowerProvider();
|
|
@@ -5283,11 +5479,11 @@
|
|
|
5283
5479
|
Corridor_instance = new Corridor();
|
|
5284
5480
|
CurvatureEstimator_instance = new CurvatureEstimator();
|
|
5285
5481
|
LocalFrame_instance = new LocalFrame();
|
|
5286
|
-
|
|
5482
|
+
Companion_instance_14 = new Companion_12();
|
|
5287
5483
|
OffsetQp_instance = new OffsetQp();
|
|
5288
5484
|
PathCurvature_instance = new PathCurvature();
|
|
5289
5485
|
RacingLine_instance = new RacingLine();
|
|
5290
|
-
|
|
5486
|
+
Companion_instance_16 = new Companion_14();
|
|
5291
5487
|
//endregion
|
|
5292
5488
|
//region block: exports
|
|
5293
5489
|
function $jsExportAll$(_) {
|
|
@@ -5307,6 +5503,10 @@
|
|
|
5307
5503
|
engine.pathDurationMs = pathDurationMs;
|
|
5308
5504
|
engine.pathElevationGain = pathElevationGain;
|
|
5309
5505
|
engine.pathElevationLoss = pathElevationLoss;
|
|
5506
|
+
engine.pathElevationGainFiltered = pathElevationGainFiltered;
|
|
5507
|
+
engine.pathElevationLossFiltered = pathElevationLossFiltered;
|
|
5508
|
+
engine.pathReportedElevationGain = pathReportedElevationGain;
|
|
5509
|
+
engine.pathReportedElevationLoss = pathReportedElevationLoss;
|
|
5310
5510
|
engine.pointAt = pointAt;
|
|
5311
5511
|
engine.writeGpx = writeGpx;
|
|
5312
5512
|
engine.writeGpxAt = writeGpxAt;
|