Changeset 446 in flair-src
- Timestamp:
- Sep 14, 2021, 11:04:41 AM (3 years ago)
- Location:
- trunk/tools/VrpnLite/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/VrpnLite/src/VrpnLite.cpp
r434 r446 17 17 #include <Thread.h> 18 18 #include <UdpSocket.h> 19 #include <TabWidget.h> 20 #include <Tab.h> 21 #include <PushButton.h> 19 22 #include <FrameworkManager.h> 20 23 #include <Quaternion.h> … … 24 27 using namespace flair::core; 25 28 using namespace flair::sensor; 29 using namespace flair::gui; 26 30 27 31 VrpnLite::VrpnLite(int vrpnLitePort,string vrpnServerAddress): Thread(getFrameworkManager(),"VrpnLite",90) { 28 32 vrpnclient=new VrpnClient("vrpn", vrpnServerAddress,80); 33 Tab* tab=new Tab(vrpnclient->GetTabWidget(),"Main"); 34 killButton=new PushButton(tab->NewRow(),"kill"); 29 35 dataSocket = new UdpSocket(this,"client socket",vrpnLitePort); 30 36 vrpnclient->Start(); … … 40 46 41 47 while (!ToBeStopped()) { 48 if(killButton->Clicked()) SafeStop(); 49 42 50 if(vrpnobjects.size()>0) { 43 51 //wait for last one to be sure all are up to date -
trunk/tools/VrpnLite/src/VrpnLite.h
r363 r446 22 22 class UdpSocket; 23 23 } 24 namespace gui { 25 class PushButton; 26 } 24 27 namespace sensor { 25 28 class VrpnClient; … … 34 37 35 38 private: 39 flair::gui::PushButton* killButton; 36 40 void Run(void); 37 41 flair::sensor::VrpnClient* vrpnclient; -
trunk/tools/VrpnLite/src/main.cpp
r330 r446 24 24 string vrpnServerAddress; 25 25 int gcsPort,vrpnLitePort; 26 bool headless; 26 27 27 28 void parseOptions(int argc, char **argv); … … 32 33 FrameworkManager *manager; 33 34 manager = new FrameworkManager("vrpnforwarder"); 34 manager->SetupConnection("127.0.0.1", gcsPort);35 if(!headless) manager->SetupConnection("127.0.0.1", gcsPort); 35 36 manager->SetupUserInterface(xml_file); 36 37 … … 45 46 void parseOptions(int argc, char **argv) { 46 47 try { 47 CmdLine cmd("Command description message", ' ', "0.1" );48 CmdLine cmd("Command description message", ' ', "0.1",false); 48 49 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"); 51 51 cmd.add(vrpnLitePortArg); 52 52 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"); 55 54 cmd.add(serveraddressArg); 56 55 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"); 59 57 cmd.add(gcsPortArg); 60 58 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"); 64 60 cmd.add(xmlArg); 61 62 ValueArg<bool> headlessArg("h", "headless", "headless mode", false, false,"bool"); 63 cmd.add(headlessArg); 65 64 66 65 cmd.parse(argc, argv); … … 70 69 gcsPort = gcsPortArg.getValue(); 71 70 xml_file = xmlArg.getValue(); 71 headless = headlessArg.getValue(); 72 72 73 73 } catch (ArgException &e) { // catch any exceptions
Note:
See TracChangeset
for help on using the changeset viewer.