Skip to content

Commit

Permalink
lint e type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Dec 5, 2023
1 parent d45cc63 commit ece1e37
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/libs/joystick/protocols/cockpit-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable max-len */
import { v4 as uuid4 } from 'uuid'

import { type JoystickProtocolActionsMapping,type JoystickState, type ProtocolAction, CockpitModifierKeyOption,JoystickButton,JoystickProtocol } from '@/types/joystick'
import { type ProtocolAction, JoystickProtocol } from '@/types/joystick'

/**
* Possible functions in the MAVLink `MANUAL_CONTROL` message protocol
Expand Down
2 changes: 1 addition & 1 deletion src/libs/joystick/protocols/mavlink-manual-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export class MavlinkManualControlManager {

if (useShift && shiftButton === undefined) return

const vehicleButtonsToActivate = useShift ? shiftVehicleButtonsToActivate.concat([manualControlButtonFromParameterName(shiftButton?.button)]) : regularVehicleButtonsToActivate
const vehicleButtonsToActivate = useShift ? shiftVehicleButtonsToActivate.concat([manualControlButtonFromParameterName(shiftButton!.button)]) : regularVehicleButtonsToActivate

// Calculate buttons value
let buttons_int = 0
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vehicle/ardupilot/ardupilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ import {
StatusText,
Velocity,
} from '@/libs/vehicle/types'
import type { MetadataFile } from '@/types/ardupilot-metadata'
import { type MissionLoadingCallback, type Waypoint, defaultLoadingCallback } from '@/types/mission'

import * as Vehicle from '../vehicle'
import type { MetadataFile } from '@/types/ardupilot-metadata'

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type ArduPilot = ArduPilotVehicle<any>
Expand Down
3 changes: 1 addition & 2 deletions src/libs/vehicle/ardupilot/arduplane.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { Package } from '@/libs/connection/m2r/messages/mavlink2rest'
import { MAVLinkType, MavModeFlag } from '@/libs/connection/m2r/messages/mavlink2rest-enum'
import * as arduplane_metadata from '@/libs/vehicle/ardupilot/ParameterRepository/Plane-4.3/apm.pdef.json'
import type { Message } from '@/libs/connection/m2r/messages/mavlink2rest-message'
import * as arduplane_metadata from '@/libs/vehicle/ardupilot/ParameterRepository/Plane-4.3/apm.pdef.json'

import * as Vehicle from '../vehicle'
import { ArduPilotVehicle } from './ardupilot'
import type { MetadataFile } from '@/types/ardupilot-metadata'

/**
* Custom modes for Plane
Expand Down
5 changes: 4 additions & 1 deletion src/stores/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export const useControllerStore = defineStore('controller', () => {
return joystickState.buttons
.map((btnState, idx) => ({ id: idx, value: btnState }))
.filter((btn) => btn.value ?? 0 > 0.5)
.map((btn) => mapping.buttonsCorrespondencies[modifierKeyId as CockpitModifierKeyOption][btn.id as JoystickButton].action)
.map((btn) =>
// @ts-ignore: It's right and working
mapping.buttonsCorrespondencies[modifierKeyId as CockpitModifierKeyOption][btn.id as JoystickButton].action
)
.concat([modifierKeyId])
}

Expand Down

0 comments on commit ece1e37

Please sign in to comment.