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

Main.cpp

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////////////////////////
00002 /*! \file Main.h
00003 *  \brief Sets up, and begins operation of a Whorl spacecraft simulator table.
00004 *  \author $Author: simpliciter $
00005 *  \version $Revision: 1.1 $
00006 *  \date    $Date: 2003/06/17 18:07:28 $
00007 *//////////////////////////////////////////////////////////////////////////////////////////////////
00008 /*! 
00009 */
00010 //////////////////////////////////////////////////////////////////////////////////////////////////
00011 
00012 #include "Brain.h"
00013 #include "Whorl.h"
00014 #include "Message.h"
00015 #include "CommObject.h"
00016 #include <string>
00017 #include <sstream>
00018 // Netxx Includes
00019 #include <Netxx/Netbuf.h>
00020 #include <Netxx/Stream.h>
00021 #include <Netxx/Timeout.h>
00022 #include <iostream>
00023 #include <exception>
00024 using namespace Netxx;
00025 using namespace std;
00026 int main()
00027 {
00028     // Setup Communications
00029     string serverName;
00030     string hostName;
00031     ifstream ifile;
00032     ifile.open("../ConfigFiles/hosts.txt");
00033     getline(ifile,hostName,' ');
00034     getline(ifile,serverName,'\n');
00035     ifile.close();
00036         cout << serverName << endl;
00037     Netxx::Stream client(serverName.c_str(), 7); 
00038     // Setup connections
00039     try { 
00040             //Netxx::Stream client(serverName.c_str(), 7); 
00041         } 
00042     catch (std::exception &e) {
00043             std::cerr << ": " << e.what() << std::endl;
00044             return 1;
00045         }
00046 
00047     
00048     // Spawn Brain/Whorl operating process
00049     CommObject Comms(client);
00050 
00051     Brain WhorlBrain;
00052     WhorlBrain.Initialize(&Comms, "../ConfigFiles/Whorl1Initialize.txt");
00053     WhorlBrain.GetWhorlObject();
00054     WhorlBrain.GetWhorlObject()->GetActuator("Wheel1");
00055     cout << ~reinterpret_cast<MomentumWheel*>(WhorlBrain.GetWhorlObject()->GetActuator("Wheel1"))->GetWheelAxis();
00056     
00057     // Begin watchdog operations
00058         vector<double> parms;
00059         parms.push_back(4);
00060         parms.push_back(3);
00061         parms.push_back(2);
00062         Message testMsg("TYPHON", "Thecla", "Test",parms);
00063     Comms.SendMessage(testMsg);
00064     return 0;
00065 }
00066 
00067 // Do not change the comments below - they will be added automatically by CVS
00068 /*****************************************************************************
00069 *       $Log: Main.cpp,v $
00070 *       Revision 1.1  2003/06/17 18:07:28  simpliciter
00071 *       Initial submission.
00072 *       
00073 *
00074 ******************************************************************************/

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