Skip to content
New issue

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

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

Already on GitHub? # to your account

Improve scaling for message-/field-definitions #72

Open
J0EK3R opened this issue Mar 5, 2017 · 0 comments
Open

Improve scaling for message-/field-definitions #72

J0EK3R opened this issue Mar 5, 2017 · 0 comments

Comments

@J0EK3R
Copy link
Contributor

J0EK3R commented Mar 5, 2017

Till now, the scaling capability of fields is limited to a single divide- or multiply-operation by setting a positive number as divisor or negative number as multiplicator.

e.g. division

16_Gradient10,SIN,10,,Steilheit

e.g. multiplication

_8_Rpm60,UCH,-60,Rpm,Drehzahl

In my Weishaupt-System there are parameters like "timespan since last command" wich holds the timespan-value since the last command from the controller of a heating-circuit was sent. (No command in a well known timespan results in an error).
In this case, the timespan value is 300 für 0 minutes, 299 for 0.5 minutes, 288 for 1 minute and so on.

To get the desired result in minutes, a certain scaling operation has to be done:

result = (rawvalue - 300) / -2

It would be very helpful to be able to define this scaling-operation in message/field-definition.
My suggestion - to be backward compatible - is the use of named parameters like:
num - numerator
den - denominator
off - offset

_6_TimeSinceLastCommand,BI0:6,num=-1;den=2;off=-300,Min,Zeit seit letztem Kommando

or the use of a num-den-off-triple in brackets

_6_TimeSinceLastCommand,BI0:6,[-1,2,-300],Min,Zeit seit letztem Kommando
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants