Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A process to manipulate feeds through arithmetic operation #8

Merged
merged 9 commits into from
Feb 24, 2019

Conversation

alexandrecuer
Copy link
Contributor

@alexandrecuer alexandrecuer commented Jan 31, 2019

3 majors features proposed :

  • addition of a basic formula process in order to manipulate feeds through arithmetic operations (multiplication, division, addition, soustraction) - so you can do f1+2*f2-f3/12 for example if you want
  • addition on common.php of a compute_meta() function, in order to calculate some basics settings when processing multiple feeds in a single process
  • addition of two simple processes, converting a liquid or air flow in m3/h in an accumulated Kwh feed
    interesting for ventilation and water heating circuits

Cosmetics but usefull :

  • in the controller : implementation of a route to view the last entries of the logfile + all the related shebang in view.php
  • the calculation of the number of points behind is reworked with unix time stamps...
  • 'tag' integration in the feed select menu just to feel more comfortable

Hope this is not a problem to have multiple features in a single PR - I can rework the whole if you dont feel happy with that....

Alex

addition of a compute_meta function in common.php to use when postprocessing involves multiple feeds
improvement of the behind points number calculation
addition of a log visualizer
'tag' integration in the feed select menu
addition of a process dedicated to convert a liquid or air flow in m3 per hour to kwh
@alexandrecuer alexandrecuer changed the title improvement suggestions log visu + 'tag' integration in feed menu + 2 simple processes Feb 1, 2019
manipulate feeds through arithmetic operations : multiplication, division, soustraction, addition
@alexandrecuer alexandrecuer changed the title log visu + 'tag' integration in feed menu + 2 simple processes A process to manipulate feeds through arithmetic operation Feb 15, 2019
@TrystanLea
Copy link
Member

Hello @alexandrecuer this looks great, testing it here when I try to add a formula process the 'enter output feed' box goes green but the create button does not appear. Any ideas?

@alexandrecuer
Copy link
Contributor Author

what is your formula ?
maybe ouput feed name already exists ?
both boxes (formula & output) are going green ?
it happens to me once and when I renew the cache, it worked…
it is strange…I only added an extra test in the validate function of the view.js. if the type is “formula”, it takes the formula and test it with 2 simple regular expressions

var regex1 = /[^-\+\*\/\df]/;
var regex2 = /f/;
if (formula.match(regex1) || !formula.match(regex2)){
    $(".process_option[option="+z+"]").css("background-color","#ffeeee");
    valid = false;
} else {
    $(".process_option[option="+z+"]").css("background-color","#eeffee");
}

for feeds involved in the formula , the existence check is done later in the controller (create)

@TrystanLea TrystanLea merged commit a004bfd into emoncms:emonpi Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants