-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Testing (not working yet) * Replaced API by local calculation/airport db * Replaced manual selection with menu integration * Updated combined MET window #4 * Tweaked display of times, added "Separate VFR" * Sun-met: updated window size and avbl "full"/"sun" windows * Removed duplicate "sun" window entries * "ALL" renamed "FULL" * ATIS Initial implementation #61 * ATIS: Remedy line break that kaput data extraction * Update package-lock.json * ATIS added conditions and blueflash #61 - Added support for extracting wx conditions (precipitation, obscuration etc) - Added support for blueflash (toggleable in settings) - Toggleable local ATIS input (in settings) * ATIS separating ARR/DEP for ESSA #61 * Fix build * Fixotrix ATIS view, remove gazillions of airports in airports.csv etc * Implement combined metreport with auto source switching * More metreport stuff, differing rwys, wx qnh trend in store, etc * Implement qnh trends, updates, TAF in full view, etc etc * Rename 'full' to 'airport' --------- Co-authored-by: Max Larsson Kuhla <[email protected]>
- Loading branch information
1 parent
2c0be0d
commit 5196334
Showing
28 changed files
with
1,722 additions
and
198 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<div class="full-component"> | ||
<Sun :id="props.id" /> | ||
<hr class="component-divider"> | ||
<Metreport :id="props.id" /> | ||
<hr v-if="tafAvailable" class="component-divider"> | ||
<Taf v-if="tafAvailable" :id="props.id" /> | ||
<hr class="component-divider"> | ||
<Metsensor :id="props.id" /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import Sun from "@/components/met/Sun.vue" | ||
import Metreport from "@/components/met/Metreport.vue" | ||
import Taf from "@/components/met/Taf.vue" | ||
import Metsensor from "@/components/met/MetsensorWX.vue" | ||
import { tafAirports } from "@/metcommon" | ||
import { computed } from "vue" | ||
const props = defineProps<{ id: string }>() | ||
const tafAvailable = computed(() => tafAirports.includes(props.id)) | ||
</script> | ||
|
||
<style scoped> | ||
.component-divider { | ||
width: 100%; | ||
border: none; | ||
border-top: 2px solid #808080; | ||
margin-top: 5px; | ||
margin-bottom: 5px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<template> | ||
<div class="float-right text-caption"> | ||
<a | ||
title="Source: METAR" | ||
class="mx-1 font-weight-bold" | ||
@click="source = 'metar'" | ||
:style="{ color: source == 'metar' ? '#444' : '#999' }" | ||
>M</a | ||
> | ||
<a | ||
v-if="awosAvailable" | ||
title="Source: WX.AWOS.SE" | ||
class="mx-1 font-weight-bold" | ||
@click="source = 'awos'" | ||
:style="{ color: source == 'awos' ? '#444' : '#999' }" | ||
>W</a | ||
> | ||
<a | ||
v-if="atisAvailable" | ||
title="Source: ATIS" | ||
class="mx-1 font-weight-bold" | ||
@click="source = 'atis'" | ||
:style="{ color: source == 'atis' ? '#444' : '#999' }" | ||
>A</a | ||
> | ||
</div> | ||
<MetreportMETAR v-if="source == 'metar'" :id="id" /> | ||
<MetreportWX v-else-if="awosAvailable && source == 'awos'" :id="id" :type="type" /> | ||
<MetreportATIS v-else-if="atisAvailable && source == 'atis'" :id="id" :type="type" /> | ||
<div class="pa-1" v-else>Source is what now??</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed, onMounted, onUnmounted, ref, watch } from "vue" | ||
import MetreportMETAR from "./MetreportMETAR.vue" | ||
import MetreportWX from "./MetreportWX.vue" | ||
import MetreportATIS from "./MetreportATIS.vue" | ||
import { useWxStore } from "@/stores/wx" | ||
import { useMetarStore } from "@/stores/metar" | ||
import { useVatsimStore } from "@/stores/vatsim" | ||
import { wxAirports, atisAirports } from "@/metcommon" | ||
const props = defineProps<{ id: string; type?: "ARR" | "DEP" }>() | ||
const wx = useWxStore() | ||
const metar = useMetarStore() | ||
const vatsim = useVatsimStore() | ||
const source = ref("metar") | ||
const awosAvailable = computed(() => | ||
wxAirports.includes(props.id) && | ||
(wx.metreport(props.id) || wx.info(props.id) || wx.metar(props.id)) | ||
? true | ||
: false, | ||
) | ||
const atisAvailable = computed(() => | ||
atisAirports.includes(props.id) && | ||
vatsim.data && | ||
vatsim.data.atis && | ||
vatsim.data.atis.find( | ||
(a) => | ||
a.callsign.startsWith( | ||
props.id + | ||
(props.type == "ARR" ? "_A_ATIS" : props.type == "DEP" ? "_D_ATIS" : "_ATIS"), | ||
) && | ||
a.text_atis && | ||
a.text_atis.length > 0, | ||
) | ||
? true | ||
: false, | ||
) | ||
let wxSubscription = "" | ||
let metarSubscription = "" | ||
onMounted(() => { | ||
wxSubscription = wx.subscribe(props.id) | ||
metarSubscription = metar.subscribe(props.id) | ||
source.value = atisAvailable.value ? "atis" : awosAvailable.value ? "awos" : "metar" | ||
}) | ||
onUnmounted(() => { | ||
if (wxSubscription) wx.unsubscribe(wxSubscription) | ||
if (metarSubscription) metar.unsubscribe(metarSubscription) | ||
}) | ||
watch([awosAvailable, atisAvailable], (newValues, oldValues) => { | ||
let changed = false | ||
for (let i = 0; i < newValues.length; i++) { | ||
if (newValues[i] != oldValues[i]) changed = true | ||
} | ||
if (changed) { | ||
if (atisAvailable.value) source.value = "atis" | ||
else if (awosAvailable.value) source.value = "awos" | ||
else source.value = "metar" | ||
} | ||
}) | ||
</script> |
Oops, something went wrong.