Reputation: 83
My application requires the processing of measurement data in part via logical rules that are unknown while coding and will be input manually by the user. An example of such a rule is
IF ( Column_3 < 4.5 ) AND ( ( Column_5 > 3.2 ) OR ( Column_7 <= 0 ) ) THEN Result = 2
where the number of elementary comparisons and the bracketing is, a priori, unknown.
This leads to a design question: What is the most efficient way to allow the user to enter this information in a GUI and how can I represent this information in my program in the best way in order to actually compute the whole IF clause? Actually, I would like to represent the rule in an SQL database and so I need a specific data structure.
Thank you all for your kind help!
Upvotes: 1
Views: 383
Reputation: 11
Regarding GUI, I feel comfortable with entering the data in text-area box. Unless your common condition are more than 2-3 lines long it should be ok.
The data structure can be something similar to the below design:
To store the condition in a relational DB, the data structure would be something similar to this:
Upvotes: 1