Advertisement
yoos

Untitled

Nov 3rd, 2011
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.09 KB | None | 0 0
  1. //! @brief Announce for a log file to be created.
  2. // TODO: data_subscriber_srv should be named something like desktop_datalog_srv.
  3. void log_chkbox_toggled (void) {
  4.     if (log_file_chkbox->get_active()) {   // If checkbox is checked...
  5.         if (log_file_chooser->get_filename() != "") {
  6.             data_subscriber_srv.request.logfilename = log_file_chooser->get_filename();
  7.         }  
  8.         data_subscriber_srv.request.isLogging = true;
  9.     }  
  10.     else {
  11.         log_file_chooser->unselect_all();
  12.         data_subscriber_srv.request.isLogging = false;
  13.     }  
  14.  
  15.     datalog_client.call(data_subscriber_srv);   // Call the service with request and receive response.
  16.  
  17.     if (data_subscriber_srv.response.logfilename != "") {
  18.         ROS_INFO("response.logfilename is %s.", data_subscriber_srv.response.logfilename.c_str());
  19.         log_file_chooser->set_filename(data_subscriber_srv.response.logfilename);   // Set FileChooserButton filename to response.
  20.     }  
  21.     else if (data_subscriber_srv.response.logfilename == "") {
  22.         ROS_INFO("response.logfilename blank!");
  23.     }  
  24. }
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement