diff --git a/src/c++/Makefile b/src/c++/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..fba606a408bd54617cc8c7eb09fc39fa1c95d3eb --- /dev/null +++ b/src/c++/Makefile @@ -0,0 +1,17 @@ +#Makefile at top of application tree +TOP = . + +include $(TOP)/configure/CONFIG + +DIRS := dmIntApp iocBoot + +iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS)) + +include $(TOP)/configure/RULES_TOP + +deploy: + +tidy: distclean + rm -rf $(TOP)/configure/RELEASE.support + + diff --git a/src/c++/configure/.svnignore b/src/c++/configure/.svnignore new file mode 100644 index 0000000000000000000000000000000000000000..e99473fc97b66eccbc1b64a0346e66ecec19e122 --- /dev/null +++ b/src/c++/configure/.svnignore @@ -0,0 +1,3 @@ +O.* +*.local +*.support diff --git a/src/c++/configure/CONFIG b/src/c++/configure/CONFIG new file mode 100644 index 0000000000000000000000000000000000000000..c1a470322c5c4689bfa82b26e602fefe27aca397 --- /dev/null +++ b/src/c++/configure/CONFIG @@ -0,0 +1,29 @@ +# CONFIG - Load build configuration data +# +# Do not make changes to this file! + +# Allow user to override where the build rules come from +RULES = $(EPICS_BASE) + +# RELEASE files point to other application tops +include $(TOP)/configure/RELEASE +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common +ifdef T_A +-include $(TOP)/configure/RELEASE.Common.$(T_A) +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) +endif + +CONFIG = $(RULES)/configure +include $(CONFIG)/CONFIG + +# Override the Base definition: +INSTALL_LOCATION = $(TOP) + +# CONFIG_SITE files contain other build configuration settings +include $(TOP)/configure/CONFIG_SITE +-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common +ifdef T_A + -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A) + -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) +endif + diff --git a/src/c++/configure/CONFIG_SITE b/src/c++/configure/CONFIG_SITE new file mode 100644 index 0000000000000000000000000000000000000000..d0bf5870a353ed6664994b5d3236baa75d404fa3 --- /dev/null +++ b/src/c++/configure/CONFIG_SITE @@ -0,0 +1,33 @@ +# CONFIG_SITE + +# Make any application-specific changes to the EPICS build +# configuration variables in this file. +# +# Host/target specific settings can be specified in files named +# CONFIG_SITE.$(EPICS_HOST_ARCH).Common +# CONFIG_SITE.Common.$(T_A) +# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) + +# CHECK_RELEASE controls the consistency checking of the support +# applications pointed to by the RELEASE* files. +# Normally CHECK_RELEASE should be set to YES. +# Set CHECK_RELEASE to NO to disable checking completely. +# Set CHECK_RELEASE to WARN to perform consistency checking but +# continue building anyway if conflicts are found. +CHECK_RELEASE = WARN + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-ppc604 + +# To install files into a location other than $(TOP) define +# INSTALL_LOCATION here. +#INSTALL_LOCATION=</path/name/to/install/top> + +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = </IOC/path/to/application/top> diff --git a/src/c++/configure/Makefile b/src/c++/configure/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..4650559f23e04d77a0eb811660fb30c127c0f210 --- /dev/null +++ b/src/c++/configure/Makefile @@ -0,0 +1,11 @@ +TOP=.. + +include $(TOP)/configure/CONFIG + +TARGETS = $(CONFIG_TARGETS) +CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) + +include $(TOP)/configure/RULES + +tidy: distclean + rm -f RELEASE.support diff --git a/src/c++/configure/RELEASE b/src/c++/configure/RELEASE new file mode 100644 index 0000000000000000000000000000000000000000..8e52a43663a866879c0c01d9b31b6b629b60148c --- /dev/null +++ b/src/c++/configure/RELEASE @@ -0,0 +1,51 @@ +# RELEASE - Location of external support modules +# +# IF YOU MAKE ANY CHANGES to this file you must subsequently +# do a "gnumake rebuild" in this application's top level +# directory. +# +# The build process does not check dependencies against files +# that are outside this application, thus you should do a +# "gnumake rebuild" in the top level directory after EPICS_BASE +# or any other external module pointed to below is rebuilt. +# +# Host- or target-specific settings can be given in files named +# RELEASE.$(EPICS_HOST_ARCH).Common +# RELEASE.Common.$(T_A) +# RELEASE.$(EPICS_HOST_ARCH).$(T_A) +# +# This file should ONLY define paths to other support modules, +# or include statements that pull in similar RELEASE files. +# Build settings that are NOT module paths should appear in a +# CONFIG_SITE file. + +# Write RELEASE.support file before including it +DM_ROOT_DIR=$(TOP)/.. +DM_SUPPORT_DIR_PRODUCTION=/ +DM_SUPPORT_DIR_DEFAULT=$(DM_ROOT_DIR)/../support +RELEASE_SUPPORT=$(TOP)/configure/RELEASE.support +$(shell if [ ! -z $$DM_SUPPORT_DIR ]; then echo DM_SUPPORT_DIR=$$DM_SUPPORT_DIR > $(RELEASE_SUPPORT); elif [ -d $(DM_SUPPORT_DIR_DEFAULT) ]; then echo DM_SUPPORT_DIR=`realpath $(DM_SUPPORT_DIR_DEFAULT)` > $(RELEASE_SUPPORT) ; else echo DM_SUPPORT_DIR=$(DM_SUPPORT_DIR_PRODUCTION) > $(RELEASE_SUPPORT); fi) + +include $(TOP)/configure/RELEASE.support +-include $(TOP)/configure/RELEASE.local + +DM_OPT_DIR=$(DM_SUPPORT_DIR)/opt +EPICS_DIR=$(DM_OPT_DIR)/epics +EPICS_MODULES_DIR=$(EPICS_DIR)/modules +EPICS4_DIR=$(EPICS_MODULES_DIR)/epics4-cpp-4-6-0 +EPICS_EXTENSIONS_DIR=$(DM_SUPPORT_DIR)/epics/extensions + +PVDATA?=$(EPICS4_DIR)/pvDataCPP +PVCOMMON?=$(EPICS4_DIR)/pvCommonCPP +PVACCESS?=$(EPICS4_DIR)/pvAccessCPP +NORMATIVETYPES?=$(EPICS4_DIR)/normativeTypesCPP +PVDATABASE?=$(EPICS4_DIR)/pvDatabaseCPP + +#################### + +# EPICS_BASE usually appears last so other apps can override stuff: +EPICS_BASE?=$(EPICS_DIR)/base + +# Set RULES here if you want to take build rules from somewhere +# other than EPICS_BASE: +#RULES=/path/to/epics/support/module/rules/x-y diff --git a/src/c++/configure/RELEASE.Common.linux-x86_64 b/src/c++/configure/RELEASE.Common.linux-x86_64 new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/src/c++/configure/RELEASE.Common.linux-x86_64 @@ -0,0 +1 @@ + diff --git a/src/c++/configure/RULES b/src/c++/configure/RULES new file mode 100644 index 0000000000000000000000000000000000000000..6d56e14e8b53dc7fd6d9c57e426b4c14f8345591 --- /dev/null +++ b/src/c++/configure/RULES @@ -0,0 +1,6 @@ +# RULES + +include $(CONFIG)/RULES + +# Library should be rebuilt because LIBOBJS may have changed. +$(LIBNAME): ../Makefile diff --git a/src/c++/configure/RULES.ioc b/src/c++/configure/RULES.ioc new file mode 100644 index 0000000000000000000000000000000000000000..901987c6cacb1d91a364439314476c259291a34e --- /dev/null +++ b/src/c++/configure/RULES.ioc @@ -0,0 +1,2 @@ +#RULES.ioc +include $(CONFIG)/RULES.ioc diff --git a/src/c++/configure/RULES_DIRS b/src/c++/configure/RULES_DIRS new file mode 100644 index 0000000000000000000000000000000000000000..3ba269dccfd9b18085c35992719103c50e091dce --- /dev/null +++ b/src/c++/configure/RULES_DIRS @@ -0,0 +1,2 @@ +#RULES_DIRS +include $(CONFIG)/RULES_DIRS diff --git a/src/c++/configure/RULES_TOP b/src/c++/configure/RULES_TOP new file mode 100644 index 0000000000000000000000000000000000000000..d09d668d537526fb41c1e08b1ecb53c1260c60b3 --- /dev/null +++ b/src/c++/configure/RULES_TOP @@ -0,0 +1,3 @@ +#RULES_TOP +include $(CONFIG)/RULES_TOP + diff --git a/src/c++/dmIntApp/Makefile b/src/c++/dmIntApp/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..8420752fd0af079c5120f5c6639ae29dfcdb3832 --- /dev/null +++ b/src/c++/dmIntApp/Makefile @@ -0,0 +1,5 @@ +TOP = .. +include $(TOP)/configure/CONFIG +DIRS := db src +include $(TOP)/configure/RULES_DIRS + diff --git a/src/c++/dmIntApp/src/DmInt.dbd b/src/c++/dmIntApp/src/DmInt.dbd new file mode 100644 index 0000000000000000000000000000000000000000..4cb042bd8dde5a87ae5ba557e0c1e5bd99c40d8c --- /dev/null +++ b/src/c++/dmIntApp/src/DmInt.dbd @@ -0,0 +1,3 @@ +include "base.dbd" +#include "asyn.dbd" +#registrar("DmIntRegister") diff --git a/src/c++/dmIntApp/src/DmIntMain.cpp b/src/c++/dmIntApp/src/DmIntMain.cpp new file mode 100644 index 0000000000000000000000000000000000000000..16ccb1716e95f69bdf98bb238414b8dfe67e6346 --- /dev/null +++ b/src/c++/dmIntApp/src/DmIntMain.cpp @@ -0,0 +1,22 @@ +// DM Integration IOC + +#include <stddef.h> +#include <stdlib.h> +#include <stddef.h> +#include <string.h> +#include <stdio.h> + +#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/src/c++/dmIntApp/src/Makefile b/src/c++/dmIntApp/src/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..3a62dc4dbd367dff7bf9d02b778756fd4d90dd76 --- /dev/null +++ b/src/c++/dmIntApp/src/Makefile @@ -0,0 +1,28 @@ +TOP=../.. + +include $(TOP)/configure/CONFIG +#---------------------------------------- +# ADD MACRO DEFINITIONS AFTER THIS LINE + +#============================= +# Build the IOC application + +PROD_IOC_linux-x86_64 = dmIntIoc +PROD_IOC += $(PROD_IOC_$(T_A)) + +# DmInt.dbd will be created and installed +DBD += dmInt.dbd +dmInt_DBD += DmInt.dbd + +# DmInt_registerRecordDeviceDriver.cpp derives from dmInt.dbd +dmIntIoc_SRCS += DmIntMain.cpp dmInt_registerRecordDeviceDriver.cpp + +# Link to the EPICS Base libraries +dmIntIoc_LIBS += $(EPICS_BASE_IOC_LIBS) + +#============================= + +include $(TOP)/configure/RULES +#---------------------------------------- +# ADD RULES AFTER THIS LINE + diff --git a/src/c++/iocBoot/Makefile b/src/c++/iocBoot/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..91e47d0b536225d200b4c23255ae586d51e85468 --- /dev/null +++ b/src/c++/iocBoot/Makefile @@ -0,0 +1,6 @@ +TOP = .. +include $(TOP)/configure/CONFIG +DIRS += $(wildcard *ioc*) +DIRS += $(wildcard as*) +include $(CONFIG)/RULES_DIRS + diff --git a/src/c++/iocBoot/iocDmInt/.svnignore b/src/c++/iocBoot/iocDmInt/.svnignore new file mode 100644 index 0000000000000000000000000000000000000000..a3818ccc6d3d079c7b5aca12f6bf7a23ebb8567a --- /dev/null +++ b/src/c++/iocBoot/iocDmInt/.svnignore @@ -0,0 +1,5 @@ +O.* +.svnignore +cdCommands.debug +cdCommands +envPaths diff --git a/src/c++/iocBoot/iocDmInt/Makefile b/src/c++/iocBoot/iocDmInt/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..258a6d8234d4adae64411d0292d0d6ad4e0f6e7a --- /dev/null +++ b/src/c++/iocBoot/iocDmInt/Makefile @@ -0,0 +1,5 @@ +TOP = ../.. +include $(TOP)/configure/CONFIG +TARGETS = envPaths +ARCH = linux-x86_64 +include $(TOP)/configure/RULES.ioc diff --git a/src/c++/iocBoot/iocDmInt/st.cmd b/src/c++/iocBoot/iocDmInt/st.cmd new file mode 100755 index 0000000000000000000000000000000000000000..8a33c4df82cfa87358f093af0602c4d1c686f3c1 --- /dev/null +++ b/src/c++/iocBoot/iocDmInt/st.cmd @@ -0,0 +1,21 @@ +#!../../bin/linux-x86_64/dmIntIoc + +# The following syntax used in dbLoadRecords assigns an empty string to PF if none is provided +#P=${PF=} + +< envPaths + +##cd ${TOP} +cd ( "../..") + +## Register all support components +dbLoadDatabase "dbd/dmInt.dbd" +dmInt_registerRecordDeviceDriver(pdbbase) + +## Load record instances +dbLoadRecords("db/Workflow.db", "P=DM:1ID:, R=WORKFLOW:") + +cd ${TOP}/iocBoot/${IOC} + +iocInit + diff --git a/src/c++/iocBoot/iocDmInt/startIocWithScreen.sh b/src/c++/iocBoot/iocDmInt/startIocWithScreen.sh new file mode 100755 index 0000000000000000000000000000000000000000..42fa9bf945659594d976d495aa8e44e7f9b2329a --- /dev/null +++ b/src/c++/iocBoot/iocDmInt/startIocWithScreen.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# to reattach .... 'screen -r' +# to detach ... 'CTL^A d + +# Allow this IOC to look at .2 PVs for acquisition conditions +export EPICS_CA_ADDR_LIST="pvgatemain1.aps4.anl.gov" + +gnome-terminal -e "screen -xR DaqMonIoc ./st.cmd" &