source: flair-dev/tags/0.0.1/include/FlairSensorActuator/BatteryMonitor.h@ 22

Last change on this file since 22 was 13, checked in by Bayard Gildas, 8 years ago

formatting script + include reformatted

File size: 1.4 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5/*!
6 * \file BatteryMonitor.h
7 * \brief Base class for battery monitor
8 * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2014/01/24
10 * \version 4.0
11 */
12
13#ifndef BATTERYMONITOR_H
14#define BATTERYMONITOR_H
15
16#include <GroupBox.h>
17
18namespace flair {
19namespace gui {
20class LayoutPosition;
21class Label;
22class DoubleSpinBox;
23}
24}
25
26namespace flair {
27namespace sensor {
28
29/*! \class BatteryMonitor
30*
31* \brief Base class for battery monitor
32*/
33
34class BatteryMonitor : public gui::GroupBox {
35public:
36 /*!
37 * \brief Constructor
38 *
39 * Construct a BatteryMonitor at given position.
40 *
41 * \param position position
42 * \param name name
43 */
44 BatteryMonitor(const gui::LayoutPosition *position, std::string name);
45
46 /*!
47 * \brief Destructor
48 *
49 */
50 ~BatteryMonitor();
51
52 /*!
53 * \brief Is batteru low?
54 *
55 * \return true if battery is below threshold
56 *
57 */
58 bool IsBatteryLow(void) const;
59
60 /*!
61 * \brief Set battery value
62 *
63 * \param battery value
64 *
65 */
66 void SetBatteryValue(float value);
67
68 /*!
69 * \brief Get battery voltage
70 *
71 * \return battery voltage
72 *
73 */
74 float GetVoltage(void) const;
75
76private:
77 float batteryvalue;
78 gui::DoubleSpinBox *battery_thresh;
79 gui::Label *battery;
80};
81} // end namespace sensor
82} // end namespace flair
83
84#endif // BATTERYMONITOR_H
Note: See TracBrowser for help on using the repository browser.