Final preparations for open source roll-out

This commit is contained in:
Jeff Parsons 2014-10-12 00:08:15 -07:00 • committed by jeffpar
commit 60669365f9
40 changed files with 2814 additions and 2639 deletions

View file

@ -270,6 +270,29 @@ C1PComputer.init = function()
var component;
var modules = {};
/*
* Let's see if the Control Panel is installed (NOTE: its ID must be "panel", and only one per machine is supported);
* the Panel needs our setPower() notifications, and this relieves us from having an explicit <module> entry for type="panel".
*/
var panel = Component.getComponentByID('panel', parmsComputer['id']);
if (panel) {
modules['panel'] = [panel];
/*
* Iterate through all the other components and update their print methods if the Control Panel has provided overrides.
*/
if (panel.controlPrint) {
var aComponents = Component.getComponents(parmsComputer['id']);
for (var iComponent = 0; iComponent < aComponents.length; iComponent++) {
component = aComponents[iComponent];
if (component == panel) continue;
component.notice = panel.notice;
component.println = panel.println;
component.controlPrint = panel.controlPrint;
}
}
}
var abMemory;
var addrStart = 0, addrEnd = 0;
@ -326,15 +349,6 @@ C1PComputer.init = function()
}
}
/*
* Let's see if the Control Panel is installed (NOTE: its ID must be "panel", and only one per machine is supported);
* the Panel needs our setPower() notifications, and this relieves us from having an explicit <module> entry for type="panel".
*/
component = Component.getComponentByID('panel', parmsComputer['id']);
if (component) {
modules['panel'] = [component];
}
var computer = new C1PComputer(parmsComputer, modules);
/*
* We may eventually add a "Power" button, but for now, all we have is a "Reset" button