Flair
Framework Libre Air
BatteryMonitor.h
Go to the documentation of this file.
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}
13 #ifndef BATTERYMONITOR_H
14 #define BATTERYMONITOR_H
15 
16 #include <Object.h>
17 
18 namespace flair {
19 namespace gui {
20 class Label;
21 class DoubleSpinBox;
22 class SpinBox;
23 }
24 }
25 
26 namespace flair {
27 namespace sensor {
28 
34 class BatteryMonitor : public core::Object {
35 public:
43  BatteryMonitor(std::string name);
44 
50 
57  bool IsBatteryLow(void);
58 
65  void SetBatteryValue(float value);
66 
73  float GetVoltage(void) const;
74 
75 private:
76  float batteryvalue;
77  gui::DoubleSpinBox *battery_thresh;
78  gui::SpinBox *thresholdTime;
79  gui::Label *battery;
80  core::Time underThersholdStartTime;
81  bool isUnderThershold;
82 };
83 } // end namespace sensor
84 } // end namespace flair
85 
86 #endif // BATTERYMONITOR_H
Base class for all Framework's classes.
Definition: Object.h:84
namespace of the flair Framework
Definition: Ahrs.h:19
unsigned long long Time
Time definition, in ns.
Definition: Object.h:56
Class displaying a QSpinBox on the ground station.
Definition: SpinBox.h:28
BatteryMonitor(std::string name)
Constructor.
bool IsBatteryLow(void)
Is battery low?
Class displaying a QLabel on the ground station.
Definition: Label.h:28
Base class for all Framework's classes.
Base class for battery monitor.
Definition: BatteryMonitor.h:34
Class displaying a QDoubleSpinBox on the ground station.
Definition: DoubleSpinBox.h:28
void SetBatteryValue(float value)
Set battery value.
float GetVoltage(void) const
Get battery voltage.