Refine pilot monitoring communication flow

This commit is contained in:
Remi
2025-09-16 15:48:00 +02:00
parent 329bb5dec5
commit d69c01e97a
3 changed files with 400 additions and 167 deletions

View File

@@ -472,6 +472,10 @@ export default function useCommunicationsEngine() {
communicationLog.value.push(entry)
}
function renderATCMessage(tpl: string) {
return renderTpl(tpl, exposeCtx())
}
function exposeCtx() {
return { variables: variables.value, flags: flags.value }
}
@@ -490,6 +494,12 @@ export default function useCommunicationsEngine() {
return flags.value.current_unit
}
function getStateDetails(stateId: string) {
const s = states.value[stateId]
if (!s) return null
return { ...s, id: stateId }
}
function genStand() {
const arr = ['A12','B15','C23','D8','E41','F18','G7','H33']
return arr[Math.floor(Math.random() * arr.length)]
@@ -568,6 +578,8 @@ export default function useCommunicationsEngine() {
resumePriorFlow,
// Utilities
normalizeATCText
normalizeATCText,
renderATCMessage,
getStateDetails
}
}