CSCI 3081 - Drone Delivery System
battery.h
1 
7 #ifndef INC_BATTERY_H_
8 #define INC_BATTERY_H_
9 
10 /*******************************************************************************
11  * Includes
12  ******************************************************************************/
13 #include <iostream>
14 #include <string>
15 #include <cmath>
16 /*******************************************************************************
17  * Class Definitions
18  ******************************************************************************/
19 
20 /*******************************************************************************
21  * @brief The main class for the battery.
22  *
23  * Calls to \ref Battery() to generate a new instance of the class
24 *******************************************************************************/
25 namespace csci3081 {
26 class Battery {
27  private:
28  int BatteryID;
29  float maxCharge;
30  float remainingLifeinSec;
31  int displayBar;
32 
34  public:
39  Battery();
40 
47  Battery(float remainingLifeinSec_, std::string batteryType="carrier");
48 
52  float GetRemainingLife();
53 
57  float GetMaxCharge();
58 
62  int GetDisplayBar();
63 
67  int GetId();
68 
73  void Depleting(float sec);
74 
80  bool Charging(float sec);
81 
85  float TimeToFull();
86 
92  bool IsDead();
93 
99  bool IsFull();
100 };
101 
102 }
103 
104 #endif /* INC_BATTERY_H_ */
int GetDisplayBar()
Definition: battery.cc:87
float TimeToFull()
This function returns the time battery needed charged to be full.
Definition: battery.cc:83
Battery()
Default Constructor. This sets up an instance of Battery with empty remaining life.
Definition: battery.cc:10
void Depleting(float sec)
Depleting The Battery. Should be used everytime the object using battery is in action.
Definition: battery.cc:56
float GetMaxCharge()
Definition: battery.cc:41
Definition: battery.h:26
Definition: asubject.cc:3
float GetRemainingLife()
Definition: battery.cc:37
bool IsFull()
This returns a boolean value if the battery is full. True if the battery is full. False otherwise...
Definition: battery.cc:79
bool IsDead()
This returns a boolean value for the battery&#39;s life False if battery is dead (below 20%) True otherwi...
Definition: battery.cc:45
bool Charging(float sec)
Charging The Battery.
Definition: battery.cc:67
int GetId()
Definition: battery.cc:52