Added Rules Functionality
This weekend I added the rules functionality. Rules might be something like, alert me when “Coolant Temp < 60 && RPM > 4500″. Each rule is given this logic, but using the commands instead of English meaning. You simply add the sensors you want in your rule and then create the logic using ANDs/ORs and comparison operators.
This is an example:
r1.setRuleName(“You may be wearing your engine. Reving too high and coolant temperature too low”);
r1.setRule(“s010C > 4500 && s0105 < 60″);
r1.addSensor(automonApp.getActiveSensorByCommand(“010C”));
r1.addSensor(automonApp.getActiveSensorByCommand(“0105″));
QObject::connect(&r1, SIGNAL(sendAlert(QString)), &errorHandler, SLOT(errorslot(QString)));
if (r1.activate())
qDebug() << “Rule Added”;
else
qDebug() << “Error Adding Rule”;
So now when the Revs goes above 4500 and the coolant temperature is still relatively cool, signal an alert. I’ve it going to my error handler at the moment but this could easily be any GUI element.
That is pretty much all I am going to do for the kernel part of my system now. I just have to implement proper error handling and test it properly. Now using all the functionality it supplies, I must create the main application.
Leave a Reply
You must be logged in to post a comment.
Tags
Archives
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
« Nov | ||||||
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 |
Blogroll
QT Programming
Single Board Computers (SBCs)
Recent Comments
- Mark Mikaelsen on QT and QExtSerialPort
- Mark Mikaelsen on QT and QExtSerialPort
- Donal on QT and QExtSerialPort
- Dmitriy on QT and QExtSerialPort
- Donal on QT and QExtSerialPort