View Single Post
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#1419
Originally Posted by Jaffa View Post
Cool, thanks. As an aside, could you describe the algorithm for checking whether a profile should be activated? For example, I assume, if there's a time-based component, that's checked first. But once the time range is checked, how frequently does it check? Or can many of the conditions set triggers at lower levels? (e.g. send a signal when this cell ID is seen)
As a high-level simplified overview (you can check sources for details) it's something like this:
* Actions are activated when all conditions in rule are matched
* All conditions are event based. So there is no polling in ProfileMatic. So I've tried to optimize ProfileMatic to do something only when the conditions have changed so that some action specified by user might have to be activated.

In case of time based conditions, it works like this:
* When ProfileMatic starts, it iterates all rules set by user and finds the time that is closest to current time (the closest time is either the start time of the "Time condition", or the end time of the condition. (Ie. when the condition is either active or stops being active).
* A timer is then set to trigger a signal at that time.
* When the signal is emitted the rules are then re-evaluated, and again the next closest time for setting the timer is found.

Talking about cell IDs, a suggestion: the ability to define locations separately. So I could capture the cell IDs for Home and then use a location of "Home" in two different rule sets:
This is something that I know of as a sort of a sore point. But I'm not yet sure if the increased complexity is worth the trouble. What I mean with this is that usually it's good enough to make one rule where the Cell Ids have been captured. After that you can copy the rule with long-press in the main view and change the copied rule's actions/conditions as wished.

Of course I'm interested in other views in why that's not good in some use cases. Also there's other possible solutions instead of named "Cell Id sets" if copying the rule is not feasible, for example a button to "Copy cell ids" and a button to pasting them into another rule, etc.
__________________
My N9/N950 projects:
 

The Following User Says Thank You to ajalkane For This Useful Post: