00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "Whorl.h"
00013 #include "WhorlSim.h"
00014 #include "CfgParse.h"
00015 #include "Measurement.h"
00016 #include <iostream>
00017 #include <fstream>
00018 #include <sys/time.h>
00019 #include <unistd.h>
00020
00021 using namespace std;
00022
00023 int main()
00024 {
00025 cout << " Prepare for parsing " << endl;
00026 cfgBody *cfgDat;
00027 CfgParse parser;
00028
00029 cout << " Parsing whorl... " << endl;
00030 cfgDat = parser.go("thruster_whorl.cfg");
00031 cout << " done " << endl;
00032
00033 Whorl whorlOne;
00034 whorlOne.Initialize(cfgDat);
00035
00036 cout << " Simulation will now begin " << endl;
00037
00038
00039
00040
00041 cout << "Th1 Air pressure is: " << whorlOne.GetThruster(string("th1"))->GetCurrentPressure() << endl;
00042 cout << "Th1 Thrust level is: " << whorlOne.GetThruster(string("th1"))->GetThrustLevel() << endl << endl;
00043
00044 cout << " Thruster 1: ON " << endl;
00045 whorlOne.GetThruster(string("th1"))->StartFire();
00046 usleep(2000000);
00047 cout << " Thruster 1: OFF " << endl;
00048 whorlOne.GetThruster(string("th1"))->StopFire();
00049
00050
00051 cout << " Pause for 5 seconds " << endl;
00052 sleep(5);
00053
00054
00055
00056
00057
00058 cout << "Th2 Air pressure is: " << whorlOne.GetThruster(string("th2"))->GetCurrentPressure() << endl;
00059 cout << "Th2 Thrust level is: " << whorlOne.GetThruster(string("th2"))->GetThrustLevel() << endl << endl;
00060
00061 cout << " Thruster 2: ON " << endl;
00062 whorlOne.GetThruster(string("th2"))->StartFire();
00063 usleep(2000000);
00064 cout << " Thruster 2: OFF " << endl;
00065 whorlOne.GetThruster(string("th2"))->StopFire();
00066 return 0;
00067 };
00068
00069
00070
00071
00072
00073
00074
00075
00076