Skip to content

Commit

Permalink
Callsign / frequency selection events.
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrTopa committed Jul 18, 2022
1 parent 092d403 commit 415f32b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion webapp/chat-rx-header-icons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
<span class="gauges">
<span class="gauge freq"><a class="btn btn-light btn-sm" href="#" @click="$emit('frequencySelected', message.Freq)"><i class="bi bi-broadcast-pin"></i> {{ message.Offset }}Hz</a></span>
<span class="gauge snr"><i class="bi bi-speedometer2"></i><span :style="'color: ' + snrColor(message.Snr)">{{ message.Snr > 0 ? '+' : '' }} {{ message.Snr }}</span></span>
<span class="gauge speed"><i class="bi bi-skip-end"></i><span :class="message.Speed"> {{ message.Speed[0].toUpperCase() }}</span></span>
<span class="gauge speed" v-if="message.Speed"><i class="bi bi-skip-end"></i><span :class="message.Speed"> {{ message.Speed[0].toUpperCase() }}</span></span>
<span class="gauge timedritft"><i class="bi bi-stopwatch"></i> {{ message.TimeDrift > 0 ? '+' : '' }}{{ message.TimeDrift }}ms</span>
</span>
`
Expand Down
24 changes: 22 additions & 2 deletions webapp/chat-window.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,31 @@ export default {
closeTab(id) {
this.chats = this.chats.filter(e => e.id != id)
},
newTab(label, filter) {
const id = uidGenerator()
this.chats.push({
id,
label,
filter
})
},
callsignSelected(callsign) {
console.log('callsign-select', callsign)
this.newTab(callsign, {
Callsign: callsign
})
},
frequencySelected(frequency) {
console.log('frequency-selected', frequency)
const from = Math.floor((frequency - 25) / 50) * 50
const to = from + 50
this.newTab(
from + 'Hz',
{
Freq: {
From: from,
To: to
}
}
)
},
},
template: `
Expand Down

0 comments on commit 415f32b

Please sign in to comment.