|
SBB Host
Host communication with the self balancing bike.
|
A class for host control widget. More...
#include <HostControl.h>
Public Member Functions | |
| HostControl () | |
| Constructor. More... | |
| void | append_slider (Glib::ustring lbl, double min=-1, double max=+1, double val=0) |
| Append a slider. More... | |
| void | update () |
| Update the widget appearance. More... | |
| bool | get_values (float *buf, size_t len) |
| Get the values of the sliders. More... | |
Protected Attributes | |
| Gtk::Grid | grid |
| Gtk::Grid object for the sliders. More... | |
| std::vector< Slider * > | sliders |
| Vector of pointers to Slider object. More... | |
Private Attributes | |
| unsigned int | nanVal = NAN_VAL |
| NaN variable, see NAN_VAL. More... | |
A class for host control widget.
Class for host control widget extending the Gtk::Frame class, used in SBBHostApp.
| HostControl::HostControl | ( | ) |
Constructor.
Default constructor.
| void HostControl::append_slider | ( | Glib::ustring | lbl, |
| double | min = -1, |
||
| double | max = +1, |
||
| double | val = 0 |
||
| ) |
Append a slider.
Function to append a slider. Does not update the widget.
| lbl | The label of the slider. |
| min | The minimum value of the slider. |
| max | The maximum value of the slider. |
| val | The default value of the slider. |
| bool HostControl::get_values | ( | float * | buf, |
| size_t | len | ||
| ) |
Get the values of the sliders.
Function to get the values of the sliders. Values of sliders not active are set to NaN, see NAN_VAL.
| buf | Pointer to buffer of floats where store the values. |
| len | Size of the buffer. |
| void HostControl::update | ( | ) |
Update the widget appearance.
Function to update the widget appearance after having added sliders.
|
protected |
Gtk::Grid object for the sliders.
|
private |
NaN variable, see NAN_VAL.