-
Notifications
You must be signed in to change notification settings - Fork 9
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
Update endpoints.py #7
base: master
Are you sure you want to change the base?
Conversation
Only plot one point per minute to unclutter several days fermentation charts.
row[0], "%Y-%m-%d %H:%M:%S") - | ||
datetime.datetime(1970, 1, 1)).total_seconds()) * 1000 | ||
if ( abs(float(row[1])) < 110 ) and # filter invalid points | ||
( p_time >= l_time ): # only plot if more than 60 sec from previus point |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, but IMO should be configurable...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the enable/disable or the time interval ( 60 sec )?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lalo-uy I think you could have a parameter plot_period
to configure that and have the default of 60.
So you replace the line: l_time = p_time + 60000;
With: l_time = p_time + 1000 * cbpi.get_config_parameter("plot_period", 60)
It that what you meant @jpgimenez?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 agree... the parameter is better than a hardcoded value
row[0], "%Y-%m-%d %H:%M:%S") - | ||
datetime.datetime(1970, 1, 1)).total_seconds()) * 1000 | ||
if ( abs(float(row[1])) < 110 ) and # filter invalid points | ||
( p_time >= l_time ): # only plot if more than 60 sec from previus point |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lalo-uy I think you could have a parameter plot_period
to configure that and have the default of 60.
So you replace the line: l_time = p_time + 60000;
With: l_time = p_time + 1000 * cbpi.get_config_parameter("plot_period", 60)
It that what you meant @jpgimenez?
Good one.
El El lun, 12 de oct. de 2020 a la(s) 11:03, staticdev <
[email protected]> escribió:
…
***@***.**** requested changes on this pull request.
------------------------------
In modules/logs/endpoints.py
<#7 (comment)>:
> for row in reader:
try:
- array.append([
- int((datetime.datetime.strptime(
- row[0], "%Y-%m-%d %H:%M:%S") -
- datetime.datetime(1970, 1, 1)).total_seconds()) *
- 1000,
- float(row[1])
- ])
+ p_time=int((datetime.datetime.strptime( # get point timestamp
+ row[0], "%Y-%m-%d %H:%M:%S") -
+ datetime.datetime(1970, 1, 1)).total_seconds()) * 1000
+ if ( abs(float(row[1])) < 110 ) and # filter invalid points
+ ( p_time >= l_time ): # only plot if more than 60 sec from previus point
@lalo-uy <https://github.com/lalo-uy> I think you could have a parameter
plot_period to configure that and have the default of 60.
So you replace the line: l_time = p_time + 60000;
With: l_time = p_time + 1000 * cbpi.get_config_parameter("plot_period",
60)
It that what you meant @jpgimenez <https://github.com/jpgimenez>?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACXBW4IBN6HSF4Y5M7GKXWDSKMEDPANCNFSM4P7Q4CLA>
.
|
@lalo-uy if you add the parameter I'm good with merging this... |
Only plot one point per minute to unclutter several days fermentation charts.
Even on kettle to many point do not make sense.