示例#1
0
import unittest
from utils.test_modes import TestModes
from utils.ioc_launcher import get_default_ioc_dir
from common_tests.fermichopper import FermichopperBase

DEVICE_PREFIX = "FERMCHOP_01"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("FERMCHOP"),
        "macros": {
            "INST": "maps",
            "MHZ": "18.0",
        },
        "emulator": "fermichopper",
        "lewis_protocol": "fermi_maps",
    },
]

TEST_MODES = [TestModes.RECSIM, TestModes.DEVSIM]


class MapsFermiChopperTests(FermichopperBase, unittest.TestCase):
    """
    All tests inherited from FermiChopperBase
    """
    def _get_device_prefix(self):
        return DEVICE_PREFIX
import unittest

from parameterized import parameterized
from utils.test_modes import TestModes
from utils.channel_access import ChannelAccess
from utils.ioc_launcher import get_default_ioc_dir, IOCRegister
from utils.testing import get_running_lewis_and_ioc, skip_if_recsim, parameterized_list

DEVICE_PREFIX = "CRYOSMS_01"
EMULATOR_NAME = "cryogenic_sms"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("CRYOSMS"),
        "emulator": EMULATOR_NAME,
        "macros": {
            "MAX_CURR": 135,
            "T_TO_A": 0.037,
            "MAX_VOLT": 9.9,
            "WRITE_UNIT": "AMPS",
            "DISPLAY_UNIT": "GAUSS",
            "RAMP_FILE":
            "C:\\Instrument\\Apps\\EPICS\\support\\cryosms\\master\\ramps\\test.txt",
            "MID_TOLERANCE": 0.1,
            "TARGET_TOLERANCE": 0.01,
            "ALLOW_PERSIST": "No",
            "USE_SWITCH": "No",
            "USE_MAGNET_TEMP": "No",
            "COMP_OFF_ACT": "No",
            "HOLD_TIME_ZERO": 12,
macros = {
    "IEOS": r"\\r\\n",
    "OEOS": r"\\r\\n",
    "MODELNO": "1240",
}
for channel in range(NUMBER_OF_CHANNELS):
    macros["CHAN{:1d}NAME".format(channel)] = CHANNEL_FORMAT.format(channel)
    macros["CHAN{:1d}LOWLIMIT".format(channel)] = LOW_ALARM_LIMIT
    macros["CHAN{:1d}HILIMIT".format(channel)] = HIGH_ALARM_LIMIT
    macros["CHAN{:1d}SCLEFACTR".format(channel)] = SCALING_FACTOR

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("MOXA12XX"),
        "emulator": "moxa12xx",
        "lewis_protocol": "MOXA_1240",
        "macros": macros,
        "pv_for_existence": "CH1:AI:RBV",
    },
]

AI_REGISTER_OFFSET = 0
REGISTERS_PER_CHANNEL = 1

TEST_MODES = [
    TestModes.DEVSIM,
]
NUMBER_OF_CHANNELS = 8
CHANNELS = range(NUMBER_OF_CHANNELS)
示例#4
0
X_KEPCO_DEVICE_PREFIX = "KEPCO_01"
Y_KEPCO_DEVICE_PREFIX = "KEPCO_02"
Z_KEPCO_DEVICE_PREFIX = "KEPCO_03"
MAGNETOMETER_DEVICE_PREFIX = "ZFMAGFLD_01"

DEFAULT_LOW_OUTPUT_LIMIT = -100
DEFAULT_HIGH_OUTPUT_LIMIT = 100

X_KEPCO_VOLTAGE_LIMIT = 20
Y_KEPCO_VOLTAGE_LIMIT = 30
Z_KEPCO_VOLTAGE_LIMIT = 40

