- Introduction
- Getting Started
- Systems and Subsystems
- Parameters
- Encodings
- Containers: Telemetry Packets
- Calibrators
- Alarms
- Commands
- Command Verification
- Algorithms
- Expressions
- CCSDS and CSP Headers
- Structuring Large Models
- Generating XTCE
Appendices
Expressions¶
Several features need a condition over telemetry or argument values: container identification, conditional entries, context alarms, verifier checks and transmission constraints all take an expression. Expressions are built with six comparison helpers and two combinators:
Helper |
Meaning |
|---|---|
|
equal to |
|
not equal to |
|
less than (or equal) |
|
greater than (or equal) |
|
true when all sub-expressions hold (AND) |
|
true when at least one holds (OR) |
Y.all_of(
Y.eq(mode, "NOMINAL"),
Y.any_of(
Y.gt(battery_voltage, 11.0),
Y.eq(external_power, True),
),
)
Combinators nest to any depth. Each helper is also available as a class
(EqExpression, AndExpression, …) with identical meaning; the
functions are simply shorter.
What can be referenced¶
The first operand, ref, accepts:
a
Parameter— the usual case;an
Argument— inside command definitions, to make entries or constraints depend on another argument of the same command;a
ParameterMemberorArgumentMember— a member inside an aggregate, built from the parameter/argument and the member object(s) forming the path (see Parameters);a plain string — the qualified name of a parameter not managed with PyMDB.
# Compare against a member of an aggregate parameter
apid = Y.ParameterMember(ccsds_packet_id, path=apid_member)
my_packet = Y.Container(
system=spacecraft,
name="my_packet",
base=ccsds_space_packet,
condition=Y.eq(apid, 101),
)
The comparison value is a plain Python value matching the engineering
type: a number, a string (for enumeration states), a boolean.
Calibrated or raw¶
By default comparisons use the calibrated (engineering) value. Pass
calibrated=False to compare against the raw value instead:
Y.eq(status_field, 0x2A, calibrated=False)
This matters chiefly in container conditions on parameters that have a calibrator or enumeration: comparing raw values spares Yamcs the calibration during packet identification, and lets you match wire-level constants directly.