mirror of
https://codeberg.org/portospaceteam/ground-dashboard.git
synced 2025-07-29 18:49:59 +01:00
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
const modeMap = {
|
|
"WT": "Waiting for Launch",
|
|
"LD": "Launch Detected",
|
|
"LV": "Low velocity Detected",
|
|
"AP": "Nose-Over",
|
|
"DR": "Drogue Fired",
|
|
"MN": "Main Fired",
|
|
"FS": "Failsafe Triggered ",
|
|
"TD": "Landing Detected"
|
|
}
|
|
|
|
class MissionInfoWidget extends Widget {
|
|
update(data) {
|
|
const extractedData = this.extractor(data)
|
|
this.time.textContent = formatSeconds(extractedData.time)
|
|
this.mode.textContent = modeMap[extractedData.mode]
|
|
this.mode.className = ['mission-info-mode', 'mission-info-mode-' + extractedData.mode.toLowerCase()].join(' ')
|
|
}
|
|
|
|
initDOM() {
|
|
const container = document.createElement('div')
|
|
container.className = 'mission-info-container'
|
|
|
|
this.time = document.createElement('div')
|
|
this.time.className = 'mission-info-time'
|
|
container.appendChild(this.time)
|
|
|
|
this.mode = document.createElement('div')
|
|
this.mode.className = 'mission-info-mode'
|
|
container.appendChild(this.mode)
|
|
|
|
return container
|
|
}
|
|
|
|
initContent() {
|
|
|
|
}
|
|
}
|