main_window.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2018 ROBOTIS CO., LTD.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16 
17 /* Authors: Kayman Jung, SCH */
18 
19 #ifndef thormang3_offset_tuner_client_MAIN_WINDOW_H
20 #define thormang3_offset_tuner_client_MAIN_WINDOW_H
21 
22 /*****************************************************************************
23  ** Includes
24  *****************************************************************************/
25 
26 #include <QtGui>
27 #include <QList>
28 #include <QSpinBox>
29 #include <QtGui/QMainWindow>
30 
31 #include <math.h>
32 
33 #include "ui_main_window.h"
34 #include "qnode.hpp"
35 
36 /*****************************************************************************
37  ** Namespace
38  *****************************************************************************/
39 
41 {
42 
43 /*****************************************************************************
44  ** Interface [MainWindow]
45  *****************************************************************************/
49 class MainWindow : public QMainWindow
50 {
51 Q_OBJECT
52 
53  public:
54  MainWindow(int argc, char** argv, QWidget *parent = 0);
55  ~MainWindow();
56 
57  void closeEvent(QCloseEvent *event); // Overloaded function
58 
59  public Q_SLOTS:
60  /******************************************
61  ** Auto-connections (connectSlotsByName())
62  *******************************************/
64 
65  void on_save_button_clicked(bool check);
66  void on_refresh_button_clicked(bool check);
67  void on_inipose_button_clicked(bool checck);
68 
69  /******************************************
70  ** Manual connections
71  *******************************************/
72  void updateLoggingView(); // no idea why this can't connect automatically
73 
74  void update_joint_offset_data_spinbox(thormang3_offset_tuner_msgs::JointOffsetPositionData msg);
75 
76  void spinBox_valueChanged(QString joint_name);
77  void torque_checkbox_clicked(QWidget *widget);
78  void all_torque_on_button_clicked(QObject *button_group);
79  void all_torque_off_button_clicked(QObject *button_group);
80 
81  private:
82  void MakeUI();
83  void MakeTabUI(QGroupBox *joint_widget, QGroupBox *torque_widget, QButtonGroup *button_group,
84  std::map<int, std::string> &offset_group);
85  void publish_torque_msgs(std::string &joint_name, bool torque_on);
86 
87  Ui::MainWindowDesign ui_;
89 
91 
92  QButtonGroup *right_arm_button_group_;
93  QButtonGroup *left_arm_button_group_;
94  QButtonGroup *legs_button_group_;
95  QButtonGroup *body_button_group_;
96  std::vector<std::string> spinBox_list_;
97 
98  std::map<std::string, QList<QAbstractSpinBox *> > joint_spinbox_map_;
99 };
100 
101 } // namespace thormang3_offset_tuner_client
102 
103 #endif // thormang3_offset_tuner_client_MAIN_WINDOW_H
ROSCPP_DECL bool check()
void spinBox_valueChanged(QString joint_name)
std::map< std::string, QList< QAbstractSpinBox * > > joint_spinbox_map_
Definition: main_window.hpp:98
void publish_torque_msgs(std::string &joint_name, bool torque_on)
void update_joint_offset_data_spinbox(thormang3_offset_tuner_msgs::JointOffsetPositionData msg)
std::vector< std::string > spinBox_list_
Definition: main_window.hpp:96
void all_torque_off_button_clicked(QObject *button_group)
MainWindow(int argc, char **argv, QWidget *parent=0)
Definition: main_window.cpp:41
Qt central, all operations relating to the view part here.
Definition: main_window.hpp:49
void MakeTabUI(QGroupBox *joint_widget, QGroupBox *torque_widget, QButtonGroup *button_group, std::map< int, std::string > &offset_group)
void all_torque_on_button_clicked(QObject *button_group)
void torque_checkbox_clicked(QWidget *widget)


thormang3_offset_tuner_client
Author(s): Kayman
autogenerated on Mon Jun 10 2019 15:38:36