00001 
00002 
00003 
00004 
00005 
00006 
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 
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     
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     
00039     try { 
00040             
00041         } 
00042     catch (std::exception &e) {
00043             std::cerr << ": " << e.what() << std::endl;
00044             return 1;
00045         }
00046 
00047     
00048     
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     
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 
00068 
00069 
00070 
00071 
00072 
00073 
00074