Skip to content

Commit

Permalink
Merge pull request #17 from oksanagit/add_options
Browse files Browse the repository at this point in the history
Adding save/restore and iocStats configurable options to the example IOC
  • Loading branch information
kmpeters authored Apr 14, 2023
2 parents cdcfd09 + 1f51e47 commit d9f3859
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 6 deletions.
10 changes: 10 additions & 0 deletions configure/EXAMPLE_RELEASE.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# define all modules if building outside motor
SUPPORT=
ASYN=$(SUPPORT)/asyn
BUSY=$(SUPPORT)/busy
IPAC=$(SUPPORT)/ipac
#optional DEVIOCSTATS, AUTOSAVE
#DEVIOCSTATS=$(SUPPORT)/iocStats
AUTOSAVE=$(SUPPORT)/autosave

MOTOR=
-include $(MOTOR)/modules/RELEASE.$(EPICS_HOST_ARCH).local
# path to motorSmarAct is needed to build the IOC inside motorSmarAct, but outside motor
MOTOR_SMARACT=
EPICS_BASE=
9 changes: 9 additions & 0 deletions iocs/smarActIOC/iocBoot/iocSmarAct/AutoSave.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set_requestfile_path("./")
set_requestfile_path("$(MOTOR)/motorApp/Db")
set_savefile_path("./autosave")
set_pass0_restoreFile("auto_positions.sav")
set_pass0_restoreFile("auto_settings.sav")
set_pass1_restoreFile("auto_settings.sav")
save_restoreSet_status_prefix("$(PREFIX)")
dbLoadRecords("$(AUTOSAVE)/asApp/Db/save_restoreStatus.db", "P=$(PREFIX)")

3 changes: 3 additions & 0 deletions iocs/smarActIOC/iocBoot/iocSmarAct/auto_positions.req
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
file "asyn_motor_positions.req", P=$(P), M=m1
file "asyn_motor_positions.req", P=$(P), M=m2
file "asyn_motor_positions.req", P=$(P), M=m3
3 changes: 3 additions & 0 deletions iocs/smarActIOC/iocBoot/iocSmarAct/auto_settings.req
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
file "asyn_motor_settings.req", P=$(P), M=m1
file "asyn_motor_settings.req", P=$(P), M=m2
file "asyn_motor_settings.req", P=$(P), M=m3
13 changes: 13 additions & 0 deletions iocs/smarActIOC/iocBoot/iocSmarAct/st.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!../../bin/linux-x86_64/smarAct

< envPaths
epicsEnvSet("P", "smarAct:")
epicsEnvSet("MC_CT", "unit1")

cd "${TOP}"

Expand All @@ -18,10 +20,21 @@ dbLoadRecords("$(MOTOR)/db/motorUtil.db", "P=smarAct:")
#< smaractmcs2.iocsh
#< smaractscu.iocsh
##
# Optional: load devIocStats records (requires DEVIOCSTATS module)
#dbLoadRecords("$(DEVIOCSTATS)/db/iocAdminSoft.db", "IOC=$(P)$(MC_CT)")

# autosave/restore machinery
<AutoSave.cmd


iocInit

## motorUtil (allstop & alldone)
motorUtilInit("smarAct:")

# save motor positions every five seconds
create_monitor_set("auto_positions.req",5,"P=$(P)")
# save settings every thirty seconds
create_monitor_set("auto_settings.req",30,"P=$(P)")

# Boot complete
20 changes: 14 additions & 6 deletions iocs/smarActIOC/smarActApp/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ DBD += smarAct.dbd
smarAct_DBD += base.dbd

# Include dbd files from all support applications:
#ifdef ASYN
ifdef ASYN
smarAct_DBD += asyn.dbd
smarAct_DBD += drvAsynSerialPort.dbd
smarAct_DBD += drvAsynIPPort.dbd
#endif
endif
smarAct_DBD += motorSupport.dbd
smarAct_DBD += devSmarActMCSMotor.dbd
smarAct_DBD += devSmarActMCS2Motor.dbd
Expand All @@ -32,12 +32,20 @@ smarAct_DBD += devSmarActSCUMotor.dbd
# Add all the support libraries needed by this IOC
smarAct_LIBS += smarActMotor
smarAct_LIBS += motor
#ifdef ASYN
ifdef ASYN
smarAct_LIBS += asyn
#endif
#ifdef SNCSEQ
endif
ifdef SNCSEQ
smarAct_LIBS += seq pv
#endif
endif
ifdef DEVIOCSTATS
smarAct_DBD += devIocStats.dbd iocAdmin.dbd
smarAct_LIBS += devIocStats
endif
ifdef AUTOSAVE
smarAct_DBD += asSupport.dbd as.dbd
smarAct_LIBS += autosave
endif

# smarAct_registerRecordDeviceDriver.cpp derives from smarAct.dbd
smarAct_SRCS += smarAct_registerRecordDeviceDriver.cpp
Expand Down

0 comments on commit d9f3859

Please sign in to comment.