CF/BF - Prepare for updated OSD Slave boards.
* Replaces Setup tab with Setup OSD tab for OSD Slave boards - ported from CF v1.x. * Disables CLI tab for OSD Slave boards - due to https://github.com/cleanflight/cleanflight/pull/2710 *10.3.x-maintenance
parent
6ada059231
commit
2618d6dafc
|
@ -73,6 +73,9 @@
|
||||||
"tabSetup": {
|
"tabSetup": {
|
||||||
"message": "Setup"
|
"message": "Setup"
|
||||||
},
|
},
|
||||||
|
"tabSetupOSD": {
|
||||||
|
"message": "OSD Setup"
|
||||||
|
},
|
||||||
"tabConfiguration": {
|
"tabConfiguration": {
|
||||||
"message": "Configuration"
|
"message": "Configuration"
|
||||||
},
|
},
|
||||||
|
@ -2056,6 +2059,30 @@
|
||||||
"powerBatteryCapacity": {
|
"powerBatteryCapacity": {
|
||||||
"message": "Capacity (mAh)"
|
"message": "Capacity (mAh)"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"osdSetupHead": {
|
||||||
|
"message": "Info"
|
||||||
|
},
|
||||||
|
"osdSetupVideoMode": {
|
||||||
|
"message": "Video Mode"
|
||||||
|
},
|
||||||
|
"osdSetupCameraConnected": {
|
||||||
|
"message": "Camera Connected"
|
||||||
|
},
|
||||||
|
"osdSetupCameraConnectedValueYes": {
|
||||||
|
"message": "Yes"
|
||||||
|
},
|
||||||
|
"osdSetupCameraConnectedValueNo": {
|
||||||
|
"message": "No"
|
||||||
|
},
|
||||||
|
|
||||||
|
"osdSetupResetText": {
|
||||||
|
"message": "Reset OSD to default"
|
||||||
|
},
|
||||||
|
"osdSetupButtonReset": {
|
||||||
|
"message": "Reset Settings"
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
"mainHelpArmed": {
|
"mainHelpArmed": {
|
||||||
"message": "Motor Arming"
|
"message": "Motor Arming"
|
||||||
|
|
|
@ -42,12 +42,11 @@ var GUI_control = function () {
|
||||||
'servos',
|
'servos',
|
||||||
];
|
];
|
||||||
this.defaultAllowedOSDTabsWhenConnected = [
|
this.defaultAllowedOSDTabsWhenConnected = [
|
||||||
'setup',
|
'setup_osd',
|
||||||
'osd',
|
'osd',
|
||||||
'power',
|
'power',
|
||||||
'sensors',
|
'sensors',
|
||||||
'transponder',
|
'transponder',
|
||||||
'cli',
|
|
||||||
];
|
];
|
||||||
this.allowedTabs = this.defaultAllowedTabsWhenDisconnected;
|
this.allowedTabs = this.defaultAllowedTabsWhenDisconnected;
|
||||||
|
|
||||||
|
|
10
main.html
10
main.html
|
@ -9,6 +9,7 @@
|
||||||
<link type="text/css" rel="stylesheet" href="./js/libraries/flightindicators.css"/>
|
<link type="text/css" rel="stylesheet" href="./js/libraries/flightindicators.css"/>
|
||||||
<link type="text/css" rel="stylesheet" href="./tabs/landing.css" media="all"/>
|
<link type="text/css" rel="stylesheet" href="./tabs/landing.css" media="all"/>
|
||||||
<link type="text/css" rel="stylesheet" href="./tabs/setup.css" media="all"/>
|
<link type="text/css" rel="stylesheet" href="./tabs/setup.css" media="all"/>
|
||||||
|
<link type="text/css" rel="stylesheet" href="./tabs/setup_osd.css" media="all" />
|
||||||
<link type="text/css" rel="stylesheet" href="./tabs/help.css" media="all"/>
|
<link type="text/css" rel="stylesheet" href="./tabs/help.css" media="all"/>
|
||||||
<link type="text/css" rel="stylesheet" href="./tabs/ports.css" media="all"/>
|
<link type="text/css" rel="stylesheet" href="./tabs/ports.css" media="all"/>
|
||||||
<link type="text/css" rel="stylesheet" href="./tabs/configuration.css" media="all"/>
|
<link type="text/css" rel="stylesheet" href="./tabs/configuration.css" media="all"/>
|
||||||
|
@ -70,6 +71,7 @@
|
||||||
<script type="text/javascript" src="./main.js"></script>
|
<script type="text/javascript" src="./main.js"></script>
|
||||||
<script type="text/javascript" src="./tabs/landing.js"></script>
|
<script type="text/javascript" src="./tabs/landing.js"></script>
|
||||||
<script type="text/javascript" src="./tabs/setup.js"></script>
|
<script type="text/javascript" src="./tabs/setup.js"></script>
|
||||||
|
<script type="text/javascript" src="./tabs/setup_osd.js"></script>
|
||||||
<script type="text/javascript" src="./tabs/help.js"></script>
|
<script type="text/javascript" src="./tabs/help.js"></script>
|
||||||
<script type="text/javascript" src="./tabs/ports.js"></script>
|
<script type="text/javascript" src="./tabs/ports.js"></script>
|
||||||
<script type="text/javascript" src="./tabs/configuration.js"></script>
|
<script type="text/javascript" src="./tabs/configuration.js"></script>
|
||||||
|
@ -215,6 +217,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="mode-connected">
|
<ul class="mode-connected">
|
||||||
<li class="tab_setup"><a href="#" i18n="tabSetup" class="tabicon ic_setup" title="Setup"></a></li>
|
<li class="tab_setup"><a href="#" i18n="tabSetup" class="tabicon ic_setup" title="Setup"></a></li>
|
||||||
|
<li class="tab_setup_osd"><a href="#" i18n="tabSetupOSD" class="tabicon ic_setup" title="OSD Setup"></a></li>
|
||||||
|
|
||||||
<li class="tab_ports"><a href="#" i18n="tabPorts" class="tabicon ic_ports" title="Ports"></a></li>
|
<li class="tab_ports"><a href="#" i18n="tabPorts" class="tabicon ic_ports" title="Ports"></a></li>
|
||||||
<li class="tab_configuration"><a href="#" i18n="tabConfiguration" class="tabicon ic_config"
|
<li class="tab_configuration"><a href="#" i18n="tabConfiguration" class="tabicon ic_config"
|
||||||
title="Configuration"></a></li>
|
title="Configuration"></a></li>
|
||||||
|
@ -244,15 +248,15 @@
|
||||||
title="Tethered Logging"></a></li>
|
title="Tethered Logging"></a></li>
|
||||||
<li class="tab_onboard_logging"><a href="#" i18n="tabOnboardLogging" class="tabicon ic_data"
|
<li class="tab_onboard_logging"><a href="#" i18n="tabOnboardLogging" class="tabicon ic_data"
|
||||||
title="Onboard Logging"></a></li>
|
title="Onboard Logging"></a></li>
|
||||||
</ul>
|
|
||||||
<ul class="mode-connected-cli">
|
|
||||||
<li class="tab_cli"><a href="#" i18n="tabCLI" class="tabicon ic_cli" title="CLI"></a></li>
|
|
||||||
<!-- spare icons
|
<!-- spare icons
|
||||||
<li class=""><a href="#"class="tabicon ic_mission">Mission (spare icon)</a></li>
|
<li class=""><a href="#"class="tabicon ic_mission">Mission (spare icon)</a></li>
|
||||||
<li class=""><a href="#"class="tabicon ic_advanced">Advanced (spare icon)</a></li>
|
<li class=""><a href="#"class="tabicon ic_advanced">Advanced (spare icon)</a></li>
|
||||||
<li class=""><a href="#"class="tabicon ic_wizzard">Wizzard (spare icon)</a></li>
|
<li class=""><a href="#"class="tabicon ic_wizzard">Wizzard (spare icon)</a></li>
|
||||||
-->
|
-->
|
||||||
</ul>
|
</ul>
|
||||||
|
<ul class="mode-connected mode-connected-cli">
|
||||||
|
<li class="tab_cli"><a href="#" i18n="tabCLI" class="tabicon ic_cli" title="CLI"></a></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear-both"></div>
|
<div class="clear-both"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
4
main.js
4
main.js
|
@ -155,6 +155,10 @@ $(document).ready(function () {
|
||||||
case 'setup':
|
case 'setup':
|
||||||
TABS.setup.initialize(content_ready);
|
TABS.setup.initialize(content_ready);
|
||||||
break;
|
break;
|
||||||
|
case 'setup_osd':
|
||||||
|
TABS.setup_osd.initialize(content_ready);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'configuration':
|
case 'configuration':
|
||||||
TABS.configuration.initialize(content_ready);
|
TABS.configuration.initialize(content_ready);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
<div class="tab-setup-osd">
|
||||||
|
<div class="content_wrapper initialstyle">
|
||||||
|
<!-- should be the first DIV on each tab -->
|
||||||
|
<div class="cf_column full spacerbottom">
|
||||||
|
<div class="tab_title" i18n="tabSetupOSD">OSD</div>
|
||||||
|
<div class="cf_doc_version_bt">
|
||||||
|
<a id="button-documentation" href="" target="_blank"></a>
|
||||||
|
</div>
|
||||||
|
<div class="cf_column fourth buttonarea">
|
||||||
|
<div class="spacer_right">
|
||||||
|
<div class="default_btn">
|
||||||
|
<a class="resetSettings" href="#" i18n="osdSetupButtonReset"></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="threefourth_right osdinfo">
|
||||||
|
<div class="cell_osd">
|
||||||
|
<span i18n="osdSetupResetText"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="gui_box grey info">
|
||||||
|
<div class="gui_box_titlebar">
|
||||||
|
<div class="spacer_box_title" i18n="osdSetupHead"></div>
|
||||||
|
</div>
|
||||||
|
<div class="spacer_box">
|
||||||
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td i18n="osdSetupVideoMode"></td>
|
||||||
|
<td class="video-mode"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td i18n="osdSetupCameraConnected"></td>
|
||||||
|
<td class="camera-connected"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,70 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
TABS.setup_osd = {
|
||||||
|
};
|
||||||
|
|
||||||
|
TABS.setup_osd.initialize = function (callback) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
if (GUI.active_tab != 'setup_osd') {
|
||||||
|
GUI.active_tab = 'setup_osd';
|
||||||
|
googleAnalytics.sendAppView('Setup OSD');
|
||||||
|
}
|
||||||
|
|
||||||
|
function load_status() {
|
||||||
|
MSP.send_message(MSPCodes.MSP_STATUS, false, false, load_html);
|
||||||
|
}
|
||||||
|
|
||||||
|
function load_html() {
|
||||||
|
$('#content').load("./tabs/setup_osd.html", process_html);
|
||||||
|
}
|
||||||
|
|
||||||
|
load_status();
|
||||||
|
|
||||||
|
function process_html() {
|
||||||
|
|
||||||
|
$('.tab-setup-osd .info').hide(); // requires an MSP update
|
||||||
|
|
||||||
|
var osdVideoModes = [
|
||||||
|
'AUTO',
|
||||||
|
'NTSC',
|
||||||
|
'PAL'
|
||||||
|
];
|
||||||
|
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
|
$('a.resetSettings').click(function () {
|
||||||
|
MSP.send_message(MSPCodes.MSP_RESET_CONF, false, false, function () {
|
||||||
|
GUI.log(chrome.i18n.getMessage('initialSetupSettingsRestored'));
|
||||||
|
|
||||||
|
GUI.tab_switch_cleanup(function () {
|
||||||
|
TABS.setup_osd.initialize();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function get_slow_data() {
|
||||||
|
/* FIXME requires MSP update
|
||||||
|
MSP.send_message(MSPCodes.MSP_OSD_VIDEO_STATUS, false, false, function () {
|
||||||
|
var element;
|
||||||
|
|
||||||
|
element = $('.video-mode');
|
||||||
|
var osdVideoMode = osdVideoModes[OSD_VIDEO_STATE.video_mode];
|
||||||
|
element.text(osdVideoMode);
|
||||||
|
|
||||||
|
element = $('.camera-connected');
|
||||||
|
element.text(OSD_VIDEO_STATE.camera_connected ? chrome.i18n.getMessage('osdSetupCameraConnectedValueYes') : chrome.i18n.getMessage('osdSetupCameraConnectedValueNo'));
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
GUI.interval_add('setup_data_pull_slow', get_slow_data, 250, true); // 4 fps
|
||||||
|
|
||||||
|
GUI.content_ready(callback);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
TABS.setup_osd.cleanup = function (callback) {
|
||||||
|
if (callback) callback();
|
||||||
|
};
|
Loading…
Reference in New Issue