Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ var FC = {
SERVO_DATA: null,
GPS_DATA: null,
ADSB_VEHICLES: null,
ADSB_LIMITS: null,
ADSB_WARNING_ICAO: null,
MISSION_PLANNER: null,
ANALOG: null,
ARMING_CONFIG: null,
Expand Down Expand Up @@ -289,6 +291,17 @@ var FC = {
vehicles: []
};

this.ADSB_LIMITS = {
adsb_distance_alert: 0,
adsb_distance_warning: 0,
adsb_ignore_plane_above_me_limit: 0,
};

this.ADSB_WARNING_ICAO = {
icao: 0,
isAlert: 0,
};

this.MISSION_PLANNER = new WaypointCollection();

this.ANALOG = {
Expand Down
2 changes: 2 additions & 0 deletions js/msp/MSPCodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ var MSPCodes = {
MSP2_INAV_SELECT_MIXER_PROFILE: 0x2080,

MSP2_ADSB_VEHICLE_LIST: 0x2090,
MSP2_ADSB_LIMITS: 0x2091,
MSP2_ADSB_WARNING_VEHICLE_ICAO: 0x2092,

MSP2_INAV_CUSTOM_OSD_ELEMENTS: 0x2100,
MSP2_INAV_CUSTOM_OSD_ELEMENT: 0x2101,
Expand Down
19 changes: 18 additions & 1 deletion js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,16 @@ var mspHelper = (function () {
FC.ADSB_VEHICLES.vehicles.push(vehicle);
}
break;

case MSPCodes.MSP2_ADSB_LIMITS:
FC.ADSB_LIMITS.adsb_distance_warning = data.getUint16(0, true);
FC.ADSB_LIMITS.adsb_distance_alert = data.getUint16(2, true);
FC.ADSB_LIMITS.adsb_ignore_plane_above_me_limit = data.getUint16(4, true);
break;
case MSPCodes.MSP2_ADSB_WARNING_VEHICLE_ICAO:
FC.ADSB_WARNING_ICAO = {}
FC.ADSB_WARNING_ICAO.icao = data.getUint32(0, true);
FC.ADSB_WARNING_ICAO.isAlert = data.getUint8(4, true);
break;
case MSPCodes.MSP_ATTITUDE:
FC.SENSOR_DATA.kinematics[0] = data.getInt16(0, true) / 10.0; // x
FC.SENSOR_DATA.kinematics[1] = data.getInt16(2, true) / 10.0; // y
Expand Down Expand Up @@ -2947,6 +2956,14 @@ var mspHelper = (function () {
MSP.send_message(MSPCodes.MSPV2_INAV_MISC, false, false, callback);
};

self.loadADSBLimits = function (callback) {
MSP.send_message(MSPCodes.MSP2_ADSB_LIMITS, false, false, callback);
};

self.loadADSBWarningIcao = function (callback) {
MSP.send_message(MSPCodes.MSP2_ADSB_WARNING_VEHICLE_ICAO, false, false, callback);
};

self.loadOutputMapping = function (callback) {
console.warn('Warning: self.loadOutputMapping is obsolete and may be removed in future versions. Please update usage.');
MSP.send_message(MSPCodes.MSPV2_INAV_OUTPUT_MAPPING, false, false, callback);
Expand Down
33 changes: 33 additions & 0 deletions locale/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6215,6 +6215,39 @@
"adsbHeartbeatTotalMessages": {
"message": "Heartbeat msgs"
},
"adsbCallsign": {
"message": "Callsign"
},
"adsbAsl": {
"message": "Asl (m)"
},
"adsbHeading": {
"message": "Heading°"
},
"adsbType": {
"message": "Type"
},
"adsbAlt": {
"message": "Alt"
},
"adsbEmitter": {
"message": "Emitter"
},
"adsbAlert": {
"message": "Alert"
},
"adsbWarning": {
"message": "Warning"
},
"adsbNoWarning": {
"message": "None"
},
"adsbWarningIcao": {
"message": "Alert/Warning ICAO"
},
"adsbWarningType": {
"message": "Alert/Warning type"
},
"currentLanguage": {
"message": "en"
},
Expand Down
83 changes: 70 additions & 13 deletions src/css/tabs/gps.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@

.tab-gps .gps_content_wrapper {
flex: 1;
display: flex;
min-height: 0;
}

.tab-gps .cf_column.twothird {
display: flex;
flex-direction: column;
min-height: 0;
}

.tab-gps .gui_box.gps_map {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}

.tab-gps progress {
width: 100%;
border-radius: 3px;
Expand Down Expand Up @@ -44,12 +64,6 @@
margin-top: 10px;
}

.tab-gps #loadmap {
height: 100%;
width: 100%;
float: left;
}

.map-button {
z-index:1;
position: absolute;
Expand Down Expand Up @@ -118,7 +132,7 @@
}

#gps-map {
height: 400px;
height: calc(100vh - 305px);
width: 100%;
float: left;
position: relative;
Expand All @@ -139,12 +153,55 @@ progress[value]::-webkit-progress-value {
box-shadow: 0 0 3px rgba(0, 0, 0, 0.25) inset;
}

@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
.adsb-table__wrapper {
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
display: block;
}

#gps-map {
height: 347px;
width: 100%;
float: left;
}
td.adsbVehicleList {
overflow: hidden;
max-width: 0;
}

.adsb-table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
}

.adsb-table__header {
background: #e4e4e4;
color: #000000;
padding: 4px 8px;
border: 1px solid #ccc;
text-align: center;
white-space: nowrap;
}

.adsb-table__cell {
padding: 3px 8px;
border: 1px solid #ccc;
text-align: center;
color: #252525;
background-color: #f9f9f9;
}

.adsb-table__row--alert .adsb-table__cell {
background-color: #f66464;
}

.adsb-table__row--warning .adsb-table__cell {
background-color: #fdbea9;
}

.adsb-table__row--stale {
opacity: 0.5;
}

.adsb-table__empty {
text-align: center;
padding: 8px;
color: #323232;
}
12 changes: 12 additions & 0 deletions tabs/gps.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,18 @@
<td style="width: 85px" data-i18n="adsbHeartbeatTotalMessages"></td>
<td class="adsbHeartbeatTotalMessages">0</td>
</tr>
<tr class="adsbWarningIcaoRow">
<td style="width: 85px" data-i18n="adsbWarningIcao"></td>
<td class="adsbWarningIcao"></td>
</tr>
<tr class="adsbWarningTypeRow">
<td style="width: 85px" data-i18n="adsbWarningType"></td>
<td class="adsbWarningType"></td>
</tr>
<tr class="adsbVehicleListRow">
<td colspan="2" class="adsbVehicleList">
</td>
</tr>
</table>
</div>
</div>
Expand Down
Loading
Loading