Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

thruster_test.cpp

Go to the documentation of this file.
00001 /************************************************************************************************/
00002 /*! \file thruster_test.cpp
00003 *  \brief Simple main file to illustrate thruster code
00004 *  \author $Author: shoemaker $
00005 *  \version $Revision: 1.1 $
00006 *  \date    $Date: 2004/05/27 19:56:32 $
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         // Thruster 1 duty cycle
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         // Thruster 2 duty cycle
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 // Do not change the comments below - they will be added automatically by CVS
00070 /*****************************************************************************
00071 *       $Log: thruster_test.cpp,v $
00072 *       Revision 1.1  2004/05/27 19:56:32  shoemaker
00073 *       Initial submission of thruster class test code
00074 *       
00075 */
00076 

Generated on Wed Sep 5 12:54:26 2007 for DSACSS Operational Code by  doxygen 1.3.9.1