@glandais/vcyclist-engine 3.0.0 → 3.1.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 +23 -4
- package/fit-kotlin-sdk.js +13575 -0
- package/fit-kotlin-sdk.js.map +1 -0
- package/kotlin-kotlin-stdlib.js +2883 -2128
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -1
- package/kotlinx-atomicfu.js +22 -22
- package/kotlinx-atomicfu.js.map +1 -1
- package/kotlinx-browser.js.map +1 -1
- package/kotlinx-coroutines-core.js +1224 -1224
- package/kotlinx-coroutines-core.js.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.js +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -1
- package/package.json +7 -8
- package/vcyclist-elevation.js +931 -931
- package/vcyclist-elevation.js.map +1 -1
- package/vcyclist-engine.js +774 -758
- package/vcyclist-engine.js.map +1 -1
- package/vcyclist-fit.js +456 -424
- package/vcyclist-fit.js.map +1 -1
- package/vcyclist-gpx.js +1112 -1106
- package/vcyclist-gpx.js.map +1 -1
- package/xmlutil-core.js +2983 -2950
- package/xmlutil-core.js.map +1 -1
- package/xmlutil-serialization.js.map +1 -1
package/vcyclist-engine.js
CHANGED
|
@@ -27,87 +27,87 @@
|
|
|
27
27
|
var imul = Math.imul;
|
|
28
28
|
var hypot = Math.hypot;
|
|
29
29
|
var sign = Math.sign;
|
|
30
|
-
var protoOf = kotlin_kotlin.$_$.
|
|
31
|
-
var initMetadataForCompanion = kotlin_kotlin.$_$.
|
|
30
|
+
var protoOf = kotlin_kotlin.$_$.t6;
|
|
31
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.f6;
|
|
32
32
|
var VOID = kotlin_kotlin.$_$.a;
|
|
33
|
-
var getNumberHashCode = kotlin_kotlin.$_$.
|
|
34
|
-
var equals = kotlin_kotlin.$_$.
|
|
35
|
-
var initMetadataForClass = kotlin_kotlin.$_$.
|
|
36
|
-
var toString = kotlin_kotlin.$_$.
|
|
37
|
-
var hashCode = kotlin_kotlin.$_$.
|
|
38
|
-
var getBooleanHashCode = kotlin_kotlin.$_$.
|
|
39
|
-
var CoroutineImpl = kotlin_kotlin.$_$.
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.
|
|
51
|
-
var last = kotlin_kotlin.$_$.
|
|
52
|
-
var toIntArray = kotlin_kotlin.$_$.
|
|
53
|
-
var sortedWith = kotlin_kotlin.$_$.
|
|
54
|
-
var toMutableList = kotlin_kotlin.$_$.
|
|
55
|
-
var first = kotlin_kotlin.$_$.
|
|
56
|
-
var removeAll = kotlin_kotlin.$_$.
|
|
57
|
-
var numberRangeToNumber = kotlin_kotlin.$_$.
|
|
58
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.
|
|
33
|
+
var getNumberHashCode = kotlin_kotlin.$_$.a6;
|
|
34
|
+
var equals = kotlin_kotlin.$_$.x5;
|
|
35
|
+
var initMetadataForClass = kotlin_kotlin.$_$.e6;
|
|
36
|
+
var toString = kotlin_kotlin.$_$.w6;
|
|
37
|
+
var hashCode = kotlin_kotlin.$_$.d6;
|
|
38
|
+
var getBooleanHashCode = kotlin_kotlin.$_$.z5;
|
|
39
|
+
var CoroutineImpl = kotlin_kotlin.$_$.s4;
|
|
40
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.y1;
|
|
41
|
+
var Unit_instance = kotlin_kotlin.$_$.f1;
|
|
42
|
+
var PointPerDistance_instance = kotlin_io_github_glandais_gpx.$_$.k;
|
|
43
|
+
var ElevationStep_instance = kotlin_io_github_glandais_gpx.$_$.h;
|
|
44
|
+
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.d4;
|
|
45
|
+
var PointPerSecond_instance = kotlin_io_github_glandais_gpx.$_$.l;
|
|
46
|
+
var PathSimplifier_instance = kotlin_io_github_glandais_gpx.$_$.i;
|
|
47
|
+
var initMetadataForCoroutine = kotlin_kotlin.$_$.g6;
|
|
48
|
+
var initMetadataForObject = kotlin_kotlin.$_$.k6;
|
|
49
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.i1;
|
|
50
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.h1;
|
|
51
|
+
var last = kotlin_kotlin.$_$.l3;
|
|
52
|
+
var toIntArray = kotlin_kotlin.$_$.w3;
|
|
53
|
+
var sortedWith = kotlin_kotlin.$_$.u3;
|
|
54
|
+
var toMutableList = kotlin_kotlin.$_$.z3;
|
|
55
|
+
var first = kotlin_kotlin.$_$.f3;
|
|
56
|
+
var removeAll = kotlin_kotlin.$_$.p3;
|
|
57
|
+
var numberRangeToNumber = kotlin_kotlin.$_$.p6;
|
|
58
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.v2;
|
|
59
59
|
var Vector3D = kotlin_io_github_glandais_elevation.$_$.g;
|
|
60
|
-
var emptyList = kotlin_kotlin.$_$.
|
|
61
|
-
var coerceIn = kotlin_kotlin.$_$.
|
|
60
|
+
var emptyList = kotlin_kotlin.$_$.c3;
|
|
61
|
+
var coerceIn = kotlin_kotlin.$_$.d7;
|
|
62
62
|
var DouglasPeucker_instance = kotlin_io_github_glandais_elevation.$_$.b;
|
|
63
|
-
var FunctionAdapter = kotlin_kotlin.$_$.
|
|
64
|
-
var isInterface = kotlin_kotlin.$_$.
|
|
65
|
-
var Comparator = kotlin_kotlin.$_$.
|
|
66
|
-
var compareValues = kotlin_kotlin.$_$.
|
|
67
|
-
var until = kotlin_kotlin.$_$.
|
|
68
|
-
var Pair = kotlin_kotlin.$_$.
|
|
69
|
-
var listOf = kotlin_kotlin.$_$.
|
|
70
|
-
var Default_getInstance = kotlin_kotlin.$_$.
|
|
71
|
-
var PointField_TEMPERATURE_getInstance = kotlin_io_github_glandais_gpx.$_$.
|
|
72
|
-
var isNaN_0 = kotlin_kotlin.$_$.
|
|
63
|
+
var FunctionAdapter = kotlin_kotlin.$_$.l5;
|
|
64
|
+
var isInterface = kotlin_kotlin.$_$.m6;
|
|
65
|
+
var Comparator = kotlin_kotlin.$_$.u8;
|
|
66
|
+
var compareValues = kotlin_kotlin.$_$.b4;
|
|
67
|
+
var until = kotlin_kotlin.$_$.h7;
|
|
68
|
+
var Pair = kotlin_kotlin.$_$.b9;
|
|
69
|
+
var listOf = kotlin_kotlin.$_$.m3;
|
|
70
|
+
var Default_getInstance = kotlin_kotlin.$_$.a1;
|
|
71
|
+
var PointField_TEMPERATURE_getInstance = kotlin_io_github_glandais_gpx.$_$.c;
|
|
72
|
+
var isNaN_0 = kotlin_kotlin.$_$.p9;
|
|
73
73
|
var get_entries = kotlin_io_github_glandais_gpx.$_$.u;
|
|
74
74
|
var Path = kotlin_io_github_glandais_gpx.$_$.t;
|
|
75
|
-
var GpxParser_instance = kotlin_io_github_glandais_gpx.$_$.
|
|
76
|
-
var copyToArray = kotlin_kotlin.$_$.
|
|
75
|
+
var GpxParser_instance = kotlin_io_github_glandais_gpx.$_$.d;
|
|
76
|
+
var copyToArray = kotlin_kotlin.$_$.b3;
|
|
77
77
|
var firstTrackAsPath = kotlin_io_github_glandais_gpx.$_$.n;
|
|
78
78
|
var tracksAsPaths = kotlin_io_github_glandais_gpx.$_$.q;
|
|
79
79
|
var segmentsAsPaths = kotlin_io_github_glandais_gpx.$_$.o;
|
|
80
|
-
var GpxPathKind_TRACK_getInstance = kotlin_io_github_glandais_gpx.$_$.
|
|
81
|
-
var setOf = kotlin_kotlin.$_$.
|
|
82
|
-
var GpxPathKind_ROUTE_getInstance = kotlin_io_github_glandais_gpx.$_$.
|
|
83
|
-
var GpxWriter_instance = kotlin_io_github_glandais_gpx.$_$.
|
|
84
|
-
var toList = kotlin_kotlin.$_$.
|
|
80
|
+
var GpxPathKind_TRACK_getInstance = kotlin_io_github_glandais_gpx.$_$.b;
|
|
81
|
+
var setOf = kotlin_kotlin.$_$.s3;
|
|
82
|
+
var GpxPathKind_ROUTE_getInstance = kotlin_io_github_glandais_gpx.$_$.a;
|
|
83
|
+
var GpxWriter_instance = kotlin_io_github_glandais_gpx.$_$.e;
|
|
84
|
+
var toList = kotlin_kotlin.$_$.y3;
|
|
85
85
|
var toGpxDocument = kotlin_io_github_glandais_gpx.$_$.p;
|
|
86
|
-
var Companion_getInstance = kotlin_kotlin.$_$.
|
|
87
|
-
var numberToLong = kotlin_kotlin.$_$.
|
|
86
|
+
var Companion_getInstance = kotlin_kotlin.$_$.c1;
|
|
87
|
+
var numberToLong = kotlin_kotlin.$_$.h5;
|
|
88
88
|
var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
|
|
89
89
|
var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
|
|
90
|
-
var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.
|
|
91
|
-
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.
|
|
92
|
-
var CsvWriter_instance = kotlin_io_github_glandais_gpx.$_$.
|
|
93
|
-
var firstOrNull = kotlin_kotlin.$_$.
|
|
90
|
+
var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.j;
|
|
91
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.a2;
|
|
92
|
+
var CsvWriter_instance = kotlin_io_github_glandais_gpx.$_$.f;
|
|
93
|
+
var firstOrNull = kotlin_kotlin.$_$.w7;
|
|
94
94
|
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.b;
|
|
95
|
-
var Char = kotlin_kotlin.$_$.
|
|
95
|
+
var Char = kotlin_kotlin.$_$.t8;
|
|
96
96
|
var CsvOptions = kotlin_io_github_glandais_gpx.$_$.r;
|
|
97
|
-
var JsonWriter_instance = kotlin_io_github_glandais_gpx.$_$.
|
|
97
|
+
var JsonWriter_instance = kotlin_io_github_glandais_gpx.$_$.g;
|
|
98
98
|
var JsonOptions = kotlin_io_github_glandais_gpx.$_$.s;
|
|
99
99
|
var toFitBytes = kotlin_io_github_glandais_fit.$_$.a;
|
|
100
|
-
var Companion_getInstance_1 = kotlin_kotlin.$_$.
|
|
101
|
-
var DurationUnit_MILLISECONDS_getInstance = kotlin_kotlin.$_$.
|
|
102
|
-
var toDuration = kotlin_kotlin.$_$.
|
|
100
|
+
var Companion_getInstance_1 = kotlin_kotlin.$_$.b1;
|
|
101
|
+
var DurationUnit_MILLISECONDS_getInstance = kotlin_kotlin.$_$.v;
|
|
102
|
+
var toDuration = kotlin_kotlin.$_$.s8;
|
|
103
103
|
var toFitBytes_0 = kotlin_io_github_glandais_fit.$_$.b;
|
|
104
|
-
var toNumber = kotlin_kotlin.$_$.
|
|
104
|
+
var toNumber = kotlin_kotlin.$_$.k5;
|
|
105
105
|
var GpxWaypoint = kotlin_io_github_glandais_gpx.$_$.m;
|
|
106
|
-
var THROW_CCE = kotlin_kotlin.$_$.
|
|
106
|
+
var THROW_CCE = kotlin_kotlin.$_$.e9;
|
|
107
107
|
var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
|
|
108
108
|
var ElevationProvider = kotlin_io_github_glandais_elevation.$_$.d;
|
|
109
|
-
var initMetadataForLambda = kotlin_kotlin.$_$.
|
|
110
|
-
var constructCallableReference = kotlin_kotlin.$_$.
|
|
109
|
+
var initMetadataForLambda = kotlin_kotlin.$_$.j6;
|
|
110
|
+
var constructCallableReference = kotlin_kotlin.$_$.u5;
|
|
111
111
|
//endregion
|
|
112
112
|
//region block: pre-declaration
|
|
113
113
|
initMetadataForCompanion(Companion);
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
//endregion
|
|
159
159
|
function Companion() {
|
|
160
160
|
Companion_instance = this;
|
|
161
|
-
this.
|
|
161
|
+
this.DEFAULT_1 = new Bike();
|
|
162
162
|
}
|
|
163
163
|
var Companion_instance;
|
|
164
164
|
function Companion_getInstance_2() {
|
|
@@ -173,21 +173,21 @@
|
|
|
173
173
|
inertiaRear = inertiaRear === VOID ? 0.07 : inertiaRear;
|
|
174
174
|
wheelRadiusM = wheelRadiusM === VOID ? 0.7 : wheelRadiusM;
|
|
175
175
|
efficiency = efficiency === VOID ? 0.976 : efficiency;
|
|
176
|
-
this.
|
|
177
|
-
this.
|
|
178
|
-
this.
|
|
179
|
-
this.
|
|
180
|
-
this.
|
|
176
|
+
this.crr_1 = crr;
|
|
177
|
+
this.inertiaFront_1 = inertiaFront;
|
|
178
|
+
this.inertiaRear_1 = inertiaRear;
|
|
179
|
+
this.wheelRadiusM_1 = wheelRadiusM;
|
|
180
|
+
this.efficiency_1 = efficiency;
|
|
181
181
|
}
|
|
182
182
|
protoOf(Bike).toString = function () {
|
|
183
|
-
return 'Bike(crr=' + this.
|
|
183
|
+
return 'Bike(crr=' + this.crr_1 + ', inertiaFront=' + this.inertiaFront_1 + ', inertiaRear=' + this.inertiaRear_1 + ', wheelRadiusM=' + this.wheelRadiusM_1 + ', efficiency=' + this.efficiency_1 + ')';
|
|
184
184
|
};
|
|
185
185
|
protoOf(Bike).hashCode = function () {
|
|
186
|
-
var result = getNumberHashCode(this.
|
|
187
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
188
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
189
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
190
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
186
|
+
var result = getNumberHashCode(this.crr_1);
|
|
187
|
+
result = imul(result, 31) + getNumberHashCode(this.inertiaFront_1) | 0;
|
|
188
|
+
result = imul(result, 31) + getNumberHashCode(this.inertiaRear_1) | 0;
|
|
189
|
+
result = imul(result, 31) + getNumberHashCode(this.wheelRadiusM_1) | 0;
|
|
190
|
+
result = imul(result, 31) + getNumberHashCode(this.efficiency_1) | 0;
|
|
191
191
|
return result;
|
|
192
192
|
};
|
|
193
193
|
protoOf(Bike).equals = function (other) {
|
|
@@ -195,41 +195,41 @@
|
|
|
195
195
|
return true;
|
|
196
196
|
if (!(other instanceof Bike))
|
|
197
197
|
return false;
|
|
198
|
-
if (!equals(this.
|
|
198
|
+
if (!equals(this.crr_1, other.crr_1))
|
|
199
199
|
return false;
|
|
200
|
-
if (!equals(this.
|
|
200
|
+
if (!equals(this.inertiaFront_1, other.inertiaFront_1))
|
|
201
201
|
return false;
|
|
202
|
-
if (!equals(this.
|
|
202
|
+
if (!equals(this.inertiaRear_1, other.inertiaRear_1))
|
|
203
203
|
return false;
|
|
204
|
-
if (!equals(this.
|
|
204
|
+
if (!equals(this.wheelRadiusM_1, other.wheelRadiusM_1))
|
|
205
205
|
return false;
|
|
206
|
-
if (!equals(this.
|
|
206
|
+
if (!equals(this.efficiency_1, other.efficiency_1))
|
|
207
207
|
return false;
|
|
208
208
|
return true;
|
|
209
209
|
};
|
|
210
210
|
function Course(path, cyclist, bike) {
|
|
211
|
-
cyclist = cyclist === VOID ? Companion_getInstance_4().
|
|
212
|
-
bike = bike === VOID ? Companion_getInstance_2().
|
|
213
|
-
this.
|
|
214
|
-
this.
|
|
215
|
-
this.
|
|
211
|
+
cyclist = cyclist === VOID ? Companion_getInstance_4().DEFAULT_1 : cyclist;
|
|
212
|
+
bike = bike === VOID ? Companion_getInstance_2().DEFAULT_1 : bike;
|
|
213
|
+
this.path_1 = path;
|
|
214
|
+
this.cyclist_1 = cyclist;
|
|
215
|
+
this.bike_1 = bike;
|
|
216
216
|
}
|
|
217
|
-
protoOf(Course).
|
|
217
|
+
protoOf(Course).copy_yzntdp_k$ = function (path, cyclist, bike) {
|
|
218
218
|
return new Course(path, cyclist, bike);
|
|
219
219
|
};
|
|
220
|
-
protoOf(Course).
|
|
221
|
-
path = path === VOID ? this.
|
|
222
|
-
cyclist = cyclist === VOID ? this.
|
|
223
|
-
bike = bike === VOID ? this.
|
|
224
|
-
return $super === VOID ? this.
|
|
220
|
+
protoOf(Course).copy$default_mmxsnj_k$ = function (path, cyclist, bike, $super) {
|
|
221
|
+
path = path === VOID ? this.path_1 : path;
|
|
222
|
+
cyclist = cyclist === VOID ? this.cyclist_1 : cyclist;
|
|
223
|
+
bike = bike === VOID ? this.bike_1 : bike;
|
|
224
|
+
return $super === VOID ? this.copy_yzntdp_k$(path, cyclist, bike) : $super.copy_yzntdp_k$.call(this, path, cyclist, bike);
|
|
225
225
|
};
|
|
226
226
|
protoOf(Course).toString = function () {
|
|
227
|
-
return 'Course(path=' + toString(this.
|
|
227
|
+
return 'Course(path=' + toString(this.path_1) + ', cyclist=' + this.cyclist_1.toString() + ', bike=' + this.bike_1.toString() + ')';
|
|
228
228
|
};
|
|
229
229
|
protoOf(Course).hashCode = function () {
|
|
230
|
-
var result = hashCode(this.
|
|
231
|
-
result = imul(result, 31) + this.
|
|
232
|
-
result = imul(result, 31) + this.
|
|
230
|
+
var result = hashCode(this.path_1);
|
|
231
|
+
result = imul(result, 31) + this.cyclist_1.hashCode() | 0;
|
|
232
|
+
result = imul(result, 31) + this.bike_1.hashCode() | 0;
|
|
233
233
|
return result;
|
|
234
234
|
};
|
|
235
235
|
protoOf(Course).equals = function (other) {
|
|
@@ -237,17 +237,17 @@
|
|
|
237
237
|
return true;
|
|
238
238
|
if (!(other instanceof Course))
|
|
239
239
|
return false;
|
|
240
|
-
if (!equals(this.
|
|
240
|
+
if (!equals(this.path_1, other.path_1))
|
|
241
241
|
return false;
|
|
242
|
-
if (!this.
|
|
242
|
+
if (!this.cyclist_1.equals(other.cyclist_1))
|
|
243
243
|
return false;
|
|
244
|
-
if (!this.
|
|
244
|
+
if (!this.bike_1.equals(other.bike_1))
|
|
245
245
|
return false;
|
|
246
246
|
return true;
|
|
247
247
|
};
|
|
248
248
|
function Companion_0() {
|
|
249
249
|
Companion_instance_0 = this;
|
|
250
|
-
this.
|
|
250
|
+
this.DEFAULT_CYCLIST_POWER_PROVIDER_1 = new PowerProviderConstant(280.0);
|
|
251
251
|
}
|
|
252
252
|
var Companion_instance_0;
|
|
253
253
|
function Companion_getInstance_3() {
|
|
@@ -260,42 +260,42 @@
|
|
|
260
260
|
rhoProvider = rhoProvider === VOID ? RhoProviderDefault_instance : rhoProvider;
|
|
261
261
|
aeroProvider = aeroProvider === VOID ? AeroProviderConstant_instance : aeroProvider;
|
|
262
262
|
windProvider = windProvider === VOID ? WindProviderNone_instance : windProvider;
|
|
263
|
-
cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_3().
|
|
264
|
-
this.
|
|
265
|
-
this.
|
|
266
|
-
this.
|
|
267
|
-
this.
|
|
268
|
-
this.
|
|
263
|
+
cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_3().DEFAULT_CYCLIST_POWER_PROVIDER_1 : cyclistPowerProvider;
|
|
264
|
+
this.course_1 = course;
|
|
265
|
+
this.rhoProvider_1 = rhoProvider;
|
|
266
|
+
this.aeroProvider_1 = aeroProvider;
|
|
267
|
+
this.windProvider_1 = windProvider;
|
|
268
|
+
this.cyclistPowerProvider_1 = cyclistPowerProvider;
|
|
269
269
|
}
|
|
270
|
-
protoOf(CoursePhysics).
|
|
271
|
-
return this.
|
|
270
|
+
protoOf(CoursePhysics).get_path_wos8ry_k$ = function () {
|
|
271
|
+
return this.course_1.path_1;
|
|
272
272
|
};
|
|
273
|
-
protoOf(CoursePhysics).
|
|
274
|
-
return this.
|
|
273
|
+
protoOf(CoursePhysics).get_cyclist_lkc0de_k$ = function () {
|
|
274
|
+
return this.course_1.cyclist_1;
|
|
275
275
|
};
|
|
276
|
-
protoOf(CoursePhysics).
|
|
277
|
-
return this.
|
|
276
|
+
protoOf(CoursePhysics).get_bike_wojgoa_k$ = function () {
|
|
277
|
+
return this.course_1.bike_1;
|
|
278
278
|
};
|
|
279
|
-
protoOf(CoursePhysics).
|
|
279
|
+
protoOf(CoursePhysics).copy_ulppn1_k$ = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
|
|
280
280
|
return new CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
|
|
281
281
|
};
|
|
282
|
-
protoOf(CoursePhysics).
|
|
283
|
-
course = course === VOID ? this.
|
|
284
|
-
rhoProvider = rhoProvider === VOID ? this.
|
|
285
|
-
aeroProvider = aeroProvider === VOID ? this.
|
|
286
|
-
windProvider = windProvider === VOID ? this.
|
|
287
|
-
cyclistPowerProvider = cyclistPowerProvider === VOID ? this.
|
|
288
|
-
return $super === VOID ? this.
|
|
282
|
+
protoOf(CoursePhysics).copy$default_a3dskc_k$ = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider, $super) {
|
|
283
|
+
course = course === VOID ? this.course_1 : course;
|
|
284
|
+
rhoProvider = rhoProvider === VOID ? this.rhoProvider_1 : rhoProvider;
|
|
285
|
+
aeroProvider = aeroProvider === VOID ? this.aeroProvider_1 : aeroProvider;
|
|
286
|
+
windProvider = windProvider === VOID ? this.windProvider_1 : windProvider;
|
|
287
|
+
cyclistPowerProvider = cyclistPowerProvider === VOID ? this.cyclistPowerProvider_1 : cyclistPowerProvider;
|
|
288
|
+
return $super === VOID ? this.copy_ulppn1_k$(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) : $super.copy_ulppn1_k$.call(this, course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
|
|
289
289
|
};
|
|
290
290
|
protoOf(CoursePhysics).toString = function () {
|
|
291
|
-
return 'CoursePhysics(course=' + this.
|
|
291
|
+
return 'CoursePhysics(course=' + this.course_1.toString() + ', rhoProvider=' + toString(this.rhoProvider_1) + ', aeroProvider=' + toString(this.aeroProvider_1) + ', windProvider=' + toString(this.windProvider_1) + ', cyclistPowerProvider=' + toString(this.cyclistPowerProvider_1) + ')';
|
|
292
292
|
};
|
|
293
293
|
protoOf(CoursePhysics).hashCode = function () {
|
|
294
|
-
var result = this.
|
|
295
|
-
result = imul(result, 31) + hashCode(this.
|
|
296
|
-
result = imul(result, 31) + hashCode(this.
|
|
297
|
-
result = imul(result, 31) + hashCode(this.
|
|
298
|
-
result = imul(result, 31) + hashCode(this.
|
|
294
|
+
var result = this.course_1.hashCode();
|
|
295
|
+
result = imul(result, 31) + hashCode(this.rhoProvider_1) | 0;
|
|
296
|
+
result = imul(result, 31) + hashCode(this.aeroProvider_1) | 0;
|
|
297
|
+
result = imul(result, 31) + hashCode(this.windProvider_1) | 0;
|
|
298
|
+
result = imul(result, 31) + hashCode(this.cyclistPowerProvider_1) | 0;
|
|
299
299
|
return result;
|
|
300
300
|
};
|
|
301
301
|
protoOf(CoursePhysics).equals = function (other) {
|
|
@@ -303,21 +303,21 @@
|
|
|
303
303
|
return true;
|
|
304
304
|
if (!(other instanceof CoursePhysics))
|
|
305
305
|
return false;
|
|
306
|
-
if (!this.
|
|
306
|
+
if (!this.course_1.equals(other.course_1))
|
|
307
307
|
return false;
|
|
308
|
-
if (!equals(this.
|
|
308
|
+
if (!equals(this.rhoProvider_1, other.rhoProvider_1))
|
|
309
309
|
return false;
|
|
310
|
-
if (!equals(this.
|
|
310
|
+
if (!equals(this.aeroProvider_1, other.aeroProvider_1))
|
|
311
311
|
return false;
|
|
312
|
-
if (!equals(this.
|
|
312
|
+
if (!equals(this.windProvider_1, other.windProvider_1))
|
|
313
313
|
return false;
|
|
314
|
-
if (!equals(this.
|
|
314
|
+
if (!equals(this.cyclistPowerProvider_1, other.cyclistPowerProvider_1))
|
|
315
315
|
return false;
|
|
316
316
|
return true;
|
|
317
317
|
};
|
|
318
318
|
function Companion_1() {
|
|
319
319
|
Companion_instance_1 = this;
|
|
320
|
-
this.
|
|
320
|
+
this.DEFAULT_1 = new Cyclist();
|
|
321
321
|
}
|
|
322
322
|
var Companion_instance_1;
|
|
323
323
|
function Companion_getInstance_4() {
|
|
@@ -333,34 +333,34 @@
|
|
|
333
333
|
frontalAreaM2 = frontalAreaM2 === VOID ? 0.5 : frontalAreaM2;
|
|
334
334
|
maxLeanAngleDeg = maxLeanAngleDeg === VOID ? 35.0 : maxLeanAngleDeg;
|
|
335
335
|
maxSpeedKmH = maxSpeedKmH === VOID ? 100.0 : maxSpeedKmH;
|
|
336
|
-
this.
|
|
337
|
-
this.
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
this.
|
|
341
|
-
this.
|
|
342
|
-
}
|
|
343
|
-
protoOf(Cyclist).
|
|
336
|
+
this.massKg_1 = massKg;
|
|
337
|
+
this.maxBrakeG_1 = maxBrakeG;
|
|
338
|
+
this.cd_1 = cd;
|
|
339
|
+
this.frontalAreaM2__1 = frontalAreaM2;
|
|
340
|
+
this.maxLeanAngleDeg_1 = maxLeanAngleDeg;
|
|
341
|
+
this.maxSpeedKmH_1 = maxSpeedKmH;
|
|
342
|
+
}
|
|
343
|
+
protoOf(Cyclist).get_tanMaxLeanAngle_qqiag1_k$ = function () {
|
|
344
344
|
// Inline function 'kotlin.math.tan' call
|
|
345
|
-
var x = this.
|
|
345
|
+
var x = this.maxLeanAngleDeg_1 * 3.141592653589793 / 180.0;
|
|
346
346
|
return Math.tan(x);
|
|
347
347
|
};
|
|
348
|
-
protoOf(Cyclist).
|
|
349
|
-
return this.
|
|
348
|
+
protoOf(Cyclist).get_maxBrakeMS2_nzouxw_k$ = function () {
|
|
349
|
+
return this.maxBrakeG_1 * 9.8;
|
|
350
350
|
};
|
|
351
|
-
protoOf(Cyclist).
|
|
352
|
-
return this.
|
|
351
|
+
protoOf(Cyclist).get_maxSpeedMS_xz2r7y_k$ = function () {
|
|
352
|
+
return this.maxSpeedKmH_1 / 3.6;
|
|
353
353
|
};
|
|
354
354
|
protoOf(Cyclist).toString = function () {
|
|
355
|
-
return 'Cyclist(massKg=' + this.
|
|
355
|
+
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 + ')';
|
|
356
356
|
};
|
|
357
357
|
protoOf(Cyclist).hashCode = function () {
|
|
358
|
-
var result = getNumberHashCode(this.
|
|
359
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
360
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
361
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
362
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
363
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
358
|
+
var result = getNumberHashCode(this.massKg_1);
|
|
359
|
+
result = imul(result, 31) + getNumberHashCode(this.maxBrakeG_1) | 0;
|
|
360
|
+
result = imul(result, 31) + getNumberHashCode(this.cd_1) | 0;
|
|
361
|
+
result = imul(result, 31) + getNumberHashCode(this.frontalAreaM2__1) | 0;
|
|
362
|
+
result = imul(result, 31) + getNumberHashCode(this.maxLeanAngleDeg_1) | 0;
|
|
363
|
+
result = imul(result, 31) + getNumberHashCode(this.maxSpeedKmH_1) | 0;
|
|
364
364
|
return result;
|
|
365
365
|
};
|
|
366
366
|
protoOf(Cyclist).equals = function (other) {
|
|
@@ -368,17 +368,17 @@
|
|
|
368
368
|
return true;
|
|
369
369
|
if (!(other instanceof Cyclist))
|
|
370
370
|
return false;
|
|
371
|
-
if (!equals(this.
|
|
371
|
+
if (!equals(this.massKg_1, other.massKg_1))
|
|
372
372
|
return false;
|
|
373
|
-
if (!equals(this.
|
|
373
|
+
if (!equals(this.maxBrakeG_1, other.maxBrakeG_1))
|
|
374
374
|
return false;
|
|
375
|
-
if (!equals(this.
|
|
375
|
+
if (!equals(this.cd_1, other.cd_1))
|
|
376
376
|
return false;
|
|
377
|
-
if (!equals(this.
|
|
377
|
+
if (!equals(this.frontalAreaM2__1, other.frontalAreaM2__1))
|
|
378
378
|
return false;
|
|
379
|
-
if (!equals(this.
|
|
379
|
+
if (!equals(this.maxLeanAngleDeg_1, other.maxLeanAngleDeg_1))
|
|
380
380
|
return false;
|
|
381
|
-
if (!equals(this.
|
|
381
|
+
if (!equals(this.maxSpeedKmH_1, other.maxSpeedKmH_1))
|
|
382
382
|
return false;
|
|
383
383
|
return true;
|
|
384
384
|
};
|
|
@@ -386,17 +386,17 @@
|
|
|
386
386
|
enabled = enabled === VOID ? true : enabled;
|
|
387
387
|
toleranceM = toleranceM === VOID ? 10.0 : toleranceM;
|
|
388
388
|
zExaggeration = zExaggeration === VOID ? 3.0 : zExaggeration;
|
|
389
|
-
this.
|
|
390
|
-
this.
|
|
391
|
-
this.
|
|
389
|
+
this.enabled_1 = enabled;
|
|
390
|
+
this.toleranceM_1 = toleranceM;
|
|
391
|
+
this.zExaggeration_1 = zExaggeration;
|
|
392
392
|
}
|
|
393
393
|
protoOf(SimplifyPathOptions).toString = function () {
|
|
394
|
-
return 'SimplifyPathOptions(enabled=' + this.
|
|
394
|
+
return 'SimplifyPathOptions(enabled=' + this.enabled_1 + ', toleranceM=' + this.toleranceM_1 + ', zExaggeration=' + this.zExaggeration_1 + ')';
|
|
395
395
|
};
|
|
396
396
|
protoOf(SimplifyPathOptions).hashCode = function () {
|
|
397
|
-
var result = getBooleanHashCode(this.
|
|
398
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
399
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
397
|
+
var result = getBooleanHashCode(this.enabled_1);
|
|
398
|
+
result = imul(result, 31) + getNumberHashCode(this.toleranceM_1) | 0;
|
|
399
|
+
result = imul(result, 31) + getNumberHashCode(this.zExaggeration_1) | 0;
|
|
400
400
|
return result;
|
|
401
401
|
};
|
|
402
402
|
protoOf(SimplifyPathOptions).equals = function (other) {
|
|
@@ -404,17 +404,17 @@
|
|
|
404
404
|
return true;
|
|
405
405
|
if (!(other instanceof SimplifyPathOptions))
|
|
406
406
|
return false;
|
|
407
|
-
if (!(this.
|
|
407
|
+
if (!(this.enabled_1 === other.enabled_1))
|
|
408
408
|
return false;
|
|
409
|
-
if (!equals(this.
|
|
409
|
+
if (!equals(this.toleranceM_1, other.toleranceM_1))
|
|
410
410
|
return false;
|
|
411
|
-
if (!equals(this.
|
|
411
|
+
if (!equals(this.zExaggeration_1, other.zExaggeration_1))
|
|
412
412
|
return false;
|
|
413
413
|
return true;
|
|
414
414
|
};
|
|
415
415
|
function Companion_2() {
|
|
416
416
|
Companion_instance_2 = this;
|
|
417
|
-
this.
|
|
417
|
+
this.DEFAULT_1 = new EnhanceOptions();
|
|
418
418
|
}
|
|
419
419
|
var Companion_instance_2;
|
|
420
420
|
function Companion_getInstance_5() {
|
|
@@ -429,21 +429,32 @@
|
|
|
429
429
|
virtualizeTrack = virtualizeTrack === VOID ? true : virtualizeTrack;
|
|
430
430
|
computeOnePointPerSecond = computeOnePointPerSecond === VOID ? true : computeOnePointPerSecond;
|
|
431
431
|
simplifyPath = simplifyPath === VOID ? new SimplifyPathOptions() : simplifyPath;
|
|
432
|
-
this.
|
|
433
|
-
this.
|
|
434
|
-
this.
|
|
435
|
-
this.
|
|
436
|
-
this.
|
|
437
|
-
}
|
|
432
|
+
this.fixElevation_1 = fixElevation;
|
|
433
|
+
this.computeMaxSpeeds_1 = computeMaxSpeeds;
|
|
434
|
+
this.virtualizeTrack_1 = virtualizeTrack;
|
|
435
|
+
this.computeOnePointPerSecond_1 = computeOnePointPerSecond;
|
|
436
|
+
this.simplifyPath_1 = simplifyPath;
|
|
437
|
+
}
|
|
438
|
+
protoOf(EnhanceOptions).copy_8buhav_k$ = function (fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath) {
|
|
439
|
+
return new EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath);
|
|
440
|
+
};
|
|
441
|
+
protoOf(EnhanceOptions).copy$default_9zz8ww_k$ = function (fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, $super) {
|
|
442
|
+
fixElevation = fixElevation === VOID ? this.fixElevation_1 : fixElevation;
|
|
443
|
+
computeMaxSpeeds = computeMaxSpeeds === VOID ? this.computeMaxSpeeds_1 : computeMaxSpeeds;
|
|
444
|
+
virtualizeTrack = virtualizeTrack === VOID ? this.virtualizeTrack_1 : virtualizeTrack;
|
|
445
|
+
computeOnePointPerSecond = computeOnePointPerSecond === VOID ? this.computeOnePointPerSecond_1 : computeOnePointPerSecond;
|
|
446
|
+
simplifyPath = simplifyPath === VOID ? this.simplifyPath_1 : simplifyPath;
|
|
447
|
+
return $super === VOID ? this.copy_8buhav_k$(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath) : $super.copy_8buhav_k$.call(this, fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath);
|
|
448
|
+
};
|
|
438
449
|
protoOf(EnhanceOptions).toString = function () {
|
|
439
|
-
return 'EnhanceOptions(fixElevation=' + this.
|
|
450
|
+
return 'EnhanceOptions(fixElevation=' + this.fixElevation_1 + ', computeMaxSpeeds=' + this.computeMaxSpeeds_1 + ', virtualizeTrack=' + this.virtualizeTrack_1 + ', computeOnePointPerSecond=' + this.computeOnePointPerSecond_1 + ', simplifyPath=' + this.simplifyPath_1.toString() + ')';
|
|
440
451
|
};
|
|
441
452
|
protoOf(EnhanceOptions).hashCode = function () {
|
|
442
|
-
var result = getBooleanHashCode(this.
|
|
443
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
444
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
445
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
446
|
-
result = imul(result, 31) + this.
|
|
453
|
+
var result = getBooleanHashCode(this.fixElevation_1);
|
|
454
|
+
result = imul(result, 31) + getBooleanHashCode(this.computeMaxSpeeds_1) | 0;
|
|
455
|
+
result = imul(result, 31) + getBooleanHashCode(this.virtualizeTrack_1) | 0;
|
|
456
|
+
result = imul(result, 31) + getBooleanHashCode(this.computeOnePointPerSecond_1) | 0;
|
|
457
|
+
result = imul(result, 31) + this.simplifyPath_1.hashCode() | 0;
|
|
447
458
|
return result;
|
|
448
459
|
};
|
|
449
460
|
protoOf(EnhanceOptions).equals = function (other) {
|
|
@@ -451,161 +462,166 @@
|
|
|
451
462
|
return true;
|
|
452
463
|
if (!(other instanceof EnhanceOptions))
|
|
453
464
|
return false;
|
|
454
|
-
if (!(this.
|
|
465
|
+
if (!(this.fixElevation_1 === other.fixElevation_1))
|
|
455
466
|
return false;
|
|
456
|
-
if (!(this.
|
|
467
|
+
if (!(this.computeMaxSpeeds_1 === other.computeMaxSpeeds_1))
|
|
457
468
|
return false;
|
|
458
|
-
if (!(this.
|
|
469
|
+
if (!(this.virtualizeTrack_1 === other.virtualizeTrack_1))
|
|
459
470
|
return false;
|
|
460
|
-
if (!(this.
|
|
471
|
+
if (!(this.computeOnePointPerSecond_1 === other.computeOnePointPerSecond_1))
|
|
461
472
|
return false;
|
|
462
|
-
if (!this.
|
|
473
|
+
if (!this.simplifyPath_1.equals(other.simplifyPath_1))
|
|
463
474
|
return false;
|
|
464
475
|
return true;
|
|
465
476
|
};
|
|
466
477
|
function $enhanceCourseCOROUTINE$(_this__u8e3s4, course, options, elevationProvider, resultContinuation) {
|
|
467
478
|
CoroutineImpl.call(this, resultContinuation);
|
|
468
|
-
this.
|
|
469
|
-
this.
|
|
470
|
-
this.
|
|
471
|
-
this.
|
|
479
|
+
this._this__u8e3s4__1 = _this__u8e3s4;
|
|
480
|
+
this.course_1 = course;
|
|
481
|
+
this.options_1 = options;
|
|
482
|
+
this.elevationProvider_1 = elevationProvider;
|
|
472
483
|
}
|
|
473
|
-
protoOf($enhanceCourseCOROUTINE$).
|
|
474
|
-
var suspendResult = this.
|
|
484
|
+
protoOf($enhanceCourseCOROUTINE$).doResume_5yljmg_k$ = function () {
|
|
485
|
+
var suspendResult = this.result_1;
|
|
475
486
|
$sm: do
|
|
476
487
|
try {
|
|
477
|
-
var tmp = this.
|
|
488
|
+
var tmp = this.state_1;
|
|
478
489
|
switch (tmp) {
|
|
479
490
|
case 0:
|
|
480
|
-
this.
|
|
481
|
-
this.
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
491
|
+
this.exceptionState_1 = 3;
|
|
492
|
+
if (!(!this.options_1.fixElevation_1 || !(this.elevationProvider_1 == null))) {
|
|
493
|
+
var message = 'fixElevation = true but elevationProvider is null. Pass a provider, or set fixElevation = false (enhanceCourseDefault resolves this automatically).';
|
|
494
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
this.path0__1 = this.course_1.get_path_wos8ry_k$();
|
|
498
|
+
this.path0__1 = PointPerDistance_instance.compute_7vlifv_k$(this.path0__1, -1.0, 30.0);
|
|
499
|
+
if (this.options_1.fixElevation_1 && !(this.elevationProvider_1 == null)) {
|
|
500
|
+
this.state_1 = 1;
|
|
501
|
+
suspendResult = ElevationStep_instance.fixElevation_nhpf8r_k$(this.path0__1, this.elevationProvider_1, this);
|
|
486
502
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
487
503
|
return suspendResult;
|
|
488
504
|
}
|
|
489
505
|
continue $sm;
|
|
490
506
|
} else {
|
|
491
|
-
this.
|
|
507
|
+
this.state_1 = 2;
|
|
492
508
|
continue $sm;
|
|
493
509
|
}
|
|
494
510
|
|
|
495
511
|
case 1:
|
|
496
|
-
this.
|
|
497
|
-
this.
|
|
512
|
+
this.path0__1 = suspendResult;
|
|
513
|
+
this.state_1 = 2;
|
|
498
514
|
continue $sm;
|
|
499
515
|
case 2:
|
|
500
|
-
this.
|
|
501
|
-
this.
|
|
502
|
-
var working = this.
|
|
503
|
-
if (this.
|
|
504
|
-
MaxSpeedComputer_instance.
|
|
516
|
+
this.path0__1 = PointPerDistance_instance.compute_7vlifv_k$(this.path0__1, 1.0, 2.0);
|
|
517
|
+
this.path0__1 = ElevationStep_instance.smoothElevation$default_3c035p_k$(this.path0__1);
|
|
518
|
+
var working = this.course_1.copy$default_a3dskc_k$(this.course_1.course_1.copy$default_mmxsnj_k$(this.path0__1));
|
|
519
|
+
if (this.options_1.computeMaxSpeeds_1 || this.options_1.virtualizeTrack_1) {
|
|
520
|
+
MaxSpeedComputer_instance.computeMaxSpeeds_jc4v4o_k$(working.course_1);
|
|
505
521
|
}
|
|
506
522
|
|
|
507
|
-
if (this.
|
|
508
|
-
this.
|
|
509
|
-
working = working.
|
|
523
|
+
if (this.options_1.virtualizeTrack_1) {
|
|
524
|
+
this.path0__1 = VirtualizeService_instance.virtualizeTrack_tp3afi_k$(working);
|
|
525
|
+
working = working.copy$default_a3dskc_k$(working.course_1.copy$default_mmxsnj_k$(this.path0__1));
|
|
510
526
|
}
|
|
511
527
|
|
|
512
|
-
if (this.
|
|
513
|
-
this.
|
|
528
|
+
if (this.options_1.computeOnePointPerSecond_1) {
|
|
529
|
+
this.path0__1 = PointPerSecond_instance.computeOnePointPerSecond_7sah9a_k$(this.path0__1);
|
|
514
530
|
}
|
|
515
531
|
|
|
516
|
-
if (this.
|
|
517
|
-
this.
|
|
532
|
+
if (this.options_1.simplifyPath_1.enabled_1) {
|
|
533
|
+
this.path0__1 = PathSimplifier_instance.simplify_gxhj7b_k$(this.path0__1, this.options_1.simplifyPath_1.toleranceM_1, this.options_1.simplifyPath_1.zExaggeration_1);
|
|
518
534
|
}
|
|
519
535
|
|
|
520
|
-
return this.
|
|
536
|
+
return this.path0__1;
|
|
521
537
|
case 3:
|
|
522
|
-
throw this.
|
|
538
|
+
throw this.exception_1;
|
|
523
539
|
}
|
|
524
540
|
} catch ($p) {
|
|
525
541
|
var e = $p;
|
|
526
|
-
if (this.
|
|
542
|
+
if (this.exceptionState_1 === 3) {
|
|
527
543
|
throw e;
|
|
528
544
|
} else {
|
|
529
|
-
this.
|
|
530
|
-
this.
|
|
545
|
+
this.state_1 = this.exceptionState_1;
|
|
546
|
+
this.exception_1 = e;
|
|
531
547
|
}
|
|
532
548
|
}
|
|
533
549
|
while (true);
|
|
534
550
|
};
|
|
535
551
|
function Enhancer() {
|
|
536
552
|
}
|
|
537
|
-
protoOf(Enhancer).
|
|
553
|
+
protoOf(Enhancer).getDefaultCourse_gqi1xw_k$ = function (path) {
|
|
538
554
|
return new CoursePhysics(new Course(path), RhoProviderEstimate_instance, AeroProviderConstant_instance, WindProviderNone_instance, new PowerProviderConstant(280.0));
|
|
539
555
|
};
|
|
540
|
-
protoOf(Enhancer).
|
|
541
|
-
return this.
|
|
556
|
+
protoOf(Enhancer).enhanceCourseDefault_jm937y_k$ = function (path, elevationProvider, options, $completion) {
|
|
557
|
+
return this.enhanceCourse_mout3j_k$(this.getDefaultCourse_gqi1xw_k$(path), options.copy$default_9zz8ww_k$(options.fixElevation_1 && !(elevationProvider == null)), elevationProvider, $completion);
|
|
542
558
|
};
|
|
543
|
-
protoOf(Enhancer).
|
|
559
|
+
protoOf(Enhancer).enhanceCourse_mout3j_k$ = function (course, options, elevationProvider, $completion) {
|
|
544
560
|
var tmp = new $enhanceCourseCOROUTINE$(this, course, options, elevationProvider, $completion);
|
|
545
|
-
tmp.
|
|
546
|
-
tmp.
|
|
547
|
-
return tmp.
|
|
561
|
+
tmp.result_1 = Unit_instance;
|
|
562
|
+
tmp.exception_1 = null;
|
|
563
|
+
return tmp.doResume_5yljmg_k$();
|
|
548
564
|
};
|
|
549
565
|
var Enhancer_instance;
|
|
550
566
|
function Enhancer_getInstance() {
|
|
551
567
|
return Enhancer_instance;
|
|
552
568
|
}
|
|
553
569
|
function Climb(startIndex, endIndex, startDistanceM, endDistanceM, startElevationM, endElevationM, positiveElevationM, negativeElevationM, parts) {
|
|
554
|
-
this.
|
|
555
|
-
this.
|
|
556
|
-
this.
|
|
557
|
-
this.
|
|
558
|
-
this.
|
|
559
|
-
this.
|
|
560
|
-
this.
|
|
561
|
-
this.
|
|
562
|
-
this.
|
|
563
|
-
}
|
|
564
|
-
protoOf(Climb).
|
|
565
|
-
return this.
|
|
566
|
-
};
|
|
567
|
-
protoOf(Climb).
|
|
568
|
-
return this.
|
|
569
|
-
};
|
|
570
|
-
protoOf(Climb).
|
|
571
|
-
return this.
|
|
572
|
-
};
|
|
573
|
-
protoOf(Climb).
|
|
570
|
+
this.startIndex_1 = startIndex;
|
|
571
|
+
this.endIndex_1 = endIndex;
|
|
572
|
+
this.startDistanceM_1 = startDistanceM;
|
|
573
|
+
this.endDistanceM_1 = endDistanceM;
|
|
574
|
+
this.startElevationM_1 = startElevationM;
|
|
575
|
+
this.endElevationM_1 = endElevationM;
|
|
576
|
+
this.positiveElevationM_1 = positiveElevationM;
|
|
577
|
+
this.negativeElevationM_1 = negativeElevationM;
|
|
578
|
+
this.parts_1 = parts;
|
|
579
|
+
}
|
|
580
|
+
protoOf(Climb).get_lengthM_2aqrzy_k$ = function () {
|
|
581
|
+
return this.endDistanceM_1 - this.startDistanceM_1;
|
|
582
|
+
};
|
|
583
|
+
protoOf(Climb).get_elevationGainM_6kg9eu_k$ = function () {
|
|
584
|
+
return this.endElevationM_1 - this.startElevationM_1;
|
|
585
|
+
};
|
|
586
|
+
protoOf(Climb).get_averageGrade_oooweb_k$ = function () {
|
|
587
|
+
return this.get_lengthM_2aqrzy_k$() === 0.0 ? 0.0 : this.get_elevationGainM_6kg9eu_k$() / this.get_lengthM_2aqrzy_k$();
|
|
588
|
+
};
|
|
589
|
+
protoOf(Climb).get_climbingGrade_olocdd_k$ = function () {
|
|
574
590
|
// Inline function 'kotlin.collections.filter' call
|
|
575
|
-
var tmp0 = this.
|
|
591
|
+
var tmp0 = this.parts_1;
|
|
576
592
|
// Inline function 'kotlin.collections.filterTo' call
|
|
577
593
|
var destination = ArrayList_init_$Create$();
|
|
578
|
-
var _iterator__ex2g4s = tmp0.
|
|
579
|
-
while (_iterator__ex2g4s.
|
|
580
|
-
var element = _iterator__ex2g4s.
|
|
581
|
-
if (element.
|
|
582
|
-
destination.
|
|
594
|
+
var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
|
|
595
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
596
|
+
var element = _iterator__ex2g4s.next_20eer_k$();
|
|
597
|
+
if (element.get_elevationGainM_6kg9eu_k$() > 0) {
|
|
598
|
+
destination.add_utx5q5_k$(element);
|
|
583
599
|
}
|
|
584
600
|
}
|
|
585
601
|
// Inline function 'kotlin.collections.sumOf' call
|
|
586
602
|
var sum = 0;
|
|
587
|
-
var _iterator__ex2g4s_0 = destination.
|
|
588
|
-
while (_iterator__ex2g4s_0.
|
|
589
|
-
var element_0 = _iterator__ex2g4s_0.
|
|
603
|
+
var _iterator__ex2g4s_0 = destination.iterator_jk1svi_k$();
|
|
604
|
+
while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
|
|
605
|
+
var element_0 = _iterator__ex2g4s_0.next_20eer_k$();
|
|
590
606
|
var tmp = sum;
|
|
591
|
-
sum = tmp + element_0.
|
|
607
|
+
sum = tmp + element_0.get_lengthM_2aqrzy_k$();
|
|
592
608
|
}
|
|
593
609
|
var climbingLength = sum;
|
|
594
|
-
return climbingLength === 0.0 ? 0.0 : this.
|
|
610
|
+
return climbingLength === 0.0 ? 0.0 : this.positiveElevationM_1 / climbingLength;
|
|
595
611
|
};
|
|
596
612
|
protoOf(Climb).toString = function () {
|
|
597
|
-
return 'Climb(startIndex=' + this.
|
|
613
|
+
return 'Climb(startIndex=' + this.startIndex_1 + ', endIndex=' + this.endIndex_1 + ', startDistanceM=' + this.startDistanceM_1 + ', endDistanceM=' + this.endDistanceM_1 + ', startElevationM=' + this.startElevationM_1 + ', endElevationM=' + this.endElevationM_1 + ', positiveElevationM=' + this.positiveElevationM_1 + ', negativeElevationM=' + this.negativeElevationM_1 + ', parts=' + toString(this.parts_1) + ')';
|
|
598
614
|
};
|
|
599
615
|
protoOf(Climb).hashCode = function () {
|
|
600
|
-
var result = this.
|
|
601
|
-
result = imul(result, 31) + this.
|
|
602
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
603
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
604
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
605
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
606
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
607
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
608
|
-
result = imul(result, 31) + hashCode(this.
|
|
616
|
+
var result = this.startIndex_1;
|
|
617
|
+
result = imul(result, 31) + this.endIndex_1 | 0;
|
|
618
|
+
result = imul(result, 31) + getNumberHashCode(this.startDistanceM_1) | 0;
|
|
619
|
+
result = imul(result, 31) + getNumberHashCode(this.endDistanceM_1) | 0;
|
|
620
|
+
result = imul(result, 31) + getNumberHashCode(this.startElevationM_1) | 0;
|
|
621
|
+
result = imul(result, 31) + getNumberHashCode(this.endElevationM_1) | 0;
|
|
622
|
+
result = imul(result, 31) + getNumberHashCode(this.positiveElevationM_1) | 0;
|
|
623
|
+
result = imul(result, 31) + getNumberHashCode(this.negativeElevationM_1) | 0;
|
|
624
|
+
result = imul(result, 31) + hashCode(this.parts_1) | 0;
|
|
609
625
|
return result;
|
|
610
626
|
};
|
|
611
627
|
protoOf(Climb).equals = function (other) {
|
|
@@ -613,49 +629,49 @@
|
|
|
613
629
|
return true;
|
|
614
630
|
if (!(other instanceof Climb))
|
|
615
631
|
return false;
|
|
616
|
-
if (!(this.
|
|
632
|
+
if (!(this.startIndex_1 === other.startIndex_1))
|
|
617
633
|
return false;
|
|
618
|
-
if (!(this.
|
|
634
|
+
if (!(this.endIndex_1 === other.endIndex_1))
|
|
619
635
|
return false;
|
|
620
|
-
if (!equals(this.
|
|
636
|
+
if (!equals(this.startDistanceM_1, other.startDistanceM_1))
|
|
621
637
|
return false;
|
|
622
|
-
if (!equals(this.
|
|
638
|
+
if (!equals(this.endDistanceM_1, other.endDistanceM_1))
|
|
623
639
|
return false;
|
|
624
|
-
if (!equals(this.
|
|
640
|
+
if (!equals(this.startElevationM_1, other.startElevationM_1))
|
|
625
641
|
return false;
|
|
626
|
-
if (!equals(this.
|
|
642
|
+
if (!equals(this.endElevationM_1, other.endElevationM_1))
|
|
627
643
|
return false;
|
|
628
|
-
if (!equals(this.
|
|
644
|
+
if (!equals(this.positiveElevationM_1, other.positiveElevationM_1))
|
|
629
645
|
return false;
|
|
630
|
-
if (!equals(this.
|
|
646
|
+
if (!equals(this.negativeElevationM_1, other.negativeElevationM_1))
|
|
631
647
|
return false;
|
|
632
|
-
if (!equals(this.
|
|
648
|
+
if (!equals(this.parts_1, other.parts_1))
|
|
633
649
|
return false;
|
|
634
650
|
return true;
|
|
635
651
|
};
|
|
636
652
|
function ClimbPart(startDistanceM, endDistanceM, startElevationM, endElevationM) {
|
|
637
|
-
this.
|
|
638
|
-
this.
|
|
639
|
-
this.
|
|
640
|
-
this.
|
|
653
|
+
this.startDistanceM_1 = startDistanceM;
|
|
654
|
+
this.endDistanceM_1 = endDistanceM;
|
|
655
|
+
this.startElevationM_1 = startElevationM;
|
|
656
|
+
this.endElevationM_1 = endElevationM;
|
|
641
657
|
}
|
|
642
|
-
protoOf(ClimbPart).
|
|
643
|
-
return this.
|
|
658
|
+
protoOf(ClimbPart).get_lengthM_2aqrzy_k$ = function () {
|
|
659
|
+
return this.endDistanceM_1 - this.startDistanceM_1;
|
|
644
660
|
};
|
|
645
|
-
protoOf(ClimbPart).
|
|
646
|
-
return this.
|
|
661
|
+
protoOf(ClimbPart).get_elevationGainM_6kg9eu_k$ = function () {
|
|
662
|
+
return this.endElevationM_1 - this.startElevationM_1;
|
|
647
663
|
};
|
|
648
|
-
protoOf(ClimbPart).
|
|
649
|
-
return this.
|
|
664
|
+
protoOf(ClimbPart).get_grade_is33qm_k$ = function () {
|
|
665
|
+
return this.get_lengthM_2aqrzy_k$() === 0.0 ? 0.0 : this.get_elevationGainM_6kg9eu_k$() / this.get_lengthM_2aqrzy_k$();
|
|
650
666
|
};
|
|
651
667
|
protoOf(ClimbPart).toString = function () {
|
|
652
|
-
return 'ClimbPart(startDistanceM=' + this.
|
|
668
|
+
return 'ClimbPart(startDistanceM=' + this.startDistanceM_1 + ', endDistanceM=' + this.endDistanceM_1 + ', startElevationM=' + this.startElevationM_1 + ', endElevationM=' + this.endElevationM_1 + ')';
|
|
653
669
|
};
|
|
654
670
|
protoOf(ClimbPart).hashCode = function () {
|
|
655
|
-
var result = getNumberHashCode(this.
|
|
656
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
657
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
658
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
671
|
+
var result = getNumberHashCode(this.startDistanceM_1);
|
|
672
|
+
result = imul(result, 31) + getNumberHashCode(this.endDistanceM_1) | 0;
|
|
673
|
+
result = imul(result, 31) + getNumberHashCode(this.startElevationM_1) | 0;
|
|
674
|
+
result = imul(result, 31) + getNumberHashCode(this.endElevationM_1) | 0;
|
|
659
675
|
return result;
|
|
660
676
|
};
|
|
661
677
|
protoOf(ClimbPart).equals = function (other) {
|
|
@@ -663,19 +679,19 @@
|
|
|
663
679
|
return true;
|
|
664
680
|
if (!(other instanceof ClimbPart))
|
|
665
681
|
return false;
|
|
666
|
-
if (!equals(this.
|
|
682
|
+
if (!equals(this.startDistanceM_1, other.startDistanceM_1))
|
|
667
683
|
return false;
|
|
668
|
-
if (!equals(this.
|
|
684
|
+
if (!equals(this.endDistanceM_1, other.endDistanceM_1))
|
|
669
685
|
return false;
|
|
670
|
-
if (!equals(this.
|
|
686
|
+
if (!equals(this.startElevationM_1, other.startElevationM_1))
|
|
671
687
|
return false;
|
|
672
|
-
if (!equals(this.
|
|
688
|
+
if (!equals(this.endElevationM_1, other.endElevationM_1))
|
|
673
689
|
return false;
|
|
674
690
|
return true;
|
|
675
691
|
};
|
|
676
692
|
function Companion_3() {
|
|
677
693
|
Companion_instance_3 = this;
|
|
678
|
-
this.
|
|
694
|
+
this.DEFAULT_1 = new ClimbOptions();
|
|
679
695
|
}
|
|
680
696
|
var Companion_instance_3;
|
|
681
697
|
function Companion_getInstance_6() {
|
|
@@ -692,30 +708,30 @@
|
|
|
692
708
|
maxDiffRealGradeRatio = maxDiffRealGradeRatio === VOID ? 1.3 : maxDiffRealGradeRatio;
|
|
693
709
|
booster = booster === VOID ? 1.3 : booster;
|
|
694
710
|
maxAnalysisPoints = maxAnalysisPoints === VOID ? 3000 : maxAnalysisPoints;
|
|
695
|
-
this.
|
|
696
|
-
this.
|
|
697
|
-
this.
|
|
698
|
-
this.
|
|
699
|
-
this.
|
|
700
|
-
this.
|
|
701
|
-
this.
|
|
711
|
+
this.minMinClimbElevationM_1 = minMinClimbElevationM;
|
|
712
|
+
this.maxMinClimbElevationM_1 = maxMinClimbElevationM;
|
|
713
|
+
this.minClimbElevationRatio_1 = minClimbElevationRatio;
|
|
714
|
+
this.minGradePercent_1 = minGradePercent;
|
|
715
|
+
this.maxDiffRealGradeRatio_1 = maxDiffRealGradeRatio;
|
|
716
|
+
this.booster_1 = booster;
|
|
717
|
+
this.maxAnalysisPoints_1 = maxAnalysisPoints;
|
|
702
718
|
// Inline function 'kotlin.require' call
|
|
703
|
-
if (!(this.
|
|
719
|
+
if (!(this.maxAnalysisPoints_1 >= 2)) {
|
|
704
720
|
var message = 'maxAnalysisPoints must be at least 2';
|
|
705
721
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
706
722
|
}
|
|
707
723
|
}
|
|
708
724
|
protoOf(ClimbOptions).toString = function () {
|
|
709
|
-
return 'ClimbOptions(minMinClimbElevationM=' + this.
|
|
725
|
+
return 'ClimbOptions(minMinClimbElevationM=' + this.minMinClimbElevationM_1 + ', maxMinClimbElevationM=' + this.maxMinClimbElevationM_1 + ', minClimbElevationRatio=' + this.minClimbElevationRatio_1 + ', minGradePercent=' + this.minGradePercent_1 + ', maxDiffRealGradeRatio=' + this.maxDiffRealGradeRatio_1 + ', booster=' + this.booster_1 + ', maxAnalysisPoints=' + this.maxAnalysisPoints_1 + ')';
|
|
710
726
|
};
|
|
711
727
|
protoOf(ClimbOptions).hashCode = function () {
|
|
712
|
-
var result = getNumberHashCode(this.
|
|
713
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
714
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
715
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
716
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
717
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
718
|
-
result = imul(result, 31) + this.
|
|
728
|
+
var result = getNumberHashCode(this.minMinClimbElevationM_1);
|
|
729
|
+
result = imul(result, 31) + getNumberHashCode(this.maxMinClimbElevationM_1) | 0;
|
|
730
|
+
result = imul(result, 31) + getNumberHashCode(this.minClimbElevationRatio_1) | 0;
|
|
731
|
+
result = imul(result, 31) + getNumberHashCode(this.minGradePercent_1) | 0;
|
|
732
|
+
result = imul(result, 31) + getNumberHashCode(this.maxDiffRealGradeRatio_1) | 0;
|
|
733
|
+
result = imul(result, 31) + getNumberHashCode(this.booster_1) | 0;
|
|
734
|
+
result = imul(result, 31) + this.maxAnalysisPoints_1 | 0;
|
|
719
735
|
return result;
|
|
720
736
|
};
|
|
721
737
|
protoOf(ClimbOptions).equals = function (other) {
|
|
@@ -723,29 +739,29 @@
|
|
|
723
739
|
return true;
|
|
724
740
|
if (!(other instanceof ClimbOptions))
|
|
725
741
|
return false;
|
|
726
|
-
if (!equals(this.
|
|
742
|
+
if (!equals(this.minMinClimbElevationM_1, other.minMinClimbElevationM_1))
|
|
727
743
|
return false;
|
|
728
|
-
if (!equals(this.
|
|
744
|
+
if (!equals(this.maxMinClimbElevationM_1, other.maxMinClimbElevationM_1))
|
|
729
745
|
return false;
|
|
730
|
-
if (!equals(this.
|
|
746
|
+
if (!equals(this.minClimbElevationRatio_1, other.minClimbElevationRatio_1))
|
|
731
747
|
return false;
|
|
732
|
-
if (!equals(this.
|
|
748
|
+
if (!equals(this.minGradePercent_1, other.minGradePercent_1))
|
|
733
749
|
return false;
|
|
734
|
-
if (!equals(this.
|
|
750
|
+
if (!equals(this.maxDiffRealGradeRatio_1, other.maxDiffRealGradeRatio_1))
|
|
735
751
|
return false;
|
|
736
|
-
if (!equals(this.
|
|
752
|
+
if (!equals(this.booster_1, other.booster_1))
|
|
737
753
|
return false;
|
|
738
|
-
if (!(this.
|
|
754
|
+
if (!(this.maxAnalysisPoints_1 === other.maxAnalysisPoints_1))
|
|
739
755
|
return false;
|
|
740
756
|
return true;
|
|
741
757
|
};
|
|
742
758
|
function Companion_4() {
|
|
743
759
|
}
|
|
744
|
-
protoOf(Companion_4).
|
|
760
|
+
protoOf(Companion_4).of_tmvbpf_k$ = function (path, maxPoints) {
|
|
745
761
|
var tmp;
|
|
746
|
-
if (path.
|
|
762
|
+
if (path.size_1 <= maxPoints) {
|
|
747
763
|
var tmp_0 = 0;
|
|
748
|
-
var tmp_1 = path.
|
|
764
|
+
var tmp_1 = path.size_1;
|
|
749
765
|
var tmp_2 = new Int32Array(tmp_1);
|
|
750
766
|
while (tmp_0 < tmp_1) {
|
|
751
767
|
var tmp_3 = tmp_0;
|
|
@@ -754,15 +770,15 @@
|
|
|
754
770
|
}
|
|
755
771
|
tmp = tmp_2;
|
|
756
772
|
} else {
|
|
757
|
-
var stride = ((path.
|
|
773
|
+
var stride = ((path.size_1 + maxPoints | 0) - 1 | 0) / maxPoints | 0;
|
|
758
774
|
var kept = ArrayList_init_$Create$_0(maxPoints + 1 | 0);
|
|
759
775
|
var i = 0;
|
|
760
|
-
while (i < path.
|
|
761
|
-
kept.
|
|
776
|
+
while (i < path.size_1) {
|
|
777
|
+
kept.add_utx5q5_k$(i);
|
|
762
778
|
i = i + stride | 0;
|
|
763
779
|
}
|
|
764
|
-
if (!(last(kept) === (path.
|
|
765
|
-
kept.
|
|
780
|
+
if (!(last(kept) === (path.size_1 - 1 | 0))) {
|
|
781
|
+
kept.add_utx5q5_k$(path.size_1 - 1 | 0);
|
|
766
782
|
}
|
|
767
783
|
tmp = toIntArray(kept);
|
|
768
784
|
}
|
|
@@ -772,7 +788,7 @@
|
|
|
772
788
|
var tmp_6 = new Float64Array(tmp_5);
|
|
773
789
|
while (tmp_4 < tmp_5) {
|
|
774
790
|
var tmp_7 = tmp_4;
|
|
775
|
-
tmp_6[tmp_7] = path.
|
|
791
|
+
tmp_6[tmp_7] = path.distance_5s4s77_k$(indices[tmp_7]);
|
|
776
792
|
tmp_4 = tmp_4 + 1 | 0;
|
|
777
793
|
}
|
|
778
794
|
var tmp_8 = 0;
|
|
@@ -780,7 +796,7 @@
|
|
|
780
796
|
var tmp_10 = new Float64Array(tmp_9);
|
|
781
797
|
while (tmp_8 < tmp_9) {
|
|
782
798
|
var tmp_11 = tmp_8;
|
|
783
|
-
tmp_10[tmp_11] = path.
|
|
799
|
+
tmp_10[tmp_11] = path.elevation_iziwkb_k$(indices[tmp_11]);
|
|
784
800
|
tmp_8 = tmp_8 + 1 | 0;
|
|
785
801
|
}
|
|
786
802
|
return new Profile(tmp_6, tmp_10, indices);
|
|
@@ -790,33 +806,33 @@
|
|
|
790
806
|
return Companion_instance_4;
|
|
791
807
|
}
|
|
792
808
|
function Profile(distance, elevation, sourceIndex) {
|
|
793
|
-
this.
|
|
794
|
-
this.
|
|
795
|
-
this.
|
|
809
|
+
this.distance_1 = distance;
|
|
810
|
+
this.elevation_1 = elevation;
|
|
811
|
+
this.sourceIndex_1 = sourceIndex;
|
|
796
812
|
}
|
|
797
|
-
protoOf(Profile).
|
|
798
|
-
return this.
|
|
813
|
+
protoOf(Profile).get_size_woubt6_k$ = function () {
|
|
814
|
+
return this.distance_1.length;
|
|
799
815
|
};
|
|
800
816
|
function bestCandidateFrom($this, profile, i, minClimbElevation, options) {
|
|
801
|
-
var startDist = profile.
|
|
802
|
-
var startEle = profile.
|
|
817
|
+
var startDist = profile.distance_1[i];
|
|
818
|
+
var startEle = profile.elevation_1[i];
|
|
803
819
|
var positiveElevation = 0.0;
|
|
804
820
|
var negativeElevation = 0.0;
|
|
805
821
|
var distClimbing = 0.0;
|
|
806
822
|
var bestScore = 0.0;
|
|
807
823
|
var best = null;
|
|
808
824
|
var inductionVariable = i + 1 | 0;
|
|
809
|
-
var last = profile.
|
|
825
|
+
var last = profile.get_size_woubt6_k$();
|
|
810
826
|
if (inductionVariable < last)
|
|
811
827
|
$l$loop: do {
|
|
812
828
|
var j = inductionVariable;
|
|
813
829
|
inductionVariable = inductionVariable + 1 | 0;
|
|
814
|
-
var endDist = profile.
|
|
815
|
-
var endEle = profile.
|
|
816
|
-
var dEle = endEle - profile.
|
|
830
|
+
var endDist = profile.distance_1[j];
|
|
831
|
+
var endEle = profile.elevation_1[j];
|
|
832
|
+
var dEle = endEle - profile.elevation_1[j - 1 | 0];
|
|
817
833
|
if (dEle > 0) {
|
|
818
834
|
positiveElevation = positiveElevation + dEle;
|
|
819
|
-
distClimbing = distClimbing + (endDist - profile.
|
|
835
|
+
distClimbing = distClimbing + (endDist - profile.distance_1[j - 1 | 0]);
|
|
820
836
|
} else {
|
|
821
837
|
negativeElevation = negativeElevation + dEle;
|
|
822
838
|
}
|
|
@@ -827,9 +843,9 @@
|
|
|
827
843
|
var gradePercent = 100.0 * netElevation / length;
|
|
828
844
|
var climbingGradePercent = distClimbing > 0 ? 100.0 * positiveElevation / distClimbing : 0.0;
|
|
829
845
|
// Inline function 'kotlin.math.pow' call
|
|
830
|
-
var x = options.
|
|
846
|
+
var x = options.booster_1;
|
|
831
847
|
var score = length * Math.pow(gradePercent, x);
|
|
832
|
-
var qualifies = gradePercent >= options.
|
|
848
|
+
var qualifies = gradePercent >= options.minGradePercent_1 && netElevation >= minClimbElevation && score >= bestScore && climbingGradePercent / gradePercent <= options.maxDiffRealGradeRatio_1;
|
|
833
849
|
if (qualifies) {
|
|
834
850
|
bestScore = score;
|
|
835
851
|
best = new Candidate(i, j, score, positiveElevation, negativeElevation);
|
|
@@ -849,60 +865,60 @@
|
|
|
849
865
|
var kept = ArrayList_init_$Create$();
|
|
850
866
|
$l$loop: while (true) {
|
|
851
867
|
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
852
|
-
if (!!remaining.
|
|
868
|
+
if (!!remaining.isEmpty_y1axqb_k$()) {
|
|
853
869
|
break $l$loop;
|
|
854
870
|
}
|
|
855
871
|
var best = first(remaining);
|
|
856
|
-
kept.
|
|
872
|
+
kept.add_utx5q5_k$(best);
|
|
857
873
|
removeAll(remaining, ClimbDetector$dedupeByScore$lambda_0(best));
|
|
858
874
|
}
|
|
859
875
|
return kept;
|
|
860
876
|
}
|
|
861
877
|
function toClimb($this, $receiver, path, profile) {
|
|
862
|
-
return new Climb(profile.
|
|
878
|
+
return new Climb(profile.sourceIndex_1[$receiver.startIndex_1], profile.sourceIndex_1[$receiver.endIndex_1], profile.distance_1[$receiver.startIndex_1], profile.distance_1[$receiver.endIndex_1], profile.elevation_1[$receiver.startIndex_1], profile.elevation_1[$receiver.endIndex_1], $receiver.positiveElevationM_1, $receiver.negativeElevationM_1, splitIntoParts($this, profile, $receiver.startIndex_1, $receiver.endIndex_1));
|
|
863
879
|
}
|
|
864
880
|
function splitIntoParts($this, profile, startIndex, endIndex) {
|
|
865
881
|
// Inline function 'kotlin.collections.map' call
|
|
866
882
|
var this_0 = numberRangeToNumber(startIndex, endIndex);
|
|
867
883
|
// Inline function 'kotlin.collections.mapTo' call
|
|
868
884
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
869
|
-
var inductionVariable = this_0.
|
|
870
|
-
var last = this_0.
|
|
885
|
+
var inductionVariable = this_0.first_1;
|
|
886
|
+
var last = this_0.last_1;
|
|
871
887
|
if (inductionVariable <= last)
|
|
872
888
|
do {
|
|
873
889
|
var item = inductionVariable;
|
|
874
890
|
inductionVariable = inductionVariable + 1 | 0;
|
|
875
891
|
var i = item;
|
|
876
|
-
var tmp$ret$2 = new Vector3D(profile.
|
|
877
|
-
destination.
|
|
892
|
+
var tmp$ret$2 = new Vector3D(profile.distance_1[i], profile.elevation_1[i], 0.0);
|
|
893
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
878
894
|
}
|
|
879
895
|
while (!(item === last));
|
|
880
896
|
var points = destination;
|
|
881
|
-
if (points.
|
|
897
|
+
if (points.get_size_woubt6_k$() < 2)
|
|
882
898
|
return emptyList();
|
|
883
|
-
var elevationGain = profile.
|
|
899
|
+
var elevationGain = profile.elevation_1[endIndex] - profile.elevation_1[startIndex];
|
|
884
900
|
var tolerance = coerceIn(elevationGain / 50.0, 10.0, 50.0);
|
|
885
|
-
var keptIndices = DouglasPeucker_instance.
|
|
901
|
+
var keptIndices = DouglasPeucker_instance.simplifyIndices_1yk9dd_k$(points, tolerance);
|
|
886
902
|
var tmp$ret$3;
|
|
887
903
|
$l$block: {
|
|
888
904
|
// Inline function 'kotlin.collections.zipWithNext' call
|
|
889
|
-
var iterator = keptIndices.
|
|
890
|
-
if (!iterator.
|
|
905
|
+
var iterator = keptIndices.iterator_jk1svi_k$();
|
|
906
|
+
if (!iterator.hasNext_bitz1p_k$()) {
|
|
891
907
|
tmp$ret$3 = emptyList();
|
|
892
908
|
break $l$block;
|
|
893
909
|
}
|
|
894
910
|
// Inline function 'kotlin.collections.mutableListOf' call
|
|
895
911
|
var result = ArrayList_init_$Create$();
|
|
896
|
-
var current = iterator.
|
|
897
|
-
while (iterator.
|
|
898
|
-
var next = iterator.
|
|
912
|
+
var current = iterator.next_20eer_k$();
|
|
913
|
+
while (iterator.hasNext_bitz1p_k$()) {
|
|
914
|
+
var next = iterator.next_20eer_k$();
|
|
899
915
|
var a = current;
|
|
900
|
-
var tmp0_startDistanceM = points.
|
|
901
|
-
var tmp1_startElevationM = points.
|
|
902
|
-
var tmp2_endDistanceM = points.
|
|
903
|
-
var tmp3_endElevationM = points.
|
|
916
|
+
var tmp0_startDistanceM = points.get_c1px32_k$(a).x_1;
|
|
917
|
+
var tmp1_startElevationM = points.get_c1px32_k$(a).y_1;
|
|
918
|
+
var tmp2_endDistanceM = points.get_c1px32_k$(next).x_1;
|
|
919
|
+
var tmp3_endElevationM = points.get_c1px32_k$(next).y_1;
|
|
904
920
|
var tmp$ret$5 = new ClimbPart(tmp0_startDistanceM, tmp2_endDistanceM, tmp1_startElevationM, tmp3_endElevationM);
|
|
905
|
-
result.
|
|
921
|
+
result.add_utx5q5_k$(tmp$ret$5);
|
|
906
922
|
current = next;
|
|
907
923
|
}
|
|
908
924
|
tmp$ret$3 = result;
|
|
@@ -910,24 +926,24 @@
|
|
|
910
926
|
return tmp$ret$3;
|
|
911
927
|
}
|
|
912
928
|
function Candidate(startIndex, endIndex, score, positiveElevationM, negativeElevationM) {
|
|
913
|
-
this.
|
|
914
|
-
this.
|
|
915
|
-
this.
|
|
916
|
-
this.
|
|
917
|
-
this.
|
|
929
|
+
this.startIndex_1 = startIndex;
|
|
930
|
+
this.endIndex_1 = endIndex;
|
|
931
|
+
this.score_1 = score;
|
|
932
|
+
this.positiveElevationM_1 = positiveElevationM;
|
|
933
|
+
this.negativeElevationM_1 = negativeElevationM;
|
|
918
934
|
}
|
|
919
|
-
protoOf(Candidate).
|
|
920
|
-
return other.
|
|
935
|
+
protoOf(Candidate).overlaps_wp0rru_k$ = function (other) {
|
|
936
|
+
return other.startIndex_1 <= this.startIndex_1 && this.startIndex_1 <= other.endIndex_1 || (other.startIndex_1 <= this.endIndex_1 && this.endIndex_1 <= other.endIndex_1) || (this.startIndex_1 <= other.startIndex_1 && other.endIndex_1 <= this.endIndex_1);
|
|
921
937
|
};
|
|
922
938
|
protoOf(Candidate).toString = function () {
|
|
923
|
-
return 'Candidate(startIndex=' + this.
|
|
939
|
+
return 'Candidate(startIndex=' + this.startIndex_1 + ', endIndex=' + this.endIndex_1 + ', score=' + this.score_1 + ', positiveElevationM=' + this.positiveElevationM_1 + ', negativeElevationM=' + this.negativeElevationM_1 + ')';
|
|
924
940
|
};
|
|
925
941
|
protoOf(Candidate).hashCode = function () {
|
|
926
|
-
var result = this.
|
|
927
|
-
result = imul(result, 31) + this.
|
|
928
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
929
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
930
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
942
|
+
var result = this.startIndex_1;
|
|
943
|
+
result = imul(result, 31) + this.endIndex_1 | 0;
|
|
944
|
+
result = imul(result, 31) + getNumberHashCode(this.score_1) | 0;
|
|
945
|
+
result = imul(result, 31) + getNumberHashCode(this.positiveElevationM_1) | 0;
|
|
946
|
+
result = imul(result, 31) + getNumberHashCode(this.negativeElevationM_1) | 0;
|
|
931
947
|
return result;
|
|
932
948
|
};
|
|
933
949
|
protoOf(Candidate).equals = function (other) {
|
|
@@ -935,36 +951,36 @@
|
|
|
935
951
|
return true;
|
|
936
952
|
if (!(other instanceof Candidate))
|
|
937
953
|
return false;
|
|
938
|
-
if (!(this.
|
|
954
|
+
if (!(this.startIndex_1 === other.startIndex_1))
|
|
939
955
|
return false;
|
|
940
|
-
if (!(this.
|
|
956
|
+
if (!(this.endIndex_1 === other.endIndex_1))
|
|
941
957
|
return false;
|
|
942
|
-
if (!equals(this.
|
|
958
|
+
if (!equals(this.score_1, other.score_1))
|
|
943
959
|
return false;
|
|
944
|
-
if (!equals(this.
|
|
960
|
+
if (!equals(this.positiveElevationM_1, other.positiveElevationM_1))
|
|
945
961
|
return false;
|
|
946
|
-
if (!equals(this.
|
|
962
|
+
if (!equals(this.negativeElevationM_1, other.negativeElevationM_1))
|
|
947
963
|
return false;
|
|
948
964
|
return true;
|
|
949
965
|
};
|
|
950
966
|
function sam$kotlin_Comparator$0(function_0) {
|
|
951
|
-
this.
|
|
967
|
+
this.function_1 = function_0;
|
|
952
968
|
}
|
|
953
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
954
|
-
return this.
|
|
969
|
+
protoOf(sam$kotlin_Comparator$0).compare_bczr_k$ = function (a, b) {
|
|
970
|
+
return this.function_1(a, b);
|
|
955
971
|
};
|
|
956
972
|
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
957
|
-
return this.
|
|
973
|
+
return this.compare_bczr_k$(a, b);
|
|
958
974
|
};
|
|
959
|
-
protoOf(sam$kotlin_Comparator$0).
|
|
960
|
-
return this.
|
|
975
|
+
protoOf(sam$kotlin_Comparator$0).getFunctionDelegate_jtodtf_k$ = function () {
|
|
976
|
+
return this.function_1;
|
|
961
977
|
};
|
|
962
978
|
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
963
979
|
var tmp;
|
|
964
980
|
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
965
981
|
var tmp_0;
|
|
966
982
|
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
967
|
-
tmp_0 = equals(this.
|
|
983
|
+
tmp_0 = equals(this.getFunctionDelegate_jtodtf_k$(), other.getFunctionDelegate_jtodtf_k$());
|
|
968
984
|
} else {
|
|
969
985
|
tmp_0 = false;
|
|
970
986
|
}
|
|
@@ -975,26 +991,26 @@
|
|
|
975
991
|
return tmp;
|
|
976
992
|
};
|
|
977
993
|
protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
978
|
-
return hashCode(this.
|
|
994
|
+
return hashCode(this.getFunctionDelegate_jtodtf_k$());
|
|
979
995
|
};
|
|
980
996
|
function sam$kotlin_Comparator$0_0(function_0) {
|
|
981
|
-
this.
|
|
997
|
+
this.function_1 = function_0;
|
|
982
998
|
}
|
|
983
|
-
protoOf(sam$kotlin_Comparator$0_0).
|
|
984
|
-
return this.
|
|
999
|
+
protoOf(sam$kotlin_Comparator$0_0).compare_bczr_k$ = function (a, b) {
|
|
1000
|
+
return this.function_1(a, b);
|
|
985
1001
|
};
|
|
986
1002
|
protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
|
|
987
|
-
return this.
|
|
1003
|
+
return this.compare_bczr_k$(a, b);
|
|
988
1004
|
};
|
|
989
|
-
protoOf(sam$kotlin_Comparator$0_0).
|
|
990
|
-
return this.
|
|
1005
|
+
protoOf(sam$kotlin_Comparator$0_0).getFunctionDelegate_jtodtf_k$ = function () {
|
|
1006
|
+
return this.function_1;
|
|
991
1007
|
};
|
|
992
1008
|
protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
993
1009
|
var tmp;
|
|
994
1010
|
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
995
1011
|
var tmp_0;
|
|
996
1012
|
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
997
|
-
tmp_0 = equals(this.
|
|
1013
|
+
tmp_0 = equals(this.getFunctionDelegate_jtodtf_k$(), other.getFunctionDelegate_jtodtf_k$());
|
|
998
1014
|
} else {
|
|
999
1015
|
tmp_0 = false;
|
|
1000
1016
|
}
|
|
@@ -1005,49 +1021,49 @@
|
|
|
1005
1021
|
return tmp;
|
|
1006
1022
|
};
|
|
1007
1023
|
protoOf(sam$kotlin_Comparator$0_0).hashCode = function () {
|
|
1008
|
-
return hashCode(this.
|
|
1024
|
+
return hashCode(this.getFunctionDelegate_jtodtf_k$());
|
|
1009
1025
|
};
|
|
1010
1026
|
function ClimbDetector$detect$lambda(a, b) {
|
|
1011
1027
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
1012
|
-
var tmp = a.
|
|
1013
|
-
var tmp$ret$2 = b.
|
|
1028
|
+
var tmp = a.startIndex_1;
|
|
1029
|
+
var tmp$ret$2 = b.startIndex_1;
|
|
1014
1030
|
return compareValues(tmp, tmp$ret$2);
|
|
1015
1031
|
}
|
|
1016
1032
|
function ClimbDetector$dedupeByScore$lambda(a, b) {
|
|
1017
1033
|
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
1018
|
-
var tmp = b.
|
|
1019
|
-
var tmp$ret$2 = a.
|
|
1034
|
+
var tmp = b.score_1;
|
|
1035
|
+
var tmp$ret$2 = a.score_1;
|
|
1020
1036
|
return compareValues(tmp, tmp$ret$2);
|
|
1021
1037
|
}
|
|
1022
1038
|
function ClimbDetector$dedupeByScore$lambda_0($best) {
|
|
1023
1039
|
return function (it) {
|
|
1024
|
-
return it.
|
|
1040
|
+
return it.overlaps_wp0rru_k$($best);
|
|
1025
1041
|
};
|
|
1026
1042
|
}
|
|
1027
1043
|
function ClimbDetector() {
|
|
1028
|
-
this.
|
|
1029
|
-
this.
|
|
1030
|
-
this.
|
|
1031
|
-
this.
|
|
1044
|
+
this.MIN_CANDIDATE_LENGTH_M_1 = 10.0;
|
|
1045
|
+
this.MIN_PART_TOLERANCE_M_1 = 10.0;
|
|
1046
|
+
this.MAX_PART_TOLERANCE_M_1 = 50.0;
|
|
1047
|
+
this.PART_TOLERANCE_DIVISOR_1 = 50.0;
|
|
1032
1048
|
}
|
|
1033
|
-
protoOf(ClimbDetector).
|
|
1034
|
-
if (path.
|
|
1049
|
+
protoOf(ClimbDetector).detect_llooq2_k$ = function (path, options) {
|
|
1050
|
+
if (path.size_1 < 2)
|
|
1035
1051
|
return emptyList();
|
|
1036
|
-
var tmp0 = options.
|
|
1037
|
-
var tmp0_0 = options.
|
|
1052
|
+
var tmp0 = options.minMinClimbElevationM_1;
|
|
1053
|
+
var tmp0_0 = options.maxMinClimbElevationM_1;
|
|
1038
1054
|
// Inline function 'kotlin.comparisons.minOf' call
|
|
1039
|
-
var b = path.
|
|
1055
|
+
var b = path.elevationGain_1 / options.minClimbElevationRatio_1;
|
|
1040
1056
|
// Inline function 'kotlin.comparisons.maxOf' call
|
|
1041
1057
|
var b_0 = Math.min(tmp0_0, b);
|
|
1042
1058
|
var minClimbElevation = Math.max(tmp0, b_0);
|
|
1043
|
-
var profile = Companion_instance_4.
|
|
1059
|
+
var profile = Companion_instance_4.of_tmvbpf_k$(path, options.maxAnalysisPoints_1);
|
|
1044
1060
|
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1045
|
-
var tmp0_1 = until(0, profile.
|
|
1061
|
+
var tmp0_1 = until(0, profile.get_size_woubt6_k$());
|
|
1046
1062
|
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1047
1063
|
var destination = ArrayList_init_$Create$();
|
|
1048
1064
|
// Inline function 'kotlin.collections.forEach' call
|
|
1049
|
-
var inductionVariable = tmp0_1.
|
|
1050
|
-
var last = tmp0_1.
|
|
1065
|
+
var inductionVariable = tmp0_1.first_1;
|
|
1066
|
+
var last = tmp0_1.last_1;
|
|
1051
1067
|
if (inductionVariable <= last)
|
|
1052
1068
|
do {
|
|
1053
1069
|
var element = inductionVariable;
|
|
@@ -1058,7 +1074,7 @@
|
|
|
1058
1074
|
null;
|
|
1059
1075
|
else {
|
|
1060
1076
|
// Inline function 'kotlin.let' call
|
|
1061
|
-
destination.
|
|
1077
|
+
destination.add_utx5q5_k$(tmp0_safe_receiver);
|
|
1062
1078
|
}
|
|
1063
1079
|
}
|
|
1064
1080
|
while (!(element === last));
|
|
@@ -1072,17 +1088,17 @@
|
|
|
1072
1088
|
var this_1 = sortedWith(this_0, tmp$ret$10);
|
|
1073
1089
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1074
1090
|
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1075
|
-
var _iterator__ex2g4s = this_1.
|
|
1076
|
-
while (_iterator__ex2g4s.
|
|
1077
|
-
var item = _iterator__ex2g4s.
|
|
1091
|
+
var _iterator__ex2g4s = this_1.iterator_jk1svi_k$();
|
|
1092
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1093
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
1078
1094
|
var tmp$ret$13 = toClimb(ClimbDetector_instance, item, path, profile);
|
|
1079
|
-
destination_0.
|
|
1095
|
+
destination_0.add_utx5q5_k$(tmp$ret$13);
|
|
1080
1096
|
}
|
|
1081
1097
|
return destination_0;
|
|
1082
1098
|
};
|
|
1083
|
-
protoOf(ClimbDetector).
|
|
1084
|
-
options = options === VOID ? Companion_getInstance_6().
|
|
1085
|
-
return $super === VOID ? this.
|
|
1099
|
+
protoOf(ClimbDetector).detect$default_6ml3ny_k$ = function (path, options, $super) {
|
|
1100
|
+
options = options === VOID ? Companion_getInstance_6().DEFAULT_1 : options;
|
|
1101
|
+
return $super === VOID ? this.detect_llooq2_k$(path, options) : $super.detect_llooq2_k$.call(this, path, options);
|
|
1086
1102
|
};
|
|
1087
1103
|
var ClimbDetector_instance;
|
|
1088
1104
|
function ClimbDetector_getInstance() {
|
|
@@ -1092,9 +1108,9 @@
|
|
|
1092
1108
|
var sumX = 0.0;
|
|
1093
1109
|
var sumY = 0.0;
|
|
1094
1110
|
var contributing = 0;
|
|
1095
|
-
var _iterator__ex2g4s = _this__u8e3s4.
|
|
1096
|
-
$l$loop: while (_iterator__ex2g4s.
|
|
1097
|
-
var path = _iterator__ex2g4s.
|
|
1111
|
+
var _iterator__ex2g4s = _this__u8e3s4.iterator_jk1svi_k$();
|
|
1112
|
+
$l$loop: while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1113
|
+
var path = _iterator__ex2g4s.next_20eer_k$();
|
|
1098
1114
|
var tmp0_elvis_lhs = meanDirectionFromStart(path);
|
|
1099
1115
|
var tmp;
|
|
1100
1116
|
if (tmp0_elvis_lhs == null) {
|
|
@@ -1103,8 +1119,8 @@
|
|
|
1103
1119
|
tmp = tmp0_elvis_lhs;
|
|
1104
1120
|
}
|
|
1105
1121
|
var mean = tmp;
|
|
1106
|
-
sumX = sumX + mean.
|
|
1107
|
-
sumY = sumY + mean.
|
|
1122
|
+
sumX = sumX + mean.first_1;
|
|
1123
|
+
sumY = sumY + mean.second_1;
|
|
1108
1124
|
contributing = contributing + 1 | 0;
|
|
1109
1125
|
}
|
|
1110
1126
|
if (contributing === 0)
|
|
@@ -1118,22 +1134,22 @@
|
|
|
1118
1134
|
return new Vector3D(-sumX / magnitude, -sumY / magnitude, 0.0);
|
|
1119
1135
|
}
|
|
1120
1136
|
function meanDirectionFromStart(_this__u8e3s4) {
|
|
1121
|
-
if (_this__u8e3s4.
|
|
1137
|
+
if (_this__u8e3s4.size_1 <= 3)
|
|
1122
1138
|
return null;
|
|
1123
|
-
var lat0 = _this__u8e3s4.
|
|
1124
|
-
var lon0 = _this__u8e3s4.
|
|
1139
|
+
var lat0 = _this__u8e3s4.latitude_gb4iok_k$(0);
|
|
1140
|
+
var lon0 = _this__u8e3s4.longitude_a9xl_k$(0);
|
|
1125
1141
|
// Inline function 'kotlin.math.cos' call
|
|
1126
1142
|
var cosLat0 = Math.cos(lat0);
|
|
1127
1143
|
var sumX = 0.0;
|
|
1128
1144
|
var sumY = 0.0;
|
|
1129
1145
|
var inductionVariable = 1;
|
|
1130
|
-
var last = _this__u8e3s4.
|
|
1146
|
+
var last = _this__u8e3s4.size_1;
|
|
1131
1147
|
if (inductionVariable < last)
|
|
1132
1148
|
$l$loop: do {
|
|
1133
1149
|
var i = inductionVariable;
|
|
1134
1150
|
inductionVariable = inductionVariable + 1 | 0;
|
|
1135
|
-
var dx = (_this__u8e3s4.
|
|
1136
|
-
var dy = _this__u8e3s4.
|
|
1151
|
+
var dx = (_this__u8e3s4.longitude_a9xl_k$(i) - lon0) * cosLat0;
|
|
1152
|
+
var dy = _this__u8e3s4.latitude_gb4iok_k$(i) - lat0;
|
|
1137
1153
|
// Inline function 'kotlin.math.hypot' call
|
|
1138
1154
|
var length = hypot(dx, dy);
|
|
1139
1155
|
if (length < 1.0E-12)
|
|
@@ -1142,7 +1158,7 @@
|
|
|
1142
1158
|
sumY = sumY + dy / length;
|
|
1143
1159
|
}
|
|
1144
1160
|
while (inductionVariable < last);
|
|
1145
|
-
var n = _this__u8e3s4.
|
|
1161
|
+
var n = _this__u8e3s4.size_1 - 1 | 0;
|
|
1146
1162
|
return new Pair(sumX / n, sumY / n);
|
|
1147
1163
|
}
|
|
1148
1164
|
function dominantHeadwindAzimuthDeg(_this__u8e3s4) {
|
|
@@ -1157,9 +1173,9 @@
|
|
|
1157
1173
|
tmp = tmp0_elvis_lhs;
|
|
1158
1174
|
}
|
|
1159
1175
|
var direction = tmp;
|
|
1160
|
-
var tmp0 = direction.
|
|
1176
|
+
var tmp0 = direction.x_1;
|
|
1161
1177
|
// Inline function 'kotlin.math.atan2' call
|
|
1162
|
-
var x = direction.
|
|
1178
|
+
var x = direction.y_1;
|
|
1163
1179
|
// Inline function 'kotlin.mod' call
|
|
1164
1180
|
var r = Math.atan2(tmp0, x) * 57.29577951308232 % 360.0;
|
|
1165
1181
|
var tmp_0;
|
|
@@ -1180,15 +1196,15 @@
|
|
|
1180
1196
|
return tmp_0;
|
|
1181
1197
|
}
|
|
1182
1198
|
function computeWithWind($this, path, i, aeroCoef, wind) {
|
|
1183
|
-
var speed = path.
|
|
1184
|
-
var bearing = path.
|
|
1185
|
-
path.
|
|
1186
|
-
path.
|
|
1187
|
-
var windDirectionAsBearing = 3.141592653589793 / 2.0 - wind.
|
|
1188
|
-
path.
|
|
1199
|
+
var speed = path.speed_npav2n_k$(i);
|
|
1200
|
+
var bearing = path.bearing_fz5vxm_k$(i);
|
|
1201
|
+
path.setWindSpeed_ggaslh_k$(i, wind.speedMS_1);
|
|
1202
|
+
path.setWindDirection_86vnxv_k$(i, wind.directionRad_1);
|
|
1203
|
+
var windDirectionAsBearing = 3.141592653589793 / 2.0 - wind.directionRad_1;
|
|
1204
|
+
path.setWindBearing_44dbry_k$(i, windDirectionAsBearing);
|
|
1189
1205
|
var alpha = windDirectionAsBearing - bearing;
|
|
1190
|
-
path.
|
|
1191
|
-
var v = wind.
|
|
1206
|
+
path.setWindAlpha_xkbtf2_k$(i, alpha);
|
|
1207
|
+
var v = wind.speedMS_1;
|
|
1192
1208
|
// Inline function 'kotlin.math.cos' call
|
|
1193
1209
|
var l1 = speed + v * Math.cos(alpha);
|
|
1194
1210
|
var l2 = l1 * l1;
|
|
@@ -1203,21 +1219,21 @@
|
|
|
1203
1219
|
return tmp_1 * Math.sqrt(l3) * l1 * speed;
|
|
1204
1220
|
}
|
|
1205
1221
|
function AeroPowerProvider() {
|
|
1206
|
-
this.
|
|
1222
|
+
this.MU_1 = 1.2;
|
|
1207
1223
|
}
|
|
1208
|
-
protoOf(AeroPowerProvider).
|
|
1209
|
-
var aeroCoef = course.
|
|
1210
|
-
path.
|
|
1211
|
-
var wind = course.
|
|
1224
|
+
protoOf(AeroPowerProvider).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
|
|
1225
|
+
var aeroCoef = course.aeroProvider_1.aeroCoef_5n4cco_k$(course, path, pointIndex);
|
|
1226
|
+
path.setAeroCoef_tmjifm_k$(pointIndex, aeroCoef);
|
|
1227
|
+
var wind = course.windProvider_1.wind_umf2tf_k$(course.course_1, path, pointIndex);
|
|
1212
1228
|
var tmp;
|
|
1213
|
-
if (wind.
|
|
1214
|
-
var v = path.
|
|
1229
|
+
if (wind.speedMS_1 === 0.0) {
|
|
1230
|
+
var v = path.speed_npav2n_k$(pointIndex);
|
|
1215
1231
|
tmp = -aeroCoef * v * v * v;
|
|
1216
1232
|
} else {
|
|
1217
1233
|
tmp = computeWithWind(this, path, pointIndex, aeroCoef, wind);
|
|
1218
1234
|
}
|
|
1219
1235
|
var pAir = tmp;
|
|
1220
|
-
path.
|
|
1236
|
+
path.setPAero_mmc4mr_k$(pointIndex, pAir);
|
|
1221
1237
|
return pAir;
|
|
1222
1238
|
};
|
|
1223
1239
|
var AeroPowerProvider_instance;
|
|
@@ -1226,17 +1242,17 @@
|
|
|
1226
1242
|
}
|
|
1227
1243
|
function AeroProviderConstant() {
|
|
1228
1244
|
}
|
|
1229
|
-
protoOf(AeroProviderConstant).
|
|
1230
|
-
var rho = course.
|
|
1231
|
-
return course.
|
|
1245
|
+
protoOf(AeroProviderConstant).aeroCoef_5n4cco_k$ = function (course, path, pointIndex) {
|
|
1246
|
+
var rho = course.rhoProvider_1.rho_pwqvzi_k$(course.course_1, path, pointIndex);
|
|
1247
|
+
return course.get_cyclist_lkc0de_k$().cd_1 * course.get_cyclist_lkc0de_k$().frontalAreaM2__1 * rho / 2.0;
|
|
1232
1248
|
};
|
|
1233
1249
|
var AeroProviderConstant_instance;
|
|
1234
1250
|
function AeroProviderConstant_getInstance() {
|
|
1235
1251
|
return AeroProviderConstant_instance;
|
|
1236
1252
|
}
|
|
1237
1253
|
function Companion_5() {
|
|
1238
|
-
this.
|
|
1239
|
-
this.
|
|
1254
|
+
this.TOLERANCE_1 = 0.05;
|
|
1255
|
+
this.MAX_MULTIPLIER_1 = 3.0;
|
|
1240
1256
|
}
|
|
1241
1257
|
var Companion_instance_5;
|
|
1242
1258
|
function Companion_getInstance_8() {
|
|
@@ -1244,10 +1260,10 @@
|
|
|
1244
1260
|
}
|
|
1245
1261
|
function CyclistPowerProviderBase(useHarmonics, random) {
|
|
1246
1262
|
random = random === VOID ? Default_getInstance() : random;
|
|
1247
|
-
this.
|
|
1263
|
+
this.useHarmonics_1 = useHarmonics;
|
|
1248
1264
|
var tmp = this;
|
|
1249
1265
|
var tmp_0;
|
|
1250
|
-
if (this.
|
|
1266
|
+
if (this.useHarmonics_1) {
|
|
1251
1267
|
// Inline function 'kotlin.collections.List' call
|
|
1252
1268
|
// Inline function 'kotlin.collections.MutableList' call
|
|
1253
1269
|
var list = ArrayList_init_$Create$_0(20);
|
|
@@ -1257,48 +1273,48 @@
|
|
|
1257
1273
|
do {
|
|
1258
1274
|
var index = inductionVariable;
|
|
1259
1275
|
inductionVariable = inductionVariable + 1 | 0;
|
|
1260
|
-
var tmp$ret$4 = new Harmonic(1.0 + random.
|
|
1261
|
-
list.
|
|
1276
|
+
var tmp$ret$4 = new Harmonic(1.0 + random.nextDouble_s2xvfg_k$() * 9.0, random.nextDouble_s2xvfg_k$() * 3.141592653589793, random.nextDouble_s2xvfg_k$() * 0.01);
|
|
1277
|
+
list.add_utx5q5_k$(tmp$ret$4);
|
|
1262
1278
|
}
|
|
1263
1279
|
while (inductionVariable < 20);
|
|
1264
1280
|
tmp_0 = list;
|
|
1265
1281
|
} else {
|
|
1266
1282
|
tmp_0 = emptyList();
|
|
1267
1283
|
}
|
|
1268
|
-
tmp.
|
|
1269
|
-
}
|
|
1270
|
-
protoOf(CyclistPowerProviderBase).
|
|
1271
|
-
var power = this.
|
|
1272
|
-
path.
|
|
1273
|
-
if (this.
|
|
1274
|
-
var x = path.
|
|
1275
|
-
var _iterator__ex2g4s = this.
|
|
1276
|
-
while (_iterator__ex2g4s.
|
|
1277
|
-
var h = _iterator__ex2g4s.
|
|
1284
|
+
tmp.harmonics_1 = tmp_0;
|
|
1285
|
+
}
|
|
1286
|
+
protoOf(CyclistPowerProviderBase).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
|
|
1287
|
+
var power = this.optimalPower_36kg19_k$(course, path, pointIndex);
|
|
1288
|
+
path.setPCyclistProvidedOptimalPower_gha9up_k$(pointIndex, power);
|
|
1289
|
+
if (this.useHarmonics_1) {
|
|
1290
|
+
var x = path.time_ryc845_k$(pointIndex) / 10000.0;
|
|
1291
|
+
var _iterator__ex2g4s = this.harmonics_1.iterator_jk1svi_k$();
|
|
1292
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1293
|
+
var h = _iterator__ex2g4s.next_20eer_k$();
|
|
1278
1294
|
var tmp = power;
|
|
1279
|
-
var tmp_0 = h.
|
|
1295
|
+
var tmp_0 = h.amp_1 * power;
|
|
1280
1296
|
// Inline function 'kotlin.math.cos' call
|
|
1281
|
-
var x_0 = h.
|
|
1297
|
+
var x_0 = h.freqRadS_1 * x - h.phaseRad_1;
|
|
1282
1298
|
power = tmp + tmp_0 * Math.cos(x_0);
|
|
1283
1299
|
}
|
|
1284
1300
|
}
|
|
1285
|
-
path.
|
|
1286
|
-
var powerNeeded = -PowerComputer_instance.
|
|
1287
|
-
path.
|
|
1301
|
+
path.setPCyclistProvidedOptimalPowerWithHarmonics_tg3fol_k$(pointIndex, power);
|
|
1302
|
+
var powerNeeded = -PowerComputer_instance.getNewPower_puvq9i_k$(course, path, pointIndex, false);
|
|
1303
|
+
path.setPCyclistPowerNeeded_54po1x_k$(pointIndex, powerNeeded);
|
|
1288
1304
|
return power;
|
|
1289
1305
|
};
|
|
1290
1306
|
function GravPowerProvider() {
|
|
1291
1307
|
}
|
|
1292
|
-
protoOf(GravPowerProvider).
|
|
1293
|
-
var m = course.
|
|
1294
|
-
var grade = path.
|
|
1295
|
-
var speed = path.
|
|
1308
|
+
protoOf(GravPowerProvider).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
|
|
1309
|
+
var m = course.get_cyclist_lkc0de_k$().massKg_1;
|
|
1310
|
+
var grade = path.grade_c4yjz5_k$(pointIndex);
|
|
1311
|
+
var speed = path.speed_npav2n_k$(pointIndex);
|
|
1296
1312
|
var tmp = -m * 9.8 * speed;
|
|
1297
1313
|
// Inline function 'kotlin.math.atan' call
|
|
1298
1314
|
// Inline function 'kotlin.math.sin' call
|
|
1299
1315
|
var x = Math.atan(grade);
|
|
1300
1316
|
var p = tmp * Math.sin(x);
|
|
1301
|
-
path.
|
|
1317
|
+
path.setPGravity_tegtcu_k$(pointIndex, p);
|
|
1302
1318
|
return p;
|
|
1303
1319
|
};
|
|
1304
1320
|
var GravPowerProvider_instance;
|
|
@@ -1306,17 +1322,17 @@
|
|
|
1306
1322
|
return GravPowerProvider_instance;
|
|
1307
1323
|
}
|
|
1308
1324
|
function Harmonic(freqRadS, phaseRad, amp) {
|
|
1309
|
-
this.
|
|
1310
|
-
this.
|
|
1311
|
-
this.
|
|
1325
|
+
this.freqRadS_1 = freqRadS;
|
|
1326
|
+
this.phaseRad_1 = phaseRad;
|
|
1327
|
+
this.amp_1 = amp;
|
|
1312
1328
|
}
|
|
1313
1329
|
protoOf(Harmonic).toString = function () {
|
|
1314
|
-
return 'Harmonic(freqRadS=' + this.
|
|
1330
|
+
return 'Harmonic(freqRadS=' + this.freqRadS_1 + ', phaseRad=' + this.phaseRad_1 + ', amp=' + this.amp_1 + ')';
|
|
1315
1331
|
};
|
|
1316
1332
|
protoOf(Harmonic).hashCode = function () {
|
|
1317
|
-
var result = getNumberHashCode(this.
|
|
1318
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1319
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1333
|
+
var result = getNumberHashCode(this.freqRadS_1);
|
|
1334
|
+
result = imul(result, 31) + getNumberHashCode(this.phaseRad_1) | 0;
|
|
1335
|
+
result = imul(result, 31) + getNumberHashCode(this.amp_1) | 0;
|
|
1320
1336
|
return result;
|
|
1321
1337
|
};
|
|
1322
1338
|
protoOf(Harmonic).equals = function (other) {
|
|
@@ -1324,39 +1340,39 @@
|
|
|
1324
1340
|
return true;
|
|
1325
1341
|
if (!(other instanceof Harmonic))
|
|
1326
1342
|
return false;
|
|
1327
|
-
if (!equals(this.
|
|
1343
|
+
if (!equals(this.freqRadS_1, other.freqRadS_1))
|
|
1328
1344
|
return false;
|
|
1329
|
-
if (!equals(this.
|
|
1345
|
+
if (!equals(this.phaseRad_1, other.phaseRad_1))
|
|
1330
1346
|
return false;
|
|
1331
|
-
if (!equals(this.
|
|
1347
|
+
if (!equals(this.amp_1, other.amp_1))
|
|
1332
1348
|
return false;
|
|
1333
1349
|
return true;
|
|
1334
1350
|
};
|
|
1335
1351
|
function computeCorneringLimit($this, course, currentIndex, window_0) {
|
|
1336
|
-
var path = course.
|
|
1352
|
+
var path = course.path_1;
|
|
1337
1353
|
var radius = computeRadiusWindowed($this, path, currentIndex, window_0);
|
|
1338
1354
|
// Inline function 'kotlin.math.sqrt' call
|
|
1339
|
-
var x = 9.8 * radius * course.
|
|
1355
|
+
var x = 9.8 * radius * course.cyclist_1.get_tanMaxLeanAngle_qqiag1_k$();
|
|
1340
1356
|
var vMax = Math.sqrt(x);
|
|
1341
1357
|
// Inline function 'kotlin.math.min' call
|
|
1342
|
-
var a = course.
|
|
1358
|
+
var a = course.cyclist_1.get_maxSpeedMS_xz2r7y_k$();
|
|
1343
1359
|
var result = Math.min(a, vMax);
|
|
1344
|
-
path.
|
|
1360
|
+
path.setSpeedMaxIncline_8l69w1_k$(currentIndex, result);
|
|
1345
1361
|
return result;
|
|
1346
1362
|
}
|
|
1347
1363
|
function computeRadiusWindowed($this, path, i, k) {
|
|
1348
1364
|
// Inline function 'kotlin.math.max' call
|
|
1349
1365
|
var b = i - k | 0;
|
|
1350
1366
|
var mini = Math.max(0, b);
|
|
1351
|
-
var tmp0 = path.
|
|
1367
|
+
var tmp0 = path.size_1 - 1 | 0;
|
|
1352
1368
|
// Inline function 'kotlin.math.min' call
|
|
1353
1369
|
var b_0 = i + k | 0;
|
|
1354
1370
|
var maxi = Math.min(tmp0, b_0);
|
|
1355
|
-
var totalBearingChange = $this.
|
|
1356
|
-
var totalDistance = path.
|
|
1371
|
+
var totalBearingChange = $this.normalizeAngleDiff_6gshzi_k$(path.bearing_fz5vxm_k$(maxi) - path.bearing_fz5vxm_k$(mini));
|
|
1372
|
+
var totalDistance = path.distance_5s4s77_k$(maxi) - path.distance_5s4s77_k$(mini);
|
|
1357
1373
|
// Inline function 'kotlin.math.abs' call
|
|
1358
1374
|
if (Math.abs(totalBearingChange) < 0.001) {
|
|
1359
|
-
path.
|
|
1375
|
+
path.setRadius_p1cueq_k$(i, 200.0);
|
|
1360
1376
|
return 200.0;
|
|
1361
1377
|
}
|
|
1362
1378
|
// Inline function 'kotlin.math.abs' call
|
|
@@ -1365,47 +1381,47 @@
|
|
|
1365
1381
|
// Inline function 'kotlin.math.max' call
|
|
1366
1382
|
var b_1 = Math.min(200.0, raw);
|
|
1367
1383
|
var clamped = Math.max(5.0, b_1);
|
|
1368
|
-
path.
|
|
1384
|
+
path.setRadius_p1cueq_k$(i, clamped);
|
|
1369
1385
|
return clamped;
|
|
1370
1386
|
}
|
|
1371
1387
|
function computeBrakingLimit($this, course, currentIndex, nextIndex) {
|
|
1372
|
-
var path = course.
|
|
1373
|
-
var vf = path.
|
|
1374
|
-
var a = course.
|
|
1375
|
-
var d = path.
|
|
1388
|
+
var path = course.path_1;
|
|
1389
|
+
var vf = path.speedMax_mjo2cl_k$(nextIndex);
|
|
1390
|
+
var a = course.cyclist_1.get_maxBrakeMS2_nzouxw_k$();
|
|
1391
|
+
var d = path.distance_5s4s77_k$(nextIndex) - path.distance_5s4s77_k$(currentIndex);
|
|
1376
1392
|
// Inline function 'kotlin.math.sqrt' call
|
|
1377
1393
|
var x = vf * vf + 2.0 * a * d;
|
|
1378
1394
|
return Math.sqrt(x);
|
|
1379
1395
|
}
|
|
1380
1396
|
function MaxSpeedComputer() {
|
|
1381
|
-
this.
|
|
1382
|
-
this.
|
|
1383
|
-
this.
|
|
1384
|
-
this.
|
|
1385
|
-
this.
|
|
1386
|
-
}
|
|
1387
|
-
protoOf(MaxSpeedComputer).
|
|
1388
|
-
var path = course.
|
|
1389
|
-
var n = path.
|
|
1397
|
+
this.MAX_RADIUS_M_1 = 200.0;
|
|
1398
|
+
this.MIN_RADIUS_M_1 = 5.0;
|
|
1399
|
+
this.END_SPEED_MS_1 = 2.0;
|
|
1400
|
+
this.BEARING_THRESHOLD_1 = 0.001;
|
|
1401
|
+
this.DEFAULT_WINDOW_1 = 10;
|
|
1402
|
+
}
|
|
1403
|
+
protoOf(MaxSpeedComputer).computeMaxSpeeds_jc4v4o_k$ = function (course) {
|
|
1404
|
+
var path = course.path_1;
|
|
1405
|
+
var n = path.size_1;
|
|
1390
1406
|
var inductionVariable = n - 1 | 0;
|
|
1391
1407
|
if (0 <= inductionVariable)
|
|
1392
1408
|
do {
|
|
1393
1409
|
var i = inductionVariable;
|
|
1394
1410
|
inductionVariable = inductionVariable + -1 | 0;
|
|
1395
1411
|
if (i === (n - 1 | 0)) {
|
|
1396
|
-
path.
|
|
1412
|
+
path.setSpeedMax_7xvqir_k$(i, 2.0);
|
|
1397
1413
|
} else {
|
|
1398
1414
|
var cornering = computeCorneringLimit(this, course, i, 10);
|
|
1399
1415
|
var braking = computeBrakingLimit(this, course, i, i + 1 | 0);
|
|
1400
1416
|
// Inline function 'kotlin.math.min' call
|
|
1401
1417
|
var tmp$ret$0 = Math.min(cornering, braking);
|
|
1402
|
-
path.
|
|
1418
|
+
path.setSpeedMax_7xvqir_k$(i, tmp$ret$0);
|
|
1403
1419
|
}
|
|
1404
1420
|
}
|
|
1405
1421
|
while (0 <= inductionVariable);
|
|
1406
|
-
path.
|
|
1422
|
+
path.computeDerivedData_uoxpeo_k$();
|
|
1407
1423
|
};
|
|
1408
|
-
protoOf(MaxSpeedComputer).
|
|
1424
|
+
protoOf(MaxSpeedComputer).normalizeAngleDiff_6gshzi_k$ = function (angleIn) {
|
|
1409
1425
|
var a = angleIn;
|
|
1410
1426
|
while (a > 3.141592653589793)
|
|
1411
1427
|
a = a - 2.0 * 3.141592653589793;
|
|
@@ -1419,11 +1435,11 @@
|
|
|
1419
1435
|
}
|
|
1420
1436
|
function MuscularPowerProvider() {
|
|
1421
1437
|
}
|
|
1422
|
-
protoOf(MuscularPowerProvider).
|
|
1423
|
-
var muscular = course.
|
|
1424
|
-
path.
|
|
1425
|
-
var wheel = muscular * course.
|
|
1426
|
-
path.
|
|
1438
|
+
protoOf(MuscularPowerProvider).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
|
|
1439
|
+
var muscular = course.cyclistPowerProvider_1.powerAt_ejucaq_k$(course, path, pointIndex);
|
|
1440
|
+
path.setPCyclistProvidedMuscular_aori9q_k$(pointIndex, muscular);
|
|
1441
|
+
var wheel = muscular * course.get_bike_wojgoa_k$().efficiency_1;
|
|
1442
|
+
path.setPCyclistProvidedWheel_ofsihz_k$(pointIndex, wheel);
|
|
1427
1443
|
return wheel;
|
|
1428
1444
|
};
|
|
1429
1445
|
var MuscularPowerProvider_instance;
|
|
@@ -1436,7 +1452,7 @@
|
|
|
1436
1452
|
var tol = dx / 1.0E7;
|
|
1437
1453
|
while (dt2 - dt1 >= tol) {
|
|
1438
1454
|
var dtMid = (dt1 + dt2) / 2.0;
|
|
1439
|
-
var dxMid = $this.
|
|
1455
|
+
var dxMid = $this.getDx_xtszre_k$(pSum, equivalentMass, currentSpeed, dtMid);
|
|
1440
1456
|
if (dxMid < dx)
|
|
1441
1457
|
dt1 = dtMid;
|
|
1442
1458
|
else
|
|
@@ -1446,18 +1462,18 @@
|
|
|
1446
1462
|
}
|
|
1447
1463
|
function PowerComputer() {
|
|
1448
1464
|
}
|
|
1449
|
-
protoOf(PowerComputer).
|
|
1465
|
+
protoOf(PowerComputer).getNewPower_puvq9i_k$ = function (course, path, pointIndex, withCyclist) {
|
|
1450
1466
|
var pSum = 0.0;
|
|
1451
|
-
pSum = pSum + WheelBearingsPowerProvider_instance.
|
|
1452
|
-
pSum = pSum + RollingResistancePowerProvider_instance.
|
|
1453
|
-
pSum = pSum + AeroPowerProvider_instance.
|
|
1454
|
-
pSum = pSum + GravPowerProvider_instance.
|
|
1467
|
+
pSum = pSum + WheelBearingsPowerProvider_instance.powerAt_ejucaq_k$(course, path, pointIndex);
|
|
1468
|
+
pSum = pSum + RollingResistancePowerProvider_instance.powerAt_ejucaq_k$(course, path, pointIndex);
|
|
1469
|
+
pSum = pSum + AeroPowerProvider_instance.powerAt_ejucaq_k$(course, path, pointIndex);
|
|
1470
|
+
pSum = pSum + GravPowerProvider_instance.powerAt_ejucaq_k$(course, path, pointIndex);
|
|
1455
1471
|
if (withCyclist) {
|
|
1456
|
-
pSum = pSum + MuscularPowerProvider_instance.
|
|
1472
|
+
pSum = pSum + MuscularPowerProvider_instance.powerAt_ejucaq_k$(course, path, pointIndex);
|
|
1457
1473
|
}
|
|
1458
1474
|
return pSum;
|
|
1459
1475
|
};
|
|
1460
|
-
protoOf(PowerComputer).
|
|
1476
|
+
protoOf(PowerComputer).getDx_xtszre_k$ = function (pSum, equivalentMass, currentSpeed, dt) {
|
|
1461
1477
|
// Inline function 'kotlin.math.sqrt' call
|
|
1462
1478
|
var x = dt * pSum / (0.5 * equivalentMass) + currentSpeed * currentSpeed;
|
|
1463
1479
|
var tmp0 = Math.sqrt(x);
|
|
@@ -1466,40 +1482,40 @@
|
|
|
1466
1482
|
var newSpeed = Math.max(tmp0, b);
|
|
1467
1483
|
return (currentSpeed + newSpeed) * dt / 2.0;
|
|
1468
1484
|
};
|
|
1469
|
-
protoOf(PowerComputer).
|
|
1485
|
+
protoOf(PowerComputer).getTotPower_kfbciq_k$ = function (equivalentMass, s1, s2, dt) {
|
|
1470
1486
|
return 0.5 * equivalentMass * (s2 * s2 - s1 * s1) / dt;
|
|
1471
1487
|
};
|
|
1472
|
-
protoOf(PowerComputer).
|
|
1488
|
+
protoOf(PowerComputer).getDt_t0pcee_k$ = function (pSum, equivalentMass, currentSpeed, dx) {
|
|
1473
1489
|
var dt = 0.1;
|
|
1474
|
-
while (this.
|
|
1490
|
+
while (this.getDx_xtszre_k$(pSum, equivalentMass, currentSpeed, dt) <= dx) {
|
|
1475
1491
|
dt = dt + 0.1;
|
|
1476
1492
|
}
|
|
1477
1493
|
return getDtInner(this, pSum, equivalentMass, currentSpeed, dx, dt - 0.1, dt);
|
|
1478
1494
|
};
|
|
1479
|
-
protoOf(PowerComputer).
|
|
1495
|
+
protoOf(PowerComputer).computeCyclistPower_kgcsa3_k$ = function (course, path, equivalentMass, i) {
|
|
1480
1496
|
if (i === 0) {
|
|
1481
|
-
path.
|
|
1497
|
+
path.setPComputedPower_c3m6yw_k$(i, 0.0);
|
|
1482
1498
|
return Unit_instance;
|
|
1483
1499
|
}
|
|
1484
|
-
var resistive = this.
|
|
1485
|
-
var s1 = path.
|
|
1486
|
-
var s2 = path.
|
|
1487
|
-
var dtSeconds = path.
|
|
1488
|
-
var totPower = this.
|
|
1489
|
-
path.
|
|
1500
|
+
var resistive = this.getNewPower_puvq9i_k$(course, path, i - 1 | 0, false);
|
|
1501
|
+
var s1 = path.speed_npav2n_k$(i - 1 | 0);
|
|
1502
|
+
var s2 = path.speed_npav2n_k$(i);
|
|
1503
|
+
var dtSeconds = path.dt_17uzp4_k$(i) / 1000.0;
|
|
1504
|
+
var totPower = this.getTotPower_kfbciq_k$(equivalentMass, s1, s2, dtSeconds);
|
|
1505
|
+
path.setPComputedTotalPower_wm6di_k$(i, totPower);
|
|
1490
1506
|
var powerWheel = totPower - resistive;
|
|
1491
|
-
path.
|
|
1507
|
+
path.setPComputedWheelPower_qplog3_k$(i, powerWheel);
|
|
1492
1508
|
// Inline function 'kotlin.math.max' call
|
|
1493
|
-
var computed = Math.max(0.0, powerWheel) / course.
|
|
1494
|
-
path.
|
|
1509
|
+
var computed = Math.max(0.0, powerWheel) / course.get_bike_wojgoa_k$().efficiency_1;
|
|
1510
|
+
path.setPComputedPower_c3m6yw_k$(i, computed);
|
|
1495
1511
|
};
|
|
1496
|
-
protoOf(PowerComputer).
|
|
1497
|
-
var m = course.
|
|
1498
|
-
var totalInertia = course.
|
|
1499
|
-
return m + totalInertia / (course.
|
|
1512
|
+
protoOf(PowerComputer).equivalentMass_3uxz65_k$ = function (course) {
|
|
1513
|
+
var m = course.cyclist_1.massKg_1;
|
|
1514
|
+
var totalInertia = course.bike_1.inertiaFront_1 + course.bike_1.inertiaRear_1;
|
|
1515
|
+
return m + totalInertia / (course.bike_1.wheelRadiusM_1 * course.bike_1.wheelRadiusM_1);
|
|
1500
1516
|
};
|
|
1501
|
-
protoOf(PowerComputer).
|
|
1502
|
-
return this.
|
|
1517
|
+
protoOf(PowerComputer).equivalentMass_e3djhu_k$ = function (course) {
|
|
1518
|
+
return this.equivalentMass_3uxz65_k$(course.course_1);
|
|
1503
1519
|
};
|
|
1504
1520
|
var PowerComputer_instance;
|
|
1505
1521
|
function PowerComputer_getInstance() {
|
|
@@ -1509,34 +1525,34 @@
|
|
|
1509
1525
|
useHarmonics = useHarmonics === VOID ? false : useHarmonics;
|
|
1510
1526
|
random = random === VOID ? Default_getInstance() : random;
|
|
1511
1527
|
CyclistPowerProviderBase.call(this, useHarmonics, random);
|
|
1512
|
-
this.
|
|
1528
|
+
this.power_1 = power;
|
|
1513
1529
|
}
|
|
1514
|
-
protoOf(PowerProviderConstant).
|
|
1515
|
-
return this.
|
|
1530
|
+
protoOf(PowerProviderConstant).optimalPower_36kg19_k$ = function (course, path, pointIndex) {
|
|
1531
|
+
return this.power_1;
|
|
1516
1532
|
};
|
|
1517
1533
|
function PowerProviderConstantWithTiring(power, useHarmonics, durationSeconds, random) {
|
|
1518
1534
|
useHarmonics = useHarmonics === VOID ? false : useHarmonics;
|
|
1519
1535
|
random = random === VOID ? Default_getInstance() : random;
|
|
1520
1536
|
CyclistPowerProviderBase.call(this, useHarmonics, random);
|
|
1521
|
-
this.
|
|
1522
|
-
this.
|
|
1537
|
+
this.power_1 = power;
|
|
1538
|
+
this.durationSeconds_1 = durationSeconds;
|
|
1523
1539
|
// Inline function 'kotlin.require' call
|
|
1524
|
-
if (!(this.
|
|
1525
|
-
var message = 'durationSeconds must be > 0, got ' + this.
|
|
1540
|
+
if (!(this.durationSeconds_1 > 0.0)) {
|
|
1541
|
+
var message = 'durationSeconds must be > 0, got ' + this.durationSeconds_1;
|
|
1526
1542
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1527
1543
|
}
|
|
1528
1544
|
}
|
|
1529
|
-
protoOf(PowerProviderConstantWithTiring).
|
|
1530
|
-
var elapsedS = path.
|
|
1545
|
+
protoOf(PowerProviderConstantWithTiring).optimalPower_36kg19_k$ = function (course, path, pointIndex) {
|
|
1546
|
+
var elapsedS = path.elapsed_7307rw_k$(pointIndex) / 1000.0;
|
|
1531
1547
|
// Inline function 'kotlin.math.max' call
|
|
1532
|
-
var b = 1.0 - 0.6 * elapsedS / this.
|
|
1548
|
+
var b = 1.0 - 0.6 * elapsedS / this.durationSeconds_1;
|
|
1533
1549
|
var c = Math.max(0.5, b);
|
|
1534
|
-
return this.
|
|
1550
|
+
return this.power_1 * c;
|
|
1535
1551
|
};
|
|
1536
1552
|
function PowerProviderFromData() {
|
|
1537
1553
|
}
|
|
1538
|
-
protoOf(PowerProviderFromData).
|
|
1539
|
-
return path.
|
|
1554
|
+
protoOf(PowerProviderFromData).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
|
|
1555
|
+
return path.pInputPower_ybhudp_k$(pointIndex);
|
|
1540
1556
|
};
|
|
1541
1557
|
var PowerProviderFromData_instance;
|
|
1542
1558
|
function PowerProviderFromData_getInstance() {
|
|
@@ -1544,7 +1560,7 @@
|
|
|
1544
1560
|
}
|
|
1545
1561
|
function RhoProviderDefault() {
|
|
1546
1562
|
}
|
|
1547
|
-
protoOf(RhoProviderDefault).
|
|
1563
|
+
protoOf(RhoProviderDefault).rho_pwqvzi_k$ = function (course, path, pointIndex) {
|
|
1548
1564
|
return 1.225;
|
|
1549
1565
|
};
|
|
1550
1566
|
var RhoProviderDefault_instance;
|
|
@@ -1552,16 +1568,16 @@
|
|
|
1552
1568
|
return RhoProviderDefault_instance;
|
|
1553
1569
|
}
|
|
1554
1570
|
function RhoProviderEstimate() {
|
|
1555
|
-
this.
|
|
1556
|
-
this.
|
|
1557
|
-
this.
|
|
1558
|
-
this.
|
|
1559
|
-
this.
|
|
1560
|
-
}
|
|
1561
|
-
protoOf(RhoProviderEstimate).
|
|
1562
|
-
var providedTemp = path.
|
|
1571
|
+
this.P0__1 = 101325.0;
|
|
1572
|
+
this.T0__1 = 288.15;
|
|
1573
|
+
this.G_ISA_1 = 9.80665;
|
|
1574
|
+
this.L_1 = 0.0065;
|
|
1575
|
+
this.R_1 = 287.05;
|
|
1576
|
+
}
|
|
1577
|
+
protoOf(RhoProviderEstimate).rho_pwqvzi_k$ = function (course, path, pointIndex) {
|
|
1578
|
+
var providedTemp = path.get_z3le6l_k$(pointIndex, PointField_TEMPERATURE_getInstance());
|
|
1563
1579
|
var temperatureC = isNaN_0(providedTemp) ? 15.0 : providedTemp;
|
|
1564
|
-
var providedElevation = path.
|
|
1580
|
+
var providedElevation = path.elevation_iziwkb_k$(pointIndex);
|
|
1565
1581
|
var altitude = isNaN_0(providedElevation) ? 0.0 : providedElevation;
|
|
1566
1582
|
var tKelvin = temperatureC + 273.15;
|
|
1567
1583
|
var tmp0 = 1.0 - 0.0065 * altitude / 288.15;
|
|
@@ -1576,17 +1592,17 @@
|
|
|
1576
1592
|
}
|
|
1577
1593
|
function RollingResistancePowerProvider() {
|
|
1578
1594
|
}
|
|
1579
|
-
protoOf(RollingResistancePowerProvider).
|
|
1580
|
-
var m = course.
|
|
1581
|
-
var crr = course.
|
|
1582
|
-
var grade = path.
|
|
1583
|
-
var speed = path.
|
|
1595
|
+
protoOf(RollingResistancePowerProvider).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
|
|
1596
|
+
var m = course.get_cyclist_lkc0de_k$().massKg_1;
|
|
1597
|
+
var crr = course.get_bike_wojgoa_k$().crr_1;
|
|
1598
|
+
var grade = path.grade_c4yjz5_k$(pointIndex);
|
|
1599
|
+
var speed = path.speed_npav2n_k$(pointIndex);
|
|
1584
1600
|
// Inline function 'kotlin.math.atan' call
|
|
1585
1601
|
// Inline function 'kotlin.math.cos' call
|
|
1586
1602
|
var x = Math.atan(grade);
|
|
1587
1603
|
var coef = Math.cos(x);
|
|
1588
1604
|
var p = -coef * m * 9.8 * speed * crr;
|
|
1589
|
-
path.
|
|
1605
|
+
path.setPRollingResistance_h04uz6_k$(pointIndex, p);
|
|
1590
1606
|
return p;
|
|
1591
1607
|
};
|
|
1592
1608
|
var RollingResistancePowerProvider_instance;
|
|
@@ -1594,18 +1610,18 @@
|
|
|
1594
1610
|
return RollingResistancePowerProvider_instance;
|
|
1595
1611
|
}
|
|
1596
1612
|
function copyAllFields($this, src, i, dst, j) {
|
|
1597
|
-
var _iterator__ex2g4s = get_entries().
|
|
1598
|
-
while (_iterator__ex2g4s.
|
|
1599
|
-
var field = _iterator__ex2g4s.
|
|
1600
|
-
dst.
|
|
1613
|
+
var _iterator__ex2g4s = get_entries().iterator_jk1svi_k$();
|
|
1614
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1615
|
+
var field = _iterator__ex2g4s.next_20eer_k$();
|
|
1616
|
+
dst.set_b3ze83_k$(j, field, src.get_z3le6l_k$(i, field));
|
|
1601
1617
|
}
|
|
1602
1618
|
}
|
|
1603
1619
|
function VirtualizeService() {
|
|
1604
|
-
this.
|
|
1620
|
+
this.MAX_ITERATIONS_1 = 100000;
|
|
1605
1621
|
}
|
|
1606
|
-
protoOf(VirtualizeService).
|
|
1607
|
-
var input = course.
|
|
1608
|
-
var n = input.
|
|
1622
|
+
protoOf(VirtualizeService).virtualizeTrack_tp3afi_k$ = function (course) {
|
|
1623
|
+
var input = course.get_path_wos8ry_k$();
|
|
1624
|
+
var n = input.size_1;
|
|
1609
1625
|
if (n === 0)
|
|
1610
1626
|
return new Path(0);
|
|
1611
1627
|
if (n === 1) {
|
|
@@ -1613,54 +1629,54 @@
|
|
|
1613
1629
|
copyAllFields(this, input, 0, singleton, 0);
|
|
1614
1630
|
return singleton;
|
|
1615
1631
|
}
|
|
1616
|
-
var mEq = PowerComputer_instance.
|
|
1632
|
+
var mEq = PowerComputer_instance.equivalentMass_e3djhu_k$(course);
|
|
1617
1633
|
var out = new Path(n);
|
|
1618
1634
|
copyAllFields(this, input, 0, out, 0);
|
|
1619
1635
|
var speed = 0.5555555555555556;
|
|
1620
1636
|
var startTimeMs = 0.0;
|
|
1621
1637
|
var timeMs = startTimeMs;
|
|
1622
|
-
out.
|
|
1623
|
-
out.
|
|
1624
|
-
out.
|
|
1625
|
-
out.
|
|
1638
|
+
out.setTime_rfmvcd_k$(0, timeMs);
|
|
1639
|
+
out.setElapsed_916ug_k$(0, 0.0);
|
|
1640
|
+
out.setSpeed_1slan1_k$(0, speed);
|
|
1641
|
+
out.setVirtSpeedCurrent_kvg8yv_k$(0, speed);
|
|
1626
1642
|
var i = 1;
|
|
1627
1643
|
var iter = 0;
|
|
1628
1644
|
$l$loop: while (i < n) {
|
|
1629
|
-
var dx = input.
|
|
1630
|
-
var pSum = PowerComputer_instance.
|
|
1631
|
-
var dt = PowerComputer_instance.
|
|
1645
|
+
var dx = input.distance_5s4s77_k$(i) - input.distance_5s4s77_k$(i - 1 | 0);
|
|
1646
|
+
var pSum = PowerComputer_instance.getNewPower_puvq9i_k$(course, out, i - 1 | 0, true);
|
|
1647
|
+
var dt = PowerComputer_instance.getDt_t0pcee_k$(pSum, mEq, speed, dx);
|
|
1632
1648
|
var speedNew = 2.0 * dx / dt - speed;
|
|
1633
1649
|
copyAllFields(this, input, i, out, i);
|
|
1634
|
-
var speedMax = input.
|
|
1650
|
+
var speedMax = input.speedMax_mjo2cl_k$(i);
|
|
1635
1651
|
if (speedNew > speedMax) {
|
|
1636
1652
|
speedNew = speedMax;
|
|
1637
1653
|
dt = 2.0 * dx / (speedNew + speed);
|
|
1638
1654
|
}
|
|
1639
1655
|
speed = speedNew;
|
|
1640
1656
|
timeMs = timeMs + dt * 1000.0;
|
|
1641
|
-
out.
|
|
1642
|
-
out.
|
|
1643
|
-
out.
|
|
1644
|
-
out.
|
|
1645
|
-
out.
|
|
1646
|
-
out.
|
|
1657
|
+
out.setTime_rfmvcd_k$(i, timeMs);
|
|
1658
|
+
out.setElapsed_916ug_k$(i, timeMs - startTimeMs);
|
|
1659
|
+
out.setDx_uk0ky4_k$(i, dx);
|
|
1660
|
+
out.setDt_sgarxs_k$(i, dt * 1000.0);
|
|
1661
|
+
out.setSpeed_1slan1_k$(i, speed);
|
|
1662
|
+
out.setVirtSpeedCurrent_kvg8yv_k$(i, speed);
|
|
1647
1663
|
i = i + 1 | 0;
|
|
1648
1664
|
var _unary__edvuaz = iter;
|
|
1649
1665
|
iter = _unary__edvuaz + 1 | 0;
|
|
1650
1666
|
if (_unary__edvuaz > 100000)
|
|
1651
1667
|
break $l$loop;
|
|
1652
1668
|
}
|
|
1653
|
-
var progression = out.
|
|
1654
|
-
var inductionVariable = progression.
|
|
1655
|
-
var last = progression.
|
|
1669
|
+
var progression = out.get_indices_xelk8u_k$();
|
|
1670
|
+
var inductionVariable = progression.first_1;
|
|
1671
|
+
var last = progression.last_1;
|
|
1656
1672
|
if (inductionVariable <= last)
|
|
1657
1673
|
do {
|
|
1658
1674
|
var j = inductionVariable;
|
|
1659
1675
|
inductionVariable = inductionVariable + 1 | 0;
|
|
1660
|
-
PowerComputer_instance.
|
|
1676
|
+
PowerComputer_instance.computeCyclistPower_kgcsa3_k$(course, out, mEq, j);
|
|
1661
1677
|
}
|
|
1662
1678
|
while (!(j === last));
|
|
1663
|
-
out.
|
|
1679
|
+
out.computeDerivedData_uoxpeo_k$();
|
|
1664
1680
|
return out;
|
|
1665
1681
|
};
|
|
1666
1682
|
var VirtualizeService_instance;
|
|
@@ -1669,10 +1685,10 @@
|
|
|
1669
1685
|
}
|
|
1670
1686
|
function WheelBearingsPowerProvider() {
|
|
1671
1687
|
}
|
|
1672
|
-
protoOf(WheelBearingsPowerProvider).
|
|
1673
|
-
var speed = path.
|
|
1688
|
+
protoOf(WheelBearingsPowerProvider).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
|
|
1689
|
+
var speed = path.speed_npav2n_k$(pointIndex);
|
|
1674
1690
|
var p = -speed * (91.0 + 8.7 * speed) / 1000.0;
|
|
1675
|
-
path.
|
|
1691
|
+
path.setPWheelBearings_djmhww_k$(pointIndex, p);
|
|
1676
1692
|
return p;
|
|
1677
1693
|
};
|
|
1678
1694
|
var WheelBearingsPowerProvider_instance;
|
|
@@ -1681,7 +1697,7 @@
|
|
|
1681
1697
|
}
|
|
1682
1698
|
function Companion_6() {
|
|
1683
1699
|
Companion_instance_6 = this;
|
|
1684
|
-
this.
|
|
1700
|
+
this.NONE_1 = new Wind(0.0, 0.0);
|
|
1685
1701
|
}
|
|
1686
1702
|
var Companion_instance_6;
|
|
1687
1703
|
function Companion_getInstance_9() {
|
|
@@ -1691,15 +1707,15 @@
|
|
|
1691
1707
|
}
|
|
1692
1708
|
function Wind(speedMS, directionRad) {
|
|
1693
1709
|
Companion_getInstance_9();
|
|
1694
|
-
this.
|
|
1695
|
-
this.
|
|
1710
|
+
this.speedMS_1 = speedMS;
|
|
1711
|
+
this.directionRad_1 = directionRad;
|
|
1696
1712
|
}
|
|
1697
1713
|
protoOf(Wind).toString = function () {
|
|
1698
|
-
return 'Wind(speedMS=' + this.
|
|
1714
|
+
return 'Wind(speedMS=' + this.speedMS_1 + ', directionRad=' + this.directionRad_1 + ')';
|
|
1699
1715
|
};
|
|
1700
1716
|
protoOf(Wind).hashCode = function () {
|
|
1701
|
-
var result = getNumberHashCode(this.
|
|
1702
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1717
|
+
var result = getNumberHashCode(this.speedMS_1);
|
|
1718
|
+
result = imul(result, 31) + getNumberHashCode(this.directionRad_1) | 0;
|
|
1703
1719
|
return result;
|
|
1704
1720
|
};
|
|
1705
1721
|
protoOf(Wind).equals = function (other) {
|
|
@@ -1707,62 +1723,62 @@
|
|
|
1707
1723
|
return true;
|
|
1708
1724
|
if (!(other instanceof Wind))
|
|
1709
1725
|
return false;
|
|
1710
|
-
if (!equals(this.
|
|
1726
|
+
if (!equals(this.speedMS_1, other.speedMS_1))
|
|
1711
1727
|
return false;
|
|
1712
|
-
if (!equals(this.
|
|
1728
|
+
if (!equals(this.directionRad_1, other.directionRad_1))
|
|
1713
1729
|
return false;
|
|
1714
1730
|
return true;
|
|
1715
1731
|
};
|
|
1716
1732
|
function WindProviderNone() {
|
|
1717
1733
|
}
|
|
1718
|
-
protoOf(WindProviderNone).
|
|
1719
|
-
return Companion_getInstance_9().
|
|
1734
|
+
protoOf(WindProviderNone).wind_umf2tf_k$ = function (course, path, pointIndex) {
|
|
1735
|
+
return Companion_getInstance_9().NONE_1;
|
|
1720
1736
|
};
|
|
1721
1737
|
var WindProviderNone_instance;
|
|
1722
1738
|
function WindProviderNone_getInstance() {
|
|
1723
1739
|
return WindProviderNone_instance;
|
|
1724
1740
|
}
|
|
1725
1741
|
function WindProviderConstant(wind) {
|
|
1726
|
-
this.
|
|
1742
|
+
this.wind_1 = wind;
|
|
1727
1743
|
}
|
|
1728
|
-
protoOf(WindProviderConstant).
|
|
1729
|
-
return this.
|
|
1744
|
+
protoOf(WindProviderConstant).wind_umf2tf_k$ = function (course, path, pointIndex) {
|
|
1745
|
+
return this.wind_1;
|
|
1730
1746
|
};
|
|
1731
1747
|
function parseGpxWaypoints(xml) {
|
|
1732
1748
|
// Inline function 'kotlin.collections.map' call
|
|
1733
|
-
var this_0 = GpxParser_instance.
|
|
1749
|
+
var this_0 = GpxParser_instance.parse$default_ez0f31_k$(xml).waypoints_1;
|
|
1734
1750
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1735
1751
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1736
|
-
var _iterator__ex2g4s = this_0.
|
|
1737
|
-
while (_iterator__ex2g4s.
|
|
1738
|
-
var item = _iterator__ex2g4s.
|
|
1752
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
1753
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1754
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
1739
1755
|
var tmp$ret$2 = waypointObj(item);
|
|
1740
|
-
destination.
|
|
1756
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
1741
1757
|
}
|
|
1742
1758
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1743
1759
|
return copyToArray(destination);
|
|
1744
1760
|
}
|
|
1745
1761
|
function parseGpx(xml) {
|
|
1746
|
-
return firstTrackAsPath(GpxParser_instance.
|
|
1762
|
+
return firstTrackAsPath(GpxParser_instance.parse$default_ez0f31_k$(xml));
|
|
1747
1763
|
}
|
|
1748
1764
|
function parseGpxTracks(xml) {
|
|
1749
1765
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1750
|
-
var this_0 = tracksAsPaths(GpxParser_instance.
|
|
1766
|
+
var this_0 = tracksAsPaths(GpxParser_instance.parse$default_ez0f31_k$(xml));
|
|
1751
1767
|
return copyToArray(this_0);
|
|
1752
1768
|
}
|
|
1753
1769
|
function parseGpxSegments(xml) {
|
|
1754
1770
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1755
|
-
var this_0 = segmentsAsPaths(GpxParser_instance.
|
|
1771
|
+
var this_0 = segmentsAsPaths(GpxParser_instance.parse$default_ez0f31_k$(xml));
|
|
1756
1772
|
return copyToArray(this_0);
|
|
1757
1773
|
}
|
|
1758
1774
|
function parseGpxTracksOnly(xml) {
|
|
1759
1775
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1760
|
-
var this_0 = tracksAsPaths(GpxParser_instance.
|
|
1776
|
+
var this_0 = tracksAsPaths(GpxParser_instance.parse$default_ez0f31_k$(xml), setOf(GpxPathKind_TRACK_getInstance()));
|
|
1761
1777
|
return copyToArray(this_0);
|
|
1762
1778
|
}
|
|
1763
1779
|
function parseGpxRoutesOnly(xml) {
|
|
1764
1780
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1765
|
-
var this_0 = tracksAsPaths(GpxParser_instance.
|
|
1781
|
+
var this_0 = tracksAsPaths(GpxParser_instance.parse$default_ez0f31_k$(xml), setOf(GpxPathKind_ROUTE_getInstance()));
|
|
1766
1782
|
return copyToArray(this_0);
|
|
1767
1783
|
}
|
|
1768
1784
|
function writeGpxTracks(paths, waypoints, writeExtensions) {
|
|
@@ -1786,35 +1802,35 @@
|
|
|
1786
1802
|
var item = waypoints[inductionVariable];
|
|
1787
1803
|
inductionVariable = inductionVariable + 1 | 0;
|
|
1788
1804
|
var tmp$ret$3 = toGpxWaypoint(item);
|
|
1789
|
-
destination.
|
|
1805
|
+
destination.add_utx5q5_k$(tmp$ret$3);
|
|
1790
1806
|
}
|
|
1791
|
-
return tmp_0.
|
|
1807
|
+
return tmp_0.write$default_koqy5u_k$(tmp_1, VOID, VOID, destination, VOID, writeExtensions);
|
|
1792
1808
|
}
|
|
1793
1809
|
function pathSize(path) {
|
|
1794
|
-
return path.
|
|
1810
|
+
return path.size_1;
|
|
1795
1811
|
}
|
|
1796
1812
|
function pathTotalDistance(path) {
|
|
1797
|
-
return path.
|
|
1813
|
+
return path.totalDistance_1;
|
|
1798
1814
|
}
|
|
1799
1815
|
function pathDurationMs(path) {
|
|
1800
|
-
return path.
|
|
1816
|
+
return path.durationMs_1;
|
|
1801
1817
|
}
|
|
1802
1818
|
function pathElevationGain(path) {
|
|
1803
|
-
return path.
|
|
1819
|
+
return path.elevationGain_1;
|
|
1804
1820
|
}
|
|
1805
1821
|
function pathElevationLoss(path) {
|
|
1806
|
-
return path.
|
|
1822
|
+
return path.elevationLoss_1;
|
|
1807
1823
|
}
|
|
1808
1824
|
function pointAt(path, i) {
|
|
1809
|
-
return pointObj(path.
|
|
1825
|
+
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));
|
|
1810
1826
|
}
|
|
1811
1827
|
function writeGpx(path, writeExtensions) {
|
|
1812
1828
|
writeExtensions = writeExtensions === VOID ? true : writeExtensions;
|
|
1813
|
-
return GpxWriter_instance.
|
|
1829
|
+
return GpxWriter_instance.write_7y52k2_k$(toGpxDocument(path, VOID, 'virtualized'), writeExtensions);
|
|
1814
1830
|
}
|
|
1815
1831
|
function writeGpxAt(path, startTimeEpochMs, writeExtensions) {
|
|
1816
1832
|
writeExtensions = writeExtensions === VOID ? true : writeExtensions;
|
|
1817
|
-
return GpxWriter_instance.
|
|
1833
|
+
return GpxWriter_instance.write_7y52k2_k$(toGpxDocument(path, VOID, 'virtualized', Companion_getInstance().fromEpochMilliseconds_uaz65_k$(numberToLong(startTimeEpochMs))), writeExtensions);
|
|
1818
1834
|
}
|
|
1819
1835
|
function enhance(path, options) {
|
|
1820
1836
|
var tmp = GlobalScope_instance;
|
|
@@ -1825,7 +1841,7 @@
|
|
|
1825
1841
|
return promise(tmp, VOID, VOID, enhanceWithCourse$slambda_0(options, path, cyclist, bike, wind, power, null));
|
|
1826
1842
|
}
|
|
1827
1843
|
function getField(path, i, fieldProp) {
|
|
1828
|
-
var tmp0_elvis_lhs = Companion_getInstance_0().
|
|
1844
|
+
var tmp0_elvis_lhs = Companion_getInstance_0().byProp_kdf1eo_k$(fieldProp);
|
|
1829
1845
|
var tmp;
|
|
1830
1846
|
if (tmp0_elvis_lhs == null) {
|
|
1831
1847
|
// Inline function 'kotlin.error' call
|
|
@@ -1835,35 +1851,35 @@
|
|
|
1835
1851
|
tmp = tmp0_elvis_lhs;
|
|
1836
1852
|
}
|
|
1837
1853
|
var field = tmp;
|
|
1838
|
-
return path.
|
|
1854
|
+
return path.get_z3le6l_k$(i, field);
|
|
1839
1855
|
}
|
|
1840
1856
|
function fieldDefinitions() {
|
|
1841
1857
|
// Inline function 'kotlin.collections.map' call
|
|
1842
1858
|
var this_0 = get_entries();
|
|
1843
1859
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1844
1860
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1845
|
-
var _iterator__ex2g4s = this_0.
|
|
1846
|
-
while (_iterator__ex2g4s.
|
|
1847
|
-
var item = _iterator__ex2g4s.
|
|
1861
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
1862
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1863
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
1848
1864
|
var o = {};
|
|
1849
|
-
o.prop = item.
|
|
1850
|
-
o.unit = item.
|
|
1851
|
-
o.shortDescription = item.
|
|
1852
|
-
o.categoryId = item.
|
|
1853
|
-
o.categoryName = item.
|
|
1854
|
-
o.notSelectable = item.
|
|
1855
|
-
o.anglesInRadians = item.
|
|
1865
|
+
o.prop = item.prop_1;
|
|
1866
|
+
o.unit = item.unit_1;
|
|
1867
|
+
o.shortDescription = item.shortDescription_1;
|
|
1868
|
+
o.categoryId = item.category_1.id_1;
|
|
1869
|
+
o.categoryName = item.category_1.displayName_1;
|
|
1870
|
+
o.notSelectable = item.notSelectable_1;
|
|
1871
|
+
o.anglesInRadians = item.anglesInRadians_1;
|
|
1856
1872
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1857
|
-
destination.
|
|
1873
|
+
destination.add_utx5q5_k$(o);
|
|
1858
1874
|
}
|
|
1859
1875
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1860
1876
|
return copyToArray(destination);
|
|
1861
1877
|
}
|
|
1862
1878
|
function pathLatitudeDeg(path, i) {
|
|
1863
|
-
return path.
|
|
1879
|
+
return path.latitudeDeg_i25sm6_k$(i);
|
|
1864
1880
|
}
|
|
1865
1881
|
function pathLongitudeDeg(path, i) {
|
|
1866
|
-
return path.
|
|
1882
|
+
return path.longitudeDeg_ikk1un_k$(i);
|
|
1867
1883
|
}
|
|
1868
1884
|
function pathToCsv(path, separator, unitsInHeader) {
|
|
1869
1885
|
var tmp = CsvWriter_instance;
|
|
@@ -1875,18 +1891,18 @@
|
|
|
1875
1891
|
} else {
|
|
1876
1892
|
tmp_0 = tmp0_elvis_lhs;
|
|
1877
1893
|
}
|
|
1878
|
-
return tmp.
|
|
1894
|
+
return tmp.write_p5vnh4_k$(path, new CsvOptions(VOID, tmp_0, unitsInHeader));
|
|
1879
1895
|
}
|
|
1880
1896
|
function pathToJson(path, pretty) {
|
|
1881
|
-
return JsonWriter_instance.
|
|
1897
|
+
return JsonWriter_instance.write_lwqeog_k$(path, new JsonOptions(VOID, pretty));
|
|
1882
1898
|
}
|
|
1883
1899
|
function pathToFit(path, name, startTimeEpochMs) {
|
|
1884
|
-
return toFitBytes(path, name, Companion_getInstance().
|
|
1900
|
+
return toFitBytes(path, name, Companion_getInstance().fromEpochMilliseconds_uaz65_k$(numberToLong(startTimeEpochMs)));
|
|
1885
1901
|
}
|
|
1886
1902
|
function pathsToFit(paths, name, startTimeEpochMs, interPathGapMs) {
|
|
1887
1903
|
interPathGapMs = interPathGapMs === VOID ? 0.0 : interPathGapMs;
|
|
1888
1904
|
var tmp = toList(paths);
|
|
1889
|
-
var tmp_0 = Companion_getInstance().
|
|
1905
|
+
var tmp_0 = Companion_getInstance().fromEpochMilliseconds_uaz65_k$(numberToLong(startTimeEpochMs));
|
|
1890
1906
|
Companion_getInstance_1();
|
|
1891
1907
|
// Inline function 'kotlin.time.Companion.milliseconds' call
|
|
1892
1908
|
var this_0 = numberToLong(interPathGapMs);
|
|
@@ -1901,42 +1917,42 @@
|
|
|
1901
1917
|
}
|
|
1902
1918
|
function detectClimbs(path) {
|
|
1903
1919
|
// Inline function 'kotlin.collections.map' call
|
|
1904
|
-
var this_0 = ClimbDetector_instance.
|
|
1920
|
+
var this_0 = ClimbDetector_instance.detect$default_6ml3ny_k$(path);
|
|
1905
1921
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1906
1922
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1907
|
-
var _iterator__ex2g4s = this_0.
|
|
1908
|
-
while (_iterator__ex2g4s.
|
|
1909
|
-
var item = _iterator__ex2g4s.
|
|
1923
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
1924
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1925
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
1910
1926
|
var tmp$ret$2 = toDto_0(item);
|
|
1911
|
-
destination.
|
|
1927
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
1912
1928
|
}
|
|
1913
1929
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1914
1930
|
return copyToArray(destination);
|
|
1915
1931
|
}
|
|
1916
1932
|
function detectClimbsWithOptions(path, minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster) {
|
|
1917
1933
|
// Inline function 'kotlin.collections.map' call
|
|
1918
|
-
var this_0 = ClimbDetector_instance.
|
|
1934
|
+
var this_0 = ClimbDetector_instance.detect_llooq2_k$(path, new ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster));
|
|
1919
1935
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1920
1936
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1921
|
-
var _iterator__ex2g4s = this_0.
|
|
1922
|
-
while (_iterator__ex2g4s.
|
|
1923
|
-
var item = _iterator__ex2g4s.
|
|
1937
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
1938
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
1939
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
1924
1940
|
var tmp$ret$2 = toDto_0(item);
|
|
1925
|
-
destination.
|
|
1941
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
1926
1942
|
}
|
|
1927
1943
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1928
1944
|
return copyToArray(destination);
|
|
1929
1945
|
}
|
|
1930
1946
|
function waypointObj(w) {
|
|
1931
1947
|
var o = {};
|
|
1932
|
-
o.latitudeDeg = w.
|
|
1933
|
-
o.longitudeDeg = w.
|
|
1934
|
-
o.elevationM = w.
|
|
1935
|
-
o.name = w.
|
|
1936
|
-
o.description = w.
|
|
1937
|
-
o.symbol = w.
|
|
1938
|
-
o.type = w.
|
|
1939
|
-
var tmp0_safe_receiver = w.
|
|
1948
|
+
o.latitudeDeg = w.latitudeDeg_1;
|
|
1949
|
+
o.longitudeDeg = w.longitudeDeg_1;
|
|
1950
|
+
o.elevationM = w.elevationM_1;
|
|
1951
|
+
o.name = w.name_1;
|
|
1952
|
+
o.description = w.description_1;
|
|
1953
|
+
o.symbol = w.symbol_1;
|
|
1954
|
+
o.type = w.type_1;
|
|
1955
|
+
var tmp0_safe_receiver = w.timeEpochMs_1;
|
|
1940
1956
|
o.timeEpochMs = tmp0_safe_receiver == null ? null : toNumber(tmp0_safe_receiver);
|
|
1941
1957
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
1942
1958
|
return o;
|
|
@@ -2033,39 +2049,39 @@
|
|
|
2033
2049
|
}
|
|
2034
2050
|
function toDto(_this__u8e3s4) {
|
|
2035
2051
|
var o = {};
|
|
2036
|
-
o.startDistanceM = _this__u8e3s4.
|
|
2037
|
-
o.endDistanceM = _this__u8e3s4.
|
|
2038
|
-
o.startElevationM = _this__u8e3s4.
|
|
2039
|
-
o.endElevationM = _this__u8e3s4.
|
|
2040
|
-
o.lengthM = _this__u8e3s4.
|
|
2041
|
-
o.elevationGainM = _this__u8e3s4.
|
|
2042
|
-
o.grade = _this__u8e3s4.
|
|
2052
|
+
o.startDistanceM = _this__u8e3s4.startDistanceM_1;
|
|
2053
|
+
o.endDistanceM = _this__u8e3s4.endDistanceM_1;
|
|
2054
|
+
o.startElevationM = _this__u8e3s4.startElevationM_1;
|
|
2055
|
+
o.endElevationM = _this__u8e3s4.endElevationM_1;
|
|
2056
|
+
o.lengthM = _this__u8e3s4.get_lengthM_2aqrzy_k$();
|
|
2057
|
+
o.elevationGainM = _this__u8e3s4.get_elevationGainM_6kg9eu_k$();
|
|
2058
|
+
o.grade = _this__u8e3s4.get_grade_is33qm_k$();
|
|
2043
2059
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
2044
2060
|
return o;
|
|
2045
2061
|
}
|
|
2046
2062
|
function toDto_0(_this__u8e3s4) {
|
|
2047
2063
|
var o = {};
|
|
2048
|
-
o.startIndex = _this__u8e3s4.
|
|
2049
|
-
o.endIndex = _this__u8e3s4.
|
|
2050
|
-
o.startDistanceM = _this__u8e3s4.
|
|
2051
|
-
o.endDistanceM = _this__u8e3s4.
|
|
2052
|
-
o.startElevationM = _this__u8e3s4.
|
|
2053
|
-
o.endElevationM = _this__u8e3s4.
|
|
2054
|
-
o.lengthM = _this__u8e3s4.
|
|
2055
|
-
o.elevationGainM = _this__u8e3s4.
|
|
2056
|
-
o.averageGrade = _this__u8e3s4.
|
|
2057
|
-
o.climbingGrade = _this__u8e3s4.
|
|
2058
|
-
o.positiveElevationM = _this__u8e3s4.
|
|
2059
|
-
o.negativeElevationM = _this__u8e3s4.
|
|
2064
|
+
o.startIndex = _this__u8e3s4.startIndex_1;
|
|
2065
|
+
o.endIndex = _this__u8e3s4.endIndex_1;
|
|
2066
|
+
o.startDistanceM = _this__u8e3s4.startDistanceM_1;
|
|
2067
|
+
o.endDistanceM = _this__u8e3s4.endDistanceM_1;
|
|
2068
|
+
o.startElevationM = _this__u8e3s4.startElevationM_1;
|
|
2069
|
+
o.endElevationM = _this__u8e3s4.endElevationM_1;
|
|
2070
|
+
o.lengthM = _this__u8e3s4.get_lengthM_2aqrzy_k$();
|
|
2071
|
+
o.elevationGainM = _this__u8e3s4.get_elevationGainM_6kg9eu_k$();
|
|
2072
|
+
o.averageGrade = _this__u8e3s4.get_averageGrade_oooweb_k$();
|
|
2073
|
+
o.climbingGrade = _this__u8e3s4.get_climbingGrade_olocdd_k$();
|
|
2074
|
+
o.positiveElevationM = _this__u8e3s4.positiveElevationM_1;
|
|
2075
|
+
o.negativeElevationM = _this__u8e3s4.negativeElevationM_1;
|
|
2060
2076
|
// Inline function 'kotlin.collections.map' call
|
|
2061
|
-
var this_0 = _this__u8e3s4.
|
|
2077
|
+
var this_0 = _this__u8e3s4.parts_1;
|
|
2062
2078
|
// Inline function 'kotlin.collections.mapTo' call
|
|
2063
2079
|
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
2064
|
-
var _iterator__ex2g4s = this_0.
|
|
2065
|
-
while (_iterator__ex2g4s.
|
|
2066
|
-
var item = _iterator__ex2g4s.
|
|
2080
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
2081
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
2082
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
2067
2083
|
var tmp$ret$2 = toDto(item);
|
|
2068
|
-
destination.
|
|
2084
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
2069
2085
|
}
|
|
2070
2086
|
// Inline function 'kotlin.collections.toTypedArray' call
|
|
2071
2087
|
o.parts = copyToArray(destination);
|
|
@@ -2073,31 +2089,31 @@
|
|
|
2073
2089
|
return o;
|
|
2074
2090
|
}
|
|
2075
2091
|
function enhance$slambda($options, $path, resultContinuation) {
|
|
2076
|
-
this
|
|
2077
|
-
this
|
|
2092
|
+
this.$options_1 = $options;
|
|
2093
|
+
this.$path_1 = $path;
|
|
2078
2094
|
CoroutineImpl.call(this, resultContinuation);
|
|
2079
2095
|
}
|
|
2080
|
-
protoOf(enhance$slambda).
|
|
2081
|
-
var tmp = this.
|
|
2082
|
-
tmp.
|
|
2083
|
-
tmp.
|
|
2084
|
-
return tmp.
|
|
2096
|
+
protoOf(enhance$slambda).invoke_jiwoso_k$ = function ($this$promise, $completion) {
|
|
2097
|
+
var tmp = this.create_rcuf4x_k$($this$promise, $completion);
|
|
2098
|
+
tmp.result_1 = Unit_instance;
|
|
2099
|
+
tmp.exception_1 = null;
|
|
2100
|
+
return tmp.doResume_5yljmg_k$();
|
|
2085
2101
|
};
|
|
2086
|
-
protoOf(enhance$slambda).
|
|
2087
|
-
return this.
|
|
2102
|
+
protoOf(enhance$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
|
|
2103
|
+
return this.invoke_jiwoso_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
2088
2104
|
};
|
|
2089
|
-
protoOf(enhance$slambda).
|
|
2090
|
-
var suspendResult = this.
|
|
2105
|
+
protoOf(enhance$slambda).doResume_5yljmg_k$ = function () {
|
|
2106
|
+
var suspendResult = this.result_1;
|
|
2091
2107
|
$sm: do
|
|
2092
2108
|
try {
|
|
2093
|
-
var tmp = this.
|
|
2109
|
+
var tmp = this.state_1;
|
|
2094
2110
|
switch (tmp) {
|
|
2095
2111
|
case 0:
|
|
2096
|
-
this.
|
|
2097
|
-
var opts = toEnhanceOptions(this
|
|
2098
|
-
var provider = opts.
|
|
2099
|
-
this.
|
|
2100
|
-
suspendResult = Enhancer_instance.
|
|
2112
|
+
this.exceptionState_1 = 2;
|
|
2113
|
+
var opts = toEnhanceOptions(this.$options_1);
|
|
2114
|
+
var provider = opts.fixElevation_1 ? new ElevationProvider() : null;
|
|
2115
|
+
this.state_1 = 1;
|
|
2116
|
+
suspendResult = Enhancer_instance.enhanceCourseDefault_jm937y_k$(this.$path_1, provider, opts, this);
|
|
2101
2117
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2102
2118
|
return suspendResult;
|
|
2103
2119
|
}
|
|
@@ -2106,61 +2122,61 @@
|
|
|
2106
2122
|
case 1:
|
|
2107
2123
|
return suspendResult;
|
|
2108
2124
|
case 2:
|
|
2109
|
-
throw this.
|
|
2125
|
+
throw this.exception_1;
|
|
2110
2126
|
}
|
|
2111
2127
|
} catch ($p) {
|
|
2112
2128
|
var e = $p;
|
|
2113
|
-
if (this.
|
|
2129
|
+
if (this.exceptionState_1 === 2) {
|
|
2114
2130
|
throw e;
|
|
2115
2131
|
} else {
|
|
2116
|
-
this.
|
|
2117
|
-
this.
|
|
2132
|
+
this.state_1 = this.exceptionState_1;
|
|
2133
|
+
this.exception_1 = e;
|
|
2118
2134
|
}
|
|
2119
2135
|
}
|
|
2120
2136
|
while (true);
|
|
2121
2137
|
};
|
|
2122
|
-
protoOf(enhance$slambda).
|
|
2123
|
-
var i = new enhance$slambda(this
|
|
2124
|
-
i
|
|
2138
|
+
protoOf(enhance$slambda).create_rcuf4x_k$ = function ($this$promise, completion) {
|
|
2139
|
+
var i = new enhance$slambda(this.$options_1, this.$path_1, completion);
|
|
2140
|
+
i.$this$promise_1 = $this$promise;
|
|
2125
2141
|
return i;
|
|
2126
2142
|
};
|
|
2127
2143
|
function enhance$slambda_0($options, $path, resultContinuation) {
|
|
2128
2144
|
var i = new enhance$slambda($options, $path, resultContinuation);
|
|
2129
2145
|
return constructCallableReference(function ($this$promise, $completion) {
|
|
2130
|
-
return i.
|
|
2146
|
+
return i.invoke_jiwoso_k$($this$promise, $completion);
|
|
2131
2147
|
}, 1);
|
|
2132
2148
|
}
|
|
2133
2149
|
function enhanceWithCourse$slambda($options, $path, $cyclist, $bike, $wind, $power, resultContinuation) {
|
|
2134
|
-
this
|
|
2135
|
-
this
|
|
2136
|
-
this
|
|
2137
|
-
this
|
|
2138
|
-
this
|
|
2139
|
-
this
|
|
2150
|
+
this.$options_1 = $options;
|
|
2151
|
+
this.$path_1 = $path;
|
|
2152
|
+
this.$cyclist_1 = $cyclist;
|
|
2153
|
+
this.$bike_1 = $bike;
|
|
2154
|
+
this.$wind_1 = $wind;
|
|
2155
|
+
this.$power_1 = $power;
|
|
2140
2156
|
CoroutineImpl.call(this, resultContinuation);
|
|
2141
2157
|
}
|
|
2142
|
-
protoOf(enhanceWithCourse$slambda).
|
|
2143
|
-
var tmp = this.
|
|
2144
|
-
tmp.
|
|
2145
|
-
tmp.
|
|
2146
|
-
return tmp.
|
|
2158
|
+
protoOf(enhanceWithCourse$slambda).invoke_jiwoso_k$ = function ($this$promise, $completion) {
|
|
2159
|
+
var tmp = this.create_rcuf4x_k$($this$promise, $completion);
|
|
2160
|
+
tmp.result_1 = Unit_instance;
|
|
2161
|
+
tmp.exception_1 = null;
|
|
2162
|
+
return tmp.doResume_5yljmg_k$();
|
|
2147
2163
|
};
|
|
2148
|
-
protoOf(enhanceWithCourse$slambda).
|
|
2149
|
-
return this.
|
|
2164
|
+
protoOf(enhanceWithCourse$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
|
|
2165
|
+
return this.invoke_jiwoso_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
2150
2166
|
};
|
|
2151
|
-
protoOf(enhanceWithCourse$slambda).
|
|
2152
|
-
var suspendResult = this.
|
|
2167
|
+
protoOf(enhanceWithCourse$slambda).doResume_5yljmg_k$ = function () {
|
|
2168
|
+
var suspendResult = this.result_1;
|
|
2153
2169
|
$sm: do
|
|
2154
2170
|
try {
|
|
2155
|
-
var tmp = this.
|
|
2171
|
+
var tmp = this.state_1;
|
|
2156
2172
|
switch (tmp) {
|
|
2157
2173
|
case 0:
|
|
2158
|
-
this.
|
|
2159
|
-
var opts = toEnhanceOptions(this
|
|
2160
|
-
var provider = opts.
|
|
2161
|
-
var course = new CoursePhysics(new Course(this
|
|
2162
|
-
this.
|
|
2163
|
-
suspendResult = Enhancer_instance.
|
|
2174
|
+
this.exceptionState_1 = 2;
|
|
2175
|
+
var opts = toEnhanceOptions(this.$options_1);
|
|
2176
|
+
var provider = opts.fixElevation_1 ? new ElevationProvider() : null;
|
|
2177
|
+
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));
|
|
2178
|
+
this.state_1 = 1;
|
|
2179
|
+
suspendResult = Enhancer_instance.enhanceCourse_mout3j_k$(course, opts, provider, this);
|
|
2164
2180
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
2165
2181
|
return suspendResult;
|
|
2166
2182
|
}
|
|
@@ -2169,28 +2185,28 @@
|
|
|
2169
2185
|
case 1:
|
|
2170
2186
|
return suspendResult;
|
|
2171
2187
|
case 2:
|
|
2172
|
-
throw this.
|
|
2188
|
+
throw this.exception_1;
|
|
2173
2189
|
}
|
|
2174
2190
|
} catch ($p) {
|
|
2175
2191
|
var e = $p;
|
|
2176
|
-
if (this.
|
|
2192
|
+
if (this.exceptionState_1 === 2) {
|
|
2177
2193
|
throw e;
|
|
2178
2194
|
} else {
|
|
2179
|
-
this.
|
|
2180
|
-
this.
|
|
2195
|
+
this.state_1 = this.exceptionState_1;
|
|
2196
|
+
this.exception_1 = e;
|
|
2181
2197
|
}
|
|
2182
2198
|
}
|
|
2183
2199
|
while (true);
|
|
2184
2200
|
};
|
|
2185
|
-
protoOf(enhanceWithCourse$slambda).
|
|
2186
|
-
var i = new enhanceWithCourse$slambda(this
|
|
2187
|
-
i
|
|
2201
|
+
protoOf(enhanceWithCourse$slambda).create_rcuf4x_k$ = function ($this$promise, completion) {
|
|
2202
|
+
var i = new enhanceWithCourse$slambda(this.$options_1, this.$path_1, this.$cyclist_1, this.$bike_1, this.$wind_1, this.$power_1, completion);
|
|
2203
|
+
i.$this$promise_1 = $this$promise;
|
|
2188
2204
|
return i;
|
|
2189
2205
|
};
|
|
2190
2206
|
function enhanceWithCourse$slambda_0($options, $path, $cyclist, $bike, $wind, $power, resultContinuation) {
|
|
2191
2207
|
var i = new enhanceWithCourse$slambda($options, $path, $cyclist, $bike, $wind, $power, resultContinuation);
|
|
2192
2208
|
return constructCallableReference(function ($this$promise, $completion) {
|
|
2193
|
-
return i.
|
|
2209
|
+
return i.invoke_jiwoso_k$($this$promise, $completion);
|
|
2194
2210
|
}, 1);
|
|
2195
2211
|
}
|
|
2196
2212
|
//region block: init
|