/  PyMDB  /  Systems and Subsystems

Systems and Subsystems

A System is the root of a PyMDB model and gives the database its structure. Every other object — parameter, container, command, algorithm — belongs to exactly one system. Systems nest through the Subsystem class, typically mirroring the physical or functional decomposition of the spacecraft:

import yamcs.pymdb as Y

satellite = Y.System("MySat")

eps = Y.Subsystem(satellite, "EPS", short_description="Electrical power")
com = Y.Subsystem(satellite, "COM", short_description="Communications")
adcs = Y.Subsystem(satellite, "ADCS")

# Subsystems nest to any depth
battery = Y.Subsystem(eps, "Battery")

A Subsystem is a System in every respect; the only difference is that it keeps a reference to its parent. Anywhere the manual says “system”, a subsystem works equally.

You can define several independent top-level systems in one script — for example the spacecraft and the ground support equipment — and export each to its own XTCE file:

satellite = Y.System("MySat")
gse = Y.System("GSE")

Qualified names

Each system defines a namespace. Items are addressed by their qualified name: the slash-separated path from the root system. A parameter battery_voltage in subsystem EPS of system MySat is /MySat/EPS/battery_voltage. These are the names Yamcs displays and that you use in Yamcs displays, scripts, and APIs.

System, Parameter, Container, Command and Algorithm all expose a qualified_name property, and their str() form is the qualified name. A subsystem’s root property returns the top of its tree.

Names must be unique per kind within a system: creating a second parameter named mode in the same system raises DuplicateNameError. (A parameter and a command may share a name, since they are different kinds.)

Descriptive metadata

Systems — and nearly every other PyMDB object — accept the same set of descriptive options:

short_description

A one-line summary, shown in listings in the Yamcs web interface.

long_description

A multi-line description. Yamcs renders this on the item’s detail page.

aliases

Alternative names, keyed by namespace, e.g. aliases={"MDB:OPS Name": "MYSAT_EPS_VBAT"}. Aliases let other systems (displays, procedures, external tools) refer to items by mission-specific naming conventions.

extra

Arbitrary key/value information, exported as XTCE ancillary data. Yamcs itself ignores unknown keys, but plugins and custom tooling can read them.

Since these are the same on every object, the other chapters do not repeat them.