#!../../bin/rhel6-x86_64/sysck

## You may have to change sysck to something else
## everywhere it appears in this file

< envPaths

# IOCs can load settings which are common
# for all IOCs. Such as EPICS_CA_ADDR_LIST, etc...
# The file: pre_st.cmd does the trick
# </afs/slac/g/lcls/build/epics/iocCommon/All/pre_st.cmd


cd ${TOP}

## Register all support components
dbLoadDatabase("dbd/sysck.dbd")
sysck_registerRecordDeviceDriver(pdbbase)

# Load iocAdmin
dbLoadRecords("db/iocAdminSoft.db","IOC=SIOC:SYS6:CK00")

## Load record instances
dbLoadRecords("db/dbExample.vdb","USER=TESTFAC")
#dbLoadRecords("db/dbExample1.db","user=jingchenHost")
#dbLoadRecords("db/dbExample2.db","user=jingchenHost,no=1,scan=1 second")
#dbLoadRecords("db/dbExample2.db","user=jingchenHost,no=2,scan=2 second")
#dbLoadRecords("db/dbExample2.db","user=jingchenHost,no=3,scan=5 second")
#dbLoadRecords("db/dbSubExample.db","user=jingchenHost")

## Setup autosave/restore
set_requestfile_path("${IOC_DATA}/${IOC}/autosave-req")
set_savefile_path("${IOC_DATA}/${IOC}/autosave")
save_restoreSet_status_prefix("SIOC:SYS6:CK00:")
dbLoadRecords("db/save_restoreStatus.db", "P=SIOC:SYS6:CK00:")

## Restore datasets
set_pass0_restoreFile("info_settings.sav")
set_pass1_restoreFile("info_settings.sav")

## Set this to see messages from mySub
#var mySubDebug 1

## Load Access Security File
asSetFilename("${TOP}/db/sysckAccessControl.acf")

cd ${TOP}/iocBoot/${IOC}
iocInit()

## Start logging messages before starting sequences.
iocLogInit()

## Log values only on change
caPutLogInit()

## Start any sequence programs
#seq sncExample,"USER=LCLS"

## Start saving datasets
cd("${IOC_DATA}/${IOC}/autosave-req")
makeAutosaveFiles()
create_periodic_set("info_settings.req",60,"")

## Now we need to do a favor for the IRMIS crawler
## All IOCs should dump some common info after initial
## startup.
## The file: post_st.cmd does the trick
#</afs/slac/g/lcls/build/epics/iocCommon/All/post_st.cmd

