X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNavaids%2Fmarkerbeacon.cxx;h=769eda40a0d6399632539f96b31586104a0708c9;hb=6bf47cd248ed388e6a4dd3ffa2d00977b00b62fb;hp=71584504f3a312f4fa4ccee1ff47e6b31db3bb27;hpb=552c3149aeaaea7abdc00eee644ef81414644e7b;p=flightgear.git diff --git a/src/Navaids/markerbeacon.cxx b/src/Navaids/markerbeacon.cxx index 71584504f..769eda40a 100644 --- a/src/Navaids/markerbeacon.cxx +++ b/src/Navaids/markerbeacon.cxx @@ -24,45 +24,13 @@ #include "config.h" #endif -#include -#include - -#include "Navaids/markerbeacon.hxx" -#include "Airports/runways.hxx" -#include "Navaids/navdb.hxx" +#include using std::string; -FGPositioned::Type -FGMarkerBeaconRecord::mapType(int aTy) -{ - switch (aTy) { - case 7: return FGPositioned::OM; - case 8: return FGPositioned::MM; - case 9: return FGPositioned::IM; - default: - throw sg_range_exception("Got a non-marker-beacon-type", - "FGMarkerBeaconRecord::mapType"); - } -} - -FGMarkerBeaconRecord* -FGMarkerBeaconRecord::create(int aTy, const string& aName, const SGGeod& aPos) -{ - Type fgpTy = mapType(aTy); - FGRunway* runway = getRunwayFromName(aName); - SGGeod pos(aPos); - // fudge elevation to the runway elevation if it's not specified - if (fabs(pos.getElevationFt()) < 0.01) { - pos.setElevationFt(runway->elevation()); - } - - return new FGMarkerBeaconRecord(fgpTy, runway, pos); -} - - -FGMarkerBeaconRecord::FGMarkerBeaconRecord(Type aTy, FGRunway* aRunway, const SGGeod& aPos) : - FGPositioned(aTy, string(), aPos), +FGMarkerBeaconRecord::FGMarkerBeaconRecord(PositionedID aGuid, Type aTy, + PositionedID aRunway, const SGGeod& aPos) : + FGPositioned(aGuid, aTy, string(), aPos), _runway(aRunway) { }