Further changes as part of MVPwq!
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
epicsEnvSet("NAME","masterMacs1")
|
||||
epicsEnvSet("ASYN_PORT","p$(NAME)")
|
||||
|
||||
drvAsynIPPortConfigure("$(ASYN_PORT)","$(ASYN_PORT)","$(MASTERMACS1_IP):$(MASTERMACS1_PORT)")
|
||||
drvAsynIPPortConfigure("$(ASYN_PORT)","$(MASTERMACS1_IP):$(MASTERMACS1_PORT)")
|
||||
masterMacsController("$(NAME)","$(ASYN_PORT)",8,0.05,0.05,0.3);
|
||||
masterMacsAxis("$(NAME)",1);
|
||||
# masterMacsAxis("$(NAME)",2);
|
||||
|
||||
epicsEnvSet("SINQDBPATH","$(masterMacs_DB)/sinqMotor.db")
|
||||
dbLoadTemplate("$(IOCDIR)/motors/$(NAME).substitutions", "INSTR=$(PVPREFIX)$(NAME):,CONTROLLER=$(NAME)")
|
||||
dbLoadTemplate("$(IOCDIR)/motors/$(NAME).substitutions", "INSTR=$(PVPREFIX):$(NAME):,CONTROLLER=$(NAME)")
|
||||
|
||||
@@ -39,6 +39,6 @@ setMaxSubsequentTimeouts("$(NAME)", 20);
|
||||
setThresholdComTimeout("$(NAME)", 100, 1);
|
||||
|
||||
epicsEnvSet("SINQDBPATH","$(turboPmac_DB)/sinqMotor.db")
|
||||
dbLoadTemplate("$(IOCDIR)/motors/$(NAME).substitutions", "INSTR=$(PVPREFIX)$(NAME):,CONTROLLER=$(NAME)")
|
||||
dbLoadTemplate("$(IOCDIR)/motors/$(NAME).substitutions", "INSTR=$(PVPREFIX):$(NAME):,CONTROLLER=$(NAME)")
|
||||
epicsEnvSet("SINQDBPATH","$(turboPmac_DB)/turboPmac.db")
|
||||
dbLoadTemplate("$(IOCDIR)/motors/$(NAME).substitutions", "INSTR=$(PVPREFIX)$(NAME):,CONTROLLER=$(NAME)")
|
||||
dbLoadTemplate("$(IOCDIR)/motors/$(NAME).substitutions", "INSTR=$(PVPREFIX):$(NAME):,CONTROLLER=$(NAME)")
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# This script is used to start the test IOC and is usually run as part of a
|
||||
# test startup procedure. It autogenerates an IOC shell script from motors.yaml
|
||||
# which contains the IP adresses and ports of the motor controllers.
|
||||
@@ -18,7 +20,7 @@ def startioc():
|
||||
|
||||
# General configuration
|
||||
out.write(
|
||||
f'epicsEnvSet("PVPREFIX"," {config["pvprefix"]})\n')
|
||||
f'epicsEnvSet("PVPREFIX", "{config["pvprefix"]}")\n')
|
||||
out.write(
|
||||
f'epicsEnvSet("IOCDIR", "{root_dir + "ioc"}" )\n')
|
||||
|
||||
@@ -36,9 +38,14 @@ def startioc():
|
||||
out.write(
|
||||
f'epicsEnvSet("MASTERMACS1_PORT", "{config["controllers"]["masterMacs1"]["port"]}")\n')
|
||||
|
||||
# Start the IOC itself
|
||||
subprocess.run(root_dir + 'ioc/startioc')
|
||||
# Start the IOC itself and keep it running in the background.
|
||||
# We need to start a new session so Pytest doesn't kill the process
|
||||
proc = subprocess.Popen([root_dir + 'ioc/startioc'], start_new_session=True)
|
||||
|
||||
print(f"Started IOC with PID {proc.pid}")
|
||||
|
||||
# Yield control back to the test
|
||||
# yield
|
||||
|
||||
if __name__ == '__main__':
|
||||
startioc()
|
||||
|
||||
@@ -11,9 +11,9 @@ require masterMacs, $(MASTERMACS_VERSION)
|
||||
|
||||
# Initialize the motors itself
|
||||
< motors/turboPmac1.cmd
|
||||
< motors/masterMacs1.cmd
|
||||
#< motors/masterMacs1.cmd
|
||||
|
||||
# Create the test record which is used to detect if the IOC is running
|
||||
dbLoadRecords("$(IOCDIR)/db/ready.db", "P=$(PVPREFIX)")
|
||||
dbLoadRecords("$(IOCDIR)/db/ready.db", "PVPREFIX=$(PVPREFIX)")
|
||||
|
||||
iocInit()
|
||||
|
||||
2
ioc/startioc
Normal file → Executable file
2
ioc/startioc
Normal file → Executable file
@@ -9,4 +9,4 @@ SCRIPT_DIR=$(dirname "$(realpath "$0")")
|
||||
cd "$SCRIPT_DIR" || exit 1
|
||||
|
||||
# Run the IOC shell script
|
||||
st.cmd
|
||||
st.cmd
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import time
|
||||
|
||||
from caproto.sync.client import read, write
|
||||
from ioc.startioc import startioc
|
||||
from ioc.pystartioc import startioc
|
||||
import pytest
|
||||
|
||||
from common import read_config
|
||||
|
||||
TIMEOUT_IOC_STARTUP = 30
|
||||
TIMEOUT_READ = 3.0
|
||||
TIMEOUT_IOC_STARTUP = 10
|
||||
TIMEOUT_READ = 2
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@@ -32,7 +32,7 @@ def prepare_ioc():
|
||||
|
||||
# Check periodically if the IOC started successfully
|
||||
now = time.time()
|
||||
while now + TIMEOUT_IOC_STARTUP < time.time():
|
||||
while now + TIMEOUT_IOC_STARTUP > time.time():
|
||||
try:
|
||||
read(f'{pvprefix}:IOCREADY', timeout=TIMEOUT_READ)
|
||||
return
|
||||
|
||||
@@ -9,7 +9,7 @@ def motor():
|
||||
config = read_config()
|
||||
return TurboPMAC(config['controllers']['turboPmac1']['ip'],
|
||||
config['controllers']['turboPmac1']['port'],
|
||||
config['pvprefix'] + 'turboPmac1:rot1')
|
||||
config['pvprefix'] + ':turboPmac1:rot1')
|
||||
|
||||
|
||||
def reset(motor):
|
||||
|
||||
Reference in New Issue
Block a user