IOCS = [
    {
        "name": ZF_DEVICE_PREFIX,
        "directory": get_default_ioc_dir("ZFCNTRL"),
        "started_text": "seq zero_field",
        "macros": {
            "OUTPUT_X_MIN": DEFAULT_LOW_OUTPUT_LIMIT,
            "OUTPUT_X_MAX": DEFAULT_HIGH_OUTPUT_LIMIT,
            "OUTPUT_Y_MIN": DEFAULT_LOW_OUTPUT_LIMIT,
            "OUTPUT_Y_MAX": DEFAULT_HIGH_OUTPUT_LIMIT,
            "OUTPUT_Z_MIN": DEFAULT_LOW_OUTPUT_LIMIT,
            "OUTPUT_Z_MAX": DEFAULT_HIGH_OUTPUT_LIMIT,
            "PSU_X": r"$(MYPVPREFIX){}".format(X_KEPCO_DEVICE_PREFIX),
            "PSU_Y": r"$(MYPVPREFIX){}".format(Y_KEPCO_DEVICE_PREFIX),
            "PSU_Z": r"$(MYPVPREFIX){}".format(Z_KEPCO_DEVICE_PREFIX),
            "MAGNETOMETER":
            r"$(MYPVPREFIX){}".format(MAGNETOMETER_DEVICE_PREFIX),
            "FEEDBACK": "1",
            "AMPS_PER_MG_X": "1",
示例#5
0
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 = "FLIPPRPS_01"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("FLIPPRPS"),
        "macros": {},
        "emulator": "flipprps",
    },
]

TEST_MODES = [TestModes.RECSIM, TestModes.DEVSIM]


class FlipprpsTests(unittest.TestCase):
    """
    Tests for the Flipprps IOC.
    """
    def setUp(self):
        self._lewis, self._ioc = get_running_lewis_and_ioc(
            "flipprps", DEVICE_PREFIX)
        self.ca = ChannelAccess(device_prefix=DEVICE_PREFIX)
        self._lewis.backdoor_set_on_device("connected", True)
示例#6
0
from utils.test_modes import TestModes
from utils.channel_access import ChannelAccess
from utils.ioc_launcher import get_default_ioc_dir, EPICS_TOP
from utils.testing import skip_if_recsim, get_running_lewis_and_ioc, parameterized_list

# Device prefix
DEVICE_PREFIX = "TWINCAT_01"
EMULATOR_NAME = "dummy_PLC"

BECKHOFF_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..",
                             "..")

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("TWINCAT"),
        "macros": {
            "TPY_FILE":
            "{}".format(
                os.path.join(BECKHOFF_ROOT, EMULATOR_NAME, "TestPLC",
                             "TestCode",
                             "TestCode.tpy").replace(os.path.sep, "/"))
        },
        "emulator": EMULATOR_NAME,
        "emulator_launcher_class": BeckhoffEmulatorLauncher,
        "beckhoff_root": BECKHOFF_ROOT,
        "solution_path": os.path.join(EMULATOR_NAME, "TestPLC.sln"),
        "emulator_wait_to_finish": True
    },
]
示例#7
0
try:
    from contextlib import nullcontext
except ImportError:
    from contextlib2 import nullcontext

test_path = os.path.realpath(
    os.path.join(os.getenv("EPICS_KIT_ROOT"), "support", "motorExtensions",
                 "master", "settings", "sans2d_vacuum_tank"))

GALIL_ADDR = "127.0.0.1"

# Create GALIL_03, GALIL_04 and GALIL_05
IOCS = [{
    "name": "GALIL_0{}".format(i),
    "directory": get_default_ioc_dir("GALIL", i),
    "custom_prefix": "MOT",
    "pv_for_existence": "MTR0{}01".format(i),
    "macros": {
        "GALILADDR": GALIL_ADDR,
        "MTRCTRL": "0{}".format(i),
        "GALILCONFIGDIR": test_path.replace("\\", "/"),
    }
} for i in [3, 4, 5]]

IOCS.append({
    "name": "INSTETC",
    "directory": get_default_ioc_dir("INSTETC"),
    "custom_prefix": "CS",
    "pv_for_existence": "MANAGER",
})
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 = "CRYVALVE_01"


IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("CRYVALVE"),
        "macros": {},
        "emulator": "Cryvalve",
    },
]


TEST_MODES = [TestModes.RECSIM]


class CryvalveTests(unittest.TestCase):
    """
    Tests for the Cryvalve IOC.
    """
    def setUp(self):
        self._lewis, self._ioc = get_running_lewis_and_ioc("Cryvalve", DEVICE_PREFIX)
        self.ca = ChannelAccess(device_prefix=DEVICE_PREFIX)
示例#9
0
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

from parameterized import parameterized

DEVICE_PREFIX = "DH2000_01"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("DH2000"),
        "macros": {},
        "emulator": "dh2000",
    },
]

TEST_MODES = [TestModes.DEVSIM]


class Dh2000Tests(unittest.TestCase):
    """
    Tests for the Dh2000 IOC.
    """
    def setUp(self):
        self._lewis, self._ioc = get_running_lewis_and_ioc(
            "dh2000", DEVICE_PREFIX)
        self.ca = ChannelAccess(device_prefix=DEVICE_PREFIX)
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, unstable_test

