Skip to content

Commit

Permalink
Merge pull request #118 from istnv/wip/scope
Browse files Browse the repository at this point in the history
More feedback fix/cleanup
  • Loading branch information
istnv authored Mar 12, 2024
2 parents d51dfc3 + 5aee84b commit dd212a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "figure53-qlab-advance",
"version": "2.6.1",
"version": "2.6.2",
"main": "qlabfb.js",
"type": "module",
"scripts": {
Expand Down
16 changes: 7 additions & 9 deletions qlabfb.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class QLabInstance extends InstanceBase {
'"isBroken","continueMode","percentActionElapsed","cartPosition","infiniteLoop","holdLastFrame"]',
},
]
fb2check = ['q_run', 'qid_run', 'any_run', 'q_armed','qid_armed', 'q_bg', 'qid_bg']

constructor(internal) {
super(internal)
Expand Down Expand Up @@ -232,7 +233,7 @@ class QLabInstance extends InstanceBase {
variableValues[vId] = q.qName
variableDefs.push({ variableId: vId, name: `Name of cue ID ${qID}` })

this.checkFeedbacks('q_bg', 'qid_bg')
this.checkFeedbacks(this.fb2check)
}

if (this.exposeVariables) {
Expand Down Expand Up @@ -509,8 +510,7 @@ class QLabInstance extends InstanceBase {

if (Object.keys(this.requestedCues).length > 0) {
let variableValues = {}
const checkFeedbacks = new Set()

const checkFeedbacks = []
const timeOut = now - 500
for (let k in this.requestedCues) {
if (this.requestedCues[k] < timeOut) {
Expand All @@ -527,16 +527,15 @@ class QLabInstance extends InstanceBase {
variableValues['q_' + qNum + '_name'] = undefined
}
variableValues['id_' + cueObj.uniqueID + '_name'] = undefined
checkFeedbacks.add('q_bg')
checkFeedbacks.add('qid_bg')
checkFeedbacks.push(...this.fb2check)
}
delete this.requestedCues[k]
}
}

this.setVariableValues(variableValues)
if (checkFeedbacks.size > 0) {
this.checkFeedbacks(...Array.from(checkFeedbacks))
this.checkFeedbacks(...checkFeedbacks)
}
}

Expand Down Expand Up @@ -725,7 +724,6 @@ class QLabInstance extends InstanceBase {
'memo',
'script',
]
const fb2check = ['q_run', 'qid_run', 'any_run', 'q_armed','qid_armed', 'q_bg', 'qid_bg']
let q = {}

if (Array.isArray(jCue)) {
Expand Down Expand Up @@ -765,7 +763,7 @@ class QLabInstance extends InstanceBase {
}
delete this.requestedCues[q.uniqueID]
}
this.checkFeedbacks(...fb2check)
this.checkFeedbacks(...this.fb2check)
if (dupIds) {
this.updateStatus(InstanceStatus.UnknownWarning, 'Multiple cues\nwith the same cue_id')
}
Expand All @@ -789,7 +787,7 @@ class QLabInstance extends InstanceBase {
}
}
}
this.checkFeedbacks(...fb2check)
this.checkFeedbacks(...this.fb2check)
this.updatePlaying()
if (
'' == this.cl ||
Expand Down

0 comments on commit dd212a1

Please sign in to comment.