-
Notifications
You must be signed in to change notification settings - Fork 2
/
commsvideo.html
255 lines (223 loc) · 8.08 KB
/
commsvideo.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!DOCTYPE html>
<html>
<head>
<title>Artemis - Comms Video</title>
<meta charset="utf-8" />
<meta name="description" content="Faux GUI supplement for set-dressing a gaming session of Artemis SBS." />
<meta name="author" content="Justin Warwick" />
<link rel='stylesheet' href='./sbs-ui.css' />
<!-- Here would be a good place to put your own additional css link for unique/special things like spacing adjsutments based on element ID. The fewer changes in sbs-ui.css, the better (esp. if you might want to share improvements that really are general purpose) -->
<script src="./sbs-ui.js"></script>
</head>
<body>
<div id="super_container">
<div id="console_super_controls">
<button class="major_action" onclick="window.location.href='menu.html';">MENU</button>
<button class="major_action major_action_active">VIDEO</button>
<button class="major_action">AUDIO</button>
<button class="major_action">TELEGRAPH</button>
</div>
<div id="dualpresentation2" class="wrapper2column">
<div class="leftcolumn">
<h3> VIDEO CHANNEL TRANSCEIVER</h3>
<!--TODO: buttons to dynamically adjust the frequency and crypt key, then make the js call to webrtc service reflect the values-->
<table class="ship_metrics">
<tr>
<td>FREQUENCY</td>
<td id="transceiver_freq">446.460 MHz</td>
</tr>
<tr>
<td></td>
<td>
<button id="freq_inc" class="increment" onclick="frequencyModify(.010);"></button>
<button id="freq_dec" class="decrement" onclick="frequencyModify(-.010);"></button>
</td>
</tr>
<tr>
<td>CRYPT KEY</td>
<td id="crypto_key">2B0N2B</td>
</tr>
<tr>
<td></td>
<td>
<button class="increment"></button>
<button class="decrement"></button>
</td>
</tr>
</table>
</div>
<div class="rightcolumn" style="text-align:right; padding-right: 1em;">
<ul class="button_stack">
<!--
https://apprtc.appspot.com/r/KEY_2B0N2B__FREQ_440-460
https://apprtc.appspot.com/?r=KEY_2B0N2B__FREQ_440-460&hd=false
window.location.href='https://apprtc.appspot.com/r/KEY_2B0N2B__FREQ_440-460';
-->
<li> <button class="action" onclick="vidcommOpen();"> OPEN CHANNEL </button> </li>
<li> <button class="action" onclick="audioAlert();"> SECURE CHANNEL </button> </li>
<li> <button class="action" onclick="vidcommClose();"> TERMINATE CHANNEL </button> </li>
</ul>
<div id="signaling_configuration">
<h3>MODULATION</h3>
<ul class="button_stack narrow">
<li> <button class="action" onclick=""> AM </button> </li>
<li> <button class="action" onclick=""> AM:SSB</button> </li>
<li> <button class="action" onclick=""> FM</button> </li>
<li> <button class="action" onclick=""> PM</button> </li>
<li> <button class="action" onclick=""> QAM</button> </li>
</ul>
<ul class="button_stack narrow">
<li> <button class="action" onclick=""> AM </button> </li>
<li> <button class="action" onclick=""> ASK </button> </li>
<li> <button class="action" onclick=""> APSK </button> </li>
<li> <button class="action" onclick=""> CPM </button> </li>
<li> <button class="action" onclick=""> FSK </button> </li>
<li> <button class="action" onclick=""> MFSK </button> </li>
<li> <button class="action" onclick=""> MSK </button> </li>
<li> <button class="action" onclick=""> PPM </button> </li>
<li> <button class="action" onclick=""> PSK </button> </li>
<li> <button class="action" onclick=""> QAM </button> </li>
<li> <button class="action" onclick=""> TCM </button> </li>
</ul>
</div>
</div>
</div>
<iframe id="videocommdisplay" ></iframe>
<div id="signaling_configuration_alt">
<p>EMF EMISSIONS ACTIVE</p>
<ul>
<li class="confirmed">UHF transmit</li>
<li>FM SIMPLEX</li>
<li>Normal space</li>
</ul>
<span>
ELF SLF ULF VLF LF MF HF VHF UHF SHF EHF THF
</span>
<!--
<span>
AM QAM FM PM AM:SSB
</span>
<span>
ASK APSK CPM FSK MFSK MSK PPM PSK QAM TCM
</span>
-->
</div>
<h3> SCAN ANALYSIS</h3>
<div id="dualpresentation1" class="wrapper2column">
<div class="yscale">
<table>
<tr><td>100</td></tr>
<tr><td>75</td></tr>
<tr><td>50</td></tr>
<tr><td>25</td></tr>
<tr><td>0</td></tr>
<tr><td>-25</td></tr>
</table>
</div>
<div class="maingrid">
<p>3874</p>
<p> <span class="graphbar"> 034 </span> <span class="graphbar"> STATIC EM SATURATION</span> </p>
<p>34893 X</p>
</div>
</div>
<div id="dualpresentation3" class="wrapper2column">
<div class="leftcolumn" style="margin-right: 1em;">
<table class="vertical_threshold_bracket">
<tr><td class="critical_threshold">_</td></tr>
<tr><td class="critical_threshold">_</td></tr>
<tr><td>—</td></tr>
<tr><td> </td></tr>
<tr><td>-</td></tr>
<tr><td>-</td></tr>
</table>
</div>
Signal strength r-current
<div class="rightcolumn">
<canvas id="signalstrength_linegraph"></canvas>
</div>
</div>
<p></p>
<!-- TODO: convert or remove
<div id="dualpresentation" class="wrapper2column">
<div class="leftcolumn">
<table class="vertical_threshold_bracket">
<tr><td class="critical_threshold">-</td></tr>
<tr><td>-</td></tr>
<tr><td>-</td></tr>
<tr><td class="nominal_threshold">-</td></tr>
<tr><td class="nominal_threshold">—</td></tr>
<tr><td class="nominal_threshold">-</td></tr>
<tr><td>-</td></tr>
<tr><td>-</td></tr>
<tr><td class="critical_threshold">-</td></tr>
</table>
</div>
<div class="rightcolumn">
<p>
<a href="#INCREMENT_ACTION" class="increment"><img src="images/button_increment.png" /></a>
<button class="increment"></button>
</p>
<p>The goldilocks variation: not too cold not too hot, only right in the middle is green</p>
<p>
<a href="#DECREMENT_ACTION" class="decrement"><img src="images/button_decrement.png" /></a>
<button class="decrement"></button>
</p>
</div>
</div>
-->
</div>
<audio id="audUmmy"/><!--Just leave this here, just needed to be able to query canplay in the initialization code to load compatible media types -->
<script>
window.console && console.log("TODO some dynamicness");
function generateLineGraph(elementID){
//Thanks to http://jsfiddle.net/drewnoakes/692cbo8q/
//TODO: generate the random ypoints in a global array, and global index then start a setinterval to perform a circular "scroll" of the graph.
// then once tested, copy to the demo/template
//
var canvas = document.querySelector('#'+elementID),
ctx = canvas.getContext('2d');
ctx.lineWidth = 1.5;
ctx.strokeStyle = 'gray';
ctx.beginPath();
for (var i = 0; i < 100; i++)
{
var x = 4*i; //Math.random() * 100,
y = Math.random() * 100;
ctx.lineTo(x, y);
}
ctx.stroke();
}
function vidcommClose() {
//TODO: neatly withdraw from channel to not occupy connections needlessly
var vid = document.getElementById('videocommdisplay');
vid.width='300px';
vid.height='150px';
vid.innerHTML = "<html><head></head><body><p>-== TRANSMISSION TERMINATED ==-</p></body></html>";
var sigconf = document.getElementById('signaling_configuration');
sigconf.style.display="block";
}
function vidcommOpen(cryptkey,frequency) {
//'2B0N2B','440.460'
if (frequency == undefined) {
frequency = document.getElementById('transceiver_freq').innerText.replace(" MHz","");
}
if (cryptkey == undefined) {
cryptkey = document.getElementById('crypto_key').innerText;
}
//TODO: filter and/or url encode the cryptkey and frequency
var vid = document.getElementById('videocommdisplay');
vid.width='100%';
vid.height=Math.round(document.getElementById("super_container").offsetHeight * .9);
vid.src ='https://apprtc.appspot.com/r/KEY_' + cryptkey + '__FREQ_' + frequency.replace('.','-');
var sigconf = document.getElementById('signaling_configuration');
sigconf.style.display="none";
}
function frequencyModify(crement) { //crement is signed adjustment in MHz
var freqElm = document.getElementById('transceiver_freq');
freqElm.innerText = (parseFloat(freqElm.innerText.replace(" MHz","")) + crement).toFixed(3) + " MHz";
}
generateLineGraph("signalstrength_linegraph");
</script>
<script src="sbs-ui-wireup.js"></script>
</body>
</html>