#include <Scenery/scenery.hxx>
#include <Navaids/navlist.hxx>
#include <Navaids/procedure.hxx>
-#include <Radio/radio.hxx>
#include "NasalSys.hxx"
{
double dv = p->getDoubleValue();
if (osg::isNaN(dv)) {
- SG_LOG(SG_GENERAL, SG_ALERT, "Nasal getprop: property " << p->getPath() << " is NaN");
+ SG_LOG(SG_NASAL, SG_ALERT, "Nasal getprop: property " << p->getPath() << " is NaN");
return naNil();
}
if(naIsNil(s)) continue;
buf += naStr_data(s);
}
- SG_LOG(SG_GENERAL, SG_ALERT, buf);
+ SG_LOG(SG_NASAL, SG_ALERT, buf);
return naNum(buf.length());
}
return vec;
}
-// Convert a cartesian point to a geodetic lat/lon/altitude.
-static naRef f_radioTransmission(naContext c, naRef me, int argc, naRef* args)
-{
- double lat, lon, elev, heading, pitch;
- if(argc != 5) naRuntimeError(c, "radioTransmission() expects 5 arguments");
- for(int i=0; i<argc; i++) {
- if(naIsNil(args[i]))
- return naNil();
- }
- lat = naNumValue(args[0]).num;
- lon = naNumValue(args[1]).num;
- elev = naNumValue(args[2]).num;
- heading = naNumValue(args[3]).num;
- pitch = naNumValue(args[4]).num;
- SGGeod geod = SGGeod::fromDegM(lon, lat, elev * SG_FEET_TO_METER);
- FGRadioTransmission *radio = new FGRadioTransmission;
- double signal = radio->receiveBeacon(geod, heading, pitch);
- delete radio;
- return naNum(signal);
-}
-
// Convert a geodetic lat/lon/altitude to a cartesian point.
static naRef f_geodtocart(naContext c, naRef me, int argc, naRef* args)
{
{ "geodinfo", f_geodinfo },
{ "airportinfo", f_airportinfo },
{ "navinfo", f_navinfo },
- { "radioTransmission", f_radioTransmission },
{ 0, 0 }
};