Ignore:
Timestamp:
Nov 4, 2009, 11:20:00 AM (15 years ago)
Author:
Christoph Mayer
Message:

-ovlvis verschoben und 3dvis hinzu

Location:
source/ariba/utility/visual
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/visual/OvlVis.cpp

    r6584 r6822  
    4242namespace utility {
    4343
    44 //*****************************************************
    45 //*****************************************************
    46 //*****************************************************
    47 
    4844use_logging_cpp(OvlVis);
    4945
    50 OvlVis::OvlVis() : socket(io_service), socketOpened(false) {
    51 
    52         if( ! Configuration::haveConfig() ) return;
    53         if( ! Configuration::instance().exists("DEMO_OvlVisIP") )   return;
    54         if( ! Configuration::instance().exists("DEMO_OvlVisPort") ) return;
    55 
    56         string serverIP = Configuration::instance().read<string>("DEMO_OvlVisIP");
    57         string serverPort = Configuration::instance().read<string>("DEMO_OvlVisPort");
    58         if( serverIP.length() == 0 || serverPort.length() == 0) return;
    59 
    60         logging_debug( "connecting to ovlvis " + serverIP + " on " + serverPort );
    61 
    62         tcp::resolver resolver(io_service);
    63         tcp::resolver::query query(
    64                 serverIP,
    65                 serverPort,
    66                 tcp::resolver::query::passive |
    67                 tcp::resolver::query::address_configured |
    68                 tcp::resolver::query::numeric_service);
    69 
    70         tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
    71         tcp::resolver::iterator end;
    72 
    73         boost::system::error_code error = boost::asio::error::host_not_found;
    74         while (error && endpoint_iterator != end){
    75                 socket.close();
    76                 socket.connect(*endpoint_iterator++, error);
    77         }
    78 
    79         if (error){
    80                 logging_warn( "OvlVis could not connect to GUI" );
    81         } else {
    82                 socketOpened = true;
    83         }
     46OvlVis::OvlVis() {
    8447}
    8548
    8649OvlVis::~OvlVis(){
    87 
    88         socket.close();
    89 
    9050}
    9151
     
    11575//      }
    11676
    117 }
    118 
    119 void OvlVis::sendSocket(const string msg){
    120         if( socket.is_open() && socketOpened )
    121                 socket.send( boost::asio::buffer(msg) );
    12277}
    12378
     
    665620}
    666621
    667 //*****************************************************
    668 //*****************************************************
    669 //*****************************************************
    670 
    671622}} // namespace ariba, common
  • source/ariba/utility/visual/OvlVis.h

    r6584 r6822  
    4545#include <map>
    4646#include <boost/utility.hpp>
    47 #include <boost/asio.hpp>
    48 #include "ariba/utility/types/NodeID.h"
    49 #include "ariba/utility/logging/Logging.h"
    5047#include "ariba/utility/system/Timer.h"
    5148#include "ariba/utility/misc/Helper.h"
    5249#include "ariba/utility/misc/KeyMapping.hpp"
    53 #include "ariba/utility/configuration/Configuration.h"
     50#include "ariba/utility/visual/ServerVis.h"
    5451
    5552using std::string;
     
    5956using std::cout;
    6057using std::ostringstream;
    61 using boost::asio::ip::tcp;
    62 using ariba::utility::NodeID;
    63 using ariba::utility::Configuration;
    6458using ariba::utility::KeyMapping;
    6559using ariba::utility::Timer;
     
    6862namespace utility {
    6963
    70 class OvlVis : private boost::noncopyable {
     64class OvlVis : public ServerVis, private boost::noncopyable {
    7165        use_logging_h(OvlVis);
    7266public:
    7367        static OvlVis& instance() { static OvlVis the_inst; return the_inst; }
    7468
    75         typedef enum _NETWORK_ID {
    76                 NETWORK_ID_BASE_COMMUNICATION   = 1,
    77                                 NETWORK_ID_BASE_OVERLAY = 2,
    78                                 NETWORK_ID_EONSON               = 3,
    79                                 NETWORK_ID_MCPO                 = 4,
    80                                 NETWORK_ID_CLIO                 = 5,
    81                                 NETWORK_ID_VIDEOSTREAM  = 6,
    82                                 NETWORK_ID_GAME                 = 7,
    83                                 NETWORK_ID_SECURITY     = 8,
    84         } NETWORK_ID;
    85 
    8669        //****************************************************************
    8770        // Node creation, node connections, status, node deletion, ...
     
    162145                        unsigned char b
    163146        );
    164 
    165         typedef enum _NODE_COLORS {
    166                 NODE_COLORS_GREY,
    167                 NODE_COLORS_GREEN,
    168                 NODE_COLORS_RED,
    169         } NODE_COLORS;
    170147
    171148        /**
     
    385362protected:
    386363        OvlVis();
    387         ~OvlVis();
     364        virtual ~OvlVis();
    388365
    389366private:
    390367        void sendMessage( const string msg, NETWORK_ID nid );
    391         void sendSocket( const string msg );
    392 
    393         /**
    394          * boost asio stuff for connecting to ovlvis
    395          */
    396         boost::asio::io_service io_service;
    397         tcp::socket socket;
    398         volatile bool socketOpened;
    399368
    400369        typedef pair<NodeID, NodeID> NodePair;
Note: See TracChangeset for help on using the changeset viewer.