rccn-gen 1.2.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.2.0 → rccn_gen-1.3.0}/CHANGELOG.md +5 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/PKG-INFO +35 -6
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/README.md +34 -5
- {rccn_gen-1.2.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.2.0 → rccn_gen-1.3.0}/src/rccn_gen/utils.py +20 -0
- rccn_gen-1.2.0/rccn_usr_bi_x1_cntrl_app/Cargo.toml +0 -17
- rccn_gen-1.2.0/src/rccn_gen/systems.py +0 -725
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/.gitignore +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/.gitlab-ci.yml +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/LICENSE +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/__init__.py +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/cargo_toml/cargo.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/command/command.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/command/command_module_enum.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/command/command_module_struct.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/main/main.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/main/service_module_import_service.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/main/service_module_mod_service.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/main/service_module_register_service.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/mod/mod.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/service/command_module_match_cmd.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/service/service.txt +0 -0
- {rccn_gen-1.2.0 → rccn_gen-1.3.0}/src/rccn_gen/text_modules/telemetry/telemetry.txt +0 -0
@@ -1,5 +1,10 @@
|
|
1
1
|
# CHANGE LOG
|
2
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
|
+
|
3
8
|
## [1.2.0] - 2025-05-05
|
4
9
|
- Added argument hints for RCCNCommand, Service and RCCNContainer
|
5
10
|
- New create_and_add_service() method for the Application
|
@@ -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
|
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/
|
@@ -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
|
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/
|