mirror of https://github.com/nealey/vail.git
Compare commits
No commits in common. "047fd1e3358105fc3b3fb33c73df6cacb3e4fdec" and "45f3b9f19fcfdf026c929a1aa29c832aca43bf43" have entirely different histories.
047fd1e335
...
45f3b9f19f
|
@ -189,6 +189,16 @@
|
|||
<div class="column">
|
||||
<div class="box">
|
||||
<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="control">
|
||||
<button id="reset" class="button" data-i18n="label.reset">
|
||||
|
|
|
@ -106,6 +106,9 @@ export class Vail {
|
|||
// and how many clients are connected
|
||||
if (msg.Duration.length == 0) {
|
||||
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)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -54,6 +54,9 @@ class VailClient {
|
|||
for (let e of document.querySelectorAll("button.maximize")) {
|
||||
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")) {
|
||||
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-rate", e => {
|
||||
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']")) {
|
||||
e.textContent = this.ditDuration
|
||||
e.textContent = this.ditDuration.toFixed(0)
|
||||
}
|
||||
this.keyer.SetDitDuration(this.ditDuration)
|
||||
this.roboKeyer.SetDitDuration(this.ditDuration)
|
||||
|
@ -416,6 +419,30 @@ class VailClient {
|
|||
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() {
|
||||
localStorage.clear()
|
||||
|
|
Loading…
Reference in New Issue