hand_control/src/display.h

72 lines
2 KiB
C
Raw Normal View History

2015-09-18 14:52:52 +00:00
/* Copyright © 2015 CentraleSupélec
*
* This file is part of Hand Control.
*
* Hand Control is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Hand Control is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Hand Control. If not, see <http://www.gnu.org/licenses/>.
2015-08-21 18:39:01 +00:00
*/
2015-09-18 14:52:52 +00:00
2015-09-19 16:54:10 +00:00
#ifndef SRC_DISPLAY_H_
#define SRC_DISPLAY_H_
2015-05-01 19:23:00 +00:00
#include <ncurses.h>
#include <geometry_msgs/Twist.h>
2015-09-19 16:54:10 +00:00
#include <string>
2015-05-01 19:23:00 +00:00
2015-09-19 16:54:10 +00:00
class Curses {
private:
2015-05-02 13:37:58 +00:00
static const int cmd_kbd_lines;
static const int cmd_kbd_columns;
WINDOW* cmd_kbd;
2015-05-02 17:24:54 +00:00
void print_cmd_kbd();
2015-05-02 13:37:58 +00:00
static const int cmd_speed_lines;
static const int cmd_speed_columns;
WINDOW* cmd_speed;
void print_cmd_speed();
2015-05-02 17:24:54 +00:00
static const int get_lines;
static const int get_columns;
2015-05-01 22:00:28 +00:00
WINDOW* get;
2015-05-01 22:40:28 +00:00
2015-05-02 17:24:54 +00:00
static const int log_sent_w_lines;
static const int log_sent_w_columns;
int log_line_number;
2015-05-01 22:40:28 +00:00
WINDOW* log_sent_w;
2015-05-02 17:46:02 +00:00
WINDOW* log_sent_title;
2015-05-02 17:24:54 +00:00
static const int nav_data_lines;
static const int nav_data_columns;
2015-05-01 22:40:28 +00:00
WINDOW* nav_data;
2015-05-02 18:52:46 +00:00
void print_nav_data();
2015-09-19 16:54:10 +00:00
static const int topic_lines;
static const int topic_columns;
WINDOW* topic;
void print_topic();
2015-09-19 16:54:10 +00:00
public:
2015-05-01 19:23:00 +00:00
Curses();
~Curses();
2015-05-01 22:00:28 +00:00
char getchar();
2015-05-01 22:40:28 +00:00
2015-05-02 13:37:58 +00:00
void update_cmd_speed(const char& coord, const float& v);
void update_nav_data(const float& batteryPercent,
2015-05-02 13:37:58 +00:00
const int& state,
const float& time);
void log_sent(const std::string& str);
void update_topic(const geometry_msgs::Twist::ConstPtr& twist);
2015-05-01 19:23:00 +00:00
};
2015-09-19 16:54:10 +00:00
#endif // SRC_DISPLAY_H_