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