Cook-E-team / Cook-E

A mobile application that helps schedule cooking with multiple recipes
GNU General Public License v3.0
2 stars 1 forks source link

NextStep and PrevStep in Schedular recovery #12

Closed carsonal closed 8 years ago

carsonal commented 8 years ago

NextStep and PrevStep do not recover when asking for prevstep if there is no prevstep or nextstep if there is no nextstep. Should be able to ask for prevstep if made a mistake and went past the last step.

samcrow commented 8 years ago

This looks like it might have been fixed.

tsjacoby commented 8 years ago

There is no way to go past the last step and no way to get the current step. If you're at the end of the steps and call for the next step then it returns null. Then if you call for the previous step it returns the second to last step if present. What behavior is desired?

samcrow commented 8 years ago

For the user interface, one convenient thing would be to have the getNextStep/getPreviousStep methods return a value that has some information about the status.

The returned value could contain the next step, or it could indicate that the user has reached the end of the recipe or that the scheduler is waiting for a parallel step to finish.

Alternatively, the user interface could call methods to get that information (isAtEnd and isWaitingForSimultaneousStep) after getNextStep/getPreviousStep.

Sam

On 2016-02-26, at 16:26, tsjacoby notifications@github.com wrote:

There is no way to go past the last step and no way to get the current step. If you're at the end of the steps and call for the next step then it returns null. Then if you call for the previous step it returns the second to last step if present. What behavior is desired?

— Reply to this email directly or view it on GitHub.

tsjacoby commented 8 years ago

I've added a getCurrStep function and another one called isAtFinalStep. The Schedules interface isn't very fun to use, but hopefully this is enough to get us by.