A script to post weekend water to Alyx and email users.
The script makes it easy to automatically post water amounts to the Alyx database for weekends and holidays. In addition it sends an email to users with the required water for each day. We use this to notify BSU staff of which subjects require water during weekends.
This is designed to work with Rigbox and Alyx.
- MATLAB 2018b or later
- An instance of the Alyx database
- An STMP email account (e.g. GMail, Outlook)
- Rigbox v2.4 or later
- Git Bash (uses curl to send emails)
- (Optional) An API key for Calendarific to determine bank holidays
- Ensure the above requirements are installed. For Rigbox, simply clone and run
addRigboxPaths
in MATAB. - In MATLAB, add the WeekendWater repository to your paths (e.g.
addpath('WeekendWater')
) - Follow these instructions on how to set up your Rigbox paths file. You will need to ensure that the
gitExe
field points to your installed Git Bash executable, and themainRepository
is where your parameterProfiles.mat file will be saved (where subjects marked for weekend training are stored). - In MATLAB, run
ww.setup
and follow the steps to set the required parameters. - To run the script, say, every Friday, create a task on Windows Scheduler. Add an action to start a program. The program should be MATLAB (i.e.
"C:\Program Files\MATLAB\R2018b\bin\matlab.exe"
) and the arguments should be-r "ww.generate;exit"
*.
*To ensure that MATLAB returns, even after errors, use -r "exit(run_safe)"
Parameters can be updated using the ww.Params
class, or by simply re-running ww.setup
. Below shows how to change the number of future weekend days to 3:
params = ww.Params;
params.set('nDaysInFuture', 3)
params.save
The code was written by Miles Wells and Micheal Krumin.