incyclist-services 1.5.39 → 1.5.41

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.
@@ -125,11 +125,11 @@ let DeviceRideService = (() => {
125
125
  return this.data;
126
126
  }
127
127
  getSelectedAdapters() {
128
- var _a, _b;
129
- if (this.rideAdapters)
128
+ var _a, _b, _c;
129
+ if ((_a = this.rideAdapters) === null || _a === void 0 ? void 0 : _a.length)
130
130
  return this.rideAdapters;
131
131
  this.rideAdapters = this.adapters = this.getConfiguredAdapters(true);
132
- const controlDevice = (_b = (_a = this.adapters.find(d => d.capabilities.includes('control'))) !== null && _a !== void 0 ? _a : this.adapters.find(d => d.capabilities.includes('power'))) !== null && _b !== void 0 ? _b : this.adapters.find(d => d.capabilities.includes('speed'));
132
+ const controlDevice = (_c = (_b = this.adapters.find(d => d.capabilities.includes('control'))) !== null && _b !== void 0 ? _b : this.adapters.find(d => d.capabilities.includes('power'))) !== null && _c !== void 0 ? _c : this.adapters.find(d => d.capabilities.includes('speed'));
133
133
  if (controlDevice) {
134
134
  this.rideAdapters.forEach(ai => {
135
135
  ai.isControl = (ai.udid === controlDevice.udid);
@@ -1,7 +1,7 @@
1
1
  import { DeviceData, UpdateRequest } from "incyclist-devices";
2
2
  import { Observer } from "../../base/types";
3
3
  import { ActiveWorkoutLimit } from "../../workouts";
4
- import { CurrentRideDisplayProps, ICurrentRideService, IRideModeService } from "./types";
4
+ import { CurrentRideDisplayProps, ICurrentRideService, IRideModeService, IRideModeServiceDisplayProps } from "./types";
5
5
  import { IncyclistService } from "../../base/service";
6
6
  import { ActivityUpdate } from "../../activities/ride/types";
7
7
  import { ScreenShotInfo } from "../../activities";
@@ -23,7 +23,7 @@ export declare class RideModeService extends IncyclistService implements IRideMo
23
23
  resume(): void;
24
24
  stop(): Promise<void>;
25
25
  getStartOverlayProps(): {};
26
- getDisplayProperties(props: CurrentRideDisplayProps): {};
26
+ getDisplayProperties(props: CurrentRideDisplayProps): IRideModeServiceDisplayProps;
27
27
  onActivityUpdate(activityPos: ActivityUpdate, data: any): void;
28
28
  onDeviceData(data: DeviceData, udid: string): void;
29
29
  onRideSettingsChanged(settings: object): void;
@@ -40,6 +40,7 @@ export declare class RideModeService extends IncyclistService implements IRideMo
40
40
  sendUpdate(request?: UpdateRequest): Promise<void>;
41
41
  protected processPowerDeltaRequest(request: UpdateRequest): void;
42
42
  protected getBikeLogProps(): object;
43
+ protected getDashboardColums(): number;
43
44
  protected getDeviceRide(): import("../../devices").DeviceRideService;
44
45
  protected getWorkoutRide(): import("../../workouts").WorkoutRide;
45
46
  }
@@ -91,7 +91,7 @@ let RideModeService = (() => {
91
91
  return {};
92
92
  }
93
93
  getDisplayProperties(props) {
94
- return {};
94
+ return { dbColumns: this.getDashboardColums() };
95
95
  }
96
96
  onActivityUpdate(activityPos, data) {
97
97
  const limits = this.getWorkoutLimits();
@@ -170,7 +170,7 @@ let RideModeService = (() => {
170
170
  send(request);
171
171
  }
172
172
  getBikeLogProps() {
173
- var _b, _c;
173
+ var _b, _c, _d;
174
174
  const device = this.getDeviceRide().getControlAdapter();
175
175
  if (!device)
176
176
  return {};
@@ -178,11 +178,14 @@ let RideModeService = (() => {
178
178
  if ((mode === null || mode === void 0 ? void 0 : mode.getName()) === 'Simulator') {
179
179
  return { bike: 'Simulator', interface: 'Simulator', mode: 'Simulator' };
180
180
  }
181
- return {
182
- bike: (_b = device.adapter) === null || _b === void 0 ? void 0 : _b.getDisplayName(),
183
- interface: (_c = device.adapter) === null || _c === void 0 ? void 0 : _c.getInterface(),
184
- bikeMode: mode === null || mode === void 0 ? void 0 : mode.getName()
185
- };
181
+ const settings = (_b = mode === null || mode === void 0 ? void 0 : mode.getSettings()) !== null && _b !== void 0 ? _b : {};
182
+ return Object.assign({ bike: (_c = device.adapter) === null || _c === void 0 ? void 0 : _c.getDisplayName(), interface: (_d = device.adapter) === null || _d === void 0 ? void 0 : _d.getInterface(), bikeMode: mode === null || mode === void 0 ? void 0 : mode.getName() }, settings);
183
+ }
184
+ getDashboardColums() {
185
+ const mode = this.getDeviceRide().getCyclingMode();
186
+ const virtshift = mode === null || mode === void 0 ? void 0 : mode.getSetting('virtshift');
187
+ const enabled = virtshift !== undefined && virtshift !== null && virtshift !== 'Disabled';
188
+ return enabled ? 8 : 7;
186
189
  }
187
190
  getDeviceRide() {
188
191
  return (0, devices_1.useDeviceRide)();
@@ -24,6 +24,7 @@ export type CurrentRideDeviceInfo = {
24
24
  healthStatus?: HealthStatus;
25
25
  };
26
26
  export interface IRideModeServiceDisplayProps {
27
+ dbColumns?: number;
27
28
  }
28
29
  export interface WorkoutDisplayProps extends IRideModeServiceDisplayProps {
29
30
  }
@@ -67,6 +67,7 @@ export declare class FreeRideDisplayService extends GpxDisplayService {
67
67
  protected savePosition(): void;
68
68
  protected get route(): Route;
69
69
  protected get currentOptions(): FreeRideContinuation[] | undefined;
70
+ protected getDashboardColums(): number;
70
71
  getFreeRideService(): FreeRideService;
71
72
  getActivityRide(): ActivityRideService;
72
73
  }
@@ -502,6 +502,10 @@ let FreeRideDisplayService = (() => {
502
502
  get currentOptions() {
503
503
  return this.getFreeRideService().getOptions();
504
504
  }
505
+ getDashboardColums() {
506
+ const parent = super.getDashboardColums();
507
+ return parent - 1;
508
+ }
505
509
  getFreeRideService() {
506
510
  return (0, free_ride_1.useFreeRideService)();
507
511
  }
@@ -175,19 +175,15 @@ let RouteDisplayService = (() => {
175
175
  }
176
176
  getDisplayProperties(props) {
177
177
  const { realityFactor, startPos, endPos } = this.startSettings;
178
+ const parent = super.getDisplayProperties(props);
178
179
  const map = this.getOverlayProps('map', props);
179
180
  const upcomingElevation = this.getOverlayProps('slope', props);
180
181
  const totalElevation = this.getOverlayProps('elevation', props);
181
182
  const nearbyRides = this.getNearbyRidesProps(props);
182
- return {
183
- position: this.position, markers: this.getMarkers(props),
184
- sideViews: this.sideViews,
185
- route: this.getCurrentRoute(),
186
- realityFactor,
183
+ return Object.assign(Object.assign({}, parent), { position: this.position, markers: this.getMarkers(props), sideViews: this.sideViews, route: this.getCurrentRoute(), realityFactor,
187
184
  startPos, endPos,
188
185
  nearbyRides,
189
- map, upcomingElevation, totalElevation
190
- };
186
+ map, upcomingElevation, totalElevation });
191
187
  }
192
188
  getScreenshotInfo(fileName, time) {
193
189
  const { lat, lng, routeDistance, elevation } = this.position;
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ScheduledWorkoutCard = void 0;
4
+ const model_1 = require("../../base/model");
4
5
  const WorkoutCard_1 = require("./WorkoutCard");
5
6
  class ScheduledWorkoutCard extends WorkoutCard_1.WorkoutCard {
6
7
  constructor(event) {
7
8
  var _a;
8
- super(event.workout);
9
+ super(new model_1.Workout(event.workout));
9
10
  this.event = event;
10
11
  (_a = this.event.observer) === null || _a === void 0 ? void 0 : _a.on('updated', this.onUpdate.bind(this));
11
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.5.39",
3
+ "version": "1.5.41",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.26"
6
6
  },
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "axios": "^1.8.2",
45
- "incyclist-devices": "^2.3.31",
45
+ "incyclist-devices": "^2.3.32",
46
46
  "promise.any": "^2.0.6",
47
47
  "semver": "^7.6.3",
48
48
  "tcx-builder": "^1.1.1",