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

Last change on this file was 164, checked in by Sanahuja Guillaume, 5 years ago

batterie

File size: 1.5 KB
RevLine 
[3]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[3]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
[15]18namespace flair {
19namespace gui {
20class LayoutPosition;
21class Label;
22class DoubleSpinBox;
[164]23class SpinBox;
[3]24}
[15]25}
[3]26
[15]27namespace flair {
28namespace sensor {
[3]29
[15]30/*! \class BatteryMonitor
31*
32* \brief Base class for battery monitor
33*/
[3]34
[15]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);
[3]46
[15]47  /*!
48  * \brief Destructor
49  *
50  */
51  ~BatteryMonitor();
[3]52
[15]53  /*!
54  * \brief Is batteru low?
55  *
56  * \return true if battery is below threshold
57  *
58  */
[164]59  bool IsBatteryLow(void);
[3]60
[15]61  /*!
62  * \brief Set battery value
63  *
64  * \param battery value
65  *
66  */
67  void SetBatteryValue(float value);
[3]68
[15]69  /*!
70  * \brief Get battery voltage
71  *
72  * \return battery voltage
73  *
74  */
75  float GetVoltage(void) const;
[3]76
[15]77private:
78  float batteryvalue;
79  gui::DoubleSpinBox *battery_thresh;
[164]80  gui::SpinBox *thresholdTime;
[15]81  gui::Label *battery;
[164]82  core::Time underThersholdStartTime;
83  bool isUnderThershold;
[15]84};
[3]85} // end namespace sensor
86} // end namespace flair
87
88#endif // BATTERYMONITOR_H
Note: See TracBrowser for help on using the repository browser.