return nasal::to_nasal(c, iap->ident());
}
-//------------------------------------------------------------------------------
-naRef to_nasal_helper(naContext c, const SGGeod& pos)
-{
- nasal::Hash hash(c);
- hash.set("lat", pos.getLatitudeDeg());
- hash.set("lon", pos.getLongitudeDeg());
- hash.set("elevation", pos.getElevationM());
- return hash.get_naRef();
-}
-
//------------------------------------------------------------------------------
static naRef f_navaid_course(naContext, FGNavRecord& nav)
{
static naRef f_findByIdent(nasal::CallContext ctx)
{
std::string prefix = ctx.requireArg<std::string>(0);
-
- FGPositioned::TypeFilter filter(FGPositioned::typeFromName(ctx.getArg<std::string>(1)));
+ std::string typeSpec = ctx.getArg<std::string>(1);
+ FGPositioned::TypeFilter filter(FGPositioned::TypeFilter::fromString(typeSpec));
bool exact = ctx.getArg<bool>(2, false);
return ctx.to_nasal( FGPositioned::findAllWithIdent(prefix, &filter, exact) );
static naRef f_findByName(nasal::CallContext ctx)
{
std::string prefix = ctx.requireArg<std::string>(0);
-
- FGPositioned::TypeFilter filter(FGPositioned::typeFromName(ctx.getArg<std::string>(1)));
+ std::string typeSpec = ctx.getArg<std::string>(1);
+ FGPositioned::TypeFilter filter(FGPositioned::TypeFilter::fromString(typeSpec));
return ctx.to_nasal( FGPositioned::findAllWithName(prefix, &filter, false) );
}
.method("getStar", &FGAirport::findSTARWithIdent)
.method("getIAP", &FGAirport::findApproachWithIdent)
.method("tostring", &FGAirport::toString);
-
+
nasal::Hash globals(globalsRef, c),
positioned( globals.createHash("positioned") );