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

Manual start program does not respect weather scaling #12

Closed
morthul opened this issue Nov 16, 2014 · 3 comments
Closed

Manual start program does not respect weather scaling #12

morthul opened this issue Nov 16, 2014 · 3 comments

Comments

@morthul
Copy link

morthul commented Nov 16, 2014

Normal loop:
unsigned long water_time = (unsigned long)water_time_decode(prog.durations[sid]);
// if the program is set to use weather scaling
if (prog.use_weather)
water_time = water_time * os.options[OPTION_WATER_PERCENTAGE].value / 100;
pd.scheduled_stop_time[sid] = water_time;

Manual start:
else if(pid>0)
dur = water_time_decode(prog.durations[sid]);
if (dur>0 && !(os.stndis_bits[bid]&(1<<s))) {
pd.scheduled_stop_time[sid] = dur;

Shouldn't we be scaling the duration in a manual start by the weather setting?

@morthul
Copy link
Author

morthul commented Nov 16, 2014

Completely untested (not even compiled, don't have a dev environment set up for this right now):

Something like changing this:

else if(pid>0)
  dur = water_time_decode(prog.durations[sid]);

To this:

else if(pid>0) {
  unsigned long water_time = (unsigned long)water_time_decode(prog.durations[sid]);
  // if the program is set to use weather scaling
  if (prog.use_weather) water_time = water_time * os.options[OPTION_WATER_PERCENTAGE].value / 100;
  dur = water_time;
}

@rayshobby
Copy link
Owner

As specified in the user manual: Manual start program will ignore water percentage, this is because 'manual start program' is assumed to be manually overriding the normal sprinkler programs, therefore it should not observe water percentage, to avoid confusion (for example, a user who wants to manually start a program that waters each station 10 minutes will not want the water percentage to change the timing).

@morthul
Copy link
Author

morthul commented Nov 21, 2014

Thanks, Ray - I totally understand that in principle and missed that in the manual. I think it's confusing personally, though ;-)

@morthul morthul closed this as completed Nov 21, 2014
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

No branches or pull requests

2 participants