Skip to content

Commit

Permalink
wipe log and do not start on just button press.
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzsche committed Nov 23, 2024
1 parent d1484f3 commit 656e20b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
23 changes: 18 additions & 5 deletions log.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ export class Log {
constructor() {
this.data = []
this.NR = 1
this.Calls = new Set()
this.Prefix = new Set()
this.ConfCalls = new Set()
this.ConfPrefix = new Set()
this.initScoreSets()
/*
this.addQso({
UTC: '00:00:00',
Expand All @@ -27,10 +24,26 @@ export class Log {
this.ConfPrefix.add('XX1')
this.ConfPrefix.add('XX3')
this.ConfPrefix.add('X3')
this.updateScore()
this.updateScore(
*/
}

initScoreSets() {
this.Calls = new Set()
this.Prefix = new Set()
this.ConfCalls = new Set()
this.ConfPrefix = new Set()
}

wipe() {
this.data = []
let table = document.querySelector('#log table')
let row_no = table.rows.length
for (let i = 1; i < row_no; i++) table.deleteRow(1)
this.initScoreSets()
this.updateScore()
}

addQso(qso) {
let complete_qso = qso

Expand Down
14 changes: 3 additions & 11 deletions view.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ export class View {
})

document.getElementById('input').addEventListener("keydown", (e) => {
this.startContest()
if (!this.running) return
//this.startContest()
if (this.call.value.toUpperCase() !== this.prev_call) {
this.prev_call = ''
this.CallSend = false
Expand Down Expand Up @@ -252,6 +253,7 @@ export class View {
this.hideTitle()
this.running = true
this.wipeFields()
this.log.wipe()
this.toggleRunButton()
//if (!this.ctx)
this.ctx = new (window.AudioContext || window.webkitAudioContext)({ sampleRate: DEFAULT.RATE })
Expand Down Expand Up @@ -346,16 +348,6 @@ export class View {
this._config = new Config( (conf) => { this.updateConf(conf) })
this._config.update_dom()
const input = document.querySelector("#volume")
/* input.addEventListener("input", (event) => {
let config = {
volume: event.target.value
}
if (this.running)
this.sendMessage({
type: AudioMessage.config,
data: config
})
});*/
}

onLoad() {
Expand Down

0 comments on commit 656e20b

Please sign in to comment.