#include "ATCDialog.hxx"
#include <Airports/runways.hxx>
+#include <simgear/math/polar3d.hxx>
#include <simgear/misc/sg_path.hxx>
#ifdef FG_WEATHERCM
FGApproach::FGApproach(){
comm1_node = fgGetNode("/radios/comm[0]/frequencies/selected-mhz", true);
comm2_node = fgGetNode("/radios/comm[1]/frequencies/selected-mhz", true);
+
+ _type = APPROACH;
num_planes = 0;
lon_node = fgGetNode("/position/longitude-deg", true);
}
void FGApproach::Init() {
- display = false;
}
const int max_trans = 20;
FGTransmission tmissions[max_trans];
int wpn;
- int station = 1;
+ atc_type station = APPROACH;
TransCode code;
TransPar TPar;
int i,j;
for (i=0; i<num_planes; i++) {
if ( planes[i].ident == "Player") {
- station = 1;
+ station = APPROACH;
tpars.station = name;
tpars.callsign = "Player";
tpars.airport = ident;
// loop over all transmissions for station
for ( j=0; j<=num_trans-1; j++ ) {
code = tmissions[j].get_code();
+ //cout << "code is " << code.c1 << " " << code.c2 << " " << code.c3 << '\n';
// select proper transmissions
- if ( ( code.c2 == -1 && planes[i].lmc.c3 == 0 ) ||
- ( code.c1 == 0 && code.c2 == planes[i].lmc.c2 ) ) {
- mentry = current_transmissionlist->gen_text(station, code, tpars, false);
- transm = current_transmissionlist->gen_text(station, code, tpars, true);
- // is the transmission already registered?
- if (!current_atcdialog->trans_reg( ident, transm )) {
- current_atcdialog->add_entry( ident, transm, mentry );
- }
+ if(code.c3 != 2) { // DCL - hack to prevent request crossing airspace being displayed since this isn't implemented yet.
+ if ( ( code.c2 == -1 && planes[i].lmc.c3 == 0 ) ||
+ ( code.c1 == 0 && code.c2 == planes[i].lmc.c2 ) ) {
+ mentry = current_transmissionlist->gen_text(station, code, tpars, false);
+ transm = current_transmissionlist->gen_text(station, code, tpars, true);
+ // is the transmission already registered?
+ if (!current_atcdialog->trans_reg( ident, transm, APPROACH )) {
+ current_atcdialog->add_entry( ident, transm, mentry, APPROACH, 0 );
+ }
+ }
}
}
}
tpars.alt = planes[i].aalt;
message = current_transmissionlist->gen_text(station, code, tpars, true );
//cout << "Approach transmitting...\n";
- //cout << message << '\n';
+ //cout << message << endl;
globals->get_ATC_display()->RegisterSingleMessage( message, 0 );
}
tpars.runway = active_runway;
message = current_transmissionlist->gen_text(station, code, tpars, true);
//cout << "Approach transmitting 2 ...\n";
- //cout << message << '\n';
+ //cout << message << endl;
globals->get_ATC_display()->RegisterSingleMessage( message, 0 );
}
planes[i].lmc = code;