mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-26 09:45:28 +03:00
Color for vtx ready status (#3422)
* VTX ready change if device get ready * minor change * removed class from translated string * Use of css way * Now use CSS style * reduce size of main.less * xVx
This commit is contained in:
parent
8d5533bbd0
commit
b523f0a0ac
8 changed files with 68 additions and 56 deletions
|
@ -2560,10 +2560,10 @@
|
||||||
"message": "3D Fix:"
|
"message": "3D Fix:"
|
||||||
},
|
},
|
||||||
"gpsFixTrue": {
|
"gpsFixTrue": {
|
||||||
"message": "<span class=\"fixtrue\">True</span>"
|
"message": "True"
|
||||||
},
|
},
|
||||||
"gpsFixFalse": {
|
"gpsFixFalse": {
|
||||||
"message": "<span class=\"fixfalse\">False</span>"
|
"message": "False"
|
||||||
},
|
},
|
||||||
"gpsAltitude": {
|
"gpsAltitude": {
|
||||||
"message": "Altitude:"
|
"message": "Altitude:"
|
||||||
|
@ -6139,6 +6139,14 @@
|
||||||
"message": "You can select here the frequency for your VTX if it is supported",
|
"message": "You can select here the frequency for your VTX if it is supported",
|
||||||
"description": "Help text for the frequency field of the VTX tab"
|
"description": "Help text for the frequency field of the VTX tab"
|
||||||
},
|
},
|
||||||
|
"vtxReadyTrue": {
|
||||||
|
"message": "True",
|
||||||
|
"description": "vtx device are ready"
|
||||||
|
},
|
||||||
|
"vtxReadyFalse": {
|
||||||
|
"message": "False",
|
||||||
|
"description": "vtx device are not ready"
|
||||||
|
},
|
||||||
"vtxDeviceReady": {
|
"vtxDeviceReady": {
|
||||||
"message": "Device ready",
|
"message": "Device ready",
|
||||||
"description": "Text of one of the fields of the VTX tab"
|
"description": "Text of one of the fields of the VTX tab"
|
||||||
|
|
|
@ -1715,19 +1715,15 @@ dialog {
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.fixtrue {
|
.colorToggle {
|
||||||
background-color: #56ac1d;
|
background-color: #e60000;
|
||||||
padding: 2px 5px;
|
padding: 2px 5px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
}
|
&.ready {
|
||||||
.fixfalse {
|
background-color: #56ac1d;
|
||||||
background-color: #e60000;
|
}
|
||||||
padding: 2px 5px;
|
|
||||||
border-radius: 3px;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
}
|
||||||
.buildInfoBtn {
|
.buildInfoBtn {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
@ -192,7 +192,9 @@ gps.initialize = async function (callback) {
|
||||||
const healthyArray = ['gnssHealthyUnknown', 'gnssHealthyHealthy', 'gnssHealthyUnhealthy', 'gnssHealthyUnknown'];
|
const healthyArray = ['gnssHealthyUnknown', 'gnssHealthyHealthy', 'gnssHealthyUnhealthy', 'gnssHealthyUnknown'];
|
||||||
let alt = FC.GPS_DATA.alt;
|
let alt = FC.GPS_DATA.alt;
|
||||||
|
|
||||||
$('.GPS_info td.fix').html((FC.GPS_DATA.fix) ? i18n.getMessage('gpsFixTrue') : i18n.getMessage('gpsFixFalse'));
|
$('.GPS_info span.colorToggle').text(FC.GPS_DATA.fix ? i18n.getMessage('gpsFixTrue') : i18n.getMessage('gpsFixFalse'));
|
||||||
|
$('.GPS_info span.colorToggle').toggleClass('ready', FC.GPS_DATA.fix != 0);
|
||||||
|
|
||||||
$('.GPS_info td.alt').text(`${alt} m`);
|
$('.GPS_info td.alt').text(`${alt} m`);
|
||||||
$('.GPS_info td.lat a').prop('href', url).text(`${lat.toFixed(4)} deg`);
|
$('.GPS_info td.lat a').prop('href', url).text(`${lat.toFixed(4)} deg`);
|
||||||
$('.GPS_info td.lon a').prop('href', url).text(`${lon.toFixed(4)} deg`);
|
$('.GPS_info td.lon a').prop('href', url).text(`${lon.toFixed(4)} deg`);
|
||||||
|
|
|
@ -192,7 +192,7 @@ setup.initialize = function (callback) {
|
||||||
rssi_e = $('.rssi'),
|
rssi_e = $('.rssi'),
|
||||||
cputemp_e = $('.cpu-temp'),
|
cputemp_e = $('.cpu-temp'),
|
||||||
arming_disable_flags_e = $('.arming-disable-flags'),
|
arming_disable_flags_e = $('.arming-disable-flags'),
|
||||||
gpsFix_e = $('.gpsFix'),
|
gpsFix_e = $('.GPS_info span.colorToggle'),
|
||||||
gpsSats_e = $('.gpsSats'),
|
gpsSats_e = $('.gpsSats'),
|
||||||
gpsLat_e = $('.gpsLat'),
|
gpsLat_e = $('.gpsLat'),
|
||||||
gpsLon_e = $('.gpsLon'),
|
gpsLon_e = $('.gpsLon'),
|
||||||
|
@ -428,7 +428,9 @@ setup.initialize = function (callback) {
|
||||||
|
|
||||||
// GPS info is acquired in the background using update_live_status() in serial_backend.js
|
// GPS info is acquired in the background using update_live_status() in serial_backend.js
|
||||||
|
|
||||||
gpsFix_e.html((FC.GPS_DATA.fix) ? i18n.getMessage('gpsFixTrue') : i18n.getMessage('gpsFixFalse'));
|
gpsFix_e.text(FC.GPS_DATA.fix ? i18n.getMessage('gpsFixTrue') : i18n.getMessage('gpsFixFalse'));
|
||||||
|
gpsFix_e.toggleClass('ready', FC.GPS_DATA.fix != 0);
|
||||||
|
|
||||||
gpsSats_e.text(FC.GPS_DATA.numSat);
|
gpsSats_e.text(FC.GPS_DATA.numSat);
|
||||||
gpsLat_e.text(`${(FC.GPS_DATA.lat / 10000000).toFixed(4)} deg`);
|
gpsLat_e.text(`${(FC.GPS_DATA.lat / 10000000).toFixed(4)} deg`);
|
||||||
gpsLon_e.text(`${(FC.GPS_DATA.lon / 10000000).toFixed(4)} deg`);
|
gpsLon_e.text(`${(FC.GPS_DATA.lon / 10000000).toFixed(4)} deg`);
|
||||||
|
|
|
@ -40,12 +40,22 @@ vtx.isVtxDeviceStatusNotReady = function()
|
||||||
|
|
||||||
vtx.updateVtxDeviceStatus = function()
|
vtx.updateVtxDeviceStatus = function()
|
||||||
{
|
{
|
||||||
MSP.send_message(MSPCodes.MSP2_GET_VTX_DEVICE_STATUS, false, false, vtxDeviceStatusReceived);
|
|
||||||
|
|
||||||
function vtxDeviceStatusReceived()
|
function vtxDeviceStatusReceived()
|
||||||
{
|
{
|
||||||
$("#vtx_type_description").text(TABS.vtx.getVtxTypeString());
|
$("#vtx_type_description").text(TABS.vtx.getVtxTypeString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function vtxDeviceStatusReady()
|
||||||
|
{
|
||||||
|
const vtxReady_e = $('.VTX_info span.colorToggle');
|
||||||
|
|
||||||
|
// update device ready state
|
||||||
|
vtxReady_e.text(FC.VTX_CONFIG.vtx_device_ready ? i18n.getMessage('vtxReadyTrue') : i18n.getMessage('vtxReadyFalse'));
|
||||||
|
vtxReady_e.toggleClass('ready', FC.VTX_CONFIG.vtx_device_ready);
|
||||||
|
}
|
||||||
|
|
||||||
|
MSP.send_message(MSPCodes.MSP2_GET_VTX_DEVICE_STATUS, false, false, vtxDeviceStatusReceived);
|
||||||
|
MSP.send_message(MSPCodes.MSP_VTX_CONFIG, false, false, vtxDeviceStatusReady);
|
||||||
};
|
};
|
||||||
|
|
||||||
vtx.getVtxTypeString = function()
|
vtx.getVtxTypeString = function()
|
||||||
|
@ -205,7 +215,6 @@ vtx.initialize = function (callback) {
|
||||||
// Bands and channels
|
// Bands and channels
|
||||||
FC.VTX_CONFIG.vtx_table_bands = vtxConfig.vtx_table.bands_list.length;
|
FC.VTX_CONFIG.vtx_table_bands = vtxConfig.vtx_table.bands_list.length;
|
||||||
|
|
||||||
|
|
||||||
let maxChannels = 0;
|
let maxChannels = 0;
|
||||||
TABS.vtx.VTXTABLE_BAND_LIST = [];
|
TABS.vtx.VTXTABLE_BAND_LIST = [];
|
||||||
for (let i = 1; i <= FC.VTX_CONFIG.vtx_table_bands; i++) {
|
for (let i = 1; i <= FC.VTX_CONFIG.vtx_table_bands; i++) {
|
||||||
|
@ -290,14 +299,14 @@ vtx.initialize = function (callback) {
|
||||||
$("#vtx_low_power_disarm").val(FC.VTX_CONFIG.vtx_low_power_disarm);
|
$("#vtx_low_power_disarm").val(FC.VTX_CONFIG.vtx_low_power_disarm);
|
||||||
|
|
||||||
// Values of the current values
|
// Values of the current values
|
||||||
const yesMessage = i18n.getMessage("yes");
|
const vtxReady_e = $('.VTX_info span.colorToggle');
|
||||||
const noMessage = i18n.getMessage("no");
|
vtxReady_e.text(FC.VTX_CONFIG.vtx_device_ready ? i18n.getMessage('vtxReadyTrue') : i18n.getMessage('vtxReadyFalse'));
|
||||||
|
vtxReady_e.toggleClass('ready', FC.VTX_CONFIG.vtx_device_ready);
|
||||||
|
|
||||||
$("#vtx_device_ready_description").text(FC.VTX_CONFIG.vtx_device_ready ? yesMessage : noMessage);
|
|
||||||
$("#vtx_type_description").text(self.getVtxTypeString());
|
$("#vtx_type_description").text(self.getVtxTypeString());
|
||||||
$("#vtx_channel_description").text(FC.VTX_CONFIG.vtx_channel);
|
$("#vtx_channel_description").text(FC.VTX_CONFIG.vtx_channel);
|
||||||
$("#vtx_frequency_description").text(FC.VTX_CONFIG.vtx_frequency);
|
$("#vtx_frequency_description").text(FC.VTX_CONFIG.vtx_frequency);
|
||||||
$("#vtx_pit_mode_description").text(FC.VTX_CONFIG.vtx_pit_mode ? yesMessage : noMessage);
|
$("#vtx_pit_mode_description").text(FC.VTX_CONFIG.vtx_pit_mode ? i18n.getMessage("Yes") : i18n.getMessage("No"));
|
||||||
$("#vtx_pit_mode_frequency_description").text(FC.VTX_CONFIG.vtx_pit_mode_frequency);
|
$("#vtx_pit_mode_frequency_description").text(FC.VTX_CONFIG.vtx_pit_mode_frequency);
|
||||||
$("#vtx_low_power_disarm_description").text(i18n.getMessage(`vtxLowPowerDisarmOption_${FC.VTX_CONFIG.vtx_low_power_disarm}`));
|
$("#vtx_low_power_disarm_description").text(i18n.getMessage(`vtxLowPowerDisarmOption_${FC.VTX_CONFIG.vtx_low_power_disarm}`));
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="grid-col col5">
|
<div class="grid-col col5">
|
||||||
|
|
||||||
<div class="gui_box grey gps">
|
<div class="gui_box grey gps">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title" i18n="configurationGPS"></div>
|
<div class="spacer_box_title" i18n="configurationGPS"></div>
|
||||||
|
@ -77,7 +76,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid-col col7">
|
<div class="grid-col col7">
|
||||||
|
|
||||||
<div class="gui_box grey">
|
<div class="gui_box grey">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title" i18n="gpsHead"></div>
|
<div class="spacer_box_title" i18n="gpsHead"></div>
|
||||||
|
@ -85,8 +83,8 @@
|
||||||
<div class="spacer_box GPS_info">
|
<div class="spacer_box GPS_info">
|
||||||
<table class="cf_table">
|
<table class="cf_table">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 85px" i18n="gps3dFix"></td>
|
<td i18n="gps3dFix"></td>
|
||||||
<td class="fix" i18n="gpsFixFalse"></td>
|
<td><span class="colorToggle" i18n="gpsFixFalse"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="gpsAltitude"></td>
|
<td i18n="gpsAltitude"></td>
|
||||||
|
|
|
@ -116,12 +116,12 @@
|
||||||
<div class="spacer_box_title" i18n="initialSetupGPSHead"></div>
|
<div class="spacer_box_title" i18n="initialSetupGPSHead"></div>
|
||||||
<div class="helpicon cf_tip" i18n_title="initialSetupGPSHeadHelp"></div>
|
<div class="helpicon cf_tip" i18n_title="initialSetupGPSHeadHelp"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer_box">
|
<div class="spacer_box GPS_info">
|
||||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="gps3dFix"></td>
|
<td i18n="gps3dFix"></td>
|
||||||
<td class="gpsFix"></td>
|
<td><span class="colorToggle" i18n="gpsFixFalse"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="gpsSats"></td>
|
<td i18n="gpsSats"></td>
|
||||||
|
|
|
@ -125,50 +125,47 @@
|
||||||
<div class="spacer_box_title" i18n="vtxActualState"></div>
|
<div class="spacer_box_title" i18n="vtxActualState"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spacer_box">
|
<div class="spacer_box VTX_info">
|
||||||
|
<table class="cf_table">
|
||||||
<table class="cf_table">
|
<tbody>
|
||||||
<tbody>
|
<tr>
|
||||||
|
<td class="description_text" i18n="vtxDeviceReady"></td>
|
||||||
|
<td><span class="colorToggle" i18n="vtxReadyFalse"></span></td>
|
||||||
|
</tr>
|
||||||
<tr class="description vtx_type">
|
<tr class="description vtx_type">
|
||||||
<td class="description_text" i18n="vtxType"></td>
|
<td class="description_text" i18n="vtxType"></td>
|
||||||
<td class="description_value" id="vtx_type_description"></td>
|
<td class="description_value" id="vtx_type_description"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="description vtx_device_ready">
|
<tr class="description vtx_band">
|
||||||
<td class="description_text" i18n="vtxDeviceReady"></td>
|
|
||||||
<td class="description_value" id="vtx_device_ready_description"></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="description vtx_band">
|
|
||||||
<td class="description_text" i18n="vtxBand"></td>
|
<td class="description_text" i18n="vtxBand"></td>
|
||||||
<td class="description_value" id="vtx_band_description"></td>
|
<td class="description_value" id="vtx_band_description"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="description vtx_channel">
|
<tr class="description vtx_channel">
|
||||||
<td class="description_text" i18n="vtxChannel"></td>
|
<td class="description_text" i18n="vtxChannel"></td>
|
||||||
<td class="description_value" id="vtx_channel_description"></td>
|
<td class="description_value" id="vtx_channel_description"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="description vtx_frequency">
|
<tr class="description vtx_frequency">
|
||||||
<td class="description_text" i18n="vtxFrequency"></td>
|
<td class="description_text" i18n="vtxFrequency"></td>
|
||||||
<td class="description_value" id="vtx_frequency_description"></td>
|
<td class="description_value" id="vtx_frequency_description"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="description vtx_power">
|
<tr class="description vtx_power">
|
||||||
<td class="description_text" i18n="vtxPower"></td>
|
<td class="description_text" i18n="vtxPower"></td>
|
||||||
<td class="description_value" id="vtx_power_description"></td>
|
<td class="description_value" id="vtx_power_description"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="description pit_mode">
|
<tr class="description pit_mode">
|
||||||
<td class="description_text" i18n="vtxPitMode"></td>
|
<td class="description_text" i18n="vtxPitMode"></td>
|
||||||
<td class="description_value" id="vtx_pit_mode_description"></td>
|
<td class="description_value" id="vtx_pit_mode_description"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="description vtx_pit_mode">
|
<tr class="description vtx_pit_mode">
|
||||||
<td class="description_text" i18n="vtxPitModeFrequency"></td>
|
<td class="description_text" i18n="vtxPitModeFrequency"></td>
|
||||||
<td class="description_value" id="vtx_pit_mode_frequency_description"></td>
|
<td class="description_value" id="vtx_pit_mode_frequency_description"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="description vtx_low_power_disarm">
|
<tr class="description vtx_low_power_disarm">
|
||||||
<td class="description_text" i18n="vtxLowPowerDisarm"></td>
|
<td class="description_text" i18n="vtxLowPowerDisarm"></td>
|
||||||
<td class="description_value" id="vtx_low_power_disarm_description"></td>
|
<td class="description_value" id="vtx_low_power_disarm_description"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</tbody>
|
||||||
</tbody>
|
</table>
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue