[helipad] Maintenance
This commit is contained in:
parent
95c62c0f30
commit
9a2a4cdb25
2 changed files with 96 additions and 106 deletions
|
@ -17,11 +17,11 @@
|
|||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/math/sg_geodesy.hxx>
|
||||
|
||||
#include "global.hxx"
|
||||
#include "apt_math.hxx"
|
||||
#include "debug.hxx"
|
||||
#include "global.hxx"
|
||||
#include "helipad.hxx"
|
||||
#include "runway.hxx"
|
||||
#include "debug.hxx"
|
||||
|
||||
|
||||
Helipad::Helipad(char* definition)
|
||||
|
@ -32,22 +32,13 @@ Helipad::Helipad(char* definition)
|
|||
// "H1 21.30433555 -157.85586778 0.00 10.70 10.70 2 0 0 0.25 0\r"
|
||||
|
||||
std::istringstream ss(definition);
|
||||
ss >> heli.designator
|
||||
>> heli.lat
|
||||
>> heli.lon
|
||||
>> heli.heading
|
||||
>> heli.length
|
||||
>> heli.width
|
||||
>> heli.surface
|
||||
>> heli.marking
|
||||
>> heli.shoulder
|
||||
>> heli.smoothness
|
||||
>> heli.edge_lights;
|
||||
ss >> heli.designator >> heli.lat >> heli.lon >> heli.heading >> heli.length >> heli.width >> heli.surface >> heli.marking >> heli.shoulder >> heli.smoothness >> heli.edge_lights;
|
||||
|
||||
TG_LOG(SG_GENERAL, SG_DEBUG, "Read helipad: (" << heli.lon << "," << heli.lat << ") heading: " << heli.heading << " length: " << heli.length << " width: " << heli.width);
|
||||
}
|
||||
|
||||
tglightcontour_list Helipad::gen_helipad_lights(double maxsize) {
|
||||
tglightcontour_list Helipad::gen_helipad_lights(double maxsize)
|
||||
{
|
||||
tglightcontour_list result;
|
||||
|
||||
// Vector calculation
|
||||
|
@ -195,8 +186,7 @@ void Helipad::BuildBtg( tgpolygon_list& rwy_polys,
|
|||
|
||||
build_helipad_shoulders(outer_area);
|
||||
|
||||
if (heli.edge_lights)
|
||||
{
|
||||
if (heli.edge_lights) {
|
||||
// Now generate the helipad lights
|
||||
tglightcontour_list s = gen_helipad_lights(heli_size);
|
||||
for (unsigned int i = 0; i < s.size(); ++i) {
|
||||
|
|
|
@ -40,12 +40,12 @@ public:
|
|||
tgpolygon_list& apt_clearing_polys,
|
||||
tgAccumulator& accum);
|
||||
|
||||
SGGeod GetLoc()
|
||||
SGGeod GetLoc() const
|
||||
{
|
||||
return SGGeod::fromDeg(heli.lon, heli.lat);
|
||||
}
|
||||
|
||||
bool GetsShoulder()
|
||||
bool GetsShoulder() const
|
||||
{
|
||||
return (heli.surface < 3) ? true : false;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
private:
|
||||
struct TGRunway {
|
||||
// data for helipad
|
||||
char designator[16];
|
||||
std::string designator;
|
||||
double lat;
|
||||
double lon;
|
||||
double heading;
|
||||
|
@ -74,7 +74,7 @@ private:
|
|||
|
||||
// generate an area for a runway with expansion specified in meters
|
||||
// (return result points in degrees)
|
||||
tgContour gen_helipad_area_w_extend(double length_extend, double width_extend)
|
||||
tgContour gen_helipad_area_w_extend(double length_extend, double width_extend) const
|
||||
{
|
||||
return (gen_wgs84_area(GetLoc(), heli.length + 2.0 * length_extend, 0.0, 0.0, heli.width + 2.0 * width_extend, heli.heading, false));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue