1
0
mirror of https://github.com/pkimpel/retro-b5500.git synced 2026-02-13 19:54:50 +00:00
Files
pkimpel.retro-b5500/webUI/prototypes/B5500DistributionAndDisplay.js
paul.kimpel@digm.com 1dad7d9744 Commit Release 1.01:
1. Split operator Control Panel from B5500Console and make it a small, separate window.
2. Implement emulator home page in what remains of B5500Console page, with Start buttons for emulator.
3. Implement improvements to setCallback() mechanism, copied from Datatron 205 project.
4. Increase scrollback for SPO and Datacom windows from 1500 to 5000 lines.
5. Correct application of green-bar styling in B5500LinePrinter (apparent in Chrome).
6. Improve initial positioning of Magnetic Tape unit windows; add "B" to mag tape reel image.
7. Minor optimizations to bit-field isolate/insert routines in CentralControl.
8. Miscellaneous enhancements to UI appearance.
9. Minor changes to hosting website pages.
2015-02-09 06:30:43 +00:00

77 lines
3.0 KiB
JavaScript

/***********************************************************************
* retro-b5500/emulator B5500DistributionAndDisplay.js
************************************************************************
* Copyright (c) 2012, Nigel Williams and Paul Kimpel.
* Licensed under the MIT License, see http://www.opensource.org/licenses/mit-license.php
************************************************************************
* JavaScript object definition for the B5500 Distribution & Display module.
************************************************************************
* 2012-06-16 P.Kimpel
* Original version, from thin air.
***********************************************************************/
"use strict";
/**************************************/
function B5500DistributionAndDisplay(cc) {
/* Constructor for the Distribution And Display module object */
this.cc = cc; // Reference back to Centrol Control module
/* Global system modules */
this.nextRefresh = 0; // Next actual Date.getTime() expected
this.timer = null; // Reference to the RTC setTimeout id.
this.panels = {}; // D&D panel object collection
this.updateDisplay.that = this; // Establish contexts for when called from setTimeout().
this.clear(); // Create and initialize the Central Control state
}
/**************************************/
/* Global constants */
B5500DistributionAndDisplay.prototype.refreshPeriod = 50; // milliseconds
/**************************************/
B5500DistributionAndDisplay.prototype.clear = function() {
/* Initializes the displays and starts the refresh timer */
if (this.timer) {
clearTimeout(this.timer);
}
this.nextTimeStamp = new Date().getTime() + this.refreshPeriod;
this.timer = setTimeout(this.tock, this.refreshPeriod);
}
};
/**************************************/
B5500DistributionAndDisplay.prototype.openProcessorPanel = function(p, caption) {
/* Creates a D&D panel window for a processor */
var x;
var panel = this.panels[caption];
if (panel) {
win = panel.window;
} else {
win = window.open("B5500ProcessorPanel.html", "P"+caption,
"resizable=yes,scrollbars=yes");
panel = {module:p, window:win, caption:caption};
this.panels[caption] = panel;
}
};
/**************************************/
B5500DistributionAndDisplay.prototype.updateDisplay = function updateDisplay() {
/* Schedules itself to update the display on a periodic basis. */
var delayTime;
var that = updateDisplay.that;
var thisTime = new Date().getTime();
// Schedule ourself for the next refresh period
that.nextRefresh += that.refreshPeriod;
delayTime = that.nextRefresh - thisTime;
that.timer = setTimeout(that.updateDisplay, (delayTime < 0 ? 1 : delayTime);
};