CM2Math plugin help
Download pluginExecutes a formula (of your design) upon values of your choice.
Parameter explanation:
Besides 'update' and 'dedicated', it uses two parameters: 'formula' and 'decimal'.
'formula' is a formula of your design.
'decimal' rounds to a decimal place. The default value is -2 representing a value like so: 123.56 (note that you must also use one of the rounding funtions listed below in your formula for rounding to work.)
Any other parameters you pass will be considered variables that apply to your 'formula'. The best way I can explain this is to give you a code example:
<sensor name="CM2Math.Math" update="1"> <parameters> <cUsed> <sensor name="Disksize.Diskused" update="1" dedicated="yes"> <parameters> <drive>C:</drive> <format>bytes</format> </parameters> </sensor> </cUsed> <kilo>1024</kilo> <formula>cUsed/(kilo^3)</formula> </parameters> </sensor>
Note that the plugin does not care what you name your parameter/variables. In the example I used <cUsed>, <kilo>, and a <formula> of "cUsed/(kilo^3)". I could very well have used <crabcakes>, <doughnuts>, and a <formula> of "crabcakes/(doughtnuts^3)", it does not matter to the plugin. Another thing that does not matter to the plugin is how many variables you have. You can have from none to whatever makes you happy.
Functions available to use in your Formula:
+ -> addition
- -> subtraction
* -> multiplication
/ -> division
^ -> power
div -> div
mod -> mod
cos -> cosine
sin -> sine
tan or tg -> tangent
cot or ctg -> cotangent
abs -> absolute value
sgn or sign -> Indicates whether a numeric value is positive, negative, or zero.
sqrt -> square root
ln -> natural log
exp -> Returns the exponential
arcsin -> inverse sine
arcos -> inverse cosine
arctan or arctg -> inverse tangent
arccot or arcctg -> inverse cotangent
sinh or sh -> hyperbolic sine
cosh or ch -> hyperbolic cosine
tanh or th -> hyperbolic tangent
coth or cth -> hyperbolic cotangent
heaviside -> seems to be quasi-boolean. If >= 0 it returns 1. Less than zero returns 0.
rnd -> "Banker's Rounding"
rndup -> round up
rnddown -> round down
trunc -> truncate to int64