Compare commits

..

No commits in common. "047fd1e3358105fc3b3fb33c73df6cacb3e4fdec" and "45f3b9f19fcfdf026c929a1aa29c832aca43bf43" have entirely different histories.

3 changed files with 42 additions and 2 deletions

View File

@ -189,6 +189,16 @@
<div class="column"> <div class="column">
<div class="box"> <div class="box">
<h2 class="title" data-i18n="heading.knobs">Knobs</h2> <h2 class="title" data-i18n="heading.knobs">Knobs</h2>
<div class="block">
<div class="control">
<button id="ck" class="button is-primary">
CK
</button>
</div>
<div class="" data-i18n="description.ck">
Send <code>CK</code> (check) to the repeater, and play when it comes back.
</div>
</div>
<div class="block"> <div class="block">
<div class="control"> <div class="control">
<button id="reset" class="button" data-i18n="label.reset"> <button id="reset" class="button" data-i18n="label.reset">

View File

@ -106,6 +106,9 @@ export class Vail {
// and how many clients are connected // and how many clients are connected
if (msg.Duration.length == 0) { if (msg.Duration.length == 0) {
this.clockOffset = now - msg.Timestamp this.clockOffset = now - msg.Timestamp
console.log("them:", msg.Timestamp)
console.log(" us:", now)
console.log("Clock offset", this.clockOffset)
this.rx(0, 0, stats) this.rx(0, 0, stats)
return return
} }

View File

@ -54,6 +54,9 @@ class VailClient {
for (let e of document.querySelectorAll("button.maximize")) { for (let e of document.querySelectorAll("button.maximize")) {
e.addEventListener("click", e => this.maximize(e)) e.addEventListener("click", e => this.maximize(e))
} }
for (let e of document.querySelectorAll("#ck")) {
e.addEventListener("click", e => this.check())
}
for (let e of document.querySelectorAll("#reset")) { for (let e of document.querySelectorAll("#reset")) {
e.addEventListener("click", e => this.reset()) e.addEventListener("click", e => this.reset())
} }
@ -62,9 +65,9 @@ class VailClient {
this.inputInit("#keyer-mode", e => this.setKeyer(e.target.value)) this.inputInit("#keyer-mode", e => this.setKeyer(e.target.value))
this.inputInit("#keyer-rate", e => { this.inputInit("#keyer-rate", e => {
let rate = e.target.value let rate = e.target.value
this.ditDuration = Math.round(Minute / rate / 50) this.ditDuration = Minute / rate / 50
for (let e of document.querySelectorAll("[data-fill='keyer-ms']")) { for (let e of document.querySelectorAll("[data-fill='keyer-ms']")) {
e.textContent = this.ditDuration e.textContent = this.ditDuration.toFixed(0)
} }
this.keyer.SetDitDuration(this.ditDuration) this.keyer.SetDitDuration(this.ditDuration)
this.roboKeyer.SetDitDuration(this.ditDuration) this.roboKeyer.SetDitDuration(this.ditDuration)
@ -416,6 +419,30 @@ class VailClient {
console.log(element) console.log(element)
} }
/**
* Send "CK" to server, and don't squelch the echo
*/
check() {
let when = Date.now()
let dit = this.ditDuration
let dah = dit * 3
let s = dit
let message = [
dah, s, dit, s, dah, s, dit,
s * 3,
dah, s, dit, s, dah
]
this.repeater.Transmit(when, 0) // Get round-trip time
for (let i in message) {
let duration = message[i]
if (i % 2 == 0) {
this.repeater.Transmit(when, duration, false)
}
when += duration
}
}
/** Reset to factory defaults */ /** Reset to factory defaults */
reset() { reset() {
localStorage.clear() localStorage.clear()