Correct bugs in db and sets up simulation mode

This commit is contained in:
2025-09-19 14:41:41 +02:00
parent 042aeadb7c
commit 2f4e279c47
7 changed files with 183 additions and 7 deletions
+10 -1
View File
@@ -1,6 +1,15 @@
require asyn
require stream
epicsEnvSet("$(NAME)_MDIF_HOST", "$(MDIF_IP):$(MDIF_PORT=2000)")
$(SET_SIM_MODE=#) $(SET_SIM_MODE) require misc
$(SET_SIM_MODE=#) $(SET_SIM_MODE) epicsEnvSet("$(NAME)_MDIF_HOST", "127.0.0.1:$(MDIF_PORT=3004)")
$(SET_SIM_MODE=#) $(SET_SIM_MODE) system "$(mdif_DIR)mdif_sim.py $(MDIF_PORT=3004) &"
# starting the python socket seems to take a while
# and need misc to use built in sleep command
$(SET_SIM_MODE=#) $(SET_SIM_MODE) sleep 3
epicsEnvSet("PROTO", "$(mdif_DB)mdif.proto")
drvAsynIPPortConfigure("ASYN_$(NAME)", "$(HOST)", 0, 0, 0)
drvAsynIPPortConfigure("ASYN_$(NAME)", "$($(NAME)_MDIF_HOST)", 0, 0, 0)
dbLoadRecords("$(mdif_DB)mdif.db", "INSTR=$(INSTR), NAME=$(NAME), PROTO=$(PROTO), ASYN_PORT=ASYN_$(NAME)")
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
export EPICS_HOST_ARCH=linux-x86_64
export EPICS_BASE=/usr/local/epics/base-7.0.7
PARENT_PATH="$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"
exec /usr/local/bin/procServ -o -L - -f -i ^D^C 20001 "${PARENT_PATH}/sim-st.cmd"
+13
View File
@@ -0,0 +1,13 @@
#!/usr/local/bin/iocsh
on error break
require mdif, wall_e
epicsEnvSet("STREAM_PROTOCOL_PATH","./db")
epicsEnvSet("INSTR","SQ:SIM:")
epicsEnvSet("SET_SIM_MODE","") # Run Simulation Instead of Actual Interface
runScript "$(mdif_DIR)mdif.cmd" "NAME=MDIF, MDIF_IP=127.0.0.1, MDIF_PORT=3004"
iocInit()