Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2559,6 +2559,12 @@
"gps3dFix": {
"message": "3D Fix:"
},
"gpsFixTrue": {
"message": "True"
},
"gpsFixFalse": {
"message": "False"
},
"gpsAltitude": {
"message": "Altitude:"
},
Expand Down Expand Up @@ -6133,6 +6139,14 @@
"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"
},
"vtxReadyTrue": {
"message": "True",
"description": "vtx device are ready"
},
"vtxReadyFalse": {
"message": "False",
"description": "vtx device are not ready"
},
"vtxDeviceReady": {
"message": "Device ready",
"description": "Text of one of the fields of the VTX tab"
Expand Down
40 changes: 27 additions & 13 deletions src/css/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -1715,19 +1715,33 @@ dialog {
height: auto;
}
}
.fixtrue {
background-color: #56ac1d;
padding: 2px 5px;
border-radius: 3px;
color: #fff;
font-size: 10px;
}
.fixfalse {
background-color: #e60000;
padding: 2px 5px;
border-radius: 3px;
color: #fff;
font-size: 10px;
.fix {
background-color: #e60000;
padding: 2px 5px;
border-radius: 3px;
color: #fff;
font-size: 10px;
}
.fix.active {
background-color: #56ac1d;
padding: 2px 5px;
border-radius: 3px;
color: #fff;
font-size: 10px;
}
.vtx_device_ready {
background-color: #e60000;
padding: 2px 5px;
border-radius: 3px;
color: #fff;
font-size: 10px;
}
.vtx_device_ready.active {
background-color: #56ac1d;
padding: 2px 5px;
border-radius: 3px;
color: #fff;
font-size: 10px;
}
.buildInfoBtn {
position: relative;
Expand Down
4 changes: 2 additions & 2 deletions src/js/tabs/gps.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { have_sensor } from "../sensor_helpers";
import { mspHelper } from '../msp/MSPHelper';
import { reinitializeConnection } from '../serial_backend';
import { updateTabList } from '../utils/updateTabList';
import { getColorYesNo } from "../utils/common";

const gps = {};

Expand Down Expand Up @@ -193,7 +192,8 @@ gps.initialize = async function (callback) {
const healthyArray = ['gnssHealthyUnknown', 'gnssHealthyHealthy', 'gnssHealthyUnhealthy', 'gnssHealthyUnknown'];
let alt = FC.GPS_DATA.alt;

$('.GPS_info td.fix').html(getColorYesNo(FC.GPS_DATA.fix));
$('.GPS_info span.fix').text((FC.GPS_DATA.fix) ? i18n.getMessage('gpsFixTrue') : i18n.getMessage('gpsFixFalse'));
$('.GPS_info span.fix').toggleClass('active', FC.GPS_DATA.fix != 0);

$('.GPS_info td.alt').text(`${alt} m`);
$('.GPS_info td.lat a').prop('href', url).text(`${lat.toFixed(4)} deg`);
Expand Down
7 changes: 4 additions & 3 deletions src/js/tabs/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Model from '../model';
import MSPCodes from '../msp/MSPCodes';
import CONFIGURATOR, { API_VERSION_1_42, API_VERSION_1_43, API_VERSION_1_46 } from '../data_storage';
import { gui_log } from '../gui_log';
import { getColorYesNo } from "../utils/common";

const setup = {
yaw_fix: 0.0,
Expand Down Expand Up @@ -193,7 +192,7 @@ setup.initialize = function (callback) {
rssi_e = $('.rssi'),
cputemp_e = $('.cpu-temp'),
arming_disable_flags_e = $('.arming-disable-flags'),
gpsFix_e = $('.gpsFix'),
gpsFix_e = $('.GPS_info span.fix'),
gpsSats_e = $('.gpsSats'),
gpsLat_e = $('.gpsLat'),
gpsLon_e = $('.gpsLon'),
Expand Down Expand Up @@ -429,7 +428,9 @@ setup.initialize = function (callback) {

// GPS info is acquired in the background using update_live_status() in serial_backend.js

gpsFix_e.html(getColorYesNo(FC.GPS_DATA.fix));
gpsFix_e.text((FC.GPS_DATA.fix) ? i18n.getMessage('gpsFixTrue') : i18n.getMessage('gpsFixFalse'));
gpsFix_e.toggleClass("active", FC.GPS_DATA.fix != 0);

gpsSats_e.text(FC.GPS_DATA.numSat);
gpsLat_e.text(`${(FC.GPS_DATA.lat / 10000000).toFixed(4)} deg`);
gpsLon_e.text(`${(FC.GPS_DATA.lon / 10000000).toFixed(4)} deg`);
Expand Down
11 changes: 8 additions & 3 deletions src/js/tabs/vtx.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import MSPCodes from "../msp/MSPCodes";
import { API_VERSION_1_42, API_VERSION_1_44 } from '../data_storage';
import UI_PHONES from "../phones_ui";
import { gui_log } from "../gui_log";
import { checkChromeRuntimeError, getColorYesNo } from "../utils/common";
import { checkChromeRuntimeError } from "../utils/common";

const vtx = {
supported: false,
Expand Down Expand Up @@ -47,8 +47,11 @@ vtx.updateVtxDeviceStatus = function()

function vtxDeviceStatusReady()
{
const vtxReady_e = $('.VTX_info span.vtx_device_ready');

// update device ready state
$("#vtx_device_ready_description").html(getColorYesNo(FC.VTX_CONFIG.vtx_device_ready));
vtxReady_e.text((FC.VTX_CONFIG.vtx_device_ready) ? i18n.getMessage('vtxReadyTrue') : i18n.getMessage('vtxReadyFalse'));
vtxReady_e.toggleClass('active', FC.VTX_CONFIG.vtx_device_ready);
}

MSP.send_message(MSPCodes.MSP2_GET_VTX_DEVICE_STATUS, false, false, vtxDeviceStatusReceived);
Expand Down Expand Up @@ -296,7 +299,9 @@ vtx.initialize = function (callback) {
$("#vtx_low_power_disarm").val(FC.VTX_CONFIG.vtx_low_power_disarm);

// Values of the current values
$("#vtx_device_ready_description").html(getColorYesNo(FC.VTX_CONFIG.vtx_device_ready));
const vtxReady_e = $('.VTX_info span.vtx_device_ready');
vtxReady_e.text((FC.VTX_CONFIG.vtx_device_ready) ? i18n.getMessage('vtxReadyTrue') : i18n.getMessage('vtxReadyFalse'));
vtxReady_e.toggleClass("active", FC.VTX_CONFIG.vtx_device_ready);

$("#vtx_type_description").text(self.getVtxTypeString());
$("#vtx_channel_description").text(FC.VTX_CONFIG.vtx_channel);
Expand Down
8 changes: 0 additions & 8 deletions src/js/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,3 @@ $.fn.sortSelect = function(text = "") {

return this.empty().append(op);
};

/*
* return Yes or No with Color from class fixtrue or fixfalse
*/

export function getColorYesNo(value) {
return (value ? `<span class="fixtrue">${i18n.getMessage("Yes")}</span>` : `<span class="fixfalse">${i18n.getMessage("No")}</span>`);
}
6 changes: 2 additions & 4 deletions src/tabs/gps.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

<div class="grid-row">
<div class="grid-col col5">

<div class="gui_box grey gps">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationGPS"></div>
Expand Down Expand Up @@ -77,16 +76,15 @@
</div>

<div class="grid-col col7">

<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="gpsHead"></div>
</div>
<div class="spacer_box GPS_info">
<table class="cf_table">
<tr>
<td style="width: 85px" i18n="gps3dFix"></td>
<td class="fix" i18n="gpsFixFalse"></td>
<td i18n="gps3dFix"></td>
<td><span class="fix" i18n="gpsFixFalse"></span></td>
</tr>
<tr>
<td i18n="gpsAltitude"></td>
Expand Down
4 changes: 2 additions & 2 deletions src/tabs/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@
<div class="spacer_box_title" i18n="initialSetupGPSHead"></div>
<div class="helpicon cf_tip" i18n_title="initialSetupGPSHeadHelp"></div>
</div>
<div class="spacer_box">
<div class="spacer_box GPS_info">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">
<tbody>
<tr>
<td i18n="gps3dFix"></td>
<td class="gpsFix"></td>
<td><span class="fix" i18n="gpsFixFalse"></span></td>
</tr>
<tr>
<td i18n="gpsSats"></td>
Expand Down
6 changes: 3 additions & 3 deletions src/tabs/vtx.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@
<div class="spacer_box_title" i18n="vtxActualState"></div>
</div>

<div class="spacer_box">
<div class="spacer_box VTX_info">
<table class="cf_table">
<tbody>
<tr class="description vtx_device_ready">
<tr>
<td class="description_text" i18n="vtxDeviceReady"></td>
<td id="vtx_device_ready_description"></td>
<td><span class="vtx_device_ready" i18n="vtxReadyFalse"></span></td>
</tr>
<tr class="description vtx_type">
<td class="description_text" i18n="vtxType"></td>
Expand Down