diff --git a/README.md b/README.md index e1cb491..09284bb 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,52 @@ For a device with 8 outlets ```bash $ startioc.sh 8 ``` + +# Documentation + +## Setters + +the stream device expose 4 or 8 individual setters record. + +``` +$(DEVICE)_set_$(PARAMETER_NAME)_$(PARAMETER_ID) +``` + +By default, it should look like : +``` +ePowerSwitch_get_outlet_0 +ePowerSwitch_get_outlet_1 +ePowerSwitch_get_outlet_2 +ePowerSwitch_get_outlet_3 +``` + +## Getters + +The stream device expose 4 or 8 individual getters record named : +``` +$(DEVICE)_get_$(PARAMETER_NAME)_$(PARAMETER_ID) +``` + +By default, it should look like : +``` +ePowerSwitch_set_outlet_0 +ePowerSwitch_set_outlet_1 +ePowerSwitch_set_outlet_2 +ePowerSwitch_set_outlet_3 +``` + +Furthermore, a record expose the number of socket of this device +It **should not** be overwrite + +``` +$(DEVICE)_config_$(CONFIG_PARAMETER_NAME) +``` + +By default, it should be called +``` +ePowerSwitch_config_maxOutlet +``` + # Test TODO \ No newline at end of file diff --git a/command.proto b/command.proto index 22975fa..08e0fe7 100644 --- a/command.proto +++ b/command.proto @@ -22,10 +22,10 @@ get8 { in "M0:O2=%(BB)s"; in "M0:O3=%(CC)s"; in "M0:O4=%(DD)s"; - in "M0:O1=%(EE)s"; - in "M0:O2=%(FF)s"; - in "M0:O3=%(GG)s"; - in "M0:O4=%(HH)s"; + in "M0:O5=%(EE)s"; + in "M0:O6=%(FF)s"; + in "M0:O7=%(GG)s"; + in "M0:O8=%(HH)s"; disconnect; } diff --git a/feedback_records.db b/feedback_records.db index 287174f..1743290 100644 --- a/feedback_records.db +++ b/feedback_records.db @@ -1,4 +1,4 @@ -record(longout, "$(DEVICE)_config_$(PARAMETER_NAME)") { +record(longout, "$(DEVICE)_config_$(CONFIG_PARAMETER_NAME)") { field(VAL, "$(OUTLET_NUMBER)") } @@ -6,6 +6,7 @@ record(scalcout, "$(DEVICE)_outlet_getter") { field(DTYP, "stream") field(SCAN, "1 second") field(CALC, "0") - field(OUT, "@command.proto get$(OUTLET_NUMBER)($(DEVICE)_get_$(GETTER_OUTPUT_PARAMETER_NAME)) $(PORT)") + field(OUT, "@command.proto get$(OUTLET_NUMBER)() $(PORT)") + field(FLNK, "$(DEVICE)_get_outlet_0") } diff --git a/socket_record.db b/socket_record.db index f50a974..4d04c31 100644 --- a/socket_record.db +++ b/socket_record.db @@ -8,7 +8,6 @@ record(stringout, "$(DEVICE)_set_$(PARAMETER_NAME)_$(PARAMETER_ID)") { } record(stringin, "$(DEVICE)_get_$(PARAMETER_NAME)_$(PARAMETER_ID)") { - field(PINI, "NO") - field(INP, "$(DEVICE)_outlet_getter_fanout.$(FANOUT_FIELD_NAME) NPP MS") + field(INP, "$(DEVICE)_outlet_getter.$(SCALCOUT_FIELD_INPUT) NPP MS") field(FLNK, "$(DEVICE)_get_$(PARAMETER_NAME)_$(FORWARDED_ID)") } diff --git a/startioc.sh b/startioc.sh old mode 100644 new mode 100755 index dec53b0..076a54c --- a/startioc.sh +++ b/startioc.sh @@ -1,4 +1,4 @@ -#!bin/bash +#!/bin/bash if [ $1 -eq 4 -o $1 -eq 8 ] then diff --git a/template4.substitutions b/template4.substitutions index 768e6f2..7b83096 100644 --- a/template4.substitutions +++ b/template4.substitutions @@ -1,7 +1,7 @@ file socket_record.db { pattern - { DEVICE, PARAMETER_NAME, PARAMETER_ID, FANOUT_FIELD_NAME, FORWARDED_ID} + { DEVICE, PARAMETER_NAME, PARAMETER_ID, SCALCOUT_FIELD_INPUT, FORWARDED_ID} { "ePowerSwitch", "outlet", 0, "AA", 1} { "ePowerSwitch", "outlet", 1, "BB", 2} { "ePowerSwitch", "outlet", 2, "CC", 3} @@ -11,6 +11,6 @@ file socket_record.db file feedback_records.db { pattern - {DEVICE, PARAMETER_NAME, OUTLET_NUMBER, GETTER_OUTPUT_PARAMETER_NAME} + {DEVICE, CONFIG_PARAMETER_NAME, OUTLET_NUMBER, GETTER_OUTPUT_PARAMETER_NAME} { "ePowerSwitch", "maxOutlet", 4, "outlet"} } \ No newline at end of file diff --git a/template8.substitutions b/template8.substitutions index 2c33a4d..6153a36 100644 --- a/template8.substitutions +++ b/template8.substitutions @@ -1,20 +1,20 @@ file socket_record.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 } + { DEVICE, PARAMETER_NAME, PARAMETER_ID, SCALCOUT_FIELD_INPUT, FORWARDED_ID} + { "ePowerSwitch", "outlet", 0, "AA", 1} + { "ePowerSwitch", "outlet", 1, "BB", 2} + { "ePowerSwitch", "outlet", 2, "CC", 3} + { "ePowerSwitch", "outlet", 3, "DD", 4} + { "ePowerSwitch", "outlet", 4, "EE", 5} + { "ePowerSwitch", "outlet", 5, "FF", 6} + { "ePowerSwitch", "outlet", 6, "GG", 7} + { "ePowerSwitch", "outlet", 7, "HH", 7} } file feedback_records.db { pattern - {DEVICE, PARAMETER_NAME, OUTLET_NUMBER, GETTER_OUTPUT_PARAMETER_NAME} + {DEVICE, CONFIG_PARAMETER_NAME, OUTLET_NUMBER, GETTER_OUTPUT_PARAMETER_NAME} { "ePowerSwitch", "maxOutlet", 8, "outlet"} } \ No newline at end of file