Show
Ignore:
Timestamp:
10/03/09 18:48:33 (15 years ago)
Author:
bhilburn
Message:

Numerous changes. A VTCROSS shell can now be remote relative to the radio host platform. The remote server/port is set through a new function in libvtcross, which has also been added as an option to the benchmark_dsa script. Other changes include bug fixes in the benchmark code and some SQL fixes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/libvtcross/libvtcross.cpp

    r412 r498  
    2222 
    2323#include <cstdlib> 
     24#include <string> 
    2425 
    2526#include "vtcross/common.h" 
     
    2728#include "vtcross/libvtcross.h" 
    2829 
    29  
    30 uint32_t 
    31 ConnectToRemoteComponent() 
    32 { 
    33     // TODO why is this hardcoded like this?? 
    34        return ClientSocket("localhost", "40000"); 
    35 } 
     30using namespace std; 
     31 
     32 
     33/* Strings that store the remote (or local) shell location for use within the 
     34 * ConnectToShell() function.  Note that these values must be set with the 
     35 * SetCrossShellLocation public function within the client code. */ 
     36string shellHostname; 
     37string shellPort; 
     38 
     39 
     40uint32_t 
     41ConnectToShell() 
     42{ 
     43    return ClientSocket(shellHostname.c_str(), shellPort.c_str()); 
     44} 
     45 
     46 
     47void 
     48SetCrossShellLocation(string hostname, string port) 
     49{ 
     50    shellHostname = hostname; 
     51    shellPort = port; 
     52} 
     53 
    3654 
    3755// TODO the following three functions all do exactly the same thing.  Why not 
     
    4260    char buffer[256]; 
    4361 
    44     uint32_t socketfd = ConnectToRemoteComponent(); 
     62    uint32_t socketfd = ConnectToShell(); 
    4563    SendMessage(socketfd, "get_number_observables"); 
    4664     
     
    5775    char buffer[256]; 
    5876 
    59     uint32_t socketfd = ConnectToRemoteComponent(); 
     77    uint32_t socketfd = ConnectToShell(); 
    6078    SendMessage(socketfd, "get_number_utilities"); 
    6179     
     
    7290    char buffer[256]; 
    7391     
    74     uint32_t socketfd = ConnectToRemoteComponent(); 
     92    uint32_t socketfd = ConnectToShell(); 
    7593    SendMessage(socketfd, "set_active_mission"); 
    7694 
     
    88106    char buffer[256]; 
    89107 
    90     uint32_t socketfd = ConnectToRemoteComponent(); 
     108    uint32_t socketfd = ConnectToShell(); 
    91109    SendMessage(socketfd, "get_number_parameters"); 
    92110     
     
    117135    char buffer[256]; 
    118136 
    119     uint32_t socketFD = ConnectToRemoteComponent(); 
     137    uint32_t socketFD = ConnectToShell(); 
    120138    SendMessage(socketFD, "request_optimization"); 
    121139 
     
    170188    char var[50]; 
    171189 
    172     uint32_t socketFD = ConnectToRemoteComponent(); 
     190    uint32_t socketFD = ConnectToShell(); 
    173191    SendMessage(socketFD, "update_performance"); 
    174192