DEVICE_PREFIX = "LKSH218_04"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("LKSH218", iocnum=4),
        "macros": {},
        "emulator": "Lksh218",
    },
]

TEST_MODES = [TestModes.RECSIM, TestModes.DEVSIM]


class Lksh218Tests(unittest.TestCase):
    """
    Tests for the Lksh218 IOC.
    """
    def setUp(self):
        self._lewis, self._ioc = get_running_lewis_and_ioc(
            "Lksh218", DEVICE_PREFIX)
        self.ca = ChannelAccess(device_prefix=DEVICE_PREFIX)
        self._lewis.backdoor_set_on_device("connected", True)
示例#11
0
from time import sleep

from parameterized import parameterized

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, unstable_test

DEVICE_PREFIX = "JSCO4180_01"
DEVICE_NAME = "jsco4180"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("JSCO4180"),
        "macros": {},
        "emulator": DEVICE_NAME,
    },
]

TEST_MODES = [TestModes.DEVSIM]

ERROR_STATE_HARDWARE_FAULT = 4
ERROR_STATE_NO_ERROR = 2

required_pvs = ["COMP:A:SP", "COMP:B:SP", "COMP:C:SP", "START:SP", "STATUS", "FLOWRATE:SP", "TIME:RUN:SP",
                "PRESSURE:MIN:SP", "PRESSURE:MAX:SP", "ERROR:SP", "ERROR:STR", "PUMP_FOR_TIME:SP"]


class Jsco4180Tests(unittest.TestCase):
示例#12
0
from utils.testing import parameterized_list
from utils.test_modes import TestModes
from utils.channel_access import ChannelAccess
from utils.ioc_launcher import get_default_ioc_dir, ProcServLauncher, IOCRegister
import numpy as np

DEVICE_PREFIX = "ZFMAGFLD_01"

TEST_MODES = [TestModes.RECSIM]

OFFSET = 1.3

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("ZFMAGFLD"),
        "ioc_launcher_class": ProcServLauncher,
    },
]

AXES = {"X": "L",
        "Y": "T",
        "Z": "V"}

ZERO_FIELD = {
    "X": 0.0,
    "Y": 0.0,
    "Z": 0.0
}

FIELD_STRENGTHS = [0.0, 1.1, 12.3, -1.1, -12.3]
ID2 = "RB1"

ADR3 = "003"
ID3 = "RB3"
ADR4 = "004"
ID4 = "RB4"

CLEAR_STATUS = "." * 24
IDS = [ID1, ID2, ID3, ID4]

PSU_ADDRESSES = [ADR1, ADR2, ADR3, ADR4]

IOCS = [
    {
        "name": PREFIX,
        "directory": get_default_ioc_dir("RKNPS"),
        "macros": {
            "CHAIN1_ID1": ID1,
            "CHAIN1_ADR1": ADR1,
            "CHAIN1_ID2": ID2,
            "CHAIN1_ADR2": ADR2,
            "CHAIN1_ID3": ID3,
            "CHAIN1_ADR3": ADR3,
            "CHAIN1_ID4": ID4,
            "CHAIN1_ADR4": ADR4,
        },
        "pv_for_existence": "{}:DISABLE".format(ID1),
        "emulator": "rknps",
    },
]
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 = "AG53220A_01"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("AG53220A"),
        "emulator": "Ag53220A",
    },
]

TEST_MODES = [TestModes.RECSIM]


class Ag53220ATests(unittest.TestCase):
    """
    Tests for the Ag53220A IOC.
    """
    def setUp(self):
        self._lewis, self._ioc = get_running_lewis_and_ioc(
            "Ag53220A", DEVICE_PREFIX)
        self.ca = ChannelAccess(device_prefix=DEVICE_PREFIX)
        self.ca.assert_that_pv_exists("DISABLE", timeout=30)

    def test_WHEN_ioc_is_started_THEN_ioc_is_not_disabled(self):
示例#15
0
# Set tight voltage stability limits around the data acquired from the DAQ
VOLT_UPPERLIM = 0.999 * max(DAQ_DATA)
VOLT_LOWERLIM = 1.001 * min(DAQ_DATA)

# Voltage and current stability limits
VOLT_STEADY = 0.5 * (VOLT_UPPERLIM + VOLT_LOWERLIM)

