Program for the water play project for the course Software Testing Practical 2016 given at the VU University

Dependencies:   mbed DRV88255 TextLCD Ping mbed-rtos

Committer:
joran
Date:
Wed Jun 15 07:25:53 2016 +0000
Revision:
40:1668630544c7
Parent:
38:930469a33001
Child:
43:0abb54448b75
Do not raise alarm for temp if we are heating, do not raise alarm for salt if we are pumping. I might have broken testing.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sbouber1 10:fd4670ec0806 1 #ifndef __ALARMCONTROLLER_H__
sbouber1 10:fd4670ec0806 2 #define __ALARMCONTROLLER_H__
sbouber1 10:fd4670ec0806 3
sbouber1 10:fd4670ec0806 4 #include "mbed.h"
sbouber1 10:fd4670ec0806 5 #include "SensorController.h"
joran 40:1668630544c7 6 #include "PIDController.h"
sbouber1 10:fd4670ec0806 7
sbouber1 38:930469a33001 8 #define STARTUP_ITERATIONS 10
sbouber1 38:930469a33001 9
sbouber1 10:fd4670ec0806 10
sbouber1 10:fd4670ec0806 11 class AlarmController : public Controller {
sbouber1 10:fd4670ec0806 12
sbouber1 10:fd4670ec0806 13
sbouber1 10:fd4670ec0806 14 public:
joran 40:1668630544c7 15 AlarmController(bool threaded, int interval_ms, SensorController *temp, SensorController *salt, SensorController *proximity, PIDController *pidc)
sbouber1 10:fd4670ec0806 16 : Controller(threaded, interval_ms) {
sbouber1 10:fd4670ec0806 17 this->temp = temp;
sbouber1 10:fd4670ec0806 18 this->salt = salt;
joran 20:521f795ea9d7 19 this->proximity = proximity;
joran 40:1668630544c7 20 this->pidc = pidc;
joran 20:521f795ea9d7 21 this->error = false;
joran 20:521f795ea9d7 22 this->tempiscrit = false;
joran 20:521f795ea9d7 23 this->saltiscrit = false;
joran 27:4f73f754fdc9 24 this->overflowiscrit = false;
joran 40:1668630544c7 25
sbouber1 10:fd4670ec0806 26 }
sbouber1 10:fd4670ec0806 27
sbouber1 10:fd4670ec0806 28 virtual void update();
sbouber1 10:fd4670ec0806 29
sbouber1 10:fd4670ec0806 30 virtual std::string get_name();
sbouber1 10:fd4670ec0806 31
sbouber1 10:fd4670ec0806 32 bool is_error();
sbouber1 10:fd4670ec0806 33
sbouber1 11:1a0a8fd74bc0 34 char *get_error_message();
joran 20:521f795ea9d7 35
joran 20:521f795ea9d7 36 void buzzOnce();
joran 20:521f795ea9d7 37 void raiseAlarmTemp(bool);
joran 20:521f795ea9d7 38 void raiseAlarmSalt(bool);
joran 27:4f73f754fdc9 39 void raiseAlarmOverFlow(bool);
sbouber1 10:fd4670ec0806 40
sbouber1 10:fd4670ec0806 41
sbouber1 10:fd4670ec0806 42 private:
sbouber1 10:fd4670ec0806 43 SensorController *temp;
sbouber1 10:fd4670ec0806 44 SensorController *salt;
sbouber1 10:fd4670ec0806 45 SensorController *proximity;
joran 40:1668630544c7 46 PIDController *pidc;
sbouber1 10:fd4670ec0806 47
sbouber1 10:fd4670ec0806 48 bool error;
sbouber1 11:1a0a8fd74bc0 49 char *error_msg;
sbouber1 10:fd4670ec0806 50
sbouber1 11:1a0a8fd74bc0 51 void activate_buzzer();
joran 20:521f795ea9d7 52 bool tempiscrit;
joran 20:521f795ea9d7 53 bool saltiscrit;
joran 27:4f73f754fdc9 54 bool overflowiscrit;
joran 27:4f73f754fdc9 55
joran 27:4f73f754fdc9 56
sbouber1 10:fd4670ec0806 57 };
sbouber1 10:fd4670ec0806 58
sbouber1 10:fd4670ec0806 59
sbouber1 10:fd4670ec0806 60 #endif