Prevent new scripts from interrupting scripts in progress

This commit is contained in:
Jeff Parsons 2017-02-08 09:25:09 -08:00 • committed by Jeff Parsons
commit d23ae82679
13 changed files with 1864 additions and 1423 deletions

View file

@ -1100,17 +1100,6 @@ class PanelPDP11 extends Component {
}
}
/**
* hasSRSwitches(value)
*
* @this {PanelPDP11}
* @return {boolean}
*/
hasSRSwitches()
{
return this.bindings[PanelPDP11.SWITCH.S0] !== undefined;
}
/**
* setSRSwitches(value)
*
@ -1120,18 +1109,15 @@ class PanelPDP11 extends Component {
*/
setSRSwitches(value)
{
if (this.hasSRSwitches() && !isNaN(value)) {
this.regSwitches = value | 0;
for (var i = 0; i < 22; i++) {
this.switches['S'+i][1] = (this.regSwitches & (1 << i))? 1 : 0;
}
/*
* This (re)displays ALL switches, not merely the SR switches, but that's OK.
*/
this.displaySwitches();
return true;
this.regSwitches = value | 0;
for (var i = 0; i < 22; i++) {
this.switches['S'+i][1] = (this.regSwitches & (1 << i))? 1 : 0;
}
return false;
/*
* This (re)displays ALL switches, not merely the SR switches, but that's OK.
*/
this.displaySwitches();
return true;
}
/**
@ -1326,7 +1312,6 @@ PanelPDP11.ADDRSEL = {
* "step" behavior when pressed more than once in a row). Ditto for the LED table.
*/
PanelPDP11.SWITCH = {
S0: 'S0',
DEP: 'DEP',
ENABLE: 'ENABLE',
EXAM: 'EXAM',