This page describes the layout of .proc files and how the names written in them resolve:
roles, components, instances, measures, inputs and answers. The statements themselves are in
the Statement Reference, the expressions in
Expressions, Types and Units.
Files#
- Steps and procedures live in
.procfiles of a library package, next to itspackage.yaml(see Libraries and Validation). A library may have any number of files; names are shared by all of them, so a step defined in one file is called from another. - A file contains top-level
stepandprocedureblocks, in any order: calls resolve whatever the order of the definitions. - Anything else at the top level is an error (
procedure::unexpected-line).
Lines and blocks#
- One statement per line. A statement never spans several lines.
- Blocks by indentation. The lines of a block are indented under the line that opens it,
all by the same amount. Only
step,procedureandif failedopen a block. - Spaces only. A tab in the indentation is an error (
procedure::indentation, "tab in indentation"). - A line indented deeper than its block, or an indented block under a line that opens none, is
an error (
procedure::indentation). - Comments start with
#and run to the end of the line, outside strings. Blank lines and comments are ignored.
# Operations on the camera outside the procedures of the use case.
procedure "Ready camera"
uses cam: hsc-100
step "Command ready" # an inline step, inside the procedure
send set_mode to cam.camera with mode = READY
wait until cam.camera.at_setpoint within 3 minStrings#
Step names, procedure names, questions of ask, texts of log and descriptions are strings in
double quotes:
"Camera answers". A string cannot contain a double quote and does not span lines; an unterminated
string is reported (procedure::syntax). Strings are never values in expressions
(expr::string-value). Only the text of a log holds expressions, between braces
("Detector at {cam.camera.detector_temperature}", see log).
Descriptions#
A description "…" line in the header of a step (inline steps included) or of a procedure
describes it for operators. The hover of the editor and the launch form of the web console show
it.
procedure "Power-up test"
description "Powers the camera from the bench supply, then checks that it answers in standby."
uses cam: hsc-100- At most one per step or procedure (
procedure::duplicate-description). - It is not part of the compiled procedure: writing or rewording a description changes neither
the hash of the procedure nor its validation in
stellar.lock.
Keywords and reserved words#
Every line starts with a keyword:
| Where | Keywords |
|---|---|
| Top level | step, procedure |
| Header of a step or procedure | description, uses, input |
| Header of a procedure | allowed in |
| Body of a step | send, expect, check, ask, wait, download, upload, configure |
| Body of a procedure | do, run, step, if failed |
An unknown keyword is reported with the closest one (procedure::unknown-keyword); a keyword in
the wrong place too (procedure::misplaced), for instance a send directly in a procedure or a
do in a step.
Inside a line, to, with, via, within, retry, every, for, as and into split
the line into clauses, outside strings and brackets. They cannot be used as names on the lines
that accept them. A clause keyword written twice on one line is an error. In a type, of
follows file_id (file_id of quicklook).
In expressions, and, or, not, is, true and false are keywords, and param
followed by a path reads a parameter, with in <mode>
after the path for a given mode.
Names#
- Roles, inputs, typed answers, argument names and environments are identifiers: ASCII letters,
digits and
_, starting with a letter (procedure::invalid-nameotherwise). - Platforms in
usesare catalogue package names, such ashsc-100orlab-psu. - Step and procedure names are free strings. Step names are unique in a library, and so are
procedure names (
procedure::duplicate-step,procedure::duplicate-procedure); a step and a procedure may share a name, sincedocalls steps andruncalls procedures. - A library step must have a name (
procedure::anonymous-step); anonymous steps exist only inline in a procedure. - Roles, inputs and the answers of
ask … intoshare one namespace per step or procedure (procedure::duplicate-name). An answer is visible in the statements that follow itsask.
Addressing#
A path names what a statement reads or commands. It starts with a role; each segment may be
indexed with […].
| Written | Means |
|---|---|
sat.channel[PAYLOAD] | Component channel of the target of role sat (a cubesat-6u), instance PAYLOAD |
sat.channel[channel] | The same, the instance given by the input channel (of the instance enum) |
sat.channel[channel].current | Measure (or derived measure) current of that instance |
psu | The only component of a single-component platform (lab-psu) |
psu.output_enabled | A measure of that only component |
cam.files[quicklook] | On-board file given by an input file_id of quicklook |
sat.stream[camera] | Continuous stream camera of the stream component |
sat.link[nominal].lockout | Measure of the standard link component, for the link nominal |
Rules:
- Instances. A multi-instance component is always indexed, by a value of its instance enum
(
PAYLOAD) or by an input of that enum type (channel); a single-instance one never is (procedure::missing-instance,procedure::unexpected-instance,procedure::unknown-instance). Measures and roles are never indexed. - Single component. For a platform with one component, the component is omitted:
send output_on to psu,check psu.voltage > 11 V. On a platform with several components, a component must be named (procedure::several-components). files. The on-board directory is indexed by an input declaredfile_id of <file type>, resolved at run time; a literal identifier is refused. Its telecommands receive theirfile_idargument from the instance: do not write it inwith(procedure::file-id-argument). See Files and Streams.link. The standardlinkcomponent exists for every target, one instance per link.sat.link[nominal]is accepted by the compiler whatever the link: link names belong to the target, not to the platform, and are checked when the run request is resolved (run::unknown-link). See COP-1 and the Link Component.
Roles and inputs#
uses <role>: <platform>
input <name>: <type>
input <name>: <duration type> range [<low>, <high>]uses cam: hsc-100declares a role typed by a platform. The platform must be a catalogue the library depends on (procedure::unknown-platform); its version is fixed by the library, see Libraries and Validation.inputdeclares a typed input; see Input types. A duration input of a step may have arangeof times (input dwell: f32 s range [1 s, 8 h]), which bounds awaitor awithingiven by the run (seewait). Only the inputs of a step take a range, and only a duration input (procedure::invalid-range).- An inline step declares neither (
procedure::inline-declaration): it uses those of its procedure.
Name resolution in expressions#
In a condition, an argument value or a call argument, a name resolves in this order:
- a path starting with a role: a measure (
cam.camera.mode,psu.voltage); - an input or a typed answer of the step or procedure (
bus_voltage,measured); - on one side of
is, or as the value of an enum argument, a value of the enum on the other side (STANDBY,READY).
An unknown name is reported with the closest known one (expr::unknown-name,
expr::unknown-enum-value).