| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,51 @@ |
| 1 |
+/* |
|
| 2 |
+ * Author: Pawel Jablonski |
|
| 3 |
+ * E-mail: pj@xirx.net |
|
| 4 |
+ * WWW: xirx.net |
|
| 5 |
+ * GIT: git.xirx.net |
|
| 6 |
+ * |
|
| 7 |
+ * License: You can use this code however you like |
|
| 8 |
+ * but leave information about the original author. |
|
| 9 |
+ * Code is free for non-commercial and commercial use. |
|
| 10 |
+ */ |
|
| 11 |
+ |
|
| 12 |
+#include "led.h" |
|
| 13 |
+ |
|
| 14 |
+/** |
|
| 15 |
+ * Constructor for the status LED class |
|
| 16 |
+ * |
|
| 17 |
+ * @param parent Parent object |
|
| 18 |
+ */ |
|
| 19 |
+LED::LED(QObject *parent) : QObject(parent) |
|
| 20 |
+{
|
|
| 21 |
+ this->reset(); |
|
| 22 |
+} |
|
| 23 |
+ |
|
| 24 |
+//! Reset the statuses of LEDs |
|
| 25 |
+void LED::reset() |
|
| 26 |
+{
|
|
| 27 |
+ this->run = false; |
|
| 28 |
+ this->error = false; |
|
| 29 |
+} |
|
| 30 |
+ |
|
| 31 |
+/** |
|
| 32 |
+ * Set enable status of the run LED |
|
| 33 |
+ * |
|
| 34 |
+ * @param enable Enable status |
|
| 35 |
+ */ |
|
| 36 |
+void LED::setRun(bool enable) |
|
| 37 |
+{
|
|
| 38 |
+ this->run = enable; |
|
| 39 |
+ emit updateRunSignal(this->run); |
|
| 40 |
+} |
|
| 41 |
+ |
|
| 42 |
+/** |
|
| 43 |
+ * Set enable status of the error LED |
|
| 44 |
+ * |
|
| 45 |
+ * @param enable Enable status |
|
| 46 |
+ */ |
|
| 47 |
+void LED::setError(bool enable) |
|
| 48 |
+{
|
|
| 49 |
+ this->error = enable; |
|
| 50 |
+ emit updateErrorSignal(this->error); |
|
| 51 |
+} |