rccn-gen 1.1.0__tar.gz → 1.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/.gitignore +2 -2
- rccn_gen-1.3.0/CHANGELOG.md +34 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/PKG-INFO +36 -7
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/README.md +35 -6
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/pyproject.toml +1 -1
- rccn_gen-1.3.0/src/rccn_gen/systems.py +1895 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/utils.py +20 -0
- rccn_gen-1.1.0/CHANGELOG.md +0 -13
- rccn_gen-1.1.0/src/rccn_gen/systems.py +0 -530
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/.gitlab-ci.yml +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/LICENSE +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/__init__.py +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/cargo_toml/cargo.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/command/command.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/command/command_module_enum.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/command/command_module_struct.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/main/main.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/main/service_module_import_service.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/main/service_module_mod_service.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/main/service_module_register_service.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/mod/mod.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/service/command_module_match_cmd.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/service/service.txt +0 -0
- {rccn_gen-1.1.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/telemetry/telemetry.txt +0 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
# CHANGE LOG
|
2
|
+
|
3
|
+
## [1.3.0] - 2025-05-15
|
4
|
+
- Added methods to the RCCNContainer class to directly add parameters
|
5
|
+
- Added documentation for Application, Service, RCCNCommand and RCCNContainer classes
|
6
|
+
- Added support for Float datatype Rust generation in Arguments and ParameterEntries
|
7
|
+
|
8
|
+
## [1.2.0] - 2025-05-05
|
9
|
+
- Added argument hints for RCCNCommand, Service and RCCNContainer
|
10
|
+
- New create_and_add_service() method for the Application
|
11
|
+
- New create_and_add_command() method for the Service
|
12
|
+
- Better error messages
|
13
|
+
- Subtypes of RCCNCommands and RCCNContainers are defined automatically, if not specified by the user
|
14
|
+
- General refactoring for more readable code
|
15
|
+
- Added add_integer_parameter method to RCCNContainer
|
16
|
+
- Bug fixes
|
17
|
+
|
18
|
+
### [1.1.2] - 2025-04-23
|
19
|
+
- The `export_directory` argument for the `Application` is now mandatory.
|
20
|
+
|
21
|
+
### [1.1.1] - 2025-04-22
|
22
|
+
- Changed the user input checking to allow for multiple command with the same name and subtype, as long as they are associated to different services.
|
23
|
+
|
24
|
+
## [1.1.0] - 2025-04-14
|
25
|
+
- Added derive statements to the rust container structs in the telemetry.rs file.
|
26
|
+
- Inherit subtype of a container from the `condition` argument, if given, or from the new (optional) `subtype` argument. If only the latter is given, condition is created from that. Subtype is included in the derive statements.
|
27
|
+
- Added missing `use anyhow::Result` import and bug fixes in `main.rs` file.
|
28
|
+
- Added new dependencies in `cargo.toml` file.
|
29
|
+
- Changed names of command structs to differentiate between trait names and struct names.
|
30
|
+
- Include bit number statement in enum declaration.
|
31
|
+
- The `tc` parameter in the service.rs file is now mutable.
|
32
|
+
- `System` of a command is obtained from the base command, if no system argument is given.
|
33
|
+
- Added support for long and short descriptions of commands, arguments and supported telemetry parameters.
|
34
|
+
- Bug fixes.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: rccn_gen
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.3.0
|
4
4
|
Summary: A python based generator for RACCOON OS source files in Rust from yamcs-pymdb config files.
|
5
5
|
Project-URL: Homepage, https://gitlab.com/rccn/pymdb_code_generation
|
6
6
|
Project-URL: Issues, https://gitlab.com/rccn/pymdb_code_generation/issues
|
@@ -29,10 +29,11 @@ To see whats new, see the [CHANGELOG](CHANGELOG.md).
|
|
29
29
|
## Using the Generator
|
30
30
|
The generator is based on [`pymdb`](https://github.com/yamcs/pymdb) and uses the same structure. Where `pymdb` gives the user freedom in defining systems, subsystems and their respective relations, the definitions for rust code generation is more restricted. For the rust generation, the user is bound to the following classes:
|
31
31
|
- `Application`,
|
32
|
-
- `Service`,
|
33
|
-
- `RCCNCommand
|
32
|
+
- `Service`,
|
33
|
+
- `RCCNCommand`, and
|
34
|
+
- `RCCNContainer`.
|
34
35
|
|
35
|
-
|
36
|
+
The Application and Service classes inherit from pymdb's Subsystem class and extend their functionality. The RCCNCommand extends the Command class and the RCCNContainer extends the Container class of pymdb. This means that an existing pymdb definition can be used to generate rust code by renaming the respective instances. No functionality for pymdb's XTCE generation will be lost.
|
36
37
|
|
37
38
|
A root system may be defined for the satellite.
|
38
39
|
```python
|
@@ -44,7 +45,7 @@ An application can be defined with the following statement.
|
|
44
45
|
```python
|
45
46
|
app = Application(system=root_system, name="ExampleApp", apid=42)
|
46
47
|
```
|
47
|
-
It has the obligatory arguments **system**, **name** and **apid**. After all Applications, Services and RCCNCommands are defined, the rust code generator can be called on the application with `app.generate_rccn_code()`.
|
48
|
+
It has the obligatory arguments **system**, **name** and **apid**. After all Applications, Services and RCCNCommands are defined, the rust code generator can be called on the application with `app.generate_rccn_code(export_directory='.')`.
|
48
49
|
|
49
50
|
### Service
|
50
51
|
|
@@ -81,7 +82,7 @@ my_command = RCCNCommand(
|
|
81
82
|
service.add_command(my_command)
|
82
83
|
```
|
83
84
|
|
84
|
-
The only obligatory
|
85
|
+
The only obligatory argument is **name**. If the subtype assignment is not given, a value will be chosen automatically. The connection to a service can also be achieved with base commands, where every base command must be unique to a service. For example:
|
85
86
|
|
86
87
|
```python
|
87
88
|
base_cmd = RCCNCommand(
|
@@ -98,6 +99,34 @@ my_command = RCCNCommand(
|
|
98
99
|
)
|
99
100
|
```
|
100
101
|
|
102
|
+
### RCCNContainer
|
103
|
+
A container to hold telemetry information can be created with:
|
104
|
+
```python
|
105
|
+
my_container = RCCNContainer(
|
106
|
+
system=service,
|
107
|
+
name='BatteryInformation',
|
108
|
+
short_description='This container holds information on battery voltage and current'
|
109
|
+
)
|
110
|
+
my_container.add_integer_parameter_entry(
|
111
|
+
name='BatteryNumber',
|
112
|
+
minimum=1,
|
113
|
+
maximum=4,
|
114
|
+
encoding=IntegerEncoding(bits=3),
|
115
|
+
short_description='Number of the battery'
|
116
|
+
)
|
117
|
+
my_container.add_float_parameter_entry(
|
118
|
+
name='Current',
|
119
|
+
units='Ampere',
|
120
|
+
encoding=FloatEncoding(bits=32),
|
121
|
+
short_description='Electric current of the battery.'
|
122
|
+
)
|
123
|
+
my_container.add_float_parameter_entry(
|
124
|
+
name='Voltage',
|
125
|
+
units='Volts',
|
126
|
+
encoding=FloatEncoding(bits=32),
|
127
|
+
short_description='Electric voltage of the battery.'
|
128
|
+
)
|
129
|
+
```
|
101
130
|
## Output
|
102
131
|
From the python configuration, the `main.rs`, `service.rs`, `command.rs`, `mod.rs`, `Cargo.toml` and `telemetry.rs` files are generated and are structured accordingly:
|
103
132
|
- rccn_usr_example_app/
|
@@ -155,4 +184,4 @@ Snapshots of the .rs files in the export directory are stored in `/user/`. These
|
|
155
184
|
app.keep_snapshots = 15 # Whatever value you want
|
156
185
|
```
|
157
186
|
|
158
|
-
With the sequence from above, it becomes apperant that changes to the .rs file in the export directory always trump changes to the pymdb config. If for example, a main.rs file is generated for an application with and APID of 42, and this apid is changed in the main.rs file to 45, this change will persist after regenerating from the python config. Even if changes to the pymdb config where made after the changes to the main.rs file.
|
187
|
+
With the sequence from above, it becomes apperant that changes to the .rs file in the export directory always trump changes to the pymdb config. If for example, a main.rs file is generated for an application with and APID of 42, and this apid is changed in the main.rs file to 45, this change will persist after regenerating from the python config. Even if changes to the pymdb config where made after the changes to the main.rs file.
|
@@ -13,10 +13,11 @@ To see whats new, see the [CHANGELOG](CHANGELOG.md).
|
|
13
13
|
## Using the Generator
|
14
14
|
The generator is based on [`pymdb`](https://github.com/yamcs/pymdb) and uses the same structure. Where `pymdb` gives the user freedom in defining systems, subsystems and their respective relations, the definitions for rust code generation is more restricted. For the rust generation, the user is bound to the following classes:
|
15
15
|
- `Application`,
|
16
|
-
- `Service`,
|
17
|
-
- `RCCNCommand
|
16
|
+
- `Service`,
|
17
|
+
- `RCCNCommand`, and
|
18
|
+
- `RCCNContainer`.
|
18
19
|
|
19
|
-
|
20
|
+
The Application and Service classes inherit from pymdb's Subsystem class and extend their functionality. The RCCNCommand extends the Command class and the RCCNContainer extends the Container class of pymdb. This means that an existing pymdb definition can be used to generate rust code by renaming the respective instances. No functionality for pymdb's XTCE generation will be lost.
|
20
21
|
|
21
22
|
A root system may be defined for the satellite.
|
22
23
|
```python
|
@@ -28,7 +29,7 @@ An application can be defined with the following statement.
|
|
28
29
|
```python
|
29
30
|
app = Application(system=root_system, name="ExampleApp", apid=42)
|
30
31
|
```
|
31
|
-
It has the obligatory arguments **system**, **name** and **apid**. After all Applications, Services and RCCNCommands are defined, the rust code generator can be called on the application with `app.generate_rccn_code()`.
|
32
|
+
It has the obligatory arguments **system**, **name** and **apid**. After all Applications, Services and RCCNCommands are defined, the rust code generator can be called on the application with `app.generate_rccn_code(export_directory='.')`.
|
32
33
|
|
33
34
|
### Service
|
34
35
|
|
@@ -65,7 +66,7 @@ my_command = RCCNCommand(
|
|
65
66
|
service.add_command(my_command)
|
66
67
|
```
|
67
68
|
|
68
|
-
The only obligatory
|
69
|
+
The only obligatory argument is **name**. If the subtype assignment is not given, a value will be chosen automatically. The connection to a service can also be achieved with base commands, where every base command must be unique to a service. For example:
|
69
70
|
|
70
71
|
```python
|
71
72
|
base_cmd = RCCNCommand(
|
@@ -82,6 +83,34 @@ my_command = RCCNCommand(
|
|
82
83
|
)
|
83
84
|
```
|
84
85
|
|
86
|
+
### RCCNContainer
|
87
|
+
A container to hold telemetry information can be created with:
|
88
|
+
```python
|
89
|
+
my_container = RCCNContainer(
|
90
|
+
system=service,
|
91
|
+
name='BatteryInformation',
|
92
|
+
short_description='This container holds information on battery voltage and current'
|
93
|
+
)
|
94
|
+
my_container.add_integer_parameter_entry(
|
95
|
+
name='BatteryNumber',
|
96
|
+
minimum=1,
|
97
|
+
maximum=4,
|
98
|
+
encoding=IntegerEncoding(bits=3),
|
99
|
+
short_description='Number of the battery'
|
100
|
+
)
|
101
|
+
my_container.add_float_parameter_entry(
|
102
|
+
name='Current',
|
103
|
+
units='Ampere',
|
104
|
+
encoding=FloatEncoding(bits=32),
|
105
|
+
short_description='Electric current of the battery.'
|
106
|
+
)
|
107
|
+
my_container.add_float_parameter_entry(
|
108
|
+
name='Voltage',
|
109
|
+
units='Volts',
|
110
|
+
encoding=FloatEncoding(bits=32),
|
111
|
+
short_description='Electric voltage of the battery.'
|
112
|
+
)
|
113
|
+
```
|
85
114
|
## Output
|
86
115
|
From the python configuration, the `main.rs`, `service.rs`, `command.rs`, `mod.rs`, `Cargo.toml` and `telemetry.rs` files are generated and are structured accordingly:
|
87
116
|
- rccn_usr_example_app/
|
@@ -139,4 +168,4 @@ Snapshots of the .rs files in the export directory are stored in `/user/`. These
|
|
139
168
|
app.keep_snapshots = 15 # Whatever value you want
|
140
169
|
```
|
141
170
|
|
142
|
-
With the sequence from above, it becomes apperant that changes to the .rs file in the export directory always trump changes to the pymdb config. If for example, a main.rs file is generated for an application with and APID of 42, and this apid is changed in the main.rs file to 45, this change will persist after regenerating from the python config. Even if changes to the pymdb config where made after the changes to the main.rs file.
|
171
|
+
With the sequence from above, it becomes apperant that changes to the .rs file in the export directory always trump changes to the pymdb config. If for example, a main.rs file is generated for an application with and APID of 42, and this apid is changed in the main.rs file to 45, this change will persist after regenerating from the python config. Even if changes to the pymdb config where made after the changes to the main.rs file.
|