-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
63 lines (56 loc) · 1.68 KB
/
main.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#include <fstream>
#include <string>
#include "aircraft.h"
#include "isa.h"
#include "menu.h"
#include "parser.h"
#include "aircraft.h"
using namespace std;
int main()
{
cout<<" *** AICRAFT CG LIMITS ***"<<endl;
ifstream ac_file;
bool run = true;
while (run)
{
Aircraft acft;
choice uChoice = menu();
switch (uChoice)
{
case READFILE:
{
cout<<"WRITE ABSOLUTE PATH TO aircraft.cfg: "<<endl;
string file_name;
//getline(cin,file_name);
file_name="C:\\home\\marco\\Work\\Flight Dynamics\\B350\\CG\\XCG\\bin\\Debug\\aircraft.cfg";
ac_file.open(file_name.c_str());
if (!ac_file.is_open())
{
cout<<"File \""<<file_name<<"\" not found"<<endl;
return 1;
}
acft = parseCfgFile(ac_file);
acft.computeData();
acft.print();
ac_file.close();
break;
}
case PRINTISA:
{
ISA isa;
isa.print();
break;
}
case QUIT:
{
run = false;
break;
}
default:
cout<<"WRONG CHOICE. PLEASE MAKE ANOTHER ONE\n";
}
}
cout<<" *** END ***"<<endl;
return 0;
}