From 6781153fb224f85fa8d292320a90d99338cb3116 Mon Sep 17 00:00:00 2001 From: Hugo Jean Ponsin Date: Tue, 28 Apr 2026 14:51:29 +0200 Subject: [PATCH] default integer --- ePowerSwitch.db | 8 ++++++++ ePowerSwitch.proto | 5 +++++ ePowerSwitch_info.db | 4 ++++ st.cmd | 10 ++++++++++ template4.substitutions | 16 ++++++++++++++++ template8.substitutions | 20 ++++++++++++++++++++ 6 files changed, 63 insertions(+) create mode 100644 ePowerSwitch.db create mode 100644 ePowerSwitch.proto create mode 100644 ePowerSwitch_info.db create mode 100644 st.cmd create mode 100644 template4.substitutions create mode 100644 template8.substitutions diff --git a/ePowerSwitch.db b/ePowerSwitch.db new file mode 100644 index 0000000..265a637 --- /dev/null +++ b/ePowerSwitch.db @@ -0,0 +1,8 @@ +record(longout, "$(DEVICE)_command_$(PARAMETER_NAME)_$(PARAMETER_ID)") { + field(DTYP, "stream") + + field(PINI, "NO") + + field(OUT, "@ePowerSwitch.proto command($(PARAMETER_ID)) $(PORT)") +} + diff --git a/ePowerSwitch.proto b/ePowerSwitch.proto new file mode 100644 index 0000000..e4c1e7e --- /dev/null +++ b/ePowerSwitch.proto @@ -0,0 +1,5 @@ +OutTerminator = "\r\n"; + +command { + out "GET /M0:O\$1=%{OFF|ON|RESTART}"; +} \ No newline at end of file diff --git a/ePowerSwitch_info.db b/ePowerSwitch_info.db new file mode 100644 index 0000000..b24a369 --- /dev/null +++ b/ePowerSwitch_info.db @@ -0,0 +1,4 @@ + +record(longout, "$(DEVICE)_config_$(PARAMETER_NAME)") { + field(VAL, "$(VALUE)") +} diff --git a/st.cmd b/st.cmd new file mode 100644 index 0000000..8381bbc --- /dev/null +++ b/st.cmd @@ -0,0 +1,10 @@ +require stream + +epicsEnvSet("ASYN_PORT","myDriverPort") + +drvAsynIPPortConfigure("$(ASYN_PORT)","127.0.0.1:55555 http", 0, 0, 0) + +dbLoadTemplate("template8.substitutions", "PORT=$(ASYN_PORT)") + +iocInit() + diff --git a/template4.substitutions b/template4.substitutions new file mode 100644 index 0000000..2486c51 --- /dev/null +++ b/template4.substitutions @@ -0,0 +1,16 @@ +file ePowerSwitch.db +{ + pattern + { DEVICE, PARAMETER_NAME, PARAMETER_ID} + { "ePowerSwitch", "outlet", 0 } + { "ePowerSwitch", "outlet", 1 } + { "ePowerSwitch", "outlet", 2 } + { "ePowerSwitch", "outlet", 3 } +} + +file ePowerSwitch_info.db +{ + pattern + {DEVICE, PARAMETER_NAME, VALUE} + { "ePowerSwitch", "maxOutlet", 4} +} \ No newline at end of file diff --git a/template8.substitutions b/template8.substitutions new file mode 100644 index 0000000..d6b2732 --- /dev/null +++ b/template8.substitutions @@ -0,0 +1,20 @@ +file ePowerSwitch.db +{ + pattern + { DEVICE, PARAMETER_NAME, PARAMETER_ID} + { "ePowerSwitch", "outlet", 0 } + { "ePowerSwitch", "outlet", 1 } + { "ePowerSwitch", "outlet", 2 } + { "ePowerSwitch", "outlet", 3 } + { "ePowerSwitch", "outlet", 4 } + { "ePowerSwitch", "outlet", 5 } + { "ePowerSwitch", "outlet", 6 } + { "ePowerSwitch", "outlet", 7 } +} + +file ePowerSwitch_info.db +{ + pattern + {DEVICE, PARAMETER_NAME, VALUE} + { "ePowerSwitch", "maxOutlet", 8} +} \ No newline at end of file