call from FGATCController::transmit()
This commit is contained in:
parent
655b88dd17
commit
98a94d83ef
3 changed files with 23 additions and 3 deletions
|
@ -743,7 +743,27 @@ void FGATCController::transmit(FGTrafficRecord * rec, FGAirportDynamics *parent,
|
||||||
|| (onBoardRadioFreqI1 == stationFreq)) {
|
|| (onBoardRadioFreqI1 == stationFreq)) {
|
||||||
if (rec->allowTransmissions()) {
|
if (rec->allowTransmissions()) {
|
||||||
|
|
||||||
fgSetString("/sim/messages/atc", text.c_str());
|
if( fgGetBool( "/instrumentation/use-itm-attenuation", false ) ) {
|
||||||
|
FGRadio* radio = new FGRadio();
|
||||||
|
SGGeod sender_pos;
|
||||||
|
double sender_alt_ft, sender_alt;
|
||||||
|
if(ground_to_air) {
|
||||||
|
sender_alt_ft = parent->getElevation();
|
||||||
|
sender_alt = sender_alt_ft * SG_FEET_TO_METER;
|
||||||
|
sender_pos= SGGeod::fromDegM( parent->getLongitude(),
|
||||||
|
parent->getLatitude(), sender_alt );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sender_alt_ft = rec->getAltitude();
|
||||||
|
sender_alt = sender_alt_ft * SG_FEET_TO_METER;
|
||||||
|
sender_pos= SGGeod::fromDegM( rec->getLongitude(),
|
||||||
|
rec->getLatitude(), sender_alt );
|
||||||
|
}
|
||||||
|
radio->receiveText(sender_pos, stationFreq, text, ground_to_air);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fgSetString("/sim/messages/atc", text.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -453,7 +453,7 @@ public:
|
||||||
void setDt(double dt) {
|
void setDt(double dt) {
|
||||||
dt_count = dt;
|
dt_count = dt;
|
||||||
};
|
};
|
||||||
void transmit(FGTrafficRecord *rec, AtcMsgId msgId, AtcMsgDir msgDir, bool audible);
|
void transmit(FGTrafficRecord *rec, FGAirportDynamics *parent, AtcMsgId msgId, AtcMsgDir msgDir, bool audible);
|
||||||
string getGateName(FGAIAircraft *aircraft);
|
string getGateName(FGAIAircraft *aircraft);
|
||||||
virtual void render(bool) = 0;
|
virtual void render(bool) = 0;
|
||||||
virtual string getName() = 0;
|
virtual string getName() = 0;
|
||||||
|
|
|
@ -54,7 +54,7 @@ FGRadio::~FGRadio()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
double FGCommRadio::getFrequency(int radio) {
|
double FGRadio::getFrequency(int radio) {
|
||||||
double freq = 118.0;
|
double freq = 118.0;
|
||||||
switch (radio) {
|
switch (radio) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|
Loading…
Reference in a new issue