DAQ_SETTINGS_DBD += base.dbd
# Include dbd files from all support applications:
-#DAQ_SETTINGS_DBD += xxx.dbd
+DAQ_SETTINGS_DBD += asSupport.dbd
# Add all the support libraries needed by this IOC
-#DAQ_SETTINGS_LIBS += xxx
+DAQ_SETTINGS_LIBS += autosave
# DAQ_SETTINGS_registerRecordDeviceDriver.cpp derives from DAQ_SETTINGS.dbd
DAQ_SETTINGS_SRCS += DAQ_SETTINGS_registerRecordDeviceDriver.cpp
# If using the sequencer, point SNCSEQ at its top directory:
#SNCSEQ = $(MODULES)/seq-ver
+AUTOSAVE = $(EPICS_ROOT)/modules/autosave
+
EPICS_BASE = $(EPICS_ROOT)/base
# EPICS_ROOT is an absolute path here. If you need a different one, you don't
dbLoadDatabase "dbd/DAQ_SETTINGS.dbd"
DAQ_SETTINGS_registerRecordDeviceDriver pdbbase
+# autosave: configure request and save file search paths
+# .req (request) file: list the records to be saved
+# .sav save file: contains the previous saved state to be restored
+set_requestfile_path("$(TOP)/iocBoot/$(IOC)", "autosave_req")
+set_savefile_path("$(TOP)/iocBoot/$(IOC)", "./autosave_sav")
+
+# autosave: now restore the state from last time
+set_pass0_restoreFile("auto_settings.sav")
+set_pass1_restoreFile("auto_settings.sav")
+
## Load record instances
dbLoadRecords("db/PRESTO_SENSORS.db","sys=CBM,sub=MVD,daqsys=PRESTO")
dbLoadRecords("db/CONTEXT.db","sys=CBM,sub=MVD,daqsys=PRESTO")
cd "${TOP}/iocBoot/${IOC}"
iocInit
+# autosave: start monitoring (and saving) the records
+create_monitor_set("auto_settings.req", 15, "P=CBM:MVD:DAQ:PRESTO:")
+
## Start any sequence programs
#seq sncxxx,"user=pklaus"