diff --git a/doc/openapi/components/schemas/config/format_obj.yaml b/doc/openapi/components/schemas/config/format_obj.yaml index 061f5898e..4d30832f2 100644 --- a/doc/openapi/components/schemas/config/format_obj.yaml +++ b/doc/openapi/components/schemas/config/format_obj.yaml @@ -5,9 +5,11 @@ type: object title: Format Object required: - type + properties: type: type: string + discriminator: propertyName: type mapping: diff --git a/doc/openapi/components/schemas/config/format_spec.yaml b/doc/openapi/components/schemas/config/format_spec.yaml index 70c56ffe4..e51bac1c6 100644 --- a/doc/openapi/components/schemas/config/format_spec.yaml +++ b/doc/openapi/components/schemas/config/format_spec.yaml @@ -4,6 +4,7 @@ description: | The payload format which is used to encode and decode exchanged messages. example: villas.human + oneOf: - $ref: format_obj.yaml - title: Format Name diff --git a/doc/openapi/components/schemas/config/hook.yaml b/doc/openapi/components/schemas/config/hook.yaml index 2f9c8a871..8049ab7a9 100644 --- a/doc/openapi/components/schemas/config/hook.yaml +++ b/doc/openapi/components/schemas/config/hook.yaml @@ -1,33 +1,17 @@ -# yaml-language-server: $schema=http://json-schema.org/draft-07/schema --- type: object -title: Hook +properties: + enabled: + type: boolean + default: true + description: An optional field which can be used to disable a hook. + + priority: + type: integer + default: 99 + description: | + The priority of this hook which determines the order in which hooks are executed. + Hooks with a lwoer priority are executed before ones with a higher priority. -discriminator: - propertyName: type - mapping: - average: hooks/average.yaml - cast: hooks/cast.yaml - decimate: hooks/decimate.yaml - dp: hooks/dp.yaml - dump: hooks/dump.yaml - ebm: hooks/ebm.yaml - fix: hooks/fix.yaml - gate: hooks/gate.yaml - jitter_calc: hooks/jitter_calc.yaml - limit_rate: hooks/limit_rate.yaml - limit_value: hooks/limit_value.yaml - lua: hooks/lua.yaml - ma: hooks/ma.yaml - pmu_dft: hooks/pmu_dft.yaml - pps_ts: hooks/pps_ts.yaml - print: hooks/print.yaml - restart: hooks/restart.yaml - rms: hooks/rms.yaml - scale: hooks/scale.yaml - shift_seq: hooks/shift_seq.yaml - shift_ts: hooks/shift_ts.yaml - skip_first: hooks/skip_first.yaml - stats: hooks/stats.yaml - ts: hooks/ts.yaml + If no priority is configured, hooks are executed in the order they are configured in the configuration file. diff --git a/doc/openapi/components/schemas/config/hook_multi.yaml b/doc/openapi/components/schemas/config/hook_multi.yaml new file mode 100644 index 000000000..b7b83cb64 --- /dev/null +++ b/doc/openapi/components/schemas/config/hook_multi.yaml @@ -0,0 +1,18 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +--- + +allOf: +- type: object + properties: + signals: + type: array + description: A list of signal names to which this hook should be applied + example: + - busA.V + - busB.V + - busC.V + items: + type: string + description: The name of a signal to which this hook should be applied + +- $ref: ./hook.yaml diff --git a/doc/openapi/components/schemas/config/hook_obj.yaml b/doc/openapi/components/schemas/config/hook_obj.yaml index 4adb351a8..240e23f44 100644 --- a/doc/openapi/components/schemas/config/hook_obj.yaml +++ b/doc/openapi/components/schemas/config/hook_obj.yaml @@ -2,12 +2,14 @@ --- type: object -title: Format Object +title: Hook Object required: - type + properties: type: type: string + discriminator: propertyName: type mapping: diff --git a/doc/openapi/components/schemas/config/hook_single.yaml b/doc/openapi/components/schemas/config/hook_single.yaml new file mode 100644 index 000000000..1090813ff --- /dev/null +++ b/doc/openapi/components/schemas/config/hook_single.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +--- + +allOf: +- type: object + properties: + signal: + type: string + description: The name of a signal to which this hook should be applied + example: busA.V + +- $ref: ./hook.yaml diff --git a/doc/openapi/components/schemas/config/hook_spec.yaml b/doc/openapi/components/schemas/config/hook_spec.yaml index 0f6f4774f..fc566d688 100644 --- a/doc/openapi/components/schemas/config/hook_spec.yaml +++ b/doc/openapi/components/schemas/config/hook_spec.yaml @@ -1,6 +1,10 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema --- +description: | + Hooks form a pipeline of steps which process, filter or alter sample data. +example: print + oneOf: - $ref: hook_obj.yaml - title: Hook Name diff --git a/doc/openapi/components/schemas/config/hooks/_average.yaml b/doc/openapi/components/schemas/config/hooks/_average.yaml index e848e4839..d0e2011a8 100644 --- a/doc/openapi/components/schemas/config/hooks/_average.yaml +++ b/doc/openapi/components/schemas/config/hooks/_average.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: average.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_cast.yaml b/doc/openapi/components/schemas/config/hooks/_cast.yaml index 2b73b32ab..25d4ff2ab 100644 --- a/doc/openapi/components/schemas/config/hooks/_cast.yaml +++ b/doc/openapi/components/schemas/config/hooks/_cast.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: cast.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_decimate.yaml b/doc/openapi/components/schemas/config/hooks/_decimate.yaml index 163801932..a0919b2ee 100644 --- a/doc/openapi/components/schemas/config/hooks/_decimate.yaml +++ b/doc/openapi/components/schemas/config/hooks/_decimate.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: decimate.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_dp.yaml b/doc/openapi/components/schemas/config/hooks/_dp.yaml index 9d643a4b8..573ad0d7b 100644 --- a/doc/openapi/components/schemas/config/hooks/_dp.yaml +++ b/doc/openapi/components/schemas/config/hooks/_dp.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: dp.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_drop.yaml b/doc/openapi/components/schemas/config/hooks/_drop.yaml index a9fd5fa4b..d251e88e3 100644 --- a/doc/openapi/components/schemas/config/hooks/_drop.yaml +++ b/doc/openapi/components/schemas/config/hooks/_drop.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: drop.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_dump.yaml b/doc/openapi/components/schemas/config/hooks/_dump.yaml index 73418c3c4..f5fcdbc8d 100644 --- a/doc/openapi/components/schemas/config/hooks/_dump.yaml +++ b/doc/openapi/components/schemas/config/hooks/_dump.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: dump.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_ebm.yaml b/doc/openapi/components/schemas/config/hooks/_ebm.yaml index 7db41f65f..db125d977 100644 --- a/doc/openapi/components/schemas/config/hooks/_ebm.yaml +++ b/doc/openapi/components/schemas/config/hooks/_ebm.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: ebm.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_fix.yaml b/doc/openapi/components/schemas/config/hooks/_fix.yaml index 7f43b917b..4ef520298 100644 --- a/doc/openapi/components/schemas/config/hooks/_fix.yaml +++ b/doc/openapi/components/schemas/config/hooks/_fix.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: fix.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_gate.yaml b/doc/openapi/components/schemas/config/hooks/_gate.yaml index 09c045d64..4c14ce308 100644 --- a/doc/openapi/components/schemas/config/hooks/_gate.yaml +++ b/doc/openapi/components/schemas/config/hooks/_gate.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: gate.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_jitter_calc.yaml b/doc/openapi/components/schemas/config/hooks/_jitter_calc.yaml index 02694ea4e..2a4e5ce8a 100644 --- a/doc/openapi/components/schemas/config/hooks/_jitter_calc.yaml +++ b/doc/openapi/components/schemas/config/hooks/_jitter_calc.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: jitter_calc.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_limit_rate.yaml b/doc/openapi/components/schemas/config/hooks/_limit_rate.yaml index c40f4d97b..298b6a6cb 100644 --- a/doc/openapi/components/schemas/config/hooks/_limit_rate.yaml +++ b/doc/openapi/components/schemas/config/hooks/_limit_rate.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: limit_rate.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_limit_value.yaml b/doc/openapi/components/schemas/config/hooks/_limit_value.yaml index 0de11fa5c..2212ad325 100644 --- a/doc/openapi/components/schemas/config/hooks/_limit_value.yaml +++ b/doc/openapi/components/schemas/config/hooks/_limit_value.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: limit_value.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_lua.yaml b/doc/openapi/components/schemas/config/hooks/_lua.yaml index ab2c32cd8..ac3ba59ce 100644 --- a/doc/openapi/components/schemas/config/hooks/_lua.yaml +++ b/doc/openapi/components/schemas/config/hooks/_lua.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: lua.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_ma.yaml b/doc/openapi/components/schemas/config/hooks/_ma.yaml index 8d0f02eb3..56e8fc95b 100644 --- a/doc/openapi/components/schemas/config/hooks/_ma.yaml +++ b/doc/openapi/components/schemas/config/hooks/_ma.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: ma.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_pmu_dft.yaml b/doc/openapi/components/schemas/config/hooks/_pmu_dft.yaml index acb5826ae..73d4a4c78 100644 --- a/doc/openapi/components/schemas/config/hooks/_pmu_dft.yaml +++ b/doc/openapi/components/schemas/config/hooks/_pmu_dft.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: pmu_dft.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_pps_ts.yaml b/doc/openapi/components/schemas/config/hooks/_pps_ts.yaml index abf278bcb..7aedb280f 100644 --- a/doc/openapi/components/schemas/config/hooks/_pps_ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/_pps_ts.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: pps_ts.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_print.yaml b/doc/openapi/components/schemas/config/hooks/_print.yaml index 78b4b03a0..4d74fbc20 100644 --- a/doc/openapi/components/schemas/config/hooks/_print.yaml +++ b/doc/openapi/components/schemas/config/hooks/_print.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: print.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_restart.yaml b/doc/openapi/components/schemas/config/hooks/_restart.yaml index 11fdabf02..a7f74c120 100644 --- a/doc/openapi/components/schemas/config/hooks/_restart.yaml +++ b/doc/openapi/components/schemas/config/hooks/_restart.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: restart.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_rms.yaml b/doc/openapi/components/schemas/config/hooks/_rms.yaml index 40e60d993..d16d9295c 100644 --- a/doc/openapi/components/schemas/config/hooks/_rms.yaml +++ b/doc/openapi/components/schemas/config/hooks/_rms.yaml @@ -1,5 +1,5 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: rms.yaml - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/_round.yaml b/doc/openapi/components/schemas/config/hooks/_round.yaml index 08a4c4631..04f1796fc 100644 --- a/doc/openapi/components/schemas/config/hooks/_round.yaml +++ b/doc/openapi/components/schemas/config/hooks/_round.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: round.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_scale.yaml b/doc/openapi/components/schemas/config/hooks/_scale.yaml index a4bfc86dd..190c37418 100644 --- a/doc/openapi/components/schemas/config/hooks/_scale.yaml +++ b/doc/openapi/components/schemas/config/hooks/_scale.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: scale.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_shift_seq.yaml b/doc/openapi/components/schemas/config/hooks/_shift_seq.yaml index 0ff3e9e4b..13065120c 100644 --- a/doc/openapi/components/schemas/config/hooks/_shift_seq.yaml +++ b/doc/openapi/components/schemas/config/hooks/_shift_seq.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: shift_seq.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_shift_ts.yaml b/doc/openapi/components/schemas/config/hooks/_shift_ts.yaml index 71e192590..d260b165f 100644 --- a/doc/openapi/components/schemas/config/hooks/_shift_ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/_shift_ts.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: shift_ts.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_skip_first.yaml b/doc/openapi/components/schemas/config/hooks/_skip_first.yaml index b5f664802..dd51e8018 100644 --- a/doc/openapi/components/schemas/config/hooks/_skip_first.yaml +++ b/doc/openapi/components/schemas/config/hooks/_skip_first.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: skip_first.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_stats.yaml b/doc/openapi/components/schemas/config/hooks/_stats.yaml index 5b2f01830..061528214 100644 --- a/doc/openapi/components/schemas/config/hooks/_stats.yaml +++ b/doc/openapi/components/schemas/config/hooks/_stats.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: stats.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_ts.yaml b/doc/openapi/components/schemas/config/hooks/_ts.yaml index 96a0b72db..f9e438fc5 100644 --- a/doc/openapi/components/schemas/config/hooks/_ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/_ts.yaml @@ -1,3 +1,3 @@ allOf: -- $ref: common.yaml +- $ref: ../hook_obj.yaml - $ref: ts.yaml diff --git a/doc/openapi/components/schemas/config/hooks/average.yaml b/doc/openapi/components/schemas/config/hooks/average.yaml index f7109594a..b772292ec 100644 --- a/doc/openapi/components/schemas/config/hooks/average.yaml +++ b/doc/openapi/components/schemas/config/hooks/average.yaml @@ -15,5 +15,4 @@ allOf: - `0` inserts the averaged signal before all other signals in the sample - `1` inserts the averaged signal after the first signal. -- $ref: common.yaml -- $ref: multi.yaml +- $ref: ../hook_multi.yaml diff --git a/doc/openapi/components/schemas/config/hooks/cast.yaml b/doc/openapi/components/schemas/config/hooks/cast.yaml index 7304d19e5..0c01489e0 100644 --- a/doc/openapi/components/schemas/config/hooks/cast.yaml +++ b/doc/openapi/components/schemas/config/hooks/cast.yaml @@ -22,5 +22,4 @@ allOf: description: The new unit of the casted signal. example: V -- $ref: common.yaml -- $ref: multi.yaml +- $ref: ../hook_multi.yaml diff --git a/doc/openapi/components/schemas/config/hooks/common.yaml b/doc/openapi/components/schemas/config/hooks/common.yaml deleted file mode 100644 index 8049ab7a9..000000000 --- a/doc/openapi/components/schemas/config/hooks/common.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- - -type: object -properties: - enabled: - type: boolean - default: true - description: An optional field which can be used to disable a hook. - - priority: - type: integer - default: 99 - description: | - The priority of this hook which determines the order in which hooks are executed. - Hooks with a lwoer priority are executed before ones with a higher priority. - - If no priority is configured, hooks are executed in the order they are configured in the configuration file. diff --git a/doc/openapi/components/schemas/config/hooks/decimate.yaml b/doc/openapi/components/schemas/config/hooks/decimate.yaml index 1212a0fc7..c7cb8dc37 100644 --- a/doc/openapi/components/schemas/config/hooks/decimate.yaml +++ b/doc/openapi/components/schemas/config/hooks/decimate.yaml @@ -11,4 +11,4 @@ allOf: description: The decimation ratio. A value of 4 will skip every, but the 4th sample in a row. example: 4 -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/dp.yaml b/doc/openapi/components/schemas/config/hooks/dp.yaml index 73f21c65d..2be619f38 100644 --- a/doc/openapi/components/schemas/config/hooks/dp.yaml +++ b/doc/openapi/components/schemas/config/hooks/dp.yaml @@ -29,5 +29,4 @@ allOf: type: boolean default: false -- $ref: common.yaml -- $ref: single.yaml +- $ref: ../hook_single.yaml diff --git a/doc/openapi/components/schemas/config/hooks/drop.yaml b/doc/openapi/components/schemas/config/hooks/drop.yaml index 5af5e9214..4783a3b94 100644 --- a/doc/openapi/components/schemas/config/hooks/drop.yaml +++ b/doc/openapi/components/schemas/config/hooks/drop.yaml @@ -2,4 +2,4 @@ --- allOf: -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/dump.yaml b/doc/openapi/components/schemas/config/hooks/dump.yaml index 5af5e9214..4783a3b94 100644 --- a/doc/openapi/components/schemas/config/hooks/dump.yaml +++ b/doc/openapi/components/schemas/config/hooks/dump.yaml @@ -2,4 +2,4 @@ --- allOf: -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/ebm.yaml b/doc/openapi/components/schemas/config/hooks/ebm.yaml index 283541187..dd32cd440 100644 --- a/doc/openapi/components/schemas/config/hooks/ebm.yaml +++ b/doc/openapi/components/schemas/config/hooks/ebm.yaml @@ -20,4 +20,4 @@ allOf: items: type: integer -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/fix.yaml b/doc/openapi/components/schemas/config/hooks/fix.yaml index 5af5e9214..4783a3b94 100644 --- a/doc/openapi/components/schemas/config/hooks/fix.yaml +++ b/doc/openapi/components/schemas/config/hooks/fix.yaml @@ -2,4 +2,4 @@ --- allOf: -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/gate.yaml b/doc/openapi/components/schemas/config/hooks/gate.yaml index 3350381d9..24b30a12c 100644 --- a/doc/openapi/components/schemas/config/hooks/gate.yaml +++ b/doc/openapi/components/schemas/config/hooks/gate.yaml @@ -24,5 +24,4 @@ allOf: description: The number if samples for which the gate opens when the triggering condition is met. Exclusive with the `duration` setting. type: number -- $ref: common.yaml -- $ref: single.yaml +- $ref: ../hook_single.yaml diff --git a/doc/openapi/components/schemas/config/hooks/jitter_calc.yaml b/doc/openapi/components/schemas/config/hooks/jitter_calc.yaml index 5af5e9214..4783a3b94 100644 --- a/doc/openapi/components/schemas/config/hooks/jitter_calc.yaml +++ b/doc/openapi/components/schemas/config/hooks/jitter_calc.yaml @@ -2,4 +2,4 @@ --- allOf: -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/limit_rate.yaml b/doc/openapi/components/schemas/config/hooks/limit_rate.yaml index bcbe7da87..a3bb32f0e 100644 --- a/doc/openapi/components/schemas/config/hooks/limit_rate.yaml +++ b/doc/openapi/components/schemas/config/hooks/limit_rate.yaml @@ -18,4 +18,4 @@ allOf: - received - origin -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/limit_value.yaml b/doc/openapi/components/schemas/config/hooks/limit_value.yaml index 7fed40b98..37ccd0f97 100644 --- a/doc/openapi/components/schemas/config/hooks/limit_value.yaml +++ b/doc/openapi/components/schemas/config/hooks/limit_value.yaml @@ -14,5 +14,4 @@ allOf: description: The largest value which will pass through the hook before getting clipped. type: number -- $ref: common.yaml -- $ref: multi.yaml +- $ref: ../hook_multi.yaml diff --git a/doc/openapi/components/schemas/config/hooks/lua.yaml b/doc/openapi/components/schemas/config/hooks/lua.yaml index b44286f68..2df69eb42 100644 --- a/doc/openapi/components/schemas/config/hooks/lua.yaml +++ b/doc/openapi/components/schemas/config/hooks/lua.yaml @@ -77,6 +77,6 @@ allOf: description: | An arbitrary Lua expression which will be evaluated and used for the value of the signal. Note you can access the current sample using the global Lua variable `smp`. - - $ref: ../signal_spec.yaml + # - $ref: ../signal_spec.yaml -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/ma.yaml b/doc/openapi/components/schemas/config/hooks/ma.yaml index 963c66142..4325c880b 100644 --- a/doc/openapi/components/schemas/config/hooks/ma.yaml +++ b/doc/openapi/components/schemas/config/hooks/ma.yaml @@ -11,5 +11,4 @@ allOf: default: 0 minimum: 0 -- $ref: common.yaml -- $ref: multi.yaml +- $ref: ../hook_multi.yaml diff --git a/doc/openapi/components/schemas/config/hooks/multi.yaml b/doc/openapi/components/schemas/config/hooks/multi.yaml deleted file mode 100644 index 3d84bc49f..000000000 --- a/doc/openapi/components/schemas/config/hooks/multi.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# yaml-language-server: $schema=http://json-schema.org/draft-07/schema ---- - -type: object -properties: - signals: - type: array - description: A list of signal names to which this hook should be applied - example: - - busA.V - - busB.V - - busC.V - items: - type: string - description: The name of a signal to which this hook should be applied diff --git a/doc/openapi/components/schemas/config/hooks/pmu_dft.yaml b/doc/openapi/components/schemas/config/hooks/pmu_dft.yaml index bc7c905f1..15c981a56 100644 --- a/doc/openapi/components/schemas/config/hooks/pmu_dft.yaml +++ b/doc/openapi/components/schemas/config/hooks/pmu_dft.yaml @@ -105,5 +105,4 @@ allOf: example: 1.0 description: An offset added to the calculated RoCoF. This setting does not really make sense but is available for completeness reasons" -- $ref: common.yaml -- $ref: multi.yaml +- $ref: ../hook_multi.yaml diff --git a/doc/openapi/components/schemas/config/hooks/pps_ts.yaml b/doc/openapi/components/schemas/config/hooks/pps_ts.yaml index e8d860a92..7660280ef 100644 --- a/doc/openapi/components/schemas/config/hooks/pps_ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/pps_ts.yaml @@ -27,5 +27,4 @@ allOf: type: integer default: 10 -- $ref: common.yaml -- $ref: single.yaml +- $ref: ../hook_single.yaml diff --git a/doc/openapi/components/schemas/config/hooks/print.yaml b/doc/openapi/components/schemas/config/hooks/print.yaml index 6ec8f3ee2..df1cff11c 100644 --- a/doc/openapi/components/schemas/config/hooks/print.yaml +++ b/doc/openapi/components/schemas/config/hooks/print.yaml @@ -15,4 +15,4 @@ allOf: default: '' description: An optional prefix which will be prepended to each line written by this hook to the output -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/restart.yaml b/doc/openapi/components/schemas/config/hooks/restart.yaml index e164e66ef..0c99bd84b 100644 --- a/doc/openapi/components/schemas/config/hooks/restart.yaml +++ b/doc/openapi/components/schemas/config/hooks/restart.yaml @@ -2,5 +2,5 @@ --- allOf: -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/rms.yaml b/doc/openapi/components/schemas/config/hooks/rms.yaml index 963c66142..4325c880b 100644 --- a/doc/openapi/components/schemas/config/hooks/rms.yaml +++ b/doc/openapi/components/schemas/config/hooks/rms.yaml @@ -11,5 +11,4 @@ allOf: default: 0 minimum: 0 -- $ref: common.yaml -- $ref: multi.yaml +- $ref: ../hook_multi.yaml diff --git a/doc/openapi/components/schemas/config/hooks/round.yaml b/doc/openapi/components/schemas/config/hooks/round.yaml index fc5050e36..050e191fc 100644 --- a/doc/openapi/components/schemas/config/hooks/round.yaml +++ b/doc/openapi/components/schemas/config/hooks/round.yaml @@ -10,5 +10,4 @@ allOf: example: 4 description: The number of decimal digits to which the singal is rounded. -- $ref: common.yaml -- $ref: multi.yaml +- $ref: ../hook_multi.yaml diff --git a/doc/openapi/components/schemas/config/hooks/scale.yaml b/doc/openapi/components/schemas/config/hooks/scale.yaml index 2ae217d55..d38bf9dd2 100644 --- a/doc/openapi/components/schemas/config/hooks/scale.yaml +++ b/doc/openapi/components/schemas/config/hooks/scale.yaml @@ -15,5 +15,4 @@ allOf: example: 1e3 description: The gain which is mulitplied to the signal before the offset is added. -- $ref: common.yaml -- $ref: multi.yaml +- $ref: ../hook_multi.yaml diff --git a/doc/openapi/components/schemas/config/hooks/shift_seq.yaml b/doc/openapi/components/schemas/config/hooks/shift_seq.yaml index a92430a07..387ac0500 100644 --- a/doc/openapi/components/schemas/config/hooks/shift_seq.yaml +++ b/doc/openapi/components/schemas/config/hooks/shift_seq.yaml @@ -10,4 +10,4 @@ allOf: type: integer description: The offset which is added to the sequence number of each processed sample. -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/shift_ts.yaml b/doc/openapi/components/schemas/config/hooks/shift_ts.yaml index e39d9851d..2881cbe10 100644 --- a/doc/openapi/components/schemas/config/hooks/shift_ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/shift_ts.yaml @@ -16,4 +16,4 @@ allOf: type: number description: The offset in seconds which is added to the timestamp field of each processed sample. -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/single.yaml b/doc/openapi/components/schemas/config/hooks/single.yaml deleted file mode 100644 index 9679bd67a..000000000 --- a/doc/openapi/components/schemas/config/hooks/single.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# yaml-language-server: $schema=http://json-schema.org/draft-07/schema ---- - -type: object -properties: - signal: - type: string - description: The name of a signal to which this hook should be applied - example: busA.V diff --git a/doc/openapi/components/schemas/config/hooks/skip_first.yaml b/doc/openapi/components/schemas/config/hooks/skip_first.yaml index 6a2e793da..84a1f05f2 100644 --- a/doc/openapi/components/schemas/config/hooks/skip_first.yaml +++ b/doc/openapi/components/schemas/config/hooks/skip_first.yaml @@ -11,4 +11,4 @@ allOf: type: number description: The number of seconds for which this hook should initially drop samples after a start or restart of the node/path. -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/stats.yaml b/doc/openapi/components/schemas/config/hooks/stats.yaml index a2d933fbd..8da13d0d4 100644 --- a/doc/openapi/components/schemas/config/hooks/stats.yaml +++ b/doc/openapi/components/schemas/config/hooks/stats.yaml @@ -23,4 +23,4 @@ allOf: description: The file where you want to write the report to. If omitted, stdout (the terminal) will be used. default: '/dev/stdout' -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/ts.yaml b/doc/openapi/components/schemas/config/hooks/ts.yaml index 5af5e9214..4783a3b94 100644 --- a/doc/openapi/components/schemas/config/hooks/ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/ts.yaml @@ -2,4 +2,4 @@ --- allOf: -- $ref: common.yaml +- $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/node.yaml b/doc/openapi/components/schemas/config/node.yaml index 1bb464269..d6ee16c2d 100644 --- a/doc/openapi/components/schemas/config/node.yaml +++ b/doc/openapi/components/schemas/config/node.yaml @@ -31,9 +31,6 @@ properties: type: integer minimum: 1 - signals: - $ref: signal_list.yaml - hooks: $ref: hook_list.yaml @@ -45,26 +42,5 @@ properties: vectorize: type: integer - signals: - type: array - title: List of signals send out to this node - description: | - The outgoing signal list is determined and runtime an must not be provided by the user configuration. - - example: - - name: tap_position - type: integer - init: 0 - - name: voltage - type: float - unit: V - init: 230.0 - - items: - $ref: signal_spec.yaml - hooks: $ref: hook_list.yaml - - netem: - $ref: netem.yaml diff --git a/doc/openapi/components/schemas/config/node_obj.yaml b/doc/openapi/components/schemas/config/node_obj.yaml index a10b44f81..3ed26c84d 100644 --- a/doc/openapi/components/schemas/config/node_obj.yaml +++ b/doc/openapi/components/schemas/config/node_obj.yaml @@ -14,14 +14,16 @@ properties: For a complete list of supported node-types run `villas node --help`. In addition to the node settings described in this section, every node type has its own specific settings + discriminator: propertyName: type mapping: - api: nodes/_api.yaml amqp: nodes/_amqp.yaml + api: nodes/_api.yaml can: nodes/_can.yaml comedi: nodes/_comedi.yaml ethercat: nodes/_ethercat.yaml + example: nodes/_example.yaml exec: nodes/_exec.yaml file: nodes/_file.yaml fpga: nodes/_fpga.yaml @@ -38,8 +40,8 @@ discriminator: redis: nodes/_redis.yaml rtp: nodes/_rtp.yaml shmem: nodes/_shmem.yaml - signal.v2: nodes/_signal_v2.yaml - signal: nodes/_signal.yaml + signal.v2: nodes/_signal_v2_node.yaml + signal: nodes/_signal_node.yaml socket: nodes/_socket.yaml stats_node: nodes/_stats_node.yaml temper: nodes/_temper.yaml diff --git a/doc/openapi/components/schemas/config/node_signals.yaml b/doc/openapi/components/schemas/config/node_signals.yaml new file mode 100644 index 000000000..db4ac7dbd --- /dev/null +++ b/doc/openapi/components/schemas/config/node_signals.yaml @@ -0,0 +1,10 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +--- + +type: object +properties: + in: + type: object + properties: + signals: + $ref: ./signal_list.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_can.yaml b/doc/openapi/components/schemas/config/nodes/_can.yaml index c079b6202..79a0caa67 100644 --- a/doc/openapi/components/schemas/config/nodes/_can.yaml +++ b/doc/openapi/components/schemas/config/nodes/_can.yaml @@ -1,3 +1,3 @@ allOf: - $ref: ../node_obj.yaml -- $ref: _amqp.yaml +- $ref: can.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_signal_v2.yaml b/doc/openapi/components/schemas/config/nodes/_signal_node.yaml similarity index 56% rename from doc/openapi/components/schemas/config/nodes/_signal_v2.yaml rename to doc/openapi/components/schemas/config/nodes/_signal_node.yaml index 1ba44c092..1f2be236b 100644 --- a/doc/openapi/components/schemas/config/nodes/_signal_v2.yaml +++ b/doc/openapi/components/schemas/config/nodes/_signal_node.yaml @@ -1,3 +1,3 @@ allOf: - $ref: ../node_obj.yaml -- $ref: signal_v2.yaml +- $ref: signal_node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_signal.yaml b/doc/openapi/components/schemas/config/nodes/_signal_v2_node.yaml similarity index 53% rename from doc/openapi/components/schemas/config/nodes/_signal.yaml rename to doc/openapi/components/schemas/config/nodes/_signal_v2_node.yaml index 42a262276..414c2a3e9 100644 --- a/doc/openapi/components/schemas/config/nodes/_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/_signal_v2_node.yaml @@ -1,3 +1,3 @@ allOf: - $ref: ../node_obj.yaml -- $ref: signal.yaml +- $ref: signal_v2_node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/amqp.yaml b/doc/openapi/components/schemas/config/nodes/amqp.yaml index 8b75901b6..3c0175398 100644 --- a/doc/openapi/components/schemas/config/nodes/amqp.yaml +++ b/doc/openapi/components/schemas/config/nodes/amqp.yaml @@ -45,4 +45,5 @@ allOf: client_key: default: "/path/to/client.key" +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/api.yaml b/doc/openapi/components/schemas/config/nodes/api.yaml index 213ae54b5..c682fdd04 100644 --- a/doc/openapi/components/schemas/config/nodes/api.yaml +++ b/doc/openapi/components/schemas/config/nodes/api.yaml @@ -11,4 +11,5 @@ allOf: curl http://localhost:80/api/v2/universal/api_node_name/config ``` +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/can.yaml b/doc/openapi/components/schemas/config/nodes/can.yaml index 4db03c7e4..1ac7b73e8 100644 --- a/doc/openapi/components/schemas/config/nodes/can.yaml +++ b/doc/openapi/components/schemas/config/nodes/can.yaml @@ -14,7 +14,7 @@ allOf: signals: type: array items: - $ref: ./signals/can.yaml + $ref: ./signals/can_signal.yaml out: type: object @@ -22,6 +22,6 @@ allOf: signals: type: array items: - $$ref: ./signals/can.yaml + $$ref: ./signals/can_signal.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/comedi.yaml b/doc/openapi/components/schemas/config/nodes/comedi.yaml index 5de261876..e144771cd 100644 --- a/doc/openapi/components/schemas/config/nodes/comedi.yaml +++ b/doc/openapi/components/schemas/config/nodes/comedi.yaml @@ -18,22 +18,10 @@ allOf: signals: type: array items: - type: object - required: - - channel - - range - - aref - properties: - channel: - type: integer - - range: - type: integer - - aref: - type: integer + $ref: ./signals/comedi_signal.yaml rate: type: integer +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/ethercat.yaml b/doc/openapi/components/schemas/config/nodes/ethercat.yaml index 38c201671..eb7b79203 100644 --- a/doc/openapi/components/schemas/config/nodes/ethercat.yaml +++ b/doc/openapi/components/schemas/config/nodes/ethercat.yaml @@ -37,4 +37,5 @@ allOf: vendor_id: type: integer +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/example.yaml b/doc/openapi/components/schemas/config/nodes/example.yaml index afadb5bdb..33e14d720 100644 --- a/doc/openapi/components/schemas/config/nodes/example.yaml +++ b/doc/openapi/components/schemas/config/nodes/example.yaml @@ -18,4 +18,5 @@ allOf: default: something description: Another setting +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/exec.yaml b/doc/openapi/components/schemas/config/nodes/exec.yaml index c2d7058ac..44491bdd7 100644 --- a/doc/openapi/components/schemas/config/nodes/exec.yaml +++ b/doc/openapi/components/schemas/config/nodes/exec.yaml @@ -45,4 +45,5 @@ allOf: description: | A object of key/value pairs of environment variables which should be passed to the sub-process in addition to the parent environment. +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/file.yaml b/doc/openapi/components/schemas/config/nodes/file.yaml index 1061b67db..167288eb2 100644 --- a/doc/openapi/components/schemas/config/nodes/file.yaml +++ b/doc/openapi/components/schemas/config/nodes/file.yaml @@ -116,4 +116,5 @@ allOf: If `out.buffer_size = 0`, no buffer will be generated. +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/fpga.yaml b/doc/openapi/components/schemas/config/nodes/fpga.yaml index 921e240e8..a571d19c9 100644 --- a/doc/openapi/components/schemas/config/nodes/fpga.yaml +++ b/doc/openapi/components/schemas/config/nodes/fpga.yaml @@ -7,4 +7,5 @@ allOf: format: $ref: ../format_spec.yaml +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/iec61850-8-1.yaml b/doc/openapi/components/schemas/config/nodes/iec61850-8-1.yaml index d15f2c785..cf240f99d 100644 --- a/doc/openapi/components/schemas/config/nodes/iec61850-8-1.yaml +++ b/doc/openapi/components/schemas/config/nodes/iec61850-8-1.yaml @@ -2,59 +2,5 @@ --- allOf: -- type: object - required: - - interface - properties: - in: - type: object - properties: - signals: - type: array - items: - $ref: ./signals/iec61850.yaml - - out: - type: object - properties: - required: - - signals - - svid - signals: - type: array - items: - $ref: ./signals/iec61850.yaml - - svid: - type: string - - confrev: - type: integer - - smpmod: - type: string - enum: - - per_nominal_period - - samples_per_second - - seconds_per_sample - - smprate: - type: integer - - vlan_id: - type: integer - - vlan_priority: - type: integer - - interface: - type: string - description: Name of network interface to/from which this node will publish/subscribe for SV frames. - - app_id: - type: integer - - dst_address: - type: string - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/iec61850-9-2.yaml b/doc/openapi/components/schemas/config/nodes/iec61850-9-2.yaml index 921e240e8..0c0e24ba6 100644 --- a/doc/openapi/components/schemas/config/nodes/iec61850-9-2.yaml +++ b/doc/openapi/components/schemas/config/nodes/iec61850-9-2.yaml @@ -3,8 +3,58 @@ allOf: - type: object + required: + - interface properties: - format: - $ref: ../format_spec.yaml + in: + type: object + properties: + signals: + type: array + items: + $ref: ./signals/iec61850_signal.yaml + + out: + type: object + required: + - signals + - svid + properties: + signals: + type: array + items: + $ref: ./signals/iec61850_signal.yaml + + svid: + type: string + + confrev: + type: integer + + smpmod: + type: string + enum: + - per_nominal_period + - samples_per_second + - seconds_per_sample + + smprate: + type: integer + + vlan_id: + type: integer + + vlan_priority: + type: integer + + interface: + type: string + description: Name of network interface to/from which this node will publish/subscribe for SV frames. + + app_id: + type: integer + + dst_address: + type: string - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/infiniband.yaml b/doc/openapi/components/schemas/config/nodes/infiniband.yaml index 3119ca17a..8bad27f1f 100644 --- a/doc/openapi/components/schemas/config/nodes/infiniband.yaml +++ b/doc/openapi/components/schemas/config/nodes/infiniband.yaml @@ -192,4 +192,5 @@ allOf: It turns out that the ideal value in most cases is `out.max_wrs / 2`. Hence, usually, it is not necessary to explicitly set this value. +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/influxdb.yaml b/doc/openapi/components/schemas/config/nodes/influxdb.yaml index 69387e327..65f94469f 100644 --- a/doc/openapi/components/schemas/config/nodes/influxdb.yaml +++ b/doc/openapi/components/schemas/config/nodes/influxdb.yaml @@ -15,4 +15,5 @@ allOf: See also: [InfluxDB documentation](https://docs.influxdata.com/influxdb/v0.9/write_protocols/line/#key). +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/kafka.yaml b/doc/openapi/components/schemas/config/nodes/kafka.yaml index 0f2ec9476..1b132a8e5 100644 --- a/doc/openapi/components/schemas/config/nodes/kafka.yaml +++ b/doc/openapi/components/schemas/config/nodes/kafka.yaml @@ -75,4 +75,5 @@ allOf: description: A timeout in seconds for the broker connection. default: 1.0 +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/loopback.yaml b/doc/openapi/components/schemas/config/nodes/loopback.yaml index 58e57b20e..c4d7a1aea 100644 --- a/doc/openapi/components/schemas/config/nodes/loopback.yaml +++ b/doc/openapi/components/schemas/config/nodes/loopback.yaml @@ -26,4 +26,5 @@ allOf: default: auto description: Specify the synchronization mode of the internal queue. +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/mqtt.yaml b/doc/openapi/components/schemas/config/nodes/mqtt.yaml index ba3ae8cbc..a57f4c0cc 100644 --- a/doc/openapi/components/schemas/config/nodes/mqtt.yaml +++ b/doc/openapi/components/schemas/config/nodes/mqtt.yaml @@ -109,4 +109,5 @@ allOf: For openssl >= 1.0.1, the available options are tlsv1.2, tlsv1.1 and tlsv1, with tlv1.2 as the default. For openssl < 1.0.1, only tlsv1 is available. +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/nanomsg.yaml b/doc/openapi/components/schemas/config/nodes/nanomsg.yaml index 5151b7b62..2f569f17e 100644 --- a/doc/openapi/components/schemas/config/nodes/nanomsg.yaml +++ b/doc/openapi/components/schemas/config/nodes/nanomsg.yaml @@ -27,4 +27,11 @@ allOf: type: string format: uri + out: + type: object + properties: + netem: + $ref: ../netem.yaml + +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/ngsi.yaml b/doc/openapi/components/schemas/config/nodes/ngsi.yaml index 594c8cf3f..e2698bd74 100644 --- a/doc/openapi/components/schemas/config/nodes/ngsi.yaml +++ b/doc/openapi/components/schemas/config/nodes/ngsi.yaml @@ -23,4 +23,5 @@ allOf: timeout: type: number +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/opal.yaml b/doc/openapi/components/schemas/config/nodes/opal.yaml index fcf95f62e..1ef2044fd 100644 --- a/doc/openapi/components/schemas/config/nodes/opal.yaml +++ b/doc/openapi/components/schemas/config/nodes/opal.yaml @@ -13,4 +13,5 @@ allOf: reply: type: boolean +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/redis.yaml b/doc/openapi/components/schemas/config/nodes/redis.yaml index a1a80d1d1..2022b161f 100644 --- a/doc/openapi/components/schemas/config/nodes/redis.yaml +++ b/doc/openapi/components/schemas/config/nodes/redis.yaml @@ -125,4 +125,5 @@ allOf: type: string description: A path to the private key file. +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/rtp.yaml b/doc/openapi/components/schemas/config/nodes/rtp.yaml index 68c6eed92..5d2f68fc9 100644 --- a/doc/openapi/components/schemas/config/nodes/rtp.yaml +++ b/doc/openapi/components/schemas/config/nodes/rtp.yaml @@ -53,4 +53,5 @@ allOf: netem: $ref: ../netem.yaml +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/shmem.yaml b/doc/openapi/components/schemas/config/nodes/shmem.yaml index 91d403acd..0613dc5c3 100644 --- a/doc/openapi/components/schemas/config/nodes/shmem.yaml +++ b/doc/openapi/components/schemas/config/nodes/shmem.yaml @@ -52,4 +52,5 @@ allOf: Must start with a forward slash (/). The same name should be passed to the external program somehow in its configuration or command-line arguments. +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/signal.yaml b/doc/openapi/components/schemas/config/nodes/signal_node.yaml similarity index 99% rename from doc/openapi/components/schemas/config/nodes/signal.yaml rename to doc/openapi/components/schemas/config/nodes/signal_node.yaml index 933c48f3a..58979e404 100644 --- a/doc/openapi/components/schemas/config/nodes/signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signal_node.yaml @@ -101,4 +101,5 @@ allOf: Especially at high rates, it can be beneficial for performance to set this flag to `false`. Warnings would namely cause system calls which will slow the node down even more, and thus cause even more missed steps. +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/signal_v2.yaml b/doc/openapi/components/schemas/config/nodes/signal_v2_node.yaml similarity index 94% rename from doc/openapi/components/schemas/config/nodes/signal_v2.yaml rename to doc/openapi/components/schemas/config/nodes/signal_v2_node.yaml index 9077a6708..1ad78137f 100644 --- a/doc/openapi/components/schemas/config/nodes/signal_v2.yaml +++ b/doc/openapi/components/schemas/config/nodes/signal_v2_node.yaml @@ -31,6 +31,6 @@ allOf: signals: type: array items: - $ref: ./signals/generator.yaml + $ref: ./signals/signal_v2_signal.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/signals/can.yaml b/doc/openapi/components/schemas/config/nodes/signals/can.yaml deleted file mode 100644 index 67e0d488c..000000000 --- a/doc/openapi/components/schemas/config/nodes/signals/can.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# yaml-language-server: $schema=http://json-schema.org/draft-07/schema ---- - -type: object -properties: - can_id: - type: integer - default: 0 - - can_size: - type: integer - default: 8 - - can_offset: - type: integer - default: 0 diff --git a/doc/openapi/components/schemas/config/nodes/signals/can_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/can_signal.yaml new file mode 100644 index 000000000..7ea2d1531 --- /dev/null +++ b/doc/openapi/components/schemas/config/nodes/signals/can_signal.yaml @@ -0,0 +1,19 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +--- + +allOf: +- type: object + properties: + can_id: + type: integer + default: 0 + + can_size: + type: integer + default: 8 + + can_offset: + type: integer + default: 0 + +- $ref: ../../signal.yaml diff --git a/doc/openapi/components/schemas/config/nodes/signals/comedi_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/comedi_signal.yaml new file mode 100644 index 000000000..744dbfe1c --- /dev/null +++ b/doc/openapi/components/schemas/config/nodes/signals/comedi_signal.yaml @@ -0,0 +1,21 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +--- + +allOf: +- type: object + required: + - channel + - range + - aref + + properties: + channel: + type: integer + + range: + type: integer + + aref: + type: integer + +- $ref: ../../signal.yaml diff --git a/doc/openapi/components/schemas/config/nodes/signals/generator.yaml b/doc/openapi/components/schemas/config/nodes/signals/generator.yaml deleted file mode 100644 index cce295652..000000000 --- a/doc/openapi/components/schemas/config/nodes/signals/generator.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# yaml-language-server: $schema=http://json-schema.org/draft-07/schema ---- - -type: object -required: -- signal -properties: - signal: - type: string - enum: - - random - - sine - - square - - triangle - - ramp - - counter - - constant - - mixed - - pulse - description: | - The type of signal which should be generated: - - - `random`: a random walk with normal distributed step sizes will be generated. - - `sine`: a sine signal will be generated. - - `square`: a square / rectangle wave will be generated. - - `triangle`: a triangle wave will be generated. - - `ramp`: the generator will produce a ramp signal in the interval `[ 0, 1 / f ]`. - - `counter`: increasing integer counter is generated. - - `constant`: a constant value generated. - - `mixed`: the signals of of each sample are generated by cycling over all remaining signal types. - - `pulse`: generates pulses with a set frequency, phase and width - - amplitude: - type: number - description: The amplitude of the signal when the `signal` setting is one of `sine`, `square` or `triangle`. - default: 1.0 - - frequency: - type: number - description: The frequency of the signal when the `signal` setting is one of `sine`, `square`, `triangle`,`pulse` or `ramp`. - default: 1.0 - - phase: - type: number - default: 0.0 - description: Tha pase of the signal when the `signal` setting is one of `sine` or `pulse`. - - - pulse_width: - type: number - default: 1.0 - description: The width of the pulse, with respect to the rate - - pulse_low: - type: number - default: 0.0 - description: The low value of the pulse signal. - - pulse_high: - type: number - default: 1.0 - description: The high value of the pulse signal. - - stddev: - type: number - default: 0.2 - description: The standard deviation of the normal distributed steps if the `signal` setting is set to `random`. - - offset: - type: number - default: 0.0 - description: Adds a constant offset to each of the generated signals. diff --git a/doc/openapi/components/schemas/config/nodes/signals/iec61850.yaml b/doc/openapi/components/schemas/config/nodes/signals/iec61850.yaml deleted file mode 100644 index b6e47be11..000000000 --- a/doc/openapi/components/schemas/config/nodes/signals/iec61850.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- - -type: object -properties: - iec_type: - type: string - enum: - - boolean - - int8 - - int16 - - int32 - - int64 - - int8u - - int16u - - int32u - - int64u - - float32 - - float64 - - enumerated - - coded_enum - - octet_string - - visible_string - - objectname - - objectreference - - timestamp - - entrytime - - bitstring diff --git a/doc/openapi/components/schemas/config/nodes/signals/iec61850_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/iec61850_signal.yaml new file mode 100644 index 000000000..f33d55385 --- /dev/null +++ b/doc/openapi/components/schemas/config/nodes/signals/iec61850_signal.yaml @@ -0,0 +1,31 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +--- + +allOf: +- type: object + properties: + iec_type: + type: string + enum: + - boolean + - int8 + - int16 + - int32 + - int64 + - int8u + - int16u + - int32u + - int64u + - float32 + - float64 + - enumerated + - coded_enum + - octet_string + - visible_string + - objectname + - objectreference + - timestamp + - entrytime + - bitstring + +- $ref: ../../signal.yaml diff --git a/doc/openapi/components/schemas/config/nodes/signals/signal_v2_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/signal_v2_signal.yaml new file mode 100644 index 000000000..7065251a7 --- /dev/null +++ b/doc/openapi/components/schemas/config/nodes/signals/signal_v2_signal.yaml @@ -0,0 +1,74 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +--- + +allOf: +- type: object + required: + - signal + properties: + signal: + type: string + enum: + - random + - sine + - square + - triangle + - ramp + - counter + - constant + - mixed + - pulse + description: | + The type of signal which should be generated: + + - `random`: a random walk with normal distributed step sizes will be generated. + - `sine`: a sine signal will be generated. + - `square`: a square / rectangle wave will be generated. + - `triangle`: a triangle wave will be generated. + - `ramp`: the generator will produce a ramp signal in the interval `[ 0, 1 / f ]`. + - `counter`: increasing integer counter is generated. + - `constant`: a constant value generated. + - `mixed`: the signals of of each sample are generated by cycling over all remaining signal types. + - `pulse`: generates pulses with a set frequency, phase and width + + amplitude: + type: number + description: The amplitude of the signal when the `signal` setting is one of `sine`, `square` or `triangle`. + default: 1.0 + + frequency: + type: number + description: The frequency of the signal when the `signal` setting is one of `sine`, `square`, `triangle`,`pulse` or `ramp`. + default: 1.0 + + phase: + type: number + default: 0.0 + description: Tha pase of the signal when the `signal` setting is one of `sine` or `pulse`. + + pulse_width: + type: number + default: 1.0 + description: The width of the pulse, with respect to the rate + + pulse_low: + type: number + default: 0.0 + description: The low value of the pulse signal. + + pulse_high: + type: number + default: 1.0 + description: The high value of the pulse signal. + + stddev: + type: number + default: 0.2 + description: The standard deviation of the normal distributed steps if the `signal` setting is set to `random`. + + offset: + type: number + default: 0.0 + description: Adds a constant offset to each of the generated signals. + +- $ref: ../../signal.yaml diff --git a/doc/openapi/components/schemas/config/nodes/signals/stats_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/stats_signal.yaml new file mode 100644 index 000000000..fdbdaf506 --- /dev/null +++ b/doc/openapi/components/schemas/config/nodes/signals/stats_signal.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +--- + +allOf: +- type: object + required: + - stats + properties: + stats: + type: string + +- $ref: ../../signal.yaml diff --git a/doc/openapi/components/schemas/config/nodes/signals/uldaq_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/uldaq_signal.yaml new file mode 100644 index 000000000..3a084692b --- /dev/null +++ b/doc/openapi/components/schemas/config/nodes/signals/uldaq_signal.yaml @@ -0,0 +1,19 @@ +--- + +allOf: +- type: object + properties: + range: + type: string + description: The range for a specific channel. See `range` for allowed values + + input_mode: + type: string + description: The input mode for a specific channel. See `input_mode` for allowed values + + channel: + type: integer + example: 5 + description: The channel input number of the device. + +- ref: ../../signal.yaml diff --git a/doc/openapi/components/schemas/config/nodes/socket.yaml b/doc/openapi/components/schemas/config/nodes/socket.yaml index 9349bc3c2..4a0db8ff3 100644 --- a/doc/openapi/components/schemas/config/nodes/socket.yaml +++ b/doc/openapi/components/schemas/config/nodes/socket.yaml @@ -69,4 +69,5 @@ allOf: loop: type: boolean +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/stats_node.yaml b/doc/openapi/components/schemas/config/nodes/stats_node.yaml index 8494ab9cc..5ed9aa27b 100644 --- a/doc/openapi/components/schemas/config/nodes/stats_node.yaml +++ b/doc/openapi/components/schemas/config/nodes/stats_node.yaml @@ -10,11 +10,12 @@ allOf: in: type: object - required: signals + required: + - signals properties: signals: type: array items: - $ref: ./signals/stats.yaml + $ref: ./signals/stats_signal.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/temper.yaml b/doc/openapi/components/schemas/config/nodes/temper.yaml index 3e76bd2ae..4b2321289 100644 --- a/doc/openapi/components/schemas/config/nodes/temper.yaml +++ b/doc/openapi/components/schemas/config/nodes/temper.yaml @@ -25,4 +25,5 @@ allOf: type: integer description: A filter applied to the USB port number for selecting a specific sensor if multiple are available. +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/uldaq.yaml b/doc/openapi/components/schemas/config/nodes/uldaq.yaml index 2e800ede5..d8e05a323 100644 --- a/doc/openapi/components/schemas/config/nodes/uldaq.yaml +++ b/doc/openapi/components/schemas/config/nodes/uldaq.yaml @@ -25,132 +25,122 @@ allOf: type: object description: Configuration for the ul201 - signals: - type: object + properties: + + signals: + type: array + items: + $ref: ./signals/uldaq_signal.yaml + + sample_rate: + type: integer + min: 0 + example: 10000 + description: The default sampling rate of the input signals. range: type: string - description: The range for a specific channel. See `range` for allowed values + enum: + - bipolar-60 + - bipolar-30 + - bipolar-15 + - bipolar-20 + - bipolar-10 + - bipolar-5 + - bipolar-4 + - bipolar-2.5 + - bipolar-2 + - bipolar-1.25 + - bipolar-1 + - bipolar-0.625 + - bipolar-0.5 + - bipolar-0.25 + - bipolar-0.125 + - bipolar-0.2 + - bipolar-0.1 + - bipolar-0.078 + - bipolar-0.05 + - bipolar-0.01 + - bipolar-0.005 + - unipolar-60 + - unipolar-30 + - unipolar-15 + - unipolar-20 + - unipolar-10 + - unipolar-5 + - unipolar-4 + - unipolar-2.5 + - unipolar-2 + - unipolar-1.25 + - unipolar-1 + - unipolar-0.625 + - unipolar-0.5 + - unipolar-0.25 + - unipolar-0.125 + - unipolar-0.2 + - unipolar-0.1 + - unipolar-0.078 + - unipolar-0.05 + - unipolar-0.01 + - unipolar-0.005 + + description: | + The default input range for signals. Check manual for your device. + + ## Supported ranges + + | Value | Min | Max | + | :--------------- | :------ | :----- | + | `bipolar-60` | -60.0 | +60.0 | + | `bipolar-60` | -60.0 | +60.0 | + | `bipolar-30` | -30.0 | +30.0 | + | `bipolar-15` | -15.0 | +15.0 | + | `bipolar-20` | -20.0 | +20.0 | + | `bipolar-10` | -10.0 | +10.0 | + | `bipolar-5` | -5.0 | +5.0 | + | `bipolar-4` | -4.0 | +4.0 | + | `bipolar-2.5` | -2.5 | +2.5 | + | `bipolar-2` | -2.0 | +2.0 | + | `bipolar-1.25` | -1.25 | +1.25 | + | `bipolar-1` | -1.0 | +1.0 | + | `bipolar-0.625` | -0.625 | +0.625 | + | `bipolar-0.5` | -0.5 | +0.5 | + | `bipolar-0.25` | -0.25 | +0.25 | + | `bipolar-0.125` | -0.125 | +0.125 | + | `bipolar-0.2` | -0.2 | +0.2 | + | `bipolar-0.1` | -0.1 | +0.1 | + | `bipolar-0.078` | -0.078 | +0.078 | + | `bipolar-0.05` | -0.05 | +0.05 | + | `bipolar-0.01` | -0.01 | +0.01 | + | `bipolar-0.005` | -0.005 | +0.005 | + | `unipolar-60` | 0.0 | +60.0 | + | `unipolar-30` | 0.0 | +30.0 | + | `unipolar-15` | 0.0 | +15.0 | + | `unipolar-20` | 0.0 | +20.0 | + | `unipolar-10` | 0.0 | +10.0 | + | `unipolar-5` | 0.0 | +5.0 | + | `unipolar-4` | 0.0 | +4.0 | + | `unipolar-2.5` | 0.0 | +2.5 | + | `unipolar-2` | 0.0 | +2.0 | + | `unipolar-1.25` | 0.0 | +1.25 | + | `unipolar-1` | 0.0 | +1.0 | + | `unipolar-0.625` | 0.0 | +0.625 | + | `unipolar-0.5` | 0.0 | +0.5 | + | `unipolar-0.25` | 0.0 | +0.25 | + | `unipolar-0.125` | 0.0 | +0.125 | + | `unipolar-0.2` | 0.0 | +0.2 | + | `unipolar-0.1` | 0.0 | +0.1 | + | `unipolar-0.078` | 0.0 | +0.078 | + | `unipolar-0.05` | 0.0 | +0.05 | + | `unipolar-0.01` | 0.0 | +0.01 | + | `unipolar-0.005` | 0.0 | +0.00 | input_mode: type: string - description: The input mode for a specific channel. See `input_mode` for allowed values - - channel: - type: integer - example: 5 - description: The channel input number of the device. - description: A list of used channels - - sample_rate: - type: integer - min: 0 - example: 10000 - description: The sampling rate of the input signal. - - range: - type: string - enum: - - bipolar-60 - - bipolar-60 - - bipolar-30 - - bipolar-15 - - bipolar-20 - - bipolar-10 - - bipolar-5 - - bipolar-4 - - bipolar-2.5 - - bipolar-2 - - bipolar-1.25 - - bipolar-1 - - bipolar-0.625 - - bipolar-0.5 - - bipolar-0.25 - - bipolar-0.125 - - bipolar-0.2 - - bipolar-0.1 - - bipolar-0.078 - - bipolar-0.05 - - bipolar-0.01 - - bipolar-0.005 - - unipolar-60 - - unipolar-30 - - unipolar-15 - - unipolar-20 - - unipolar-10 - - unipolar-5 - - unipolar-4 - - unipolar-2.5 - - unipolar-2 - - unipolar-1.25 - - unipolar-1 - - unipolar-0.625 - - unipolar-0.5 - - unipolar-0.25 - - unipolar-0.125 - - unipolar-0.2 - - unipolar-0.1 - - unipolar-0.078 - - unipolar-0.05 - - unipolar-0.01 - - unipolar-0.005 - description: | - The input range. Check manual for your device. - - ## Supported ranges - - | Value | Min | Max | - | :--------------- | :------ | :----- | - | `bipolar-60` | -60.0 | +60.0 | - | `bipolar-60` | -60.0 | +60.0 | - | `bipolar-30` | -30.0 | +30.0 | - | `bipolar-15` | -15.0 | +15.0 | - | `bipolar-20` | -20.0 | +20.0 | - | `bipolar-10` | -10.0 | +10.0 | - | `bipolar-5` | -5.0 | +5.0 | - | `bipolar-4` | -4.0 | +4.0 | - | `bipolar-2.5` | -2.5 | +2.5 | - | `bipolar-2` | -2.0 | +2.0 | - | `bipolar-1.25` | -1.25 | +1.25 | - | `bipolar-1` | -1.0 | +1.0 | - | `bipolar-0.625` | -0.625 | +0.625 | - | `bipolar-0.5` | -0.5 | +0.5 | - | `bipolar-0.25` | -0.25 | +0.25 | - | `bipolar-0.125` | -0.125 | +0.125 | - | `bipolar-0.2` | -0.2 | +0.2 | - | `bipolar-0.1` | -0.1 | +0.1 | - | `bipolar-0.078` | -0.078 | +0.078 | - | `bipolar-0.05` | -0.05 | +0.05 | - | `bipolar-0.01` | -0.01 | +0.01 | - | `bipolar-0.005` | -0.005 | +0.005 | - | `unipolar-60` | 0.0 | +60.0 | - | `unipolar-30` | 0.0 | +30.0 | - | `unipolar-15` | 0.0 | +15.0 | - | `unipolar-20` | 0.0 | +20.0 | - | `unipolar-10` | 0.0 | +10.0 | - | `unipolar-5` | 0.0 | +5.0 | - | `unipolar-4` | 0.0 | +4.0 | - | `unipolar-2.5` | 0.0 | +2.5 | - | `unipolar-2` | 0.0 | +2.0 | - | `unipolar-1.25` | 0.0 | +1.25 | - | `unipolar-1` | 0.0 | +1.0 | - | `unipolar-0.625` | 0.0 | +0.625 | - | `unipolar-0.5` | 0.0 | +0.5 | - | `unipolar-0.25` | 0.0 | +0.25 | - | `unipolar-0.125` | 0.0 | +0.125 | - | `unipolar-0.2` | 0.0 | +0.2 | - | `unipolar-0.1` | 0.0 | +0.1 | - | `unipolar-0.078` | 0.0 | +0.078 | - | `unipolar-0.05` | 0.0 | +0.05 | - | `unipolar-0.01` | 0.0 | +0.01 | - | `unipolar-0.005` | 0.0 | +0.00 | - - input_mode: - type: string - enum: - - differential - - single-ended - - pseudo-differential - description: The sampling type. Check manual for you device + enum: + - differential + - single-ended + - pseudo-differential + description: The default sampling type. Check manual for you device. - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/webrtc.yaml b/doc/openapi/components/schemas/config/nodes/webrtc.yaml index 8b6cd1e27..b99f3374b 100644 --- a/doc/openapi/components/schemas/config/nodes/webrtc.yaml +++ b/doc/openapi/components/schemas/config/nodes/webrtc.yaml @@ -54,4 +54,5 @@ allOf: type: string description: Username for used authentication against TURN servers. +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/websocket.yaml b/doc/openapi/components/schemas/config/nodes/websocket.yaml index d04be6fab..580684456 100644 --- a/doc/openapi/components/schemas/config/nodes/websocket.yaml +++ b/doc/openapi/components/schemas/config/nodes/websocket.yaml @@ -28,4 +28,5 @@ allOf: format: uri description: A WebSocket URI +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/zeromq.yaml b/doc/openapi/components/schemas/config/nodes/zeromq.yaml index 2e992921e..50701d8be 100644 --- a/doc/openapi/components/schemas/config/nodes/zeromq.yaml +++ b/doc/openapi/components/schemas/config/nodes/zeromq.yaml @@ -53,4 +53,11 @@ allOf: description: | The private key of the server. + out: + type: object + properties: + netem: + $ref: ../netem.yaml + +- $ref: ../node_signals.yaml - $ref: ../node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/signals/common.yaml b/doc/openapi/components/schemas/config/signal.yaml similarity index 100% rename from doc/openapi/components/schemas/config/nodes/signals/common.yaml rename to doc/openapi/components/schemas/config/signal.yaml diff --git a/doc/openapi/components/schemas/config/nodes/signals/list.yaml b/doc/openapi/components/schemas/config/signal_list.yaml similarity index 96% rename from doc/openapi/components/schemas/config/nodes/signals/list.yaml rename to doc/openapi/components/schemas/config/signal_list.yaml index e93719a38..6e6c02b59 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/list.yaml +++ b/doc/openapi/components/schemas/config/signal_list.yaml @@ -20,12 +20,12 @@ oneOf: init: 230.0 items: - $ref: signal_spec.yaml + $ref: ./signal.yaml - type: object title: Signal definition with `count` allOf: - - $ref: signal_spec.yaml + - $ref: ./signal.yaml - type: object required: - count