From 34ae216b180f0e3806d2cd32410c6c978c9632de Mon Sep 17 00:00:00 2001 From: vnadot Date: Thu, 8 Apr 2021 18:09:37 +0200 Subject: [PATCH] fix current headers and add others (C, SNL, CMD, dbd, yaml) --- CHANGELOG.md | 3 ++ snippets/c.json | 8 +++ snippets/db.json | 5 +- snippets/dbd.json | 8 +++ snippets/snl.json | 13 +++++ snippets/startup.json | 8 +++ snippets/substitutions.json | 4 +- snippets/weTest.json | 13 +++++ test/test.c | 6 +++ test/test.cmd | 9 ++++ test/test.sub | 4 +- test/test.yaml | 104 +++++++++++++++++++++++++++++++++--- test/testSeq.st | 19 +++---- 13 files changed, 181 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 120c899..463b5b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## 1.1.0 - 2020-04-17 +- fix current headers and add others (C, SNL, CMD, dbd, yaml) + ## 1.0.0 - 2020-03-19 - Add defaut value to macro for epicsEnvSet(). Improve dbLoadTemplate and dbLoadRecords. - add ${0} at the end of each snippets. diff --git a/snippets/c.json b/snippets/c.json index 602e97c..04cb4b4 100644 --- a/snippets/c.json +++ b/snippets/c.json @@ -174,5 +174,13 @@ "}", "${0}" ] + }, + "header": { + "prefix": "epics.header", + "body": [ "// file: ${TM_FILENAME}", + "// author: ${1:victor.nadot@cea.fr}", + "// company: ${2:CEA / DRF / IRFU / LDISC}", + "// description: ${3:this file is doing that ...}", + "${0}"] } } \ No newline at end of file diff --git a/snippets/db.json b/snippets/db.json index 0fda5b6..cc3695e 100644 --- a/snippets/db.json +++ b/snippets/db.json @@ -374,9 +374,10 @@ "# description: ${3:this file is doing that ...}", "# macros:", "# - >> Mandatory", - "# - ${4:P}: ${${4:P}=${5:CEA:}} | ${6:PV prefix}", + "# - ${4:P}: ${${4:P}} | ${5:PV prefix}", "# - >> Optional", - "# - ", + "# - ${6:EGU}: ${${6:P}=${7:Volts}} | ${8:PV unit}", "${0}"] } + } } diff --git a/snippets/dbd.json b/snippets/dbd.json index 3aebbce..4f9d401 100644 --- a/snippets/dbd.json +++ b/snippets/dbd.json @@ -34,5 +34,13 @@ "body": [ "# Variables", "variable(${1:})${0}" ] + }, + "header": { + "prefix": "epics.header", + "body": [ "# file: ${TM_FILENAME}", + "# author: ${1:victor.nadot@cea.fr}", + "# company: ${2:CEA / DRF / IRFU / LDISC}", + "# description: ${3:this file is doing that ...}", + "${0}"] } } diff --git a/snippets/snl.json b/snippets/snl.json index 1105448..ea5f7f4 100644 --- a/snippets/snl.json +++ b/snippets/snl.json @@ -23,5 +23,18 @@ "SNL pvGet": { "prefix": "epics.snl.pvGet", "body": [ "pvGet(${1:pv_variable});${0}"] + }, + "header": { + "prefix": "epics.header", + "body": [ "// file: ${TM_FILENAME}", + "// author: ${1:victor.nadot@cea.fr}", + "// company: ${2:CEA / DRF / IRFU / LDISC}", + "// description: ${3:this file is doing that ...}", + "// macros:", + "// - >> Mandatory", + "// - ${4:P}: ${${4:P}} | ${5:PV prefix}", + "// - >> Optional", + "// - ${6:EGU}: ${${6:P}=${7:Volts}} | ${8:PV unit}", + "${0}"] } } diff --git a/snippets/startup.json b/snippets/startup.json index cec2c84..5738236 100644 --- a/snippets/startup.json +++ b/snippets/startup.json @@ -14,5 +14,13 @@ "dbLoadRecords": { "prefix": "epics.dbLoadRecords", "body": "dbLoadRecords(\"${1:file}.${2|template,db|}\", \"${3:P=$(P=CEA:)}, ${4:R=$(P=LAB:)}\")${0}" + }, + "header": { + "prefix": "epics.header", + "body": [ "# file: ${TM_FILENAME}", + "# author: ${1:victor.nadot@cea.fr}", + "# company: ${2:CEA / DRF / IRFU / LDISC}", + "# description: ${3:this file is doing that ...}", + "${0}"] } } \ No newline at end of file diff --git a/snippets/substitutions.json b/snippets/substitutions.json index 585d3ec..6ffa076 100644 --- a/snippets/substitutions.json +++ b/snippets/substitutions.json @@ -24,9 +24,9 @@ "# description: ${3:this file is doing that ...}", "# macros:", "# - >> Mandatory", - "# - ${4:P}: ${${4:P}=${5:CEA:}} | ${6:PV prefix}", + "# - ${4:P}: ${${4:P}} | ${5:PV prefix}", "# - >> Optional", - "# - ", + "# - ${6:EGU}: ${${6:P}=${7:Volts}} | ${8:PV unit}", "${0}"] } } diff --git a/snippets/weTest.json b/snippets/weTest.json index 1b76282..87669d7 100644 --- a/snippets/weTest.json +++ b/snippets/weTest.json @@ -149,5 +149,18 @@ " skip: False True", " on_failure: continue pause abort", " retry: 5${0}"] + }, + "header": { + "prefix": "epics.header", + "body": [ "# file: ${TM_FILENAME}", + "# author: ${1:victor.nadot@cea.fr}", + "# company: ${2:CEA / DRF / IRFU / LDISC}", + "# description: ${3:this file is doing that ...}", + "# macros:", + "# - >> Mandatory", + "# - ${4:P}: ${${4:P}} | ${5:PV prefix}", + "# - >> Optional", + "# - ${6:EGU}: ${${6:P}=${7:Volts}} | ${8:PV unit}", + "${0}"] } } diff --git a/test/test.c b/test/test.c index 0487915..ed240c7 100644 --- a/test/test.c +++ b/test/test.c @@ -1,3 +1,9 @@ +// file: test.c +// author: victor.nadot@cea.fr +// company: CEA / DRF / IRFU / LDISC +// description: this file is doing that ... + + epicsInt8 epicsUInt8 epicsInt16 diff --git a/test/test.cmd b/test/test.cmd index 584f1f6..ed094a1 100644 --- a/test/test.cmd +++ b/test/test.cmd @@ -1,3 +1,12 @@ +# file: test.cmd +# author: victor.nadot@cea.fr +# company: CEA / DRF / IRFU / LDISC +# description: this file is doing that ... +# macros: +# - >> Mandatory +# - P: ${P} | PV prefix +# - >> Optional +# - EGU: ${EGU=Volts} | PV unit require module, version diff --git a/test/test.sub b/test/test.sub index 7cd4dd9..65aeb56 100644 --- a/test/test.sub +++ b/test/test.sub @@ -4,9 +4,9 @@ # description: this file is doing that ... # macros: # - >> Mandatory -# - ererer: ${ererer=CEA:} | PV prefix +# - P: ${P} | PV prefix # - >> Optional -# - +# - EGU: ${EGU=Volts} | PV unit file db/myDBfile.template { { P=xxx, Y=yyy} diff --git a/test/test.yaml b/test/test.yaml index 8a5189f..aa087b7 100644 --- a/test/test.yaml +++ b/test/test.yaml @@ -1,11 +1,99 @@ +# file: test.yaml +# author: victor.nadot@cea.fr +# company: CEA / DRF / IRFU / LDISC +# description: this file is doing that ... +# macros: +# - >> Mandatory +# - P: ${P} | PV prefix +# - >> Optional +# - EGU: ${EGU=Volts} | PV unit +version: {major: 1, minor: 2, bugfix: 0} -commands: - - name: "set voltage" - setter: "VolS" - getter: "VolMes" - margin: 0 # % - set_value: 10 - get_value: 10 +include: + # without macro + - myScript.yaml + # with macro on one line + - ['myScript.yaml', MACRO1: 'MY_MACRO1, MACRO2: 'MY_MACRO2'] + # with macro on several lines + - path: myScript.yaml + MACRO1: 'MY_MACRO1' + MACRO2: 'MY_MACRO2' - \ No newline at end of file +macros: + - MACRO1: MY_MACRO1 + MACRO2: MY_MACRO2 + +config: + name: my_scenario_name + type: unit functional + prefix: CEA-01: # PV prefix + use_prefix: False True + delay: 1 # sec + ignore: False True + skip: False True + on_failure: continue pause abort + retry: + +tests: + - name: my_sub_test + prefix: CEA-01:... + use_prefix: False True + delay: 1 # sec + message: my_message + setter: USet + getter: UMes + margin: 0 # % + delta: 0 + + # choose between range, values and commands + # range + range: + start: -5 + stop: 10 + # choose between step, lin and geom + step: 0.3 + lin: 5 # number of values linearly spaced between start and stop + geom: 3 # number of values geometrically spaced between start and stop + include_start: False True + include_stop: False True + sort: True False random reverse + + # values (2 ways to define them) + # one line + values: [1, 10, 100] + # several lines + values: + - 1 + - 10 + - 100 + + # commands + commands: + # commande 1 + - name: command_name + message: my_message + margin: 0 # % + delta: 0 + setter: USet + getter: UMes + get_value: 20 # if setter and getter have different values + set_value: 20 # if setter and getter have different values + value: 20 # if setter and getter have the same value + delay: 0 # sec + ignore: False True + skip: False True + on_failure: continue pause abort + retry: 5 + # commande 2 + - name: ... # command 2 + # commande 3 + - name: ... # command 3 + + finally: + setter: USet + value: 0 # % + ignore: False True + skip: False True + on_failure: continue pause abort + retry: 0 \ No newline at end of file diff --git a/test/testSeq.st b/test/testSeq.st index 18e354b..01ec33c 100644 --- a/test/testSeq.st +++ b/test/testSeq.st @@ -1,12 +1,13 @@ -/* - * C.E.A. IRFU/SIS/LDISC - * - * $Id$ - * - * who when what - * -------- -------- ---------------------------------------------- - * agaget 15/04/16 created - */ +// file: testSeq.st +// author: victor.nadot@cea.fr +// company: CEA / DRF / IRFU / LDISC +// description: this file is doing that ... +// macros: +// - >> Mandatory +// - P: ${P} | PV prefix +// - >> Optional +// - EGU: ${EGU=Volts} | PV unit + program LaunchSeq