CURR_STEADY = 0.5 * MAX_SEPARATOR_CURR
CURR_LIMIT = MAX_SEPARATOR_CURR

STRIDE_LENGTH = 1

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("SEPRTR"),
        "macros": {
            "VUPPERLIM": VOLT_UPPERLIM,
            "VLOWERLIM": VOLT_LOWERLIM,
            "ISTEADY": CURR_STEADY,
            "ILIMIT": CURR_LIMIT,
            "NELM": SAMPLE_LEN,
            "FREQ": SAMPLE_LEN,
            "WINDOWSIZE": BUFFER_LEN,
            "MAXUNSTBL": 30,
            "POWER_MIN_VOLT": 2,
            "DAQ_AI_PORT_NAME": "L0",
            "DAQ_AO_PORT_NAME": "L0"
        },
    },
]
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
from enum import Enum
from itertools import product

DEVICE_PREFIX = "TPG300_01"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("TPG300"),
        "macros": {},
        "emulator": "tpg300",
    },
]


TEST_MODES = [TestModes.DEVSIM, TestModes.RECSIM]


class Units(Enum):
    mbar = 1
    Torr = 2
    Pa = 3


CHANNELS = "A1", "A2", "B1", "B2"
示例#17
0
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 = "HAMEG8123_01"


IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("HAMEG8123"),
        "macros": {},
        "emulator": "Hameg8123",
    },
]


TEST_MODES = [TestModes.RECSIM]


class Hameg8123Tests(unittest.TestCase):
    """
    Tests for the Hameg8123 IOC.
    """
    def setUp(self):
        self._lewis, self._ioc = get_running_lewis_and_ioc(None, DEVICE_PREFIX)
        self.ca = ChannelAccess(device_prefix=DEVICE_PREFIX)
import unittest

import itertools

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, parameterized_list
from parameterized import parameterized

DEVICE_PREFIX = "ITC503_01"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("ITC503"),
        "emulator": "itc503",
    },
]

TEST_MODES = [TestModes.DEVSIM, TestModes.RECSIM]

TEST_VALUES = 0.12345678, 54.321

MODES = ("Manual", "Auto")

CHANNELS = (
    "Channel 1",
    "Channel 2",
    "Channel 3",
)
示例#19
0
import unittest

from parameterized import parameterized

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 = "KEYLKG_01"
EMULATOR_NAME = "keylkg"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("KEYLKG"),
        "macros": {},
        "emulator": EMULATOR_NAME,
    },
]

TEST_MODES = [TestModes.DEVSIM, TestModes.RECSIM]


class KeylkgTests(unittest.TestCase):
    """
    Tests for the Keylkg IOC.
    """
    def setUp(self):
        self._lewis, self._ioc = get_running_lewis_and_ioc(
            EMULATOR_NAME, DEVICE_PREFIX)
import unittest

from utils.test_modes import TestModes
from utils.channel_access import ChannelAccess
from utils.ioc_launcher import get_default_ioc_dir, IOCRegister
from utils.testing import skip_if_recsim, get_running_lewis_and_ioc

# Device prefix
DEVICE_PREFIX = "AG3631A_01"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("AG3631A"),
    },
]

TEST_MODES = [TestModes.RECSIM]


class Ag3631aTests(unittest.TestCase):
    """
    Tests for the AG3631A.
    """
    def setUp(self):
        self._ioc = IOCRegister.get_running(DEVICE_PREFIX)

        self.ca = ChannelAccess(20, DEVICE_PREFIX)
        self.ca.assert_that_pv_exists("DISABLE", timeout=30)

    def test_WHEN_ioc_is_started_THEN_ioc_is_not_disabled(self):
示例#21
0
from utils.ioc_launcher import get_default_ioc_dir
from utils.test_modes import TestModes

from .jaws import JawsTestsBase

MTR_01 = "GALIL_01"
MTR_02 = "GALIL_02"

test_path = os.path.realpath(
    os.path.join(os.getenv("EPICS_KIT_ROOT"), "support", "jaws", "master", "settings", "jaws_full_split"))

