Changeset 446 in flair-src for trunk/tools/VrpnLite/src/main.cpp


Ignore:
Timestamp:
09/14/21 11:04:41 (4 months ago)
Author:
Sanahuja Guillaume
Message:

vrpnlite: add headless mode and kill button

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/VrpnLite/src/main.cpp

    r330 r446  
    2424string vrpnServerAddress;
    2525int gcsPort,vrpnLitePort;
     26bool headless;
    2627
    2728void parseOptions(int argc, char **argv);
     
    3233  FrameworkManager *manager;
    3334  manager = new FrameworkManager("vrpnforwarder");
    34   manager->SetupConnection("127.0.0.1", gcsPort);
     35  if(!headless) manager->SetupConnection("127.0.0.1", gcsPort);
    3536  manager->SetupUserInterface(xml_file);
    3637 
     
    4546void parseOptions(int argc, char **argv) {
    4647  try {
    47     CmdLine cmd("Command description message", ' ', "0.1");
     48    CmdLine cmd("Command description message", ' ', "0.1",false);
    4849
    49     ValueArg<int> vrpnLitePortArg("v", "vport","vrpn lite port", true,
    50                                 3884, "int");
     50    ValueArg<int> vrpnLitePortArg("v", "vport","vrpn lite port", true,3884, "int");
    5151    cmd.add(vrpnLitePortArg);
    5252   
    53     ValueArg<string> serveraddressArg("s", "saddress","server address", true,
    54                                 "127.0.0.1:3883", "string");
     53    ValueArg<string> serveraddressArg("s", "saddress","server address", true,"127.0.0.1:3883", "string");
    5554    cmd.add(serveraddressArg);
    5655
    57     ValueArg<int> gcsPortArg("p", "port","local port used to connect to the ground station",
    58                           false, 9000, "int");
     56    ValueArg<int> gcsPortArg("p", "port","local port used to connect to the ground station",false, 9000, "int");
    5957    cmd.add(gcsPortArg);
    6058
    61 
    62     ValueArg<string> xmlArg("x", "xml", "xml file", true, "./settings.xml",
    63                             "string");
     59    ValueArg<string> xmlArg("x", "xml", "xml file", true, "./settings.xml","string");
    6460    cmd.add(xmlArg);
     61   
     62    ValueArg<bool> headlessArg("h", "headless", "headless mode", false, false,"bool");
     63    cmd.add(headlessArg);
    6564
    6665    cmd.parse(argc, argv);
     
    7069    gcsPort = gcsPortArg.getValue();
    7170    xml_file = xmlArg.getValue();
     71    headless = headlessArg.getValue();
    7272
    7373  } catch (ArgException &e) { // catch any exceptions
Note: See TracChangeset for help on using the changeset viewer.