Skip to content
Snippets Groups Projects
Commit c230ab99 authored by Anders Lindh Olsson's avatar Anders Lindh Olsson :8ball:
Browse files

Merge branch 'cleanup' into 'master'

E3-1392: Module review fixes

See merge request !30
parents 47afe468 05ad7b52
No related branches found
No related tags found
1 merge request!30E3-1392: Module review fixes
Pipeline #180233 canceled
Showing with 52 additions and 706 deletions
# # Copyright (c) 2017 - 2020 Jeong Han Lee
# Copyright (c) 2017 - Present Jeong Han Lee
# Copyright (c) 2017 - Present European Spallation Source ERIC # Copyright (c) 2017 - Present European Spallation Source ERIC
# #
# The program is free software: you can redistribute # The program is free software: you can redistribute
...@@ -14,17 +13,7 @@ ...@@ -14,17 +13,7 @@
# #
# You should have received a copy of the GNU General Public License along with # You should have received a copy of the GNU General Public License along with
# this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt # this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt
#
#
# Author : Jeong Han Lee
# email : jeonghan.lee@gmail.com
# Date : 2018Apr06-1331-13CEST
# version : 0.0.1
TOP:=$(CURDIR) TOP:=$(CURDIR)
include $(TOP)/configure/CONFIG include $(TOP)/configure/CONFIG
include $(TOP)/configure/RULES include $(TOP)/configure/RULES
# e3-autosave # e3-autosave
## Autosave settings Wrapper for the `autosave` module - part of EPICS infrastructure at ESS. This module is loaded through `essioc` for production IOCs.
We try to enclose most possible autosave configuration within `autosave.iocsh`. ## Installation
## Preparation of DB ```sh
$ make init patch build
Each record in database file that needs to have values saved by `autosave` must have the one of following `info` tags. Such as $ make install
```
info(autosaveFields, "PREC SCAN DESC OUT")
info(autosaveFields_pass0, "VAL")
info(autosaveFields_pass1, "VAL")
``` ```
Each info tag should be matched with what one would like to use such as For further targets, type `make`.
* `autosaveFields` : before and after record initialization ## Usage
- `settings.sav` : in `$(AS_TOP)/$(IOCNAME)/save`
- `settings.req` : in `$(AS_TOP)/$(IOCNAME)/req`
* `autosaveFields_pass0` : before record initialization
- `values_pass0.sav` : in `$(AS_TOP)/$(IOCNAME)/save`
- `values_pass0.req` : in `$(AS_TOP)/$(IOCNAME)/req`
* `autosaveFields_pass1`: after record initialization (Most autosave values can be restored at Pass 0 and Pass 1 using the `autosaveFields` info tag.) ```sh
- `values_pass1.sav` : in `$(AS_TOP)/$(IOCNAME)/save` $ iocsh -r "autosave"
- `values_pass1.req` : in `$(AS_TOP)/$(IOCNAME)/req` ```
Please look at the example in [Autosave DB example](template/SR_test_info.db). ### How it works
## How to enable it within e3 To set up autosave (and boot-time restore) of record fields, use one of the following info-tags:
* `autosaveFields`: to restore **before** and **after** record initialization
- `settings.sav`: in `$(AS_TOP)/$(IOCNAME)/save`
- `settings.req`: in `$(AS_TOP)/$(IOCNAME)/req`
* `autosaveFields_pass0`: to restore only **before** record initialization
- `values_pass0.sav`: in `$(AS_TOP)/$(IOCNAME)/save`
- `values_pass0.req`: in `$(AS_TOP)/$(IOCNAME)/req`
``` * `autosaveFields_pass1`: to restore only **after** record initialization
require autosave,5.10.0 - `values_pass1.sav`: in `$(AS_TOP)/$(IOCNAME)/save`
- `values_pass1.req`: in `$(AS_TOP)/$(IOCNAME)/req`
epicsEnvSet("TOP", "$(E3_CMD_TOP)/..") For example:
epicsEnvSet("IOCNAME", "as_test")
iocshLoad("$(autosave_DIR)/autosave.iocsh", "AS_TOP=$(TOP),IOCNAME=$(IOCNAME)") ```
record("*", "some-record") {
info(autosaveFields, "PREC SCAN DESC OUT")
info(autosaveFields_pass0, "VAL")
info(autosaveFields_pass1, "VAL")
}
``` ```
## asVerify Each info tag should be matched with what one would like to use such as
asVerify is avaiable in `${EPICS_BASE}/bin/${EPICS_HOST_ARCH}/asVerify_VERSION`. Once e3 environment is sourced, it can be executable in that terminal. Please see its usage at https://epics.anl.gov/bcda/synApps/autosave/autoSaveRestore_R5-5.html#asVerify
## request (req) files ## Contributing
The req files can be used, however, one should copy all req files into `db` folder, by `TEMPLATE` variable. In order to integrate an IOC, please check [README : How to use existent req files](README_REQUEST.md). However, it is highly recommended **NOT** to use this method if possible. Contributions through pull/merge requests only.
#
# Copyright (c) 2017 - 2019 Jeong Han Lee # Copyright (c) 2017 - 2019 Jeong Han Lee
# Copyright (c) 2019 European Spallation Source ERIC # Copyright (c) 2019 - Current European Spallation Source ERIC
# #
# The program is free software: you can redistribute # The program is free software: you can redistribute
# it and/or modify it under the terms of the GNU General Public License # it and/or modify it under the terms of the GNU General Public License
...@@ -14,71 +13,45 @@ ...@@ -14,71 +13,45 @@
# #
# You should have received a copy of the GNU General Public License along with # You should have received a copy of the GNU General Public License along with
# this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt # this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt
#
# Author : Jeong Han Lee
# email : han.lee@esss.se
# Date : Wednesday, September 11 20:36:45 CEST 2019
# version : 0.0.4
# Get where_am_I before include driver.makefile.
# After driver.makefile, where_am_I is the epics base,
# so we cannot use it
# LEGACY_RSET should be defined before driver.makefile
# require-ess from 3.0.1
#LEGACY_RSET = YES
where_am_I := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) where_am_I := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
include ${E3_REQUIRE_TOOLS}/driver.makefile include ${E3_REQUIRE_TOOLS}/driver.makefile
USR_CFLAGS += -DDBLOADRECORDSHOOKREGISTER
USR_CFLAGS += -DUSE_TYPED_RSET
USR_CFLAGS += -Wno-unused-variable
# To enable autosaveBuild, use dbLoadRecordsHookRegister. (But it doesn't USR_CFLAGS += -Wno-unused-function
# appear in EPICS base until 3.14.12.5, so disable by default for now.)
# ESS uses the more than 3.14.12.5, so we enable them by default
USR_CFLAGS += -DDBLOADRECORDSHOOKREGISTER
USR_CFLAGS += -DUSE_TYPED_RSET
USR_CFLAGS += -Wno-unused-variable
USR_CFLAGS += -Wno-unused-function
USR_CPPFLAGS += -Wno-unused-variable USR_CPPFLAGS += -Wno-unused-variable
USR_CPPFLAGS += -Wno-unused-function USR_CPPFLAGS += -Wno-unused-function
ASAPP := asApp
ASAPPDB := $(ASAPP)/Db
ASAPPSRC := $(ASAPP)/src
ASAPP:=asApp
ASAAPDB:= $(ASAPP)/Db
ASAPPSRC:= $(ASAPP)/src
#include files
HEADERS += $(ASAPPSRC)/os/Linux/osdNfs.h HEADERS += $(ASAPPSRC)/os/Linux/osdNfs.h
# OS independent code
#os independent code
SOURCES += $(ASAPPSRC)/dbrestore.c SOURCES += $(ASAPPSRC)/dbrestore.c
SOURCES += $(ASAPPSRC)/save_restore.c SOURCES += $(ASAPPSRC)/save_restore.c
SOURCES += $(ASAPPSRC)/initHooks.c SOURCES += $(ASAPPSRC)/initHooks.c
SOURCES += $(ASAPPSRC)/fGetDateStr.c SOURCES += $(ASAPPSRC)/fGetDateStr.c
SOURCES += $(ASAPPSRC)/configMenuSub.c SOURCES += $(ASAPPSRC)/configMenuSub.c
SOURCES += $(ASAPPSRC)/verify.c
#os dependent code # OS dependent code
SOURCES += $(ASAPPSRC)/os/Linux/osdNfs.c SOURCES += $(ASAPPSRC)/os/Linux/osdNfs.c
#DO NOT relocate verify.c file DBDS += $(ASAPPSRC)/asSupport.dbd
#os independent code
SOURCES += $(ASAPPSRC)/verify.c
DBDS += $(ASAPPSRC)/asSupport.dbd
SCRIPTS += $(wildcard ../iocsh/*.iocsh) SCRIPTS += $(wildcard ../iocsh/*.iocsh)
TEMPLATES += ../template/save_restoreStatus.db TEMPLATES += $(ASAPPDB)/save_restoreStatus.db
TEMPLATES += $(ASAAPDB)/configMenu.db TEMPLATES += $(ASAPPDB)/configMenu.db
TEMPLATES += $(ASAAPDB)/configMenuNames.req TEMPLATES += $(ASAPPDB)/configMenuNames.req
TEMPLATES += $(ASAAPDB)/configMenu.req TEMPLATES += $(ASAPPDB)/configMenu.req
TEMPLATES += $(ASAAPDB)/configMenu_settings.req TEMPLATES += $(ASAPPDB)/configMenu_settings.req
######################################################## ########################################################
# #
...@@ -112,11 +85,3 @@ $(ASVERIFY): $(ASVERIFY_SOURCES:.c=.o) ...@@ -112,11 +85,3 @@ $(ASVERIFY): $(ASVERIFY_SOURCES:.c=.o)
$(CCC) -o $@ -L$(EPICS_BASE_LIB) -Wl,-rpath,$(EPICS_BASE_LIB) $(OP_SYS_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(CODE_LDFLAGS) $^ -lca -lCom $(CCC) -o $@ -L$(EPICS_BASE_LIB) -Wl,-rpath,$(EPICS_BASE_LIB) $(OP_SYS_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(CODE_LDFLAGS) $^ -lca -lCom
@echo "<<<<< asVerify Done" @echo "<<<<< asVerify Done"
@echo "" @echo ""
#
.PHONY: vlibs
vlibs:
#
require iocStats,3.1.16
require autosave,5.10.0
require std,3.5.0
epicsEnvSet("TOP", "$(E3_CMD_TOP)/..")
epicsEnvSet("SEC", "SEC")
epicsEnvSet("SUB", "SUB01")
epicsEnvSet("P", "$(SEC)-$(SUB):")
epicsEnvSet("DIS", "DIS")
epicsEnvSet("DEV", "DEV-01")
epicsEnvSet("R", "$(DIS)-$(DEV)")
iocshLoad("$(TOP)/iocsh/autosave.iocsh", "AS_TOP=$(TARGET),IOCNAME=$(IOCNAME),SEQ_PERIOD=60")
dbLoadRecords("$(TOP)/template/SR_test_info.db","P=$(IOCNAME):,N=12")
iocInit()
dbl > "${IOCNAME}_PVs.list"
require iocStats,3.1.16
require autosave,5.10.0
#require std,3.6.1
epicsEnvSet("TOP", "$(E3_CMD_TOP)/..")
epicsEnvSet("SEC", "SEC")
epicsEnvSet("SUB", "SUB01")
epicsEnvSet("P", "$(SEC)-$(SUB):")
epicsEnvSet("DIS", "DIS")
epicsEnvSet("DEV", "DEV-01")
epicsEnvSet("R", "$(DIS)-$(DEV)")
epicsEnvSet("IOCNAME", "ioc_test")
iocshLoad("$(TOP)/iocsh/autosave.iocsh", "AS_TOP=$(TOP),IOCNAME=$(IOCNAME),SEQ_PERIOD=60")
dbLoadRecords("$(TOP)/template/SR_test_info.db","P=$(IOCNAME):,N=12")
iocInit()
dbl > "${IOCNAME}_PVs.list"
#
VARS_EXCLUDES := $(.VARIABLES) VARS_EXCLUDES := $(.VARIABLES)
ifneq (,$(findstring dev,$(MAKECMDGOALS)))
include $(TOP)/configure/RELEASE_DEV
else
include $(TOP)/configure/RELEASE include $(TOP)/configure/RELEASE
endif
ifneq (,$(findstring dev,$(MAKECMDGOALS)))
include $(TOP)/configure/CONFIG_MODULE_DEV
else
include $(TOP)/configure/CONFIG_MODULE include $(TOP)/configure/CONFIG_MODULE
endif
E3_REQUIRE_LOCATION := $(EPICS_BASE)/$(E3_REQUIRE_NAME)/$(E3_REQUIRE_VERSION) E3_REQUIRE_LOCATION := $(EPICS_BASE)/$(E3_REQUIRE_NAME)/$(E3_REQUIRE_VERSION)
include $(E3_REQUIRE_LOCATION)/configure/CONFIG include $(E3_REQUIRE_LOCATION)/configure/CONFIG
...@@ -7,6 +7,4 @@ E3_MODULE_SRC_PATH:=$(EPICS_MODULE_NAME) ...@@ -7,6 +7,4 @@ E3_MODULE_SRC_PATH:=$(EPICS_MODULE_NAME)
E3_MODULE_MAKEFILE:=$(EPICS_MODULE_NAME).Makefile E3_MODULE_MAKEFILE:=$(EPICS_MODULE_NAME).Makefile
-include $(TOP)/configure/CONFIG_OPTIONS -include $(TOP)/configure/CONFIG_OPTIONS
# The definitions shown below can also be placed in an untracked CONFIG_MODULE*.local
-include $(TOP)/configure/CONFIG_MODULE.local -include $(TOP)/configure/CONFIG_MODULE.local
#
EPICS_MODULE_NAME:=autosave
#
EPICS_MODULE_TAG:=master
#
E3_MODULE_VERSION:=develop
#
E3_MODULE_NAME:=$(EPICS_MODULE_NAME)
#
E3_MODULE_SRC_PATH:=$(EPICS_MODULE_NAME)-dev
#
E3_MODULE_MAKEFILE:=$(EPICS_MODULE_NAME).Makefile
#
E3_MODULE_DEV_GITURL:="https://github.com/epics-modules/autosave"
#
-include $(TOP)/configure/CONFIG_OPTIONS
# The definitions shown below can also be placed in an untracked CONFIG_MODULE*.local
-include $(TOP)/configure/CONFIG_MODULE_DEV.local
#
# One should install libusb-1.0.0
# Debian apt-get install libusb-1.0-0-dev libusb-1.0-0
# USR_INCLUDES
# $ pkg-config --cflags libusb-1.0
# -I/usr/include/libusb-1.0
# USR_LDFLAGS
# $ pkg-config --libs libusb-1.0
# $ -lusb-1.0
#
#ifeq (linux-x86_64, $(T_A))
# DRV_USBTMC=YES
# export DRV_USBTMC
#endif
#
EPICS_BASE:=/epics/base-7.0.7 EPICS_BASE:=/epics/base-7.0.7
E3_REQUIRE_NAME:=require E3_REQUIRE_NAME:=require
E3_REQUIRE_VERSION:=5.0.0 E3_REQUIRE_VERSION:=5.0.0
# The definitions shown below can also be placed in an untracked RELEASE.local
-include $(TOP)/../../RELEASE.local -include $(TOP)/../../RELEASE.local
-include $(TOP)/../RELEASE.local -include $(TOP)/../RELEASE.local
-include $(TOP)/configure/RELEASE.local -include $(TOP)/configure/RELEASE.local
#
EPICS_BASE=/epics/base-7.0.5
E3_REQUIRE_NAME:=require
E3_REQUIRE_VERSION:=3.4.0
# The definitions shown below can also be placed in an untracked RELEASE_DEV.local
-include $(TOP)/../../RELEASE_DEV.local
-include $(TOP)/../RELEASE_DEV.local
-include $(TOP)/configure/RELEASE_DEV.local
include $(E3_REQUIRE_CONFIG)/RULES_SITEMODS include $(E3_REQUIRE_CONFIG)/RULES_SITEMODS
include $(TOP)/configure/module/RULES_MODULE include $(TOP)/configure/module/RULES_MODULE
-include $(TOP)/configure/module/RULES_DKMS_L -include $(TOP)/configure/module/RULES_DKMS_L
# KMOD_NAME := mrf
# .PHONY: dkms_add
# dkms_add: conf
# $(MSI) -M name="$(E3_MODULE_NAME)" -M version="$(E3_MODULE_VERSION)" -M kmod_name="$(KMOD_NAME)" $(TOP)/dkms/dkms_with_msi.conf.in > $(TOP)/dkms/dkms_with_msi.conf
# $(QUIET) cat $(TOP)/dkms/dkms_with_msi.conf $(TOP)/dkms/dkms_without_msi.conf > $(TOP)/dkms/dkms.conf
# $(QUIET) install -m 644 $(TOP)/dkms/dkms.conf $(E3_KMOD_SRC_PATH)/
# $(SUDO) install -d /usr/src/$(E3_MODULE_NAME)-$(E3_MODULE_VERSION)
# $(SUDO) cp -r $(TOP)/$(E3_KMOD_SRC_PATH)/* /usr/src/$(E3_MODULE_NAME)-$(E3_MODULE_VERSION)/
# $(SUDO) $(DKMS) add $(DKMS_ARGS)
# setup:
# $(QUIET) $(SUDO2) 'echo KERNEL==\"uio*\", ATTR{name}==\"mrf-pci\", MODE=\"0666\" | tee /etc/udev/rules.d/99-$(KMOD_NAME).rules'
# $(QUIET) $(SUDO) /bin/udevadm control --reload-rules
# $(QUIET) $(SUDO) /bin/udevadm trigger
# $(QUIET) $(SUDO2) 'echo $(KMOD_NAME) | tee /etc/modules-load.d/$(KMOD_NAME).conf'
# $(QUIET) $(SUDO) depmod --quick
# $(QUIET) $(SUDO) modprobe -rv $(KMOD_NAME)
# $(QUIET) $(SUDO) modprobe -v $(KMOD_NAME)
# $(QUIET) echo ""
# $(QUIET) echo ""
# $(QUIET) echo "It is OK to see \"E3/RULES_DKMS:37: recipe for target 'setup' failed\""
# $(QUIET) echo "---------------------------------------------------------------------"
# $(QUIET) -ls -l /dev/uio* 2>/dev/null
# $(QUIET) echo "---------------------------------------------------------------------"
# setup_clean:
# $(QUIET) $(SUDO) modprobe -rv $(KMOD_NAME)
# $(SUDO) rm -f /etc/modules-load.d/$(KMOD_NAME).conf
# $(SUDO) rm -f /etc/udev/rules.d/99-$(KMOD_NAME).rules
# .PHONY: setup setup_clean
#
.PHONY: hdrs .PHONY: hdrs
hdrs: hdrs:
TEST_BIN_LOCATION = $(TEMP_CELL_PATH)/$(notdir $(EPICS_BASE))/require-$(E3_REQUIRE_VERSION)/$(E3_MODULE_NAME)/$(E3_MODULE_VERSION)/bin TEST_BIN_LOCATION = $(TEMP_CELL_PATH)/$(notdir $(EPICS_BASE))/require-$(E3_REQUIRE_VERSION)/$(E3_MODULE_NAME)/$(E3_MODULE_VERSION)/bin
......
How to reuse request files
===
It is highly recommended to use `info` tag instead of the seperated request files. However, this file would like to help them to use existent request files within `autosave.iocsh` within `e3-autosave` according to existent all EPICS modules' req files, own req files, or both.
## `e3-autosave`
```
require autosave,5.10.0
...
dbLoadRecords("spinnaker.db", "P=$(PREFIX),R=,PORT=$(PORT)")
...
iocshLoad("$(autosave_DIR)/autosave.iocsh", "AS_TOP=$(TOP),IOCNAME=$(IOCNAME)")
#
iocInit()
```
## `e3-ADSpinnakar`
* Use the same way to use `e3-autosave`
* Define **all** requestfile path before the first `dbLoadRecords`. It is important to open all req files, which are related with all database files. And one has to check where they are. And one has to define them all.
```
set_requestfile_path("$(ADSpinnaker_DB)", "")
set_requestfile_path("$(ADGenICam_DB)", "")
set_requestfile_path("$(ADCore_DB)", "")
set_requestfile_path("$(calc_DB)", "")
set_requestfile_path("$(busy_DB)", "")
set_requestfile_path("$(TOP)", "cmds")
```
* Create one own req file in a directory (for example, `cmds`).
```
$ more cmds/auto_settings.req
file "spinnaker_settings.req", P=$(P), R=$(R)
file "NDStdArrays_settings.req", P=$(P), R=$(R)
file "commonPlugin_settings.req", P=$(P)
```
* Add the `create_monitor_set` after `iocInit`
```
create_monitor_set("auto_settings.req", 5, "P=$(PREFIX),R=,IMAGE=$(IMAGE):")
```
* Full example for the ADSpinnaker application
```
require ADSpinnaker,2.0.0
require calc,3.7.3
require busy,1.7.2-e45eda2
require autosave,5.10.0
epicsEnvSet("TOP", "$(E3_CMD_TOP)/..")
set_requestfile_path("$(ADSpinnaker_DB)", "")
set_requestfile_path("$(ADGenICam_DB)", "")
set_requestfile_path("$(ADCore_DB)", "")
set_requestfile_path("$(calc_DB)", "")
set_requestfile_path("$(busy_DB)", "")
set_requestfile_path("$(TOP)", "cmds")
ADSpinnakerConfig("$(PORT)", "$(CAMERA_ID)", 0x1, 0)
dbLoadRecords("spinnaker.db", "P=$(PREFIX),R=,PORT=$(PORT)")
dbLoadRecords("PGR_BlackflyS_50S5C.db", "P=$(PREFIX),R=,PORT=$(PORT)")
NDStdArraysConfigure("$(IMAGE)", 5, 0, "$(PORT)", 0, 0)
dbLoadRecords("NDStdArrays.template", "P=$(PREFIX),R=,PORT=$(IMAGE),ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=Int16,FTVL=SHORT,NELEMENTS=$(NELEMENTS)")
iocshLoad("$(ADCore_DIR)/commPlugins.iocsh", "P=$(PREFIX),UNIT=1,PORT=$(IMAGE),QSIZE=$(QSIZE),XSIZE=$(XSIZE),YSIZE=$(YSIZE),NCHANS=$(NCHANS),CBUFFS=$(CBUFFS)")
iocshLoad("$(autosave_DIR)/autosave.iocsh", "AS_TOP=$(TOP),IOCNAME=$(IOCNAME)")
iocInit()
create_monitor_set("auto_settings.req", 5, "P=$(PREFIX),R=,IMAGE=$(IMAGE):")
```
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#- AUTOSAVE_VALUES_PERIOD_PASS0 - Optional, Default 5 #- AUTOSAVE_VALUES_PERIOD_PASS0 - Optional, Default 5
#- AUTOSAVE_VALUES_PERIOD_PASS1 - Optional, Default 10 #- AUTOSAVE_VALUES_PERIOD_PASS1 - Optional, Default 10
#- AUTOSAVE_SETTINGS_PERIOD - Optional, Default 5 #- AUTOSAVE_SETTINGS_PERIOD - Optional, Default 5
#- AUTOSAVE_DEBUG_MODE - Optional, Default 0
set_savefile_path ("$(AS_TOP)/$(IOCDIR)", "/save") set_savefile_path ("$(AS_TOP)/$(IOCDIR)", "/save")
set_requestfile_path ("$(AS_TOP)/$(IOCDIR)", "/req") set_requestfile_path ("$(AS_TOP)/$(IOCDIR)", "/req")
...@@ -27,7 +28,7 @@ system("install -d $(AS_TOP)/$(IOCDIR)/req") ...@@ -27,7 +28,7 @@ system("install -d $(AS_TOP)/$(IOCDIR)/req")
save_restoreSet_status_prefix("$(IOCNAME):as-") save_restoreSet_status_prefix("$(IOCNAME):as-")
#- Debug-output level #- Debug-output level
save_restoreSet_Debug(0) save_restoreSet_Debug($(AUTOSAVE_DEBUG_MODE=0))
#- Ok to save/restore save sets with missing values (no CA connection to PV)? #- Ok to save/restore save sets with missing values (no CA connection to PV)?
save_restoreSet_IncompleteSetsOk($(AUTOSAVE_INCOMPLETE=1)) save_restoreSet_IncompleteSetsOk($(AUTOSAVE_INCOMPLETE=1))
......
# what_ever_filename.p0.patch
Generic Description.....
* created by Jeong Han Lee, han.lee@esss.se
* related URL or reference https://github.com/icshwi
* Tuesday, February 13 13:24:57 CET 2018
# Site Specific EPICS Module Patch Files
## Changes
The changes were tested in local environemnt, and commits to the forked repository and do pull request to the epics community module repository.
* Check the original HASH, and your own master
* feb8856 : The original HASH
* master : Changed
## How to create a p0 patch file between commits
* Show what the difference between commits
* Create p0 patch
```
$git diff feb8856 master --no-prefix > ../patch/Site/what_ever_filename.p0.patch
```
record(ao, "$(P)SR_ao")
{
field(DTYP,"Soft Channel")
info(autosaveFields, "PREC SCAN DESC OUT")
info(autosaveFields_pass0, "VAL")
}
record(ao, "$(P)SR_aoDISP")
{
field(DTYP,"Soft Channel")
info(autosaveFields, "DISP")
}
record(ao, "$(P)SR_longout")
{
field(DTYP,"Soft Channel")
info(autosaveFields_pass1, "VAL")
}
record(bo, "$(P)SR_bo")
{
field(DTYP,"Soft Channel")
info(autosaveFields, "IVOV")
}
record(bi, "$(P)SR_bi")
{
field(DTYP,"Soft Channel")
info(autosaveFields_pass0, "SVAL")
}
# arrays
record(waveform, "$(P)SR_char_array")
{
field(NELM, "$(N)")
field(FTVL, "CHAR")
info(autosaveFields_pass1, "VAL")
}
record(waveform, "$(P)SR_double_array")
{
field(NELM, "$(N)")
field(FTVL, "DOUBLE")
info(autosaveFields_pass1, "VAL")
}
record(waveform, "$(P)SR_float_array")
{
field(NELM, "$(N)")
field(FTVL, "FLOAT")
info(autosaveFields_pass1, "VAL")
}
record(waveform, "$(P)SR_long_array")
{
field(NELM, "$(N)")
field(FTVL, "LONG")
info(autosaveFields_pass1, "VAL")
}
record(waveform, "$(P)SR_short_array")
{
field(NELM, "$(N)")
field(FTVL, "SHORT")
info(autosaveFields_pass1, "VAL")
}
record(waveform, "$(P)SR_string_array")
{
field(NELM, "$(N)")
field(FTVL, "STRING")
info(autosaveFields_pass1, "VAL")
}
record(waveform, "$(P)SR_uchar_array")
{
field(NELM, "$(N)")
field(FTVL, "UCHAR")
info(autosaveFields_pass1, "VAL")
}
record(waveform, "$(P)SR_ulong_array")
{
field(NELM, "$(N)")
field(FTVL, "ULONG")
info(autosaveFields_pass1, "VAL")
}
record(waveform, "$(P)SR_ushort_array")
{
field(NELM, "$(N)")
field(FTVL, "USHORT")
info(autosaveFields_pass1, "VAL")
}
Test Procedures
===
# Automatic
```
bash tools/check_autosave_status.bash
```
# Manual
* Run an IOC
```
e3-autosave (master)$ iocsh.bash cmds/as_test.cmd
```
* Wait for Backup files..
```
...
efe358d.proton.20315 > save_restore:write_save_file: Backup file (/home/jhlee/e3-7.0.3/e3-autosave/cmds/../ioc_test/save/values_pass0.savB) bad or not found. Writing a new one. [191010-162509]
save_restore:write_save_file: Backup file (/home/jhlee/e3-7.0.3/e3-autosave/cmds/../ioc_test/save/settings.savB) bad or not found. Writing a new one. [191010-162509]
save_restore:write_save_file: Backup file (/home/jhlee/e3-7.0.3/e3-autosave/cmds/../ioc_test/save/values_pass1.savB) bad or not found. Writing a new one. [191010-162514]
```
* Check PVs
```
e3-autosave (master)$ bash tools/SR_get.bash > 1
e3-autosave (master)$ cat 1
ioc_test:SR_aoDISP.DISP 0
ioc_test:SR_ao.PREC 0
ioc_test:SR_bo.IVOV 0
ioc_test:SR_ao.SCAN Passive
ioc_test:SR_ao.VAL 0
ioc_test:SR_ao.DESC
ioc_test:SR_ao.OUT
ioc_test:SR_longout 0
ioc_test:SR_bi.SVAL 0
ioc_test:SR_char_array 12 3 0 0 0 0 0 0 0 0 0 0 0
ioc_test:SR_double_array 12 2.50321e-308 0 0 0 0 0 0 0 0 0 0 0
ioc_test:SR_float_array 12 4.06377e-44 0 0 0 0 0 0 0 0 0 0 0
ioc_test:SR_long_array 12 3 0 0 0 0 0 0 0 0 0 0 0
ioc_test:SR_short_array 12 3 0 0 0 0 0 0 0 0 0 0 0
ioc_test:SR_string_array 12
ioc_test:SR_uchar_array 12 3 0 0 0 0 0 0 0 0 0 0 0
ioc_test:SR_ulong_array 12 2.50321e-308 0 0 0 0 0 0 0 0 0 0 0
ioc_test:SR_ushort_array 12 3 0 0 0 0 0 0 0 0 0 0 0
```
* Put some values
```
e3-autosave (master)$ bash tools/SR_put.bash
Old : ioc_test:SR_aoDISP.DISP 0
New : ioc_test:SR_aoDISP.DISP 27
Old : ioc_test:SR_ao.PREC 0
New : ioc_test:SR_ao.PREC 6
Old : ioc_test:SR_bo.IVOV 0
New : ioc_test:SR_bo.IVOV 67
Old : ioc_test:SR_ao.SCAN Passive
New : ioc_test:SR_ao.SCAN .1 second
Old : ioc_test:SR_ao.VAL 0
New : ioc_test:SR_ao.VAL 622.1
Old : ioc_test:SR_ao.DESC
New : ioc_test:SR_ao.DESC uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi
Old : ioc_test:SR_ao.OUT
New : ioc_test:SR_ao.OUT abc:rec PP NMS
Old : ioc_test:SR_longout 0
New : ioc_test:SR_longout 743
Old : ioc_test:SR_bi.SVAL 0
New : ioc_test:SR_bi.SVAL 5
Old : ioc_test:SR_char_array \003
New : ioc_test:SR_char_array uzffe
Old : ioc_test:SR_double_array 12 2.50321e-308 0 0 0 0 0 0 0 0 0 0 0
New : ioc_test:SR_double_array 12 6 67 80 622 743 0 0 0 0 0 0 0
Old : ioc_test:SR_float_array 12 6.5861e-44 0 0 0 0 0 0 0 0 0 0 0
New : ioc_test:SR_float_array 12 27 6 67 80 622 5 0 0 0 0 0 0
Old : ioc_test:SR_long_array 12 3 0 0 0 0 0 0 0 0 0 0 0
New : ioc_test:SR_long_array 12 27 6 67 80 622 743 0 0 0 0 0 0
Old : ioc_test:SR_short_array 12 3 0 0 0 0 0 0 0 0 0 0 0
New : ioc_test:SR_short_array 12 27 6 67 80 622 743 0 0 0 0 0 0
Old : ioc_test:SR_string_array 12
New : ioc_test:SR_string_array 12 uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi abc def ghi
Old : ioc_test:SR_uchar_array 12 3 0 0 0 0 0 0 0 0 0 0 0
New : ioc_test:SR_uchar_array 12 27 6 67 80 0 0 0 0 0 0 0 0
Old : ioc_test:SR_ulong_array 12 2.50321e-308 0 0 0 0 0 0 0 0 0 0 0
New : ioc_test:SR_ulong_array 12 27 6 67 80 622 743 0 0 0 0 0 0
Old : ioc_test:SR_ushort_array 12 3 0 0 0 0 0 0 0 0 0 0 0
New : ioc_test:SR_ushort_array 12 27 6 67 80 622 743 0 0 0 0 0 0
```
* Check PVs values
```
e3-autosave (master)$ bash tools/SR_get.bash > 2
jhlee@proton: e3-autosave (master)$ cat 2
ioc_test:SR_aoDISP.DISP 27
ioc_test:SR_ao.PREC 6
ioc_test:SR_bo.IVOV 67
ioc_test:SR_ao.SCAN .1 second
ioc_test:SR_ao.VAL 622.1
ioc_test:SR_ao.DESC uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi
ioc_test:SR_ao.OUT abc:rec PP NMS
ioc_test:SR_longout 743
ioc_test:SR_bi.SVAL 5
ioc_test:SR_char_array 12 117 122 102 102 101 0 0 0 0 0 0 0
ioc_test:SR_double_array 12 6 67 80 622 743 0 0 0 0 0 0 0
ioc_test:SR_float_array 12 27 6 67 80 622 5 0 0 0 0 0 0
ioc_test:SR_long_array 12 27 6 67 80 622 743 0 0 0 0 0 0
ioc_test:SR_short_array 12 27 6 67 80 622 743 0 0 0 0 0 0
ioc_test:SR_string_array 12 uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi abc def ghi
ioc_test:SR_uchar_array 12 27 6 67 80 0 0 0 0 0 0 0 0
ioc_test:SR_ulong_array 12 27 6 67 80 622 743 0 0 0 0 0 0
ioc_test:SR_ushort_array 12 27 6 67 80 622 743 0 0 0 0 0 0
```
* Check the autosave folders
```
e3-autosave (master)$ tree ioc_test/
ioc_test/
├── [jhlee 4.0K] req
│ ├── [jhlee 123] settings.req
│ ├── [jhlee 39] values_pass0.req
│ └── [jhlee 277] values_pass1.req
└── [jhlee 4.0K] save
├── [jhlee 266] settings.sav
├── [jhlee 211] settings.sav0
├── [jhlee 266] settings.sav1
├── [jhlee 266] settings.sav2
├── [jhlee 266] settings.savB
├── [jhlee 125] values_pass0.sav
├── [jhlee 121] values_pass0.sav0
├── [jhlee 125] values_pass0.sav1
├── [jhlee 125] values_pass0.sav2
├── [jhlee 125] values_pass0.savB
├── [jhlee 767] values_pass1.sav
├── [jhlee 369] values_pass1.sav0
├── [jhlee 371] values_pass1.sav1
├── [jhlee 767] values_pass1.sav2
└── [jhlee 767] values_pass1.savB
e3-autosave (master)$ more ioc_test/req/*
::::::::::::::
ioc_test/req/settings.req
::::::::::::::
ioc_test:SR_ao.PREC
ioc_test:SR_ao.SCAN
ioc_test:SR_ao.DESC
ioc_test:SR_ao.OUT
ioc_test:SR_aoDISP.DISP
ioc_test:SR_bo.IVOV
::::::::::::::
ioc_test/req/values_pass0.req
::::::::::::::
ioc_test:SR_ao.VAL
ioc_test:SR_bi.SVAL
::::::::::::::
ioc_test/req/values_pass1.req
::::::::::::::
ioc_test:SR_longout.VAL
ioc_test:SR_char_array.VAL
ioc_test:SR_double_array.VAL
ioc_test:SR_float_array.VAL
ioc_test:SR_long_array.VAL
ioc_test:SR_short_array.VAL
ioc_test:SR_string_array.VAL
ioc_test:SR_uchar_array.VAL
ioc_test:SR_ulong_array.VAL
ioc_test:SR_ushort_array.VAL
e3-autosave (master)$ more ioc_test/save/settings.sav*
::::::::::::::
ioc_test/save/settings.sav
::::::::::::::
# autosave R5.3 Automatically generated - DO NOT MODIFY - 191010-162704
ioc_test:SR_ao.PREC 6
ioc_test:SR_ao.SCAN 9
ioc_test:SR_ao.DESC uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi
ioc_test:SR_ao.OUT abc:rec PP NMS
ioc_test:SR_aoDISP.DISP 27
ioc_test:SR_bo.IVOV 67
<END>
::::::::::::::
ioc_test/save/settings.sav0
::::::::::::::
# autosave R5.3 Automatically generated - DO NOT MODIFY - 191010-162704
ioc_test:SR_ao.PREC 6
ioc_test:SR_ao.SCAN 9
ioc_test:SR_ao.DESC uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi
ioc_test:SR_ao.OUT abc:rec PP NMS
ioc_test:SR_aoDISP.DISP 27
ioc_test:SR_bo.IVOV 67
<END>
::::::::::::::
ioc_test/save/settings.sav1
::::::::::::::
# autosave R5.3 Automatically generated - DO NOT MODIFY - 191010-162704
ioc_test:SR_ao.PREC 6
ioc_test:SR_ao.SCAN 9
ioc_test:SR_ao.DESC uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi
ioc_test:SR_ao.OUT abc:rec PP NMS
ioc_test:SR_aoDISP.DISP 27
ioc_test:SR_bo.IVOV 67
<END>
::::::::::::::
ioc_test/save/settings.sav2
::::::::::::::
# autosave R5.3 Automatically generated - DO NOT MODIFY - 191010-162704
ioc_test:SR_ao.PREC 6
ioc_test:SR_ao.SCAN 9
ioc_test:SR_ao.DESC uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi
ioc_test:SR_ao.OUT abc:rec PP NMS
ioc_test:SR_aoDISP.DISP 27
ioc_test:SR_bo.IVOV 67
<END>
::::::::::::::
ioc_test/save/settings.savB
::::::::::::::
# autosave R5.3 Automatically generated - DO NOT MODIFY - 191010-162704
ioc_test:SR_ao.PREC 6
ioc_test:SR_ao.SCAN 9
ioc_test:SR_ao.DESC uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi
ioc_test:SR_ao.OUT abc:rec PP NMS
ioc_test:SR_aoDISP.DISP 27
ioc_test:SR_bo.IVOV 67
<END>
```
* Exit and restart an IOC
```
efe358d.proton.20315 > exit
e3-autosave (master)$ iocsh.bash cmds/as_test.cmd
```
* Check autosave values
```
e3-autosave (master)$ bash tools/SR_get.bash > 3
jhlee@proton: e3-autosave (master)$ cat 3
ioc_test:SR_aoDISP.DISP 27
ioc_test:SR_ao.PREC 6
ioc_test:SR_bo.IVOV 67
ioc_test:SR_ao.SCAN .1 second
ioc_test:SR_ao.VAL 622.1
ioc_test:SR_ao.DESC uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi
ioc_test:SR_ao.OUT abc:rec PP NMS
ioc_test:SR_longout 743
ioc_test:SR_bi.SVAL 5
ioc_test:SR_char_array 12 117 122 102 102 101 0 0 0 0 0 0 0
ioc_test:SR_double_array 12 6 67 80 622 743 0 0 0 0 0 0 0
ioc_test:SR_float_array 12 27 6 67 80 622 5 0 0 0 0 0 0
ioc_test:SR_long_array 12 27 6 67 80 622 743 0 0 0 0 0 0
ioc_test:SR_short_array 12 27 6 67 80 622 743 0 0 0 0 0 0
ioc_test:SR_string_array 12 uuanjwiemsfnjjyzwjlaunhlxonfgyirdackcqi abc def ghi
ioc_test:SR_uchar_array 12 27 6 67 80 0 0 0 0 0 0 0 0
ioc_test:SR_ulong_array 12 27 6 67 80 622 743 0 0 0 0 0 0
ioc_test:SR_ushort_array 12 27 6 67 80 622 743 0 0 0 0 0 0
e3-autosave (master)$ diff 2 3
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment