#==============================================================
#
#  Abs:  Common Soft IOC startup script
#
#  Name: st.cmd.soft
#
#  Rem:  Upon entry we expect to be at location TOP
#        and the following macros must be defined.
#        Note that all other environment variables #
#        used within this file are defined in envPaths.
#
#           IOC_NAME - IOC Device name       (ie. SIOC:BSY0:MG01)
#           LOCATION - Rack location 
#           ACF_INIT - Access Control File with path 
#
#        Upon exiting this script the directory
#        will be set to the TOP of the IOC Application.
#
#  Facility:  LCLS XLEAP Insertion Device Controls
#
#  Auth: 03-Mar-207, Kristi Luchini  (LUCHINI)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        dd-mmm-yyyy, First Lastname  (USERNAME):
#          comment
#
#==============================================================
#
# Set environment variables
< envPaths

#==============================================================
# Setup environment variables 
#==============================================================
#
# Get current iocBoot directory path so we can return easily
epicsEnvSet("IOC_BOOT"  ,"${TOP}/iocBoot/${IOC}")

# iocAdmin environment variables
# the environment variable LOCATION must
# be defined upon entry.
epicsEnvSet("ENGINEER"  , "Alex Montironi")
epicsEnvSet("STARTUP"   , "${EPICS_IOCS}/${IOC}")
epicsEnvSet("ST_CMD"    , "startup.cmd")

# Set path for stream devices (MCOR bulks)
epicsEnvSet("STREAM_PROTOCOL_PATH","${TOP}/db")

#==============================================================
# Load standard databases
#==============================================================
#
cd ${TOP}

# Load EPICS Database
dbLoadDatabase("dbd/idSupport.dbd")
idSupport_registerRecordDeviceDriver(pdbbase)

# Load IOC Administration Databse
dbLoadRecords("db/iocAdminSoft.db","IOC=${IOC_NAME}")

# The following database is a result of a python parser
# which looks at RELEASE_SITE and RELEASE to discover
# versions of software your IOC is referencing
# The python parser is part of iocAdmin
dbLoadRecords("db/iocRelease.db"  ,"IOC=${IOC_NAME}")

#==============================================================
#  Load Channe Access Security if configuration file exists
#==============================================================
#< ${ACF_INIT}

# End of script






