diff --git a/src/ATC/transmissionlist.cxx b/src/ATC/transmissionlist.cxx index 28fd43117..7f5b09f62 100644 --- a/src/ATC/transmissionlist.cxx +++ b/src/ATC/transmissionlist.cxx @@ -45,52 +45,13 @@ FGTransmissionList *current_transmissionlist; -// Constructor FGTransmissionList::FGTransmissionList( void ) { } -// Destructor FGTransmissionList::~FGTransmissionList( void ) { } -/* -// ============================================================================ -// init menu window -// ============================================================================ -void mkATCMenuInit (void) -{ - int dx = 400; - int dy = 100; - int y = (fgGetInt("/sim/startup/ysize") - 10 - dy); - ATCMenuBox = new puDialogBox (10, y); - { - ATCMenuFrame = new puFrame (0,0,400,100); - ATCMenuBoxMessage = new puText (10, 70); - ATCMenuBoxMessage -> setLabel (""); - } - fgSetBool("/sim/atc/menu",false); - fgSetBool("/sim/atc/opt1",false); - fgSetBool("/sim/atc/opt2",false); - fgSetBool("/sim/atc/opt3",false); - fgSetBool("/sim/atc/opt4",false); - fgSetBool("/sim/atc/opt5",false); - fgSetBool("/sim/atc/opt6",false); - fgSetBool("/sim/atc/opt7",false); - fgSetBool("/sim/atc/opt8",false); - fgSetBool("/sim/atc/opt9",false); - fgSetBool("/sim/atc/opt0",false); -} - -// ATC Menu Message Box -void mkATCMenu ( const char *txt ) -{ - ATCMenuBoxMessage = new puText (10, 70); - ATCMenuBoxMessage->setLabel( txt ); - - FG_PUSH_PUI_DIALOG( ATCMenuBox ); -} -*/ // load default.transmissions bool FGTransmissionList::init( SGPath path ) { @@ -179,114 +140,114 @@ bool FGTransmissionList::query_station( const int &station, FGTransmission *t, } string FGTransmissionList::gen_text(const int &station, const TransCode code, - const TransPar &tpars, const bool ttext ) + const TransPar &tpars, const bool ttext ) { - const int cmax = 100; - string message; - char tag[4]; - char crej = '@'; - char mes[cmax]; - char dum[cmax]; - //char buf[10]; - char *pos; - int len; - FGTransmission t; - - // if (current_transmissionlist->query_station( station, &t ) ) { - transmission_list_type tmissions = transmissionlist_station[station]; - transmission_list_iterator current = tmissions.begin(); - transmission_list_iterator last = tmissions.end(); - - for ( ; current != last ; ++current ) { - if ( current->get_code().c1 == code.c1 && - current->get_code().c2 == code.c2 && - current->get_code().c3 == code.c3 ) { - - if ( ttext ) message = current->get_transtext(); - else message = current->get_menutext(); - strcpy( &mes[0], message.c_str() ); - - while ( strchr(&mes[0], crej) != NULL ) { - pos = strchr( &mes[0], crej ); - bcopy(pos, &tag[0], 3); - tag[3] = '\0'; - int i; - len = 0; - for ( i=0; iquery_station( station, &t ) ) { + transmission_list_type tmissions = transmissionlist_station[station]; + transmission_list_iterator current = tmissions.begin(); + transmission_list_iterator last = tmissions.end(); + + for ( ; current != last ; ++current ) { + if ( current->get_code().c1 == code.c1 && + current->get_code().c2 == code.c2 && + current->get_code().c3 == code.c3 ) { + + if ( ttext ) message = current->get_transtext(); + else message = current->get_menutext(); + strcpy( &mes[0], message.c_str() ); + + while ( strchr(&mes[0], crej) != NULL ) { + pos = strchr( &mes[0], crej ); + bcopy(pos, &tag[0], 3); + tag[3] = '\0'; + int i; + len = 0; + for ( i=0; i