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

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

batterie

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