Skip to content

Commit

Permalink
On connect load in series, not in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
DzikuVx committed Apr 26, 2024
1 parent 20e36b9 commit 9f9aa84
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions js/serial_backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,35 +454,36 @@ var SerialBackend = (function () {
$('.mode-disconnected').hide();
$('.mode-connected').show();

MSP.send_message(MSPCodes.MSP_DATAFLASH_SUMMARY, false, false);

$('#sensor-status').show();
$('#portsinput').hide();
$('#dataflash_wrapper_global').show();

/*
* Get BOXNAMES since it is used for some reason....
*/
MSP.send_message(MSPCodes.MSP_BOXNAMES, false, false);
MSP.send_message(MSPCodes.MSP_DATAFLASH_SUMMARY, false, false, function () {
$('#sensor-status').show();
$('#portsinput').hide();
$('#dataflash_wrapper_global').show();

/*
* Get BOXNAMES since it is used for some reason....
*/
MSP.send_message(MSPCodes.MSP_BOXNAMES, false, false, function () {
/*
* Init PIDs bank with a length that depends on the version
*/
let pidCount = 11;

/*
* Init PIDs bank with a length that depends on the version
*/
let pidCount = 11;
for (let i = 0; i < pidCount; i++) {
FC.PIDs.push(new Array(4));
}

for (let i = 0; i < pidCount; i++) {
FC.PIDs.push(new Array(4));
}
interval.add('msp-load-update', function () {
$('#msp-version').text("MSP version: " + MSP.protocolVersion.toFixed(0));
$('#msp-load').text("MSP load: " + mspQueue.getLoad().toFixed(1));
$('#msp-roundtrip').text("MSP round trip: " + mspQueue.getRoundtrip().toFixed(0));
$('#hardware-roundtrip').text("HW round trip: " + mspQueue.getHardwareRoundtrip().toFixed(0));
$('#drop-rate').text("Drop ratio: " + mspQueue.getDropRatio().toFixed(0) + "%");
}, 100);

interval.add('msp-load-update', function () {
$('#msp-version').text("MSP version: " + MSP.protocolVersion.toFixed(0));
$('#msp-load').text("MSP load: " + mspQueue.getLoad().toFixed(1));
$('#msp-roundtrip').text("MSP round trip: " + mspQueue.getRoundtrip().toFixed(0));
$('#hardware-roundtrip').text("HW round trip: " + mspQueue.getHardwareRoundtrip().toFixed(0));
$('#drop-rate').text("Drop ratio: " + mspQueue.getDropRatio().toFixed(0) + "%");
}, 100);
interval.add('global_data_refresh', periodicStatusUpdater.run, periodicStatusUpdater.getUpdateInterval(CONFIGURATOR.connection.bitrate), false);
});
});

interval.add('global_data_refresh', periodicStatusUpdater.run, periodicStatusUpdater.getUpdateInterval(CONFIGURATOR.connection.bitrate), false);
}

privateScope.onClosed = function (result) {
Expand Down

0 comments on commit 9f9aa84

Please sign in to comment.