commit 46325d0ddf1fc341c608dcd4578bd46d620f0ed2 Author: vagrant Date: Wed Mar 16 21:34:15 2022 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5e3e9d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +O.* +/bin +/db +/dbd \ No newline at end of file diff --git a/ADHama.Makefile b/ADHama.Makefile new file mode 100644 index 0000000..d367d6b --- /dev/null +++ b/ADHama.Makefile @@ -0,0 +1,138 @@ +# +# Copyright (c) 2019 - 2022, European Spallation Source ERIC +# +# The program is free software: you can redistribute it and/or modify it +# under the terms of the BSD 3-Clause license. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# Author : Tomasz Brys +# email : tomasz.brys@ess.eu +# Date : 2022-03-16 +# version : 0.0.0 +# +# This template file is based on one generated by e3TemplateGenerator.bash. +# Please look at many other module_name.Makefile in the https://gitlab.esss.lu.se/epics-modules/ +# repositories. +# + +## The following lines are mandatory, please don't change them. +where_am_I := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(E3_REQUIRE_TOOLS)/driver.makefile + + +############################################################################ +# +# Add any required modules here that come from startup scripts, etc. +# +############################################################################ + +# REQUIRED += stream + + +############################################################################ +# +# If you want to exclude any architectures: +# +############################################################################ + +# EXCLUDE_ARCHS += linux-ppc64e6500 + + +############################################################################ +# +# Relevant directories to point to files +# +############################################################################ + +APP:=ADHamaApp +#APPDB:=$(APP)/Db +APPSRC:=$(APP)/src +#APPCMDS:=$(APP)/cmds + + +############################################################################ +# +# Add any files that should be copied to $(module)/Db +# +############################################################################ + +# TEMPLATES += $(wildcard $(APPDB)/*.db) +# TEMPLATES += $(wildcard $(APPDB)/*.proto) +# TEMPLATES += $(wildcard $(APPDB)/*.template) + +# USR_INCLUDES += -I$(where_am_I)$(APPSRC) + + +############################################################################ +# +# Add any files that need to be compiled (e.g. .c, .cpp, .st, .stt) +# +############################################################################ + +SOURCES += $(APPSRC)/ADHamaMain.cpp + + +############################################################################ +# +# Add any .dbd files that should be included (e.g. from user-defined functions, etc.) +# +############################################################################ + +#DBDS += + + +############################################################################ +# +# Add any header files that should be included in the install (e.g. +# StreamDevice or asyn header files that are used by other modules) +# +############################################################################ + +#HEADERS += + + +############################################################################ +# +# Add any startup scripts that should be installed in the base directory +# +############################################################################ + +SCRIPTS += $(wildcard iocsh/*.iocsh) + + +############################################################################ +# +# If you have any .substitution files, and template files, add them here. +# +############################################################################ + +# SUBS=$(wildcard $(APPDB)/*.substitutions) +# TMPS=$(wildcard $(APPDB)/*.template) + +USR_DBFLAGS += -I . -I .. +USR_DBFLAGS += -I $(EPICS_BASE)/db +USR_DBFLAGS += -I $(APPDB) + +db: $(SUBS) $(TMPS) + +$(SUBS): + @printf "Inflating database ... %44s >>> %40s \n" "$@" "$(basename $(@)).db" + @rm -f $(basename $(@)).db.d $(basename $(@)).db + @$(MSI) -D $(USR_DBFLAGS) -o $(basename $(@)).db -S $@ > $(basename $(@)).db.d + @$(MSI) $(USR_DBFLAGS) -o $(basename $(@)).db -S $@ + +$(TMPS): + @printf "Inflating database ... %44s >>> %40s \n" "$@" "$(basename $(@)).db" + @rm -f $(basename $(@)).db.d $(basename $(@)).db + @$(MSI) -D $(USR_DBFLAGS) -o $(basename $(@)).db $@ > $(basename $(@)).db.d + @$(MSI) $(USR_DBFLAGS) -o $(basename $(@)).db $@ + +.PHONY: db $(SUBS) $(TMPS) + + +vlibs: + +.PHONY: vlibs diff --git a/ADHamaApp/src/ADHamaMain.cpp b/ADHamaApp/src/ADHamaMain.cpp new file mode 100644 index 0000000..bdf0d07 --- /dev/null +++ b/ADHamaApp/src/ADHamaMain.cpp @@ -0,0 +1,24 @@ +/* ADHamaMain.cpp */ +/* Author: Tomasz Brys */ +/* Date: 2022-03-16 */ + +#include +#include +#include +#include +#include + +#include "epicsExit.h" +#include "epicsThread.h" +#include "iocsh.h" + +int main(int argc,char *argv[]) +{ + if(argc>=2) { + iocsh(argv[1]); + epicsThreadSleep(.2); + } + iocsh(NULL); + epicsExit(0); + return(0); +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0dd686f --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2022, European Spallation Source ERIC +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..dafc7a3 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ + +ADHama +====== +European Spallation Source ERIC Site-specific EPICS module : ADHama + +Additonal information: + +* [Documentation](https://confluence.esss.lu.se/display/IS/Integration+by+ICS) +* [Release notes](RELEASE.md) +* [Requirements](https://gitlab.esss.lu.se/e3-recipes/ADHama-recipe/-/blob/master/recipe/meta.yaml#L18) +* [Building and Testing](https://confluence.esss.lu.se/display/IS/1.+Development+locally+with+e3+and+Conda#id-1.Developmentlocallywithe3andConda-BuildanEPICSmoduleandtestitlocally) \ No newline at end of file diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..4e93806 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,2 @@ +Release Notes +============= \ No newline at end of file diff --git a/cmds/st.cmd b/cmds/st.cmd new file mode 100644 index 0000000..3f2dfff --- /dev/null +++ b/cmds/st.cmd @@ -0,0 +1,4 @@ +# This should be a test startup script +require ADHama + +iocshLoad("$(ADHama_DIR)/ADHama.iocsh") diff --git a/iocsh/ADHama.iocsh b/iocsh/ADHama.iocsh new file mode 100644 index 0000000..1d5100b --- /dev/null +++ b/iocsh/ADHama.iocsh @@ -0,0 +1,3 @@ +# This should be the included snippet to configure and run the deployed IOC. It should be loaded with +# +# iocshLoad("$(ADHama_DIR)/ADHama.iocsh")