Skip to content

Commit c93251c

Browse files
committed
* adsb vehicle table
* add ADSB areas to GPS map * expand map up to bottom of visible area
1 parent 19ba259 commit c93251c

7 files changed

Lines changed: 472 additions & 176 deletions

File tree

js/fc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ var FC = {
4949
SERVO_DATA: null,
5050
GPS_DATA: null,
5151
ADSB_VEHICLES: null,
52+
ADSB_LIMITS: null,
53+
ADSB_WARNING_ICAO: null,
5254
MISSION_PLANNER: null,
5355
ANALOG: null,
5456
ARMING_CONFIG: null,
@@ -289,6 +291,17 @@ var FC = {
289291
vehicles: []
290292
};
291293

294+
this.ADSB_LIMITS = {
295+
adsb_distance_alert: 0,
296+
adsb_distance_warning: 0,
297+
adsb_ignore_plane_above_me_limit: 0,
298+
};
299+
300+
this.ADSB_WARNING_ICAO = {
301+
icao: 0,
302+
isAlert: 0,
303+
};
304+
292305
this.MISSION_PLANNER = new WaypointCollection();
293306

294307
this.ANALOG = {

js/msp/MSPCodes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ var MSPCodes = {
237237
MSP2_INAV_SELECT_MIXER_PROFILE: 0x2080,
238238

239239
MSP2_ADSB_VEHICLE_LIST: 0x2090,
240+
MSP2_ADSB_LIMITS: 0x2091,
241+
MSP2_ADSB_WARNING_VEHICLE_ICAO: 0x2092,
240242

241243
MSP2_INAV_CUSTOM_OSD_ELEMENTS: 0x2100,
242244
MSP2_INAV_CUSTOM_OSD_ELEMENT: 0x2101,

js/msp/MSPHelper.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,16 @@ var mspHelper = (function () {
228228
FC.ADSB_VEHICLES.vehicles.push(vehicle);
229229
}
230230
break;
231-
231+
case MSPCodes.MSP2_ADSB_LIMITS:
232+
FC.ADSB_LIMITS.adsb_distance_warning = data.getUint16(0, true);
233+
FC.ADSB_LIMITS.adsb_distance_alert = data.getUint16(2, true);
234+
FC.ADSB_LIMITS.adsb_ignore_plane_above_me_limit = data.getUint16(4, true);
235+
break;
236+
case MSPCodes.MSP2_ADSB_WARNING_VEHICLE_ICAO:
237+
FC.ADSB_WARNING_ICAO = {}
238+
FC.ADSB_WARNING_ICAO.icao = data.getUint32(0, true);
239+
FC.ADSB_WARNING_ICAO.isAlert = data.getUint8(4, true);
240+
break;
232241
case MSPCodes.MSP_ATTITUDE:
233242
FC.SENSOR_DATA.kinematics[0] = data.getInt16(0, true) / 10.0; // x
234243
FC.SENSOR_DATA.kinematics[1] = data.getInt16(2, true) / 10.0; // y
@@ -2938,6 +2947,14 @@ var mspHelper = (function () {
29382947
MSP.send_message(MSPCodes.MSPV2_INAV_MISC, false, false, callback);
29392948
};
29402949

2950+
self.loadADSBLimits = function (callback) {
2951+
MSP.send_message(MSPCodes.MSP2_ADSB_LIMITS, false, false, callback);
2952+
};
2953+
2954+
self.loadADSBWarningIcao = function (callback) {
2955+
MSP.send_message(MSPCodes.MSP2_ADSB_WARNING_VEHICLE_ICAO, false, false, callback);
2956+
};
2957+
29412958
self.loadOutputMapping = function (callback) {
29422959
console.warn('Warning: self.loadOutputMapping is obsolete and may be removed in future versions. Please update usage.');
29432960
MSP.send_message(MSPCodes.MSPV2_INAV_OUTPUT_MAPPING, false, false, callback);

locale/en/messages.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6201,6 +6201,39 @@
62016201
"adsbHeartbeatTotalMessages": {
62026202
"message": "Heartbeat msgs"
62036203
},
6204+
"adsbCallsign": {
6205+
"message": "Callsign"
6206+
},
6207+
"adsbAsl": {
6208+
"message": "Asl (m)"
6209+
},
6210+
"adsbHeading": {
6211+
"message": "Heading°"
6212+
},
6213+
"adsbType": {
6214+
"message": "Type"
6215+
},
6216+
"adsbAlt": {
6217+
"message": "Alt"
6218+
},
6219+
"adsbEmitter": {
6220+
"message": "Emitter"
6221+
},
6222+
"adsbAlert": {
6223+
"message": "Alert"
6224+
},
6225+
"adsbWarning": {
6226+
"message": "Warning"
6227+
},
6228+
"adsbNoWarning": {
6229+
"message": "None"
6230+
},
6231+
"adsbWarningIcao": {
6232+
"message": "Alert/Warning ICAO"
6233+
},
6234+
"adsbWarningType": {
6235+
"message": "Alert/Warning type"
6236+
},
62046237
"currentLanguage": {
62056238
"message": "en"
62066239
},

src/css/tabs/gps.css

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2+
.tab-gps .gps_content_wrapper {
3+
flex: 1;
4+
display: flex;
5+
min-height: 0;
6+
}
7+
8+
.tab-gps .cf_column.twothird {
9+
display: flex;
10+
flex-direction: column;
11+
min-height: 0;
12+
}
13+
14+
.tab-gps .gui_box.gps_map {
15+
flex: 1;
16+
display: flex;
17+
flex-direction: column;
18+
min-height: 0;
19+
}
20+
121
.tab-gps progress {
222
width: 100%;
323
border-radius: 3px;
@@ -44,12 +64,6 @@
4464
margin-top: 10px;
4565
}
4666

47-
.tab-gps #loadmap {
48-
height: 100%;
49-
width: 100%;
50-
float: left;
51-
}
52-
5367
.map-button {
5468
z-index:1;
5569
position: absolute;
@@ -118,7 +132,7 @@
118132
}
119133

120134
#gps-map {
121-
height: 400px;
135+
height: calc(100vh - 305px);
122136
width: 100%;
123137
float: left;
124138
position: relative;
@@ -139,12 +153,55 @@ progress[value]::-webkit-progress-value {
139153
box-shadow: 0 0 3px rgba(0, 0, 0, 0.25) inset;
140154
}
141155

142-
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
156+
.adsb-table__wrapper {
157+
width: 100%;
158+
overflow-x: auto;
159+
-webkit-overflow-scrolling: touch;
160+
display: block;
161+
}
143162

144-
#gps-map {
145-
height: 347px;
146-
width: 100%;
147-
float: left;
148-
}
163+
td.adsbVehicleList {
164+
overflow: hidden;
165+
max-width: 0;
166+
}
149167

168+
.adsb-table {
169+
width: 100%;
170+
border-collapse: collapse;
171+
font-size: 12px;
172+
}
173+
174+
.adsb-table__header {
175+
background: #e4e4e4;
176+
color: #000000;
177+
padding: 4px 8px;
178+
border: 1px solid #ccc;
179+
text-align: center;
180+
white-space: nowrap;
181+
}
182+
183+
.adsb-table__cell {
184+
padding: 3px 8px;
185+
border: 1px solid #ccc;
186+
text-align: center;
187+
color: #252525;
188+
background-color: #f9f9f9;
189+
}
190+
191+
.adsb-table__row--alert .adsb-table__cell {
192+
background-color: #f66464;
193+
}
194+
195+
.adsb-table__row--warning .adsb-table__cell {
196+
background-color: #fdbea9;
197+
}
198+
199+
.adsb-table__row--stale {
200+
opacity: 0.5;
201+
}
202+
203+
.adsb-table__empty {
204+
text-align: center;
205+
padding: 8px;
206+
color: #323232;
150207
}

0 commit comments

Comments
 (0)