1
function ADEI(sidebar_id, menu_id, session_id) {
2
this.config = new CONFIG;
3
this.module = new MODULE(null, configSetupModule, this.config);
4
this.popup = new POPUP(Geometry, null);
6
this.updater = new UPDATER(this.config, this.module, this.popup);
8
if (menu_id) this.menu = new MENU(this.config, this.updater, menu_id);
12
this.source_interval = null;
13
this.source_window = null;
15
this.data_export = null;
20
this.cfg = new Object({
23
'subsecond_threshold': 0,
28
if (typeof session_id == "undefined")
29
this.adei_session = Math.floor(Math.random() * 4294967295);
31
this.adei_session = session_id;
33
this.AddToQuery('adei_session=' + session_id);
35
this.sidebar_node = document.getElementById(sidebar_id);
39
Ext.EventManager.addListener(document, "keyup", this.keyUp, this);
40
Ext.EventManager.addListener(document, "keydown", this.keyDown, this);
41
Ext.EventManager.addListener(document, "keypress", this.keyPress, this);
46
ADEI.prototype.keyPress = function(ev) {
50
ADEI.prototype.keyUp = function(ev) {
55
ADEI.prototype.keyDown = function(ev) {
56
this.key = ev.getKey();
61
ADEI.prototype.SetOptions = function(opts) {
65
ADEI.prototype.SetProperty = function(name, val) {
69
ADEI.prototype.AddToQuery = function(props) {
70
if (this.cfg['query']) this.cfg['query'] += '&' + props;
71
else this.cfg['query'] = props;
74
ADEI.prototype.RegisterModule = function(mod, mod_class) {
75
this.module.Register(mod, mod_class);
78
ADEI.prototype.AttachSourceModule = function(source, ivl, wnd) {
80
this.source_interval = ivl;
81
this.source_window = wnd;
83
source.AttachConfig(this.config);
84
source.Init(this.updater, this.options);
86
if (this.menu) this.menu.AttachWindow(wnd);
89
ADEI.prototype.AttachExportModule = function(data_export) {
90
this.data_export = data_export;
92
data_export.AttachConfig(this.config);
95
if (this.menu) this.menu.AttachExporter(data_export);
98
ADEI.prototype.AttachGraphModule = function(graph) {
101
graph.AttachConfig(this.config);
102
graph.AttachWindow(this.source_window);
103
graph.AttachExporter(this.data_export);
106
ADEI.prototype.Start = function(mod, update_rate) {
107
this.module.Open(mod);
109
this.updater.Start(update_rate);
112
ADEI.prototype.OpenModule = function(mod) {
113
this.module.Open(mod);
116
ADEI.prototype.SwitchPopup = function(mod) {
117
this.popup.Switch(mod);
120
ADEI.prototype.UpdateModuleGeometry = function(mod, width, height) {
121
var m = this.module.GetModule(mod);
122
if ((m)&&(typeof m.AdjustGeometry != "undefined"))
123
m.AdjustGeometry(width - this.sidebar_node.offsetWidth, height);
126
ADEI.prototype.GetURL = function(page, props) {
127
if (this.cfg.query) {
128
if (props) return page + "?" + this.cfg.query + "&" + props;
129
return page + "?" + this.cfg.query;
131
if (props) return page + "?" + props;
136
ADEI.prototype.GetServiceURL = function(name, props) {
137
return this.GetURL("services/" + name + ".php", props);
140
ADEI.prototype.GetService = function(name, props) {
141
return this.GetServiceURL(name, props);