forked from vtwireless/HLSI
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestAll.html
135 lines (96 loc) · 2.94 KB
/
testAll.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Testing Modules</title>
<meta charset="UTF-8"/>
<link rel=stylesheet type=text/css href=hlsi.css>
<link rel=stylesheet type=text/css href=codemirror.min.css />
<link rel=stylesheet type=text/css href=blackboard.min.css />
<script src=codemirror.min.js></script>
<script src=codeMirror_javascript.js></script>
<script src=scriptController.js></script>
<script src=signal.js></script>
<script src=common.js></script>
<script src=powerSpectrumPlot.js></script>
<script src=fft.js></script>
<script src=d3.v5.min.js></script>
<script src=sliders.js></script>
<script src=spectralEfficiencyPlot.js></script>
<script src=throughputPlot.js></script>
<script src=label.js></script>
</head>
<body>
<h2>Testing Modules</h2>
<p><a href="devel_index.html">[Index]</a></p>
<p>
This page is not intended to be a usable example, it's for
testing.
This page tests the abstraction that we define as a
<b>Script Controller</b>. The optional editor and selector
allow the user to run javaScript that will control
simulated (or real radio transceivers TODO).
</p>
<p>
Try right mouse clicking and viewing the source. It's very
small.
</p>
<div style="font-size: 120%"id=scriptController1></div>
<p>
<input type=range id=freq1slider></input>
</p>
<p>
<span>stuff in text in span</span> <output id="freq1"></output>
more test not in span
</p>
<p id=scriptController2></p>
</body>
<script>
'use strict';
// We are making two signals that have the same initial state but they
// change values 'freq', 'bw', 'gn', 'mcs' separately.
var sig1 = new Signal(conf.sig0, '1');
var sig2 = new Signal(conf.sig0, '2');
var noise1 = new Signal(conf.noise, 'noise 1');
var noise2 = new Signal(conf.noise, 'noise 2');
// Change the initial freq value for sig1, so we see it is different from
// sig2.
sig1.freq = 1810.0e+6;
noise1.gn = -10;
var sc = new ScriptController([sig1, sig2], {
functionFiles: "functions/default_1_2.js",
element: "#scriptController1"
});
new ScriptController([sig1], {
functionFiles: "functions/default_1.js",
element: "#scriptController2",
postfix: '1',
sync: sc
});
Label(sig1, 'freq', {
prefix: "freq 1: ",
element: "#freq1"
});
Label(sig1, 'rate', { prefix: "Rate: ", suffix: " don't ya know"});
Label(sig1, 'mcs', { prefix: "mod/code: "});
Label(sig1, 'gn', { prefix: "gn 1: "});
Label(sig1, 'bw', { prefix: "bw 1: "});
Slider(sig1, 'freq', "#freq1slider");
Slider(sig1, 'freq');
Slider(sig1, 'bw');
Slider(sig1, 'gn');
Slider(sig1, 'mcs');
Slider(sig2, 'freq');
Slider(sig2, 'bw');
Slider(sig2, 'gn');
Slider(sig2, 'mcs');
Slider(noise1, 'gn');
Slider(noise2, 'gn');
ThroughputPlot(sig1);
ThroughputPlot(sig2);
// This is the Spectral Efficiency Plot for sig1 with sig2 being the
// interferer signal.
SpectralEfficiencyPlot(sig1);
SpectralEfficiencyPlot(sig2);
PowerSpectrumPlot();
</script>
</html>