ecom.database
Module Contents
Classes
A representation of a physical unit. |
|
A configuration item of the secondary device. |
|
A datapoint that is the value of a configuration. |
|
A response type that is the value of a configuration. |
|
A constant in the communication database. |
|
The shared communication database. Contains all information about the communication. |
Functions
|
Verifies the communication database. |
- class ecom.database.Unit[source]
Bases:
ecom.datatypes.TypeInfo
A representation of a physical unit.
- classmethod fromTypeInfo(name: str, typeInfo: ecom.datatypes.TypeInfo, description: Optional[str] = None) Unit [source]
Create a new unit type from a given base type.
- Parameters:
name – The name of the unit.
typeInfo – The base type.
description – The description of the unit.
- Returns:
The new unit.
- class ecom.database.Configuration[source]
Bases:
Generic
[ecom.datatypes.V
]A configuration item of the secondary device.
- id: ecom.datatypes.EnumType[source]
The id of the configuration item.
- type: ecom.datatypes.TypeInfo[ecom.datatypes.V][source]
The type of the configuration.
- exception ecom.database.CommunicationDatabaseError[source]
Bases:
RuntimeError
Indicates an error in the communication database.
- exception ecom.database.UnknownTypeError(typ: str)[source]
Bases:
CommunicationDatabaseError
Information about an unknown shared datatype was requested.
- exception ecom.database.UnknownConstantError(constant: str)[source]
Bases:
ValueError
Information about an unknown shared constant was requested.
- exception ecom.database.UnknownDatapointError(datapointName: str)[source]
Bases:
CommunicationDatabaseError
Information about an unknown datapoint was requested.
- class ecom.database.ConfigurationValueDatapoint[source]
Bases:
ecom.message.DependantTelecommandDatapointType
,_DbContainer
A datapoint that is the value of a configuration.
- class ecom.database.ConfigurationValueResponseType(database: CommunicationDatabase, *args, **kwargs)[source]
Bases:
ecom.message.DependantTelecommandResponseType
A response type that is the value of a configuration.
- class ecom.database.Constant[source]
Bases:
Generic
[ecom.datatypes.V
]A constant in the communication database.
- type: ecom.datatypes.TypeInfo[ecom.datatypes.V][source]
Information about the type of the constant.
- class ecom.database.CommunicationDatabase(dataDirectory: str)[source]
The shared communication database. Contains all information about the communication.
- property constants: Dict[str, Constant][source]
- Returns:
A name to value, description and type information mapping for all shared constants.
- property telecommandTypes: List[ecom.message.TelecommandType][source]
- Returns:
All telecommand types.
- property telecommandTypeEnum: Optional[Type[ecom.datatypes.EnumType]][source]
- Returns:
The enum class that is used for the telecommand types or None if no telecommand types exist.
- property telemetryTypes: List[ecom.message.TelemetryType][source]
- Returns:
All telemetry types.
- property telemetryTypeEnum: Optional[Type[ecom.datatypes.EnumType]][source]
- Returns:
The enum class that is used for the telemetry types or None if no telemetry types exist.
- property dataTypes: Dict[str, ecom.datatypes.TypeInfo][source]
- Returns:
All shared data types.
- property units: Dict[str, List[Unit]][source]
- Returns:
All mapping of names to all known units and their variants.
- property configurations: List[Configuration][source]
- Returns:
All configuration items of the secondary device.
- property configurationEnum: Optional[Type[ecom.datatypes.EnumType]][source]
- Returns:
The enum class that is used for the configurations or None if no configurations exist.
- getTypeInfo(typeName: str) ecom.datatypes.TypeInfo [source]
Get the type info for a known datatype by its name.
- Parameters:
typeName – The name of the type.
- Returns:
The type info for the data type.
- getTelecommandByName(name: str) ecom.message.TelecommandType [source]
- Parameters:
name – The name of a telecommand type.
- Returns:
The telecommand type with the specified name.
- getTelecommand(telecommandId: ecom.datatypes.EnumType) ecom.message.TelecommandType [source]
- Parameters:
telecommandId – The id enum value of a telecommand type.
- Returns:
The telecommand type with the specified id.
- getTelemetryByName(name: str) ecom.message.TelemetryType [source]
- Parameters:
name – The name of a telemetry type.
- Returns:
The telemetry type with the specified name.
- getTelemetry(telemetryId: ecom.datatypes.EnumType) ecom.message.TelemetryType [source]
- Parameters:
telemetryId – The id enum value of a telemetry type.
- Returns:
The telemetry type with the specified id.
- parseKnownTypeInfo(typeStr: str, name: Optional[str] = None, documentation: Optional[str] = None)[source]
Get the type info for a known datatype. Supports parsing type strings declaring an array of a known datatype.
- Parameters:
typeStr – The type string to parse.
name – The name of the array data type, if the type is an array. If not provided, the typeStr is used.
documentation – The documentation of the data type, if the type is an array.
- Returns:
The type information for the parsed type.
- replaceType(typ: Type[ecom.datatypes.V], name: Optional[str] = None)[source]
Replace a type registered in the database with another Python class. This allows to define own types like enums for types defined in the communication database, make sure that the two types match and keep up to date with each other, and use the types on the Python side with IDE autocompletion support.
- Parameters:
typ – The new type to replace the old type.
name – The name of the type to replace, if omitted the class name of the new type is used.