[linked_objects] Maintenance
This commit is contained in:
parent
c04eab3101
commit
c8ea78fbe6
2 changed files with 17 additions and 29 deletions
|
@ -1,50 +1,38 @@
|
|||
#include <simgear/debug/logstream.hxx>
|
||||
|
||||
#include "linked_objects.hxx"
|
||||
#include "debug.hxx"
|
||||
#include "linked_objects.hxx"
|
||||
|
||||
|
||||
Windsock::Windsock(char* definition)
|
||||
{
|
||||
std::istringstream ss(definition);
|
||||
ss >> lat
|
||||
>> lon
|
||||
>> lit;
|
||||
ss >> lat >> lon >> lit;
|
||||
|
||||
TG_LOG(SG_GENERAL, SG_DEBUG, "Read Windsock: (" << lon << "," << lat << ") lit: " << lit );
|
||||
TG_LOG(SG_GENERAL, SG_DEBUG, "Read Windsock: (" << lon << "," << lat << ") lit: " << lit);
|
||||
}
|
||||
|
||||
Beacon::Beacon(char* definition)
|
||||
{
|
||||
std::istringstream ss(definition);
|
||||
ss >> lat
|
||||
>> lon
|
||||
>> code;
|
||||
ss >> lat >> lon >> code;
|
||||
|
||||
TG_LOG(SG_GENERAL, SG_DEBUG, "Read Beacon: (" << lon << "," << lat << ") code: " << code );
|
||||
TG_LOG(SG_GENERAL, SG_DEBUG, "Read Beacon: (" << lon << "," << lat << ") code: " << code);
|
||||
}
|
||||
|
||||
Sign::Sign(char* definition)
|
||||
{
|
||||
char sgdef[256];
|
||||
std::string sgdef;
|
||||
double def_heading;
|
||||
|
||||
std::istringstream ss(definition);
|
||||
ss >> lat
|
||||
>> lon
|
||||
>> def_heading
|
||||
>> reserved
|
||||
>> size
|
||||
>> sgdef;
|
||||
ss >> lat >> lon >> def_heading >> reserved >> size >> sgdef;
|
||||
|
||||
// 850 format sign heading is the heading which points away from the visible numbers
|
||||
// Flightgear wants the heading to be the heading in which the sign is read
|
||||
heading = -def_heading + 360.0;
|
||||
|
||||
TG_LOG(SG_GENERAL, SG_DEBUG, "Read Sign: (" << lon << "," << lat <<
|
||||
") heading " << def_heading <<
|
||||
" size " << size <<
|
||||
" definition: " << sgdef <<
|
||||
" calc view heading: " << heading );
|
||||
TG_LOG(SG_GENERAL, SG_DEBUG, "Read Sign: (" << lon << "," << lat << ") heading " << def_heading << " size " << size << " definition: " << sgdef << " calc view heading: " << heading);
|
||||
|
||||
sgn_def = sgdef;
|
||||
}
|
||||
|
|
|
@ -14,12 +14,12 @@ public:
|
|||
double lon;
|
||||
int lit;
|
||||
|
||||
SGGeod GetLoc()
|
||||
SGGeod GetLoc() const
|
||||
{
|
||||
return SGGeod::fromDeg(lon, lat);
|
||||
}
|
||||
|
||||
bool IsLit()
|
||||
bool IsLit() const
|
||||
{
|
||||
return (lit == 1) ? true : false;
|
||||
}
|
||||
|
@ -37,12 +37,12 @@ public:
|
|||
double lon;
|
||||
int code;
|
||||
|
||||
SGGeod GetLoc()
|
||||
SGGeod GetLoc() const
|
||||
{
|
||||
return SGGeod::fromDeg(lon, lat);
|
||||
}
|
||||
|
||||
int GetCode()
|
||||
int GetCode() const
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
@ -62,22 +62,22 @@ public:
|
|||
int size;
|
||||
std::string sgn_def;
|
||||
|
||||
SGGeod GetLoc()
|
||||
SGGeod GetLoc() const
|
||||
{
|
||||
return SGGeod::fromDeg(lon, lat);
|
||||
}
|
||||
|
||||
double GetHeading()
|
||||
double GetHeading() const
|
||||
{
|
||||
return heading;
|
||||
}
|
||||
|
||||
std::string GetDefinition()
|
||||
std::string GetDefinition() const
|
||||
{
|
||||
return sgn_def;
|
||||
}
|
||||
|
||||
int GetSize()
|
||||
int GetSize() const
|
||||
{
|
||||
return size;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue