Indicate when a repeater is local-only

This commit is contained in:
Neale Pickett 2021-04-28 10:17:23 -06:00
parent c64708fa05
commit f50540aefe
5 changed files with 27 additions and 4 deletions

View File

@ -89,6 +89,7 @@
</div> </div>
</h2> </h2>
</div> </div>
<output id="note"></output>
<div class="mdl-tabs mdl-js-tabs mdl-js-ripple-effect"> <div class="mdl-tabs mdl-js-tabs mdl-js-ripple-effect">
<div class="mdl-tabs__tab-bar"> <div class="mdl-tabs__tab-bar">
<a href="#straight" class="mdl-tabs__tab is-active">Straight Key</a> <a href="#straight" class="mdl-tabs__tab is-active">Straight Key</a>
@ -325,6 +326,7 @@
<span>Over -.-</span> <span>Over -.-</span>
<span>Correction ........</span> <span>Correction ........</span>
<span>? / Say Again ..--..</span> <span>? / Say Again ..--..</span>
<span>Speak Slower --.- .-. ...</span>
</div> </div>
</div> </div>
</div> </div>
@ -429,7 +431,15 @@
I also didn't have a lot of money to spend on equipment, but I did have a computer, phone, and gamepad. I also didn't have a lot of money to spend on equipment, but I did have a computer, phone, and gamepad.
Nothing else like this exists on the Internet, as far as I can tell. Nothing else like this exists on the Internet, as far as I can tell.
</p> </p>
<h3 class="mdl-card__title-text">What does "local" mean next to the repeater name?</h3>
<p>
It means this repeater doesn't repeat anything:
nothing you key in will be sent anywhere.
These are to help people practice and learn,
without worrying about anyone else hearing them fumble around.
</p>
<h3 class="mdl-card__title-text">Why do I hear a low tone?</h3> <h3 class="mdl-card__title-text">Why do I hear a low tone?</h3>
<p> <p>
This is the "drop tone", and will be accompanied by an error. This is the "drop tone", and will be accompanied by an error.

View File

@ -141,6 +141,9 @@ export class Fortune {
let fortune = GetFortune() let fortune = GetFortune()
this.keyer.EnqueueAsciiString(`${fortune}\x04 `) this.keyer.EnqueueAsciiString(`${fortune}\x04 `)
this.rx(0, 0, {
note: "local",
})
} }
Transmit(time, duration, squelch=true) { Transmit(time, duration, squelch=true) {

View File

@ -17,7 +17,7 @@ function install(event) {
self.addEventListener("fetch", e => cacheFetch(e)) self.addEventListener("fetch", e => cacheFetch(e))
function cacheFetch(event) { function cacheFetch(event) {
let fetchInit = {} let fetchInit = {}
if (event.request.match(/(css|js|html)$/)) { if (event.request.url.match(/\.(css|mjs|js|html)$/)) {
fetchInit.cache = "no-cache" fetchInit.cache = "no-cache"
} }
event.respondWith( event.respondWith(

View File

@ -109,6 +109,14 @@ img {
background-color: orange; background-color: orange;
} }
#note {
position: absolute;
top: 0.5em;
right: 5em;
font-size: 80%;
color: #888;
}
.input-methods td { .input-methods td {
text-align: left; text-align: left;
} }

View File

@ -26,7 +26,7 @@ class VailClient {
this.sent = [] this.sent = []
this.lagTimes = [0] this.lagTimes = [0]
this.rxDurations = [0] this.rxDurations = [0]
this.clockOffset = "unknown" // How badly our clock is off of the server's this.clockOffset = null // How badly our clock is off of the server's
this.rxDelay = 0 // Milliseconds to add to incoming timestamps this.rxDelay = 0 // Milliseconds to add to incoming timestamps
this.beginTxTime = null // Time when we began transmitting this.beginTxTime = null // Time when we began transmitting
this.debug = localStorage.debug this.debug = localStorage.debug
@ -192,9 +192,10 @@ class VailClient {
* @param {dict} stats Stuff the repeater class would like us to know about * @param {dict} stats Stuff the repeater class would like us to know about
*/ */
receive(when, duration, stats) { receive(when, duration, stats) {
this.clockOffset = stats.clockOffset || "unknown" this.clockOffset = stats.clockOffset || "?"
let now = Date.now() let now = Date.now()
when += this.rxDelay when += this.rxDelay
console.log(stats)
if (duration > 0) { if (duration > 0) {
if (when < now) { if (when < now) {
@ -212,6 +213,7 @@ class VailClient {
let longestRxDuration = this.rxDurations.reduce((a,b) => Math.max(a,b)) let longestRxDuration = this.rxDurations.reduce((a,b) => Math.max(a,b))
let suggestedDelay = ((averageLag + longestRxDuration) * 1.2).toFixed(0) let suggestedDelay = ((averageLag + longestRxDuration) * 1.2).toFixed(0)
this.updateReading("#note", stats.note || "")
this.updateReading("#lag-value", averageLag) this.updateReading("#lag-value", averageLag)
this.updateReading("#longest-rx-value", longestRxDuration) this.updateReading("#longest-rx-value", longestRxDuration)
this.updateReading("#suggested-delay-value", suggestedDelay) this.updateReading("#suggested-delay-value", suggestedDelay)