forked from donaloconnor/automon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruleeditorwidget.h
84 lines (71 loc) · 3.09 KB
/
ruleeditorwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef RULEEDITORWIDGET_H
#define RULEEDITORWIDGET_H
/*
==================================================================================================
| ruleeditorwidget.h |
| Part of the Automon application. |
| |
| Final Year Project - "An Embedded Automotive Monitoring Device" |
| |
| By Donal O' Connor for completion of B.Sc (Hons) Software Development and Computer Networking |
| Email: [email protected] |
| Website/Blog: http://automon.killarneyonline.eu |
| |
| Cork Institute of Technology, Cork, Ireland - http://www.cit.ie/ |
| |
| Copyright © 2009 Donal O'Connor <[email protected]> |
==================================================================================================
This class, RuleEditorWidget is a widget that is loaded from the Monitoring widget.
It provides a GUI interface to add and delete rules. It provides a scroll bar to set ranges and
the logic for what the rule stands for. It supports adding one or two sensors to the rule
*/
#include <QWidget>
#include "automon.h"
class QLabel;
class QVBoxLayout;
class QHBoxLayout;
class QComboBox;
class QSlider;
class QLCDNumber;
class QPushButton;
class QTableWidget;
using namespace AutomonKernel;
class RuleEditorWidget : public QWidget
{
Q_OBJECT
public:
RuleEditorWidget(Automon * kernel, QWidget * parent = 0);
signals:
void changeStatus(const QString & status);
void refreshRules();
public slots:
void changeSliderValuesSensor1(int index);
void changeSliderValuesSensor2(int index);
void createRule();
void deleteRule();
private:
void updateRulesTable();
QLabel * m_header;
QHBoxLayout * m_mainLayout;
QVBoxLayout * m_verticalLayout;
QVBoxLayout * m_newRuleLayout;
QHBoxLayout * m_sensor1Layout;
QHBoxLayout * m_sensor2Layout;
QHBoxLayout * m_ruleListLayout;
QHBoxLayout * m_buttonLayout;
QHBoxLayout * m_tableLayout;
QComboBox * m_sensor1;
QComboBox * m_sensor2;
QComboBox * m_operator1;
QComboBox * m_operator2;
QComboBox * m_booleanChoice;
QSlider * m_sensor1Value;
QSlider * m_sensor2Value;
QLCDNumber * m_sensor1ValueDisplay;
QLCDNumber * m_sensor2ValueDisplay;
QPushButton * m_createRuleButton;
QPushButton * m_deleteRuleButton;
QTableWidget * m_ruleListTable;
Automon * m_kernel;
};
#endif // RULEEDITORWIDGET_H