IOCS = [
    {
        "name": MTR_01,
        "directory": get_default_ioc_dir("GALIL"),
        "pv_for_existence": "AXIS1",
        "macros": {
            "MTRCTRL": "01",
            "GALILCONFIGDIR": test_path.replace("\\", "/"),
        },
    },
    {
        "name": MTR_02,
        "directory": get_default_ioc_dir("GALIL", iocnum=2),
        "pv_for_existence": "AXIS1",
        "macros": {
            "MTRCTRL": "02",
            "GALILCONFIGDIR": test_path.replace("\\", "/"),
        },
    },
import unittest

from utils.channel_access import ChannelAccess
from utils.ioc_launcher import get_default_ioc_dir, IOCRegister
from utils.test_modes import TestModes

DEVICE_PREFIX = "FMR_01"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("FMR"),
        "macros": {
            "LVDCOM_OPTIONS": 1
        },
    },
]

TEST_MODES = [TestModes.RECSIM]


class FmrTests(unittest.TestCase):
    """
    Tests for the fmr IOC.
    """
    def setUp(self):
        self._ioc = IOCRegister.get_running(DEVICE_PREFIX)
        self.ca = ChannelAccess(20, device_prefix=DEVICE_PREFIX)

    def test_WHEN_ioc_is_started_THEN_PV_exists(self):
        self.ca.assert_that_pv_exists("FMR:ACTIVITY", timeout=30)
MOTION_SETPOINT = OrderedDict([("Aperture_large", 02.900000),
                               ("Stop_01", 15.400000),
                               ("Aperture_medium", 27.900000),
                               ("Stop_02", 40.400000),
                               ("Aperture_small", 52.900000)])

SETPOINT_GAP = MOTION_SETPOINT["Stop_01"] - MOTION_SETPOINT["Aperture_large"]

test_path = os.path.realpath(
    os.path.join(os.getenv("EPICS_KIT_ROOT"), "support", "motorExtensions",
                 "master", "settings", "loqAperture"))

IOCS = [
    {
        "name": "GALIL_01",
        "directory": get_default_ioc_dir("GALIL"),
        "pv_for_existence": "AXIS1",
        "macros": {
            "GALILADDR": GALIL_ADDR,
            "MTRCTRL": "1",
            "GALILCONFIGDIR": test_path.replace("\\", "/"),
            "ICPCONFIGROOT": test_path.replace("\\", "/"),
        },
    },
]

TEST_MODES = [TestModes.DEVSIM]


