#==============================================================
#
#  Abs:  Start the autosave task (for a linux and linxRT IOCs)
#
#  Name: restore_manual.cmd.soft
#
#  Rem:  Upon entry we will expect the following
#        macros must be defined.
#
#          a) TOP        - absolute path for top of IOC App
#          b) IOC        - IOC name  ex) sioc-lr20-ls01
#          c) IOC_DATA   - NFS Mount for IOC data directory
#          c) the status prefix has been set for autosave
#          d) the request and save files locations have been dset
#          e) the save_restoreStatus.db has been loaded
#
#        Note that all other environment variables
#        used within this file are defined in envPaths.
#
#        Upon exit this script will return to location TOP
#
#  Side:  Load this script after iocInit and restore.cmd.soft
#
#  Facility:  EED Laser Control
#
#  Auth: 20-Sep-2021, K. Luchini       (LUCHINI)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        dd-mmm-yyyy, First Lastname  (USERNAME):
#         comment
#
#==============================================================
#
# Generate the autosave PV list
# Note we need change directory to
# where we are saving the restore
# request file.
cd("${IOC_DATA}/${IOC}/autosave-req")
makeAutosaveFiles()

# Start the save_restore task 
# save changes on change
# Note: the last arg cannot be set to 0
# save other things every thirty seconds
# save positions every five seconds
create_monitor_set("${IOC}.req",5)

# change directory to TOP of application
cd("${TOP}")
pwd()

# End of script
