Further work on dataflash and profile switch in the header

10.3.x-maintenance
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 () {
GUI.log(chrome.i18n.getMessage('pidTuningLoadedProfile', [profile + 1]));
GUI.tab_switch_cleanup(function () {
// < here goes the code to reinitialise the current tab
TABS[this.active_tab].initialize();
});
});
});
// testing profile change END
// 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) {
if (bytes < 1024) {
return bytes + "B";
}
var kilobytes = bytes / 1024;
if (kilobytes < 1024) {
@ -327,7 +322,7 @@ function onConnect() {
display: 'block'
});
$(".dataflash-used div").text('Used space ' + formatFilesize(DATAFLASH.usedSize));
$(".dataflash-used div").text('Dataflash: used ' + formatFilesize(DATAFLASH.usedSize));
} else {
$(".dataflash-used").css({
display: 'none'
@ -339,7 +334,7 @@ function onConnect() {
width: ((DATAFLASH.totalSize - DATAFLASH.usedSize) / DATAFLASH.totalSize * 100) + "%",
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 {
$(".dataflash-free").css({
display: 'none'
@ -347,7 +342,12 @@ function onConnect() {
}
}
update_html();
// testing dataflash change END

View File

@ -1344,7 +1344,7 @@ dialog {
color:white;
font-size:10px;
margin-top: 20px;
width:95px;
width:125px;
float: right;
margin-right: 20px;
line-height: 12px;
@ -1363,7 +1363,7 @@ dialog {
#profile_change {
color:white;
margin-top: 16px;
width:95px;
width:125px;
float: right;
margin-right: 0px;
line-height: 12px;
@ -1388,10 +1388,10 @@ dialog {
}
.dataflash-contents li {
height: 6px;
height: 5px;
position: relative;
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;
left: 0;
right: 0;
width:90px;
width:120px;
text-align:left;
color:silver;
}
.dataflash-used {
background-color: #59AA29;
border-radius: 4px;
border-radius: 2px;
}
progress::-webkit-progress-bar {

View File

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