class LoqApertureTests(unittest.TestCase):
    """
from time import sleep

import operator

from utils.test_modes import TestModes
from utils.channel_access import ChannelAccess
from utils.ioc_launcher import get_default_ioc_dir
from utils.testing import get_running_lewis_and_ioc, skip_if_recsim

DEVICE_PREFIX = "CYBAMAN_01"
EMULATOR_DEVICE = "cybaman"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("CYBAMAN"),
        "macros": {},
        "emulator": EMULATOR_DEVICE,
    },
]

TEST_MODES = [TestModes.RECSIM, TestModes.DEVSIM]


class CybamanTests(unittest.TestCase):
    """
    Tests for the cybaman IOC.
    """

    AXES = ["A", "B", "C"]
    test_positions = [-200, -1.23, 0, 180.0]
示例#25
0
import unittest

from common_tests.tpgx6x import TpgBase
from utils.ioc_launcher import get_default_ioc_dir
from utils.test_modes import TestModes

DEVICE_PREFIX = "TPG26X_01"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("TPG26X"),
        "emulator": "tpgx6x",
        "lewis_protocol": "tpg26x",
    },
]

TEST_MODES = [TestModes.RECSIM, TestModes.DEVSIM]


class Tpg26xTests(TpgBase, unittest.TestCase):
    def get_prefix(self):
        return DEVICE_PREFIX
ioc_number = 1
DEVICE_PREFIX = "REFL_{:02d}".format(ioc_number)
GALIL_PREFIX = "GALIL_01"
GALIL_PREFIX_JAWS = "GALIL_02"
test_config_path = os.path.abspath(
    os.path.join(os.path.dirname(os.path.dirname(__file__)), "test_config",
                 "good_for_refl"))
test_var_path = os.path.join(test_config_path, "var")

IOCS = [
    # Deliberately start the REFL server first to check on waiting for motors functionality
    {
        "ioc_launcher_class": ProcServLauncher,
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("REFL", iocnum=ioc_number),
        "started_text": "Instantiating Beamline Model",
        "pv_for_existence": "STAT",
        "macros": {
            "CONFIG_FILE": "config_init.py"
        },
        "environment_vars": {
            "ICPCONFIGROOT": test_config_path,
            "ICPVARDIR": test_var_path,
        }
    },
    {
        "name": GALIL_PREFIX,
        "custom_prefix": "MOT",
        "directory": get_default_ioc_dir("GALIL"),
        "pv_for_existence": "MTR0101",
from parameterized import parameterized

from utils.channel_access import ChannelAccess
from utils.ioc_launcher import get_default_ioc_dir, ProcServLauncher
from utils.test_modes import TestModes
from utils.testing import get_running_lewis_and_ioc, skip_if_recsim, parameterized_list

DEVICE_PREFIX = "LKSH340_01"
_EMULATOR_NAME = "lakeshore340"

THRESHOLDS_FILE = "Test1.txt"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("LKSH340"),
        "emulator": _EMULATOR_NAME,
        "ioc_launcher_class": ProcServLauncher,
        "macros": {
            "EXCITATION_THRESHOLD_FILE": THRESHOLDS_FILE,
            "USE_EXCITATION_THRESHOLD_FILE": "YES"
        }
    },
]

TEST_MODES = [TestModes.RECSIM, TestModes.DEVSIM]

SENSORS = ["A", "B", "C", "D"]
TEST_TEMPERATURES = [0.0, 0.0001, 1.0001, 123.456]
TEST_READINGS = TEST_TEMPERATURES
from utils.channel_access import ChannelAccess
from utils.ioc_launcher import IOCRegister, get_default_ioc_dir, EPICS_TOP
from parameterized import parameterized

from utils.test_modes import TestModes
from utils.testing import parameterized_list

ioc_name = "FINS"
test_path = os.path.join(EPICS_TOP, "ioc", "master", ioc_name,
                         "exampleSettings", "SANS2D_vacuum")
ioc_prefix = "FINS_VAC"

IOCS = [
    {
        "name": "FINS_01",
        "directory": get_default_ioc_dir(ioc_name),
        "custom_prefix": ioc_prefix,
        "pv_for_existence": "HEARTBEAT",
        "macros": {
            "FINSCONFIGDIR": test_path.replace("\\", "/"),
            "PLCIP": "127.0.0.1"
        },
    },
]

TEST_MODES = [TestModes.RECSIM]


class Sans2dVacuumSystemTests(unittest.TestCase):
    """
    Tests for the SANS2D vacuum system, based on a FINS PLC.
示例#29
0
import unittest

from utils.test_modes import TestModes
from utils.ioc_launcher import get_default_ioc_dir, ProcServLauncher

from common_tests.danfysik import DanfysikCommon, DEVICE_PREFIX, EMULATOR_NAME, HAS_TRIPPED
from utils.testing import skip_if_recsim

MAX_RAW_SETPOINT = 1000000
MIN_RAW_SETPOINT = MAX_RAW_SETPOINT * (-1)

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("DFKPS"),
        "macros": {
            "DEV_TYPE": "8000",
            "CALIBRATED": "0",
            "FACTOR_READ_I": "1",
            "FACTOR_READ_V": "1",
            "FACTOR_WRITE_I": "1",
            "DISABLE_AUTOONOFF": "0",
            "MAX_RAW_SETPOINT": MAX_RAW_SETPOINT,
            "POLARITY": "BIPOLAR",
        },
        "emulator": EMULATOR_NAME,
        "lewis_protocol": "model8000",
        "ioc_launcher_class": ProcServLauncher,
    },
]
示例#30
0
import itertools
import unittest

from parameterized import parameterized

from utils.channel_access import ChannelAccess
from utils.ioc_launcher import get_default_ioc_dir, IOCRegister
from utils.test_modes import TestModes
from utils.testing import get_running_lewis_and_ioc, skip_if_recsim, parameterized_list

DEVICE_PREFIX = "ICEFRDGE_01"

IOCS = [
    {
        "name": DEVICE_PREFIX,
        "directory": get_default_ioc_dir("ICEFRDGE"),
        "macros": {},
        "emulator": "icefrdge",
    },
]

TEST_MODES = [TestModes.RECSIM, TestModes.DEVSIM]

VTI_TEMP_SUFFIXES = [1, 2, 3, 4]

VTI_LOOPS = [1, 2]

VTI_LOOP_TEST_INPUTS = [0, 0.001, 0.333, 273]

LS_MC_HTR_RANGE_VALUES = ["Off", "31.6 uA", "100 uA", "316 uA", "1.00 mA", "3.16 mA", "10 mA", "31.6 mA", "100 mA"]