-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_contact.cpp
41 lines (33 loc) · 1.3 KB
/
main_contact.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "contact/contact_time.h"
/*
* BERECHNET KONTAKTZEITPUNKTE MIT SATELLITEN AUF BASIS EINES TLE
*/
// ############### CONTACT CALCULATION: CONDITION ###############
const constexpr double MIN_ELEVATION = M_PI / 36; // entspricht 5 Grad (gehört zur bool Funktion, deswegen nicht in Header!)
bool checkContact(double ele) noexcept
{
if (ele >= MIN_ELEVATION)
{
return true;
}
else if (ele < MIN_ELEVATION)
{
return false;
}
return false;
}
// ##############################################################
int main(void) // Enthält beispielhafte Implementierung
{
// Beispielhafter Aufruf einer Kontaktzeitberechnung:
// Nötig:
// - Condition um Verbindungsanforderung zu prüfen (siehe oben)
// - TLE als Klasse Tle
// - Start- und Endzeitpunkt
const auto tles {readTlesFromFile("ISS.txt")};
const auto sonate {tles.at(25544)}; // select Sonate
const GregorianCalendar ENDE {2020, 6, 16, 0, 0, 0};
const GregorianCalendar START {2020, 6, 15, 0, 0, 0};
bool (*condition)(double) = checkContact; // Funktionszeiger auf Condition-Function (prüft in DetermineContactTimes bei jeder Iteration ob eine Verbindung zu dem Satelliten besteht)
DetermineContactTimes("Ausgabe.txt", sonate, START, ENDE, 0.275, 49.78, 9.97, condition);
}