dashboard_node.cpp
Go to the documentation of this file.
1 
7 #include <ros/ros.h>
8 #include <qt5/QtWidgets/qapplication.h>
10 #include <signal.h>
11 #include <unistd.h>
12 
22  const std::vector<int>& quitSignals,
23  const std::vector<int>& ignoreSignals = std::vector<int>())
24 {
25 
26  auto handler = [](int sig) -> void
27  {
28  printf("\nquit the application (user request signal = %d).\n", sig);
29  QCoreApplication::quit();
30  };
31 
32  // all these signals will be ignored.
33  for (int sig : ignoreSignals)
34  signal(sig, SIG_IGN);
35 
36  // each of these signals calls the handler (quits the QCoreApplication).
37  for (int sig : quitSignals)
38  signal(sig, handler);
39 }
40 
44 int main(int argc, char** argv)
45 {
46 
47  ros::init(argc, argv, "dashboard");
48  ros::NodeHandle nh;
49  QApplication a(argc, argv);
50  catchUnixSignals({SIGQUIT, SIGINT, SIGTERM, SIGHUP});
51  Dashboard w(&nh);
52  w.show();
53  return a.exec();
54 }
void catchUnixSignals(const std::vector< int > &quitSignals, const std::vector< int > &ignoreSignals=std::vector< int >())
This function is the callback for the shutdown system signal.
The Dashboard class provides functionality for the autogenerated ui header.
Definition: dashboard.h:218
Header file for the Dashboard class.
int main(int argc, char **argv)
Main function of this node.


pses_dashboard
Author(s): Sebastian Ehmes
autogenerated on Sat Oct 28 2017 14:12:28