From c63cffb52c760fd72ba2ceefc18836c9902acf1f Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 14 Sep 2022 11:38:51 +0100 Subject: [PATCH 01/14] Creating template file structure in support submodule --- .gitignore | 20 +++++++++ LICENCE | 30 ++++++++++++++ Makefile | 37 +++++++++++++++++ configure/CONFIG | 29 ++++++++++++++ configure/CONFIG_SITE | 43 ++++++++++++++++++++ configure/Makefile | 8 ++++ configure/RELEASE | 5 +++ configure/RULES | 6 +++ configure/RULES_DIRS | 2 + configure/RULES_TOP | 3 ++ documentation/devtjmpap.html | 78 ++++++++++++++++++++++++++++++++++++ tjmpapSup/Makefile | 10 +++++ tjmpapSup/tjmpap.db | 19 +++++++++ tjmpapSup/tjmpap.proto | 18 +++++++++ 14 files changed, 308 insertions(+) create mode 100644 .gitignore create mode 100644 LICENCE create mode 100644 Makefile create mode 100644 configure/CONFIG create mode 100644 configure/CONFIG_SITE create mode 100644 configure/Makefile create mode 100644 configure/RELEASE create mode 100644 configure/RULES create mode 100644 configure/RULES_DIRS create mode 100644 configure/RULES_TOP create mode 100644 documentation/devtjmpap.html create mode 100644 tjmpapSup/Makefile create mode 100644 tjmpapSup/tjmpap.db create mode 100644 tjmpapSup/tjmpap.proto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fcdf55f --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +O.*/ +/db +/bin +/dbd +/include +/lib +/templates +envPaths +cdCommands +dllPath.bat +runIOC.bat +runIOC.sh +relPaths.sh +*.tag +/data/ +/doc/ +*_info_positions.req +*_info_settings.req +*.py[cod] +__pycache__/ diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..03742f5 --- /dev/null +++ b/LICENCE @@ -0,0 +1,30 @@ +BSD 3-Clause License + +Copyright (c) 2022, Science and Technology Facilities Council +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/Makefile b/Makefile new file mode 100644 index 0000000..22ffa66 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +# Makefile for Asyn tjmpap support +# +# Created by eii24694 on Wed Sep 14 11:38:48 2022 +# Based on the Asyn streamSCPI template + +TOP = . +include $(TOP)/configure/CONFIG + +DIRS += configure +DIRS += $(wildcard *Sup) +DIRS += $(wildcard *App) +DIRS += $(wildcard *Top) +DIRS += $(wildcard iocBoot) + +# The build order is controlled by these dependency rules: + +# All dirs except configure depend on configure +$(foreach dir, $(filter-out configure, $(DIRS)), \ + $(eval $(dir)_DEPEND_DIRS += configure)) + +# Any *App dirs depend on all *Sup dirs +$(foreach dir, $(filter %App, $(DIRS)), \ + $(eval $(dir)_DEPEND_DIRS += $(filter %Sup, $(DIRS)))) + +# Any *Top dirs depend on all *Sup and *App dirs +$(foreach dir, $(filter %Top, $(DIRS)), \ + $(eval $(dir)_DEPEND_DIRS += $(filter %Sup %App, $(DIRS)))) + +# iocBoot depends on all *App dirs +iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS)) + +# Add any additional dependency rules here: + +include $(TOP)/configure/RULES_TOP + +ioctests: + .\system_tests\run_tests.bat diff --git a/configure/CONFIG b/configure/CONFIG new file mode 100644 index 0000000..c1a4703 --- /dev/null +++ b/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/configure/CONFIG_SITE b/configure/CONFIG_SITE new file mode 100644 index 0000000..212485e --- /dev/null +++ b/configure/CONFIG_SITE @@ -0,0 +1,43 @@ +# 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 even if conflicts are found. +CHECK_RELEASE = YES + +# 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-ppc32 + +# To install files into a location other than $(TOP) define +# INSTALL_LOCATION here. +#INSTALL_LOCATION= + +# Set this when the IOC and build host use different paths +# to the install location. This may be needed to boot from +# a Microsoft FTP server say, or on some NFS configurations. +#IOCS_APPL_TOP = + +# For application debugging purposes, override the HOST_OPT and/ +# or CROSS_OPT settings from base/configure/CONFIG_SITE +#HOST_OPT = NO +#CROSS_OPT = NO + +# These allow developers to override the CONFIG_SITE variable +# settings without having to modify the configure/CONFIG_SITE +# file itself. +-include $(TOP)/../CONFIG_SITE.local +-include $(TOP)/configure/CONFIG_SITE.local + diff --git a/configure/Makefile b/configure/Makefile new file mode 100644 index 0000000..9254309 --- /dev/null +++ b/configure/Makefile @@ -0,0 +1,8 @@ +TOP=.. + +include $(TOP)/configure/CONFIG + +TARGETS = $(CONFIG_TARGETS) +CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) + +include $(TOP)/configure/RULES diff --git a/configure/RELEASE b/configure/RELEASE new file mode 100644 index 0000000..7fc8365 --- /dev/null +++ b/configure/RELEASE @@ -0,0 +1,5 @@ +# optional extra local definitions here +-include $(TOP)/configure/RELEASE.private + +include $(TOP)/../../../ISIS_CONFIG +-include $(TOP)/../../../ISIS_CONFIG.$(EPICS_HOST_ARCH) diff --git a/configure/RULES b/configure/RULES new file mode 100644 index 0000000..6d56e14 --- /dev/null +++ b/configure/RULES @@ -0,0 +1,6 @@ +# RULES + +include $(CONFIG)/RULES + +# Library should be rebuilt because LIBOBJS may have changed. +$(LIBNAME): ../Makefile diff --git a/configure/RULES_DIRS b/configure/RULES_DIRS new file mode 100644 index 0000000..3ba269d --- /dev/null +++ b/configure/RULES_DIRS @@ -0,0 +1,2 @@ +#RULES_DIRS +include $(CONFIG)/RULES_DIRS diff --git a/configure/RULES_TOP b/configure/RULES_TOP new file mode 100644 index 0000000..d09d668 --- /dev/null +++ b/configure/RULES_TOP @@ -0,0 +1,3 @@ +#RULES_TOP +include $(CONFIG)/RULES_TOP + diff --git a/documentation/devtjmpap.html b/documentation/devtjmpap.html new file mode 100644 index 0000000..8f22850 --- /dev/null +++ b/documentation/devtjmpap.html @@ -0,0 +1,78 @@ + + + + + + tjmpap Instrument Support + + + + +

Using tjmpap instrument support in an application

+ +

Several files need minor modifications to use tjmpap instrument support in +an application.

