We have project developed on Zend Framework.
**Brief project description**
There are hardware sensors which can measure different type of Measurement Points (MP): temperature, pressure, voltage, power etc. These sensors can put data into CSV file.
We have import script which can import data from CSV file and put data into database. Also we have web application where we can setup import parameters as well as display graphics based on data from database.
While importing there is parameter - alert value. There is webform where it's possible for each MP secify critical value (alert value) of this param and condition to check: >=, <=. Import script check this info when make import and if alert value reached - send email with alert.
For now we have very simple mechanism to specify conditions for alerts. Something like:
MP1 >= 10
MP2 <= 25
**What required to be done**
We need build advanced alert condiitions feature. We want to have ability to write complex alert conditions like:
((MP1 + MP2) >= MP10) AND MP5 <= 20
MP1 > 1 / sqrt (MP2)
Basic mathematical operations and functions should be supported.
Let me know if any questions.
See attach to get understanding how current form where you can setup alert conditions looks like.
**What should be done in web interface**
In the bottom part of existing form you need add section:
Advanced alert conditions
Current advanced alerts will be displayed here.
Display icon near each advanced alert condition: Delete advanced alert
This icon allow to delete advacned alert
Also add icon: Add advanced alert
On click new input area should be displayed where we can add new advanced alert.
When saving form it will be good to test that syntax for advanced alert condition is good. For test data you can use first line from CSV file if available (we already have code to get test data) or you can generate values of MP by random for test.
If advanced alert condition is not correct, for example:
MP <= 10 (not specified MP. We have MP1, MP2 etc)
MP100 >= 20 (MP100 not exist. MP20 is maximu for currect CSV file)
MP1 >= MP2 MP3 <= 10 (wrong syntax)
display the same form, display error message which exactly advacned alert condition wrong, and display red border for input area.
**Modify current import script**
Current import script process CSV files line by line and test current MP values for current alert conditions. If some MP value >= or <= than alert value - script send email with alert. You need add functionality which can use also saved advanced alert conditions and test imported MP values using this advanced alert condition.
If advanced alert condition has wrong syntax and can't be processed for any reason - import script should not broke, but should display error message and continue their work.