Change channel graph to use new variable
This commit is contained in:
11
index.js
11
index.js
@@ -84,10 +84,6 @@ var PAUSE = false;
|
|||||||
var PAUSE_AFTER_END = true;
|
var PAUSE_AFTER_END = true;
|
||||||
var PACKET_SIZE_BITS = 5; // 32 bytes, 256 bits
|
var PACKET_SIZE_BITS = 5; // 32 bytes, 256 bits
|
||||||
|
|
||||||
var EXPECTED_ENCODED_BITS = [];
|
|
||||||
var EXPECTED_BITS = [];
|
|
||||||
var EXPECTED_TEXT = '';
|
|
||||||
|
|
||||||
const packetReceivedBits = [];
|
const packetReceivedBits = [];
|
||||||
const packetUninterlievedBits = [];
|
const packetUninterlievedBits = [];
|
||||||
const packetDecodedBits = [];
|
const packetDecodedBits = [];
|
||||||
@@ -1542,7 +1538,6 @@ function handleSendButtonClick() {
|
|||||||
resetReceivedData();
|
resetReceivedData();
|
||||||
|
|
||||||
const text = document.getElementById('text-to-send').value;
|
const text = document.getElementById('text-to-send').value;
|
||||||
EXPECTED_TEXT = text;
|
|
||||||
sendBytes(textToBytes(text));
|
sendBytes(textToBytes(text));
|
||||||
}
|
}
|
||||||
function getAnalyser() {
|
function getAnalyser() {
|
||||||
@@ -1879,8 +1874,8 @@ function drawChannelData() {
|
|||||||
const receivedBit = segmentBits[channelIndex];
|
const receivedBit = segmentBits[channelIndex];
|
||||||
// identify expected bit
|
// identify expected bit
|
||||||
const bitIndex = channelIndex + (segmentIndex * channelCount);
|
const bitIndex = channelIndex + (segmentIndex * channelCount);
|
||||||
if(bitIndex >= EXPECTED_ENCODED_BITS.length) break;
|
if(bitIndex >= SENT_ENCODED_BITS.length) break;
|
||||||
const expectedBit = EXPECTED_ENCODED_BITS[bitIndex];
|
const expectedBit = SENT_ENCODED_BITS[bitIndex];
|
||||||
|
|
||||||
drawChannelSegmentBackground(
|
drawChannelSegmentBackground(
|
||||||
ctx,
|
ctx,
|
||||||
@@ -2220,7 +2215,7 @@ function handleReceivedChannelGraphClick(e) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const expectedBit = EXPECTED_ENCODED_BITS[bitIndex];
|
const expectedBit = SENT_ENCODED_BITS[bitIndex];
|
||||||
const receivedBit = packetReceivedBits[bitIndex];
|
const receivedBit = packetReceivedBits[bitIndex];
|
||||||
addLowHigh('Expected Bit', expectedBit === 1 ? '' : '0', expectedBit === 1 ? '1' : '')
|
addLowHigh('Expected Bit', expectedBit === 1 ? '' : '0', expectedBit === 1 ? '1' : '')
|
||||||
addLowHigh('Received Bit', receivedBit === 1 ? '' : '0', receivedBit === 1 ? '1' : '')
|
addLowHigh('Received Bit', receivedBit === 1 ? '' : '0', receivedBit === 1 ? '1' : '')
|
||||||
|
|||||||
Reference in New Issue
Block a user