Begining of contains
This commit is contained in:
parent
46214e9dc3
commit
e677a345e0
1
build.sh
1
build.sh
@ -44,6 +44,7 @@ if [ "$1" = "mac" ] && [ "$DEBUG" = "1" ]
|
||||
then
|
||||
echo "Building dSYM"
|
||||
/opt/osxcross/target/bin/osxcross-llvm-dsymutil X-Plane/GAConnector/mac.xpl
|
||||
/opt/osxcross/target/bin/osxcross-llvm-dsymutil X-Plane/GAConnector/libixwebsocket.dylib
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@ -71,32 +71,9 @@ namespace file
|
||||
: designator(designator), bounds(bounds), width(width),
|
||||
length(length), trueHeading(trueHeading){};
|
||||
|
||||
inline bool containsPoint(geodata::point point)
|
||||
inline bool containsPoint(const geodata::point point) const
|
||||
{
|
||||
bool flag = false;
|
||||
double udegrees1 = this->bounds.topRight.latitude + 90;
|
||||
double udegrees2 = this->bounds.bottomLeft.latitude + 90;
|
||||
double udegrees3 = this->bounds.topLeft.latitude + 90;
|
||||
double udegrees4 = this->bounds.bottomRight.latitude + 90;
|
||||
double udegrees5 = this->bounds.topRight.longitude + 180;
|
||||
double udegrees6 = this->bounds.bottomLeft.longitude + 180;
|
||||
double udegrees7 = this->bounds.topLeft.longitude + 180;
|
||||
double udegrees8 = this->bounds.bottomRight.longitude + 180;
|
||||
double udegrees9 = point.longitude + 180;
|
||||
double udegrees10 = point.latitude + 90;
|
||||
if (udegrees9 > udegrees5 + (udegrees6 - udegrees5) /
|
||||
(udegrees1 - udegrees2) *
|
||||
(udegrees1 - udegrees10) &&
|
||||
udegrees9 < udegrees8 + (udegrees7 - udegrees8) /
|
||||
(udegrees4 - udegrees3) *
|
||||
(udegrees4 - udegrees10) &&
|
||||
udegrees10 > udegrees2 + (udegrees3 - udegrees2) /
|
||||
(udegrees7 - udegrees6) *
|
||||
(udegrees9 - udegrees6))
|
||||
flag = udegrees10 < udegrees1 + (udegrees4 - udegrees1) /
|
||||
(udegrees8 - udegrees5) *
|
||||
(udegrees9 - udegrees5);
|
||||
return flag;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline void toFile(std::ofstream &out) const
|
||||
|
||||
@ -283,6 +283,9 @@ void recordingWorker()
|
||||
germanairlinesva::file::recording::RecordingEntry lastPath;
|
||||
std::uint32_t segment = 0;
|
||||
|
||||
auto ap = (*database)["EDDF"];
|
||||
auto rwys = ap.second;
|
||||
|
||||
while (!wantsExit) {
|
||||
germanairlinesva::websocket::data copy;
|
||||
{
|
||||
@ -300,6 +303,12 @@ void recordingWorker()
|
||||
if (strcmp(copy.path, "") != 0 && copy.pause && lastPath != currentPath) {
|
||||
p.addEntry(currentPath);
|
||||
lastPath = currentPath;
|
||||
|
||||
for (const auto &it : rwys) {
|
||||
if (it.containsPoint({copy.lat, copy.lon})) {
|
||||
toLog("On Runway: " + it.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
segment++;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user