Skip to content

Commit

Permalink
fix current headers and add others (C, SNL, CMD, dbd, yaml)
Browse files Browse the repository at this point in the history
  • Loading branch information
vnadot committed Apr 8, 2021
1 parent 128fcb9 commit 34ae216
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 8 additions & 0 deletions snippets/c.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
}
}
5 changes: 3 additions & 2 deletions snippets/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
}
}
}
8 changes: 8 additions & 0 deletions snippets/dbd.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,13 @@
"body": [ "# Variables",
"variable(${1:<variable_name>})${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}"]
}
}
13 changes: 13 additions & 0 deletions snippets/snl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
}
}
8 changes: 8 additions & 0 deletions snippets/startup.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
}
}
4 changes: 2 additions & 2 deletions snippets/substitutions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
}
}
13 changes: 13 additions & 0 deletions snippets/weTest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
}
}
6 changes: 6 additions & 0 deletions test/test.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 9 additions & 0 deletions test/test.cmd
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/test.sub
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
104 changes: 96 additions & 8 deletions test/test.yaml
Original file line number Diff line number Diff line change
@@ -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'


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
19 changes: 10 additions & 9 deletions test/testSeq.st
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 34ae216

Please sign in to comment.