@glandais/vcyclist-engine 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -8
- package/kotlin-kotlin-stdlib.js +3193 -1808
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kotlinx-atomicfu.js +22 -22
- package/kotlinx-coroutines-core.js +1212 -1184
- package/kotlinx-coroutines-core.js.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.js +1 -1
- package/package.json +3 -2
- package/vcyclist-elevation.js +925 -918
- package/vcyclist-elevation.js.map +1 -1
- package/vcyclist-engine.d.ts +10 -0
- package/vcyclist-engine.js +1148 -2519
- package/vcyclist-engine.js.map +1 -1
- package/vcyclist-fit.js +656 -0
- package/vcyclist-fit.js.map +1 -0
- package/vcyclist-gpx.js +3401 -0
- package/vcyclist-gpx.js.map +1 -0
- package/xmlutil-core.js +8125 -3739
- package/xmlutil-core.js.map +1 -1
package/vcyclist-engine.js
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
1
1
|
(function (factory) {
|
|
2
2
|
if (typeof define === 'function' && define.amd)
|
|
3
|
-
define(['exports', './kotlin-kotlin-stdlib.js', './vcyclist-
|
|
3
|
+
define(['exports', './kotlin-kotlin-stdlib.js', './vcyclist-gpx.js', './vcyclist-elevation.js', './kotlinx-coroutines-core.js', './vcyclist-fit.js'], factory);
|
|
4
4
|
else if (typeof exports === 'object')
|
|
5
|
-
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./vcyclist-
|
|
5
|
+
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./vcyclist-gpx.js'), require('./vcyclist-elevation.js'), require('./kotlinx-coroutines-core.js'), require('./vcyclist-fit.js'));
|
|
6
6
|
else {
|
|
7
7
|
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
8
|
throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'io.github.glandais:engine'.");
|
|
9
9
|
}
|
|
10
|
+
if (typeof globalThis['vcyclist-gpx'] === 'undefined') {
|
|
11
|
+
throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'vcyclist-gpx' was not found. Please, check whether 'vcyclist-gpx' is loaded prior to 'io.github.glandais:engine'.");
|
|
12
|
+
}
|
|
10
13
|
if (typeof globalThis['vcyclist-elevation'] === 'undefined') {
|
|
11
14
|
throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'vcyclist-elevation' was not found. Please, check whether 'vcyclist-elevation' is loaded prior to 'io.github.glandais:engine'.");
|
|
12
15
|
}
|
|
13
|
-
if (typeof globalThis['xmlutil-core'] === 'undefined') {
|
|
14
|
-
throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'xmlutil-core' was not found. Please, check whether 'xmlutil-core' is loaded prior to 'io.github.glandais:engine'.");
|
|
15
|
-
}
|
|
16
16
|
if (typeof globalThis['kotlinx-coroutines-core'] === 'undefined') {
|
|
17
17
|
throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'kotlinx-coroutines-core' was not found. Please, check whether 'kotlinx-coroutines-core' is loaded prior to 'io.github.glandais:engine'.");
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
if (typeof globalThis['vcyclist-fit'] === 'undefined') {
|
|
20
|
+
throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'vcyclist-fit' was not found. Please, check whether 'vcyclist-fit' is loaded prior to 'io.github.glandais:engine'.");
|
|
21
|
+
}
|
|
22
|
+
globalThis['io.github.glandais:engine'] = factory(typeof globalThis['io.github.glandais:engine'] === 'undefined' ? {} : globalThis['io.github.glandais:engine'], globalThis['kotlin-kotlin-stdlib'], globalThis['vcyclist-gpx'], globalThis['vcyclist-elevation'], globalThis['kotlinx-coroutines-core'], globalThis['vcyclist-fit']);
|
|
20
23
|
}
|
|
21
|
-
}(function (_, kotlin_kotlin, kotlin_io_github_glandais_elevation,
|
|
24
|
+
}(function (_, kotlin_kotlin, kotlin_io_github_glandais_gpx, kotlin_io_github_glandais_elevation, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_io_github_glandais_fit) {
|
|
22
25
|
'use strict';
|
|
23
26
|
//region block: imports
|
|
24
27
|
var imul = Math.imul;
|
|
25
|
-
var protoOf = kotlin_kotlin.$_$.
|
|
26
|
-
var initMetadataForCompanion = kotlin_kotlin.$_$.
|
|
28
|
+
var protoOf = kotlin_kotlin.$_$.y5;
|
|
29
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.k5;
|
|
27
30
|
var VOID = kotlin_kotlin.$_$.a;
|
|
28
|
-
var getNumberHashCode = kotlin_kotlin.$_$.
|
|
29
|
-
var equals = kotlin_kotlin.$_$.
|
|
30
|
-
var initMetadataForClass = kotlin_kotlin.$_$.
|
|
31
|
-
var toString = kotlin_kotlin.$_$.
|
|
32
|
-
var hashCode = kotlin_kotlin.$_$.
|
|
33
|
-
var getBooleanHashCode = kotlin_kotlin.$_$.
|
|
34
|
-
var CoroutineImpl = kotlin_kotlin.$_$.
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var toDoubleOrNull = kotlin_kotlin.$_$.a6;
|
|
58
|
-
var numberToInt = kotlin_kotlin.$_$.d5;
|
|
59
|
-
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.s;
|
|
60
|
-
var Companion_getInstance = kotlin_kotlin.$_$.e;
|
|
61
|
-
var IllegalArgumentException = kotlin_kotlin.$_$.l6;
|
|
62
|
-
var get_xmlStreaming = kotlin_io_github_pdvrieze_xmlutil_core.$_$.e;
|
|
63
|
-
var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.z;
|
|
64
|
-
var XmlException = kotlin_io_github_pdvrieze_xmlutil_core.$_$.c;
|
|
65
|
-
var firstOrNull = kotlin_kotlin.$_$.l2;
|
|
66
|
-
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.a1;
|
|
67
|
-
var toNumber = kotlin_kotlin.$_$.c4;
|
|
68
|
-
var XmlDeclMode_None_getInstance = kotlin_io_github_pdvrieze_xmlutil_core.$_$.b;
|
|
69
|
-
var newGenericWriter = kotlin_io_github_pdvrieze_xmlutil_core.$_$.d;
|
|
70
|
-
var LatLon = kotlin_io_github_glandais_elevation.$_$.g;
|
|
71
|
-
var ElevationSmoother_instance = kotlin_io_github_glandais_elevation.$_$.c;
|
|
72
|
-
var until = kotlin_kotlin.$_$.p5;
|
|
73
|
-
var LatLonElevation = kotlin_io_github_glandais_elevation.$_$.f;
|
|
74
|
-
var arrayCopy = kotlin_kotlin.$_$.a2;
|
|
75
|
-
var Distance_instance = kotlin_io_github_glandais_elevation.$_$.a;
|
|
31
|
+
var getNumberHashCode = kotlin_kotlin.$_$.f5;
|
|
32
|
+
var equals = kotlin_kotlin.$_$.d5;
|
|
33
|
+
var initMetadataForClass = kotlin_kotlin.$_$.j5;
|
|
34
|
+
var toString = kotlin_kotlin.$_$.a6;
|
|
35
|
+
var hashCode = kotlin_kotlin.$_$.i5;
|
|
36
|
+
var getBooleanHashCode = kotlin_kotlin.$_$.e5;
|
|
37
|
+
var CoroutineImpl = kotlin_kotlin.$_$.d4;
|
|
38
|
+
var PointPerDistance_instance = kotlin_io_github_glandais_gpx.$_$.h;
|
|
39
|
+
var ElevationStep_instance = kotlin_io_github_glandais_gpx.$_$.e;
|
|
40
|
+
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.o3;
|
|
41
|
+
var Unit_instance = kotlin_kotlin.$_$.t;
|
|
42
|
+
var PointPerSecond_instance = kotlin_io_github_glandais_gpx.$_$.i;
|
|
43
|
+
var PathSimplifier_instance = kotlin_io_github_glandais_gpx.$_$.f;
|
|
44
|
+
var initMetadataForCoroutine = kotlin_kotlin.$_$.l5;
|
|
45
|
+
var initMetadataForObject = kotlin_kotlin.$_$.p5;
|
|
46
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.x;
|
|
47
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.m1;
|
|
48
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.w;
|
|
49
|
+
var last = kotlin_kotlin.$_$.y2;
|
|
50
|
+
var toIntArray = kotlin_kotlin.$_$.i3;
|
|
51
|
+
var sortedWith = kotlin_kotlin.$_$.g3;
|
|
52
|
+
var toMutableList = kotlin_kotlin.$_$.l3;
|
|
53
|
+
var first = kotlin_kotlin.$_$.s2;
|
|
54
|
+
var removeAll = kotlin_kotlin.$_$.c3;
|
|
55
|
+
var numberRangeToNumber = kotlin_kotlin.$_$.u5;
|
|
56
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.j2;
|
|
57
|
+
var Vector3D = kotlin_io_github_glandais_elevation.$_$.h;
|
|
58
|
+
var emptyList = kotlin_kotlin.$_$.p2;
|
|
59
|
+
var coerceIn = kotlin_kotlin.$_$.h6;
|
|
76
60
|
var DouglasPeucker_instance = kotlin_io_github_glandais_elevation.$_$.b;
|
|
77
|
-
var
|
|
78
|
-
var
|
|
79
|
-
var
|
|
80
|
-
var
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
var
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
var
|
|
61
|
+
var FunctionAdapter = kotlin_kotlin.$_$.t4;
|
|
62
|
+
var isInterface = kotlin_kotlin.$_$.r5;
|
|
63
|
+
var Comparator = kotlin_kotlin.$_$.w7;
|
|
64
|
+
var compareValues = kotlin_kotlin.$_$.m3;
|
|
65
|
+
var until = kotlin_kotlin.$_$.l6;
|
|
66
|
+
var Default_getInstance = kotlin_kotlin.$_$.p;
|
|
67
|
+
var PointField_TEMPERATURE_getInstance = kotlin_io_github_glandais_gpx.$_$.j;
|
|
68
|
+
var isNaN_0 = kotlin_kotlin.$_$.n8;
|
|
69
|
+
var get_entries = kotlin_io_github_glandais_gpx.$_$.s;
|
|
70
|
+
var Path = kotlin_io_github_glandais_gpx.$_$.r;
|
|
71
|
+
var GpxParser_instance = kotlin_io_github_glandais_gpx.$_$.a;
|
|
72
|
+
var copyToArray = kotlin_kotlin.$_$.o2;
|
|
73
|
+
var firstTrackAsPath = kotlin_io_github_glandais_gpx.$_$.l;
|
|
74
|
+
var tracksAsPaths = kotlin_io_github_glandais_gpx.$_$.o;
|
|
75
|
+
var segmentsAsPaths = kotlin_io_github_glandais_gpx.$_$.m;
|
|
76
|
+
var GpxWriter_instance = kotlin_io_github_glandais_gpx.$_$.b;
|
|
77
|
+
var toList = kotlin_kotlin.$_$.k3;
|
|
78
|
+
var toGpxDocument = kotlin_io_github_glandais_gpx.$_$.n;
|
|
79
|
+
var Companion_getInstance = kotlin_kotlin.$_$.r;
|
|
80
|
+
var numberToLong = kotlin_kotlin.$_$.q4;
|
|
93
81
|
var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
|
|
94
82
|
var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
|
|
95
|
-
var
|
|
83
|
+
var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.g;
|
|
84
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.o1;
|
|
85
|
+
var CsvWriter_instance = kotlin_io_github_glandais_gpx.$_$.c;
|
|
86
|
+
var firstOrNull = kotlin_kotlin.$_$.z6;
|
|
87
|
+
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.b;
|
|
88
|
+
var Char = kotlin_kotlin.$_$.v7;
|
|
89
|
+
var CsvOptions = kotlin_io_github_glandais_gpx.$_$.p;
|
|
90
|
+
var JsonWriter_instance = kotlin_io_github_glandais_gpx.$_$.d;
|
|
91
|
+
var JsonOptions = kotlin_io_github_glandais_gpx.$_$.q;
|
|
92
|
+
var toFitBytes = kotlin_io_github_glandais_fit.$_$.a;
|
|
93
|
+
var toNumber = kotlin_kotlin.$_$.s4;
|
|
94
|
+
var GpxWaypoint = kotlin_io_github_glandais_gpx.$_$.k;
|
|
95
|
+
var THROW_CCE = kotlin_kotlin.$_$.g8;
|
|
96
96
|
var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
|
|
97
|
-
var isInterface = kotlin_kotlin.$_$.a5;
|
|
98
97
|
var ElevationProvider = kotlin_io_github_glandais_elevation.$_$.e;
|
|
99
|
-
var initMetadataForLambda = kotlin_kotlin.$_$.
|
|
98
|
+
var initMetadataForLambda = kotlin_kotlin.$_$.o5;
|
|
99
|
+
var constructCallableReference = kotlin_kotlin.$_$.b5;
|
|
100
100
|
//endregion
|
|
101
101
|
//region block: pre-declaration
|
|
102
102
|
initMetadataForCompanion(Companion);
|
|
@@ -111,32 +111,19 @@
|
|
|
111
111
|
initMetadataForClass(EnhanceOptions, 'EnhanceOptions', EnhanceOptions);
|
|
112
112
|
initMetadataForCoroutine($enhanceCourseCOROUTINE$, CoroutineImpl);
|
|
113
113
|
initMetadataForObject(Enhancer, 'Enhancer', VOID, VOID, VOID, [3]);
|
|
114
|
-
initMetadataForClass(
|
|
115
|
-
initMetadataForClass(
|
|
116
|
-
initMetadataForClass(GpxTrackPoint, 'GpxTrackPoint');
|
|
117
|
-
initMetadataForClass(ExtensionsAccumulator, 'ExtensionsAccumulator', ExtensionsAccumulator);
|
|
118
|
-
initMetadataForObject(GpxParser, 'GpxParser');
|
|
119
|
-
initMetadataForObject(GpxWriter, 'GpxWriter');
|
|
120
|
-
initMetadataForCoroutine($fixElevationCOROUTINE$, CoroutineImpl);
|
|
121
|
-
initMetadataForObject(ElevationStep, 'ElevationStep', VOID, VOID, VOID, [2]);
|
|
122
|
-
initMetadataForClass(GeneratedPath, 'GeneratedPath');
|
|
114
|
+
initMetadataForClass(Climb, 'Climb');
|
|
115
|
+
initMetadataForClass(ClimbPart, 'ClimbPart');
|
|
123
116
|
initMetadataForCompanion(Companion_3);
|
|
124
|
-
initMetadataForClass(
|
|
117
|
+
initMetadataForClass(ClimbOptions, 'ClimbOptions', ClimbOptions);
|
|
125
118
|
initMetadataForCompanion(Companion_4);
|
|
126
|
-
initMetadataForClass(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
initMetadataForClass(
|
|
130
|
-
|
|
131
|
-
initMetadataForClass(Copy, 'Copy');
|
|
132
|
-
initMetadataForClass(Interpolate, 'Interpolate');
|
|
133
|
-
initMetadataForObject(PointPerDistance, 'PointPerDistance');
|
|
134
|
-
initMetadataForClass(Copy_0, 'Copy');
|
|
135
|
-
initMetadataForClass(Interpolate_0, 'Interpolate');
|
|
136
|
-
initMetadataForObject(PointPerSecond, 'PointPerSecond');
|
|
119
|
+
initMetadataForClass(Profile, 'Profile');
|
|
120
|
+
initMetadataForClass(Candidate, 'Candidate');
|
|
121
|
+
initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
122
|
+
initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
|
|
123
|
+
initMetadataForObject(ClimbDetector, 'ClimbDetector');
|
|
137
124
|
initMetadataForObject(AeroPowerProvider, 'AeroPowerProvider');
|
|
138
125
|
initMetadataForObject(AeroProviderConstant, 'AeroProviderConstant');
|
|
139
|
-
initMetadataForCompanion(
|
|
126
|
+
initMetadataForCompanion(Companion_5);
|
|
140
127
|
initMetadataForClass(CyclistPowerProviderBase, 'CyclistPowerProviderBase');
|
|
141
128
|
initMetadataForObject(GravPowerProvider, 'GravPowerProvider');
|
|
142
129
|
initMetadataForClass(Harmonic, 'Harmonic');
|
|
@@ -151,7 +138,7 @@
|
|
|
151
138
|
initMetadataForObject(RollingResistancePowerProvider, 'RollingResistancePowerProvider');
|
|
152
139
|
initMetadataForObject(VirtualizeService, 'VirtualizeService');
|
|
153
140
|
initMetadataForObject(WheelBearingsPowerProvider, 'WheelBearingsPowerProvider');
|
|
154
|
-
initMetadataForCompanion(
|
|
141
|
+
initMetadataForCompanion(Companion_6);
|
|
155
142
|
initMetadataForClass(Wind, 'Wind');
|
|
156
143
|
initMetadataForObject(WindProviderNone, 'WindProviderNone');
|
|
157
144
|
initMetadataForClass(WindProviderConstant, 'WindProviderConstant');
|
|
@@ -160,36 +147,36 @@
|
|
|
160
147
|
//endregion
|
|
161
148
|
function Companion() {
|
|
162
149
|
Companion_instance = this;
|
|
163
|
-
this.
|
|
150
|
+
this.m1y_1 = new Bike();
|
|
164
151
|
}
|
|
165
152
|
var Companion_instance;
|
|
166
|
-
function
|
|
153
|
+
function Companion_getInstance_1() {
|
|
167
154
|
if (Companion_instance == null)
|
|
168
155
|
new Companion();
|
|
169
156
|
return Companion_instance;
|
|
170
157
|
}
|
|
171
158
|
function Bike(crr, inertiaFront, inertiaRear, wheelRadiusM, efficiency) {
|
|
172
|
-
|
|
159
|
+
Companion_getInstance_1();
|
|
173
160
|
crr = crr === VOID ? 0.004 : crr;
|
|
174
161
|
inertiaFront = inertiaFront === VOID ? 0.05 : inertiaFront;
|
|
175
162
|
inertiaRear = inertiaRear === VOID ? 0.07 : inertiaRear;
|
|
176
163
|
wheelRadiusM = wheelRadiusM === VOID ? 0.7 : wheelRadiusM;
|
|
177
164
|
efficiency = efficiency === VOID ? 0.976 : efficiency;
|
|
178
|
-
this.
|
|
179
|
-
this.
|
|
180
|
-
this.
|
|
181
|
-
this.
|
|
182
|
-
this.
|
|
165
|
+
this.n1y_1 = crr;
|
|
166
|
+
this.o1y_1 = inertiaFront;
|
|
167
|
+
this.p1y_1 = inertiaRear;
|
|
168
|
+
this.q1y_1 = wheelRadiusM;
|
|
169
|
+
this.r1y_1 = efficiency;
|
|
183
170
|
}
|
|
184
171
|
protoOf(Bike).toString = function () {
|
|
185
|
-
return 'Bike(crr=' + this.
|
|
172
|
+
return 'Bike(crr=' + this.n1y_1 + ', inertiaFront=' + this.o1y_1 + ', inertiaRear=' + this.p1y_1 + ', wheelRadiusM=' + this.q1y_1 + ', efficiency=' + this.r1y_1 + ')';
|
|
186
173
|
};
|
|
187
174
|
protoOf(Bike).hashCode = function () {
|
|
188
|
-
var result = getNumberHashCode(this.
|
|
189
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
190
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
191
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
192
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
175
|
+
var result = getNumberHashCode(this.n1y_1);
|
|
176
|
+
result = imul(result, 31) + getNumberHashCode(this.o1y_1) | 0;
|
|
177
|
+
result = imul(result, 31) + getNumberHashCode(this.p1y_1) | 0;
|
|
178
|
+
result = imul(result, 31) + getNumberHashCode(this.q1y_1) | 0;
|
|
179
|
+
result = imul(result, 31) + getNumberHashCode(this.r1y_1) | 0;
|
|
193
180
|
return result;
|
|
194
181
|
};
|
|
195
182
|
protoOf(Bike).equals = function (other) {
|
|
@@ -197,41 +184,41 @@
|
|
|
197
184
|
return true;
|
|
198
185
|
if (!(other instanceof Bike))
|
|
199
186
|
return false;
|
|
200
|
-
if (!equals(this.
|
|
187
|
+
if (!equals(this.n1y_1, other.n1y_1))
|
|
201
188
|
return false;
|
|
202
|
-
if (!equals(this.
|
|
189
|
+
if (!equals(this.o1y_1, other.o1y_1))
|
|
203
190
|
return false;
|
|
204
|
-
if (!equals(this.
|
|
191
|
+
if (!equals(this.p1y_1, other.p1y_1))
|
|
205
192
|
return false;
|
|
206
|
-
if (!equals(this.
|
|
193
|
+
if (!equals(this.q1y_1, other.q1y_1))
|
|
207
194
|
return false;
|
|
208
|
-
if (!equals(this.
|
|
195
|
+
if (!equals(this.r1y_1, other.r1y_1))
|
|
209
196
|
return false;
|
|
210
197
|
return true;
|
|
211
198
|
};
|
|
212
199
|
function Course(path, cyclist, bike) {
|
|
213
|
-
cyclist = cyclist === VOID ?
|
|
214
|
-
bike = bike === VOID ?
|
|
215
|
-
this.
|
|
216
|
-
this.
|
|
217
|
-
this.
|
|
200
|
+
cyclist = cyclist === VOID ? Companion_getInstance_3().s1y_1 : cyclist;
|
|
201
|
+
bike = bike === VOID ? Companion_getInstance_1().m1y_1 : bike;
|
|
202
|
+
this.t1y_1 = path;
|
|
203
|
+
this.u1y_1 = cyclist;
|
|
204
|
+
this.v1y_1 = bike;
|
|
218
205
|
}
|
|
219
|
-
protoOf(Course).
|
|
206
|
+
protoOf(Course).w1y = function (path, cyclist, bike) {
|
|
220
207
|
return new Course(path, cyclist, bike);
|
|
221
208
|
};
|
|
222
|
-
protoOf(Course).
|
|
223
|
-
path = path === VOID ? this.
|
|
224
|
-
cyclist = cyclist === VOID ? this.
|
|
225
|
-
bike = bike === VOID ? this.
|
|
226
|
-
return $super === VOID ? this.
|
|
209
|
+
protoOf(Course).x1y = function (path, cyclist, bike, $super) {
|
|
210
|
+
path = path === VOID ? this.t1y_1 : path;
|
|
211
|
+
cyclist = cyclist === VOID ? this.u1y_1 : cyclist;
|
|
212
|
+
bike = bike === VOID ? this.v1y_1 : bike;
|
|
213
|
+
return $super === VOID ? this.w1y(path, cyclist, bike) : $super.w1y.call(this, path, cyclist, bike);
|
|
227
214
|
};
|
|
228
215
|
protoOf(Course).toString = function () {
|
|
229
|
-
return 'Course(path=' + toString(this.
|
|
216
|
+
return 'Course(path=' + toString(this.t1y_1) + ', cyclist=' + this.u1y_1.toString() + ', bike=' + this.v1y_1.toString() + ')';
|
|
230
217
|
};
|
|
231
218
|
protoOf(Course).hashCode = function () {
|
|
232
|
-
var result = hashCode(this.
|
|
233
|
-
result = imul(result, 31) + this.
|
|
234
|
-
result = imul(result, 31) + this.
|
|
219
|
+
var result = hashCode(this.t1y_1);
|
|
220
|
+
result = imul(result, 31) + this.u1y_1.hashCode() | 0;
|
|
221
|
+
result = imul(result, 31) + this.v1y_1.hashCode() | 0;
|
|
235
222
|
return result;
|
|
236
223
|
};
|
|
237
224
|
protoOf(Course).equals = function (other) {
|
|
@@ -239,65 +226,65 @@
|
|
|
239
226
|
return true;
|
|
240
227
|
if (!(other instanceof Course))
|
|
241
228
|
return false;
|
|
242
|
-
if (!equals(this.
|
|
229
|
+
if (!equals(this.t1y_1, other.t1y_1))
|
|
243
230
|
return false;
|
|
244
|
-
if (!this.
|
|
231
|
+
if (!this.u1y_1.equals(other.u1y_1))
|
|
245
232
|
return false;
|
|
246
|
-
if (!this.
|
|
233
|
+
if (!this.v1y_1.equals(other.v1y_1))
|
|
247
234
|
return false;
|
|
248
235
|
return true;
|
|
249
236
|
};
|
|
250
237
|
function Companion_0() {
|
|
251
238
|
Companion_instance_0 = this;
|
|
252
|
-
this.
|
|
239
|
+
this.y1y_1 = new PowerProviderConstant(280.0);
|
|
253
240
|
}
|
|
254
241
|
var Companion_instance_0;
|
|
255
|
-
function
|
|
242
|
+
function Companion_getInstance_2() {
|
|
256
243
|
if (Companion_instance_0 == null)
|
|
257
244
|
new Companion_0();
|
|
258
245
|
return Companion_instance_0;
|
|
259
246
|
}
|
|
260
247
|
function CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
|
|
261
|
-
|
|
248
|
+
Companion_getInstance_2();
|
|
262
249
|
rhoProvider = rhoProvider === VOID ? RhoProviderDefault_instance : rhoProvider;
|
|
263
250
|
aeroProvider = aeroProvider === VOID ? AeroProviderConstant_instance : aeroProvider;
|
|
264
251
|
windProvider = windProvider === VOID ? WindProviderNone_instance : windProvider;
|
|
265
|
-
cyclistPowerProvider = cyclistPowerProvider === VOID ?
|
|
266
|
-
this.
|
|
267
|
-
this.
|
|
268
|
-
this.
|
|
269
|
-
this.
|
|
270
|
-
this.
|
|
252
|
+
cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_2().y1y_1 : cyclistPowerProvider;
|
|
253
|
+
this.z1y_1 = course;
|
|
254
|
+
this.a1z_1 = rhoProvider;
|
|
255
|
+
this.b1z_1 = aeroProvider;
|
|
256
|
+
this.c1z_1 = windProvider;
|
|
257
|
+
this.d1z_1 = cyclistPowerProvider;
|
|
271
258
|
}
|
|
272
|
-
protoOf(CoursePhysics).
|
|
273
|
-
return this.
|
|
259
|
+
protoOf(CoursePhysics).e1z = function () {
|
|
260
|
+
return this.z1y_1.t1y_1;
|
|
274
261
|
};
|
|
275
|
-
protoOf(CoursePhysics).
|
|
276
|
-
return this.
|
|
262
|
+
protoOf(CoursePhysics).f1z = function () {
|
|
263
|
+
return this.z1y_1.u1y_1;
|
|
277
264
|
};
|
|
278
|
-
protoOf(CoursePhysics).
|
|
279
|
-
return this.
|
|
265
|
+
protoOf(CoursePhysics).g1z = function () {
|
|
266
|
+
return this.z1y_1.v1y_1;
|
|
280
267
|
};
|
|
281
|
-
protoOf(CoursePhysics).
|
|
268
|
+
protoOf(CoursePhysics).h1z = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
|
|
282
269
|
return new CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
|
|
283
270
|
};
|
|
284
|
-
protoOf(CoursePhysics).
|
|
285
|
-
course = course === VOID ? this.
|
|
286
|
-
rhoProvider = rhoProvider === VOID ? this.
|
|
287
|
-
aeroProvider = aeroProvider === VOID ? this.
|
|
288
|
-
windProvider = windProvider === VOID ? this.
|
|
289
|
-
cyclistPowerProvider = cyclistPowerProvider === VOID ? this.
|
|
290
|
-
return $super === VOID ? this.
|
|
271
|
+
protoOf(CoursePhysics).i1z = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider, $super) {
|
|
272
|
+
course = course === VOID ? this.z1y_1 : course;
|
|
273
|
+
rhoProvider = rhoProvider === VOID ? this.a1z_1 : rhoProvider;
|
|
274
|
+
aeroProvider = aeroProvider === VOID ? this.b1z_1 : aeroProvider;
|
|
275
|
+
windProvider = windProvider === VOID ? this.c1z_1 : windProvider;
|
|
276
|
+
cyclistPowerProvider = cyclistPowerProvider === VOID ? this.d1z_1 : cyclistPowerProvider;
|
|
277
|
+
return $super === VOID ? this.h1z(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) : $super.h1z.call(this, course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
|
|
291
278
|
};
|
|
292
279
|
protoOf(CoursePhysics).toString = function () {
|
|
293
|
-
return 'CoursePhysics(course=' + this.
|
|
280
|
+
return 'CoursePhysics(course=' + this.z1y_1.toString() + ', rhoProvider=' + toString(this.a1z_1) + ', aeroProvider=' + toString(this.b1z_1) + ', windProvider=' + toString(this.c1z_1) + ', cyclistPowerProvider=' + toString(this.d1z_1) + ')';
|
|
294
281
|
};
|
|
295
282
|
protoOf(CoursePhysics).hashCode = function () {
|
|
296
|
-
var result = this.
|
|
297
|
-
result = imul(result, 31) + hashCode(this.
|
|
298
|
-
result = imul(result, 31) + hashCode(this.
|
|
299
|
-
result = imul(result, 31) + hashCode(this.
|
|
300
|
-
result = imul(result, 31) + hashCode(this.
|
|
283
|
+
var result = this.z1y_1.hashCode();
|
|
284
|
+
result = imul(result, 31) + hashCode(this.a1z_1) | 0;
|
|
285
|
+
result = imul(result, 31) + hashCode(this.b1z_1) | 0;
|
|
286
|
+
result = imul(result, 31) + hashCode(this.c1z_1) | 0;
|
|
287
|
+
result = imul(result, 31) + hashCode(this.d1z_1) | 0;
|
|
301
288
|
return result;
|
|
302
289
|
};
|
|
303
290
|
protoOf(CoursePhysics).equals = function (other) {
|
|
@@ -305,64 +292,64 @@
|
|
|
305
292
|
return true;
|
|
306
293
|
if (!(other instanceof CoursePhysics))
|
|
307
294
|
return false;
|
|
308
|
-
if (!this.
|
|
295
|
+
if (!this.z1y_1.equals(other.z1y_1))
|
|
309
296
|
return false;
|
|
310
|
-
if (!equals(this.
|
|
297
|
+
if (!equals(this.a1z_1, other.a1z_1))
|
|
311
298
|
return false;
|
|
312
|
-
if (!equals(this.
|
|
299
|
+
if (!equals(this.b1z_1, other.b1z_1))
|
|
313
300
|
return false;
|
|
314
|
-
if (!equals(this.
|
|
301
|
+
if (!equals(this.c1z_1, other.c1z_1))
|
|
315
302
|
return false;
|
|
316
|
-
if (!equals(this.
|
|
303
|
+
if (!equals(this.d1z_1, other.d1z_1))
|
|
317
304
|
return false;
|
|
318
305
|
return true;
|
|
319
306
|
};
|
|
320
307
|
function Companion_1() {
|
|
321
308
|
Companion_instance_1 = this;
|
|
322
|
-
this.
|
|
309
|
+
this.s1y_1 = new Cyclist();
|
|
323
310
|
}
|
|
324
311
|
var Companion_instance_1;
|
|
325
|
-
function
|
|
312
|
+
function Companion_getInstance_3() {
|
|
326
313
|
if (Companion_instance_1 == null)
|
|
327
314
|
new Companion_1();
|
|
328
315
|
return Companion_instance_1;
|
|
329
316
|
}
|
|
330
317
|
function Cyclist(massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH) {
|
|
331
|
-
|
|
318
|
+
Companion_getInstance_3();
|
|
332
319
|
massKg = massKg === VOID ? 80.0 : massKg;
|
|
333
320
|
maxBrakeG = maxBrakeG === VOID ? 0.6 : maxBrakeG;
|
|
334
321
|
cd = cd === VOID ? 0.7 : cd;
|
|
335
322
|
frontalAreaM2 = frontalAreaM2 === VOID ? 0.5 : frontalAreaM2;
|
|
336
323
|
maxLeanAngleDeg = maxLeanAngleDeg === VOID ? 35.0 : maxLeanAngleDeg;
|
|
337
324
|
maxSpeedKmH = maxSpeedKmH === VOID ? 100.0 : maxSpeedKmH;
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
this.
|
|
341
|
-
this.
|
|
342
|
-
this.
|
|
343
|
-
this.
|
|
344
|
-
}
|
|
345
|
-
protoOf(Cyclist).
|
|
325
|
+
this.j1z_1 = massKg;
|
|
326
|
+
this.k1z_1 = maxBrakeG;
|
|
327
|
+
this.l1z_1 = cd;
|
|
328
|
+
this.m1z_1 = frontalAreaM2;
|
|
329
|
+
this.n1z_1 = maxLeanAngleDeg;
|
|
330
|
+
this.o1z_1 = maxSpeedKmH;
|
|
331
|
+
}
|
|
332
|
+
protoOf(Cyclist).p1z = function () {
|
|
346
333
|
// Inline function 'kotlin.math.tan' call
|
|
347
|
-
var x = this.
|
|
334
|
+
var x = this.n1z_1 * 3.141592653589793 / 180.0;
|
|
348
335
|
return Math.tan(x);
|
|
349
336
|
};
|
|
350
|
-
protoOf(Cyclist).
|
|
351
|
-
return this.
|
|
337
|
+
protoOf(Cyclist).q1z = function () {
|
|
338
|
+
return this.k1z_1 * 9.8;
|
|
352
339
|
};
|
|
353
|
-
protoOf(Cyclist).
|
|
354
|
-
return this.
|
|
340
|
+
protoOf(Cyclist).r1z = function () {
|
|
341
|
+
return this.o1z_1 / 3.6;
|
|
355
342
|
};
|
|
356
343
|
protoOf(Cyclist).toString = function () {
|
|
357
|
-
return 'Cyclist(massKg=' + this.
|
|
344
|
+
return 'Cyclist(massKg=' + this.j1z_1 + ', maxBrakeG=' + this.k1z_1 + ', cd=' + this.l1z_1 + ', frontalAreaM2=' + this.m1z_1 + ', maxLeanAngleDeg=' + this.n1z_1 + ', maxSpeedKmH=' + this.o1z_1 + ')';
|
|
358
345
|
};
|
|
359
346
|
protoOf(Cyclist).hashCode = function () {
|
|
360
|
-
var result = getNumberHashCode(this.
|
|
361
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
362
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
363
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
364
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
365
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
347
|
+
var result = getNumberHashCode(this.j1z_1);
|
|
348
|
+
result = imul(result, 31) + getNumberHashCode(this.k1z_1) | 0;
|
|
349
|
+
result = imul(result, 31) + getNumberHashCode(this.l1z_1) | 0;
|
|
350
|
+
result = imul(result, 31) + getNumberHashCode(this.m1z_1) | 0;
|
|
351
|
+
result = imul(result, 31) + getNumberHashCode(this.n1z_1) | 0;
|
|
352
|
+
result = imul(result, 31) + getNumberHashCode(this.o1z_1) | 0;
|
|
366
353
|
return result;
|
|
367
354
|
};
|
|
368
355
|
protoOf(Cyclist).equals = function (other) {
|
|
@@ -370,17 +357,17 @@
|
|
|
370
357
|
return true;
|
|
371
358
|
if (!(other instanceof Cyclist))
|
|
372
359
|
return false;
|
|
373
|
-
if (!equals(this.
|
|
360
|
+
if (!equals(this.j1z_1, other.j1z_1))
|
|
374
361
|
return false;
|
|
375
|
-
if (!equals(this.
|
|
362
|
+
if (!equals(this.k1z_1, other.k1z_1))
|
|
376
363
|
return false;
|
|
377
|
-
if (!equals(this.
|
|
364
|
+
if (!equals(this.l1z_1, other.l1z_1))
|
|
378
365
|
return false;
|
|
379
|
-
if (!equals(this.
|
|
366
|
+
if (!equals(this.m1z_1, other.m1z_1))
|
|
380
367
|
return false;
|
|
381
|
-
if (!equals(this.
|
|
368
|
+
if (!equals(this.n1z_1, other.n1z_1))
|
|
382
369
|
return false;
|
|
383
|
-
if (!equals(this.
|
|
370
|
+
if (!equals(this.o1z_1, other.o1z_1))
|
|
384
371
|
return false;
|
|
385
372
|
return true;
|
|
386
373
|
};
|
|
@@ -388,17 +375,17 @@
|
|
|
388
375
|
enabled = enabled === VOID ? true : enabled;
|
|
389
376
|
toleranceM = toleranceM === VOID ? 10.0 : toleranceM;
|
|
390
377
|
zExaggeration = zExaggeration === VOID ? 3.0 : zExaggeration;
|
|
391
|
-
this.
|
|
392
|
-
this.
|
|
393
|
-
this.
|
|
378
|
+
this.s1z_1 = enabled;
|
|
379
|
+
this.t1z_1 = toleranceM;
|
|
380
|
+
this.u1z_1 = zExaggeration;
|
|
394
381
|
}
|
|
395
382
|
protoOf(SimplifyPathOptions).toString = function () {
|
|
396
|
-
return 'SimplifyPathOptions(enabled=' + this.
|
|
383
|
+
return 'SimplifyPathOptions(enabled=' + this.s1z_1 + ', toleranceM=' + this.t1z_1 + ', zExaggeration=' + this.u1z_1 + ')';
|
|
397
384
|
};
|
|
398
385
|
protoOf(SimplifyPathOptions).hashCode = function () {
|
|
399
|
-
var result = getBooleanHashCode(this.
|
|
400
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
401
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
386
|
+
var result = getBooleanHashCode(this.s1z_1);
|
|
387
|
+
result = imul(result, 31) + getNumberHashCode(this.t1z_1) | 0;
|
|
388
|
+
result = imul(result, 31) + getNumberHashCode(this.u1z_1) | 0;
|
|
402
389
|
return result;
|
|
403
390
|
};
|
|
404
391
|
protoOf(SimplifyPathOptions).equals = function (other) {
|
|
@@ -406,46 +393,46 @@
|
|
|
406
393
|
return true;
|
|
407
394
|
if (!(other instanceof SimplifyPathOptions))
|
|
408
395
|
return false;
|
|
409
|
-
if (!(this.
|
|
396
|
+
if (!(this.s1z_1 === other.s1z_1))
|
|
410
397
|
return false;
|
|
411
|
-
if (!equals(this.
|
|
398
|
+
if (!equals(this.t1z_1, other.t1z_1))
|
|
412
399
|
return false;
|
|
413
|
-
if (!equals(this.
|
|
400
|
+
if (!equals(this.u1z_1, other.u1z_1))
|
|
414
401
|
return false;
|
|
415
402
|
return true;
|
|
416
403
|
};
|
|
417
404
|
function Companion_2() {
|
|
418
405
|
Companion_instance_2 = this;
|
|
419
|
-
this.
|
|
406
|
+
this.v1z_1 = new EnhanceOptions();
|
|
420
407
|
}
|
|
421
408
|
var Companion_instance_2;
|
|
422
|
-
function
|
|
409
|
+
function Companion_getInstance_4() {
|
|
423
410
|
if (Companion_instance_2 == null)
|
|
424
411
|
new Companion_2();
|
|
425
412
|
return Companion_instance_2;
|
|
426
413
|
}
|
|
427
414
|
function EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath) {
|
|
428
|
-
|
|
415
|
+
Companion_getInstance_4();
|
|
429
416
|
fixElevation = fixElevation === VOID ? true : fixElevation;
|
|
430
417
|
computeMaxSpeeds = computeMaxSpeeds === VOID ? true : computeMaxSpeeds;
|
|
431
418
|
virtualizeTrack = virtualizeTrack === VOID ? true : virtualizeTrack;
|
|
432
419
|
computeOnePointPerSecond = computeOnePointPerSecond === VOID ? true : computeOnePointPerSecond;
|
|
433
420
|
simplifyPath = simplifyPath === VOID ? new SimplifyPathOptions() : simplifyPath;
|
|
434
|
-
this.
|
|
435
|
-
this.
|
|
436
|
-
this.
|
|
437
|
-
this.
|
|
438
|
-
this.
|
|
421
|
+
this.w1z_1 = fixElevation;
|
|
422
|
+
this.x1z_1 = computeMaxSpeeds;
|
|
423
|
+
this.y1z_1 = virtualizeTrack;
|
|
424
|
+
this.z1z_1 = computeOnePointPerSecond;
|
|
425
|
+
this.a20_1 = simplifyPath;
|
|
439
426
|
}
|
|
440
427
|
protoOf(EnhanceOptions).toString = function () {
|
|
441
|
-
return 'EnhanceOptions(fixElevation=' + this.
|
|
428
|
+
return 'EnhanceOptions(fixElevation=' + this.w1z_1 + ', computeMaxSpeeds=' + this.x1z_1 + ', virtualizeTrack=' + this.y1z_1 + ', computeOnePointPerSecond=' + this.z1z_1 + ', simplifyPath=' + this.a20_1.toString() + ')';
|
|
442
429
|
};
|
|
443
430
|
protoOf(EnhanceOptions).hashCode = function () {
|
|
444
|
-
var result = getBooleanHashCode(this.
|
|
445
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
446
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
447
|
-
result = imul(result, 31) + getBooleanHashCode(this.
|
|
448
|
-
result = imul(result, 31) + this.
|
|
431
|
+
var result = getBooleanHashCode(this.w1z_1);
|
|
432
|
+
result = imul(result, 31) + getBooleanHashCode(this.x1z_1) | 0;
|
|
433
|
+
result = imul(result, 31) + getBooleanHashCode(this.y1z_1) | 0;
|
|
434
|
+
result = imul(result, 31) + getBooleanHashCode(this.z1z_1) | 0;
|
|
435
|
+
result = imul(result, 31) + this.a20_1.hashCode() | 0;
|
|
449
436
|
return result;
|
|
450
437
|
};
|
|
451
438
|
protoOf(EnhanceOptions).equals = function (other) {
|
|
@@ -453,2175 +440,653 @@
|
|
|
453
440
|
return true;
|
|
454
441
|
if (!(other instanceof EnhanceOptions))
|
|
455
442
|
return false;
|
|
456
|
-
if (!(this.
|
|
443
|
+
if (!(this.w1z_1 === other.w1z_1))
|
|
457
444
|
return false;
|
|
458
|
-
if (!(this.
|
|
445
|
+
if (!(this.x1z_1 === other.x1z_1))
|
|
459
446
|
return false;
|
|
460
|
-
if (!(this.
|
|
447
|
+
if (!(this.y1z_1 === other.y1z_1))
|
|
461
448
|
return false;
|
|
462
|
-
if (!(this.
|
|
449
|
+
if (!(this.z1z_1 === other.z1z_1))
|
|
463
450
|
return false;
|
|
464
|
-
if (!this.
|
|
451
|
+
if (!this.a20_1.equals(other.a20_1))
|
|
465
452
|
return false;
|
|
466
453
|
return true;
|
|
467
454
|
};
|
|
468
455
|
function $enhanceCourseCOROUTINE$(_this__u8e3s4, course, options, elevationProvider, resultContinuation) {
|
|
469
456
|
CoroutineImpl.call(this, resultContinuation);
|
|
470
|
-
this.
|
|
471
|
-
this.
|
|
472
|
-
this.
|
|
473
|
-
this.
|
|
457
|
+
this.j20_1 = _this__u8e3s4;
|
|
458
|
+
this.k20_1 = course;
|
|
459
|
+
this.l20_1 = options;
|
|
460
|
+
this.m20_1 = elevationProvider;
|
|
474
461
|
}
|
|
475
|
-
protoOf($enhanceCourseCOROUTINE$).
|
|
476
|
-
var suspendResult = this.
|
|
462
|
+
protoOf($enhanceCourseCOROUTINE$).p6 = function () {
|
|
463
|
+
var suspendResult = this.j6_1;
|
|
477
464
|
$sm: do
|
|
478
465
|
try {
|
|
479
|
-
var tmp = this.
|
|
466
|
+
var tmp = this.h6_1;
|
|
480
467
|
switch (tmp) {
|
|
481
468
|
case 0:
|
|
482
|
-
this.
|
|
483
|
-
this.
|
|
484
|
-
this.
|
|
485
|
-
if (this.
|
|
486
|
-
this.
|
|
487
|
-
suspendResult = ElevationStep_instance.
|
|
469
|
+
this.i6_1 = 3;
|
|
470
|
+
this.n20_1 = this.k20_1.e1z();
|
|
471
|
+
this.n20_1 = PointPerDistance_instance.p1w(this.n20_1, -1.0, 30.0);
|
|
472
|
+
if (this.l20_1.w1z_1 && !(this.m20_1 == null)) {
|
|
473
|
+
this.h6_1 = 1;
|
|
474
|
+
suspendResult = ElevationStep_instance.g1u(this.n20_1, this.m20_1, this);
|
|
488
475
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
489
476
|
return suspendResult;
|
|
490
477
|
}
|
|
491
478
|
continue $sm;
|
|
492
479
|
} else {
|
|
493
|
-
this.
|
|
480
|
+
this.h6_1 = 2;
|
|
494
481
|
continue $sm;
|
|
495
482
|
}
|
|
496
483
|
|
|
497
484
|
case 1:
|
|
498
|
-
this.
|
|
499
|
-
this.
|
|
485
|
+
this.n20_1 = suspendResult;
|
|
486
|
+
this.h6_1 = 2;
|
|
500
487
|
continue $sm;
|
|
501
488
|
case 2:
|
|
502
|
-
this.
|
|
503
|
-
this.
|
|
504
|
-
var working = this.
|
|
505
|
-
if (this.
|
|
506
|
-
MaxSpeedComputer_instance.
|
|
489
|
+
this.n20_1 = PointPerDistance_instance.p1w(this.n20_1, 1.0, 2.0);
|
|
490
|
+
this.n20_1 = ElevationStep_instance.j1u(this.n20_1);
|
|
491
|
+
var working = this.k20_1.i1z(this.k20_1.z1y_1.x1y(this.n20_1));
|
|
492
|
+
if (this.l20_1.x1z_1 || this.l20_1.y1z_1) {
|
|
493
|
+
MaxSpeedComputer_instance.t20(working.z1y_1);
|
|
507
494
|
}
|
|
508
495
|
|
|
509
|
-
if (this.
|
|
510
|
-
this.
|
|
511
|
-
working = working.
|
|
496
|
+
if (this.l20_1.y1z_1) {
|
|
497
|
+
this.n20_1 = VirtualizeService_instance.v20(working);
|
|
498
|
+
working = working.i1z(working.z1y_1.x1y(this.n20_1));
|
|
512
499
|
}
|
|
513
500
|
|
|
514
|
-
if (this.
|
|
515
|
-
this.
|
|
501
|
+
if (this.l20_1.z1z_1) {
|
|
502
|
+
this.n20_1 = PointPerSecond_instance.v1w(this.n20_1);
|
|
516
503
|
}
|
|
517
504
|
|
|
518
|
-
if (this.
|
|
519
|
-
this.
|
|
505
|
+
if (this.l20_1.a20_1.s1z_1) {
|
|
506
|
+
this.n20_1 = PathSimplifier_instance.d1w(this.n20_1, this.l20_1.a20_1.t1z_1, this.l20_1.a20_1.u1z_1);
|
|
520
507
|
}
|
|
521
508
|
|
|
522
|
-
return this.
|
|
509
|
+
return this.n20_1;
|
|
523
510
|
case 3:
|
|
524
|
-
throw this.
|
|
511
|
+
throw this.k6_1;
|
|
525
512
|
}
|
|
526
513
|
} catch ($p) {
|
|
527
514
|
var e = $p;
|
|
528
|
-
if (this.
|
|
515
|
+
if (this.i6_1 === 3) {
|
|
529
516
|
throw e;
|
|
530
517
|
} else {
|
|
531
|
-
this.
|
|
532
|
-
this.
|
|
518
|
+
this.h6_1 = this.i6_1;
|
|
519
|
+
this.k6_1 = e;
|
|
533
520
|
}
|
|
534
521
|
}
|
|
535
522
|
while (true);
|
|
536
523
|
};
|
|
537
524
|
function Enhancer() {
|
|
538
525
|
}
|
|
539
|
-
protoOf(Enhancer).
|
|
526
|
+
protoOf(Enhancer).w20 = function (path) {
|
|
540
527
|
return new CoursePhysics(new Course(path), RhoProviderEstimate_instance, AeroProviderConstant_instance, WindProviderNone_instance, new PowerProviderConstant(280.0));
|
|
541
528
|
};
|
|
542
|
-
protoOf(Enhancer).
|
|
543
|
-
return this.
|
|
529
|
+
protoOf(Enhancer).x20 = function (path, elevationProvider, options, $completion) {
|
|
530
|
+
return this.y20(this.w20(path), options, elevationProvider, $completion);
|
|
544
531
|
};
|
|
545
|
-
protoOf(Enhancer).
|
|
532
|
+
protoOf(Enhancer).y20 = function (course, options, elevationProvider, $completion) {
|
|
546
533
|
var tmp = new $enhanceCourseCOROUTINE$(this, course, options, elevationProvider, $completion);
|
|
547
|
-
tmp.
|
|
548
|
-
tmp.
|
|
549
|
-
return tmp.
|
|
534
|
+
tmp.j6_1 = Unit_instance;
|
|
535
|
+
tmp.k6_1 = null;
|
|
536
|
+
return tmp.p6();
|
|
550
537
|
};
|
|
551
538
|
var Enhancer_instance;
|
|
552
539
|
function Enhancer_getInstance() {
|
|
553
540
|
return Enhancer_instance;
|
|
554
541
|
}
|
|
555
|
-
function
|
|
556
|
-
|
|
557
|
-
this.
|
|
558
|
-
this.
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
542
|
+
function Climb(startIndex, endIndex, startDistanceM, endDistanceM, startElevationM, endElevationM, positiveElevationM, negativeElevationM, parts) {
|
|
543
|
+
this.z20_1 = startIndex;
|
|
544
|
+
this.a21_1 = endIndex;
|
|
545
|
+
this.b21_1 = startDistanceM;
|
|
546
|
+
this.c21_1 = endDistanceM;
|
|
547
|
+
this.d21_1 = startElevationM;
|
|
548
|
+
this.e21_1 = endElevationM;
|
|
549
|
+
this.f21_1 = positiveElevationM;
|
|
550
|
+
this.g21_1 = negativeElevationM;
|
|
551
|
+
this.h21_1 = parts;
|
|
552
|
+
}
|
|
553
|
+
protoOf(Climb).i21 = function () {
|
|
554
|
+
return this.c21_1 - this.b21_1;
|
|
555
|
+
};
|
|
556
|
+
protoOf(Climb).j21 = function () {
|
|
557
|
+
return this.e21_1 - this.d21_1;
|
|
558
|
+
};
|
|
559
|
+
protoOf(Climb).k21 = function () {
|
|
560
|
+
return this.i21() === 0.0 ? 0.0 : this.j21() / this.i21();
|
|
561
|
+
};
|
|
562
|
+
protoOf(Climb).l21 = function () {
|
|
563
|
+
// Inline function 'kotlin.collections.filter' call
|
|
564
|
+
var tmp0 = this.h21_1;
|
|
565
|
+
// Inline function 'kotlin.collections.filterTo' call
|
|
566
|
+
var destination = ArrayList_init_$Create$();
|
|
567
|
+
var _iterator__ex2g4s = tmp0.i();
|
|
568
|
+
while (_iterator__ex2g4s.j()) {
|
|
569
|
+
var element = _iterator__ex2g4s.k();
|
|
570
|
+
if (element.j21() > 0) {
|
|
571
|
+
destination.h(element);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
// Inline function 'kotlin.collections.sumOf' call
|
|
575
|
+
var sum = 0;
|
|
576
|
+
var _iterator__ex2g4s_0 = destination.i();
|
|
577
|
+
while (_iterator__ex2g4s_0.j()) {
|
|
578
|
+
var element_0 = _iterator__ex2g4s_0.k();
|
|
579
|
+
var tmp = sum;
|
|
580
|
+
sum = tmp + element_0.i21();
|
|
581
|
+
}
|
|
582
|
+
var climbingLength = sum;
|
|
583
|
+
return climbingLength === 0.0 ? 0.0 : this.f21_1 / climbingLength;
|
|
584
|
+
};
|
|
585
|
+
protoOf(Climb).toString = function () {
|
|
586
|
+
return 'Climb(startIndex=' + this.z20_1 + ', endIndex=' + this.a21_1 + ', startDistanceM=' + this.b21_1 + ', endDistanceM=' + this.c21_1 + ', startElevationM=' + this.d21_1 + ', endElevationM=' + this.e21_1 + ', positiveElevationM=' + this.f21_1 + ', negativeElevationM=' + this.g21_1 + ', parts=' + toString(this.h21_1) + ')';
|
|
587
|
+
};
|
|
588
|
+
protoOf(Climb).hashCode = function () {
|
|
589
|
+
var result = this.z20_1;
|
|
590
|
+
result = imul(result, 31) + this.a21_1 | 0;
|
|
591
|
+
result = imul(result, 31) + getNumberHashCode(this.b21_1) | 0;
|
|
592
|
+
result = imul(result, 31) + getNumberHashCode(this.c21_1) | 0;
|
|
593
|
+
result = imul(result, 31) + getNumberHashCode(this.d21_1) | 0;
|
|
594
|
+
result = imul(result, 31) + getNumberHashCode(this.e21_1) | 0;
|
|
595
|
+
result = imul(result, 31) + getNumberHashCode(this.f21_1) | 0;
|
|
596
|
+
result = imul(result, 31) + getNumberHashCode(this.g21_1) | 0;
|
|
597
|
+
result = imul(result, 31) + hashCode(this.h21_1) | 0;
|
|
566
598
|
return result;
|
|
567
599
|
};
|
|
568
|
-
protoOf(
|
|
600
|
+
protoOf(Climb).equals = function (other) {
|
|
569
601
|
if (this === other)
|
|
570
602
|
return true;
|
|
571
|
-
if (!(other instanceof
|
|
603
|
+
if (!(other instanceof Climb))
|
|
572
604
|
return false;
|
|
573
|
-
if (!(this.
|
|
605
|
+
if (!(this.z20_1 === other.z20_1))
|
|
574
606
|
return false;
|
|
575
|
-
if (!
|
|
607
|
+
if (!(this.a21_1 === other.a21_1))
|
|
576
608
|
return false;
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
this.
|
|
584
|
-
this.o1h_1 = points;
|
|
585
|
-
}
|
|
586
|
-
protoOf(GpxTrack).toString = function () {
|
|
587
|
-
return 'GpxTrack(name=' + this.m1h_1 + ', type=' + this.n1h_1 + ', points=' + toString(this.o1h_1) + ')';
|
|
588
|
-
};
|
|
589
|
-
protoOf(GpxTrack).hashCode = function () {
|
|
590
|
-
var result = this.m1h_1 == null ? 0 : getStringHashCode(this.m1h_1);
|
|
591
|
-
result = imul(result, 31) + (this.n1h_1 == null ? 0 : getStringHashCode(this.n1h_1)) | 0;
|
|
592
|
-
result = imul(result, 31) + hashCode(this.o1h_1) | 0;
|
|
593
|
-
return result;
|
|
594
|
-
};
|
|
595
|
-
protoOf(GpxTrack).equals = function (other) {
|
|
596
|
-
if (this === other)
|
|
597
|
-
return true;
|
|
598
|
-
if (!(other instanceof GpxTrack))
|
|
609
|
+
if (!equals(this.b21_1, other.b21_1))
|
|
610
|
+
return false;
|
|
611
|
+
if (!equals(this.c21_1, other.c21_1))
|
|
612
|
+
return false;
|
|
613
|
+
if (!equals(this.d21_1, other.d21_1))
|
|
614
|
+
return false;
|
|
615
|
+
if (!equals(this.e21_1, other.e21_1))
|
|
599
616
|
return false;
|
|
600
|
-
if (!(this.
|
|
617
|
+
if (!equals(this.f21_1, other.f21_1))
|
|
601
618
|
return false;
|
|
602
|
-
if (!(this.
|
|
619
|
+
if (!equals(this.g21_1, other.g21_1))
|
|
603
620
|
return false;
|
|
604
|
-
if (!equals(this.
|
|
621
|
+
if (!equals(this.h21_1, other.h21_1))
|
|
605
622
|
return false;
|
|
606
623
|
return true;
|
|
607
624
|
};
|
|
608
|
-
function
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
this.
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
this.
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
this.
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
630
|
-
result = imul(result, 31) +
|
|
631
|
-
result = imul(result, 31) + (this.s1h_1 == null ? 0 : this.s1h_1.hashCode()) | 0;
|
|
632
|
-
result = imul(result, 31) + (this.t1h_1 == null ? 0 : this.t1h_1) | 0;
|
|
633
|
-
result = imul(result, 31) + (this.u1h_1 == null ? 0 : this.u1h_1) | 0;
|
|
634
|
-
result = imul(result, 31) + (this.v1h_1 == null ? 0 : getNumberHashCode(this.v1h_1)) | 0;
|
|
635
|
-
result = imul(result, 31) + (this.w1h_1 == null ? 0 : getNumberHashCode(this.w1h_1)) | 0;
|
|
625
|
+
function ClimbPart(startDistanceM, endDistanceM, startElevationM, endElevationM) {
|
|
626
|
+
this.m21_1 = startDistanceM;
|
|
627
|
+
this.n21_1 = endDistanceM;
|
|
628
|
+
this.o21_1 = startElevationM;
|
|
629
|
+
this.p21_1 = endElevationM;
|
|
630
|
+
}
|
|
631
|
+
protoOf(ClimbPart).i21 = function () {
|
|
632
|
+
return this.n21_1 - this.m21_1;
|
|
633
|
+
};
|
|
634
|
+
protoOf(ClimbPart).j21 = function () {
|
|
635
|
+
return this.p21_1 - this.o21_1;
|
|
636
|
+
};
|
|
637
|
+
protoOf(ClimbPart).q21 = function () {
|
|
638
|
+
return this.i21() === 0.0 ? 0.0 : this.j21() / this.i21();
|
|
639
|
+
};
|
|
640
|
+
protoOf(ClimbPart).toString = function () {
|
|
641
|
+
return 'ClimbPart(startDistanceM=' + this.m21_1 + ', endDistanceM=' + this.n21_1 + ', startElevationM=' + this.o21_1 + ', endElevationM=' + this.p21_1 + ')';
|
|
642
|
+
};
|
|
643
|
+
protoOf(ClimbPart).hashCode = function () {
|
|
644
|
+
var result = getNumberHashCode(this.m21_1);
|
|
645
|
+
result = imul(result, 31) + getNumberHashCode(this.n21_1) | 0;
|
|
646
|
+
result = imul(result, 31) + getNumberHashCode(this.o21_1) | 0;
|
|
647
|
+
result = imul(result, 31) + getNumberHashCode(this.p21_1) | 0;
|
|
636
648
|
return result;
|
|
637
649
|
};
|
|
638
|
-
protoOf(
|
|
650
|
+
protoOf(ClimbPart).equals = function (other) {
|
|
639
651
|
if (this === other)
|
|
640
652
|
return true;
|
|
641
|
-
if (!(other instanceof
|
|
653
|
+
if (!(other instanceof ClimbPart))
|
|
642
654
|
return false;
|
|
643
|
-
if (!equals(this.
|
|
655
|
+
if (!equals(this.m21_1, other.m21_1))
|
|
644
656
|
return false;
|
|
645
|
-
if (!equals(this.
|
|
657
|
+
if (!equals(this.n21_1, other.n21_1))
|
|
646
658
|
return false;
|
|
647
|
-
if (!equals(this.
|
|
659
|
+
if (!equals(this.o21_1, other.o21_1))
|
|
648
660
|
return false;
|
|
649
|
-
if (!equals(this.
|
|
650
|
-
return false;
|
|
651
|
-
if (!(this.t1h_1 == other.t1h_1))
|
|
652
|
-
return false;
|
|
653
|
-
if (!(this.u1h_1 == other.u1h_1))
|
|
654
|
-
return false;
|
|
655
|
-
if (!equals(this.v1h_1, other.v1h_1))
|
|
656
|
-
return false;
|
|
657
|
-
if (!equals(this.w1h_1, other.w1h_1))
|
|
661
|
+
if (!equals(this.p21_1, other.p21_1))
|
|
658
662
|
return false;
|
|
659
663
|
return true;
|
|
660
664
|
};
|
|
661
|
-
function toGpxTrack(_this__u8e3s4, name, type) {
|
|
662
|
-
name = name === VOID ? null : name;
|
|
663
|
-
type = type === VOID ? 'cycling' : type;
|
|
664
|
-
// Inline function 'kotlin.collections.List' call
|
|
665
|
-
// Inline function 'kotlin.collections.MutableList' call
|
|
666
|
-
var size = _this__u8e3s4.x1h_1;
|
|
667
|
-
var list = ArrayList_init_$Create$(size);
|
|
668
|
-
// Inline function 'kotlin.repeat' call
|
|
669
|
-
var inductionVariable = 0;
|
|
670
|
-
if (inductionVariable < size)
|
|
671
|
-
do {
|
|
672
|
-
var index = inductionVariable;
|
|
673
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
674
|
-
var tmp = _this__u8e3s4.z1h(index) * MathConstants_getInstance().bv_1;
|
|
675
|
-
var tmp_0 = _this__u8e3s4.a1i(index) * MathConstants_getInstance().bv_1;
|
|
676
|
-
// Inline function 'kotlin.takeUnless' call
|
|
677
|
-
var this_0 = _this__u8e3s4.b1i(index);
|
|
678
|
-
var tmp_1;
|
|
679
|
-
if (!isNaN_0(this_0)) {
|
|
680
|
-
tmp_1 = this_0;
|
|
681
|
-
} else {
|
|
682
|
-
tmp_1 = null;
|
|
683
|
-
}
|
|
684
|
-
var tmp_2 = tmp_1;
|
|
685
|
-
// Inline function 'kotlin.takeIf' call
|
|
686
|
-
var this_1 = numberToLong(_this__u8e3s4.c1i(index));
|
|
687
|
-
var tmp_3;
|
|
688
|
-
if (compare(this_1, new Long(0, 0)) > 0) {
|
|
689
|
-
tmp_3 = this_1;
|
|
690
|
-
} else {
|
|
691
|
-
tmp_3 = null;
|
|
692
|
-
}
|
|
693
|
-
var tmp_4 = tmp_3;
|
|
694
|
-
// Inline function 'kotlin.takeUnless' call
|
|
695
|
-
var this_2 = _this__u8e3s4.d1i(index);
|
|
696
|
-
var tmp_5;
|
|
697
|
-
if (!(isNaN_0(this_2) || this_2 === 0.0)) {
|
|
698
|
-
tmp_5 = this_2;
|
|
699
|
-
} else {
|
|
700
|
-
tmp_5 = null;
|
|
701
|
-
}
|
|
702
|
-
var tmp0_safe_receiver = tmp_5;
|
|
703
|
-
var tmp_6 = tmp0_safe_receiver == null ? null : roundToInt(tmp0_safe_receiver);
|
|
704
|
-
// Inline function 'kotlin.takeUnless' call
|
|
705
|
-
var this_3 = _this__u8e3s4.e1i(index);
|
|
706
|
-
var tmp_7;
|
|
707
|
-
if (!(isNaN_0(this_3) || this_3 === 0.0)) {
|
|
708
|
-
tmp_7 = this_3;
|
|
709
|
-
} else {
|
|
710
|
-
tmp_7 = null;
|
|
711
|
-
}
|
|
712
|
-
var tmp1_safe_receiver = tmp_7;
|
|
713
|
-
var tmp_8 = tmp1_safe_receiver == null ? null : roundToInt(tmp1_safe_receiver);
|
|
714
|
-
// Inline function 'kotlin.takeUnless' call
|
|
715
|
-
var this_4 = _this__u8e3s4.f1i(index);
|
|
716
|
-
var tmp_9;
|
|
717
|
-
if (!(isNaN_0(this_4) || this_4 === 0.0)) {
|
|
718
|
-
tmp_9 = this_4;
|
|
719
|
-
} else {
|
|
720
|
-
tmp_9 = null;
|
|
721
|
-
}
|
|
722
|
-
var tmp_10 = tmp_9;
|
|
723
|
-
// Inline function 'kotlin.takeUnless' call
|
|
724
|
-
var this_5 = _this__u8e3s4.g1i(index);
|
|
725
|
-
var tmp_11;
|
|
726
|
-
if (!(isNaN_0(this_5) || this_5 === 0.0)) {
|
|
727
|
-
tmp_11 = this_5;
|
|
728
|
-
} else {
|
|
729
|
-
tmp_11 = null;
|
|
730
|
-
}
|
|
731
|
-
var tmp$ret$15 = tmp_11;
|
|
732
|
-
var tmp$ret$4 = new GpxTrackPoint(tmp, tmp_0, tmp_2, tmp_4, tmp_6, tmp_8, tmp_10, tmp$ret$15);
|
|
733
|
-
list.h(tmp$ret$4);
|
|
734
|
-
}
|
|
735
|
-
while (inductionVariable < size);
|
|
736
|
-
var points = list;
|
|
737
|
-
return new GpxTrack(name, type, points);
|
|
738
|
-
}
|
|
739
|
-
function toGpxDocument(_this__u8e3s4, name, trackName) {
|
|
740
|
-
name = name === VOID ? 'noname' : name;
|
|
741
|
-
trackName = trackName === VOID ? null : trackName;
|
|
742
|
-
return new GpxDocument(name, listOf(toGpxTrack(_this__u8e3s4, trackName)));
|
|
743
|
-
}
|
|
744
|
-
function parseDocument($this, reader) {
|
|
745
|
-
while (reader.j()) {
|
|
746
|
-
var ev = reader.k();
|
|
747
|
-
if (ev.equals(EventType_START_ELEMENT_getInstance())) {
|
|
748
|
-
if (!(reader.o15() === 'gpx')) {
|
|
749
|
-
throw IllegalArgumentException_init_$Create$('Invalid GPX file: missing gpx root element (found ' + reader.o15() + ')');
|
|
750
|
-
}
|
|
751
|
-
return parseGpxRoot($this, reader);
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
throw IllegalArgumentException_init_$Create$('Invalid GPX file: missing gpx root element');
|
|
755
|
-
}
|
|
756
|
-
function parseGpxRoot($this, reader) {
|
|
757
|
-
var name = 'noname';
|
|
758
|
-
// Inline function 'kotlin.collections.mutableListOf' call
|
|
759
|
-
var tracks = ArrayList_init_$Create$_0();
|
|
760
|
-
while (reader.j()) {
|
|
761
|
-
var ev = reader.k();
|
|
762
|
-
switch (ev.l1_1) {
|
|
763
|
-
case 1:
|
|
764
|
-
switch (reader.o15()) {
|
|
765
|
-
case 'metadata':
|
|
766
|
-
var metaName = parseMetadataName($this, reader);
|
|
767
|
-
if (!(metaName == null))
|
|
768
|
-
name = metaName;
|
|
769
|
-
break;
|
|
770
|
-
case 'trk':
|
|
771
|
-
tracks.h(parseTrack($this, reader));
|
|
772
|
-
break;
|
|
773
|
-
default:
|
|
774
|
-
skipElement($this, reader);
|
|
775
|
-
break;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
break;
|
|
779
|
-
case 2:
|
|
780
|
-
return new GpxDocument(name, tracks);
|
|
781
|
-
default:
|
|
782
|
-
break;
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
return new GpxDocument(name, tracks);
|
|
786
|
-
}
|
|
787
|
-
function parseMetadataName($this, reader) {
|
|
788
|
-
var name = null;
|
|
789
|
-
while (reader.j()) {
|
|
790
|
-
var ev = reader.k();
|
|
791
|
-
switch (ev.l1_1) {
|
|
792
|
-
case 1:
|
|
793
|
-
if (reader.o15() === 'name' && name == null) {
|
|
794
|
-
// Inline function 'kotlin.text.trim' call
|
|
795
|
-
var this_0 = readElementText($this, reader);
|
|
796
|
-
// Inline function 'kotlin.text.ifEmpty' call
|
|
797
|
-
var this_1 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
798
|
-
var tmp;
|
|
799
|
-
// Inline function 'kotlin.text.isEmpty' call
|
|
800
|
-
if (charSequenceLength(this_1) === 0) {
|
|
801
|
-
tmp = null;
|
|
802
|
-
} else {
|
|
803
|
-
tmp = this_1;
|
|
804
|
-
}
|
|
805
|
-
name = tmp;
|
|
806
|
-
} else {
|
|
807
|
-
skipElement($this, reader);
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
break;
|
|
811
|
-
case 2:
|
|
812
|
-
return name;
|
|
813
|
-
default:
|
|
814
|
-
break;
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
return name;
|
|
818
|
-
}
|
|
819
|
-
function parseTrack($this, reader) {
|
|
820
|
-
var name = null;
|
|
821
|
-
var type = null;
|
|
822
|
-
// Inline function 'kotlin.collections.mutableListOf' call
|
|
823
|
-
var points = ArrayList_init_$Create$_0();
|
|
824
|
-
while (reader.j()) {
|
|
825
|
-
var ev = reader.k();
|
|
826
|
-
switch (ev.l1_1) {
|
|
827
|
-
case 1:
|
|
828
|
-
switch (reader.o15()) {
|
|
829
|
-
case 'name':
|
|
830
|
-
// Inline function 'kotlin.text.trim' call
|
|
831
|
-
|
|
832
|
-
var this_0 = readElementText($this, reader);
|
|
833
|
-
// Inline function 'kotlin.text.ifEmpty' call
|
|
834
|
-
|
|
835
|
-
var this_1 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
836
|
-
var tmp;
|
|
837
|
-
// Inline function 'kotlin.text.isEmpty' call
|
|
838
|
-
|
|
839
|
-
if (charSequenceLength(this_1) === 0) {
|
|
840
|
-
tmp = null;
|
|
841
|
-
} else {
|
|
842
|
-
tmp = this_1;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
name = tmp;
|
|
846
|
-
break;
|
|
847
|
-
case 'type':
|
|
848
|
-
// Inline function 'kotlin.text.trim' call
|
|
849
|
-
|
|
850
|
-
var this_2 = readElementText($this, reader);
|
|
851
|
-
// Inline function 'kotlin.text.ifEmpty' call
|
|
852
|
-
|
|
853
|
-
var this_3 = toString(trim(isCharSequence(this_2) ? this_2 : THROW_CCE()));
|
|
854
|
-
var tmp_0;
|
|
855
|
-
// Inline function 'kotlin.text.isEmpty' call
|
|
856
|
-
|
|
857
|
-
if (charSequenceLength(this_3) === 0) {
|
|
858
|
-
tmp_0 = null;
|
|
859
|
-
} else {
|
|
860
|
-
tmp_0 = this_3;
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
type = tmp_0;
|
|
864
|
-
break;
|
|
865
|
-
case 'trkseg':
|
|
866
|
-
parseTrackSegment($this, reader, points);
|
|
867
|
-
break;
|
|
868
|
-
default:
|
|
869
|
-
skipElement($this, reader);
|
|
870
|
-
break;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
break;
|
|
874
|
-
case 2:
|
|
875
|
-
return new GpxTrack(name, type, points);
|
|
876
|
-
default:
|
|
877
|
-
break;
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
return new GpxTrack(name, type, points);
|
|
881
|
-
}
|
|
882
|
-
function parseTrackSegment($this, reader, accum) {
|
|
883
|
-
while (reader.j()) {
|
|
884
|
-
var ev = reader.k();
|
|
885
|
-
switch (ev.l1_1) {
|
|
886
|
-
case 1:
|
|
887
|
-
if (reader.o15() === 'trkpt') {
|
|
888
|
-
accum.h(parseTrackPoint($this, reader));
|
|
889
|
-
} else {
|
|
890
|
-
skipElement($this, reader);
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
break;
|
|
894
|
-
case 2:
|
|
895
|
-
return Unit_instance;
|
|
896
|
-
default:
|
|
897
|
-
break;
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
function parseTrackPoint($this, reader) {
|
|
902
|
-
var latStr = reader.z15(null, 'lat');
|
|
903
|
-
var lonStr = reader.z15(null, 'lon');
|
|
904
|
-
var tmp;
|
|
905
|
-
// Inline function 'kotlin.text.isNullOrBlank' call
|
|
906
|
-
if (latStr == null || isBlank(latStr)) {
|
|
907
|
-
tmp = true;
|
|
908
|
-
} else {
|
|
909
|
-
// Inline function 'kotlin.text.isNullOrBlank' call
|
|
910
|
-
tmp = lonStr == null || isBlank(lonStr);
|
|
911
|
-
}
|
|
912
|
-
if (tmp) {
|
|
913
|
-
throw IllegalArgumentException_init_$Create$('Invalid track point: missing latitude or longitude attribute');
|
|
914
|
-
}
|
|
915
|
-
var tmp0_elvis_lhs = toDoubleOrNull(latStr);
|
|
916
|
-
var tmp_0;
|
|
917
|
-
if (tmp0_elvis_lhs == null) {
|
|
918
|
-
throw IllegalArgumentException_init_$Create$("Invalid track point: latitude '" + latStr + "' is not a valid number");
|
|
919
|
-
} else {
|
|
920
|
-
tmp_0 = tmp0_elvis_lhs;
|
|
921
|
-
}
|
|
922
|
-
var lat = tmp_0;
|
|
923
|
-
var tmp1_elvis_lhs = toDoubleOrNull(lonStr);
|
|
924
|
-
var tmp_1;
|
|
925
|
-
if (tmp1_elvis_lhs == null) {
|
|
926
|
-
throw IllegalArgumentException_init_$Create$("Invalid track point: longitude '" + lonStr + "' is not a valid number");
|
|
927
|
-
} else {
|
|
928
|
-
tmp_1 = tmp1_elvis_lhs;
|
|
929
|
-
}
|
|
930
|
-
var lon = tmp_1;
|
|
931
|
-
var elevation = null;
|
|
932
|
-
var timeMs = null;
|
|
933
|
-
var ext = new ExtensionsAccumulator();
|
|
934
|
-
while (reader.j()) {
|
|
935
|
-
var ev = reader.k();
|
|
936
|
-
switch (ev.l1_1) {
|
|
937
|
-
case 1:
|
|
938
|
-
switch (reader.o15()) {
|
|
939
|
-
case 'ele':
|
|
940
|
-
// Inline function 'kotlin.text.trim' call
|
|
941
|
-
|
|
942
|
-
var this_0 = readElementText($this, reader);
|
|
943
|
-
var txt = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
944
|
-
// Inline function 'kotlin.text.isNotEmpty' call
|
|
945
|
-
|
|
946
|
-
if (charSequenceLength(txt) > 0) {
|
|
947
|
-
var tmp4_elvis_lhs = toDoubleOrNull(txt);
|
|
948
|
-
elevation = tmp4_elvis_lhs == null ? elevation : tmp4_elvis_lhs;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
break;
|
|
952
|
-
case 'time':
|
|
953
|
-
// Inline function 'kotlin.text.trim' call
|
|
954
|
-
|
|
955
|
-
var this_1 = readElementText($this, reader);
|
|
956
|
-
var txt_0 = toString(trim(isCharSequence(this_1) ? this_1 : THROW_CCE()));
|
|
957
|
-
// Inline function 'kotlin.text.isNotEmpty' call
|
|
958
|
-
|
|
959
|
-
if (charSequenceLength(txt_0) > 0)
|
|
960
|
-
timeMs = parseTimeIsoToMs($this, txt_0);
|
|
961
|
-
break;
|
|
962
|
-
case 'extensions':
|
|
963
|
-
parseExtensions($this, reader, ext);
|
|
964
|
-
break;
|
|
965
|
-
default:
|
|
966
|
-
skipElement($this, reader);
|
|
967
|
-
break;
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
break;
|
|
971
|
-
case 2:
|
|
972
|
-
return new GpxTrackPoint(lat, lon, elevation, timeMs, ext.h1i_1, ext.i1i_1, ext.j1i_1, ext.k1i_1);
|
|
973
|
-
default:
|
|
974
|
-
break;
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
return new GpxTrackPoint(lat, lon, elevation, timeMs, ext.h1i_1, ext.i1i_1, ext.j1i_1, ext.k1i_1);
|
|
978
|
-
}
|
|
979
|
-
function parseExtensions($this, reader, ext) {
|
|
980
|
-
while (reader.j()) {
|
|
981
|
-
var ev = reader.k();
|
|
982
|
-
switch (ev.l1_1) {
|
|
983
|
-
case 1:
|
|
984
|
-
var ln = reader.o15();
|
|
985
|
-
// Inline function 'kotlin.text.lowercase' call
|
|
986
|
-
|
|
987
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
988
|
-
|
|
989
|
-
switch (ln.toLowerCase()) {
|
|
990
|
-
case 'power':
|
|
991
|
-
var tmp2_safe_receiver = readNumeric($this, reader);
|
|
992
|
-
if (tmp2_safe_receiver == null)
|
|
993
|
-
null;
|
|
994
|
-
else {
|
|
995
|
-
// Inline function 'kotlin.let' call
|
|
996
|
-
var tmp = ext;
|
|
997
|
-
var tmp0_elvis_lhs = ext.k1i_1;
|
|
998
|
-
tmp.k1i_1 = tmp0_elvis_lhs == null ? tmp2_safe_receiver : tmp0_elvis_lhs;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
break;
|
|
1002
|
-
case 'hr':
|
|
1003
|
-
case 'heartrate':
|
|
1004
|
-
var tmp3_safe_receiver = readNumeric($this, reader);
|
|
1005
|
-
if (tmp3_safe_receiver == null)
|
|
1006
|
-
null;
|
|
1007
|
-
else {
|
|
1008
|
-
// Inline function 'kotlin.let' call
|
|
1009
|
-
if (ext.h1i_1 == null)
|
|
1010
|
-
ext.h1i_1 = numberToInt(tmp3_safe_receiver);
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
break;
|
|
1014
|
-
case 'cad':
|
|
1015
|
-
case 'cadence':
|
|
1016
|
-
var tmp4_safe_receiver = readNumeric($this, reader);
|
|
1017
|
-
if (tmp4_safe_receiver == null)
|
|
1018
|
-
null;
|
|
1019
|
-
else {
|
|
1020
|
-
// Inline function 'kotlin.let' call
|
|
1021
|
-
if (ext.i1i_1 == null)
|
|
1022
|
-
ext.i1i_1 = numberToInt(tmp4_safe_receiver);
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
break;
|
|
1026
|
-
case 'atemp':
|
|
1027
|
-
case 'temperature':
|
|
1028
|
-
case 'temp':
|
|
1029
|
-
var tmp5_safe_receiver = readNumeric($this, reader);
|
|
1030
|
-
if (tmp5_safe_receiver == null)
|
|
1031
|
-
null;
|
|
1032
|
-
else {
|
|
1033
|
-
// Inline function 'kotlin.let' call
|
|
1034
|
-
var tmp_0 = ext;
|
|
1035
|
-
var tmp0_elvis_lhs_0 = ext.j1i_1;
|
|
1036
|
-
tmp_0.j1i_1 = tmp0_elvis_lhs_0 == null ? tmp5_safe_receiver : tmp0_elvis_lhs_0;
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
break;
|
|
1040
|
-
default:
|
|
1041
|
-
parseExtensions($this, reader, ext);
|
|
1042
|
-
break;
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
break;
|
|
1046
|
-
case 2:
|
|
1047
|
-
return Unit_instance;
|
|
1048
|
-
default:
|
|
1049
|
-
break;
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
function readElementText($this, reader) {
|
|
1054
|
-
var sb = StringBuilder_init_$Create$();
|
|
1055
|
-
while (reader.j()) {
|
|
1056
|
-
var ev = reader.k();
|
|
1057
|
-
switch (ev.l1_1) {
|
|
1058
|
-
case 4:
|
|
1059
|
-
case 5:
|
|
1060
|
-
case 9:
|
|
1061
|
-
sb.j5(reader.s15());
|
|
1062
|
-
break;
|
|
1063
|
-
case 1:
|
|
1064
|
-
skipElement($this, reader);
|
|
1065
|
-
break;
|
|
1066
|
-
case 2:
|
|
1067
|
-
return sb.toString();
|
|
1068
|
-
default:
|
|
1069
|
-
break;
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
return sb.toString();
|
|
1073
|
-
}
|
|
1074
|
-
function readNumeric($this, reader) {
|
|
1075
|
-
// Inline function 'kotlin.text.trim' call
|
|
1076
|
-
var this_0 = readElementText($this, reader);
|
|
1077
|
-
var txt = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
|
|
1078
|
-
return toDoubleOrNull(txt);
|
|
1079
|
-
}
|
|
1080
|
-
function skipElement($this, reader) {
|
|
1081
|
-
var depth = 1;
|
|
1082
|
-
while (reader.j() && depth > 0) {
|
|
1083
|
-
switch (reader.k().l1_1) {
|
|
1084
|
-
case 1:
|
|
1085
|
-
depth = depth + 1 | 0;
|
|
1086
|
-
break;
|
|
1087
|
-
case 2:
|
|
1088
|
-
depth = depth - 1 | 0;
|
|
1089
|
-
break;
|
|
1090
|
-
default:
|
|
1091
|
-
break;
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
function parseTimeIsoToMs($this, text) {
|
|
1096
|
-
var tmp;
|
|
1097
|
-
try {
|
|
1098
|
-
tmp = Companion_getInstance().lb(text).pb();
|
|
1099
|
-
} catch ($p) {
|
|
1100
|
-
var tmp_0;
|
|
1101
|
-
if ($p instanceof IllegalArgumentException) {
|
|
1102
|
-
var e = $p;
|
|
1103
|
-
tmp_0 = null;
|
|
1104
|
-
} else {
|
|
1105
|
-
if ($p instanceof Error) {
|
|
1106
|
-
var e_0 = $p;
|
|
1107
|
-
tmp_0 = null;
|
|
1108
|
-
} else {
|
|
1109
|
-
throw $p;
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
tmp = tmp_0;
|
|
1113
|
-
}
|
|
1114
|
-
return tmp;
|
|
1115
|
-
}
|
|
1116
|
-
function ExtensionsAccumulator(heartRate, cadence, temperatureC, powerW) {
|
|
1117
|
-
heartRate = heartRate === VOID ? null : heartRate;
|
|
1118
|
-
cadence = cadence === VOID ? null : cadence;
|
|
1119
|
-
temperatureC = temperatureC === VOID ? null : temperatureC;
|
|
1120
|
-
powerW = powerW === VOID ? null : powerW;
|
|
1121
|
-
this.h1i_1 = heartRate;
|
|
1122
|
-
this.i1i_1 = cadence;
|
|
1123
|
-
this.j1i_1 = temperatureC;
|
|
1124
|
-
this.k1i_1 = powerW;
|
|
1125
|
-
}
|
|
1126
|
-
function GpxParser() {
|
|
1127
|
-
}
|
|
1128
|
-
protoOf(GpxParser).l1i = function (xml) {
|
|
1129
|
-
var tmp;
|
|
1130
|
-
try {
|
|
1131
|
-
tmp = get_xmlStreaming().t16(xml);
|
|
1132
|
-
} catch ($p) {
|
|
1133
|
-
var tmp_0;
|
|
1134
|
-
if ($p instanceof XmlException) {
|
|
1135
|
-
var e = $p;
|
|
1136
|
-
throw IllegalArgumentException_init_$Create$_0('Invalid GPX XML: ' + e.message, e);
|
|
1137
|
-
} else {
|
|
1138
|
-
throw $p;
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
var reader = tmp;
|
|
1142
|
-
var tmp_1;
|
|
1143
|
-
try {
|
|
1144
|
-
tmp_1 = parseDocument(this, reader);
|
|
1145
|
-
} catch ($p) {
|
|
1146
|
-
var tmp_2;
|
|
1147
|
-
if ($p instanceof XmlException) {
|
|
1148
|
-
var e_0 = $p;
|
|
1149
|
-
throw IllegalArgumentException_init_$Create$_0('Invalid GPX XML: ' + e_0.message, e_0);
|
|
1150
|
-
} else {
|
|
1151
|
-
throw $p;
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
finally {
|
|
1155
|
-
reader.b16();
|
|
1156
|
-
}
|
|
1157
|
-
return tmp_1;
|
|
1158
|
-
};
|
|
1159
|
-
var GpxParser_instance;
|
|
1160
|
-
function GpxParser_getInstance() {
|
|
1161
|
-
return GpxParser_instance;
|
|
1162
|
-
}
|
|
1163
|
-
function firstTrackAsPath(_this__u8e3s4) {
|
|
1164
|
-
var tmp0_elvis_lhs = firstOrNull(_this__u8e3s4.l1h_1);
|
|
1165
|
-
var tmp;
|
|
1166
|
-
if (tmp0_elvis_lhs == null) {
|
|
1167
|
-
// Inline function 'kotlin.error' call
|
|
1168
|
-
var message = 'GpxDocument has no track';
|
|
1169
|
-
throw IllegalStateException_init_$Create$(toString(message));
|
|
1170
|
-
} else {
|
|
1171
|
-
tmp = tmp0_elvis_lhs;
|
|
1172
|
-
}
|
|
1173
|
-
var track = tmp;
|
|
1174
|
-
return toPath(track);
|
|
1175
|
-
}
|
|
1176
|
-
function toPath(_this__u8e3s4) {
|
|
1177
|
-
var n = _this__u8e3s4.o1h_1.l();
|
|
1178
|
-
var path = new Path(n);
|
|
1179
|
-
var iterator = _this__u8e3s4.o1h_1.i();
|
|
1180
|
-
var index = 0;
|
|
1181
|
-
while (iterator.j()) {
|
|
1182
|
-
var i = index;
|
|
1183
|
-
index = index + 1 | 0;
|
|
1184
|
-
var p = iterator.k();
|
|
1185
|
-
path.m1i(i, p.p1h_1 * MathConstants_getInstance().av_1);
|
|
1186
|
-
path.n1i(i, p.q1h_1 * MathConstants_getInstance().av_1);
|
|
1187
|
-
var tmp0_elvis_lhs = p.r1h_1;
|
|
1188
|
-
path.o1i(i, tmp0_elvis_lhs == null ? 0.0 : tmp0_elvis_lhs);
|
|
1189
|
-
var tmp1_elvis_lhs = p.s1h_1;
|
|
1190
|
-
path.p1i(i, toNumber(tmp1_elvis_lhs == null ? new Long(0, 0) : tmp1_elvis_lhs));
|
|
1191
|
-
var tmp2_safe_receiver = p.w1h_1;
|
|
1192
|
-
if (tmp2_safe_receiver == null)
|
|
1193
|
-
null;
|
|
1194
|
-
else {
|
|
1195
|
-
// Inline function 'kotlin.let' call
|
|
1196
|
-
path.q1i(i, tmp2_safe_receiver);
|
|
1197
|
-
}
|
|
1198
|
-
var tmp3_safe_receiver = p.t1h_1;
|
|
1199
|
-
if (tmp3_safe_receiver == null)
|
|
1200
|
-
null;
|
|
1201
|
-
else {
|
|
1202
|
-
// Inline function 'kotlin.let' call
|
|
1203
|
-
path.r1i(i, tmp3_safe_receiver);
|
|
1204
|
-
}
|
|
1205
|
-
var tmp4_safe_receiver = p.u1h_1;
|
|
1206
|
-
if (tmp4_safe_receiver == null)
|
|
1207
|
-
null;
|
|
1208
|
-
else {
|
|
1209
|
-
// Inline function 'kotlin.let' call
|
|
1210
|
-
path.s1i(i, tmp4_safe_receiver);
|
|
1211
|
-
}
|
|
1212
|
-
var tmp5_safe_receiver = p.v1h_1;
|
|
1213
|
-
if (tmp5_safe_receiver == null)
|
|
1214
|
-
null;
|
|
1215
|
-
else {
|
|
1216
|
-
// Inline function 'kotlin.let' call
|
|
1217
|
-
path.t1i(i, tmp5_safe_receiver);
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
path.d1j();
|
|
1221
|
-
return path;
|
|
1222
|
-
}
|
|
1223
|
-
function writeDocument($this, w, document) {
|
|
1224
|
-
w.c17('', 'http://www.topografix.com/GPX/1/1');
|
|
1225
|
-
w.c17('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
|
1226
|
-
w.c17('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1');
|
|
1227
|
-
w.e17('http://www.topografix.com/GPX/1/1', 'gpx', '');
|
|
1228
|
-
w.g17(null, 'version', null, '1.1');
|
|
1229
|
-
w.g17(null, 'creator', null, '@glandais/vcyclist');
|
|
1230
|
-
w.d17('', 'http://www.topografix.com/GPX/1/1');
|
|
1231
|
-
w.d17('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
|
1232
|
-
w.d17('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1');
|
|
1233
|
-
w.g17('http://www.w3.org/2001/XMLSchema-instance', 'schemaLocation', 'xsi', 'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd');
|
|
1234
|
-
writeMetadata($this, w, document.k1h_1);
|
|
1235
|
-
var _iterator__ex2g4s = document.l1h_1.i();
|
|
1236
|
-
while (_iterator__ex2g4s.j()) {
|
|
1237
|
-
var track = _iterator__ex2g4s.k();
|
|
1238
|
-
writeTrack($this, w, track);
|
|
1239
|
-
}
|
|
1240
|
-
w.j17('http://www.topografix.com/GPX/1/1', 'gpx', '');
|
|
1241
|
-
}
|
|
1242
|
-
function writeMetadata($this, w, name) {
|
|
1243
|
-
w.e17('http://www.topografix.com/GPX/1/1', 'metadata', '');
|
|
1244
|
-
writeSimpleText($this, w, 'name', name);
|
|
1245
|
-
w.j17('http://www.topografix.com/GPX/1/1', 'metadata', '');
|
|
1246
|
-
}
|
|
1247
|
-
function writeTrack($this, w, track) {
|
|
1248
|
-
w.e17('http://www.topografix.com/GPX/1/1', 'trk', '');
|
|
1249
|
-
var tmp0_safe_receiver = track.m1h_1;
|
|
1250
|
-
if (tmp0_safe_receiver == null)
|
|
1251
|
-
null;
|
|
1252
|
-
else {
|
|
1253
|
-
// Inline function 'kotlin.let' call
|
|
1254
|
-
writeSimpleText(GpxWriter_instance, w, 'name', tmp0_safe_receiver);
|
|
1255
|
-
}
|
|
1256
|
-
var tmp1_safe_receiver = track.n1h_1;
|
|
1257
|
-
if (tmp1_safe_receiver == null)
|
|
1258
|
-
null;
|
|
1259
|
-
else {
|
|
1260
|
-
// Inline function 'kotlin.let' call
|
|
1261
|
-
writeSimpleText(GpxWriter_instance, w, 'type', tmp1_safe_receiver);
|
|
1262
|
-
}
|
|
1263
|
-
w.e17('http://www.topografix.com/GPX/1/1', 'trkseg', '');
|
|
1264
|
-
var _iterator__ex2g4s = track.o1h_1.i();
|
|
1265
|
-
while (_iterator__ex2g4s.j()) {
|
|
1266
|
-
var p = _iterator__ex2g4s.k();
|
|
1267
|
-
writeTrackPoint($this, w, p);
|
|
1268
|
-
}
|
|
1269
|
-
w.j17('http://www.topografix.com/GPX/1/1', 'trkseg', '');
|
|
1270
|
-
w.j17('http://www.topografix.com/GPX/1/1', 'trk', '');
|
|
1271
|
-
}
|
|
1272
|
-
function writeTrackPoint($this, w, p) {
|
|
1273
|
-
w.e17('http://www.topografix.com/GPX/1/1', 'trkpt', '');
|
|
1274
|
-
w.g17(null, 'lat', null, p.p1h_1.toString());
|
|
1275
|
-
w.g17(null, 'lon', null, p.q1h_1.toString());
|
|
1276
|
-
var tmp0_safe_receiver = p.s1h_1;
|
|
1277
|
-
if (tmp0_safe_receiver == null)
|
|
1278
|
-
null;
|
|
1279
|
-
else {
|
|
1280
|
-
// Inline function 'kotlin.let' call
|
|
1281
|
-
writeSimpleText(GpxWriter_instance, w, 'time', Companion_getInstance().ib(tmp0_safe_receiver).toString());
|
|
1282
|
-
}
|
|
1283
|
-
var tmp1_safe_receiver = p.r1h_1;
|
|
1284
|
-
if (tmp1_safe_receiver == null)
|
|
1285
|
-
null;
|
|
1286
|
-
else {
|
|
1287
|
-
// Inline function 'kotlin.let' call
|
|
1288
|
-
writeSimpleText(GpxWriter_instance, w, 'ele', tmp1_safe_receiver.toString());
|
|
1289
|
-
}
|
|
1290
|
-
var hasGarminExt = !(p.t1h_1 == null) || !(p.u1h_1 == null) || !(p.v1h_1 == null);
|
|
1291
|
-
var hasPower = !(p.w1h_1 == null);
|
|
1292
|
-
if (hasGarminExt || hasPower) {
|
|
1293
|
-
w.e17('http://www.topografix.com/GPX/1/1', 'extensions', '');
|
|
1294
|
-
if (hasPower) {
|
|
1295
|
-
writeSimpleText($this, w, 'power', p.w1h_1.toString());
|
|
1296
|
-
}
|
|
1297
|
-
if (hasGarminExt) {
|
|
1298
|
-
w.e17('http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'TrackPointExtension', 'gpxtpx');
|
|
1299
|
-
var tmp2_safe_receiver = p.t1h_1;
|
|
1300
|
-
if (tmp2_safe_receiver == null)
|
|
1301
|
-
null;
|
|
1302
|
-
else {
|
|
1303
|
-
// Inline function 'kotlin.let' call
|
|
1304
|
-
writeNamespaced(GpxWriter_instance, w, 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'hr', 'gpxtpx', tmp2_safe_receiver.toString());
|
|
1305
|
-
}
|
|
1306
|
-
var tmp3_safe_receiver = p.u1h_1;
|
|
1307
|
-
if (tmp3_safe_receiver == null)
|
|
1308
|
-
null;
|
|
1309
|
-
else {
|
|
1310
|
-
// Inline function 'kotlin.let' call
|
|
1311
|
-
writeNamespaced(GpxWriter_instance, w, 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'cad', 'gpxtpx', tmp3_safe_receiver.toString());
|
|
1312
|
-
}
|
|
1313
|
-
var tmp4_safe_receiver = p.v1h_1;
|
|
1314
|
-
if (tmp4_safe_receiver == null)
|
|
1315
|
-
null;
|
|
1316
|
-
else {
|
|
1317
|
-
// Inline function 'kotlin.let' call
|
|
1318
|
-
writeNamespaced(GpxWriter_instance, w, 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'atemp', 'gpxtpx', tmp4_safe_receiver.toString());
|
|
1319
|
-
}
|
|
1320
|
-
w.j17('http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'TrackPointExtension', 'gpxtpx');
|
|
1321
|
-
}
|
|
1322
|
-
w.j17('http://www.topografix.com/GPX/1/1', 'extensions', '');
|
|
1323
|
-
}
|
|
1324
|
-
w.j17('http://www.topografix.com/GPX/1/1', 'trkpt', '');
|
|
1325
|
-
}
|
|
1326
|
-
function writeSimpleText($this, w, localName, text) {
|
|
1327
|
-
w.e17('http://www.topografix.com/GPX/1/1', localName, '');
|
|
1328
|
-
w.f17(text);
|
|
1329
|
-
w.j17('http://www.topografix.com/GPX/1/1', localName, '');
|
|
1330
|
-
}
|
|
1331
|
-
function writeNamespaced($this, w, namespace, localName, prefix, text) {
|
|
1332
|
-
w.e17(namespace, localName, prefix);
|
|
1333
|
-
w.f17(text);
|
|
1334
|
-
w.j17(namespace, localName, prefix);
|
|
1335
|
-
}
|
|
1336
|
-
function GpxWriter() {
|
|
1337
|
-
this.e1j_1 = 'http://www.topografix.com/GPX/1/1';
|
|
1338
|
-
this.f1j_1 = 'http://www.w3.org/2001/XMLSchema-instance';
|
|
1339
|
-
this.g1j_1 = 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1';
|
|
1340
|
-
this.h1j_1 = 'xsi';
|
|
1341
|
-
this.i1j_1 = 'gpxtpx';
|
|
1342
|
-
this.j1j_1 = 'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd';
|
|
1343
|
-
this.k1j_1 = '@glandais/vcyclist';
|
|
1344
|
-
}
|
|
1345
|
-
protoOf(GpxWriter).l1j = function (document) {
|
|
1346
|
-
var out = StringBuilder_init_$Create$();
|
|
1347
|
-
out.j5('<?xml version="1.0" encoding="UTF-8"?>\n');
|
|
1348
|
-
var writer = newGenericWriter(get_xmlStreaming(), out, false, XmlDeclMode_None_getInstance());
|
|
1349
|
-
try {
|
|
1350
|
-
writeDocument(this, writer, document);
|
|
1351
|
-
}finally {
|
|
1352
|
-
writer.b16();
|
|
1353
|
-
}
|
|
1354
|
-
return out.toString();
|
|
1355
|
-
};
|
|
1356
|
-
var GpxWriter_instance;
|
|
1357
|
-
function GpxWriter_getInstance() {
|
|
1358
|
-
return GpxWriter_instance;
|
|
1359
|
-
}
|
|
1360
|
-
function copyAllSlots($this, source) {
|
|
1361
|
-
var out = new Path(source.x1h_1);
|
|
1362
|
-
var inductionVariable = 0;
|
|
1363
|
-
var last = source.x1h_1;
|
|
1364
|
-
if (inductionVariable < last)
|
|
1365
|
-
do {
|
|
1366
|
-
var i = inductionVariable;
|
|
1367
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
1368
|
-
var _iterator__ex2g4s = get_entries().i();
|
|
1369
|
-
while (_iterator__ex2g4s.j()) {
|
|
1370
|
-
var field = _iterator__ex2g4s.k();
|
|
1371
|
-
out.n1j(i, field, source.m1j(i, field));
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
while (inductionVariable < last);
|
|
1375
|
-
return out;
|
|
1376
|
-
}
|
|
1377
|
-
function $fixElevationCOROUTINE$(_this__u8e3s4, source, provider, resultContinuation) {
|
|
1378
|
-
CoroutineImpl.call(this, resultContinuation);
|
|
1379
|
-
this.w1j_1 = _this__u8e3s4;
|
|
1380
|
-
this.x1j_1 = source;
|
|
1381
|
-
this.y1j_1 = provider;
|
|
1382
|
-
}
|
|
1383
|
-
protoOf($fixElevationCOROUTINE$).c6 = function () {
|
|
1384
|
-
var suspendResult = this.w5_1;
|
|
1385
|
-
$sm: do
|
|
1386
|
-
try {
|
|
1387
|
-
var tmp = this.u5_1;
|
|
1388
|
-
switch (tmp) {
|
|
1389
|
-
case 0:
|
|
1390
|
-
this.v5_1 = 2;
|
|
1391
|
-
if (this.x1j_1.x1h_1 === 0)
|
|
1392
|
-
return new Path(0);
|
|
1393
|
-
var size = this.x1j_1.x1h_1;
|
|
1394
|
-
var list = ArrayList_init_$Create$(size);
|
|
1395
|
-
var inductionVariable = 0;
|
|
1396
|
-
if (inductionVariable < size)
|
|
1397
|
-
do {
|
|
1398
|
-
var index = inductionVariable;
|
|
1399
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
1400
|
-
list.h(new LatLon(this.x1j_1.z1h(index) * MathConstants_getInstance().bv_1, this.x1j_1.a1i(index) * MathConstants_getInstance().bv_1));
|
|
1401
|
-
}
|
|
1402
|
-
while (inductionVariable < size);
|
|
1403
|
-
var coords = list;
|
|
1404
|
-
this.u5_1 = 1;
|
|
1405
|
-
suspendResult = this.y1j_1.xy(coords, VOID, this);
|
|
1406
|
-
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
1407
|
-
return suspendResult;
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
continue $sm;
|
|
1411
|
-
case 1:
|
|
1412
|
-
var corrected = suspendResult;
|
|
1413
|
-
var out = copyAllSlots(this.w1j_1, this.x1j_1);
|
|
1414
|
-
var inductionVariable_0 = 0;
|
|
1415
|
-
var last = out.x1h_1;
|
|
1416
|
-
if (inductionVariable_0 < last)
|
|
1417
|
-
do {
|
|
1418
|
-
var i = inductionVariable_0;
|
|
1419
|
-
inductionVariable_0 = inductionVariable_0 + 1 | 0;
|
|
1420
|
-
out.o1i(i, corrected.m(i).fv());
|
|
1421
|
-
}
|
|
1422
|
-
while (inductionVariable_0 < last);
|
|
1423
|
-
out.d1j();
|
|
1424
|
-
return out;
|
|
1425
|
-
case 2:
|
|
1426
|
-
throw this.x5_1;
|
|
1427
|
-
}
|
|
1428
|
-
} catch ($p) {
|
|
1429
|
-
var e = $p;
|
|
1430
|
-
if (this.v5_1 === 2) {
|
|
1431
|
-
throw e;
|
|
1432
|
-
} else {
|
|
1433
|
-
this.u5_1 = this.v5_1;
|
|
1434
|
-
this.x5_1 = e;
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
while (true);
|
|
1438
|
-
};
|
|
1439
|
-
function ElevationStep() {
|
|
1440
|
-
this.u1g_1 = 150.0;
|
|
1441
|
-
}
|
|
1442
|
-
protoOf(ElevationStep).v1g = function (source, provider, $completion) {
|
|
1443
|
-
var tmp = new $fixElevationCOROUTINE$(this, source, provider, $completion);
|
|
1444
|
-
tmp.w5_1 = Unit_instance;
|
|
1445
|
-
tmp.x5_1 = null;
|
|
1446
|
-
return tmp.c6();
|
|
1447
|
-
};
|
|
1448
|
-
protoOf(ElevationStep).z1j = function (source, windowM) {
|
|
1449
|
-
if (source.x1h_1 === 0)
|
|
1450
|
-
return new Path(0);
|
|
1451
|
-
// Inline function 'kotlin.collections.List' call
|
|
1452
|
-
// Inline function 'kotlin.collections.MutableList' call
|
|
1453
|
-
var size = source.x1h_1;
|
|
1454
|
-
var list = ArrayList_init_$Create$(size);
|
|
1455
|
-
// Inline function 'kotlin.repeat' call
|
|
1456
|
-
var inductionVariable = 0;
|
|
1457
|
-
if (inductionVariable < size)
|
|
1458
|
-
do {
|
|
1459
|
-
var index = inductionVariable;
|
|
1460
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
1461
|
-
var tmp$ret$4 = source.a1k(index);
|
|
1462
|
-
list.h(tmp$ret$4);
|
|
1463
|
-
}
|
|
1464
|
-
while (inductionVariable < size);
|
|
1465
|
-
var coords = list;
|
|
1466
|
-
var smoothed = ElevationSmoother_instance.uu(coords, windowM);
|
|
1467
|
-
var out = copyAllSlots(this, source);
|
|
1468
|
-
var inductionVariable_0 = 0;
|
|
1469
|
-
var last = out.x1h_1;
|
|
1470
|
-
if (inductionVariable_0 < last)
|
|
1471
|
-
do {
|
|
1472
|
-
var i = inductionVariable_0;
|
|
1473
|
-
inductionVariable_0 = inductionVariable_0 + 1 | 0;
|
|
1474
|
-
out.o1i(i, smoothed.m(i).fv());
|
|
1475
|
-
}
|
|
1476
|
-
while (inductionVariable_0 < last);
|
|
1477
|
-
out.d1j();
|
|
1478
|
-
return out;
|
|
1479
|
-
};
|
|
1480
|
-
protoOf(ElevationStep).w1g = function (source, windowM, $super) {
|
|
1481
|
-
windowM = windowM === VOID ? 150.0 : windowM;
|
|
1482
|
-
return $super === VOID ? this.z1j(source, windowM) : $super.z1j.call(this, source, windowM);
|
|
1483
|
-
};
|
|
1484
|
-
var ElevationStep_instance;
|
|
1485
|
-
function ElevationStep_getInstance() {
|
|
1486
|
-
return ElevationStep_instance;
|
|
1487
|
-
}
|
|
1488
|
-
function GeneratedPath(size) {
|
|
1489
|
-
this.x1h_1 = size;
|
|
1490
|
-
// Inline function 'kotlin.require' call
|
|
1491
|
-
if (!(this.x1h_1 >= 0)) {
|
|
1492
|
-
var message = 'Negative size: ' + this.x1h_1;
|
|
1493
|
-
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
1494
|
-
}
|
|
1495
|
-
this.y1h_1 = new Float64Array(imul(this.x1h_1, 36));
|
|
1496
|
-
}
|
|
1497
|
-
protoOf(GeneratedPath).m1j = function (i, field) {
|
|
1498
|
-
return this.y1h_1[imul(i, 36) + field.l1_1 | 0];
|
|
1499
|
-
};
|
|
1500
|
-
protoOf(GeneratedPath).n1j = function (i, field, v) {
|
|
1501
|
-
this.y1h_1[imul(i, 36) + field.l1_1 | 0] = v;
|
|
1502
|
-
};
|
|
1503
|
-
protoOf(GeneratedPath).z1h = function (i) {
|
|
1504
|
-
return this.y1h_1[imul(i, 36) + 0 | 0];
|
|
1505
|
-
};
|
|
1506
|
-
protoOf(GeneratedPath).m1i = function (i, v) {
|
|
1507
|
-
this.y1h_1[imul(i, 36) + 0 | 0] = v;
|
|
1508
|
-
};
|
|
1509
|
-
protoOf(GeneratedPath).a1i = function (i) {
|
|
1510
|
-
return this.y1h_1[imul(i, 36) + 1 | 0];
|
|
1511
|
-
};
|
|
1512
|
-
protoOf(GeneratedPath).n1i = function (i, v) {
|
|
1513
|
-
this.y1h_1[imul(i, 36) + 1 | 0] = v;
|
|
1514
|
-
};
|
|
1515
|
-
protoOf(GeneratedPath).b1k = function (i) {
|
|
1516
|
-
return this.y1h_1[imul(i, 36) + 2 | 0];
|
|
1517
|
-
};
|
|
1518
|
-
protoOf(GeneratedPath).c1k = function (i, v) {
|
|
1519
|
-
this.y1h_1[imul(i, 36) + 2 | 0] = v;
|
|
1520
|
-
};
|
|
1521
|
-
protoOf(GeneratedPath).d1k = function (i, v) {
|
|
1522
|
-
this.y1h_1[imul(i, 36) + 3 | 0] = v;
|
|
1523
|
-
};
|
|
1524
|
-
protoOf(GeneratedPath).c1i = function (i) {
|
|
1525
|
-
return this.y1h_1[imul(i, 36) + 4 | 0];
|
|
1526
|
-
};
|
|
1527
|
-
protoOf(GeneratedPath).p1i = function (i, v) {
|
|
1528
|
-
this.y1h_1[imul(i, 36) + 4 | 0] = v;
|
|
1529
|
-
};
|
|
1530
|
-
protoOf(GeneratedPath).e1k = function (i) {
|
|
1531
|
-
return this.y1h_1[imul(i, 36) + 5 | 0];
|
|
1532
|
-
};
|
|
1533
|
-
protoOf(GeneratedPath).f1k = function (i, v) {
|
|
1534
|
-
this.y1h_1[imul(i, 36) + 5 | 0] = v;
|
|
1535
|
-
};
|
|
1536
|
-
protoOf(GeneratedPath).g1k = function (i) {
|
|
1537
|
-
return this.y1h_1[imul(i, 36) + 6 | 0];
|
|
1538
|
-
};
|
|
1539
|
-
protoOf(GeneratedPath).h1k = function (i, v) {
|
|
1540
|
-
this.y1h_1[imul(i, 36) + 6 | 0] = v;
|
|
1541
|
-
};
|
|
1542
|
-
protoOf(GeneratedPath).i1k = function (i) {
|
|
1543
|
-
return this.y1h_1[imul(i, 36) + 7 | 0];
|
|
1544
|
-
};
|
|
1545
|
-
protoOf(GeneratedPath).j1k = function (i, v) {
|
|
1546
|
-
this.y1h_1[imul(i, 36) + 7 | 0] = v;
|
|
1547
|
-
};
|
|
1548
|
-
protoOf(GeneratedPath).b1i = function (i) {
|
|
1549
|
-
return this.y1h_1[imul(i, 36) + 8 | 0];
|
|
1550
|
-
};
|
|
1551
|
-
protoOf(GeneratedPath).o1i = function (i, v) {
|
|
1552
|
-
this.y1h_1[imul(i, 36) + 8 | 0] = v;
|
|
1553
|
-
};
|
|
1554
|
-
protoOf(GeneratedPath).k1k = function (i) {
|
|
1555
|
-
return this.y1h_1[imul(i, 36) + 9 | 0];
|
|
1556
|
-
};
|
|
1557
|
-
protoOf(GeneratedPath).l1k = function (i, v) {
|
|
1558
|
-
this.y1h_1[imul(i, 36) + 9 | 0] = v;
|
|
1559
|
-
};
|
|
1560
|
-
protoOf(GeneratedPath).m1k = function (i, v) {
|
|
1561
|
-
this.y1h_1[imul(i, 36) + 10 | 0] = v;
|
|
1562
|
-
};
|
|
1563
|
-
protoOf(GeneratedPath).n1k = function (i, v) {
|
|
1564
|
-
this.y1h_1[imul(i, 36) + 11 | 0] = v;
|
|
1565
|
-
};
|
|
1566
|
-
protoOf(GeneratedPath).o1k = function (i, v) {
|
|
1567
|
-
this.y1h_1[imul(i, 36) + 12 | 0] = v;
|
|
1568
|
-
};
|
|
1569
|
-
protoOf(GeneratedPath).p1k = function (i, v) {
|
|
1570
|
-
this.y1h_1[imul(i, 36) + 13 | 0] = v;
|
|
1571
|
-
};
|
|
1572
|
-
protoOf(GeneratedPath).q1k = function (i, v) {
|
|
1573
|
-
this.y1h_1[imul(i, 36) + 14 | 0] = v;
|
|
1574
|
-
};
|
|
1575
|
-
protoOf(GeneratedPath).r1k = function (i, v) {
|
|
1576
|
-
this.y1h_1[imul(i, 36) + 15 | 0] = v;
|
|
1577
|
-
};
|
|
1578
|
-
protoOf(GeneratedPath).s1k = function (i, v) {
|
|
1579
|
-
this.y1h_1[imul(i, 36) + 16 | 0] = v;
|
|
1580
|
-
};
|
|
1581
|
-
protoOf(GeneratedPath).t1k = function (i, v) {
|
|
1582
|
-
this.y1h_1[imul(i, 36) + 17 | 0] = v;
|
|
1583
|
-
};
|
|
1584
|
-
protoOf(GeneratedPath).g1i = function (i) {
|
|
1585
|
-
return this.y1h_1[imul(i, 36) + 18 | 0];
|
|
1586
|
-
};
|
|
1587
|
-
protoOf(GeneratedPath).q1i = function (i, v) {
|
|
1588
|
-
this.y1h_1[imul(i, 36) + 18 | 0] = v;
|
|
1589
|
-
};
|
|
1590
|
-
protoOf(GeneratedPath).u1k = function (i, v) {
|
|
1591
|
-
this.y1h_1[imul(i, 36) + 19 | 0] = v;
|
|
1592
|
-
};
|
|
1593
|
-
protoOf(GeneratedPath).v1k = function (i, v) {
|
|
1594
|
-
this.y1h_1[imul(i, 36) + 20 | 0] = v;
|
|
1595
|
-
};
|
|
1596
|
-
protoOf(GeneratedPath).w1k = function (i, v) {
|
|
1597
|
-
this.y1h_1[imul(i, 36) + 21 | 0] = v;
|
|
1598
|
-
};
|
|
1599
|
-
protoOf(GeneratedPath).x1k = function (i, v) {
|
|
1600
|
-
this.y1h_1[imul(i, 36) + 22 | 0] = v;
|
|
1601
|
-
};
|
|
1602
|
-
protoOf(GeneratedPath).y1k = function (i, v) {
|
|
1603
|
-
this.y1h_1[imul(i, 36) + 23 | 0] = v;
|
|
1604
|
-
};
|
|
1605
|
-
protoOf(GeneratedPath).z1k = function (i, v) {
|
|
1606
|
-
this.y1h_1[imul(i, 36) + 24 | 0] = v;
|
|
1607
|
-
};
|
|
1608
|
-
protoOf(GeneratedPath).a1l = function (i, v) {
|
|
1609
|
-
this.y1h_1[imul(i, 36) + 25 | 0] = v;
|
|
1610
|
-
};
|
|
1611
|
-
protoOf(GeneratedPath).b1l = function (i) {
|
|
1612
|
-
return this.y1h_1[imul(i, 36) + 26 | 0];
|
|
1613
|
-
};
|
|
1614
|
-
protoOf(GeneratedPath).c1l = function (i, v) {
|
|
1615
|
-
this.y1h_1[imul(i, 36) + 26 | 0] = v;
|
|
1616
|
-
};
|
|
1617
|
-
protoOf(GeneratedPath).d1l = function (i) {
|
|
1618
|
-
return this.y1h_1[imul(i, 36) + 27 | 0];
|
|
1619
|
-
};
|
|
1620
|
-
protoOf(GeneratedPath).e1l = function (i, v) {
|
|
1621
|
-
this.y1h_1[imul(i, 36) + 27 | 0] = v;
|
|
1622
|
-
};
|
|
1623
|
-
protoOf(GeneratedPath).f1l = function (i) {
|
|
1624
|
-
return this.y1h_1[imul(i, 36) + 28 | 0];
|
|
1625
|
-
};
|
|
1626
|
-
protoOf(GeneratedPath).g1l = function (i, v) {
|
|
1627
|
-
this.y1h_1[imul(i, 36) + 28 | 0] = v;
|
|
1628
|
-
};
|
|
1629
|
-
protoOf(GeneratedPath).h1l = function (i, v) {
|
|
1630
|
-
this.y1h_1[imul(i, 36) + 29 | 0] = v;
|
|
1631
|
-
};
|
|
1632
|
-
protoOf(GeneratedPath).i1l = function (i, v) {
|
|
1633
|
-
this.y1h_1[imul(i, 36) + 30 | 0] = v;
|
|
1634
|
-
};
|
|
1635
|
-
protoOf(GeneratedPath).f1i = function (i) {
|
|
1636
|
-
return this.y1h_1[imul(i, 36) + 31 | 0];
|
|
1637
|
-
};
|
|
1638
|
-
protoOf(GeneratedPath).t1i = function (i, v) {
|
|
1639
|
-
this.y1h_1[imul(i, 36) + 31 | 0] = v;
|
|
1640
|
-
};
|
|
1641
|
-
protoOf(GeneratedPath).j1l = function (i, v) {
|
|
1642
|
-
this.y1h_1[imul(i, 36) + 32 | 0] = v;
|
|
1643
|
-
};
|
|
1644
|
-
protoOf(GeneratedPath).k1l = function (i, v) {
|
|
1645
|
-
this.y1h_1[imul(i, 36) + 33 | 0] = v;
|
|
1646
|
-
};
|
|
1647
|
-
protoOf(GeneratedPath).d1i = function (i) {
|
|
1648
|
-
return this.y1h_1[imul(i, 36) + 34 | 0];
|
|
1649
|
-
};
|
|
1650
|
-
protoOf(GeneratedPath).r1i = function (i, v) {
|
|
1651
|
-
this.y1h_1[imul(i, 36) + 34 | 0] = v;
|
|
1652
|
-
};
|
|
1653
|
-
protoOf(GeneratedPath).e1i = function (i) {
|
|
1654
|
-
return this.y1h_1[imul(i, 36) + 35 | 0];
|
|
1655
|
-
};
|
|
1656
|
-
protoOf(GeneratedPath).s1i = function (i, v) {
|
|
1657
|
-
this.y1h_1[imul(i, 36) + 35 | 0] = v;
|
|
1658
|
-
};
|
|
1659
665
|
function Companion_3() {
|
|
1660
666
|
Companion_instance_3 = this;
|
|
1661
|
-
this.
|
|
667
|
+
this.r21_1 = new ClimbOptions();
|
|
1662
668
|
}
|
|
1663
669
|
var Companion_instance_3;
|
|
1664
|
-
function
|
|
670
|
+
function Companion_getInstance_5() {
|
|
1665
671
|
if (Companion_instance_3 == null)
|
|
1666
672
|
new Companion_3();
|
|
1667
673
|
return Companion_instance_3;
|
|
1668
674
|
}
|
|
1669
|
-
function
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
675
|
+
function ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGradeRatio, booster, maxAnalysisPoints) {
|
|
676
|
+
Companion_getInstance_5();
|
|
677
|
+
minMinClimbElevationM = minMinClimbElevationM === VOID ? 10.0 : minMinClimbElevationM;
|
|
678
|
+
maxMinClimbElevationM = maxMinClimbElevationM === VOID ? 35.0 : maxMinClimbElevationM;
|
|
679
|
+
minClimbElevationRatio = minClimbElevationRatio === VOID ? 100.0 : minClimbElevationRatio;
|
|
680
|
+
minGradePercent = minGradePercent === VOID ? 3.0 : minGradePercent;
|
|
681
|
+
maxDiffRealGradeRatio = maxDiffRealGradeRatio === VOID ? 1.3 : maxDiffRealGradeRatio;
|
|
682
|
+
booster = booster === VOID ? 1.3 : booster;
|
|
683
|
+
maxAnalysisPoints = maxAnalysisPoints === VOID ? 3000 : maxAnalysisPoints;
|
|
684
|
+
this.s21_1 = minMinClimbElevationM;
|
|
685
|
+
this.t21_1 = maxMinClimbElevationM;
|
|
686
|
+
this.u21_1 = minClimbElevationRatio;
|
|
687
|
+
this.v21_1 = minGradePercent;
|
|
688
|
+
this.w21_1 = maxDiffRealGradeRatio;
|
|
689
|
+
this.x21_1 = booster;
|
|
690
|
+
this.y21_1 = maxAnalysisPoints;
|
|
691
|
+
// Inline function 'kotlin.require' call
|
|
692
|
+
if (!(this.y21_1 >= 2)) {
|
|
693
|
+
var message = 'maxAnalysisPoints must be at least 2';
|
|
694
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
protoOf(ClimbOptions).toString = function () {
|
|
698
|
+
return 'ClimbOptions(minMinClimbElevationM=' + this.s21_1 + ', maxMinClimbElevationM=' + this.t21_1 + ', minClimbElevationRatio=' + this.u21_1 + ', minGradePercent=' + this.v21_1 + ', maxDiffRealGradeRatio=' + this.w21_1 + ', booster=' + this.x21_1 + ', maxAnalysisPoints=' + this.y21_1 + ')';
|
|
699
|
+
};
|
|
700
|
+
protoOf(ClimbOptions).hashCode = function () {
|
|
701
|
+
var result = getNumberHashCode(this.s21_1);
|
|
702
|
+
result = imul(result, 31) + getNumberHashCode(this.t21_1) | 0;
|
|
703
|
+
result = imul(result, 31) + getNumberHashCode(this.u21_1) | 0;
|
|
704
|
+
result = imul(result, 31) + getNumberHashCode(this.v21_1) | 0;
|
|
705
|
+
result = imul(result, 31) + getNumberHashCode(this.w21_1) | 0;
|
|
706
|
+
result = imul(result, 31) + getNumberHashCode(this.x21_1) | 0;
|
|
707
|
+
result = imul(result, 31) + this.y21_1 | 0;
|
|
1684
708
|
return result;
|
|
1685
709
|
};
|
|
1686
|
-
protoOf(
|
|
710
|
+
protoOf(ClimbOptions).equals = function (other) {
|
|
1687
711
|
if (this === other)
|
|
1688
712
|
return true;
|
|
1689
|
-
if (!(other instanceof
|
|
713
|
+
if (!(other instanceof ClimbOptions))
|
|
714
|
+
return false;
|
|
715
|
+
if (!equals(this.s21_1, other.s21_1))
|
|
716
|
+
return false;
|
|
717
|
+
if (!equals(this.t21_1, other.t21_1))
|
|
718
|
+
return false;
|
|
719
|
+
if (!equals(this.u21_1, other.u21_1))
|
|
1690
720
|
return false;
|
|
1691
|
-
if (!equals(this.
|
|
721
|
+
if (!equals(this.v21_1, other.v21_1))
|
|
1692
722
|
return false;
|
|
1693
|
-
if (!equals(this.
|
|
723
|
+
if (!equals(this.w21_1, other.w21_1))
|
|
1694
724
|
return false;
|
|
1695
|
-
if (!equals(this.
|
|
725
|
+
if (!equals(this.x21_1, other.x21_1))
|
|
1696
726
|
return false;
|
|
1697
|
-
if (!
|
|
727
|
+
if (!(this.y21_1 === other.y21_1))
|
|
1698
728
|
return false;
|
|
1699
729
|
return true;
|
|
1700
730
|
};
|
|
1701
|
-
function copyStatsFrom($this, other) {
|
|
1702
|
-
$this.w1i_1 = other.w1i_1;
|
|
1703
|
-
$this.x1i_1 = other.x1i_1;
|
|
1704
|
-
$this.y1i_1 = other.y1i_1;
|
|
1705
|
-
$this.z1i_1 = other.z1i_1;
|
|
1706
|
-
$this.a1j_1 = other.a1j_1;
|
|
1707
|
-
$this.b1j_1 = other.b1j_1;
|
|
1708
|
-
$this.c1j_1 = other.c1j_1;
|
|
1709
|
-
}
|
|
1710
|
-
function resetStats($this) {
|
|
1711
|
-
$this.w1i_1 = 0.0;
|
|
1712
|
-
$this.x1i_1 = 0.0;
|
|
1713
|
-
$this.y1i_1 = 0.0;
|
|
1714
|
-
$this.z1i_1 = 0.0;
|
|
1715
|
-
$this.a1j_1 = 0.0;
|
|
1716
|
-
$this.b1j_1 = 0.0;
|
|
1717
|
-
$this.c1j_1 = Companion_getInstance_4().l1l_1;
|
|
1718
|
-
}
|
|
1719
|
-
function computeBearing($this, from, to) {
|
|
1720
|
-
var lat1 = $this.z1h(from);
|
|
1721
|
-
var lon1 = $this.a1i(from);
|
|
1722
|
-
var lat2 = $this.z1h(to);
|
|
1723
|
-
var lon2 = $this.a1i(to);
|
|
1724
|
-
// Inline function 'kotlin.math.cos' call
|
|
1725
|
-
var x1 = lon1 * Math.cos(lat1);
|
|
1726
|
-
var y1 = lat1;
|
|
1727
|
-
// Inline function 'kotlin.math.cos' call
|
|
1728
|
-
var x2 = lon2 * Math.cos(lat2);
|
|
1729
|
-
var y2 = lat2;
|
|
1730
|
-
var dy = y2 - y1;
|
|
1731
|
-
var dx = x2 - x1;
|
|
1732
|
-
// Inline function 'kotlin.math.atan2' call
|
|
1733
|
-
var y = -dy;
|
|
1734
|
-
return Math.atan2(y, dx);
|
|
1735
|
-
}
|
|
1736
731
|
function Companion_4() {
|
|
1737
732
|
}
|
|
733
|
+
protoOf(Companion_4).z21 = function (path, maxPoints) {
|
|
734
|
+
var tmp;
|
|
735
|
+
if (path.u1q_1 <= maxPoints) {
|
|
736
|
+
var tmp_0 = 0;
|
|
737
|
+
var tmp_1 = path.u1q_1;
|
|
738
|
+
var tmp_2 = new Int32Array(tmp_1);
|
|
739
|
+
while (tmp_0 < tmp_1) {
|
|
740
|
+
var tmp_3 = tmp_0;
|
|
741
|
+
tmp_2[tmp_3] = tmp_3;
|
|
742
|
+
tmp_0 = tmp_0 + 1 | 0;
|
|
743
|
+
}
|
|
744
|
+
tmp = tmp_2;
|
|
745
|
+
} else {
|
|
746
|
+
var stride = ((path.u1q_1 + maxPoints | 0) - 1 | 0) / maxPoints | 0;
|
|
747
|
+
var kept = ArrayList_init_$Create$_0(maxPoints + 1 | 0);
|
|
748
|
+
var i = 0;
|
|
749
|
+
while (i < path.u1q_1) {
|
|
750
|
+
kept.h(i);
|
|
751
|
+
i = i + stride | 0;
|
|
752
|
+
}
|
|
753
|
+
if (!(last(kept) === (path.u1q_1 - 1 | 0))) {
|
|
754
|
+
kept.h(path.u1q_1 - 1 | 0);
|
|
755
|
+
}
|
|
756
|
+
tmp = toIntArray(kept);
|
|
757
|
+
}
|
|
758
|
+
var indices = tmp;
|
|
759
|
+
var tmp_4 = 0;
|
|
760
|
+
var tmp_5 = indices.length;
|
|
761
|
+
var tmp_6 = new Float64Array(tmp_5);
|
|
762
|
+
while (tmp_4 < tmp_5) {
|
|
763
|
+
var tmp_7 = tmp_4;
|
|
764
|
+
tmp_6[tmp_7] = path.k1u(indices[tmp_7]);
|
|
765
|
+
tmp_4 = tmp_4 + 1 | 0;
|
|
766
|
+
}
|
|
767
|
+
var tmp_8 = 0;
|
|
768
|
+
var tmp_9 = indices.length;
|
|
769
|
+
var tmp_10 = new Float64Array(tmp_9);
|
|
770
|
+
while (tmp_8 < tmp_9) {
|
|
771
|
+
var tmp_11 = tmp_8;
|
|
772
|
+
tmp_10[tmp_11] = path.y1q(indices[tmp_11]);
|
|
773
|
+
tmp_8 = tmp_8 + 1 | 0;
|
|
774
|
+
}
|
|
775
|
+
return new Profile(tmp_6, tmp_10, indices);
|
|
776
|
+
};
|
|
1738
777
|
var Companion_instance_4;
|
|
1739
|
-
function
|
|
778
|
+
function Companion_getInstance_6() {
|
|
1740
779
|
return Companion_instance_4;
|
|
1741
780
|
}
|
|
1742
|
-
function
|
|
1743
|
-
|
|
1744
|
-
this.
|
|
1745
|
-
this.
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
this.
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
};
|
|
1761
|
-
protoOf(Path).a1k = function (i) {
|
|
1762
|
-
return new LatLonElevation(this.r1l(i), this.s1l(i), this.b1i(i));
|
|
1763
|
-
};
|
|
1764
|
-
protoOf(Path).t1l = function () {
|
|
1765
|
-
var out = new Path(this.x1h_1);
|
|
1766
|
-
var tmp0 = this.y1h_1;
|
|
1767
|
-
var tmp2 = out.y1h_1;
|
|
1768
|
-
// Inline function 'kotlin.collections.copyInto' call
|
|
1769
|
-
var endIndex = this.y1h_1.length;
|
|
1770
|
-
// Inline function 'kotlin.js.unsafeCast' call
|
|
1771
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
1772
|
-
var tmp = tmp0;
|
|
1773
|
-
// Inline function 'kotlin.js.unsafeCast' call
|
|
1774
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
1775
|
-
arrayCopy(tmp, tmp2, 0, 0, endIndex);
|
|
1776
|
-
copyStatsFrom(out, this);
|
|
1777
|
-
return out;
|
|
1778
|
-
};
|
|
1779
|
-
protoOf(Path).d1j = function () {
|
|
1780
|
-
resetStats(this);
|
|
1781
|
-
if (this.x1h_1 === 0)
|
|
1782
|
-
return Unit_instance;
|
|
1783
|
-
var timeStart = this.c1i(0);
|
|
1784
|
-
var cumDist = 0.0;
|
|
1785
|
-
var minLat = Infinity;
|
|
1786
|
-
var maxLat = -Infinity;
|
|
1787
|
-
var minLon = Infinity;
|
|
1788
|
-
var maxLon = -Infinity;
|
|
1789
|
-
var minEle = Infinity;
|
|
1790
|
-
var maxEle = -Infinity;
|
|
1791
|
-
var gain = 0.0;
|
|
1792
|
-
var loss = 0.0;
|
|
1793
|
-
var inductionVariable = 0;
|
|
1794
|
-
var last = this.x1h_1;
|
|
781
|
+
function Profile(distance, elevation, sourceIndex) {
|
|
782
|
+
this.a22_1 = distance;
|
|
783
|
+
this.b22_1 = elevation;
|
|
784
|
+
this.c22_1 = sourceIndex;
|
|
785
|
+
}
|
|
786
|
+
protoOf(Profile).l = function () {
|
|
787
|
+
return this.a22_1.length;
|
|
788
|
+
};
|
|
789
|
+
function bestCandidateFrom($this, profile, i, minClimbElevation, options) {
|
|
790
|
+
var startDist = profile.a22_1[i];
|
|
791
|
+
var startEle = profile.b22_1[i];
|
|
792
|
+
var positiveElevation = 0.0;
|
|
793
|
+
var negativeElevation = 0.0;
|
|
794
|
+
var distClimbing = 0.0;
|
|
795
|
+
var bestScore = 0.0;
|
|
796
|
+
var best = null;
|
|
797
|
+
var inductionVariable = i + 1 | 0;
|
|
798
|
+
var last = profile.l();
|
|
1795
799
|
if (inductionVariable < last)
|
|
1796
|
-
do {
|
|
1797
|
-
var
|
|
800
|
+
$l$loop: do {
|
|
801
|
+
var j = inductionVariable;
|
|
1798
802
|
inductionVariable = inductionVariable + 1 | 0;
|
|
1799
|
-
var
|
|
1800
|
-
var
|
|
1801
|
-
var
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
var
|
|
1813
|
-
|
|
1814
|
-
// Inline function 'kotlin.math.
|
|
1815
|
-
var
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
var prevCoord = new LatLon(this.r1l(i - 1 | 0), this.s1l(i - 1 | 0));
|
|
1822
|
-
var curCoord = new LatLon(this.r1l(i), this.s1l(i));
|
|
1823
|
-
cumDist = cumDist + Distance_instance.yu(prevCoord, curCoord);
|
|
1824
|
-
var dEle = ele - this.b1i(i - 1 | 0);
|
|
1825
|
-
if (dEle > 0)
|
|
1826
|
-
gain = gain + dEle;
|
|
1827
|
-
else
|
|
1828
|
-
loss = loss + dEle;
|
|
803
|
+
var endDist = profile.a22_1[j];
|
|
804
|
+
var endEle = profile.b22_1[j];
|
|
805
|
+
var dEle = endEle - profile.b22_1[j - 1 | 0];
|
|
806
|
+
if (dEle > 0) {
|
|
807
|
+
positiveElevation = positiveElevation + dEle;
|
|
808
|
+
distClimbing = distClimbing + (endDist - profile.a22_1[j - 1 | 0]);
|
|
809
|
+
} else {
|
|
810
|
+
negativeElevation = negativeElevation + dEle;
|
|
811
|
+
}
|
|
812
|
+
var length = endDist - startDist;
|
|
813
|
+
if (length <= 10.0)
|
|
814
|
+
continue $l$loop;
|
|
815
|
+
var netElevation = endEle - startEle;
|
|
816
|
+
var gradePercent = 100.0 * netElevation / length;
|
|
817
|
+
var climbingGradePercent = distClimbing > 0 ? 100.0 * positiveElevation / distClimbing : 0.0;
|
|
818
|
+
// Inline function 'kotlin.math.pow' call
|
|
819
|
+
var x = options.x21_1;
|
|
820
|
+
var score = length * Math.pow(gradePercent, x);
|
|
821
|
+
var qualifies = gradePercent >= options.v21_1 && netElevation >= minClimbElevation && score >= bestScore && climbingGradePercent / gradePercent <= options.w21_1;
|
|
822
|
+
if (qualifies) {
|
|
823
|
+
bestScore = score;
|
|
824
|
+
best = new Candidate(i, j, score, positiveElevation, negativeElevation);
|
|
1829
825
|
}
|
|
1830
|
-
this.c1k(i, cumDist);
|
|
1831
826
|
}
|
|
1832
827
|
while (inductionVariable < last);
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
var
|
|
1841
|
-
var
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
continue $l$loop;
|
|
1849
|
-
// Inline function 'kotlin.math.max' call
|
|
1850
|
-
var b = i_0 - 1 | 0;
|
|
1851
|
-
var im1 = Math.max(0, b);
|
|
1852
|
-
var tmp0 = this.x1h_1 - 1 | 0;
|
|
1853
|
-
// Inline function 'kotlin.math.min' call
|
|
1854
|
-
var b_0 = i_0 + 1 | 0;
|
|
1855
|
-
var ip1 = Math.min(tmp0, b_0);
|
|
1856
|
-
this.j1k(i_0, computeBearing(this, im1, ip1));
|
|
1857
|
-
var dDist = (this.b1k(ip1) - this.b1k(im1)) / 2.0;
|
|
1858
|
-
var dEle_0 = (this.b1i(ip1) - this.b1i(im1)) / 2.0;
|
|
1859
|
-
var grade = dDist === 0.0 ? 0.0 : dEle_0 / dDist;
|
|
1860
|
-
this.l1k(i_0, grade);
|
|
1861
|
-
var dTime = (this.c1i(ip1) - this.c1i(im1)) / 2000.0;
|
|
1862
|
-
this.d1k(i_0, dDist);
|
|
1863
|
-
this.h1k(i_0, dTime);
|
|
1864
|
-
this.e1l(i_0, dTime === 0.0 ? 0.0 : dDist / dTime);
|
|
828
|
+
return best;
|
|
829
|
+
}
|
|
830
|
+
function dedupeByScore($this, candidates) {
|
|
831
|
+
// Inline function 'kotlin.collections.sortedByDescending' call
|
|
832
|
+
// Inline function 'kotlin.comparisons.compareByDescending' call
|
|
833
|
+
var tmp = ClimbDetector$dedupeByScore$lambda;
|
|
834
|
+
var tmp$ret$1 = new sam$kotlin_Comparator$0_0(tmp);
|
|
835
|
+
var tmp$ret$0 = sortedWith(candidates, tmp$ret$1);
|
|
836
|
+
var remaining = toMutableList(tmp$ret$0);
|
|
837
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
838
|
+
var kept = ArrayList_init_$Create$();
|
|
839
|
+
$l$loop: while (true) {
|
|
840
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
841
|
+
if (!!remaining.n()) {
|
|
842
|
+
break $l$loop;
|
|
1865
843
|
}
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
844
|
+
var best = first(remaining);
|
|
845
|
+
kept.h(best);
|
|
846
|
+
removeAll(remaining, ClimbDetector$dedupeByScore$lambda_0(best));
|
|
847
|
+
}
|
|
848
|
+
return kept;
|
|
1869
849
|
}
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
var
|
|
1876
|
-
|
|
850
|
+
function toClimb($this, $receiver, path, profile) {
|
|
851
|
+
return new Climb(profile.c22_1[$receiver.d22_1], profile.c22_1[$receiver.e22_1], profile.a22_1[$receiver.d22_1], profile.a22_1[$receiver.e22_1], profile.b22_1[$receiver.d22_1], profile.b22_1[$receiver.e22_1], $receiver.g22_1, $receiver.h22_1, splitIntoParts($this, profile, $receiver.d22_1, $receiver.e22_1));
|
|
852
|
+
}
|
|
853
|
+
function splitIntoParts($this, profile, startIndex, endIndex) {
|
|
854
|
+
// Inline function 'kotlin.collections.map' call
|
|
855
|
+
var this_0 = numberRangeToNumber(startIndex, endIndex);
|
|
856
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
857
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
858
|
+
var inductionVariable = this_0.lc_1;
|
|
859
|
+
var last = this_0.mc_1;
|
|
860
|
+
if (inductionVariable <= last)
|
|
1877
861
|
do {
|
|
1878
|
-
var
|
|
862
|
+
var item = inductionVariable;
|
|
1879
863
|
inductionVariable = inductionVariable + 1 | 0;
|
|
1880
|
-
|
|
1881
|
-
var
|
|
1882
|
-
|
|
864
|
+
var i = item;
|
|
865
|
+
var tmp$ret$2 = new Vector3D(profile.a22_1[i], profile.b22_1[i], 0.0);
|
|
866
|
+
destination.h(tmp$ret$2);
|
|
1883
867
|
}
|
|
1884
|
-
while (
|
|
1885
|
-
var
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
var
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
868
|
+
while (!(item === last));
|
|
869
|
+
var points = destination;
|
|
870
|
+
if (points.l() < 2)
|
|
871
|
+
return emptyList();
|
|
872
|
+
var elevationGain = profile.b22_1[endIndex] - profile.b22_1[startIndex];
|
|
873
|
+
var tolerance = coerceIn(elevationGain / 50.0, 10.0, 50.0);
|
|
874
|
+
var keptIndices = DouglasPeucker_instance.ix(points, tolerance);
|
|
875
|
+
var tmp$ret$3;
|
|
876
|
+
$l$block: {
|
|
877
|
+
// Inline function 'kotlin.collections.zipWithNext' call
|
|
878
|
+
var iterator = keptIndices.i();
|
|
879
|
+
if (!iterator.j()) {
|
|
880
|
+
tmp$ret$3 = emptyList();
|
|
881
|
+
break $l$block;
|
|
1898
882
|
}
|
|
1899
|
-
// Inline function 'kotlin.collections.
|
|
1900
|
-
var
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
while (_iterator__ex2g4s_0.j()) {
|
|
1913
|
-
var field = _iterator__ex2g4s_0.k();
|
|
1914
|
-
out.n1j(dstIdx, field, path.m1j(srcIdx, field));
|
|
883
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
884
|
+
var result = ArrayList_init_$Create$();
|
|
885
|
+
var current = iterator.k();
|
|
886
|
+
while (iterator.j()) {
|
|
887
|
+
var next = iterator.k();
|
|
888
|
+
var a = current;
|
|
889
|
+
var tmp0_startDistanceM = points.m(a).dx_1;
|
|
890
|
+
var tmp1_startElevationM = points.m(a).ex_1;
|
|
891
|
+
var tmp2_endDistanceM = points.m(next).dx_1;
|
|
892
|
+
var tmp3_endElevationM = points.m(next).ex_1;
|
|
893
|
+
var tmp$ret$5 = new ClimbPart(tmp0_startDistanceM, tmp2_endDistanceM, tmp1_startElevationM, tmp3_endElevationM);
|
|
894
|
+
result.h(tmp$ret$5);
|
|
895
|
+
current = next;
|
|
1915
896
|
}
|
|
897
|
+
tmp$ret$3 = result;
|
|
1916
898
|
}
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
var PointField_P_GRAVITY_instance;
|
|
1940
|
-
var PointField_P_ROLLING_RESISTANCE_instance;
|
|
1941
|
-
var PointField_P_WHEEL_BEARINGS_instance;
|
|
1942
|
-
var PointField_P_INPUT_POWER_instance;
|
|
1943
|
-
var PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_instance;
|
|
1944
|
-
var PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_instance;
|
|
1945
|
-
var PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_instance;
|
|
1946
|
-
var PointField_P_CYCLIST_PROVIDED_MUSCULAR_instance;
|
|
1947
|
-
var PointField_P_CYCLIST_PROVIDED_WHEEL_instance;
|
|
1948
|
-
var PointField_P_COMPUTED_TOTAL_POWER_instance;
|
|
1949
|
-
var PointField_P_COMPUTED_WHEEL_POWER_instance;
|
|
1950
|
-
var PointField_POWER_instance;
|
|
1951
|
-
var PointField_SPEED_instance;
|
|
1952
|
-
var PointField_SPEED_MAX_instance;
|
|
1953
|
-
var PointField_SPEED_MAX_INCLINE_instance;
|
|
1954
|
-
var PointField_VIRT_SPEED_CURRENT_instance;
|
|
1955
|
-
var PointField_TEMPERATURE_instance;
|
|
1956
|
-
var PointField_WIND_SPEED_instance;
|
|
1957
|
-
var PointField_WIND_DIRECTION_instance;
|
|
1958
|
-
var PointField_HEART_RATE_instance;
|
|
1959
|
-
var PointField_CADENCE_instance;
|
|
1960
|
-
function Companion_5() {
|
|
1961
|
-
Companion_instance_5 = this;
|
|
1962
|
-
this.u1l_1 = 36;
|
|
1963
|
-
var tmp = this;
|
|
1964
|
-
// Inline function 'kotlin.collections.associateBy' call
|
|
1965
|
-
var this_0 = get_entries();
|
|
1966
|
-
var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
|
|
1967
|
-
// Inline function 'kotlin.collections.associateByTo' call
|
|
1968
|
-
var destination = LinkedHashMap_init_$Create$(capacity);
|
|
1969
|
-
var _iterator__ex2g4s = this_0.i();
|
|
1970
|
-
while (_iterator__ex2g4s.j()) {
|
|
1971
|
-
var element = _iterator__ex2g4s.k();
|
|
1972
|
-
var tmp$ret$2 = element.y1l_1;
|
|
1973
|
-
destination.p2(tmp$ret$2, element);
|
|
1974
|
-
}
|
|
1975
|
-
tmp.v1l_1 = destination;
|
|
1976
|
-
}
|
|
1977
|
-
protoOf(Companion_5).e1m = function (prop) {
|
|
1978
|
-
return this.v1l_1.h1(prop);
|
|
899
|
+
return tmp$ret$3;
|
|
900
|
+
}
|
|
901
|
+
function Candidate(startIndex, endIndex, score, positiveElevationM, negativeElevationM) {
|
|
902
|
+
this.d22_1 = startIndex;
|
|
903
|
+
this.e22_1 = endIndex;
|
|
904
|
+
this.f22_1 = score;
|
|
905
|
+
this.g22_1 = positiveElevationM;
|
|
906
|
+
this.h22_1 = negativeElevationM;
|
|
907
|
+
}
|
|
908
|
+
protoOf(Candidate).i22 = function (other) {
|
|
909
|
+
return other.d22_1 <= this.d22_1 && this.d22_1 <= other.e22_1 || (other.d22_1 <= this.e22_1 && this.e22_1 <= other.e22_1) || (this.d22_1 <= other.d22_1 && other.e22_1 <= this.e22_1);
|
|
910
|
+
};
|
|
911
|
+
protoOf(Candidate).toString = function () {
|
|
912
|
+
return 'Candidate(startIndex=' + this.d22_1 + ', endIndex=' + this.e22_1 + ', score=' + this.f22_1 + ', positiveElevationM=' + this.g22_1 + ', negativeElevationM=' + this.h22_1 + ')';
|
|
913
|
+
};
|
|
914
|
+
protoOf(Candidate).hashCode = function () {
|
|
915
|
+
var result = this.d22_1;
|
|
916
|
+
result = imul(result, 31) + this.e22_1 | 0;
|
|
917
|
+
result = imul(result, 31) + getNumberHashCode(this.f22_1) | 0;
|
|
918
|
+
result = imul(result, 31) + getNumberHashCode(this.g22_1) | 0;
|
|
919
|
+
result = imul(result, 31) + getNumberHashCode(this.h22_1) | 0;
|
|
920
|
+
return result;
|
|
1979
921
|
};
|
|
1980
|
-
|
|
1981
|
-
function Companion_getInstance_6() {
|
|
1982
|
-
PointField_initEntries();
|
|
1983
|
-
if (Companion_instance_5 == null)
|
|
1984
|
-
new Companion_5();
|
|
1985
|
-
return Companion_instance_5;
|
|
1986
|
-
}
|
|
1987
|
-
function values() {
|
|
1988
|
-
return [PointField_LATITUDE_getInstance(), PointField_LONGITUDE_getInstance(), PointField_DISTANCE_getInstance(), PointField_DX_getInstance(), PointField_TIME_getInstance(), PointField_ELAPSED_getInstance(), PointField_DT_getInstance(), PointField_BEARING_getInstance(), PointField_ELEVATION_getInstance(), PointField_GRADE_getInstance(), PointField_RADIUS_getInstance(), PointField_AERO_COEF_getInstance(), PointField_WIND_BEARING_getInstance(), PointField_WIND_ALPHA_getInstance(), PointField_P_AERO_getInstance(), PointField_P_GRAVITY_getInstance(), PointField_P_ROLLING_RESISTANCE_getInstance(), PointField_P_WHEEL_BEARINGS_getInstance(), PointField_P_INPUT_POWER_getInstance(), PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_getInstance(), PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_getInstance(), PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_getInstance(), PointField_P_CYCLIST_PROVIDED_MUSCULAR_getInstance(), PointField_P_CYCLIST_PROVIDED_WHEEL_getInstance(), PointField_P_COMPUTED_TOTAL_POWER_getInstance(), PointField_P_COMPUTED_WHEEL_POWER_getInstance(), PointField_POWER_getInstance(), PointField_SPEED_getInstance(), PointField_SPEED_MAX_getInstance(), PointField_SPEED_MAX_INCLINE_getInstance(), PointField_VIRT_SPEED_CURRENT_getInstance(), PointField_TEMPERATURE_getInstance(), PointField_WIND_SPEED_getInstance(), PointField_WIND_DIRECTION_getInstance(), PointField_HEART_RATE_getInstance(), PointField_CADENCE_getInstance()];
|
|
1989
|
-
}
|
|
1990
|
-
function get_entries() {
|
|
1991
|
-
if ($ENTRIES == null)
|
|
1992
|
-
$ENTRIES = enumEntries(values());
|
|
1993
|
-
return $ENTRIES;
|
|
1994
|
-
}
|
|
1995
|
-
var PointField_entriesInitialized;
|
|
1996
|
-
function PointField_initEntries() {
|
|
1997
|
-
if (PointField_entriesInitialized)
|
|
1998
|
-
return Unit_instance;
|
|
1999
|
-
PointField_entriesInitialized = true;
|
|
2000
|
-
PointField_LATITUDE_instance = new PointField('LATITUDE', 0, 'latitude', 'radians', 'Latitude (radians)', PointFieldCategory_COORDINATES_getInstance(), true, true);
|
|
2001
|
-
PointField_LONGITUDE_instance = new PointField('LONGITUDE', 1, 'longitude', 'radians', 'Longitude (radians)', PointFieldCategory_COORDINATES_getInstance(), true, true);
|
|
2002
|
-
PointField_DISTANCE_instance = new PointField('DISTANCE', 2, 'distance', 'meters', 'Distance (meters)', PointFieldCategory_COORDINATES_getInstance());
|
|
2003
|
-
PointField_DX_instance = new PointField('DX', 3, 'dx', 'meters', 'dx (meters)', PointFieldCategory_COORDINATES_getInstance());
|
|
2004
|
-
PointField_TIME_instance = new PointField('TIME', 4, 'time', 'ms', 'Timestamp (ms since epoch)', PointFieldCategory_TEMPORAL_getInstance(), true);
|
|
2005
|
-
PointField_ELAPSED_instance = new PointField('ELAPSED', 5, 'elapsed', 'ms', 'Elapsed duration (ms)', PointFieldCategory_TEMPORAL_getInstance());
|
|
2006
|
-
PointField_DT_instance = new PointField('DT', 6, 'dt', 'ms', 'dt (ms)', PointFieldCategory_TEMPORAL_getInstance());
|
|
2007
|
-
PointField_BEARING_instance = new PointField('BEARING', 7, 'bearing', 'radians', 'Direction bearing (radians)', PointFieldCategory_ANGLES_getInstance(), VOID, true);
|
|
2008
|
-
PointField_ELEVATION_instance = new PointField('ELEVATION', 8, 'elevation', 'meters', 'Elevation (meters)', PointFieldCategory_ELEVATION_getInstance());
|
|
2009
|
-
PointField_GRADE_instance = new PointField('GRADE', 9, 'grade', '%', 'Road grade/slope (%)', PointFieldCategory_GRADE_getInstance());
|
|
2010
|
-
PointField_RADIUS_instance = new PointField('RADIUS', 10, 'radius', 'meters', 'Turn radius (meters)', PointFieldCategory_RADIUS_getInstance());
|
|
2011
|
-
PointField_AERO_COEF_instance = new PointField('AERO_COEF', 11, 'aeroCoef', 'aero', 'Aerodynamic coefficient', PointFieldCategory_AERO_COEF_getInstance());
|
|
2012
|
-
PointField_WIND_BEARING_instance = new PointField('WIND_BEARING', 12, 'windBearing', 'radians', 'Wind bearing (radians)', PointFieldCategory_CYCLIST_WIND_getInstance(), VOID, true);
|
|
2013
|
-
PointField_WIND_ALPHA_instance = new PointField('WIND_ALPHA', 13, 'windAlpha', 'radians', 'Wind angle (radians)', PointFieldCategory_CYCLIST_WIND_getInstance(), VOID, true);
|
|
2014
|
-
PointField_P_AERO_instance = new PointField('P_AERO', 14, 'pAero', 'watts', 'Aerodynamic power', PointFieldCategory_POWER_PHYSICS_getInstance());
|
|
2015
|
-
PointField_P_GRAVITY_instance = new PointField('P_GRAVITY', 15, 'pGravity', 'watts', 'Gravitational power', PointFieldCategory_POWER_PHYSICS_getInstance());
|
|
2016
|
-
PointField_P_ROLLING_RESISTANCE_instance = new PointField('P_ROLLING_RESISTANCE', 16, 'pRollingResistance', 'watts', 'Rolling resistance power', PointFieldCategory_POWER_PHYSICS_getInstance());
|
|
2017
|
-
PointField_P_WHEEL_BEARINGS_instance = new PointField('P_WHEEL_BEARINGS', 17, 'pWheelBearings', 'watts', 'Wheel bearings power', PointFieldCategory_POWER_PHYSICS_getInstance());
|
|
2018
|
-
PointField_P_INPUT_POWER_instance = new PointField('P_INPUT_POWER', 18, 'pInputPower', 'watts', 'GPX input power', PointFieldCategory_POWER_CYCLIST_getInstance());
|
|
2019
|
-
PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_instance = new PointField('P_CYCLIST_PROVIDED_OPTIMAL_POWER', 19, 'pCyclistProvidedOptimalPower', 'watts', 'Optimal power', PointFieldCategory_POWER_CYCLIST_getInstance());
|
|
2020
|
-
PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_instance = new PointField('P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS', 20, 'pCyclistProvidedOptimalPowerWithHarmonics', 'watts', 'Optimal power with harmonics', PointFieldCategory_POWER_CYCLIST_getInstance());
|
|
2021
|
-
PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_instance = new PointField('P_CYCLIST_PROVIDED_POWER_NEEDED', 21, 'pCyclistPowerNeeded', 'watts', 'Power needed', PointFieldCategory_POWER_CYCLIST_getInstance());
|
|
2022
|
-
PointField_P_CYCLIST_PROVIDED_MUSCULAR_instance = new PointField('P_CYCLIST_PROVIDED_MUSCULAR', 22, 'pCyclistProvidedMuscular', 'watts', 'Raw cyclist power', PointFieldCategory_POWER_CYCLIST_getInstance());
|
|
2023
|
-
PointField_P_CYCLIST_PROVIDED_WHEEL_instance = new PointField('P_CYCLIST_PROVIDED_WHEEL', 23, 'pCyclistProvidedWheel', 'watts', 'Cyclist power transmitted to ground', PointFieldCategory_POWER_CYCLIST_getInstance());
|
|
2024
|
-
PointField_P_COMPUTED_TOTAL_POWER_instance = new PointField('P_COMPUTED_TOTAL_POWER', 24, 'pComputedTotalPower', 'watts', 'Power from kinetic energy change', PointFieldCategory_POWER_POST_getInstance());
|
|
2025
|
-
PointField_P_COMPUTED_WHEEL_POWER_instance = new PointField('P_COMPUTED_WHEEL_POWER', 25, 'pComputedWheelPower', 'watts', 'Wheel power from kinetic energy change', PointFieldCategory_POWER_POST_getInstance());
|
|
2026
|
-
PointField_POWER_instance = new PointField('POWER', 26, 'pComputedPower', 'watts', 'Total power (watts)', PointFieldCategory_POWER_POST_getInstance());
|
|
2027
|
-
PointField_SPEED_instance = new PointField('SPEED', 27, 'speed', 'm/s', 'Current speed (m/s)', PointFieldCategory_SPEED_getInstance());
|
|
2028
|
-
PointField_SPEED_MAX_instance = new PointField('SPEED_MAX', 28, 'speedMax', 'm/s', 'Maximum speed (m/s)', PointFieldCategory_SPEED_getInstance());
|
|
2029
|
-
PointField_SPEED_MAX_INCLINE_instance = new PointField('SPEED_MAX_INCLINE', 29, 'speedMaxIncline', 'm/s', 'Max speed on incline (m/s)', PointFieldCategory_SPEED_getInstance());
|
|
2030
|
-
PointField_VIRT_SPEED_CURRENT_instance = new PointField('VIRT_SPEED_CURRENT', 30, 'virtSpeedCurrent', 'm/s', 'Virtual current speed (m/s)', PointFieldCategory_SPEED_getInstance());
|
|
2031
|
-
PointField_TEMPERATURE_instance = new PointField('TEMPERATURE', 31, 'temperature', 'celsius', 'Temperature (celsius)', PointFieldCategory_ENVIRONMENTAL_getInstance());
|
|
2032
|
-
PointField_WIND_SPEED_instance = new PointField('WIND_SPEED', 32, 'windSpeed', 'm/s', 'Wind speed (m/s)', PointFieldCategory_ENVIRONMENTAL_getInstance());
|
|
2033
|
-
PointField_WIND_DIRECTION_instance = new PointField('WIND_DIRECTION', 33, 'windDirection', 'radians', 'Wind direction (radians)', PointFieldCategory_ENVIRONMENTAL_getInstance(), VOID, true);
|
|
2034
|
-
PointField_HEART_RATE_instance = new PointField('HEART_RATE', 34, 'heartRate', 'bpm', 'Heart rate (bpm)', PointFieldCategory_PHYSIOLOGICAL_getInstance());
|
|
2035
|
-
PointField_CADENCE_instance = new PointField('CADENCE', 35, 'cadence', 'rpm', 'Pedaling cadence (rpm)', PointFieldCategory_PHYSIOLOGICAL_getInstance());
|
|
2036
|
-
Companion_getInstance_6();
|
|
2037
|
-
}
|
|
2038
|
-
var $ENTRIES;
|
|
2039
|
-
function PointField(name, ordinal, prop, unit, shortDescription, category, notSelectable, anglesInRadians) {
|
|
2040
|
-
notSelectable = notSelectable === VOID ? false : notSelectable;
|
|
2041
|
-
anglesInRadians = anglesInRadians === VOID ? false : anglesInRadians;
|
|
2042
|
-
Enum.call(this, name, ordinal);
|
|
2043
|
-
this.y1l_1 = prop;
|
|
2044
|
-
this.z1l_1 = unit;
|
|
2045
|
-
this.a1m_1 = shortDescription;
|
|
2046
|
-
this.b1m_1 = category;
|
|
2047
|
-
this.c1m_1 = notSelectable;
|
|
2048
|
-
this.d1m_1 = anglesInRadians;
|
|
2049
|
-
}
|
|
2050
|
-
function PointField_LATITUDE_getInstance() {
|
|
2051
|
-
PointField_initEntries();
|
|
2052
|
-
return PointField_LATITUDE_instance;
|
|
2053
|
-
}
|
|
2054
|
-
function PointField_LONGITUDE_getInstance() {
|
|
2055
|
-
PointField_initEntries();
|
|
2056
|
-
return PointField_LONGITUDE_instance;
|
|
2057
|
-
}
|
|
2058
|
-
function PointField_DISTANCE_getInstance() {
|
|
2059
|
-
PointField_initEntries();
|
|
2060
|
-
return PointField_DISTANCE_instance;
|
|
2061
|
-
}
|
|
2062
|
-
function PointField_DX_getInstance() {
|
|
2063
|
-
PointField_initEntries();
|
|
2064
|
-
return PointField_DX_instance;
|
|
2065
|
-
}
|
|
2066
|
-
function PointField_TIME_getInstance() {
|
|
2067
|
-
PointField_initEntries();
|
|
2068
|
-
return PointField_TIME_instance;
|
|
2069
|
-
}
|
|
2070
|
-
function PointField_ELAPSED_getInstance() {
|
|
2071
|
-
PointField_initEntries();
|
|
2072
|
-
return PointField_ELAPSED_instance;
|
|
2073
|
-
}
|
|
2074
|
-
function PointField_DT_getInstance() {
|
|
2075
|
-
PointField_initEntries();
|
|
2076
|
-
return PointField_DT_instance;
|
|
2077
|
-
}
|
|
2078
|
-
function PointField_BEARING_getInstance() {
|
|
2079
|
-
PointField_initEntries();
|
|
2080
|
-
return PointField_BEARING_instance;
|
|
2081
|
-
}
|
|
2082
|
-
function PointField_ELEVATION_getInstance() {
|
|
2083
|
-
PointField_initEntries();
|
|
2084
|
-
return PointField_ELEVATION_instance;
|
|
2085
|
-
}
|
|
2086
|
-
function PointField_GRADE_getInstance() {
|
|
2087
|
-
PointField_initEntries();
|
|
2088
|
-
return PointField_GRADE_instance;
|
|
2089
|
-
}
|
|
2090
|
-
function PointField_RADIUS_getInstance() {
|
|
2091
|
-
PointField_initEntries();
|
|
2092
|
-
return PointField_RADIUS_instance;
|
|
2093
|
-
}
|
|
2094
|
-
function PointField_AERO_COEF_getInstance() {
|
|
2095
|
-
PointField_initEntries();
|
|
2096
|
-
return PointField_AERO_COEF_instance;
|
|
2097
|
-
}
|
|
2098
|
-
function PointField_WIND_BEARING_getInstance() {
|
|
2099
|
-
PointField_initEntries();
|
|
2100
|
-
return PointField_WIND_BEARING_instance;
|
|
2101
|
-
}
|
|
2102
|
-
function PointField_WIND_ALPHA_getInstance() {
|
|
2103
|
-
PointField_initEntries();
|
|
2104
|
-
return PointField_WIND_ALPHA_instance;
|
|
2105
|
-
}
|
|
2106
|
-
function PointField_P_AERO_getInstance() {
|
|
2107
|
-
PointField_initEntries();
|
|
2108
|
-
return PointField_P_AERO_instance;
|
|
2109
|
-
}
|
|
2110
|
-
function PointField_P_GRAVITY_getInstance() {
|
|
2111
|
-
PointField_initEntries();
|
|
2112
|
-
return PointField_P_GRAVITY_instance;
|
|
2113
|
-
}
|
|
2114
|
-
function PointField_P_ROLLING_RESISTANCE_getInstance() {
|
|
2115
|
-
PointField_initEntries();
|
|
2116
|
-
return PointField_P_ROLLING_RESISTANCE_instance;
|
|
2117
|
-
}
|
|
2118
|
-
function PointField_P_WHEEL_BEARINGS_getInstance() {
|
|
2119
|
-
PointField_initEntries();
|
|
2120
|
-
return PointField_P_WHEEL_BEARINGS_instance;
|
|
2121
|
-
}
|
|
2122
|
-
function PointField_P_INPUT_POWER_getInstance() {
|
|
2123
|
-
PointField_initEntries();
|
|
2124
|
-
return PointField_P_INPUT_POWER_instance;
|
|
2125
|
-
}
|
|
2126
|
-
function PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_getInstance() {
|
|
2127
|
-
PointField_initEntries();
|
|
2128
|
-
return PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_instance;
|
|
2129
|
-
}
|
|
2130
|
-
function PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_getInstance() {
|
|
2131
|
-
PointField_initEntries();
|
|
2132
|
-
return PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_instance;
|
|
2133
|
-
}
|
|
2134
|
-
function PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_getInstance() {
|
|
2135
|
-
PointField_initEntries();
|
|
2136
|
-
return PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_instance;
|
|
2137
|
-
}
|
|
2138
|
-
function PointField_P_CYCLIST_PROVIDED_MUSCULAR_getInstance() {
|
|
2139
|
-
PointField_initEntries();
|
|
2140
|
-
return PointField_P_CYCLIST_PROVIDED_MUSCULAR_instance;
|
|
2141
|
-
}
|
|
2142
|
-
function PointField_P_CYCLIST_PROVIDED_WHEEL_getInstance() {
|
|
2143
|
-
PointField_initEntries();
|
|
2144
|
-
return PointField_P_CYCLIST_PROVIDED_WHEEL_instance;
|
|
2145
|
-
}
|
|
2146
|
-
function PointField_P_COMPUTED_TOTAL_POWER_getInstance() {
|
|
2147
|
-
PointField_initEntries();
|
|
2148
|
-
return PointField_P_COMPUTED_TOTAL_POWER_instance;
|
|
2149
|
-
}
|
|
2150
|
-
function PointField_P_COMPUTED_WHEEL_POWER_getInstance() {
|
|
2151
|
-
PointField_initEntries();
|
|
2152
|
-
return PointField_P_COMPUTED_WHEEL_POWER_instance;
|
|
2153
|
-
}
|
|
2154
|
-
function PointField_POWER_getInstance() {
|
|
2155
|
-
PointField_initEntries();
|
|
2156
|
-
return PointField_POWER_instance;
|
|
2157
|
-
}
|
|
2158
|
-
function PointField_SPEED_getInstance() {
|
|
2159
|
-
PointField_initEntries();
|
|
2160
|
-
return PointField_SPEED_instance;
|
|
2161
|
-
}
|
|
2162
|
-
function PointField_SPEED_MAX_getInstance() {
|
|
2163
|
-
PointField_initEntries();
|
|
2164
|
-
return PointField_SPEED_MAX_instance;
|
|
2165
|
-
}
|
|
2166
|
-
function PointField_SPEED_MAX_INCLINE_getInstance() {
|
|
2167
|
-
PointField_initEntries();
|
|
2168
|
-
return PointField_SPEED_MAX_INCLINE_instance;
|
|
2169
|
-
}
|
|
2170
|
-
function PointField_VIRT_SPEED_CURRENT_getInstance() {
|
|
2171
|
-
PointField_initEntries();
|
|
2172
|
-
return PointField_VIRT_SPEED_CURRENT_instance;
|
|
2173
|
-
}
|
|
2174
|
-
function PointField_TEMPERATURE_getInstance() {
|
|
2175
|
-
PointField_initEntries();
|
|
2176
|
-
return PointField_TEMPERATURE_instance;
|
|
2177
|
-
}
|
|
2178
|
-
function PointField_WIND_SPEED_getInstance() {
|
|
2179
|
-
PointField_initEntries();
|
|
2180
|
-
return PointField_WIND_SPEED_instance;
|
|
2181
|
-
}
|
|
2182
|
-
function PointField_WIND_DIRECTION_getInstance() {
|
|
2183
|
-
PointField_initEntries();
|
|
2184
|
-
return PointField_WIND_DIRECTION_instance;
|
|
2185
|
-
}
|
|
2186
|
-
function PointField_HEART_RATE_getInstance() {
|
|
2187
|
-
PointField_initEntries();
|
|
2188
|
-
return PointField_HEART_RATE_instance;
|
|
2189
|
-
}
|
|
2190
|
-
function PointField_CADENCE_getInstance() {
|
|
2191
|
-
PointField_initEntries();
|
|
2192
|
-
return PointField_CADENCE_instance;
|
|
2193
|
-
}
|
|
2194
|
-
var PointFieldCategory_COORDINATES_instance;
|
|
2195
|
-
var PointFieldCategory_TEMPORAL_instance;
|
|
2196
|
-
var PointFieldCategory_ANGLES_instance;
|
|
2197
|
-
var PointFieldCategory_ELEVATION_instance;
|
|
2198
|
-
var PointFieldCategory_GRADE_instance;
|
|
2199
|
-
var PointFieldCategory_RADIUS_instance;
|
|
2200
|
-
var PointFieldCategory_AERO_COEF_instance;
|
|
2201
|
-
var PointFieldCategory_CYCLIST_WIND_instance;
|
|
2202
|
-
var PointFieldCategory_POWER_PHYSICS_instance;
|
|
2203
|
-
var PointFieldCategory_POWER_CYCLIST_instance;
|
|
2204
|
-
var PointFieldCategory_POWER_POST_instance;
|
|
2205
|
-
var PointFieldCategory_SPEED_instance;
|
|
2206
|
-
var PointFieldCategory_ENVIRONMENTAL_instance;
|
|
2207
|
-
var PointFieldCategory_PHYSIOLOGICAL_instance;
|
|
2208
|
-
var PointFieldCategory_entriesInitialized;
|
|
2209
|
-
function PointFieldCategory_initEntries() {
|
|
2210
|
-
if (PointFieldCategory_entriesInitialized)
|
|
2211
|
-
return Unit_instance;
|
|
2212
|
-
PointFieldCategory_entriesInitialized = true;
|
|
2213
|
-
PointFieldCategory_COORDINATES_instance = new PointFieldCategory('COORDINATES', 0, 'coordinates', 'Coordinates');
|
|
2214
|
-
PointFieldCategory_TEMPORAL_instance = new PointFieldCategory('TEMPORAL', 1, 'temporal', 'Temporal');
|
|
2215
|
-
PointFieldCategory_ANGLES_instance = new PointFieldCategory('ANGLES', 2, 'angles', 'Angles');
|
|
2216
|
-
PointFieldCategory_ELEVATION_instance = new PointFieldCategory('ELEVATION', 3, 'elevation', '\uD83C\uDFD4\uFE0F Elevation');
|
|
2217
|
-
PointFieldCategory_GRADE_instance = new PointFieldCategory('GRADE', 4, 'grade', '\uD83D\uDCD0 Grade');
|
|
2218
|
-
PointFieldCategory_RADIUS_instance = new PointFieldCategory('RADIUS', 5, 'radius', 'Radius');
|
|
2219
|
-
PointFieldCategory_AERO_COEF_instance = new PointFieldCategory('AERO_COEF', 6, 'aero_coef', 'Aero coef');
|
|
2220
|
-
PointFieldCategory_CYCLIST_WIND_instance = new PointFieldCategory('CYCLIST_WIND', 7, 'cyclist_wind', 'Cyclist wind');
|
|
2221
|
-
PointFieldCategory_POWER_PHYSICS_instance = new PointFieldCategory('POWER_PHYSICS', 8, 'power_physics', '\u26A1 Power Physics');
|
|
2222
|
-
PointFieldCategory_POWER_CYCLIST_instance = new PointFieldCategory('POWER_CYCLIST', 9, 'power_cyclist', '\u26A1 Power Cyclist');
|
|
2223
|
-
PointFieldCategory_POWER_POST_instance = new PointFieldCategory('POWER_POST', 10, 'power_post', '\u26A1 Power Post processed');
|
|
2224
|
-
PointFieldCategory_SPEED_instance = new PointFieldCategory('SPEED', 11, 'speed', 'Speed & Motion');
|
|
2225
|
-
PointFieldCategory_ENVIRONMENTAL_instance = new PointFieldCategory('ENVIRONMENTAL', 12, 'environmental', 'Environmental');
|
|
2226
|
-
PointFieldCategory_PHYSIOLOGICAL_instance = new PointFieldCategory('PHYSIOLOGICAL', 13, 'physiological', 'Physiological');
|
|
2227
|
-
}
|
|
2228
|
-
function PointFieldCategory(name, ordinal, id, displayName) {
|
|
2229
|
-
Enum.call(this, name, ordinal);
|
|
2230
|
-
this.h1m_1 = id;
|
|
2231
|
-
this.i1m_1 = displayName;
|
|
2232
|
-
}
|
|
2233
|
-
function PointFieldCategory_COORDINATES_getInstance() {
|
|
2234
|
-
PointFieldCategory_initEntries();
|
|
2235
|
-
return PointFieldCategory_COORDINATES_instance;
|
|
2236
|
-
}
|
|
2237
|
-
function PointFieldCategory_TEMPORAL_getInstance() {
|
|
2238
|
-
PointFieldCategory_initEntries();
|
|
2239
|
-
return PointFieldCategory_TEMPORAL_instance;
|
|
2240
|
-
}
|
|
2241
|
-
function PointFieldCategory_ANGLES_getInstance() {
|
|
2242
|
-
PointFieldCategory_initEntries();
|
|
2243
|
-
return PointFieldCategory_ANGLES_instance;
|
|
2244
|
-
}
|
|
2245
|
-
function PointFieldCategory_ELEVATION_getInstance() {
|
|
2246
|
-
PointFieldCategory_initEntries();
|
|
2247
|
-
return PointFieldCategory_ELEVATION_instance;
|
|
2248
|
-
}
|
|
2249
|
-
function PointFieldCategory_GRADE_getInstance() {
|
|
2250
|
-
PointFieldCategory_initEntries();
|
|
2251
|
-
return PointFieldCategory_GRADE_instance;
|
|
2252
|
-
}
|
|
2253
|
-
function PointFieldCategory_RADIUS_getInstance() {
|
|
2254
|
-
PointFieldCategory_initEntries();
|
|
2255
|
-
return PointFieldCategory_RADIUS_instance;
|
|
2256
|
-
}
|
|
2257
|
-
function PointFieldCategory_AERO_COEF_getInstance() {
|
|
2258
|
-
PointFieldCategory_initEntries();
|
|
2259
|
-
return PointFieldCategory_AERO_COEF_instance;
|
|
2260
|
-
}
|
|
2261
|
-
function PointFieldCategory_CYCLIST_WIND_getInstance() {
|
|
2262
|
-
PointFieldCategory_initEntries();
|
|
2263
|
-
return PointFieldCategory_CYCLIST_WIND_instance;
|
|
2264
|
-
}
|
|
2265
|
-
function PointFieldCategory_POWER_PHYSICS_getInstance() {
|
|
2266
|
-
PointFieldCategory_initEntries();
|
|
2267
|
-
return PointFieldCategory_POWER_PHYSICS_instance;
|
|
2268
|
-
}
|
|
2269
|
-
function PointFieldCategory_POWER_CYCLIST_getInstance() {
|
|
2270
|
-
PointFieldCategory_initEntries();
|
|
2271
|
-
return PointFieldCategory_POWER_CYCLIST_instance;
|
|
2272
|
-
}
|
|
2273
|
-
function PointFieldCategory_POWER_POST_getInstance() {
|
|
2274
|
-
PointFieldCategory_initEntries();
|
|
2275
|
-
return PointFieldCategory_POWER_POST_instance;
|
|
2276
|
-
}
|
|
2277
|
-
function PointFieldCategory_SPEED_getInstance() {
|
|
2278
|
-
PointFieldCategory_initEntries();
|
|
2279
|
-
return PointFieldCategory_SPEED_instance;
|
|
2280
|
-
}
|
|
2281
|
-
function PointFieldCategory_ENVIRONMENTAL_getInstance() {
|
|
2282
|
-
PointFieldCategory_initEntries();
|
|
2283
|
-
return PointFieldCategory_ENVIRONMENTAL_instance;
|
|
2284
|
-
}
|
|
2285
|
-
function PointFieldCategory_PHYSIOLOGICAL_getInstance() {
|
|
2286
|
-
PointFieldCategory_initEntries();
|
|
2287
|
-
return PointFieldCategory_PHYSIOLOGICAL_instance;
|
|
2288
|
-
}
|
|
2289
|
-
function Copy(sourceIndex) {
|
|
2290
|
-
this.j1m_1 = sourceIndex;
|
|
2291
|
-
}
|
|
2292
|
-
protoOf(Copy).toString = function () {
|
|
2293
|
-
return 'Copy(sourceIndex=' + this.j1m_1 + ')';
|
|
2294
|
-
};
|
|
2295
|
-
protoOf(Copy).hashCode = function () {
|
|
2296
|
-
return this.j1m_1;
|
|
2297
|
-
};
|
|
2298
|
-
protoOf(Copy).equals = function (other) {
|
|
922
|
+
protoOf(Candidate).equals = function (other) {
|
|
2299
923
|
if (this === other)
|
|
2300
924
|
return true;
|
|
2301
|
-
if (!(other instanceof
|
|
925
|
+
if (!(other instanceof Candidate))
|
|
2302
926
|
return false;
|
|
2303
|
-
if (!(this.
|
|
927
|
+
if (!(this.d22_1 === other.d22_1))
|
|
2304
928
|
return false;
|
|
2305
|
-
|
|
2306
|
-
};
|
|
2307
|
-
function Interpolate(from, to, coef) {
|
|
2308
|
-
this.k1m_1 = from;
|
|
2309
|
-
this.l1m_1 = to;
|
|
2310
|
-
this.m1m_1 = coef;
|
|
2311
|
-
}
|
|
2312
|
-
protoOf(Interpolate).toString = function () {
|
|
2313
|
-
return 'Interpolate(from=' + this.k1m_1 + ', to=' + this.l1m_1 + ', coef=' + this.m1m_1 + ')';
|
|
2314
|
-
};
|
|
2315
|
-
protoOf(Interpolate).hashCode = function () {
|
|
2316
|
-
var result = this.k1m_1;
|
|
2317
|
-
result = imul(result, 31) + this.l1m_1 | 0;
|
|
2318
|
-
result = imul(result, 31) + getNumberHashCode(this.m1m_1) | 0;
|
|
2319
|
-
return result;
|
|
2320
|
-
};
|
|
2321
|
-
protoOf(Interpolate).equals = function (other) {
|
|
2322
|
-
if (this === other)
|
|
2323
|
-
return true;
|
|
2324
|
-
if (!(other instanceof Interpolate))
|
|
929
|
+
if (!(this.e22_1 === other.e22_1))
|
|
2325
930
|
return false;
|
|
2326
|
-
if (!(this.
|
|
931
|
+
if (!equals(this.f22_1, other.f22_1))
|
|
2327
932
|
return false;
|
|
2328
|
-
if (!(this.
|
|
933
|
+
if (!equals(this.g22_1, other.g22_1))
|
|
2329
934
|
return false;
|
|
2330
|
-
if (!equals(this.
|
|
935
|
+
if (!equals(this.h22_1, other.h22_1))
|
|
2331
936
|
return false;
|
|
2332
937
|
return true;
|
|
2333
938
|
};
|
|
2334
|
-
function
|
|
2335
|
-
|
|
2336
|
-
var plan = ArrayList_init_$Create$(n);
|
|
2337
|
-
// Inline function 'kotlin.collections.plusAssign' call
|
|
2338
|
-
var element = new Copy(0);
|
|
2339
|
-
plan.h(element);
|
|
2340
|
-
var lastAddedDistance = source.b1k(0);
|
|
2341
|
-
var lastAddedIndex = 0;
|
|
2342
|
-
var inductionVariable = 1;
|
|
2343
|
-
if (inductionVariable < n)
|
|
2344
|
-
$l$loop: do {
|
|
2345
|
-
var i = inductionVariable;
|
|
2346
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
2347
|
-
var curDist = source.b1k(i);
|
|
2348
|
-
var gap = curDist - lastAddedDistance;
|
|
2349
|
-
if (gap < minDistanceM)
|
|
2350
|
-
continue $l$loop;
|
|
2351
|
-
else if (gap <= maxDistanceM) {
|
|
2352
|
-
// Inline function 'kotlin.collections.plusAssign' call
|
|
2353
|
-
var element_0 = new Copy(i);
|
|
2354
|
-
plan.h(element_0);
|
|
2355
|
-
lastAddedDistance = curDist;
|
|
2356
|
-
lastAddedIndex = i;
|
|
2357
|
-
} else {
|
|
2358
|
-
// Inline function 'kotlin.math.ceil' call
|
|
2359
|
-
var x = gap / maxDistanceM;
|
|
2360
|
-
var tmp$ret$2 = Math.ceil(x);
|
|
2361
|
-
var numSegments = numberToInt(tmp$ret$2);
|
|
2362
|
-
var spacing = gap / numSegments;
|
|
2363
|
-
var index1 = lastAddedIndex;
|
|
2364
|
-
var inductionVariable_0 = 1;
|
|
2365
|
-
if (inductionVariable_0 < numSegments)
|
|
2366
|
-
do {
|
|
2367
|
-
var j = inductionVariable_0;
|
|
2368
|
-
inductionVariable_0 = inductionVariable_0 + 1 | 0;
|
|
2369
|
-
var targetDistance = lastAddedDistance + j * spacing;
|
|
2370
|
-
while (index1 < (i - 1 | 0) && source.b1k(index1 + 1 | 0) < targetDistance) {
|
|
2371
|
-
index1 = index1 + 1 | 0;
|
|
2372
|
-
}
|
|
2373
|
-
var dist1 = source.b1k(index1);
|
|
2374
|
-
var dist2 = source.b1k(index1 + 1 | 0);
|
|
2375
|
-
var coef = (targetDistance - dist1) / (dist2 - dist1);
|
|
2376
|
-
// Inline function 'kotlin.collections.plusAssign' call
|
|
2377
|
-
var element_1 = new Interpolate(index1, index1 + 1 | 0, coef);
|
|
2378
|
-
plan.h(element_1);
|
|
2379
|
-
}
|
|
2380
|
-
while (inductionVariable_0 < numSegments);
|
|
2381
|
-
// Inline function 'kotlin.collections.plusAssign' call
|
|
2382
|
-
var element_2 = new Copy(i);
|
|
2383
|
-
plan.h(element_2);
|
|
2384
|
-
lastAddedDistance = curDist;
|
|
2385
|
-
lastAddedIndex = i;
|
|
2386
|
-
}
|
|
2387
|
-
}
|
|
2388
|
-
while (inductionVariable < n);
|
|
2389
|
-
return plan;
|
|
2390
|
-
}
|
|
2391
|
-
function materialize($this, source, plan) {
|
|
2392
|
-
var out = new Path(plan.l());
|
|
2393
|
-
var iterator = plan.i();
|
|
2394
|
-
var index = 0;
|
|
2395
|
-
while (iterator.j()) {
|
|
2396
|
-
var dstIdx = index;
|
|
2397
|
-
index = index + 1 | 0;
|
|
2398
|
-
var op = iterator.k();
|
|
2399
|
-
if (op instanceof Copy) {
|
|
2400
|
-
copyFields($this, source, op.j1m_1, out, dstIdx);
|
|
2401
|
-
} else {
|
|
2402
|
-
if (op instanceof Interpolate) {
|
|
2403
|
-
interpolateFields($this, source, op.k1m_1, op.l1m_1, op.m1m_1, out, dstIdx);
|
|
2404
|
-
} else {
|
|
2405
|
-
noWhenBranchMatchedException();
|
|
2406
|
-
}
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2409
|
-
out.d1j();
|
|
2410
|
-
return out;
|
|
939
|
+
function sam$kotlin_Comparator$0(function_0) {
|
|
940
|
+
this.j22_1 = function_0;
|
|
2411
941
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
while (_iterator__ex2g4s.j()) {
|
|
2415
|
-
var field = _iterator__ex2g4s.k();
|
|
2416
|
-
dst.n1j(dstIdx, field, src.m1j(srcIdx, field));
|
|
2417
|
-
}
|
|
2418
|
-
}
|
|
2419
|
-
function interpolateFields($this, src, i1, i2, coef, dst, dstIdx) {
|
|
2420
|
-
var _iterator__ex2g4s = get_entries().i();
|
|
2421
|
-
while (_iterator__ex2g4s.j()) {
|
|
2422
|
-
var field = _iterator__ex2g4s.k();
|
|
2423
|
-
var v1 = src.m1j(i1, field);
|
|
2424
|
-
var v2 = src.m1j(i2, field);
|
|
2425
|
-
var v = isNaN_0(v1) || isNaN_0(v2) ? NaN : v1 + (v2 - v1) * coef;
|
|
2426
|
-
dst.n1j(dstIdx, field, v);
|
|
2427
|
-
}
|
|
2428
|
-
}
|
|
2429
|
-
function PointPerDistance() {
|
|
2430
|
-
}
|
|
2431
|
-
protoOf(PointPerDistance).t1g = function (source, minDistanceM, maxDistanceM) {
|
|
2432
|
-
return this.n1m(source, minDistanceM, maxDistanceM);
|
|
942
|
+
protoOf(sam$kotlin_Comparator$0).l9 = function (a, b) {
|
|
943
|
+
return this.j22_1(a, b);
|
|
2433
944
|
};
|
|
2434
|
-
protoOf(
|
|
2435
|
-
|
|
2436
|
-
if (!(maxDistanceM > 0.0)) {
|
|
2437
|
-
var message = 'maxDistanceM must be > 0, got ' + maxDistanceM;
|
|
2438
|
-
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
2439
|
-
}
|
|
2440
|
-
if (source.x1h_1 === 0)
|
|
2441
|
-
return new Path(0);
|
|
2442
|
-
if (source.x1h_1 === 1) {
|
|
2443
|
-
var out = new Path(1);
|
|
2444
|
-
copyFields(this, source, 0, out, 0);
|
|
2445
|
-
out.d1j();
|
|
2446
|
-
return out;
|
|
2447
|
-
}
|
|
2448
|
-
var plan = buildPlan(this, source, minDistanceM, maxDistanceM);
|
|
2449
|
-
return materialize(this, source, plan);
|
|
945
|
+
protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
|
|
946
|
+
return this.l9(a, b);
|
|
2450
947
|
};
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
return PointPerDistance_instance;
|
|
2454
|
-
}
|
|
2455
|
-
function Copy_0(sourceIndex) {
|
|
2456
|
-
this.o1m_1 = sourceIndex;
|
|
2457
|
-
}
|
|
2458
|
-
protoOf(Copy_0).toString = function () {
|
|
2459
|
-
return 'Copy(sourceIndex=' + this.o1m_1 + ')';
|
|
948
|
+
protoOf(sam$kotlin_Comparator$0).x1 = function () {
|
|
949
|
+
return this.j22_1;
|
|
2460
950
|
};
|
|
2461
|
-
protoOf(
|
|
2462
|
-
|
|
951
|
+
protoOf(sam$kotlin_Comparator$0).equals = function (other) {
|
|
952
|
+
var tmp;
|
|
953
|
+
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
954
|
+
var tmp_0;
|
|
955
|
+
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
956
|
+
tmp_0 = equals(this.x1(), other.x1());
|
|
957
|
+
} else {
|
|
958
|
+
tmp_0 = false;
|
|
959
|
+
}
|
|
960
|
+
tmp = tmp_0;
|
|
961
|
+
} else {
|
|
962
|
+
tmp = false;
|
|
963
|
+
}
|
|
964
|
+
return tmp;
|
|
2463
965
|
};
|
|
2464
|
-
protoOf(
|
|
2465
|
-
|
|
2466
|
-
return true;
|
|
2467
|
-
if (!(other instanceof Copy_0))
|
|
2468
|
-
return false;
|
|
2469
|
-
if (!(this.o1m_1 === other.o1m_1))
|
|
2470
|
-
return false;
|
|
2471
|
-
return true;
|
|
966
|
+
protoOf(sam$kotlin_Comparator$0).hashCode = function () {
|
|
967
|
+
return hashCode(this.x1());
|
|
2472
968
|
};
|
|
2473
|
-
function
|
|
2474
|
-
this.
|
|
2475
|
-
this.q1m_1 = to;
|
|
2476
|
-
this.r1m_1 = coef;
|
|
969
|
+
function sam$kotlin_Comparator$0_0(function_0) {
|
|
970
|
+
this.k22_1 = function_0;
|
|
2477
971
|
}
|
|
2478
|
-
protoOf(
|
|
2479
|
-
return
|
|
972
|
+
protoOf(sam$kotlin_Comparator$0_0).l9 = function (a, b) {
|
|
973
|
+
return this.k22_1(a, b);
|
|
2480
974
|
};
|
|
2481
|
-
protoOf(
|
|
2482
|
-
|
|
2483
|
-
result = imul(result, 31) + this.q1m_1 | 0;
|
|
2484
|
-
result = imul(result, 31) + getNumberHashCode(this.r1m_1) | 0;
|
|
2485
|
-
return result;
|
|
975
|
+
protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
|
|
976
|
+
return this.l9(a, b);
|
|
2486
977
|
};
|
|
2487
|
-
protoOf(
|
|
2488
|
-
|
|
2489
|
-
return true;
|
|
2490
|
-
if (!(other instanceof Interpolate_0))
|
|
2491
|
-
return false;
|
|
2492
|
-
if (!(this.p1m_1 === other.p1m_1))
|
|
2493
|
-
return false;
|
|
2494
|
-
if (!(this.q1m_1 === other.q1m_1))
|
|
2495
|
-
return false;
|
|
2496
|
-
if (!equals(this.r1m_1, other.r1m_1))
|
|
2497
|
-
return false;
|
|
2498
|
-
return true;
|
|
978
|
+
protoOf(sam$kotlin_Comparator$0_0).x1 = function () {
|
|
979
|
+
return this.k22_1;
|
|
2499
980
|
};
|
|
2500
|
-
function
|
|
2501
|
-
var
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
var i = inductionVariable;
|
|
2507
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
2508
|
-
var time1 = source.c1i(i);
|
|
2509
|
-
// Inline function 'kotlin.math.floor' call
|
|
2510
|
-
var x = time1 / 1000.0;
|
|
2511
|
-
var tmp$ret$0 = Math.floor(x);
|
|
2512
|
-
var epoch1 = numberToLong(tmp$ret$0);
|
|
2513
|
-
var msInSec1 = subtract(numberToLong(time1), multiply(epoch1, new Long(1000, 0)));
|
|
2514
|
-
if (i === 0 && !equalsLong(msInSec1, new Long(0, 0))) {
|
|
2515
|
-
// Inline function 'kotlin.collections.set' call
|
|
2516
|
-
var value = new Copy_0(i);
|
|
2517
|
-
plan.p2(epoch1, value);
|
|
2518
|
-
}
|
|
2519
|
-
if (i === (n - 1 | 0)) {
|
|
2520
|
-
if (!equalsLong(msInSec1, new Long(0, 0))) {
|
|
2521
|
-
var tmp2 = add(epoch1, new Long(1, 0));
|
|
2522
|
-
// Inline function 'kotlin.collections.set' call
|
|
2523
|
-
var value_0 = new Copy_0(i);
|
|
2524
|
-
plan.p2(tmp2, value_0);
|
|
2525
|
-
}
|
|
2526
|
-
continue $l$loop_0;
|
|
2527
|
-
}
|
|
2528
|
-
var time2 = source.c1i(i + 1 | 0);
|
|
2529
|
-
// Inline function 'kotlin.math.floor' call
|
|
2530
|
-
var x_0 = time2 / 1000.0;
|
|
2531
|
-
var tmp$ret$3 = Math.floor(x_0);
|
|
2532
|
-
var epoch2 = numberToLong(tmp$ret$3);
|
|
2533
|
-
if (equalsLong(epoch1, epoch2))
|
|
2534
|
-
continue $l$loop_0;
|
|
2535
|
-
var duration12 = time2 - time1;
|
|
2536
|
-
var epochStart = equalsLong(msInSec1, new Long(0, 0)) ? epoch1 : add(epoch1, new Long(1, 0));
|
|
2537
|
-
var epochEnd = epoch2;
|
|
2538
|
-
var e = epochStart;
|
|
2539
|
-
while (compare(e, epochEnd) <= 0) {
|
|
2540
|
-
// Inline function 'kotlin.Long.times' call
|
|
2541
|
-
var this_0 = e;
|
|
2542
|
-
var epochTime = toNumber(this_0) * 1000.0;
|
|
2543
|
-
var coef = (epochTime - time1) / duration12;
|
|
2544
|
-
var tmp2_0 = e;
|
|
2545
|
-
// Inline function 'kotlin.collections.set' call
|
|
2546
|
-
var value_1 = new Interpolate_0(i, i + 1 | 0, coef);
|
|
2547
|
-
plan.p2(tmp2_0, value_1);
|
|
2548
|
-
var _unary__edvuaz = e;
|
|
2549
|
-
e = add(_unary__edvuaz, get_ONE());
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
|
-
while (inductionVariable < n);
|
|
2553
|
-
return plan;
|
|
2554
|
-
}
|
|
2555
|
-
function materialize_0($this, source, plan) {
|
|
2556
|
-
var sortedEpochs = sorted(plan.i1());
|
|
2557
|
-
var out = new Path(sortedEpochs.l());
|
|
2558
|
-
var iterator = sortedEpochs.i();
|
|
2559
|
-
var index = 0;
|
|
2560
|
-
$l$loop: while (iterator.j()) {
|
|
2561
|
-
var idx = index;
|
|
2562
|
-
index = index + 1 | 0;
|
|
2563
|
-
var epoch = iterator.k();
|
|
2564
|
-
var tmp0_elvis_lhs = plan.h1(epoch);
|
|
2565
|
-
var tmp;
|
|
2566
|
-
if (tmp0_elvis_lhs == null) {
|
|
2567
|
-
continue $l$loop;
|
|
2568
|
-
} else {
|
|
2569
|
-
tmp = tmp0_elvis_lhs;
|
|
2570
|
-
}
|
|
2571
|
-
var data = tmp;
|
|
2572
|
-
if (data instanceof Copy_0) {
|
|
2573
|
-
copyFields_0($this, source, data.o1m_1, out, idx);
|
|
981
|
+
protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
|
|
982
|
+
var tmp;
|
|
983
|
+
if (!(other == null) ? isInterface(other, Comparator) : false) {
|
|
984
|
+
var tmp_0;
|
|
985
|
+
if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
|
|
986
|
+
tmp_0 = equals(this.x1(), other.x1());
|
|
2574
987
|
} else {
|
|
2575
|
-
|
|
2576
|
-
interpolateFields_0($this, source, data.p1m_1, data.q1m_1, data.r1m_1, out, idx);
|
|
2577
|
-
} else {
|
|
2578
|
-
noWhenBranchMatchedException();
|
|
2579
|
-
}
|
|
988
|
+
tmp_0 = false;
|
|
2580
989
|
}
|
|
2581
|
-
|
|
990
|
+
tmp = tmp_0;
|
|
991
|
+
} else {
|
|
992
|
+
tmp = false;
|
|
2582
993
|
}
|
|
2583
|
-
|
|
2584
|
-
|
|
994
|
+
return tmp;
|
|
995
|
+
};
|
|
996
|
+
protoOf(sam$kotlin_Comparator$0_0).hashCode = function () {
|
|
997
|
+
return hashCode(this.x1());
|
|
998
|
+
};
|
|
999
|
+
function ClimbDetector$detect$lambda(a, b) {
|
|
1000
|
+
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
1001
|
+
var tmp = a.d22_1;
|
|
1002
|
+
var tmp$ret$2 = b.d22_1;
|
|
1003
|
+
return compareValues(tmp, tmp$ret$2);
|
|
2585
1004
|
}
|
|
2586
|
-
function
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
}
|
|
1005
|
+
function ClimbDetector$dedupeByScore$lambda(a, b) {
|
|
1006
|
+
// Inline function 'kotlin.comparisons.compareValuesBy' call
|
|
1007
|
+
var tmp = b.f22_1;
|
|
1008
|
+
var tmp$ret$2 = a.f22_1;
|
|
1009
|
+
return compareValues(tmp, tmp$ret$2);
|
|
2592
1010
|
}
|
|
2593
|
-
function
|
|
2594
|
-
|
|
1011
|
+
function ClimbDetector$dedupeByScore$lambda_0($best) {
|
|
1012
|
+
return function (it) {
|
|
1013
|
+
return it.i22($best);
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
function ClimbDetector() {
|
|
1017
|
+
this.l22_1 = 10.0;
|
|
1018
|
+
this.m22_1 = 10.0;
|
|
1019
|
+
this.n22_1 = 50.0;
|
|
1020
|
+
this.o22_1 = 50.0;
|
|
1021
|
+
}
|
|
1022
|
+
protoOf(ClimbDetector).p22 = function (path, options) {
|
|
1023
|
+
if (path.u1q_1 < 2)
|
|
1024
|
+
return emptyList();
|
|
1025
|
+
var tmp0 = options.s21_1;
|
|
1026
|
+
var tmp0_0 = options.t21_1;
|
|
1027
|
+
// Inline function 'kotlin.comparisons.minOf' call
|
|
1028
|
+
var b = path.a1s_1 / options.u21_1;
|
|
1029
|
+
// Inline function 'kotlin.comparisons.maxOf' call
|
|
1030
|
+
var b_0 = Math.min(tmp0_0, b);
|
|
1031
|
+
var minClimbElevation = Math.max(tmp0, b_0);
|
|
1032
|
+
var profile = Companion_instance_4.z21(path, options.y21_1);
|
|
1033
|
+
// Inline function 'kotlin.collections.mapNotNull' call
|
|
1034
|
+
var tmp0_1 = until(0, profile.l());
|
|
1035
|
+
// Inline function 'kotlin.collections.mapNotNullTo' call
|
|
1036
|
+
var destination = ArrayList_init_$Create$();
|
|
1037
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
1038
|
+
var inductionVariable = tmp0_1.lc_1;
|
|
1039
|
+
var last = tmp0_1.mc_1;
|
|
1040
|
+
if (inductionVariable <= last)
|
|
1041
|
+
do {
|
|
1042
|
+
var element = inductionVariable;
|
|
1043
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
1044
|
+
var i = element;
|
|
1045
|
+
var tmp0_safe_receiver = bestCandidateFrom(ClimbDetector_instance, profile, i, minClimbElevation, options);
|
|
1046
|
+
if (tmp0_safe_receiver == null)
|
|
1047
|
+
null;
|
|
1048
|
+
else {
|
|
1049
|
+
// Inline function 'kotlin.let' call
|
|
1050
|
+
destination.h(tmp0_safe_receiver);
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
while (!(element === last));
|
|
1054
|
+
var candidates = destination;
|
|
1055
|
+
// Inline function 'kotlin.collections.sortedBy' call
|
|
1056
|
+
var this_0 = dedupeByScore(this, candidates);
|
|
1057
|
+
// Inline function 'kotlin.comparisons.compareBy' call
|
|
1058
|
+
var tmp = ClimbDetector$detect$lambda;
|
|
1059
|
+
var tmp$ret$10 = new sam$kotlin_Comparator$0(tmp);
|
|
1060
|
+
// Inline function 'kotlin.collections.map' call
|
|
1061
|
+
var this_1 = sortedWith(this_0, tmp$ret$10);
|
|
1062
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1063
|
+
var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
|
|
1064
|
+
var _iterator__ex2g4s = this_1.i();
|
|
2595
1065
|
while (_iterator__ex2g4s.j()) {
|
|
2596
|
-
var
|
|
2597
|
-
var
|
|
2598
|
-
|
|
2599
|
-
var v = isNaN_0(v1) || isNaN_0(v2) ? NaN : v1 + (v2 - v1) * coef;
|
|
2600
|
-
dst.n1j(dstIdx, field, v);
|
|
1066
|
+
var item = _iterator__ex2g4s.k();
|
|
1067
|
+
var tmp$ret$13 = toClimb(ClimbDetector_instance, item, path, profile);
|
|
1068
|
+
destination_0.h(tmp$ret$13);
|
|
2601
1069
|
}
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
return new Path(0);
|
|
2608
|
-
var plan = buildPlan_0(this, source);
|
|
2609
|
-
return materialize_0(this, source, plan);
|
|
1070
|
+
return destination_0;
|
|
1071
|
+
};
|
|
1072
|
+
protoOf(ClimbDetector).q22 = function (path, options, $super) {
|
|
1073
|
+
options = options === VOID ? Companion_getInstance_5().r21_1 : options;
|
|
1074
|
+
return $super === VOID ? this.p22(path, options) : $super.p22.call(this, path, options);
|
|
2610
1075
|
};
|
|
2611
|
-
var
|
|
2612
|
-
function
|
|
2613
|
-
return
|
|
1076
|
+
var ClimbDetector_instance;
|
|
1077
|
+
function ClimbDetector_getInstance() {
|
|
1078
|
+
return ClimbDetector_instance;
|
|
2614
1079
|
}
|
|
2615
1080
|
function computeWithWind($this, path, i, aeroCoef, wind) {
|
|
2616
|
-
var speed = path.
|
|
2617
|
-
var bearing = path.
|
|
2618
|
-
path.
|
|
2619
|
-
path.
|
|
2620
|
-
var windDirectionAsBearing = 3.141592653589793 / 2.0 - wind.
|
|
2621
|
-
path.
|
|
1081
|
+
var speed = path.m1v(i);
|
|
1082
|
+
var bearing = path.r1u(i);
|
|
1083
|
+
path.s1v(i, wind.r22_1);
|
|
1084
|
+
path.t1v(i, wind.s22_1);
|
|
1085
|
+
var windDirectionAsBearing = 3.141592653589793 / 2.0 - wind.s22_1;
|
|
1086
|
+
path.x1u(i, windDirectionAsBearing);
|
|
2622
1087
|
var alpha = windDirectionAsBearing - bearing;
|
|
2623
|
-
path.
|
|
2624
|
-
var v = wind.
|
|
1088
|
+
path.y1u(i, alpha);
|
|
1089
|
+
var v = wind.r22_1;
|
|
2625
1090
|
// Inline function 'kotlin.math.cos' call
|
|
2626
1091
|
var l1 = speed + v * Math.cos(alpha);
|
|
2627
1092
|
var l2 = l1 * l1;
|
|
@@ -2636,21 +1101,21 @@
|
|
|
2636
1101
|
return tmp_1 * Math.sqrt(l3) * l1 * speed;
|
|
2637
1102
|
}
|
|
2638
1103
|
function AeroPowerProvider() {
|
|
2639
|
-
this.
|
|
1104
|
+
this.t22_1 = 1.2;
|
|
2640
1105
|
}
|
|
2641
|
-
protoOf(AeroPowerProvider).
|
|
2642
|
-
var aeroCoef = course.
|
|
2643
|
-
path.
|
|
2644
|
-
var wind = course.
|
|
1106
|
+
protoOf(AeroPowerProvider).u22 = function (course, path, pointIndex) {
|
|
1107
|
+
var aeroCoef = course.b1z_1.v22(course, path, pointIndex);
|
|
1108
|
+
path.w1u(pointIndex, aeroCoef);
|
|
1109
|
+
var wind = course.c1z_1.w22(course.z1y_1, path, pointIndex);
|
|
2645
1110
|
var tmp;
|
|
2646
|
-
if (wind.
|
|
2647
|
-
var v = path.
|
|
1111
|
+
if (wind.r22_1 === 0.0) {
|
|
1112
|
+
var v = path.m1v(pointIndex);
|
|
2648
1113
|
tmp = -aeroCoef * v * v * v;
|
|
2649
1114
|
} else {
|
|
2650
1115
|
tmp = computeWithWind(this, path, pointIndex, aeroCoef, wind);
|
|
2651
1116
|
}
|
|
2652
1117
|
var pAir = tmp;
|
|
2653
|
-
path.
|
|
1118
|
+
path.z1u(pointIndex, pAir);
|
|
2654
1119
|
return pAir;
|
|
2655
1120
|
};
|
|
2656
1121
|
var AeroPowerProvider_instance;
|
|
@@ -2659,38 +1124,38 @@
|
|
|
2659
1124
|
}
|
|
2660
1125
|
function AeroProviderConstant() {
|
|
2661
1126
|
}
|
|
2662
|
-
protoOf(AeroProviderConstant).
|
|
2663
|
-
var rho = course.
|
|
2664
|
-
return course.
|
|
1127
|
+
protoOf(AeroProviderConstant).v22 = function (course, path, pointIndex) {
|
|
1128
|
+
var rho = course.a1z_1.x22(course.z1y_1, path, pointIndex);
|
|
1129
|
+
return course.f1z().l1z_1 * course.f1z().m1z_1 * rho / 2.0;
|
|
2665
1130
|
};
|
|
2666
1131
|
var AeroProviderConstant_instance;
|
|
2667
1132
|
function AeroProviderConstant_getInstance() {
|
|
2668
1133
|
return AeroProviderConstant_instance;
|
|
2669
1134
|
}
|
|
2670
|
-
function
|
|
2671
|
-
this.
|
|
2672
|
-
this.
|
|
1135
|
+
function Companion_5() {
|
|
1136
|
+
this.y22_1 = 0.05;
|
|
1137
|
+
this.z22_1 = 3.0;
|
|
2673
1138
|
}
|
|
2674
|
-
var
|
|
1139
|
+
var Companion_instance_5;
|
|
2675
1140
|
function Companion_getInstance_7() {
|
|
2676
|
-
return
|
|
1141
|
+
return Companion_instance_5;
|
|
2677
1142
|
}
|
|
2678
1143
|
function CyclistPowerProviderBase(useHarmonics, random) {
|
|
2679
1144
|
random = random === VOID ? Default_getInstance() : random;
|
|
2680
|
-
this.
|
|
1145
|
+
this.a23_1 = useHarmonics;
|
|
2681
1146
|
var tmp = this;
|
|
2682
1147
|
var tmp_0;
|
|
2683
|
-
if (this.
|
|
1148
|
+
if (this.a23_1) {
|
|
2684
1149
|
// Inline function 'kotlin.collections.List' call
|
|
2685
1150
|
// Inline function 'kotlin.collections.MutableList' call
|
|
2686
|
-
var list = ArrayList_init_$Create$(20);
|
|
1151
|
+
var list = ArrayList_init_$Create$_0(20);
|
|
2687
1152
|
// Inline function 'kotlin.repeat' call
|
|
2688
1153
|
var inductionVariable = 0;
|
|
2689
1154
|
if (inductionVariable < 20)
|
|
2690
1155
|
do {
|
|
2691
1156
|
var index = inductionVariable;
|
|
2692
1157
|
inductionVariable = inductionVariable + 1 | 0;
|
|
2693
|
-
var tmp$ret$4 = new Harmonic(1.0 + random.
|
|
1158
|
+
var tmp$ret$4 = new Harmonic(1.0 + random.zb() * 9.0, random.zb() * 3.141592653589793, random.zb() * 0.01);
|
|
2694
1159
|
list.h(tmp$ret$4);
|
|
2695
1160
|
}
|
|
2696
1161
|
while (inductionVariable < 20);
|
|
@@ -2698,40 +1163,40 @@
|
|
|
2698
1163
|
} else {
|
|
2699
1164
|
tmp_0 = emptyList();
|
|
2700
1165
|
}
|
|
2701
|
-
tmp.
|
|
2702
|
-
}
|
|
2703
|
-
protoOf(CyclistPowerProviderBase).
|
|
2704
|
-
var power = this.
|
|
2705
|
-
path.
|
|
2706
|
-
if (this.
|
|
2707
|
-
var x = path.
|
|
2708
|
-
var _iterator__ex2g4s = this.
|
|
1166
|
+
tmp.b23_1 = tmp_0;
|
|
1167
|
+
}
|
|
1168
|
+
protoOf(CyclistPowerProviderBase).u22 = function (course, path, pointIndex) {
|
|
1169
|
+
var power = this.c23(course, path, pointIndex);
|
|
1170
|
+
path.d1v(pointIndex, power);
|
|
1171
|
+
if (this.a23_1) {
|
|
1172
|
+
var x = path.z1q(pointIndex) / 10000.0;
|
|
1173
|
+
var _iterator__ex2g4s = this.b23_1.i();
|
|
2709
1174
|
while (_iterator__ex2g4s.j()) {
|
|
2710
1175
|
var h = _iterator__ex2g4s.k();
|
|
2711
1176
|
var tmp = power;
|
|
2712
|
-
var tmp_0 = h.
|
|
1177
|
+
var tmp_0 = h.f23_1 * power;
|
|
2713
1178
|
// Inline function 'kotlin.math.cos' call
|
|
2714
|
-
var x_0 = h.
|
|
1179
|
+
var x_0 = h.d23_1 * x - h.e23_1;
|
|
2715
1180
|
power = tmp + tmp_0 * Math.cos(x_0);
|
|
2716
1181
|
}
|
|
2717
1182
|
}
|
|
2718
|
-
path.
|
|
2719
|
-
var powerNeeded = -PowerComputer_instance.
|
|
2720
|
-
path.
|
|
1183
|
+
path.e1v(pointIndex, power);
|
|
1184
|
+
var powerNeeded = -PowerComputer_instance.g23(course, path, pointIndex, false);
|
|
1185
|
+
path.f1v(pointIndex, powerNeeded);
|
|
2721
1186
|
return power;
|
|
2722
1187
|
};
|
|
2723
1188
|
function GravPowerProvider() {
|
|
2724
1189
|
}
|
|
2725
|
-
protoOf(GravPowerProvider).
|
|
2726
|
-
var m = course.
|
|
2727
|
-
var grade = path.
|
|
2728
|
-
var speed = path.
|
|
1190
|
+
protoOf(GravPowerProvider).u22 = function (course, path, pointIndex) {
|
|
1191
|
+
var m = course.f1z().j1z_1;
|
|
1192
|
+
var grade = path.t1u(pointIndex);
|
|
1193
|
+
var speed = path.m1v(pointIndex);
|
|
2729
1194
|
var tmp = -m * 9.8 * speed;
|
|
2730
1195
|
// Inline function 'kotlin.math.atan' call
|
|
2731
1196
|
// Inline function 'kotlin.math.sin' call
|
|
2732
1197
|
var x = Math.atan(grade);
|
|
2733
1198
|
var p = tmp * Math.sin(x);
|
|
2734
|
-
path.
|
|
1199
|
+
path.a1v(pointIndex, p);
|
|
2735
1200
|
return p;
|
|
2736
1201
|
};
|
|
2737
1202
|
var GravPowerProvider_instance;
|
|
@@ -2739,17 +1204,17 @@
|
|
|
2739
1204
|
return GravPowerProvider_instance;
|
|
2740
1205
|
}
|
|
2741
1206
|
function Harmonic(freqRadS, phaseRad, amp) {
|
|
2742
|
-
this.
|
|
2743
|
-
this.
|
|
2744
|
-
this.
|
|
1207
|
+
this.d23_1 = freqRadS;
|
|
1208
|
+
this.e23_1 = phaseRad;
|
|
1209
|
+
this.f23_1 = amp;
|
|
2745
1210
|
}
|
|
2746
1211
|
protoOf(Harmonic).toString = function () {
|
|
2747
|
-
return 'Harmonic(freqRadS=' + this.
|
|
1212
|
+
return 'Harmonic(freqRadS=' + this.d23_1 + ', phaseRad=' + this.e23_1 + ', amp=' + this.f23_1 + ')';
|
|
2748
1213
|
};
|
|
2749
1214
|
protoOf(Harmonic).hashCode = function () {
|
|
2750
|
-
var result = getNumberHashCode(this.
|
|
2751
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
2752
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1215
|
+
var result = getNumberHashCode(this.d23_1);
|
|
1216
|
+
result = imul(result, 31) + getNumberHashCode(this.e23_1) | 0;
|
|
1217
|
+
result = imul(result, 31) + getNumberHashCode(this.f23_1) | 0;
|
|
2753
1218
|
return result;
|
|
2754
1219
|
};
|
|
2755
1220
|
protoOf(Harmonic).equals = function (other) {
|
|
@@ -2757,39 +1222,39 @@
|
|
|
2757
1222
|
return true;
|
|
2758
1223
|
if (!(other instanceof Harmonic))
|
|
2759
1224
|
return false;
|
|
2760
|
-
if (!equals(this.
|
|
1225
|
+
if (!equals(this.d23_1, other.d23_1))
|
|
2761
1226
|
return false;
|
|
2762
|
-
if (!equals(this.
|
|
1227
|
+
if (!equals(this.e23_1, other.e23_1))
|
|
2763
1228
|
return false;
|
|
2764
|
-
if (!equals(this.
|
|
1229
|
+
if (!equals(this.f23_1, other.f23_1))
|
|
2765
1230
|
return false;
|
|
2766
1231
|
return true;
|
|
2767
1232
|
};
|
|
2768
1233
|
function computeCorneringLimit($this, course, currentIndex, window_0) {
|
|
2769
|
-
var path = course.
|
|
1234
|
+
var path = course.t1y_1;
|
|
2770
1235
|
var radius = computeRadiusWindowed($this, path, currentIndex, window_0);
|
|
2771
1236
|
// Inline function 'kotlin.math.sqrt' call
|
|
2772
|
-
var x = 9.8 * radius * course.
|
|
1237
|
+
var x = 9.8 * radius * course.u1y_1.p1z();
|
|
2773
1238
|
var vMax = Math.sqrt(x);
|
|
2774
1239
|
// Inline function 'kotlin.math.min' call
|
|
2775
|
-
var a = course.
|
|
1240
|
+
var a = course.u1y_1.r1z();
|
|
2776
1241
|
var result = Math.min(a, vMax);
|
|
2777
|
-
path.
|
|
1242
|
+
path.q1v(currentIndex, result);
|
|
2778
1243
|
return result;
|
|
2779
1244
|
}
|
|
2780
1245
|
function computeRadiusWindowed($this, path, i, k) {
|
|
2781
1246
|
// Inline function 'kotlin.math.max' call
|
|
2782
1247
|
var b = i - k | 0;
|
|
2783
1248
|
var mini = Math.max(0, b);
|
|
2784
|
-
var tmp0 = path.
|
|
1249
|
+
var tmp0 = path.u1q_1 - 1 | 0;
|
|
2785
1250
|
// Inline function 'kotlin.math.min' call
|
|
2786
1251
|
var b_0 = i + k | 0;
|
|
2787
1252
|
var maxi = Math.min(tmp0, b_0);
|
|
2788
|
-
var totalBearingChange = $this.
|
|
2789
|
-
var totalDistance = path.
|
|
1253
|
+
var totalBearingChange = $this.h23(path.r1u(maxi) - path.r1u(mini));
|
|
1254
|
+
var totalDistance = path.k1u(maxi) - path.k1u(mini);
|
|
2790
1255
|
// Inline function 'kotlin.math.abs' call
|
|
2791
1256
|
if (Math.abs(totalBearingChange) < 0.001) {
|
|
2792
|
-
path.
|
|
1257
|
+
path.v1u(i, 200.0);
|
|
2793
1258
|
return 200.0;
|
|
2794
1259
|
}
|
|
2795
1260
|
// Inline function 'kotlin.math.abs' call
|
|
@@ -2798,47 +1263,47 @@
|
|
|
2798
1263
|
// Inline function 'kotlin.math.max' call
|
|
2799
1264
|
var b_1 = Math.min(200.0, raw);
|
|
2800
1265
|
var clamped = Math.max(5.0, b_1);
|
|
2801
|
-
path.
|
|
1266
|
+
path.v1u(i, clamped);
|
|
2802
1267
|
return clamped;
|
|
2803
1268
|
}
|
|
2804
1269
|
function computeBrakingLimit($this, course, currentIndex, nextIndex) {
|
|
2805
|
-
var path = course.
|
|
2806
|
-
var vf = path.
|
|
2807
|
-
var a = course.
|
|
2808
|
-
var d = path.
|
|
1270
|
+
var path = course.t1y_1;
|
|
1271
|
+
var vf = path.o1v(nextIndex);
|
|
1272
|
+
var a = course.u1y_1.q1z();
|
|
1273
|
+
var d = path.k1u(nextIndex) - path.k1u(currentIndex);
|
|
2809
1274
|
// Inline function 'kotlin.math.sqrt' call
|
|
2810
1275
|
var x = vf * vf + 2.0 * a * d;
|
|
2811
1276
|
return Math.sqrt(x);
|
|
2812
1277
|
}
|
|
2813
1278
|
function MaxSpeedComputer() {
|
|
2814
|
-
this.
|
|
2815
|
-
this.
|
|
2816
|
-
this.
|
|
2817
|
-
this.
|
|
2818
|
-
this.
|
|
2819
|
-
}
|
|
2820
|
-
protoOf(MaxSpeedComputer).
|
|
2821
|
-
var path = course.
|
|
2822
|
-
var n = path.
|
|
1279
|
+
this.o20_1 = 200.0;
|
|
1280
|
+
this.p20_1 = 5.0;
|
|
1281
|
+
this.q20_1 = 2.0;
|
|
1282
|
+
this.r20_1 = 0.001;
|
|
1283
|
+
this.s20_1 = 10;
|
|
1284
|
+
}
|
|
1285
|
+
protoOf(MaxSpeedComputer).t20 = function (course) {
|
|
1286
|
+
var path = course.t1y_1;
|
|
1287
|
+
var n = path.u1q_1;
|
|
2823
1288
|
var inductionVariable = n - 1 | 0;
|
|
2824
1289
|
if (0 <= inductionVariable)
|
|
2825
1290
|
do {
|
|
2826
1291
|
var i = inductionVariable;
|
|
2827
1292
|
inductionVariable = inductionVariable + -1 | 0;
|
|
2828
1293
|
if (i === (n - 1 | 0)) {
|
|
2829
|
-
path.
|
|
1294
|
+
path.p1v(i, 2.0);
|
|
2830
1295
|
} else {
|
|
2831
1296
|
var cornering = computeCorneringLimit(this, course, i, 10);
|
|
2832
1297
|
var braking = computeBrakingLimit(this, course, i, i + 1 | 0);
|
|
2833
1298
|
// Inline function 'kotlin.math.min' call
|
|
2834
1299
|
var tmp$ret$0 = Math.min(cornering, braking);
|
|
2835
|
-
path.
|
|
1300
|
+
path.p1v(i, tmp$ret$0);
|
|
2836
1301
|
}
|
|
2837
1302
|
}
|
|
2838
1303
|
while (0 <= inductionVariable);
|
|
2839
|
-
path.
|
|
1304
|
+
path.e1s();
|
|
2840
1305
|
};
|
|
2841
|
-
protoOf(MaxSpeedComputer).
|
|
1306
|
+
protoOf(MaxSpeedComputer).h23 = function (angleIn) {
|
|
2842
1307
|
var a = angleIn;
|
|
2843
1308
|
while (a > 3.141592653589793)
|
|
2844
1309
|
a = a - 2.0 * 3.141592653589793;
|
|
@@ -2852,11 +1317,11 @@
|
|
|
2852
1317
|
}
|
|
2853
1318
|
function MuscularPowerProvider() {
|
|
2854
1319
|
}
|
|
2855
|
-
protoOf(MuscularPowerProvider).
|
|
2856
|
-
var muscular = course.
|
|
2857
|
-
path.
|
|
2858
|
-
var wheel = muscular * course.
|
|
2859
|
-
path.
|
|
1320
|
+
protoOf(MuscularPowerProvider).u22 = function (course, path, pointIndex) {
|
|
1321
|
+
var muscular = course.d1z_1.u22(course, path, pointIndex);
|
|
1322
|
+
path.g1v(pointIndex, muscular);
|
|
1323
|
+
var wheel = muscular * course.g1z().r1y_1;
|
|
1324
|
+
path.h1v(pointIndex, wheel);
|
|
2860
1325
|
return wheel;
|
|
2861
1326
|
};
|
|
2862
1327
|
var MuscularPowerProvider_instance;
|
|
@@ -2869,7 +1334,7 @@
|
|
|
2869
1334
|
var tol = dx / 1.0E7;
|
|
2870
1335
|
while (dt2 - dt1 >= tol) {
|
|
2871
1336
|
var dtMid = (dt1 + dt2) / 2.0;
|
|
2872
|
-
var dxMid = $this.
|
|
1337
|
+
var dxMid = $this.i23(pSum, equivalentMass, currentSpeed, dtMid);
|
|
2873
1338
|
if (dxMid < dx)
|
|
2874
1339
|
dt1 = dtMid;
|
|
2875
1340
|
else
|
|
@@ -2879,18 +1344,18 @@
|
|
|
2879
1344
|
}
|
|
2880
1345
|
function PowerComputer() {
|
|
2881
1346
|
}
|
|
2882
|
-
protoOf(PowerComputer).
|
|
1347
|
+
protoOf(PowerComputer).g23 = function (course, path, pointIndex, withCyclist) {
|
|
2883
1348
|
var pSum = 0.0;
|
|
2884
|
-
pSum = pSum + WheelBearingsPowerProvider_instance.
|
|
2885
|
-
pSum = pSum + RollingResistancePowerProvider_instance.
|
|
2886
|
-
pSum = pSum + AeroPowerProvider_instance.
|
|
2887
|
-
pSum = pSum + GravPowerProvider_instance.
|
|
1349
|
+
pSum = pSum + WheelBearingsPowerProvider_instance.u22(course, path, pointIndex);
|
|
1350
|
+
pSum = pSum + RollingResistancePowerProvider_instance.u22(course, path, pointIndex);
|
|
1351
|
+
pSum = pSum + AeroPowerProvider_instance.u22(course, path, pointIndex);
|
|
1352
|
+
pSum = pSum + GravPowerProvider_instance.u22(course, path, pointIndex);
|
|
2888
1353
|
if (withCyclist) {
|
|
2889
|
-
pSum = pSum + MuscularPowerProvider_instance.
|
|
1354
|
+
pSum = pSum + MuscularPowerProvider_instance.u22(course, path, pointIndex);
|
|
2890
1355
|
}
|
|
2891
1356
|
return pSum;
|
|
2892
1357
|
};
|
|
2893
|
-
protoOf(PowerComputer).
|
|
1358
|
+
protoOf(PowerComputer).i23 = function (pSum, equivalentMass, currentSpeed, dt) {
|
|
2894
1359
|
// Inline function 'kotlin.math.sqrt' call
|
|
2895
1360
|
var x = dt * pSum / (0.5 * equivalentMass) + currentSpeed * currentSpeed;
|
|
2896
1361
|
var tmp0 = Math.sqrt(x);
|
|
@@ -2899,40 +1364,40 @@
|
|
|
2899
1364
|
var newSpeed = Math.max(tmp0, b);
|
|
2900
1365
|
return (currentSpeed + newSpeed) * dt / 2.0;
|
|
2901
1366
|
};
|
|
2902
|
-
protoOf(PowerComputer).
|
|
1367
|
+
protoOf(PowerComputer).j23 = function (equivalentMass, s1, s2, dt) {
|
|
2903
1368
|
return 0.5 * equivalentMass * (s2 * s2 - s1 * s1) / dt;
|
|
2904
1369
|
};
|
|
2905
|
-
protoOf(PowerComputer).
|
|
1370
|
+
protoOf(PowerComputer).k23 = function (pSum, equivalentMass, currentSpeed, dx) {
|
|
2906
1371
|
var dt = 0.1;
|
|
2907
|
-
while (this.
|
|
1372
|
+
while (this.i23(pSum, equivalentMass, currentSpeed, dt) <= dx) {
|
|
2908
1373
|
dt = dt + 0.1;
|
|
2909
1374
|
}
|
|
2910
1375
|
return getDtInner(this, pSum, equivalentMass, currentSpeed, dx, dt - 0.1, dt);
|
|
2911
1376
|
};
|
|
2912
|
-
protoOf(PowerComputer).
|
|
1377
|
+
protoOf(PowerComputer).l23 = function (course, path, equivalentMass, i) {
|
|
2913
1378
|
if (i === 0) {
|
|
2914
|
-
path.
|
|
1379
|
+
path.l1v(i, 0.0);
|
|
2915
1380
|
return Unit_instance;
|
|
2916
1381
|
}
|
|
2917
|
-
var resistive = this.
|
|
2918
|
-
var s1 = path.
|
|
2919
|
-
var s2 = path.
|
|
2920
|
-
var dtSeconds = path.
|
|
2921
|
-
var totPower = this.
|
|
2922
|
-
path.
|
|
1382
|
+
var resistive = this.g23(course, path, i - 1 | 0, false);
|
|
1383
|
+
var s1 = path.m1v(i - 1 | 0);
|
|
1384
|
+
var s2 = path.m1v(i);
|
|
1385
|
+
var dtSeconds = path.p1u(i) / 1000.0;
|
|
1386
|
+
var totPower = this.j23(equivalentMass, s1, s2, dtSeconds);
|
|
1387
|
+
path.i1v(i, totPower);
|
|
2923
1388
|
var powerWheel = totPower - resistive;
|
|
2924
|
-
path.
|
|
1389
|
+
path.j1v(i, powerWheel);
|
|
2925
1390
|
// Inline function 'kotlin.math.max' call
|
|
2926
|
-
var computed = Math.max(0.0, powerWheel) / course.
|
|
2927
|
-
path.
|
|
1391
|
+
var computed = Math.max(0.0, powerWheel) / course.g1z().r1y_1;
|
|
1392
|
+
path.l1v(i, computed);
|
|
2928
1393
|
};
|
|
2929
|
-
protoOf(PowerComputer).
|
|
2930
|
-
var m = course.
|
|
2931
|
-
var totalInertia = course.
|
|
2932
|
-
return m + totalInertia / (course.
|
|
1394
|
+
protoOf(PowerComputer).m23 = function (course) {
|
|
1395
|
+
var m = course.u1y_1.j1z_1;
|
|
1396
|
+
var totalInertia = course.v1y_1.o1y_1 + course.v1y_1.p1y_1;
|
|
1397
|
+
return m + totalInertia / (course.v1y_1.q1y_1 * course.v1y_1.q1y_1);
|
|
2933
1398
|
};
|
|
2934
|
-
protoOf(PowerComputer).
|
|
2935
|
-
return this.
|
|
1399
|
+
protoOf(PowerComputer).n23 = function (course) {
|
|
1400
|
+
return this.m23(course.z1y_1);
|
|
2936
1401
|
};
|
|
2937
1402
|
var PowerComputer_instance;
|
|
2938
1403
|
function PowerComputer_getInstance() {
|
|
@@ -2942,34 +1407,34 @@
|
|
|
2942
1407
|
useHarmonics = useHarmonics === VOID ? false : useHarmonics;
|
|
2943
1408
|
random = random === VOID ? Default_getInstance() : random;
|
|
2944
1409
|
CyclistPowerProviderBase.call(this, useHarmonics, random);
|
|
2945
|
-
this.
|
|
1410
|
+
this.q23_1 = power;
|
|
2946
1411
|
}
|
|
2947
|
-
protoOf(PowerProviderConstant).
|
|
2948
|
-
return this.
|
|
1412
|
+
protoOf(PowerProviderConstant).c23 = function (course, path, pointIndex) {
|
|
1413
|
+
return this.q23_1;
|
|
2949
1414
|
};
|
|
2950
1415
|
function PowerProviderConstantWithTiring(power, useHarmonics, durationSeconds, random) {
|
|
2951
1416
|
useHarmonics = useHarmonics === VOID ? false : useHarmonics;
|
|
2952
1417
|
random = random === VOID ? Default_getInstance() : random;
|
|
2953
1418
|
CyclistPowerProviderBase.call(this, useHarmonics, random);
|
|
2954
|
-
this.
|
|
2955
|
-
this.
|
|
1419
|
+
this.t23_1 = power;
|
|
1420
|
+
this.u23_1 = durationSeconds;
|
|
2956
1421
|
// Inline function 'kotlin.require' call
|
|
2957
|
-
if (!(this.
|
|
2958
|
-
var message = 'durationSeconds must be > 0, got ' + this.
|
|
1422
|
+
if (!(this.u23_1 > 0.0)) {
|
|
1423
|
+
var message = 'durationSeconds must be > 0, got ' + this.u23_1;
|
|
2959
1424
|
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
2960
1425
|
}
|
|
2961
1426
|
}
|
|
2962
|
-
protoOf(PowerProviderConstantWithTiring).
|
|
2963
|
-
var elapsedS = path.
|
|
1427
|
+
protoOf(PowerProviderConstantWithTiring).c23 = function (course, path, pointIndex) {
|
|
1428
|
+
var elapsedS = path.n1u(pointIndex) / 1000.0;
|
|
2964
1429
|
// Inline function 'kotlin.math.max' call
|
|
2965
|
-
var b = 1.0 - 0.6 * elapsedS / this.
|
|
1430
|
+
var b = 1.0 - 0.6 * elapsedS / this.u23_1;
|
|
2966
1431
|
var c = Math.max(0.5, b);
|
|
2967
|
-
return this.
|
|
1432
|
+
return this.t23_1 * c;
|
|
2968
1433
|
};
|
|
2969
1434
|
function PowerProviderFromData() {
|
|
2970
1435
|
}
|
|
2971
|
-
protoOf(PowerProviderFromData).
|
|
2972
|
-
return path.
|
|
1436
|
+
protoOf(PowerProviderFromData).u22 = function (course, path, pointIndex) {
|
|
1437
|
+
return path.d1r(pointIndex);
|
|
2973
1438
|
};
|
|
2974
1439
|
var PowerProviderFromData_instance;
|
|
2975
1440
|
function PowerProviderFromData_getInstance() {
|
|
@@ -2977,7 +1442,7 @@
|
|
|
2977
1442
|
}
|
|
2978
1443
|
function RhoProviderDefault() {
|
|
2979
1444
|
}
|
|
2980
|
-
protoOf(RhoProviderDefault).
|
|
1445
|
+
protoOf(RhoProviderDefault).x22 = function (course, path, pointIndex) {
|
|
2981
1446
|
return 1.225;
|
|
2982
1447
|
};
|
|
2983
1448
|
var RhoProviderDefault_instance;
|
|
@@ -2985,16 +1450,16 @@
|
|
|
2985
1450
|
return RhoProviderDefault_instance;
|
|
2986
1451
|
}
|
|
2987
1452
|
function RhoProviderEstimate() {
|
|
2988
|
-
this.
|
|
2989
|
-
this.
|
|
2990
|
-
this.
|
|
2991
|
-
this.
|
|
2992
|
-
this.
|
|
2993
|
-
}
|
|
2994
|
-
protoOf(RhoProviderEstimate).
|
|
2995
|
-
var providedTemp = path.
|
|
2996
|
-
var temperatureC = isNaN_0(providedTemp)
|
|
2997
|
-
var providedElevation = path.
|
|
1453
|
+
this.v23_1 = 101325.0;
|
|
1454
|
+
this.w23_1 = 288.15;
|
|
1455
|
+
this.x23_1 = 9.80665;
|
|
1456
|
+
this.y23_1 = 0.0065;
|
|
1457
|
+
this.z23_1 = 287.05;
|
|
1458
|
+
}
|
|
1459
|
+
protoOf(RhoProviderEstimate).x22 = function (course, path, pointIndex) {
|
|
1460
|
+
var providedTemp = path.m1t(pointIndex, PointField_TEMPERATURE_getInstance());
|
|
1461
|
+
var temperatureC = isNaN_0(providedTemp) ? 15.0 : providedTemp;
|
|
1462
|
+
var providedElevation = path.y1q(pointIndex);
|
|
2998
1463
|
var altitude = isNaN_0(providedElevation) ? 0.0 : providedElevation;
|
|
2999
1464
|
var tKelvin = temperatureC + 273.15;
|
|
3000
1465
|
var tmp0 = 1.0 - 0.0065 * altitude / 288.15;
|
|
@@ -3009,17 +1474,17 @@
|
|
|
3009
1474
|
}
|
|
3010
1475
|
function RollingResistancePowerProvider() {
|
|
3011
1476
|
}
|
|
3012
|
-
protoOf(RollingResistancePowerProvider).
|
|
3013
|
-
var m = course.
|
|
3014
|
-
var crr = course.
|
|
3015
|
-
var grade = path.
|
|
3016
|
-
var speed = path.
|
|
1477
|
+
protoOf(RollingResistancePowerProvider).u22 = function (course, path, pointIndex) {
|
|
1478
|
+
var m = course.f1z().j1z_1;
|
|
1479
|
+
var crr = course.g1z().n1y_1;
|
|
1480
|
+
var grade = path.t1u(pointIndex);
|
|
1481
|
+
var speed = path.m1v(pointIndex);
|
|
3017
1482
|
// Inline function 'kotlin.math.atan' call
|
|
3018
1483
|
// Inline function 'kotlin.math.cos' call
|
|
3019
1484
|
var x = Math.atan(grade);
|
|
3020
1485
|
var coef = Math.cos(x);
|
|
3021
1486
|
var p = -coef * m * 9.8 * speed * crr;
|
|
3022
|
-
path.
|
|
1487
|
+
path.b1v(pointIndex, p);
|
|
3023
1488
|
return p;
|
|
3024
1489
|
};
|
|
3025
1490
|
var RollingResistancePowerProvider_instance;
|
|
@@ -3030,15 +1495,15 @@
|
|
|
3030
1495
|
var _iterator__ex2g4s = get_entries().i();
|
|
3031
1496
|
while (_iterator__ex2g4s.j()) {
|
|
3032
1497
|
var field = _iterator__ex2g4s.k();
|
|
3033
|
-
dst.
|
|
1498
|
+
dst.t1t(j, field, src.m1t(i, field));
|
|
3034
1499
|
}
|
|
3035
1500
|
}
|
|
3036
1501
|
function VirtualizeService() {
|
|
3037
|
-
this.
|
|
1502
|
+
this.u20_1 = 100000;
|
|
3038
1503
|
}
|
|
3039
|
-
protoOf(VirtualizeService).
|
|
3040
|
-
var input = course.
|
|
3041
|
-
var n = input.
|
|
1504
|
+
protoOf(VirtualizeService).v20 = function (course) {
|
|
1505
|
+
var input = course.e1z();
|
|
1506
|
+
var n = input.u1q_1;
|
|
3042
1507
|
if (n === 0)
|
|
3043
1508
|
return new Path(0);
|
|
3044
1509
|
if (n === 1) {
|
|
@@ -3046,54 +1511,54 @@
|
|
|
3046
1511
|
copyAllFields(this, input, 0, singleton, 0);
|
|
3047
1512
|
return singleton;
|
|
3048
1513
|
}
|
|
3049
|
-
var mEq = PowerComputer_instance.
|
|
1514
|
+
var mEq = PowerComputer_instance.n23(course);
|
|
3050
1515
|
var out = new Path(n);
|
|
3051
1516
|
copyAllFields(this, input, 0, out, 0);
|
|
3052
1517
|
var speed = 0.5555555555555556;
|
|
3053
1518
|
var startTimeMs = 0.0;
|
|
3054
1519
|
var timeMs = startTimeMs;
|
|
3055
|
-
out.
|
|
3056
|
-
out.
|
|
3057
|
-
out.
|
|
3058
|
-
out.
|
|
1520
|
+
out.q1r(0, timeMs);
|
|
1521
|
+
out.o1u(0, 0.0);
|
|
1522
|
+
out.n1v(0, speed);
|
|
1523
|
+
out.r1v(0, speed);
|
|
3059
1524
|
var i = 1;
|
|
3060
1525
|
var iter = 0;
|
|
3061
1526
|
$l$loop: while (i < n) {
|
|
3062
|
-
var dx = input.
|
|
3063
|
-
var pSum = PowerComputer_instance.
|
|
3064
|
-
var dt = PowerComputer_instance.
|
|
1527
|
+
var dx = input.k1u(i) - input.k1u(i - 1 | 0);
|
|
1528
|
+
var pSum = PowerComputer_instance.g23(course, out, i - 1 | 0, true);
|
|
1529
|
+
var dt = PowerComputer_instance.k23(pSum, mEq, speed, dx);
|
|
3065
1530
|
var speedNew = 2.0 * dx / dt - speed;
|
|
3066
1531
|
copyAllFields(this, input, i, out, i);
|
|
3067
|
-
var speedMax = input.
|
|
1532
|
+
var speedMax = input.o1v(i);
|
|
3068
1533
|
if (speedNew > speedMax) {
|
|
3069
1534
|
speedNew = speedMax;
|
|
3070
1535
|
dt = 2.0 * dx / (speedNew + speed);
|
|
3071
1536
|
}
|
|
3072
1537
|
speed = speedNew;
|
|
3073
1538
|
timeMs = timeMs + dt * 1000.0;
|
|
3074
|
-
out.
|
|
3075
|
-
out.
|
|
3076
|
-
out.
|
|
3077
|
-
out.
|
|
3078
|
-
out.
|
|
3079
|
-
out.
|
|
1539
|
+
out.q1r(i, timeMs);
|
|
1540
|
+
out.o1u(i, timeMs - startTimeMs);
|
|
1541
|
+
out.m1u(i, dx);
|
|
1542
|
+
out.q1u(i, dt * 1000.0);
|
|
1543
|
+
out.n1v(i, speed);
|
|
1544
|
+
out.r1v(i, speed);
|
|
3080
1545
|
i = i + 1 | 0;
|
|
3081
1546
|
var _unary__edvuaz = iter;
|
|
3082
1547
|
iter = _unary__edvuaz + 1 | 0;
|
|
3083
1548
|
if (_unary__edvuaz > 100000)
|
|
3084
1549
|
break $l$loop;
|
|
3085
1550
|
}
|
|
3086
|
-
var progression = out.
|
|
3087
|
-
var inductionVariable = progression.
|
|
3088
|
-
var last = progression.
|
|
1551
|
+
var progression = out.z1v();
|
|
1552
|
+
var inductionVariable = progression.lc_1;
|
|
1553
|
+
var last = progression.mc_1;
|
|
3089
1554
|
if (inductionVariable <= last)
|
|
3090
1555
|
do {
|
|
3091
1556
|
var j = inductionVariable;
|
|
3092
1557
|
inductionVariable = inductionVariable + 1 | 0;
|
|
3093
|
-
PowerComputer_instance.
|
|
1558
|
+
PowerComputer_instance.l23(course, out, mEq, j);
|
|
3094
1559
|
}
|
|
3095
1560
|
while (!(j === last));
|
|
3096
|
-
out.
|
|
1561
|
+
out.e1s();
|
|
3097
1562
|
return out;
|
|
3098
1563
|
};
|
|
3099
1564
|
var VirtualizeService_instance;
|
|
@@ -3102,37 +1567,37 @@
|
|
|
3102
1567
|
}
|
|
3103
1568
|
function WheelBearingsPowerProvider() {
|
|
3104
1569
|
}
|
|
3105
|
-
protoOf(WheelBearingsPowerProvider).
|
|
3106
|
-
var speed = path.
|
|
1570
|
+
protoOf(WheelBearingsPowerProvider).u22 = function (course, path, pointIndex) {
|
|
1571
|
+
var speed = path.m1v(pointIndex);
|
|
3107
1572
|
var p = -speed * (91.0 + 8.7 * speed) / 1000.0;
|
|
3108
|
-
path.
|
|
1573
|
+
path.c1v(pointIndex, p);
|
|
3109
1574
|
return p;
|
|
3110
1575
|
};
|
|
3111
1576
|
var WheelBearingsPowerProvider_instance;
|
|
3112
1577
|
function WheelBearingsPowerProvider_getInstance() {
|
|
3113
1578
|
return WheelBearingsPowerProvider_instance;
|
|
3114
1579
|
}
|
|
3115
|
-
function
|
|
3116
|
-
|
|
3117
|
-
this.
|
|
1580
|
+
function Companion_6() {
|
|
1581
|
+
Companion_instance_6 = this;
|
|
1582
|
+
this.a24_1 = new Wind(0.0, 0.0);
|
|
3118
1583
|
}
|
|
3119
|
-
var
|
|
1584
|
+
var Companion_instance_6;
|
|
3120
1585
|
function Companion_getInstance_8() {
|
|
3121
|
-
if (
|
|
3122
|
-
new
|
|
3123
|
-
return
|
|
1586
|
+
if (Companion_instance_6 == null)
|
|
1587
|
+
new Companion_6();
|
|
1588
|
+
return Companion_instance_6;
|
|
3124
1589
|
}
|
|
3125
1590
|
function Wind(speedMS, directionRad) {
|
|
3126
1591
|
Companion_getInstance_8();
|
|
3127
|
-
this.
|
|
3128
|
-
this.
|
|
1592
|
+
this.r22_1 = speedMS;
|
|
1593
|
+
this.s22_1 = directionRad;
|
|
3129
1594
|
}
|
|
3130
1595
|
protoOf(Wind).toString = function () {
|
|
3131
|
-
return 'Wind(speedMS=' + this.
|
|
1596
|
+
return 'Wind(speedMS=' + this.r22_1 + ', directionRad=' + this.s22_1 + ')';
|
|
3132
1597
|
};
|
|
3133
1598
|
protoOf(Wind).hashCode = function () {
|
|
3134
|
-
var result = getNumberHashCode(this.
|
|
3135
|
-
result = imul(result, 31) + getNumberHashCode(this.
|
|
1599
|
+
var result = getNumberHashCode(this.r22_1);
|
|
1600
|
+
result = imul(result, 31) + getNumberHashCode(this.s22_1) | 0;
|
|
3136
1601
|
return result;
|
|
3137
1602
|
};
|
|
3138
1603
|
protoOf(Wind).equals = function (other) {
|
|
@@ -3140,50 +1605,101 @@
|
|
|
3140
1605
|
return true;
|
|
3141
1606
|
if (!(other instanceof Wind))
|
|
3142
1607
|
return false;
|
|
3143
|
-
if (!equals(this.
|
|
1608
|
+
if (!equals(this.r22_1, other.r22_1))
|
|
3144
1609
|
return false;
|
|
3145
|
-
if (!equals(this.
|
|
1610
|
+
if (!equals(this.s22_1, other.s22_1))
|
|
3146
1611
|
return false;
|
|
3147
1612
|
return true;
|
|
3148
1613
|
};
|
|
3149
1614
|
function WindProviderNone() {
|
|
3150
1615
|
}
|
|
3151
|
-
protoOf(WindProviderNone).
|
|
3152
|
-
return Companion_getInstance_8().
|
|
1616
|
+
protoOf(WindProviderNone).w22 = function (course, path, pointIndex) {
|
|
1617
|
+
return Companion_getInstance_8().a24_1;
|
|
3153
1618
|
};
|
|
3154
1619
|
var WindProviderNone_instance;
|
|
3155
1620
|
function WindProviderNone_getInstance() {
|
|
3156
1621
|
return WindProviderNone_instance;
|
|
3157
1622
|
}
|
|
3158
1623
|
function WindProviderConstant(wind) {
|
|
3159
|
-
this.
|
|
1624
|
+
this.b24_1 = wind;
|
|
3160
1625
|
}
|
|
3161
|
-
protoOf(WindProviderConstant).
|
|
3162
|
-
return this.
|
|
1626
|
+
protoOf(WindProviderConstant).w22 = function (course, path, pointIndex) {
|
|
1627
|
+
return this.b24_1;
|
|
3163
1628
|
};
|
|
1629
|
+
function parseGpxWaypoints(xml) {
|
|
1630
|
+
// Inline function 'kotlin.collections.map' call
|
|
1631
|
+
var this_0 = GpxParser_instance.m1r(xml).e1q_1;
|
|
1632
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1633
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1634
|
+
var _iterator__ex2g4s = this_0.i();
|
|
1635
|
+
while (_iterator__ex2g4s.j()) {
|
|
1636
|
+
var item = _iterator__ex2g4s.k();
|
|
1637
|
+
var tmp$ret$2 = waypointObj(item);
|
|
1638
|
+
destination.h(tmp$ret$2);
|
|
1639
|
+
}
|
|
1640
|
+
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1641
|
+
return copyToArray(destination);
|
|
1642
|
+
}
|
|
3164
1643
|
function parseGpx(xml) {
|
|
3165
|
-
return firstTrackAsPath(GpxParser_instance.
|
|
1644
|
+
return firstTrackAsPath(GpxParser_instance.m1r(xml));
|
|
1645
|
+
}
|
|
1646
|
+
function parseGpxTracks(xml) {
|
|
1647
|
+
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1648
|
+
var this_0 = tracksAsPaths(GpxParser_instance.m1r(xml));
|
|
1649
|
+
return copyToArray(this_0);
|
|
1650
|
+
}
|
|
1651
|
+
function parseGpxSegments(xml) {
|
|
1652
|
+
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1653
|
+
var this_0 = segmentsAsPaths(GpxParser_instance.m1r(xml));
|
|
1654
|
+
return copyToArray(this_0);
|
|
1655
|
+
}
|
|
1656
|
+
function writeGpxTracks(paths, waypoints) {
|
|
1657
|
+
var tmp;
|
|
1658
|
+
if (waypoints === VOID) {
|
|
1659
|
+
// Inline function 'kotlin.emptyArray' call
|
|
1660
|
+
tmp = [];
|
|
1661
|
+
} else {
|
|
1662
|
+
tmp = waypoints;
|
|
1663
|
+
}
|
|
1664
|
+
waypoints = tmp;
|
|
1665
|
+
var tmp_0 = GpxWriter_instance;
|
|
1666
|
+
var tmp_1 = toList(paths);
|
|
1667
|
+
// Inline function 'kotlin.collections.map' call
|
|
1668
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1669
|
+
var destination = ArrayList_init_$Create$_0(waypoints.length);
|
|
1670
|
+
var inductionVariable = 0;
|
|
1671
|
+
var last = waypoints.length;
|
|
1672
|
+
while (inductionVariable < last) {
|
|
1673
|
+
var item = waypoints[inductionVariable];
|
|
1674
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
1675
|
+
var tmp$ret$3 = toGpxWaypoint(item);
|
|
1676
|
+
destination.h(tmp$ret$3);
|
|
1677
|
+
}
|
|
1678
|
+
return tmp_0.o1s(tmp_1, VOID, VOID, destination);
|
|
3166
1679
|
}
|
|
3167
1680
|
function pathSize(path) {
|
|
3168
|
-
return path.
|
|
1681
|
+
return path.u1q_1;
|
|
3169
1682
|
}
|
|
3170
1683
|
function pathTotalDistance(path) {
|
|
3171
|
-
return path.
|
|
1684
|
+
return path.x1r_1;
|
|
3172
1685
|
}
|
|
3173
1686
|
function pathDurationMs(path) {
|
|
3174
|
-
return path.
|
|
1687
|
+
return path.c1s_1;
|
|
3175
1688
|
}
|
|
3176
1689
|
function pathElevationGain(path) {
|
|
3177
|
-
return path.
|
|
1690
|
+
return path.a1s_1;
|
|
3178
1691
|
}
|
|
3179
1692
|
function pathElevationLoss(path) {
|
|
3180
|
-
return path.
|
|
1693
|
+
return path.b1s_1;
|
|
3181
1694
|
}
|
|
3182
1695
|
function pointAt(path, i) {
|
|
3183
|
-
return pointObj(path.
|
|
1696
|
+
return pointObj(path.a1w(i), path.b1w(i), path.y1q(i), path.z1q(i), path.m1v(i), path.k1v(i), path.k1u(i), path.t1u(i));
|
|
3184
1697
|
}
|
|
3185
1698
|
function writeGpx(path) {
|
|
3186
|
-
return GpxWriter_instance.
|
|
1699
|
+
return GpxWriter_instance.m1s(toGpxDocument(path, VOID, 'virtualized'));
|
|
1700
|
+
}
|
|
1701
|
+
function writeGpxAt(path, startTimeEpochMs) {
|
|
1702
|
+
return GpxWriter_instance.m1s(toGpxDocument(path, VOID, 'virtualized', Companion_getInstance().nd(numberToLong(startTimeEpochMs))));
|
|
3187
1703
|
}
|
|
3188
1704
|
function enhance(path, options) {
|
|
3189
1705
|
var tmp = GlobalScope_instance;
|
|
@@ -3194,7 +1710,7 @@
|
|
|
3194
1710
|
return promise(tmp, VOID, VOID, enhanceWithCourse$slambda_0(options, path, cyclist, bike, wind, power, null));
|
|
3195
1711
|
}
|
|
3196
1712
|
function getField(path, i, fieldProp) {
|
|
3197
|
-
var tmp0_elvis_lhs =
|
|
1713
|
+
var tmp0_elvis_lhs = Companion_getInstance_0().g1w(fieldProp);
|
|
3198
1714
|
var tmp;
|
|
3199
1715
|
if (tmp0_elvis_lhs == null) {
|
|
3200
1716
|
// Inline function 'kotlin.error' call
|
|
@@ -3204,24 +1720,24 @@
|
|
|
3204
1720
|
tmp = tmp0_elvis_lhs;
|
|
3205
1721
|
}
|
|
3206
1722
|
var field = tmp;
|
|
3207
|
-
return path.
|
|
1723
|
+
return path.m1t(i, field);
|
|
3208
1724
|
}
|
|
3209
1725
|
function fieldDefinitions() {
|
|
3210
1726
|
// Inline function 'kotlin.collections.map' call
|
|
3211
1727
|
var this_0 = get_entries();
|
|
3212
1728
|
// Inline function 'kotlin.collections.mapTo' call
|
|
3213
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
1729
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
3214
1730
|
var _iterator__ex2g4s = this_0.i();
|
|
3215
1731
|
while (_iterator__ex2g4s.j()) {
|
|
3216
1732
|
var item = _iterator__ex2g4s.k();
|
|
3217
1733
|
var o = {};
|
|
3218
|
-
o.prop = item.
|
|
3219
|
-
o.unit = item.
|
|
3220
|
-
o.shortDescription = item.
|
|
3221
|
-
o.categoryId = item.
|
|
3222
|
-
o.categoryName = item.
|
|
3223
|
-
o.notSelectable = item.
|
|
3224
|
-
o.anglesInRadians = item.
|
|
1734
|
+
o.prop = item.a1t_1;
|
|
1735
|
+
o.unit = item.b1t_1;
|
|
1736
|
+
o.shortDescription = item.c1t_1;
|
|
1737
|
+
o.categoryId = item.d1t_1.j1w_1;
|
|
1738
|
+
o.categoryName = item.d1t_1.k1w_1;
|
|
1739
|
+
o.notSelectable = item.e1t_1;
|
|
1740
|
+
o.anglesInRadians = item.f1t_1;
|
|
3225
1741
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
3226
1742
|
destination.h(o);
|
|
3227
1743
|
}
|
|
@@ -3229,10 +1745,70 @@
|
|
|
3229
1745
|
return copyToArray(destination);
|
|
3230
1746
|
}
|
|
3231
1747
|
function pathLatitudeDeg(path, i) {
|
|
3232
|
-
return path.
|
|
1748
|
+
return path.a1w(i);
|
|
3233
1749
|
}
|
|
3234
1750
|
function pathLongitudeDeg(path, i) {
|
|
3235
|
-
return path.
|
|
1751
|
+
return path.b1w(i);
|
|
1752
|
+
}
|
|
1753
|
+
function pathToCsv(path, separator, unitsInHeader) {
|
|
1754
|
+
var tmp = CsvWriter_instance;
|
|
1755
|
+
var tmp0_elvis_lhs = firstOrNull(separator);
|
|
1756
|
+
var tmp_0;
|
|
1757
|
+
var tmp_1 = tmp0_elvis_lhs;
|
|
1758
|
+
if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
|
|
1759
|
+
tmp_0 = _Char___init__impl__6a9atx(44);
|
|
1760
|
+
} else {
|
|
1761
|
+
tmp_0 = tmp0_elvis_lhs;
|
|
1762
|
+
}
|
|
1763
|
+
return tmp.l1t(path, new CsvOptions(VOID, tmp_0, unitsInHeader));
|
|
1764
|
+
}
|
|
1765
|
+
function pathToJson(path, pretty) {
|
|
1766
|
+
return JsonWriter_instance.s1t(path, new JsonOptions(VOID, pretty));
|
|
1767
|
+
}
|
|
1768
|
+
function pathToFit(path, name, startTimeEpochMs) {
|
|
1769
|
+
return toFitBytes(path, name, Companion_getInstance().nd(numberToLong(startTimeEpochMs)));
|
|
1770
|
+
}
|
|
1771
|
+
function detectClimbs(path) {
|
|
1772
|
+
// Inline function 'kotlin.collections.map' call
|
|
1773
|
+
var this_0 = ClimbDetector_instance.q22(path);
|
|
1774
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1775
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1776
|
+
var _iterator__ex2g4s = this_0.i();
|
|
1777
|
+
while (_iterator__ex2g4s.j()) {
|
|
1778
|
+
var item = _iterator__ex2g4s.k();
|
|
1779
|
+
var tmp$ret$2 = toDto_0(item);
|
|
1780
|
+
destination.h(tmp$ret$2);
|
|
1781
|
+
}
|
|
1782
|
+
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1783
|
+
return copyToArray(destination);
|
|
1784
|
+
}
|
|
1785
|
+
function detectClimbsWithOptions(path, minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster) {
|
|
1786
|
+
// Inline function 'kotlin.collections.map' call
|
|
1787
|
+
var this_0 = ClimbDetector_instance.p22(path, new ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster));
|
|
1788
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1789
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1790
|
+
var _iterator__ex2g4s = this_0.i();
|
|
1791
|
+
while (_iterator__ex2g4s.j()) {
|
|
1792
|
+
var item = _iterator__ex2g4s.k();
|
|
1793
|
+
var tmp$ret$2 = toDto_0(item);
|
|
1794
|
+
destination.h(tmp$ret$2);
|
|
1795
|
+
}
|
|
1796
|
+
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1797
|
+
return copyToArray(destination);
|
|
1798
|
+
}
|
|
1799
|
+
function waypointObj(w) {
|
|
1800
|
+
var o = {};
|
|
1801
|
+
o.latitudeDeg = w.u1p_1;
|
|
1802
|
+
o.longitudeDeg = w.v1p_1;
|
|
1803
|
+
o.elevationM = w.w1p_1;
|
|
1804
|
+
o.name = w.x1p_1;
|
|
1805
|
+
o.description = w.y1p_1;
|
|
1806
|
+
o.symbol = w.z1p_1;
|
|
1807
|
+
o.type = w.a1q_1;
|
|
1808
|
+
var tmp0_safe_receiver = w.b1q_1;
|
|
1809
|
+
o.timeEpochMs = tmp0_safe_receiver == null ? null : toNumber(tmp0_safe_receiver);
|
|
1810
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1811
|
+
return o;
|
|
3236
1812
|
}
|
|
3237
1813
|
function pointObj(latitudeDeg, longitudeDeg, elevation, timeMs, speed, pComputedPower, distance, grade) {
|
|
3238
1814
|
var o = {};
|
|
@@ -3247,6 +1823,17 @@
|
|
|
3247
1823
|
// Inline function 'kotlin.js.unsafeCast' call
|
|
3248
1824
|
return o;
|
|
3249
1825
|
}
|
|
1826
|
+
function toGpxWaypoint(_this__u8e3s4) {
|
|
1827
|
+
var tmp = _this__u8e3s4.latitudeDeg;
|
|
1828
|
+
var tmp_0 = _this__u8e3s4.longitudeDeg;
|
|
1829
|
+
var tmp_1 = _this__u8e3s4.elevationM;
|
|
1830
|
+
var tmp_2 = _this__u8e3s4.name;
|
|
1831
|
+
var tmp_3 = _this__u8e3s4.description;
|
|
1832
|
+
var tmp_4 = _this__u8e3s4.symbol;
|
|
1833
|
+
var tmp_5 = _this__u8e3s4.type;
|
|
1834
|
+
var tmp0_safe_receiver = _this__u8e3s4.timeEpochMs;
|
|
1835
|
+
return new GpxWaypoint(tmp, tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, tmp_5, tmp0_safe_receiver == null ? null : numberToLong(tmp0_safe_receiver));
|
|
1836
|
+
}
|
|
3250
1837
|
function toEnhanceOptions(_this__u8e3s4) {
|
|
3251
1838
|
if (_this__u8e3s4 == null)
|
|
3252
1839
|
return defaultJsOptions();
|
|
@@ -3313,32 +1900,73 @@
|
|
|
3313
1900
|
}
|
|
3314
1901
|
return tmp;
|
|
3315
1902
|
}
|
|
1903
|
+
function toDto(_this__u8e3s4) {
|
|
1904
|
+
var o = {};
|
|
1905
|
+
o.startDistanceM = _this__u8e3s4.m21_1;
|
|
1906
|
+
o.endDistanceM = _this__u8e3s4.n21_1;
|
|
1907
|
+
o.startElevationM = _this__u8e3s4.o21_1;
|
|
1908
|
+
o.endElevationM = _this__u8e3s4.p21_1;
|
|
1909
|
+
o.lengthM = _this__u8e3s4.i21();
|
|
1910
|
+
o.elevationGainM = _this__u8e3s4.j21();
|
|
1911
|
+
o.grade = _this__u8e3s4.q21();
|
|
1912
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1913
|
+
return o;
|
|
1914
|
+
}
|
|
1915
|
+
function toDto_0(_this__u8e3s4) {
|
|
1916
|
+
var o = {};
|
|
1917
|
+
o.startIndex = _this__u8e3s4.z20_1;
|
|
1918
|
+
o.endIndex = _this__u8e3s4.a21_1;
|
|
1919
|
+
o.startDistanceM = _this__u8e3s4.b21_1;
|
|
1920
|
+
o.endDistanceM = _this__u8e3s4.c21_1;
|
|
1921
|
+
o.startElevationM = _this__u8e3s4.d21_1;
|
|
1922
|
+
o.endElevationM = _this__u8e3s4.e21_1;
|
|
1923
|
+
o.lengthM = _this__u8e3s4.i21();
|
|
1924
|
+
o.elevationGainM = _this__u8e3s4.j21();
|
|
1925
|
+
o.averageGrade = _this__u8e3s4.k21();
|
|
1926
|
+
o.climbingGrade = _this__u8e3s4.l21();
|
|
1927
|
+
o.positiveElevationM = _this__u8e3s4.f21_1;
|
|
1928
|
+
o.negativeElevationM = _this__u8e3s4.g21_1;
|
|
1929
|
+
// Inline function 'kotlin.collections.map' call
|
|
1930
|
+
var this_0 = _this__u8e3s4.h21_1;
|
|
1931
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1932
|
+
var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
|
|
1933
|
+
var _iterator__ex2g4s = this_0.i();
|
|
1934
|
+
while (_iterator__ex2g4s.j()) {
|
|
1935
|
+
var item = _iterator__ex2g4s.k();
|
|
1936
|
+
var tmp$ret$2 = toDto(item);
|
|
1937
|
+
destination.h(tmp$ret$2);
|
|
1938
|
+
}
|
|
1939
|
+
// Inline function 'kotlin.collections.toTypedArray' call
|
|
1940
|
+
o.parts = copyToArray(destination);
|
|
1941
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1942
|
+
return o;
|
|
1943
|
+
}
|
|
3316
1944
|
function enhance$slambda($options, $path, resultContinuation) {
|
|
3317
|
-
this.
|
|
3318
|
-
this.
|
|
1945
|
+
this.k24_1 = $options;
|
|
1946
|
+
this.l24_1 = $path;
|
|
3319
1947
|
CoroutineImpl.call(this, resultContinuation);
|
|
3320
1948
|
}
|
|
3321
|
-
protoOf(enhance$slambda).
|
|
3322
|
-
var tmp = this.
|
|
3323
|
-
tmp.
|
|
3324
|
-
tmp.
|
|
3325
|
-
return tmp.
|
|
1949
|
+
protoOf(enhance$slambda).n24 = function ($this$promise, $completion) {
|
|
1950
|
+
var tmp = this.n11($this$promise, $completion);
|
|
1951
|
+
tmp.j6_1 = Unit_instance;
|
|
1952
|
+
tmp.k6_1 = null;
|
|
1953
|
+
return tmp.p6();
|
|
3326
1954
|
};
|
|
3327
|
-
protoOf(enhance$slambda).
|
|
3328
|
-
return this.
|
|
1955
|
+
protoOf(enhance$slambda).x6 = function (p1, $completion) {
|
|
1956
|
+
return this.n24((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
3329
1957
|
};
|
|
3330
|
-
protoOf(enhance$slambda).
|
|
3331
|
-
var suspendResult = this.
|
|
1958
|
+
protoOf(enhance$slambda).p6 = function () {
|
|
1959
|
+
var suspendResult = this.j6_1;
|
|
3332
1960
|
$sm: do
|
|
3333
1961
|
try {
|
|
3334
|
-
var tmp = this.
|
|
1962
|
+
var tmp = this.h6_1;
|
|
3335
1963
|
switch (tmp) {
|
|
3336
1964
|
case 0:
|
|
3337
|
-
this.
|
|
3338
|
-
var opts = toEnhanceOptions(this.
|
|
3339
|
-
var provider = opts.
|
|
3340
|
-
this.
|
|
3341
|
-
suspendResult = Enhancer_instance.
|
|
1965
|
+
this.i6_1 = 2;
|
|
1966
|
+
var opts = toEnhanceOptions(this.k24_1);
|
|
1967
|
+
var provider = opts.w1z_1 ? new ElevationProvider() : null;
|
|
1968
|
+
this.h6_1 = 1;
|
|
1969
|
+
suspendResult = Enhancer_instance.x20(this.l24_1, provider, opts, this);
|
|
3342
1970
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3343
1971
|
return suspendResult;
|
|
3344
1972
|
}
|
|
@@ -3347,63 +1975,61 @@
|
|
|
3347
1975
|
case 1:
|
|
3348
1976
|
return suspendResult;
|
|
3349
1977
|
case 2:
|
|
3350
|
-
throw this.
|
|
1978
|
+
throw this.k6_1;
|
|
3351
1979
|
}
|
|
3352
1980
|
} catch ($p) {
|
|
3353
1981
|
var e = $p;
|
|
3354
|
-
if (this.
|
|
1982
|
+
if (this.i6_1 === 2) {
|
|
3355
1983
|
throw e;
|
|
3356
1984
|
} else {
|
|
3357
|
-
this.
|
|
3358
|
-
this.
|
|
1985
|
+
this.h6_1 = this.i6_1;
|
|
1986
|
+
this.k6_1 = e;
|
|
3359
1987
|
}
|
|
3360
1988
|
}
|
|
3361
1989
|
while (true);
|
|
3362
1990
|
};
|
|
3363
|
-
protoOf(enhance$slambda).
|
|
3364
|
-
var i = new enhance$slambda(this.
|
|
3365
|
-
i.
|
|
1991
|
+
protoOf(enhance$slambda).n11 = function ($this$promise, completion) {
|
|
1992
|
+
var i = new enhance$slambda(this.k24_1, this.l24_1, completion);
|
|
1993
|
+
i.m24_1 = $this$promise;
|
|
3366
1994
|
return i;
|
|
3367
1995
|
};
|
|
3368
1996
|
function enhance$slambda_0($options, $path, resultContinuation) {
|
|
3369
1997
|
var i = new enhance$slambda($options, $path, resultContinuation);
|
|
3370
|
-
|
|
3371
|
-
return i.
|
|
3372
|
-
};
|
|
3373
|
-
l.$arity = 1;
|
|
3374
|
-
return l;
|
|
1998
|
+
return constructCallableReference(function ($this$promise, $completion) {
|
|
1999
|
+
return i.n24($this$promise, $completion);
|
|
2000
|
+
}, 1);
|
|
3375
2001
|
}
|
|
3376
2002
|
function enhanceWithCourse$slambda($options, $path, $cyclist, $bike, $wind, $power, resultContinuation) {
|
|
3377
|
-
this.
|
|
3378
|
-
this.
|
|
3379
|
-
this.
|
|
3380
|
-
this.
|
|
3381
|
-
this.
|
|
3382
|
-
this.
|
|
2003
|
+
this.w24_1 = $options;
|
|
2004
|
+
this.x24_1 = $path;
|
|
2005
|
+
this.y24_1 = $cyclist;
|
|
2006
|
+
this.z24_1 = $bike;
|
|
2007
|
+
this.a25_1 = $wind;
|
|
2008
|
+
this.b25_1 = $power;
|
|
3383
2009
|
CoroutineImpl.call(this, resultContinuation);
|
|
3384
2010
|
}
|
|
3385
|
-
protoOf(enhanceWithCourse$slambda).
|
|
3386
|
-
var tmp = this.
|
|
3387
|
-
tmp.
|
|
3388
|
-
tmp.
|
|
3389
|
-
return tmp.
|
|
2011
|
+
protoOf(enhanceWithCourse$slambda).n24 = function ($this$promise, $completion) {
|
|
2012
|
+
var tmp = this.n11($this$promise, $completion);
|
|
2013
|
+
tmp.j6_1 = Unit_instance;
|
|
2014
|
+
tmp.k6_1 = null;
|
|
2015
|
+
return tmp.p6();
|
|
3390
2016
|
};
|
|
3391
|
-
protoOf(enhanceWithCourse$slambda).
|
|
3392
|
-
return this.
|
|
2017
|
+
protoOf(enhanceWithCourse$slambda).x6 = function (p1, $completion) {
|
|
2018
|
+
return this.n24((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
|
|
3393
2019
|
};
|
|
3394
|
-
protoOf(enhanceWithCourse$slambda).
|
|
3395
|
-
var suspendResult = this.
|
|
2020
|
+
protoOf(enhanceWithCourse$slambda).p6 = function () {
|
|
2021
|
+
var suspendResult = this.j6_1;
|
|
3396
2022
|
$sm: do
|
|
3397
2023
|
try {
|
|
3398
|
-
var tmp = this.
|
|
2024
|
+
var tmp = this.h6_1;
|
|
3399
2025
|
switch (tmp) {
|
|
3400
2026
|
case 0:
|
|
3401
|
-
this.
|
|
3402
|
-
var opts = toEnhanceOptions(this.
|
|
3403
|
-
var provider = opts.
|
|
3404
|
-
var course = new CoursePhysics(new Course(this.
|
|
3405
|
-
this.
|
|
3406
|
-
suspendResult = Enhancer_instance.
|
|
2027
|
+
this.i6_1 = 2;
|
|
2028
|
+
var opts = toEnhanceOptions(this.w24_1);
|
|
2029
|
+
var provider = opts.w1z_1 ? new ElevationProvider() : null;
|
|
2030
|
+
var course = new CoursePhysics(new Course(this.x24_1, toCyclist(this.y24_1), toBike(this.z24_1)), RhoProviderEstimate_instance, AeroProviderConstant_instance, toWindProvider(this.a25_1), toCyclistPowerProvider(this.b25_1));
|
|
2031
|
+
this.h6_1 = 1;
|
|
2032
|
+
suspendResult = Enhancer_instance.y20(course, opts, provider, this);
|
|
3407
2033
|
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
3408
2034
|
return suspendResult;
|
|
3409
2035
|
}
|
|
@@ -3412,44 +2038,37 @@
|
|
|
3412
2038
|
case 1:
|
|
3413
2039
|
return suspendResult;
|
|
3414
2040
|
case 2:
|
|
3415
|
-
throw this.
|
|
2041
|
+
throw this.k6_1;
|
|
3416
2042
|
}
|
|
3417
2043
|
} catch ($p) {
|
|
3418
2044
|
var e = $p;
|
|
3419
|
-
if (this.
|
|
2045
|
+
if (this.i6_1 === 2) {
|
|
3420
2046
|
throw e;
|
|
3421
2047
|
} else {
|
|
3422
|
-
this.
|
|
3423
|
-
this.
|
|
2048
|
+
this.h6_1 = this.i6_1;
|
|
2049
|
+
this.k6_1 = e;
|
|
3424
2050
|
}
|
|
3425
2051
|
}
|
|
3426
2052
|
while (true);
|
|
3427
2053
|
};
|
|
3428
|
-
protoOf(enhanceWithCourse$slambda).
|
|
3429
|
-
var i = new enhanceWithCourse$slambda(this.
|
|
3430
|
-
i.
|
|
2054
|
+
protoOf(enhanceWithCourse$slambda).n11 = function ($this$promise, completion) {
|
|
2055
|
+
var i = new enhanceWithCourse$slambda(this.w24_1, this.x24_1, this.y24_1, this.z24_1, this.a25_1, this.b25_1, completion);
|
|
2056
|
+
i.c25_1 = $this$promise;
|
|
3431
2057
|
return i;
|
|
3432
2058
|
};
|
|
3433
2059
|
function enhanceWithCourse$slambda_0($options, $path, $cyclist, $bike, $wind, $power, resultContinuation) {
|
|
3434
2060
|
var i = new enhanceWithCourse$slambda($options, $path, $cyclist, $bike, $wind, $power, resultContinuation);
|
|
3435
|
-
|
|
3436
|
-
return i.
|
|
3437
|
-
};
|
|
3438
|
-
l.$arity = 1;
|
|
3439
|
-
return l;
|
|
2061
|
+
return constructCallableReference(function ($this$promise, $completion) {
|
|
2062
|
+
return i.n24($this$promise, $completion);
|
|
2063
|
+
}, 1);
|
|
3440
2064
|
}
|
|
3441
2065
|
//region block: init
|
|
3442
2066
|
Enhancer_instance = new Enhancer();
|
|
3443
|
-
GpxParser_instance = new GpxParser();
|
|
3444
|
-
GpxWriter_instance = new GpxWriter();
|
|
3445
|
-
ElevationStep_instance = new ElevationStep();
|
|
3446
2067
|
Companion_instance_4 = new Companion_4();
|
|
3447
|
-
|
|
3448
|
-
PointPerDistance_instance = new PointPerDistance();
|
|
3449
|
-
PointPerSecond_instance = new PointPerSecond();
|
|
2068
|
+
ClimbDetector_instance = new ClimbDetector();
|
|
3450
2069
|
AeroPowerProvider_instance = new AeroPowerProvider();
|
|
3451
2070
|
AeroProviderConstant_instance = new AeroProviderConstant();
|
|
3452
|
-
|
|
2071
|
+
Companion_instance_5 = new Companion_5();
|
|
3453
2072
|
GravPowerProvider_instance = new GravPowerProvider();
|
|
3454
2073
|
MaxSpeedComputer_instance = new MaxSpeedComputer();
|
|
3455
2074
|
MuscularPowerProvider_instance = new MuscularPowerProvider();
|
|
@@ -3468,7 +2087,11 @@
|
|
|
3468
2087
|
var github = io.github || (io.github = {});
|
|
3469
2088
|
var glandais = github.glandais || (github.glandais = {});
|
|
3470
2089
|
var engine = glandais.engine || (glandais.engine = {});
|
|
2090
|
+
engine.parseGpxWaypoints = parseGpxWaypoints;
|
|
3471
2091
|
engine.parseGpx = parseGpx;
|
|
2092
|
+
engine.parseGpxTracks = parseGpxTracks;
|
|
2093
|
+
engine.parseGpxSegments = parseGpxSegments;
|
|
2094
|
+
engine.writeGpxTracks = writeGpxTracks;
|
|
3472
2095
|
engine.pathSize = pathSize;
|
|
3473
2096
|
engine.pathTotalDistance = pathTotalDistance;
|
|
3474
2097
|
engine.pathDurationMs = pathDurationMs;
|
|
@@ -3476,12 +2099,18 @@
|
|
|
3476
2099
|
engine.pathElevationLoss = pathElevationLoss;
|
|
3477
2100
|
engine.pointAt = pointAt;
|
|
3478
2101
|
engine.writeGpx = writeGpx;
|
|
2102
|
+
engine.writeGpxAt = writeGpxAt;
|
|
3479
2103
|
engine.enhance = enhance;
|
|
3480
2104
|
engine.enhanceWithCourse = enhanceWithCourse;
|
|
3481
2105
|
engine.getField = getField;
|
|
3482
2106
|
engine.fieldDefinitions = fieldDefinitions;
|
|
3483
2107
|
engine.pathLatitudeDeg = pathLatitudeDeg;
|
|
3484
2108
|
engine.pathLongitudeDeg = pathLongitudeDeg;
|
|
2109
|
+
engine.pathToCsv = pathToCsv;
|
|
2110
|
+
engine.pathToJson = pathToJson;
|
|
2111
|
+
engine.pathToFit = pathToFit;
|
|
2112
|
+
engine.detectClimbs = detectClimbs;
|
|
2113
|
+
engine.detectClimbsWithOptions = detectClimbsWithOptions;
|
|
3485
2114
|
}
|
|
3486
2115
|
$jsExportAll$(_);
|
|
3487
2116
|
kotlin_io_github_glandais_elevation.$jsExportAll$(_);
|