source: flair-src/trunk/lib/FlairSensorActuator/src/BatteryMonitor.h@ 10

Last change on this file since 10 was 3, checked in by Sanahuja Guillaume, 8 years ago

sensoractuator

File size: 1.9 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
19{
20 namespace gui
21 {
22 class LayoutPosition;
23 class Label;
24 class DoubleSpinBox;
25 }
26}
27
28namespace flair
29{
30namespace sensor
31{
32
33 /*! \class BatteryMonitor
34 *
35 * \brief Base class for battery monitor
36 */
37
38 class BatteryMonitor : public gui::GroupBox
39 {
40 public:
41 /*!
42 * \brief Constructor
43 *
44 * Construct a BatteryMonitor at given position.
45 *
46 * \param position position
47 * \param name name
48 */
49 BatteryMonitor(const gui::LayoutPosition* position,std::string name);
50
51 /*!
52 * \brief Destructor
53 *
54 */
55 ~BatteryMonitor();
56
57 /*!
58 * \brief Is batteru low?
59 *
60 * \return true if battery is below threshold
61 *
62 */
63 bool IsBatteryLow(void) const;
64
65 /*!
66 * \brief Set battery value
67 *
68 * \param battery value
69 *
70 */
71 void SetBatteryValue(float value);
72
73 /*!
74 * \brief Get battery voltage
75 *
76 * \return battery voltage
77 *
78 */
79 float GetVoltage(void) const;
80
81 private:
82 float batteryvalue;
83 gui::DoubleSpinBox *battery_thresh;
84 gui::Label *battery;
85 };
86} // end namespace sensor
87} // end namespace flair
88
89#endif // BATTERYMONITOR_H
Note: See TracBrowser for help on using the repository browser.