29#include <simgear/io/iostreams/sgstream.hxx>
30#include <simgear/misc/sg_path.hxx>
31#include <simgear/structure/exception.hxx>
32#include <simgear/debug/logstream.hxx>
33#include <simgear/sg_inlines.h>
34#include <simgear/props/props.hxx>
45 const std::string& aName,
const SGGeod& aPos,
46 int aFreq,
int aRange,
double aMultiuse,
PositionedID aRunway) :
70 SGVec3d thresholdCart(SGVec3d::fromGeod(rwy->
threshold()));
71 double axisLength = dist(
cart(), thresholdCart);
72 double landingLength = dist(thresholdCart, SGVec3d::fromGeod(rwy->
end()));
82 if (landingLength < 1200.0) {
91 double raw_width = 210.0 / axisLength * SGD_RADIANS_TO_DEGREES;
92 return raw_width < 6.0? raw_width : 6.0;
98 return (mColocated > 0);
108 return mName.find(
" VORTAC") != std::string::npos;
130 SG_LOG(SG_NAVAID, SG_DEV_WARN,
"called glideSlopeAngleDeg on non-GS navaid:" <<
ident());
134 const auto tmp =
static_cast<int>(
get_multiuse() / 1000.0);
135 return static_cast<double>(tmp) / 100.0;
141 const std::string&
ident,
142 const std::string&
name,
178 SGPropertyNode* ai_branch =
fgGetNode(
"ai/models");
183 "Can not update mobile navaid position (no ai/models branch)" );
187 const std::string& nav_name =
name();
190 simgear::PropertyList carrier = ai_branch->getChildren(
"carrier");
191 for(
size_t i = 0;
i < carrier.size(); ++
i)
193 const std::string carrier_name = carrier[
i]->getStringValue(
"name");
195 if( carrier_name.empty()
196 || nav_name.find(carrier_name) == std::string::npos )
204 const std::string tanker_branches[] = {
211 for(
size_t i = 0;
i <
sizeof(tanker_branches)/
sizeof(tanker_branches[0]); ++
i)
213 simgear::PropertyList tanker = ai_branch->getChildren(tanker_branches[
i]);
214 for(
size_t j = 0; j < tanker.size(); ++j)
216 const std::string callsign = tanker[j]->getStringValue(
"callsign");
219 || nav_name.find(callsign) == std::string::npos )
231 SGTimeStamp now = SGTimeStamp::now();
263 in >> n.channel >> n.freq ;
SGSharedPtr< FGRunway > FGRunwayRef
virtual const SGGeod & geod() const
virtual const SGVec3d & cart() const
The cartesian position associated with this object.
FGMobileNavRecord(PositionedID aGuid, Type type, const std::string &ident, const std::string &name, const SGGeod &aPos, int freq, int range, double multiuse, PositionedID aRunway)
double _initial_elevation_ft
SGTimeStamp _last_vehicle_update
SGPropertyNode_ptr _vehicle_node
FGNavRecord(PositionedID aGuid, Type type, const std::string &ident, const std::string &name, const SGGeod &aPos, int freq, int range, double multiuse, PositionedID aRunway)
void setColocatedDME(PositionedID other)
virtual const std::string & name() const
Return the name of this positioned.
double get_multiuse() const
double glideSlopeAngleDeg() const
extract the glide slope angle, in degrees, from the multiuse field Return 0.0 for non-GS navaids (inc...
PositionedID colocatedDME() const
double localizerWidth() const
return the localizer width, in degrees computation is based up ICAO stdandard width at the runway thr...
FGRunwayRef runway() const
Retrieve the runway this navaid is associated with (for ILS/LOC/GS)
void updateFromXML(const SGGeod &geod, double heading)
FGPositioned(PositionedID aGuid, Type ty, const std::string &aIdent, const SGGeod &aPos)
void modifyPosition(const SGGeod &newPos)
virtual const SGGeod & geod() const
virtual const SGVec3d & cart() const
The cartesian position associated with this object.
void invalidatePosition()
static SGSharedPtr< T > loadById(PositionedID id)
const std::string & ident() const
SGGeod end() const
Get the 'far' end - this is equivalent to calling pointOnCenterline(lengthFt());.
SGGeod threshold() const
Get the (possibly displaced) threshold point.
std::istream & operator>>(std::istream &in, FGTACANRecord &n)
SGPropertyNode * fgGetNode(const char *path, bool create)
Get a property node.