1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 20:10:11 +03:00

Further work on dataflash and profile switch in the header

This commit is contained in:
skaman82 2015-11-16 12:46:59 +01:00
parent 0b2c6a26d5
commit 6b97eb2809
3 changed files with 17 additions and 17 deletions

View file

@ -289,26 +289,21 @@ function onConnect() {
MSP.send_message(MSP_codes.MSP_SELECT_SETTING, [profile], false, function () { MSP.send_message(MSP_codes.MSP_SELECT_SETTING, [profile], false, function () {
GUI.log(chrome.i18n.getMessage('pidTuningLoadedProfile', [profile + 1])); GUI.log(chrome.i18n.getMessage('pidTuningLoadedProfile', [profile + 1]));
GUI.tab_switch_cleanup(function () {
// < here goes the code to reinitialise the current tab // < here goes the code to reinitialise the current tab
TABS[this.active_tab].initialize();
});
}); });
}); });
// testing profile change END // testing profile change END
// TEST code for dataflash status in header // TEST code for dataflash status in header
MSP.send_message(MSP_codes.MSP_DATAFLASH_SUMMARY, false, false); MSP.send_message(MSP_codes.MSP_DATAFLASH_SUMMARY, false, false);
function formatFilesize(bytes) { function formatFilesize(bytes) {
if (bytes < 1024) { if (bytes < 1024) {
return bytes + "B"; return bytes + "B";
} }
var kilobytes = bytes / 1024; var kilobytes = bytes / 1024;
if (kilobytes < 1024) { if (kilobytes < 1024) {
@ -327,7 +322,7 @@ function onConnect() {
display: 'block' display: 'block'
}); });
$(".dataflash-used div").text('Used space ' + formatFilesize(DATAFLASH.usedSize)); $(".dataflash-used div").text('Dataflash: used ' + formatFilesize(DATAFLASH.usedSize));
} else { } else {
$(".dataflash-used").css({ $(".dataflash-used").css({
display: 'none' display: 'none'
@ -339,7 +334,7 @@ function onConnect() {
width: ((DATAFLASH.totalSize - DATAFLASH.usedSize) / DATAFLASH.totalSize * 100) + "%", width: ((DATAFLASH.totalSize - DATAFLASH.usedSize) / DATAFLASH.totalSize * 100) + "%",
display: 'block' display: 'block'
}); });
$(".dataflash-free div").text('Free space ' + formatFilesize(DATAFLASH.totalSize - DATAFLASH.usedSize)); $(".dataflash-free div").text('Dataflash: free ' + formatFilesize(DATAFLASH.totalSize - DATAFLASH.usedSize));
} else { } else {
$(".dataflash-free").css({ $(".dataflash-free").css({
display: 'none' display: 'none'
@ -347,6 +342,11 @@ function onConnect() {
} }
} }
update_html();
// testing dataflash change END // testing dataflash change END

View file

@ -1344,7 +1344,7 @@ dialog {
color:white; color:white;
font-size:10px; font-size:10px;
margin-top: 20px; margin-top: 20px;
width:95px; width:125px;
float: right; float: right;
margin-right: 20px; margin-right: 20px;
line-height: 12px; line-height: 12px;
@ -1363,7 +1363,7 @@ dialog {
#profile_change { #profile_change {
color:white; color:white;
margin-top: 16px; margin-top: 16px;
width:95px; width:125px;
float: right; float: right;
margin-right: 0px; margin-right: 0px;
line-height: 12px; line-height: 12px;
@ -1388,10 +1388,10 @@ dialog {
} }
.dataflash-contents li { .dataflash-contents li {
height: 6px; height: 5px;
position: relative; position: relative;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.20); box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.20);
border-radius: 4px; border-radius: 2px;
} }
@ -1402,14 +1402,14 @@ dialog {
text-align: center; text-align: center;
left: 0; left: 0;
right: 0; right: 0;
width:90px; width:120px;
text-align:left; text-align:left;
color:silver; color:silver;
} }
.dataflash-used { .dataflash-used {
background-color: #59AA29; background-color: #59AA29;
border-radius: 4px; border-radius: 2px;
} }
progress::-webkit-progress-bar { progress::-webkit-progress-bar {

View file

@ -130,10 +130,10 @@
<div class="noflash" align="center">No dataflash <br>chip found</div> <div class="noflash" align="center">No dataflash <br>chip found</div>
<ul class="dataflash-contents"> <ul class="dataflash-contents">
<li class="dataflash-used"> <li class="dataflash-used">
<div class="legend">Used space</div> <div class="legend">Dataflash: used space</div>
</li> </li>
<li class="dataflash-free"> <li class="dataflash-free">
<div class="legend">Free space</div> <div class="legend">Dataflash: free space</div>
</li> </li>
</ul> </ul>
<div id="profile_change"> <div id="profile_change">