+
    +
  1. Add the full path to the tjmpap support directory to the + application configure/RELEASE file:
    + tjmpap=xxxx/modules/instrument/tjmpap/<release>
    +Where <release> is the release number of of the tjmpap support.
  2. +
  3. Add stream and asyn support to application database definition file
    + The application database definition file must include the database + definition files for the stream package and for any needed ASYN + drivers. There are two ways that this can be done: +
      +
    • If you are building your application database definition file from + an xxxInclude.dbd file you include the additional database + definitions in that file:
      + include "base.dbd"
      + include "stream.dbd"
      + include "drvAsynIPPort.dbd"
    • +
    • If you are building your application database definition file from + the application Makefile you specify the aditional database + definitions there:
      + xxx_DBD += base.dbd
      + xxx_DBD += stream.dbd
      + xxx_DBD += drvAsynIPPort.dbd
    • +
    +
  4. +
  5. Add the stream and asyn support libraries to the application
    + You must link the stream support library and the ASYN support library + with the application. Add the following lines:
    + xxx_LIBS += stream
    + xxx_LIBS += asyn
    + before the
    + xxx_LIBS += $(EPICS_BASE_IOC_LIBS)
    + in the application Makefile.
  6. +
  7. Load the tjmpap support database records in the application startup script:
    + cd $(tjmpap)      (cd tjmpap if using the vxWorks shell)
    + dbLoadRecords("db/devtjmpap.db,"P=<P>,R=<R>,PORT=<PORT>,A=<A>")
    + You'll have to provide appropriate values for the PV name prefixes + (<P> and <R>), the port name (<PORT>) and the device address + (<A>). The port name must match the value specified in + an ASYN drvxxxxxConfigure command. +
  8. +
+

Installation and Building

+After obtaining a copy of the distribution, it must be installed and built +for use at your site. +
    +
  1. Create an installation directory for the module. The path name + of this directory should end with modules/instrument/tjmpap.
  2. +
  3. Place the distribution file into this directory.
  4. +
  5. Execute the following commands:
    + cd modules/instrument/tjmpap
    + gunzip tjmpap<release>.tar.gz
    + tar xvf tjmpap<release>.tar
    + cd <release>
    +Where <release> is the release number of of the tjmpap support. +
  6. +
  7. Edit the configure/RELEASE file and set the paths to your + installation of EPICS base, stream and ASYN support modules.
  8. +
  9. Execute make in the top level directory.
  10. +
+ + + + diff --git a/tjmpapSup/Makefile b/tjmpapSup/Makefile new file mode 100644 index 0000000..b33521a --- /dev/null +++ b/tjmpapSup/Makefile @@ -0,0 +1,10 @@ +TOP=.. +include $(TOP)/configure/CONFIG +#======================================= + +# Install .dbd and .db files +DB += tjmpap.db +DATA += tjmpap.proto + +#======================================= +include $(TOP)/configure/RULES diff --git a/tjmpapSup/tjmpap.db b/tjmpapSup/tjmpap.db new file mode 100644 index 0000000..4c7f7b3 --- /dev/null +++ b/tjmpapSup/tjmpap.db @@ -0,0 +1,19 @@ +record(bo, "$(P)SIM") +{ + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "NO") + field(ONAM, "YES") + field(VAL, "$(RECSIM=0)") + field(PINI, "YES") +} + +record(bo, "$(P)DISABLE") +{ + field(DESC, "Disable comms") + field(PINI, "YES") + field(VAL, "$(DISABLE=0)") + field(OMSL, "supervisory") + field(ZNAM, "COMMS ENABLED") + field(ONAM, "COMMS DISABLED") +} diff --git a/tjmpapSup/tjmpap.proto b/tjmpapSup/tjmpap.proto new file mode 100644 index 0000000..3326465 --- /dev/null +++ b/tjmpapSup/tjmpap.proto @@ -0,0 +1,18 @@ +getIDN { + out "*IDN?"; + in "%\$1[^\r\n]"; + ExtraInput = Ignore; +} + +cmd { + out "\$1"; +} + +setD { + out "\$1 %d"; +} +getD { + out "\$1?"; + in "%d"; + ExtraInput = Ignore; +} From 4ed760d29805ce2e92191afb525f567ba3c24031 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 14 Sep 2022 11:40:11 +0100 Subject: [PATCH 02/14] Add device to test framework --- system_tests/run_tests.bat | 13 +++++++++++++ system_tests/tests/__init__.py | 0 system_tests/tests/tjmpap.py | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 system_tests/run_tests.bat create mode 100644 system_tests/tests/__init__.py create mode 100644 system_tests/tests/tjmpap.py diff --git a/system_tests/run_tests.bat b/system_tests/run_tests.bat new file mode 100644 index 0000000..56f9c25 --- /dev/null +++ b/system_tests/run_tests.bat @@ -0,0 +1,13 @@ +@echo off +REM Run this directory's tests using the IOC Testing Framework + +SET CurrentDir=%~dp0 + +call "%~dp0..\..\..\..\config_env.bat" + +set "PYTHONUNBUFFERED=1" + +REM Command line arguments always passed to the test script +SET ARGS=--test_and_emulator %~dp0 +call %PYTHON3% "%EPICS_KIT_ROOT%\support\IocTestFramework\master\run_tests.py" %ARGS% %* +IF %ERRORLEVEL% NEQ 0 EXIT /b %errorlevel% diff --git a/system_tests/tests/__init__.py b/system_tests/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/system_tests/tests/tjmpap.py b/system_tests/tests/tjmpap.py new file mode 100644 index 0000000..943455c --- /dev/null +++ b/system_tests/tests/tjmpap.py @@ -0,0 +1,34 @@ +import unittest + +from utils.channel_access import ChannelAccess +from utils.ioc_launcher import get_default_ioc_dir +from utils.test_modes import TestModes +from utils.testing import get_running_lewis_and_ioc, skip_if_recsim + + +DEVICE_PREFIX = "TJMPAP_01" + + +IOCS = [ + { + "name": DEVICE_PREFIX, + "directory": get_default_ioc_dir("TJMPAP"), + "macros": {}, + "emulator": "Tjmpap", + }, +] + + +TEST_MODES = [TestModes.RECSIM, TestModes.DEVSIM] + + +class TjmpapTests(unittest.TestCase): + """ + Tests for the Tjmpap IOC. + """ + def setUp(self): + self._lewis, self._ioc = get_running_lewis_and_ioc("Tjmpap", DEVICE_PREFIX) + self.ca = ChannelAccess(device_prefix=DEVICE_PREFIX) + + def test_that_fails(self): + self.fail("You haven't implemented any tests!") From e1813bb42a834eb9fa4672a2595cef41202ec400 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 14 Sep 2022 11:40:23 +0100 Subject: [PATCH 03/14] Add template emulator --- .../lewis_emulators/Tjmpap/__init__.py | 5 +++ system_tests/lewis_emulators/Tjmpap/device.py | 25 +++++++++++++++ .../Tjmpap/interfaces/__init__.py | 3 ++ .../Tjmpap/interfaces/stream_interface.py | 32 +++++++++++++++++++ system_tests/lewis_emulators/Tjmpap/states.py | 5 +++ system_tests/lewis_emulators/__init__.py | 0 .../lewis_emulators/lewis_versions.py | 2 ++ 7 files changed, 72 insertions(+) create mode 100644 system_tests/lewis_emulators/Tjmpap/__init__.py create mode 100644 system_tests/lewis_emulators/Tjmpap/device.py create mode 100644 system_tests/lewis_emulators/Tjmpap/interfaces/__init__.py create mode 100644 system_tests/lewis_emulators/Tjmpap/interfaces/stream_interface.py create mode 100644 system_tests/lewis_emulators/Tjmpap/states.py create mode 100644 system_tests/lewis_emulators/__init__.py create mode 100644 system_tests/lewis_emulators/lewis_versions.py diff --git a/system_tests/lewis_emulators/Tjmpap/__init__.py b/system_tests/lewis_emulators/Tjmpap/__init__.py new file mode 100644 index 0000000..3769659 --- /dev/null +++ b/system_tests/lewis_emulators/Tjmpap/__init__.py @@ -0,0 +1,5 @@ +from .device import SimulatedTjmpap +from ..lewis_versions import LEWIS_LATEST + +framework_version = LEWIS_LATEST +__all__ = ['SimulatedTjmpap'] diff --git a/system_tests/lewis_emulators/Tjmpap/device.py b/system_tests/lewis_emulators/Tjmpap/device.py new file mode 100644 index 0000000..6090c5f --- /dev/null +++ b/system_tests/lewis_emulators/Tjmpap/device.py @@ -0,0 +1,25 @@ +from collections import OrderedDict +from .states import DefaultState +from lewis.devices import StateMachineDevice + + +class SimulatedTjmpap(StateMachineDevice): + + def _initialize_data(self): + """ + Initialize all of the device's attributes. + """ + pass + + def _get_state_handlers(self): + return { + 'default': DefaultState(), + } + + def _get_initial_state(self): + return 'default' + + def _get_transition_handlers(self): + return OrderedDict([ + ]) + diff --git a/system_tests/lewis_emulators/Tjmpap/interfaces/__init__.py b/system_tests/lewis_emulators/Tjmpap/interfaces/__init__.py new file mode 100644 index 0000000..3026207 --- /dev/null +++ b/system_tests/lewis_emulators/Tjmpap/interfaces/__init__.py @@ -0,0 +1,3 @@ +from .stream_interface import TjmpapStreamInterface + +__all__ = ['TjmpapStreamInterface'] diff --git a/system_tests/lewis_emulators/Tjmpap/interfaces/stream_interface.py b/system_tests/lewis_emulators/Tjmpap/interfaces/stream_interface.py new file mode 100644 index 0000000..eadf045 --- /dev/null +++ b/system_tests/lewis_emulators/Tjmpap/interfaces/stream_interface.py @@ -0,0 +1,32 @@ +from lewis.adapters.stream import StreamInterface, Cmd +from lewis.utils.command_builder import CmdBuilder +from lewis.core.logging import has_log +from lewis.utils.replies import conditional_reply + + +@has_log +class TjmpapStreamInterface(StreamInterface): + + in_terminator = "\r\n" + out_terminator = "\r\n" + + def __init__(self): + super(TjmpapStreamInterface, self).__init__() + # Commands that we expect via serial during normal operation + self.commands = { + CmdBuilder(self.catch_all).arg("^#9.*$").build() # Catch-all command for debugging + } + + def handle_error(self, request, error): + """ + If command is not recognised print and error + + Args: + request: requested string + error: problem + + """ + self.log.error("An error occurred at request " + repr(request) + ": " + repr(error)) + + def catch_all(self, command): + pass diff --git a/system_tests/lewis_emulators/Tjmpap/states.py b/system_tests/lewis_emulators/Tjmpap/states.py new file mode 100644 index 0000000..e4ca48e --- /dev/null +++ b/system_tests/lewis_emulators/Tjmpap/states.py @@ -0,0 +1,5 @@ +from lewis.core.statemachine import State + + +class DefaultState(State): + pass diff --git a/system_tests/lewis_emulators/__init__.py b/system_tests/lewis_emulators/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/system_tests/lewis_emulators/lewis_versions.py b/system_tests/lewis_emulators/lewis_versions.py new file mode 100644 index 0000000..0f6c45a --- /dev/null +++ b/system_tests/lewis_emulators/lewis_versions.py @@ -0,0 +1,2 @@ +LEWIS_1_3_0 = "1.3.0" +LEWIS_LATEST = LEWIS_1_3_0 From 7152a198e2cd7032e1d2e058833563e9e4d68299 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 14 Sep 2022 11:47:23 +0100 Subject: [PATCH 04/14] Updated gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fcdf55f..8d4c57c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ relPaths.sh *_info_settings.req *.py[cod] __pycache__/ +system_tests/test-reports/ From 4c86b5cbd334730ba8c58cfedb6675905a0f1f32 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 14 Sep 2022 13:24:05 +0100 Subject: [PATCH 05/14] Added template files. --- tjmpapSup/{tjmpap.db => tjmpap.template} | 16 +++++++++++ tjmpapSup/tjmpap_limits.template | 7 +++++ tjmpapSup/tjmpap_moving.template | 7 +++++ tjmpapSup/tjmpap_temp.template | 35 ++++++++++++++++++++++++ 4 files changed, 65 insertions(+) rename tjmpapSup/{tjmpap.db => tjmpap.template} (53%) create mode 100644 tjmpapSup/tjmpap_limits.template create mode 100644 tjmpapSup/tjmpap_moving.template create mode 100644 tjmpapSup/tjmpap_temp.template diff --git a/tjmpapSup/tjmpap.db b/tjmpapSup/tjmpap.template similarity index 53% rename from tjmpapSup/tjmpap.db rename to tjmpapSup/tjmpap.template index 4c7f7b3..b97c62c 100644 --- a/tjmpapSup/tjmpap.db +++ b/tjmpapSup/tjmpap.template @@ -17,3 +17,19 @@ record(bo, "$(P)DISABLE") field(ZNAM, "COMMS ENABLED") field(ONAM, "COMMS DISABLED") } + +record(mbbi, "$(P)MODE") +{ + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + info(interest, "HIGH") +} +alias("$(P)MODE", "TJMPER_$(TJUMPER_IOC_ID):MODE") + +record(mbbo, "$(P)MODE:SP") +{ + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + info(interest, "HIGH") +} +alias("$(P)MODE:SP", "TJMPER_$(TJUMPER_IOC_ID):MODE:SP") diff --git a/tjmpapSup/tjmpap_limits.template b/tjmpapSup/tjmpap_limits.template new file mode 100644 index 0000000..bcec03f --- /dev/null +++ b/tjmpapSup/tjmpap_limits.template @@ -0,0 +1,7 @@ +record(bi, "$(P)LMT:$(PART):$(MODE)") +{ + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + info(interest, "HIGH") +} +alias("$(P)LMT:$(PART):$(MODE)", "TJMPER_$(TJUMPER_IOC_ID):LMT:$(PART):$(MODE)") diff --git a/tjmpapSup/tjmpap_moving.template b/tjmpapSup/tjmpap_moving.template new file mode 100644 index 0000000..d95534c --- /dev/null +++ b/tjmpapSup/tjmpap_moving.template @@ -0,0 +1,7 @@ +record(bi, "$(P)$(PART):MOVING") +{ + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + info(interest, "HIGH") +} +alias("$(P)$(PART):MOVING", "TJMPER_$(TJUMPER_IOC_ID):$(PART):MOVING") diff --git a/tjmpapSup/tjmpap_temp.template b/tjmpapSup/tjmpap_temp.template new file mode 100644 index 0000000..23a97ba --- /dev/null +++ b/tjmpapSup/tjmpap_temp.template @@ -0,0 +1,35 @@ +record(cvt, "$(P)$(PLATE):TEMP") +{ + field(DESC, "User value for the $(PLATE) temperature") + field(SCAN, "1 second") + field(DTYP, "stream") + info(interest, "HIGH") + info(archive, "VAL") +} + +record(cvt, "$(P)$(PLATE):TEMP:SP") +{ + field(DESC, "User value for the $(PLATE) temperature setpoint") +} + +record(ai, "$(P)$(PLATE):TEMP:RAW") +{ + field(DESC, "Raw value from the $(PLATE) temperature controller") + field(SCAN, "1 second") + field(DTYP, "stream") + info(archive, "VAL") +} + +record(ao, "$(P)$(PLATE):TEMP:RAW:SP") +{ + field(DESC, "Raw value to send to the $(PLATE) temperature controller") +} + +record(ai, "$(P)SAMPLE:TEMP") +{ + field(DESC, "Value for the sample temperature") + field(SCAN, "1 second") + field(DTYP, "stream") + info(interest, "HIGH") + info(archive, "VAL") +} From 084fa46088669512734abb23484269da5b9991ef Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 14 Sep 2022 16:01:51 +0100 Subject: [PATCH 06/14] Updated a PV name. --- tjmpapSup/tjmpap.template | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tjmpapSup/tjmpap.template b/tjmpapSup/tjmpap.template index b97c62c..2e79308 100644 --- a/tjmpapSup/tjmpap.template +++ b/tjmpapSup/tjmpap.template @@ -18,18 +18,18 @@ record(bo, "$(P)DISABLE") field(ONAM, "COMMS DISABLED") } -record(mbbi, "$(P)MODE") +record(mbbi, "$(P)JMP:MODE") { field(SCAN, "Passive") field(DTYP, "Soft Channel") info(interest, "HIGH") } -alias("$(P)MODE", "TJMPER_$(TJUMPER_IOC_ID):MODE") +alias("$(P)JMP:MODE", "TJMPER_$(TJUMPER_IOC_ID):MODE") -record(mbbo, "$(P)MODE:SP") +record(mbbo, "$(P)JMP:MODE:SP") { field(SCAN, "Passive") field(DTYP, "Soft Channel") info(interest, "HIGH") } -alias("$(P)MODE:SP", "TJMPER_$(TJUMPER_IOC_ID):MODE:SP") +alias("$(P)JMP:MODE:SP", "TJMPER_$(TJUMPER_IOC_ID):MODE:SP") From 078cfc0a87adb47867389ceb183f3e6f63803c39 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 21 Sep 2022 12:16:25 +0100 Subject: [PATCH 07/14] Added calibration files for tests. --- calibrations/1x1.txt | 2 ++ calibrations/1x2.txt | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 calibrations/1x1.txt create mode 100644 calibrations/1x2.txt diff --git a/calibrations/1x1.txt b/calibrations/1x1.txt new file mode 100644 index 0000000..5f9707f --- /dev/null +++ b/calibrations/1x1.txt @@ -0,0 +1,2 @@ +0,0 +100000,100000 \ No newline at end of file diff --git a/calibrations/1x2.txt b/calibrations/1x2.txt new file mode 100644 index 0000000..587641e --- /dev/null +++ b/calibrations/1x2.txt @@ -0,0 +1,2 @@ +1,2 +100000,200000 \ No newline at end of file From e2d080985908a396feded02d167e391e15459de6 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 21 Sep 2022 12:18:43 +0100 Subject: [PATCH 08/14] Removed auto-generated emulator files. --- .../lewis_emulators/Tjmpap/__init__.py | 5 --- system_tests/lewis_emulators/Tjmpap/device.py | 25 ------------- .../Tjmpap/interfaces/__init__.py | 3 -- .../Tjmpap/interfaces/stream_interface.py | 32 ----------------- system_tests/lewis_emulators/Tjmpap/states.py | 5 --- system_tests/lewis_emulators/__init__.py | 0 .../lewis_emulators/lewis_versions.py | 2 -- tjmpapSup/tjmpap_limits.template | 7 ---- tjmpapSup/tjmpap_moving.template | 7 ---- tjmpapSup/tjmpap_temp.template | 35 ------------------- 10 files changed, 121 deletions(-) delete mode 100644 system_tests/lewis_emulators/Tjmpap/__init__.py delete mode 100644 system_tests/lewis_emulators/Tjmpap/device.py delete mode 100644 system_tests/lewis_emulators/Tjmpap/interfaces/__init__.py delete mode 100644 system_tests/lewis_emulators/Tjmpap/interfaces/stream_interface.py delete mode 100644 system_tests/lewis_emulators/Tjmpap/states.py delete mode 100644 system_tests/lewis_emulators/__init__.py delete mode 100644 system_tests/lewis_emulators/lewis_versions.py delete mode 100644 tjmpapSup/tjmpap_limits.template delete mode 100644 tjmpapSup/tjmpap_moving.template delete mode 100644 tjmpapSup/tjmpap_temp.template diff --git a/system_tests/lewis_emulators/Tjmpap/__init__.py b/system_tests/lewis_emulators/Tjmpap/__init__.py deleted file mode 100644 index 3769659..0000000 --- a/system_tests/lewis_emulators/Tjmpap/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .device import SimulatedTjmpap -from ..lewis_versions import LEWIS_LATEST - -framework_version = LEWIS_LATEST -__all__ = ['SimulatedTjmpap'] diff --git a/system_tests/lewis_emulators/Tjmpap/device.py b/system_tests/lewis_emulators/Tjmpap/device.py deleted file mode 100644 index 6090c5f..0000000 --- a/system_tests/lewis_emulators/Tjmpap/device.py +++ /dev/null @@ -1,25 +0,0 @@ -from collections import OrderedDict -from .states import DefaultState -from lewis.devices import StateMachineDevice - - -class SimulatedTjmpap(StateMachineDevice): - - def _initialize_data(self): - """ - Initialize all of the device's attributes. - """ - pass - - def _get_state_handlers(self): - return { - 'default': DefaultState(), - } - - def _get_initial_state(self): - return 'default' - - def _get_transition_handlers(self): - return OrderedDict([ - ]) - diff --git a/system_tests/lewis_emulators/Tjmpap/interfaces/__init__.py b/system_tests/lewis_emulators/Tjmpap/interfaces/__init__.py deleted file mode 100644 index 3026207..0000000 --- a/system_tests/lewis_emulators/Tjmpap/interfaces/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .stream_interface import TjmpapStreamInterface - -__all__ = ['TjmpapStreamInterface'] diff --git a/system_tests/lewis_emulators/Tjmpap/interfaces/stream_interface.py b/system_tests/lewis_emulators/Tjmpap/interfaces/stream_interface.py deleted file mode 100644 index eadf045..0000000 --- a/system_tests/lewis_emulators/Tjmpap/interfaces/stream_interface.py +++ /dev/null @@ -1,32 +0,0 @@ -from lewis.adapters.stream import StreamInterface, Cmd -from lewis.utils.command_builder import CmdBuilder -from lewis.core.logging import has_log -from lewis.utils.replies import conditional_reply - - -@has_log -class TjmpapStreamInterface(StreamInterface): - - in_terminator = "\r\n" - out_terminator = "\r\n" - - def __init__(self): - super(TjmpapStreamInterface, self).__init__() - # Commands that we expect via serial during normal operation - self.commands = { - CmdBuilder(self.catch_all).arg("^#9.*$").build() # Catch-all command for debugging - } - - def handle_error(self, request, error): - """ - If command is not recognised print and error - - Args: - request: requested string - error: problem - - """ - self.log.error("An error occurred at request " + repr(request) + ": " + repr(error)) - - def catch_all(self, command): - pass diff --git a/system_tests/lewis_emulators/Tjmpap/states.py b/system_tests/lewis_emulators/Tjmpap/states.py deleted file mode 100644 index e4ca48e..0000000 --- a/system_tests/lewis_emulators/Tjmpap/states.py +++ /dev/null @@ -1,5 +0,0 @@ -from lewis.core.statemachine import State - - -class DefaultState(State): - pass diff --git a/system_tests/lewis_emulators/__init__.py b/system_tests/lewis_emulators/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/system_tests/lewis_emulators/lewis_versions.py b/system_tests/lewis_emulators/lewis_versions.py deleted file mode 100644 index 0f6c45a..0000000 --- a/system_tests/lewis_emulators/lewis_versions.py +++ /dev/null @@ -1,2 +0,0 @@ -LEWIS_1_3_0 = "1.3.0" -LEWIS_LATEST = LEWIS_1_3_0 diff --git a/tjmpapSup/tjmpap_limits.template b/tjmpapSup/tjmpap_limits.template deleted file mode 100644 index bcec03f..0000000 --- a/tjmpapSup/tjmpap_limits.template +++ /dev/null @@ -1,7 +0,0 @@ -record(bi, "$(P)LMT:$(PART):$(MODE)") -{ - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - info(interest, "HIGH") -} -alias("$(P)LMT:$(PART):$(MODE)", "TJMPER_$(TJUMPER_IOC_ID):LMT:$(PART):$(MODE)") diff --git a/tjmpapSup/tjmpap_moving.template b/tjmpapSup/tjmpap_moving.template deleted file mode 100644 index d95534c..0000000 --- a/tjmpapSup/tjmpap_moving.template +++ /dev/null @@ -1,7 +0,0 @@ -record(bi, "$(P)$(PART):MOVING") -{ - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - info(interest, "HIGH") -} -alias("$(P)$(PART):MOVING", "TJMPER_$(TJUMPER_IOC_ID):$(PART):MOVING") diff --git a/tjmpapSup/tjmpap_temp.template b/tjmpapSup/tjmpap_temp.template deleted file mode 100644 index 23a97ba..0000000 --- a/tjmpapSup/tjmpap_temp.template +++ /dev/null @@ -1,35 +0,0 @@ -record(cvt, "$(P)$(PLATE):TEMP") -{ - field(DESC, "User value for the $(PLATE) temperature") - field(SCAN, "1 second") - field(DTYP, "stream") - info(interest, "HIGH") - info(archive, "VAL") -} - -record(cvt, "$(P)$(PLATE):TEMP:SP") -{ - field(DESC, "User value for the $(PLATE) temperature setpoint") -} - -record(ai, "$(P)$(PLATE):TEMP:RAW") -{ - field(DESC, "Raw value from the $(PLATE) temperature controller") - field(SCAN, "1 second") - field(DTYP, "stream") - info(archive, "VAL") -} - -record(ao, "$(P)$(PLATE):TEMP:RAW:SP") -{ - field(DESC, "Raw value to send to the $(PLATE) temperature controller") -} - -record(ai, "$(P)SAMPLE:TEMP") -{ - field(DESC, "Value for the sample temperature") - field(SCAN, "1 second") - field(DTYP, "stream") - info(interest, "HIGH") - info(archive, "VAL") -} From 28a65367339f7943c5aaedf5772634aa4de0efd4 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 21 Sep 2022 12:19:28 +0100 Subject: [PATCH 09/14] Added utilities dependency. --- configure/RELEASE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure/RELEASE b/configure/RELEASE index 7fc8365..8e0f179 100644 --- a/configure/RELEASE +++ b/configure/RELEASE @@ -3,3 +3,5 @@ include $(TOP)/../../../ISIS_CONFIG -include $(TOP)/../../../ISIS_CONFIG.$(EPICS_HOST_ARCH) + +UTILITIES=$(SUPPORT)/utilities/master From 515f94458251df88475eaabafc0b90aaa6de4526 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 21 Sep 2022 12:20:03 +0100 Subject: [PATCH 10/14] Added tests. --- system_tests/tests/tjmpap.py | 143 ++++++++++++++++++++++++++++++++--- 1 file changed, 134 insertions(+), 9 deletions(-) diff --git a/system_tests/tests/tjmpap.py b/system_tests/tests/tjmpap.py index 943455c..a91b5c3 100644 --- a/system_tests/tests/tjmpap.py +++ b/system_tests/tests/tjmpap.py @@ -1,25 +1,90 @@ import unittest +import os + +from parameterized import parameterized from utils.channel_access import ChannelAccess -from utils.ioc_launcher import get_default_ioc_dir +from utils.ioc_launcher import get_default_ioc_dir, IOCRegister, ProcServLauncher, EPICS_TOP from utils.test_modes import TestModes -from utils.testing import get_running_lewis_and_ioc, skip_if_recsim +from utils.testing import get_running_lewis_and_ioc, skip_if_recsim, parameterized_list +EUROTHERM_PREFIX = "EUROTHRM_01" +EUROTHERM_ADDRESS = "A01" +JULABO_PREFIX = "JULABO_01" +TJMPER_PREFIX = "TJMPER_01" DEVICE_PREFIX = "TJMPAP_01" +CALIBRATION_FOLDER = "tjmpap/master/calibrations" +CALIBRATION_BASE_DIR = "C:/Instrument/Apps/EPICS/support" +MACROS = [ + ({ + "CALIBRATION_FILE" : "1x1.txt", + "CALIBRATION_FOLDER" : CALIBRATION_FOLDER, + "CALIBRATION_BASE_DIR" : CALIBRATION_BASE_DIR + }, 1.0), + ({ + "CALIBRATION_FILE" : "1x2.txt", + "CALIBRATION_FOLDER" : CALIBRATION_FOLDER, + "CALIBRATION_BASE_DIR" : CALIBRATION_BASE_DIR + }, 2.0) +] + + IOCS = [ + { + "name": EUROTHERM_PREFIX, + "directory": get_default_ioc_dir("EUROTHRM"), + "ioc_launcher_class": ProcServLauncher, + "macros": { + "ADDR": EUROTHERM_ADDRESS, + "ADDR_1": 1, + "ADDR_2": "", + "ADDR_3": "", + "ADDR_4": "", + "ADDR_5": "", + "ADDR_6": "", + "ADDR_7": "", + "ADDR_8": "", + "ADDR_9": "", + "ADDR_10": "" + }, + "emulator": "eurotherm", + "lewis_additional_path": os.path.join(EPICS_TOP, "support", "DeviceEmulator", "master"), + }, + { + "name": JULABO_PREFIX, + "directory": get_default_ioc_dir("JULABO"), + "macros": {}, + "emulator": "julabo", + "lewis_protocol": "julabo-version-1", + "lewis_additional_path": os.path.join(EPICS_TOP, "support", "DeviceEmulator", "master"), + }, + { + "name": TJMPER_PREFIX, + "directory": get_default_ioc_dir("TJMPER"), + "macros": {}, + "emulator": "Tjmper", + "lewis_additional_path": os.path.join(EPICS_TOP, "support", "tjmper", "master", "system_tests"), + }, { "name": DEVICE_PREFIX, "directory": get_default_ioc_dir("TJMPAP"), - "macros": {}, - "emulator": "Tjmpap", + "ioc_launcher_class": ProcServLauncher, + "macros": MACROS[0][0] }, ] -TEST_MODES = [TestModes.RECSIM, TestModes.DEVSIM] +TEST_MODES = [TestModes.DEVSIM] + + +MODES = [ + ("All out", ["True", "False", "True", "False", "True", "False"]), + ("PLT1 and SMPL engaged", ["False", "True", "True", "False", "False", "True"]), + ("PLT2 and SMPL engaged", ["True", "False", "False", "True", "False", "True"]) +] class TjmpapTests(unittest.TestCase): @@ -27,8 +92,68 @@ class TjmpapTests(unittest.TestCase): Tests for the Tjmpap IOC. """ def setUp(self): - self._lewis, self._ioc = get_running_lewis_and_ioc("Tjmpap", DEVICE_PREFIX) - self.ca = ChannelAccess(device_prefix=DEVICE_PREFIX) + self._ioc = IOCRegister.get_running(DEVICE_PREFIX) + self.assertIsNotNone(self._ioc) + self.ca = ChannelAccess(device_prefix=DEVICE_PREFIX, default_wait_time=0) + + self._lewis_tjmper, self._ioc_tjmper = get_running_lewis_and_ioc("Tjmper", TJMPER_PREFIX) + self.ca_tjmper = ChannelAccess(device_prefix=TJMPER_PREFIX, default_wait_time=0) + self.ca_tjmper.assert_that_pv_exists("ID", timeout=10) + + self._lewis_euro, self._ioc_euro = get_running_lewis_and_ioc("eurotherm", EUROTHERM_PREFIX) + self.ca_euro = ChannelAccess(device_prefix=f"{EUROTHERM_PREFIX}:{EUROTHERM_ADDRESS}") + self.ca_euro.assert_that_pv_exists("CAL:SEL", timeout=10) + self._lewis_euro.backdoor_set_on_device("address", "A01") + + self._lewis_julabo, self._ioc_julabo = get_running_lewis_and_ioc("julabo", JULABO_PREFIX) + self.ca_julabo = ChannelAccess(device_prefix=JULABO_PREFIX) + self.ca_julabo.assert_that_pv_exists("TEMP", timeout=30) + + def test_WHEN_controllers_connected_THEN_controller_names_correct(self): + self.ca.assert_that_pv_is("PLATE1:CONTROLLER", f"{EUROTHERM_PREFIX}:{EUROTHERM_ADDRESS}") + self.ca.assert_that_pv_is("PLATE2:CONTROLLER", JULABO_PREFIX) + self.ca.assert_that_pv_is("SAMPLE:READBACK", f"{EUROTHERM_PREFIX}:{EUROTHERM_ADDRESS}") + + @parameterized.expand(parameterized_list(MACROS)) + def test_WHEN_temperature_set_on_block_1_THEN_temperature_updates_on_controller(self, _, macros, multiplier): + with self._ioc.start_with_macros(macros, "JMP:MODE"): + self.ca.set_pv_value("PLATE1:TEMP:SP", 5.0) + self.ca_euro.assert_that_pv_is("TEMP:SP:RBV", 5.0 / multiplier) + self._lewis_euro.assert_that_emulator_value_is("ramp_setpoint_temperature", str(5.0 / multiplier)) + + self._lewis_euro.backdoor_set_on_device("current_temperature", 6.0) + self.ca.assert_that_pv_is_number("PLATE1:TEMP", 6.0 * multiplier, tolerance=0.01) + + @parameterized.expand(parameterized_list(MACROS)) + def test_WHEN_temperature_set_on_block_2_THEN_temperature_updates_on_controller(self, _, macros, multiplier): + with self._ioc.start_with_macros(macros, "JMP:MODE"): + self.ca.set_pv_value("PLATE2:TEMP:SP", 10.0) + self.ca_julabo.assert_that_pv_is("TEMP:SP:RBV", 10.0 / multiplier) + self._lewis_julabo.assert_that_emulator_value_is("set_point_temperature", str(10.0 / multiplier)) + + self._lewis_julabo.backdoor_set_on_device("temperature", 11.0) + self.ca.assert_that_pv_is_number("PLATE2:TEMP", 11.0 * multiplier, tolerance=0.01) + + def test_WHEN_temperature_set_on_readback_controller_via_backdoor_THEN_temperature_updates_correctly(self): + self._lewis_euro.backdoor_set_on_device("current_temperature", 33.0) + self.ca.assert_that_pv_is_number("SAMPLE:TEMP", 33.0, tolerance=0.01) + + @parameterized.expand(parameterized_list(MODES)) + def test_WHEN_position_moved_THEN_position_updates_correctly(self, _, mode, states): + self.ca.set_pv_value("JMP:MODE:SP", mode) + self.ca.assert_that_pv_is("JMP:MODE", mode) + self.ca_tjmper.assert_that_pv_is("MODE", mode) + + self.ca.assert_that_pv_is("PLATE1:HOME", states[0]) + self.ca.assert_that_pv_is("PLATE1:ENGAGED", states[1]) + self.ca.assert_that_pv_is("PLATE2:HOME", states[2]) + self.ca.assert_that_pv_is("PLATE2:ENGAGED", states[3]) + self.ca.assert_that_pv_is("SAMPLE:HOME", states[4]) + self.ca.assert_that_pv_is("SAMPLE:ENGAGED", states[5]) - def test_that_fails(self): - self.fail("You haven't implemented any tests!") + self.ca_tjmper.assert_that_pv_is("LMT:PLATE1:HOME", states[0]) + self.ca_tjmper.assert_that_pv_is("LMT:PLATE1:ENGAGED", states[1]) + self.ca_tjmper.assert_that_pv_is("LMT:PLATE2:HOME", states[2]) + self.ca_tjmper.assert_that_pv_is("LMT:PLATE2:ENGAGED", states[3]) + self.ca_tjmper.assert_that_pv_is("LMT:SAMPLE:HOME", states[4]) + self.ca_tjmper.assert_that_pv_is("LMT:SAMPLE:ENGAGED", states[5]) From 0ab9b80c08a5ba55b3516907b502e5fa6ed49b3f Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 21 Sep 2022 12:20:20 +0100 Subject: [PATCH 11/14] Added basic template. --- tjmpapSup/tjmpap.template | 258 +++++++++++++++++++++++++++++++++++++- 1 file changed, 256 insertions(+), 2 deletions(-) diff --git a/tjmpapSup/tjmpap.template b/tjmpapSup/tjmpap.template index 2e79308..94e7d22 100644 --- a/tjmpapSup/tjmpap.template +++ b/tjmpapSup/tjmpap.template @@ -20,16 +20,270 @@ record(bo, "$(P)DISABLE") record(mbbi, "$(P)JMP:MODE") { + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):MODE CP MSS") field(SCAN, "Passive") field(DTYP, "Soft Channel") + field(ZRST, "All out") # All home + field(ONST, "PLT1 and SMPL engaged") # Engage Plate 1 and sample + field(TWST, "PLT2 and SMPL engaged") # Engage Plate 2 and sample info(interest, "HIGH") } -alias("$(P)JMP:MODE", "TJMPER_$(TJUMPER_IOC_ID):MODE") record(mbbo, "$(P)JMP:MODE:SP") { + field(OUT, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):MODE:SP CP MSS") field(SCAN, "Passive") field(DTYP, "Soft Channel") + field(ZRST, "All out") + field(ONST, "PLT1 and SMPL engaged") + field(TWST, "PLT2 and SMPL engaged") info(interest, "HIGH") } -alias("$(P)JMP:MODE:SP", "TJMPER_$(TJUMPER_IOC_ID):MODE:SP") + +record(stringin, "$(P)TJMPER") +{ + field(VAL, "TJMPER_$(TJMPER_IOC_ID)") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} + +record(stringin, "$(P)PLATE1:CONTROLLER") +{ + field(VAL, "$(BLOCK_1_TEMP_CONTROLLER)") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} + +record(stringin, "$(P)PLATE2:CONTROLLER") +{ + field(VAL, "$(BLOCK_2_TEMP_CONTROLLER)") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} + +record(stringin, "$(P)SAMPLE:READBACK") +{ + field(VAL, "$(SAMPLE_TEMP_READBACK)") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} + +record(bi, "$(P)PLATE1:MOVING") +{ + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):PLATE1:MOVING CP MSS") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "False") + field(ONAM, "True") + info(interest, "HIGH") +} + +record(bi, "$(P)PLATE2:MOVING") +{ + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):PLATE2:MOVING CP MSS") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "False") + field(ONAM, "True") + info(interest, "HIGH") +} + +record(bi, "$(P)SAMPLE:MOVING") +{ + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):SAMPLE:MOVING CP MSS") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "False") + field(ONAM, "True") + info(interest, "HIGH") +} + +record(bi, "$(P)PLATE1:HOME") +{ + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:PLATE1:HOME CP MSS") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "False") + field(ONAM, "True") + info(interest, "HIGH") +} + +record(bi, "$(P)PLATE2:HOME") +{ + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:PLATE2:HOME CP MSS") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "False") + field(ONAM, "True") + info(interest, "HIGH") +} + +record(bi, "$(P)SAMPLE:HOME") +{ + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:SAMPLE:HOME CP MSS") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "False") + field(ONAM, "True") + info(interest, "HIGH") +} + +record(bi, "$(P)PLATE1:ENGAGED") +{ + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:PLATE1:ENGAGED CP MSS") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "False") + field(ONAM, "True") + info(interest, "HIGH") +} + +record(bi, "$(P)PLATE2:ENGAGED") +{ + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:PLATE2:ENGAGED CP MSS") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "False") + field(ONAM, "True") + info(interest, "HIGH") +} + +record(bi, "$(P)SAMPLE:ENGAGED") +{ + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:SAMPLE:ENGAGED CP MSS") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "False") + field(ONAM, "True") + info(interest, "HIGH") +} + +record(ai, "$(P)SAMPLE:TEMP") +{ + field(INP, "$(PVPREFIX)$(SAMPLE_TEMP_READBACK):TEMP CP MSS") + field(DESC, "Value for the sample temperature") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + info(interest, "HIGH") + info(archive, "VAL") +} + +record(ai, "$(P)PLATE1:TEMP:RAW") +{ + field(INP, "$(PVPREFIX)$(BLOCK_1_TEMP_CONTROLLER):TEMP CP MSS") + #field(DESC, "Raw value from the Plate1 temperature controller") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + info(archive, "VAL") +} + +record(ao, "$(P)PLATE1:TEMP:RAW:SP") +{ + field(OUT, "$(PVPREFIX)$(BLOCK_1_TEMP_CONTROLLER):TEMP:SP CA PP") + #field(DESC, "Raw value to send to the Plate1 temperature controller") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} + +record(ai, "$(P)PLATE1:TEMP:RAW:SP:READBACK") +{ + field(INP, "$(PVPREFIX)$(BLOCK_1_TEMP_CONTROLLER):TEMP:SP:RBV CP MSS") + #field(DESC, "Raw value to send to the Plate1 temperature controller") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} + +record(ai, "$(P)PLATE2:TEMP:RAW") +{ + field(INP, "$(PVPREFIX)$(BLOCK_2_TEMP_CONTROLLER):TEMP CP MSS") + #field(DESC, "Raw value from the Plate2 temperature controller") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + info(archive, "VAL") +} + +record(ao, "$(P)PLATE2:TEMP:RAW:SP") +{ + field(OUT, "$(PVPREFIX)$(BLOCK_2_TEMP_CONTROLLER):TEMP:SP CA PP") + #field(DESC, "Raw value to send to the Plate2 temperature controller") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} + +record(ai, "$(P)PLATE2:TEMP:RAW:SP:READBACK") +{ + field(INP, "$(PVPREFIX)$(BLOCK_2_TEMP_CONTROLLER):TEMP:SP:RBV CP MSS") + #field(DESC, "Raw value to send to the Plate2 temperature controller") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} + +record(cvt, "$(P)PLATE1:TEMP") +{ + field(INPX, "$(P)PLATE1:TEMP:RAW CP MSS") + field(METH, "1D TABLE") + field(SPEC, "$(CALIBRATION_FILE)") + field(TDIR, "$(CALIBRATION_FOLDER)") + field(BDIR, "$(CALIBRATION_BASE_DIR)") + info(interest, "HIGH") + info(archive, "VAL") +} + +record(cvt, "$(P)PLATE2:TEMP") +{ + field(INPX, "$(P)PLATE2:TEMP:RAW CP MSS") + field(METH, "1D TABLE") + field(SPEC, "$(CALIBRATION_FILE)") + field(TDIR, "$(CALIBRATION_FOLDER)") + field(BDIR, "$(CALIBRATION_BASE_DIR)") + info(interest, "HIGH") + info(archive, "VAL") +} + +record(ao, "$(P)PLATE1:TEMP:SP") +{ + field(FLNK, "$(P)PLATE1:TEMP:SP:CALIB") +} + +record(ao, "$(P)PLATE2:TEMP:SP") +{ + field(FLNK, "$(P)PLATE2:TEMP:SP:CALIB") +} + +record(cvt, "$(P)PLATE1:TEMP:SP:CALIB") +{ + field(INPY, "$(P)PLATE1:TEMP:SP") + field(METH, "1D TABLE INVERTED") + field(SPEC, "$(CALIBRATION_FILE)") + field(TDIR, "$(CALIBRATION_FOLDER)") + field(BDIR, "$(CALIBRATION_BASE_DIR)") + field(OUT, "$(P)PLATE1:TEMP:RAW:SP PP") +} + +record(cvt, "$(P)PLATE2:TEMP:SP:CALIB") +{ + field(INPY, "$(P)PLATE2:TEMP:SP") + field(METH, "1D TABLE INVERTED") + field(SPEC, "$(CALIBRATION_FILE)") + field(TDIR, "$(CALIBRATION_FOLDER)") + field(BDIR, "$(CALIBRATION_BASE_DIR)") + field(OUT, "$(P)PLATE2:TEMP:RAW:SP PP") +} + +record(cvt, "$(P)PLATE1:TEMP:SP:READBACK") +{ + field(INPX, "$(P)PLATE1:TEMP:RAW:SP:READBACK CP MSS") + field(METH, "1D TABLE") + field(SPEC, "$(CALIBRATION_FILE)") + field(TDIR, "$(CALIBRATION_FOLDER)") + field(BDIR, "$(CALIBRATION_BASE_DIR)") +} + +record(cvt, "$(P)PLATE2:TEMP:SP:READBACK") +{ + field(INPX, "$(P)PLATE2:TEMP:RAW:SP:READBACK CP MSS") + field(METH, "1D TABLE") + field(SPEC, "$(CALIBRATION_FILE)") + field(TDIR, "$(CALIBRATION_FOLDER)") + field(BDIR, "$(CALIBRATION_BASE_DIR)") +} \ No newline at end of file From a4146a5e8a7080d96e02f54cf1280253a19cfe49 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 21 Sep 2022 13:37:30 +0100 Subject: [PATCH 12/14] Templated the database. --- tjmpapSup/tjmpap.template | 238 ---------------------------- tjmpapSup/tjmpap_macros.template | 6 + tjmpapSup/tjmpap_positions.template | 9 ++ tjmpapSup/tjmpap_temps.template | 59 +++++++ 4 files changed, 74 insertions(+), 238 deletions(-) create mode 100644 tjmpapSup/tjmpap_macros.template create mode 100644 tjmpapSup/tjmpap_positions.template create mode 100644 tjmpapSup/tjmpap_temps.template diff --git a/tjmpapSup/tjmpap.template b/tjmpapSup/tjmpap.template index 94e7d22..670d0b9 100644 --- a/tjmpapSup/tjmpap.template +++ b/tjmpapSup/tjmpap.template @@ -40,124 +40,6 @@ record(mbbo, "$(P)JMP:MODE:SP") info(interest, "HIGH") } -record(stringin, "$(P)TJMPER") -{ - field(VAL, "TJMPER_$(TJMPER_IOC_ID)") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") -} - -record(stringin, "$(P)PLATE1:CONTROLLER") -{ - field(VAL, "$(BLOCK_1_TEMP_CONTROLLER)") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") -} - -record(stringin, "$(P)PLATE2:CONTROLLER") -{ - field(VAL, "$(BLOCK_2_TEMP_CONTROLLER)") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") -} - -record(stringin, "$(P)SAMPLE:READBACK") -{ - field(VAL, "$(SAMPLE_TEMP_READBACK)") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") -} - -record(bi, "$(P)PLATE1:MOVING") -{ - field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):PLATE1:MOVING CP MSS") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - field(ZNAM, "False") - field(ONAM, "True") - info(interest, "HIGH") -} - -record(bi, "$(P)PLATE2:MOVING") -{ - field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):PLATE2:MOVING CP MSS") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - field(ZNAM, "False") - field(ONAM, "True") - info(interest, "HIGH") -} - -record(bi, "$(P)SAMPLE:MOVING") -{ - field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):SAMPLE:MOVING CP MSS") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - field(ZNAM, "False") - field(ONAM, "True") - info(interest, "HIGH") -} - -record(bi, "$(P)PLATE1:HOME") -{ - field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:PLATE1:HOME CP MSS") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - field(ZNAM, "False") - field(ONAM, "True") - info(interest, "HIGH") -} - -record(bi, "$(P)PLATE2:HOME") -{ - field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:PLATE2:HOME CP MSS") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - field(ZNAM, "False") - field(ONAM, "True") - info(interest, "HIGH") -} - -record(bi, "$(P)SAMPLE:HOME") -{ - field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:SAMPLE:HOME CP MSS") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - field(ZNAM, "False") - field(ONAM, "True") - info(interest, "HIGH") -} - -record(bi, "$(P)PLATE1:ENGAGED") -{ - field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:PLATE1:ENGAGED CP MSS") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - field(ZNAM, "False") - field(ONAM, "True") - info(interest, "HIGH") -} - -record(bi, "$(P)PLATE2:ENGAGED") -{ - field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:PLATE2:ENGAGED CP MSS") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - field(ZNAM, "False") - field(ONAM, "True") - info(interest, "HIGH") -} - -record(bi, "$(P)SAMPLE:ENGAGED") -{ - field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):LMT:SAMPLE:ENGAGED CP MSS") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - field(ZNAM, "False") - field(ONAM, "True") - info(interest, "HIGH") -} - record(ai, "$(P)SAMPLE:TEMP") { field(INP, "$(PVPREFIX)$(SAMPLE_TEMP_READBACK):TEMP CP MSS") @@ -167,123 +49,3 @@ record(ai, "$(P)SAMPLE:TEMP") info(interest, "HIGH") info(archive, "VAL") } - -record(ai, "$(P)PLATE1:TEMP:RAW") -{ - field(INP, "$(PVPREFIX)$(BLOCK_1_TEMP_CONTROLLER):TEMP CP MSS") - #field(DESC, "Raw value from the Plate1 temperature controller") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - info(archive, "VAL") -} - -record(ao, "$(P)PLATE1:TEMP:RAW:SP") -{ - field(OUT, "$(PVPREFIX)$(BLOCK_1_TEMP_CONTROLLER):TEMP:SP CA PP") - #field(DESC, "Raw value to send to the Plate1 temperature controller") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") -} - -record(ai, "$(P)PLATE1:TEMP:RAW:SP:READBACK") -{ - field(INP, "$(PVPREFIX)$(BLOCK_1_TEMP_CONTROLLER):TEMP:SP:RBV CP MSS") - #field(DESC, "Raw value to send to the Plate1 temperature controller") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") -} - -record(ai, "$(P)PLATE2:TEMP:RAW") -{ - field(INP, "$(PVPREFIX)$(BLOCK_2_TEMP_CONTROLLER):TEMP CP MSS") - #field(DESC, "Raw value from the Plate2 temperature controller") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") - info(archive, "VAL") -} - -record(ao, "$(P)PLATE2:TEMP:RAW:SP") -{ - field(OUT, "$(PVPREFIX)$(BLOCK_2_TEMP_CONTROLLER):TEMP:SP CA PP") - #field(DESC, "Raw value to send to the Plate2 temperature controller") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") -} - -record(ai, "$(P)PLATE2:TEMP:RAW:SP:READBACK") -{ - field(INP, "$(PVPREFIX)$(BLOCK_2_TEMP_CONTROLLER):TEMP:SP:RBV CP MSS") - #field(DESC, "Raw value to send to the Plate2 temperature controller") - field(SCAN, "Passive") - field(DTYP, "Soft Channel") -} - -record(cvt, "$(P)PLATE1:TEMP") -{ - field(INPX, "$(P)PLATE1:TEMP:RAW CP MSS") - field(METH, "1D TABLE") - field(SPEC, "$(CALIBRATION_FILE)") - field(TDIR, "$(CALIBRATION_FOLDER)") - field(BDIR, "$(CALIBRATION_BASE_DIR)") - info(interest, "HIGH") - info(archive, "VAL") -} - -record(cvt, "$(P)PLATE2:TEMP") -{ - field(INPX, "$(P)PLATE2:TEMP:RAW CP MSS") - field(METH, "1D TABLE") - field(SPEC, "$(CALIBRATION_FILE)") - field(TDIR, "$(CALIBRATION_FOLDER)") - field(BDIR, "$(CALIBRATION_BASE_DIR)") - info(interest, "HIGH") - info(archive, "VAL") -} - -record(ao, "$(P)PLATE1:TEMP:SP") -{ - field(FLNK, "$(P)PLATE1:TEMP:SP:CALIB") -} - -record(ao, "$(P)PLATE2:TEMP:SP") -{ - field(FLNK, "$(P)PLATE2:TEMP:SP:CALIB") -} - -record(cvt, "$(P)PLATE1:TEMP:SP:CALIB") -{ - field(INPY, "$(P)PLATE1:TEMP:SP") - field(METH, "1D TABLE INVERTED") - field(SPEC, "$(CALIBRATION_FILE)") - field(TDIR, "$(CALIBRATION_FOLDER)") - field(BDIR, "$(CALIBRATION_BASE_DIR)") - field(OUT, "$(P)PLATE1:TEMP:RAW:SP PP") -} - -record(cvt, "$(P)PLATE2:TEMP:SP:CALIB") -{ - field(INPY, "$(P)PLATE2:TEMP:SP") - field(METH, "1D TABLE INVERTED") - field(SPEC, "$(CALIBRATION_FILE)") - field(TDIR, "$(CALIBRATION_FOLDER)") - field(BDIR, "$(CALIBRATION_BASE_DIR)") - field(OUT, "$(P)PLATE2:TEMP:RAW:SP PP") -} - -record(cvt, "$(P)PLATE1:TEMP:SP:READBACK") -{ - field(INPX, "$(P)PLATE1:TEMP:RAW:SP:READBACK CP MSS") - field(METH, "1D TABLE") - field(SPEC, "$(CALIBRATION_FILE)") - field(TDIR, "$(CALIBRATION_FOLDER)") - field(BDIR, "$(CALIBRATION_BASE_DIR)") -} - -record(cvt, "$(P)PLATE2:TEMP:SP:READBACK") -{ - field(INPX, "$(P)PLATE2:TEMP:RAW:SP:READBACK CP MSS") - field(METH, "1D TABLE") - field(SPEC, "$(CALIBRATION_FILE)") - field(TDIR, "$(CALIBRATION_FOLDER)") - field(BDIR, "$(CALIBRATION_BASE_DIR)") -} \ No newline at end of file diff --git a/tjmpapSup/tjmpap_macros.template b/tjmpapSup/tjmpap_macros.template new file mode 100644 index 0000000..5775752 --- /dev/null +++ b/tjmpapSup/tjmpap_macros.template @@ -0,0 +1,6 @@ +record(stringin, "$(P)$(CONTROLLER)") +{ + field(VAL, "$(MACRO)") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} diff --git a/tjmpapSup/tjmpap_positions.template b/tjmpapSup/tjmpap_positions.template new file mode 100644 index 0000000..7502d0b --- /dev/null +++ b/tjmpapSup/tjmpap_positions.template @@ -0,0 +1,9 @@ +record(bi, "$(P)$(POSITION)") +{ + field(INP, "$(PVPREFIX)TJMPER_$(TJMPER_IOC_ID):$(TJMPER_POSITION) CP MSS") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(ZNAM, "False") + field(ONAM, "True") + info(interest, "HIGH") +} diff --git a/tjmpapSup/tjmpap_temps.template b/tjmpapSup/tjmpap_temps.template new file mode 100644 index 0000000..01dd4a9 --- /dev/null +++ b/tjmpapSup/tjmpap_temps.template @@ -0,0 +1,59 @@ +record(ai, "$(P)$(PLATE):TEMP:RAW") +{ + field(INP, "$(PVPREFIX)$(CONTROLLER):TEMP CP MSS") + field(DESC, "Raw value from $(PLATE) TEMP CNTLR") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + info(archive, "VAL") +} + +record(ao, "$(P)$(PLATE):TEMP:RAW:SP") +{ + field(OUT, "$(PVPREFIX)$(CONTROLLER):TEMP:SP CA PP") + field(DESC, "Raw value SP to $(PLATE) TEMP CNTLR") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} + +record(ai, "$(P)$(PLATE):TEMP:RAW:SP:READBACK") +{ + field(INP, "$(PVPREFIX)$(CONTROLLER):TEMP:SP:RBV CP MSS") + field(DESC, "SP RBV from $(PLATE) TEMP CNTLR") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") +} + +record(cvt, "$(P)$(PLATE):TEMP:SP:READBACK") +{ + field(INPX, "$(P)$(PLATE):TEMP:RAW:SP:READBACK CP MSS") + field(METH, "1D TABLE") + field(SPEC, "$(CALIBRATION_FILE)") + field(TDIR, "$(CALIBRATION_FOLDER)") + field(BDIR, "$(CALIBRATION_BASE_DIR)") +} + +record(cvt, "$(P)$(PLATE):TEMP") +{ + field(INPX, "$(P)$(PLATE):TEMP:RAW CP MSS") + field(METH, "1D TABLE") + field(SPEC, "$(CALIBRATION_FILE)") + field(TDIR, "$(CALIBRATION_FOLDER)") + field(BDIR, "$(CALIBRATION_BASE_DIR)") + info(interest, "HIGH") + info(archive, "VAL") +} + +record(cvt, "$(P)$(PLATE):TEMP:SP:CALIB") +{ + field(INPY, "$(P)$(PLATE):TEMP:SP") + field(METH, "1D TABLE INVERTED") + field(SPEC, "$(CALIBRATION_FILE)") + field(TDIR, "$(CALIBRATION_FOLDER)") + field(BDIR, "$(CALIBRATION_BASE_DIR)") + field(OUT, "$(P)$(PLATE):TEMP:RAW:SP PP") +} + +record(ao, "$(P)$(PLATE):TEMP:SP") +{ + field(FLNK, "$(P)$(PLATE):TEMP:SP:CALIB") +} From 483124b9d568a1a7840d6a7a3e5bf0798cb6f6e6 Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Wed, 21 Sep 2022 13:56:38 +0100 Subject: [PATCH 13/14] Fixed weird characters. --- Makefile | 74 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index 22ffa66..8721105 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,37 @@ -# Makefile for Asyn tjmpap support -# -# Created by eii24694 on Wed Sep 14 11:38:48 2022 -# Based on the Asyn streamSCPI template - -TOP = . -include $(TOP)/configure/CONFIG - -DIRS += configure -DIRS += $(wildcard *Sup) -DIRS += $(wildcard *App) -DIRS += $(wildcard *Top) -DIRS += $(wildcard iocBoot) - -# The build order is controlled by these dependency rules: - -# All dirs except configure depend on configure -$(foreach dir, $(filter-out configure, $(DIRS)), \ - $(eval $(dir)_DEPEND_DIRS += configure)) - -# Any *App dirs depend on all *Sup dirs -$(foreach dir, $(filter %App, $(DIRS)), \ - $(eval $(dir)_DEPEND_DIRS += $(filter %Sup, $(DIRS)))) - -# Any *Top dirs depend on all *Sup and *App dirs -$(foreach dir, $(filter %Top, $(DIRS)), \ - $(eval $(dir)_DEPEND_DIRS += $(filter %Sup %App, $(DIRS)))) - -# iocBoot depends on all *App dirs -iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS)) - -# Add any additional dependency rules here: - -include $(TOP)/configure/RULES_TOP - -ioctests: - .\system_tests\run_tests.bat +# Makefile for Asyn tjmpap support +# +# Created by eii24694 on Wed Sep 14 11:38:48 2022 +# Based on the Asyn streamSCPI template + +TOP = . +include $(TOP)/configure/CONFIG + +DIRS += configure +DIRS += $(wildcard *Sup) +DIRS += $(wildcard *App) +DIRS += $(wildcard *Top) +DIRS += $(wildcard iocBoot) + +# The build order is controlled by these dependency rules: + +# All dirs except configure depend on configure +$(foreach dir, $(filter-out configure, $(DIRS)), \ + $(eval $(dir)_DEPEND_DIRS += configure)) + +# Any *App dirs depend on all *Sup dirs +$(foreach dir, $(filter %App, $(DIRS)), \ + $(eval $(dir)_DEPEND_DIRS += $(filter %Sup, $(DIRS)))) + +# Any *Top dirs depend on all *Sup and *App dirs +$(foreach dir, $(filter %Top, $(DIRS)), \ + $(eval $(dir)_DEPEND_DIRS += $(filter %Sup %App, $(DIRS)))) + +# iocBoot depends on all *App dirs +iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS)) + +# Add any additional dependency rules here: + +include $(TOP)/configure/RULES_TOP + +ioctests: + .\system_tests\run_tests.bat From 2c9eb6609fdb17f6f9e6b4058cdfd054fb43f43a Mon Sep 17 00:00:00 2001 From: Nikola Roev Date: Mon, 24 Oct 2022 09:54:25 +0100 Subject: [PATCH 14/14] Fixed Makefile formatting. Removed auto generated protocol file. --- Makefile | 3 ++- tjmpapSup/Makefile | 1 - tjmpapSup/tjmpap.proto | 18 ------------------ 3 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 tjmpapSup/tjmpap.proto diff --git a/Makefile b/Makefile index 8721105..588d9f9 100644 --- a/Makefile +++ b/Makefile @@ -34,4 +34,5 @@ iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS)) include $(TOP)/configure/RULES_TOP ioctests: - .\system_tests\run_tests.bat + + .\system_tests\run_tests.bat diff --git a/tjmpapSup/Makefile b/tjmpapSup/Makefile index b33521a..c1ef4bb 100644 --- a/tjmpapSup/Makefile +++ b/tjmpapSup/Makefile @@ -4,7 +4,6 @@ include $(TOP)/configure/CONFIG # Install .dbd and .db files DB += tjmpap.db -DATA += tjmpap.proto #======================================= include $(TOP)/configure/RULES diff --git a/tjmpapSup/tjmpap.proto b/tjmpapSup/tjmpap.proto deleted file mode 100644 index 3326465..0000000 --- a/tjmpapSup/tjmpap.proto +++ /dev/null @@ -1,18 +0,0 @@ -getIDN { - out "*IDN?"; - in "%\$1[^\r\n]"; - ExtraInput = Ignore; -} - -cmd { - out "\$1"; -} - -setD { - out "\$1 %d"; -} -getD { - out "\$1?"; - in "%d"; - ExtraInput = Ignore; -}