adding packet error indicator in status bar

fixes #8
10.3.x-maintenance
cTn 2013-12-05 10:34:10 +01:00
parent 0344110c2d
commit ac85aeff8a
3 changed files with 9 additions and 3 deletions

View File

@ -64,7 +64,8 @@ var MSP = {
message_buffer_uint8_view: undefined, message_buffer_uint8_view: undefined,
message_checksum: 0, message_checksum: 0,
callbacks: [] callbacks: [],
packet_error: 0
}; };
function MSP_char_read(readInfo) { function MSP_char_read(readInfo) {
@ -132,6 +133,9 @@ function MSP_char_read(readInfo) {
process_data(MSP.code, MSP.message_buffer, MSP.message_length_expected); process_data(MSP.code, MSP.message_buffer, MSP.message_length_expected);
} else { } else {
console.log('code: ' + MSP.code + ' - crc failed'); console.log('code: ' + MSP.code + ' - crc failed');
MSP.packet_error++;
$('span.packet-error').html(MSP.packet_error);
} }
// Reset variables // Reset variables

View File

@ -132,8 +132,9 @@ $(document).ready(function() {
// Change port utilization to 0 // Change port utilization to 0
$('span.port-usage').html('0%'); $('span.port-usage').html('0%');
// reset valid config received variable (used to block tabs while not connected properly) configuration_received = false; // reset valid config received variable (used to block tabs while not connected properly)
configuration_received = false;
MSP.packet_error = 0; // reset CRC packet error counter for next session
// unlock port select & baud // unlock port select & baud
$('div#port-picker #port, div#port-picker #baud, div#port-picker #delay').prop('disabled', false); $('div#port-picker #port, div#port-picker #baud, div#port-picker #delay').prop('disabled', false);

View File

@ -104,6 +104,7 @@
</div> </div>
<div id="status-bar"> <div id="status-bar">
Port utilization: <span class="port-usage">0%</span> | Port utilization: <span class="port-usage">0%</span> |
Packet error: <span class="packet-error">0</span> |
Firmware Version: <span class="software-version">0.00</span> | Firmware Version: <span class="software-version">0.00</span> |
Cycle Time: <span class="cycle-time">0</span> Cycle Time: <span class="cycle-time">0</span>
<span class="notify"></span> <span class="notify"></span>