Skip to content

Commit

Permalink
linting and naming improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
ericjohnson97 committed Nov 19, 2023
1 parent 6224997 commit be3f5dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/components/MiniWidgetInstantiator.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<template v-if="miniWidget.component === MiniWidgetType.AltitudeIndicator">
<AltitudeIndicator :mini-widget="miniWidget" />
<template v-if="miniWidget.component === MiniWidgetType.RelativeAltitudeIndicator">
<RelativeAltitudeIndicator :mini-widget="miniWidget" />
</template>
<template v-if="miniWidget.component === MiniWidgetType.ArmerButton">
<ArmerButton :options="miniWidget" />
Expand Down Expand Up @@ -39,14 +39,14 @@ import { toRefs } from 'vue'
import { type MiniWidget, MiniWidgetType } from '@/types/miniWidgets'
import AltitudeIndicator from './mini-widgets/RelativeAltitudeIndicator.vue'
import ArmerButton from './mini-widgets/ArmerButton.vue'
import BaseCommIndicator from './mini-widgets/BaseCommIndicator.vue'
import BatteryIndicator from './mini-widgets/BatteryIndicator.vue'
import DepthIndicator from './mini-widgets/DepthIndicator.vue'
import JoystickCommIndicator from './mini-widgets/JoystickCommIndicator.vue'
import MiniVideoRecorder from './mini-widgets/MiniVideoRecorder.vue'
import ModeSelector from './mini-widgets/ModeSelector.vue'
import RelativeAltitudeIndicator from './mini-widgets/RelativeAltitudeIndicator.vue'
import SatelliteIndicator from './mini-widgets/SatelliteIndicator.vue'
import VeryGenericIndicator from './mini-widgets/VeryGenericIndicator.vue'
import ViewSelector from './mini-widgets/ViewSelector.vue'
Expand Down
22 changes: 10 additions & 12 deletions src/components/mini-widgets/RelativeAltitudeIndicator.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<template>
<div class="flex items-center w-fit min-w-[8rem] max-w-[9rem] h-12 p-1 text-white justify-center">
<img src="@/assets/altitude-icon.svg" class="h-full" :draggable="false" />
<div class="flex flex-col items-start justify-center ml-1 min-w-[4rem] max-w-[6rem] select-none">
<div>
<span class="font-mono text-xl font-semibold leading-6 w-fit">{{ round(altitude, 2).toFixed(2) }}</span>
<span class="text-xl font-semibold leading-6 w-fit"> m</span>
</div>
<span class="w-full text-sm font-semibold leading-4 whitespace-nowrap">Alt (Rel)</span>
</div>
<div class="flex items-center w-fit min-w-[8rem] max-w-[9rem] h-12 p-1 text-white justify-center">
<img src="@/assets/altitude-icon.svg" class="h-full" :draggable="false" />
<div class="flex flex-col items-start justify-center ml-1 min-w-[4rem] max-w-[6rem] select-none">
<div>
<span class="font-mono text-xl font-semibold leading-6 w-fit">{{ round(altitude, 2).toFixed(2) }}</span>
<span class="text-xl font-semibold leading-6 w-fit"> m</span>
</div>
<span class="w-full text-sm font-semibold leading-4 whitespace-nowrap">Alt (Rel)</span>
</div>
</div>
</template>

<script setup lang="ts">
import { ref, watch } from 'vue'
Expand All @@ -21,6 +21,4 @@ const store = useMainVehicleStore()
const altitude = ref(0)
watch(store.altitude, () => (altitude.value = store.altitude.rel))
</script>

2 changes: 1 addition & 1 deletion src/libs/vehicle/ardupilot/ardupilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type ArduPilot = ArduPilotVehicle<any>
* Generic ArduPilot vehicle
*/
export abstract class ArduPilotVehicle<Modes> extends Vehicle.AbstractVehicle<Modes> {
_altitude = new Altitude({ msl: 0, rel: 0})
_altitude = new Altitude({ msl: 0, rel: 0 })
_attitude = new Attitude({ roll: 0, pitch: 0, yaw: 0 })
_communicationDropRate = 0
_communicationErrors = 0
Expand Down

0 comments on commit be3f5dc

Please sign in to comment.