#656: COM1 frequency set to 0 at startup
Also, don't flood the screen with AI ATC messages when COM1/2 is set to 0 (ignore aircraft "transmissions" on frequency "0 MHz").
This commit is contained in:
parent
17590ba436
commit
a8d5ac90c6
2 changed files with 13 additions and 6 deletions
|
@ -111,8 +111,11 @@ void FGATCManager::init() {
|
|||
if (!runway.empty()) {
|
||||
controller = apt->getDynamics()->getTowerController();
|
||||
int stationFreq = apt->getDynamics()->getTowerFrequency(2);
|
||||
//cerr << "Setting radio frequency to in airfrequency: " << stationFreq << endl;
|
||||
fgSetDouble("/instrumentation/comm[0]/frequencies/selected-mhz", ((double) stationFreq / 100.0));
|
||||
if (stationFreq > 0)
|
||||
{
|
||||
//cerr << "Setting radio frequency to in airfrequency: " << stationFreq << endl;
|
||||
fgSetDouble("/instrumentation/comm[0]/frequencies/selected-mhz", ((double) stationFreq / 100.0));
|
||||
}
|
||||
leg = 3;
|
||||
string fltType = "ga";
|
||||
fp->setRunway(runway);
|
||||
|
@ -124,8 +127,11 @@ void FGATCManager::init() {
|
|||
} else {
|
||||
controller = apt->getDynamics()->getStartupController();
|
||||
int stationFreq = apt->getDynamics()->getGroundFrequency(1);
|
||||
//cerr << "Setting radio frequency to : " << stationFreq << endl;
|
||||
fgSetDouble("/instrumentation/comm[0]/frequencies/selected-mhz", ((double) stationFreq / 100.0));
|
||||
if (stationFreq > 0)
|
||||
{
|
||||
//cerr << "Setting radio frequency to : " << stationFreq << endl;
|
||||
fgSetDouble("/instrumentation/comm[0]/frequencies/selected-mhz", ((double) stationFreq / 100.0));
|
||||
}
|
||||
leg = 1;
|
||||
//double, lat, lon, head; // Unused variables;
|
||||
//int getId = apt->getDynamics()->getParking(gateId, &lat, &lon, &head);
|
||||
|
|
|
@ -725,8 +725,9 @@ void FGATCController::transmit(FGTrafficRecord * rec, FGAirportDynamics *parent,
|
|||
// the relevant frequency.
|
||||
// Note that distance attenuation is currently not yet implemented
|
||||
|
||||
if ((onBoardRadioFreqI0 == stationFreq)
|
||||
|| (onBoardRadioFreqI1 == stationFreq)) {
|
||||
if ((stationFreq > 0)&&
|
||||
((onBoardRadioFreqI0 == stationFreq)||
|
||||
(onBoardRadioFreqI1 == stationFreq))) {
|
||||
if (rec->allowTransmissions()) {
|
||||
|
||||
if( fgGetBool( "/sim/radio/use-itm-attenuation", false ) ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue