Last change
on this file since 38 was 15, checked in by Bayard Gildas, 9 years ago |
sources reformatted with flair-format-dir script
|
File size:
1.4 KB
|
Rev | Line | |
---|
[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] | 18 | namespace flair {
|
---|
| 19 | namespace gui {
|
---|
| 20 | class LayoutPosition;
|
---|
| 21 | class Label;
|
---|
| 22 | class DoubleSpinBox;
|
---|
[3] | 23 | }
|
---|
[15] | 24 | }
|
---|
[3] | 25 |
|
---|
[15] | 26 | namespace flair {
|
---|
| 27 | namespace sensor {
|
---|
[3] | 28 |
|
---|
[15] | 29 | /*! \class BatteryMonitor
|
---|
| 30 | *
|
---|
| 31 | * \brief Base class for battery monitor
|
---|
| 32 | */
|
---|
[3] | 33 |
|
---|
[15] | 34 | class BatteryMonitor : public gui::GroupBox {
|
---|
| 35 | public:
|
---|
| 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);
|
---|
[3] | 45 |
|
---|
[15] | 46 | /*!
|
---|
| 47 | * \brief Destructor
|
---|
| 48 | *
|
---|
| 49 | */
|
---|
| 50 | ~BatteryMonitor();
|
---|
[3] | 51 |
|
---|
[15] | 52 | /*!
|
---|
| 53 | * \brief Is batteru low?
|
---|
| 54 | *
|
---|
| 55 | * \return true if battery is below threshold
|
---|
| 56 | *
|
---|
| 57 | */
|
---|
| 58 | bool IsBatteryLow(void) const;
|
---|
[3] | 59 |
|
---|
[15] | 60 | /*!
|
---|
| 61 | * \brief Set battery value
|
---|
| 62 | *
|
---|
| 63 | * \param battery value
|
---|
| 64 | *
|
---|
| 65 | */
|
---|
| 66 | void SetBatteryValue(float value);
|
---|
[3] | 67 |
|
---|
[15] | 68 | /*!
|
---|
| 69 | * \brief Get battery voltage
|
---|
| 70 | *
|
---|
| 71 | * \return battery voltage
|
---|
| 72 | *
|
---|
| 73 | */
|
---|
| 74 | float GetVoltage(void) const;
|
---|
[3] | 75 |
|
---|
[15] | 76 | private:
|
---|
| 77 | float batteryvalue;
|
---|
| 78 | gui::DoubleSpinBox *battery_thresh;
|
---|
| 79 | gui::Label *battery;
|
---|
| 80 | };
|
---|
[3] | 81 | } // end namespace sensor
|
---|
| 82 | } // end namespace flair
|
---|
| 83 |
|
---|
| 84 | #endif // BATTERYMONITOR_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.