#==============================================================
#
#  Name: README
#
#  Rem:  This is the iocBoot directory for the LCLS
#        Feedback Controller IOC Application. This README contains 
#        more detailed information on the updates to the st.cmd and 
#        the vioc's
#
#  Loc:  /afs/slac/g/lcls/build/epics/iocTop/FastFeedback/MAIN_TRUNK/iocBoot
#
#  Auth: 14-Dec-2015, A. Babbitt      (ababbitt)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  3-16-2016 - Required new epicsEnvSet Variable found in each vioc's specific st.cmd
#  Must be set to zero for Longitudinal feedback loops
#  epicsEnvSet("LOCAL_SETPOINTS", "0")
#  Must be set to one for all other types of feedback loops
#  epicsEnvSet("LOCAL_SETPOINTS", "1")
#  
#  Added Second Batch of Development Vioc's 
#  (will run on cpu-sys0-fb02 on production)
#  vioc-in20-tr01 => vevr0
#  vioc-in20-tr02 => vevr1
#  vioc-sys0-gn01 => vevr2
#  vioc-sys0-lg01 => vevr3
#  vioc-sys0-und1 => vevr4
#  vioc-sys0-und2 => vevr5
#
#  Current Development Vioc's (these are the vioc's that will run on 
#  cpu-sys0-fb01 on production)
#  vioc-bsy0-tr01 => vevr0 
#  vioc-li21-tr01 => vevr1
#  vioc-li21-tr02 => vevr2
#  vioc-li25-tr01 => vevr3
#  vioc-li28-tr01 => vevr4
#  vioc-ltu1-tr01 => vevr5
#  vioc-ltu1-tr02 => vevr6
#  vioc-ltu1-tr03 => vevr7
#
#  Original Development vioc's
#  vioc-b34-fb01
#  vioc-b34-fb02
#  vioc-b34-fb03
#  vioc-b34-fb04
#  vioc-b34-fb05
#  vioc-b34-fb06
#        
#==============================================================
# Notes on how database records are being called and where the macros needed 
# to be passed through to remove hardcoded "IOC:SYS0"
# Also, shows databases that currently have a longitudinal-only section
#
# fbck_template.db => fbckLoop.db, fbckIoc.db, iocEnergyChirp.db (for longitudinal)
#       fbckIoc.db => fbckIocConfig.db, fbckIocStatus.db
#                     fbckIocConfig.db => records that use to contain "IOC:SYS0" (now replaced with macros)
#                     fbckIocStatus.db => records with "IOC:SYS0" + longitudinal section
#      fbckLoop.db => fbckConfig.db, fbckStatus.db, fbckState.db, fbckAct.db, fbckMeas.db
#                     fbckConfig.db => records with "FBCK:$(AREA):$(LOOP):SOMETHING
#                     fbckStatus.db => records with "FBCK:$(AREA):$(LOOP):SOMETHING
#                     fbckState.db  => has some IOC:SYS0 + longitudinal section
#                     fbckAct.db    => records with "FBCK:$(AREA):$(LOOP):SOMETHING
#                     fbckMeas.db   => records with "FBCK:$(AREA):$(LOOP):SOMETHING
#      iocEnergyChirp.db = > just records (was no IOC:SYS0)
##
#Note: Feedback PV names are generated with the following macros:
#epicsEnvSet("FB", "${LOCA}")
#epicsEnvSet("LOOP", "TR01")
#
#vioc PV names are generated with the following PV names:
##System Location:
#epicsEnvSet("LOCA","BSY0")                                                                                              
#epicsEnvSet("LOOP", "TR01")
#epicsEnvSet("IOC_TYPE", "VIOC")
#epicsEnvSet("IOC_NAME",  "${IOC_TYPE}:${LOCA}:${LOOP}")
#
#Current proposed naming scheme has FB = LOCA, but for future flexibility will leave these macros
#seperate
#==============================================================
#
# Mod: 
#
# #   Nov. 05, 2015 L. Piccoli - created
#
# #   Nov. 16, 2015 A. Babbitt - Updated for EVR sharing and LinuxRT
# #   A) Updated for LinuxRT real-time priority threads
# #   B) Updated for EVR sharing - with older evr substitutions (IOC-SYS0-FB01.substitutions)
# #   C) Updated save/restore and iocAdmin functionality (modernization) 
# #   D) Updated event module databases, provided macro substitution, and generic files (in progress)
#
# #   Nov. 20th, 2015 A. Babbitt - Generated new vioc-b34-fb02 to support the following:
# #   A) Set-up the 2nd vevr1
# #   B) Set-up linuxRT to run two vioc's
# #   C) Clean-up st.cmd to use macros for vevr's, vioc's, and feedbacks (generalize/modular)
# #   D) Modernize the evr templates => pass in macros versus IOC:SYS:FB03.db#   
# #   E) Create generic fbckFB03.db files and pass in macros
#
# #   Nov. 30, 2015 A. Babbitt - Loop Splitting 
# #   A) Using generic template files - define loop parameters with macros
# #   B) Using macro for virtual EVR  - goal is to just change environment variables (generic st.cmd)
# #   C) Test new template files - update template file names
# #   D) Clean-up the auto/save restore (just one loop now per st.cmd)
#
# #   Dec. 7, 2015 A. Babbitt -  Database clean-up under /Db/common
# #   Goal 1: A) Use macros to remove hardcoded LG01 for longitudinal feedbacks to provide capability to configure 
# #         new longitudinal feedbacks in the future using the same databases (fbckIOCStatus.db, fbckState.db)
# #         & B) only generate the logitudinal feedback PV's when it actually is a longitudinal feedback loop (part be deffered)
# #   Current Solution Under Consideration (deferred): Pass a flag into fbckIOCStatus.db and fbckState.db (as a macro) for longitudinal 
# #        feedbacks and use conditional logic in fbckIOCStatus.db and fbckState.db for longitudinal feedbacks 
# #        (and hope C++ code doesn't depend on having the logitudinal feedback PV's (regardless of loop) = > 
# #        if it does, remove flag and and just use the macro that was part one of the goal
# #   Goal 2: Update all database files and st.cmd to provide macro substitution for "IOC:SYS0" in order to be 
# #           able to configure PV names generically and easily reconfigure for testing with current screens.
# #        "IOC:SYS0" => "${IOC}:${LOCA}" (then easily reconfigure PV names later)
#
# #   Test Plan:
# #        1) Change the hardcoded LG01 to ${LOOP} = >reboot (see if this fixes previous errors with the FLNK-fixed)
# #        2) Macro Flag = > need to pass through .db chain and put in conditional logic around longitudinal only code
# #                      =>  see if this breaks C++ code  (might break - still considering whether this is necessary-deffered logitudinal flag)
# #        3) Update macro name (pass through the .db chain) to fix hardcoded "IOC:SYS0"  => reboot (tested-done)
#    
#    Dec. 14, 2015 A.Babbitt - Items 1) and 3) from the test plan have beeen tested on vioc-b34-fb01.
#    Goal 1: Want to provide generic st.cmd that applies to ALL vioc's under /iocBoot/common
#            Each vioc directory will contain a shortened st.cmd that contains parameters unique to that vioc
#    Rationale: Made and tested changes to st.cmd in vioc-34-fb01/st.cmd, which now need to be rolled out to the other vioc's
#               Isolating the common st.cmd from the vioc-unique parameters with reduce future development work and human errors 
#               (one source to keep updated versus six instances (or 14 on production)
#
#    Dec. 15, 2015 A. Babbitt
#            Generating a new tagged release.  Details can be found in the RELEASE_NOTES folder
#            Begin development testing
#
#    Feb. 19  2016 A. Babbitt
#            Updated development vioc's to match the vioc's that will run on cpu-sys0-fb01 on production
#            Updated vevr{0-7} 
#            Cleaned up macro substitution and fix PV names
#
#
