incyclist-services 1.7.36 → 1.7.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/ride/page/service.js +16 -0
- package/lib/esm/ride/page/service.js +16 -0
- package/lib/types/ride/page/service.d.ts +2 -1
- package/package.json +1 -1
- package/lib/cjs/devices/ride/model.js +0 -2
- package/lib/esm/base/types.js +0 -1
- package/lib/esm/base/typesdef.js +0 -1
- package/lib/esm/devices/configuration/model/service/types.js +0 -1
- package/lib/esm/devices/ride/model.js +0 -1
- package/lib/types/base/types.d.ts +0 -7
- package/lib/types/base/typesdef.d.ts +0 -7
- package/lib/types/devices/configuration/model/service/types.d.ts +0 -16
- package/lib/types/devices/ride/model.d.ts +0 -54
|
@@ -160,6 +160,7 @@ let RidePageService = (() => {
|
|
|
160
160
|
const rideType = this.getRideDisplay().getRideType();
|
|
161
161
|
switch (rideType) {
|
|
162
162
|
case 'Video': return this.getVideoRideDisplayProps();
|
|
163
|
+
case 'GPX': return this.getGPXRideDisplayProps();
|
|
163
164
|
default:
|
|
164
165
|
return null;
|
|
165
166
|
}
|
|
@@ -267,6 +268,21 @@ let RidePageService = (() => {
|
|
|
267
268
|
};
|
|
268
269
|
return displayProps;
|
|
269
270
|
}
|
|
271
|
+
getGPXRideDisplayProps() {
|
|
272
|
+
const props = this.rideDisplayProps;
|
|
273
|
+
const state = this.getRideDisplay().getState();
|
|
274
|
+
const rideType = this.getRideDisplay().getRideType();
|
|
275
|
+
const isStarting = state === 'Idle' || state === 'Starting' || state === 'Error';
|
|
276
|
+
const displayProps = {
|
|
277
|
+
rideState: state,
|
|
278
|
+
rideType,
|
|
279
|
+
startGateProps: this.startGateProps,
|
|
280
|
+
startOverlayProps: isStarting ? this.getRideDisplay().getStartOverlayProps() : null,
|
|
281
|
+
menuProps: this.menuProps,
|
|
282
|
+
gpx: props
|
|
283
|
+
};
|
|
284
|
+
return displayProps;
|
|
285
|
+
}
|
|
270
286
|
async checkSecretValidity() {
|
|
271
287
|
if (this.getBindings().appInfo.getChannel() === 'mobile') {
|
|
272
288
|
const secretsStatus = this.getSecretBinding().getSecretsStatus?.();
|
|
@@ -157,6 +157,7 @@ let RidePageService = (() => {
|
|
|
157
157
|
const rideType = this.getRideDisplay().getRideType();
|
|
158
158
|
switch (rideType) {
|
|
159
159
|
case 'Video': return this.getVideoRideDisplayProps();
|
|
160
|
+
case 'GPX': return this.getGPXRideDisplayProps();
|
|
160
161
|
default:
|
|
161
162
|
return null;
|
|
162
163
|
}
|
|
@@ -264,6 +265,21 @@ let RidePageService = (() => {
|
|
|
264
265
|
};
|
|
265
266
|
return displayProps;
|
|
266
267
|
}
|
|
268
|
+
getGPXRideDisplayProps() {
|
|
269
|
+
const props = this.rideDisplayProps;
|
|
270
|
+
const state = this.getRideDisplay().getState();
|
|
271
|
+
const rideType = this.getRideDisplay().getRideType();
|
|
272
|
+
const isStarting = state === 'Idle' || state === 'Starting' || state === 'Error';
|
|
273
|
+
const displayProps = {
|
|
274
|
+
rideState: state,
|
|
275
|
+
rideType,
|
|
276
|
+
startGateProps: this.startGateProps,
|
|
277
|
+
startOverlayProps: isStarting ? this.getRideDisplay().getStartOverlayProps() : null,
|
|
278
|
+
menuProps: this.menuProps,
|
|
279
|
+
gpx: props
|
|
280
|
+
};
|
|
281
|
+
return displayProps;
|
|
282
|
+
}
|
|
267
283
|
async checkSecretValidity() {
|
|
268
284
|
if (this.getBindings().appInfo.getChannel() === 'mobile') {
|
|
269
285
|
const secretsStatus = this.getSecretBinding().getSecretsStatus?.();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IncyclistPageService } from "../../base/pages";
|
|
2
2
|
import { CurrentRideDisplayProps, CurrentRideState, IObserver, RideType } from "../../types";
|
|
3
|
-
import { AnyRidePageDisplayProps, IRidePageService, RideMenuProps, StartGateProps, VideoRidePageDisplayProps } from "./types";
|
|
3
|
+
import { AnyRidePageDisplayProps, GPXRidePageDisplayProps, IRidePageService, RideMenuProps, StartGateProps, VideoRidePageDisplayProps } from "./types";
|
|
4
4
|
import { ISecretBinding } from "../../api/secret";
|
|
5
5
|
export declare class RidePageService extends IncyclistPageService implements IRidePageService {
|
|
6
6
|
protected eventHandler: Record<string, Function>;
|
|
@@ -28,6 +28,7 @@ export declare class RidePageService extends IncyclistPageService implements IRi
|
|
|
28
28
|
onIgnoreStart(): void;
|
|
29
29
|
onCancelStart(): Promise<void>;
|
|
30
30
|
protected getVideoRideDisplayProps(): VideoRidePageDisplayProps;
|
|
31
|
+
protected getGPXRideDisplayProps(): GPXRidePageDisplayProps;
|
|
31
32
|
protected checkSecretValidity(): Promise<void>;
|
|
32
33
|
protected showStartGate(): void;
|
|
33
34
|
protected hideStartgate(): void;
|
package/package.json
CHANGED
package/lib/esm/base/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/esm/base/typesdef.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ICyclingMode, IncyclistDeviceAdapter } from "incyclist-devices";
|
|
2
|
-
import { ExtendedIncyclistCapability } from "../app";
|
|
3
|
-
export interface AdapterInfo {
|
|
4
|
-
udid: string;
|
|
5
|
-
adapter: IncyclistDeviceAdapter;
|
|
6
|
-
capabilities: ExtendedIncyclistCapability[];
|
|
7
|
-
isControl?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface DeviceModeInfo {
|
|
10
|
-
udid: string;
|
|
11
|
-
mode: string;
|
|
12
|
-
isERG?: boolean;
|
|
13
|
-
isSIM?: boolean;
|
|
14
|
-
settings: any;
|
|
15
|
-
options?: ICyclingMode[];
|
|
16
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { DeviceProperties } from "incyclist-devices";
|
|
2
|
-
import { AdapterInfo, ExtendedIncyclistCapability } from "../configuration";
|
|
3
|
-
import { Route } from "../../routes/base/model/route";
|
|
4
|
-
import { RouteApiDetail } from "../../routes/base/api/types";
|
|
5
|
-
export type HealthStatus = 'green' | 'amber' | 'red';
|
|
6
|
-
export interface AdapterRideInfo extends AdapterInfo {
|
|
7
|
-
isStarted: boolean;
|
|
8
|
-
tsLastData?: number;
|
|
9
|
-
isHealthy?: boolean;
|
|
10
|
-
isRestarting?: boolean;
|
|
11
|
-
dataStatus?: HealthStatus;
|
|
12
|
-
ivToCheck?: NodeJS.Timeout;
|
|
13
|
-
isControl?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface AdapterStateInfo {
|
|
16
|
-
udid: string;
|
|
17
|
-
name: string;
|
|
18
|
-
isControl: boolean;
|
|
19
|
-
capabilities: Array<ExtendedIncyclistCapability>;
|
|
20
|
-
isStarted: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface LegacyRoute {
|
|
23
|
-
get(): RouteApiDetail;
|
|
24
|
-
isLap(): boolean;
|
|
25
|
-
getTitle(): string;
|
|
26
|
-
}
|
|
27
|
-
export interface RideServiceDeviceProperties extends DeviceProperties {
|
|
28
|
-
forceErgMode?: boolean;
|
|
29
|
-
startPos?: number;
|
|
30
|
-
realityFactor?: number;
|
|
31
|
-
rideMode?: string;
|
|
32
|
-
route?: Route | LegacyRoute;
|
|
33
|
-
}
|
|
34
|
-
export interface RideServiceCheckFilter {
|
|
35
|
-
interface?: string;
|
|
36
|
-
interfaces?: string[];
|
|
37
|
-
udid?: string;
|
|
38
|
-
}
|
|
39
|
-
export interface Point {
|
|
40
|
-
elevation: number;
|
|
41
|
-
distance: number;
|
|
42
|
-
}
|
|
43
|
-
export interface PreparedRoute {
|
|
44
|
-
name: string;
|
|
45
|
-
description: string;
|
|
46
|
-
programId: number;
|
|
47
|
-
type: string;
|
|
48
|
-
totalDistance: number;
|
|
49
|
-
lapMode: boolean;
|
|
50
|
-
minElevation: number;
|
|
51
|
-
maxElevation: number;
|
|
52
|
-
sampleRate: number;
|
|
53
|
-
points: Point[];
|
|
54
|
-
}
|