mirror of https://github.com/nealey/vail.git
Compare commits
2 Commits
45f3b9f19f
...
047fd1e335
Author | SHA1 | Date |
---|---|---|
Neale Pickett | 047fd1e335 | |
Neale Pickett | 45c79230c2 |
|
@ -189,16 +189,6 @@
|
|||
<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,9 +106,6 @@ 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,9 +54,6 @@ 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())
|
||||
}
|
||||
|
@ -65,9 +62,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 = Minute / rate / 50
|
||||
this.ditDuration = Math.round(Minute / rate / 50)
|
||||
for (let e of document.querySelectorAll("[data-fill='keyer-ms']")) {
|
||||
e.textContent = this.ditDuration.toFixed(0)
|
||||
e.textContent = this.ditDuration
|
||||
}
|
||||
this.keyer.SetDitDuration(this.ditDuration)
|
||||
this.roboKeyer.SetDitDuration(this.ditDuration)
|
||||
|
@ -419,30 +416,6 @@ 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