rccn-gen 1.3.1__tar.gz → 1.3.3__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.3.1 → rccn_gen-1.3.3}/CHANGELOG.md +8 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/PKG-INFO +2 -2
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/pyproject.toml +2 -2
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/systems.py +30 -5
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/cargo_toml/cargo.txt +6 -3
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/.gitignore +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/.gitlab-ci.yml +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/README.md +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/LICENSE +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/__init__.py +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/command/command.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/command/command_module_enum.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/command/command_module_struct.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/main/main.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/main/service_module_import_service.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/main/service_module_mod_service.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/main/service_module_register_service.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/mod/mod.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/service/command_module_match_cmd.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/service/service.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/telemetry/telemetry.txt +0 -0
- {rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/utils.py +0 -0
@@ -1,5 +1,13 @@
|
|
1
1
|
# CHANGE LOG
|
2
2
|
|
3
|
+
### [1.3.3] - 2025-05-26
|
4
|
+
- Fixed toml file error. Added new create_toml_file method for the Application class.
|
5
|
+
- Updated minimum required python version
|
6
|
+
- Updated toml file contents
|
7
|
+
|
8
|
+
### [1.3.2] - 2025-05-26
|
9
|
+
- Fixed base command hinheritance bug
|
10
|
+
|
3
11
|
### [1.3.1] - 2025-05-15
|
4
12
|
- Added documentation for utils.py
|
5
13
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: rccn_gen
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.3
|
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
|
@@ -8,7 +8,7 @@ Author-email: Fabian Krech <f.krech@tu-berlin.de>
|
|
8
8
|
License-Expression: GPL-3.0
|
9
9
|
Classifier: Operating System :: OS Independent
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
11
|
-
Requires-Python: >=3.
|
11
|
+
Requires-Python: >=3.12
|
12
12
|
Requires-Dist: case-converter>=1.2.0
|
13
13
|
Requires-Dist: inflect>=7.5.0
|
14
14
|
Requires-Dist: yamcs-pymdb>=0.1.0
|
@@ -4,13 +4,13 @@ build-backend = "hatchling.build"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "rccn_gen"
|
7
|
-
version = "1.3.
|
7
|
+
version = "1.3.3"
|
8
8
|
authors = [
|
9
9
|
{ name="Fabian Krech", email="f.krech@tu-berlin.de" },
|
10
10
|
]
|
11
11
|
description = "A python based generator for RACCOON OS source files in Rust from yamcs-pymdb config files."
|
12
12
|
readme = "README.md"
|
13
|
-
requires-python = ">=3.
|
13
|
+
requires-python = ">=3.12"
|
14
14
|
dependencies = [
|
15
15
|
"yamcs-pymdb>=0.1.0",
|
16
16
|
"inflect>=7.5.0",
|
@@ -169,6 +169,9 @@ class Application(Subsystem):
|
|
169
169
|
'main_template': os.path.join(self.text_modules_main_path, 'main.txt'),
|
170
170
|
'cargo_toml': os.path.join(self.export_directory, 'rccn_usr_'+snakecase(self.name), 'Cargo.toml'),
|
171
171
|
'cargo_toml_template': os.path.join(self.text_modules_path, 'cargo_toml', 'cargo.txt'),
|
172
|
+
'cargo_toml_generated_snapshot': os.path.join(self.snapshot_directory, 'generated', 'rccn_usr_'+snakecase(self.name), 'cargo.toml'),
|
173
|
+
'cargo_toml_user_snapshot': os.path.join(self.user_snapshot_path(), 'rccn_usr_'+snakecase(self.name), 'cargo.toml'),
|
174
|
+
'cargo_toml_diff': os.path.join(self.diff_directory, 'rccn_usr_'+snakecase(self.name), 'cargo.diff'),
|
172
175
|
}
|
173
176
|
return paths
|
174
177
|
|
@@ -407,12 +410,34 @@ class Application(Subsystem):
|
|
407
410
|
|
408
411
|
def generate_cargo_toml_file(self):
|
409
412
|
"""
|
410
|
-
Generate the
|
413
|
+
Generate the cargo.toml file for the application.
|
414
|
+
|
415
|
+
Performs several tasks:
|
416
|
+
1. Creates diff file if both current and snapshot files exist
|
417
|
+
2. Creates snapshot of current main with user changes if snapshots are enabled
|
418
|
+
3. Generates new cargo.toml file from template
|
419
|
+
4. Creates snapshot of newly generated main if snapshots are enabled
|
420
|
+
5. Applies user changes from diff file if rebase_changes is enabled
|
411
421
|
"""
|
422
|
+
# Create cargo_toml.diff file
|
423
|
+
if os.path.exists(self.file_paths()['cargo_toml']) and os.path.exists(self.file_paths()['cargo_toml_generated_snapshot']):
|
424
|
+
os.maked(os.path.dirname(self.file_paths()['cargo_toml_diff']), exist_ok=True)
|
425
|
+
self.generate_diff_file('cargo_toml', 'cargo_toml_generated_snapshot', 'cargo_toml_diff')
|
426
|
+
# Create snapshot of cargo_toml with user changes if instructed
|
427
|
+
if self.snapshots and os.path.exists(self.file_paths()['cargo_toml']):
|
428
|
+
self.generate_snapshot('cargo_toml', 'cargo_toml_user_snapshot')
|
429
|
+
# Generate cargo_toml file
|
412
430
|
with open(self.file_paths()['cargo_toml_template'], 'r') as file:
|
413
431
|
cargo_toml_template_text = file.read()
|
414
432
|
with open(self.file_paths()['cargo_toml'], 'w') as file:
|
415
|
-
|
433
|
+
new_cargo_toml_text = self.find_and_replace_keywords(cargo_toml_template_text)
|
434
|
+
file.write("".join(new_cargo_toml_text))
|
435
|
+
# Create snapshot of newly generated cargo_toml if instructed
|
436
|
+
if self.snapshots:
|
437
|
+
self.generate_snapshot('cargo_toml', 'cargo_toml_generated_snapshot')
|
438
|
+
# Rebase cargo_toml.diff on cargo_toml if instructed
|
439
|
+
if self.rebase_changes and os.path.exists(self.file_paths()['cargo_toml_diff']):
|
440
|
+
os.system('patch '+self.file_paths()['cargo_toml']+' < '+self.file_paths()['cargo_toml_diff'])
|
416
441
|
|
417
442
|
|
418
443
|
class Service(Subsystem):
|
@@ -974,7 +999,7 @@ class RCCNCommand(Command):
|
|
974
999
|
- If no subtype is provided, a unique one will be assigned automatically
|
975
1000
|
- The command's APID is automatically set to match the service's application APID
|
976
1001
|
"""
|
977
|
-
if
|
1002
|
+
if self.init_kwargs['base'] is None and not any(command.name == 'base' for command in service.commands):
|
978
1003
|
print("RCCN-Information: Command \'"+self.init_kwargs['name']+"\' doesn\'t have a base argument and no base command was found in service \'"+service.name+"\'.\nStandard base command will be created with system = \'"+service.name+"\' and type = "+str(service.service_id)+".")
|
979
1004
|
self.init_kwargs['base'] = Command(
|
980
1005
|
system=service,
|
@@ -983,7 +1008,7 @@ class RCCNCommand(Command):
|
|
983
1008
|
base='/PUS/pus-tc',
|
984
1009
|
assignments={'type': service.service_id}
|
985
1010
|
)
|
986
|
-
elif
|
1011
|
+
elif self.init_kwargs['base'] is None and any(command.name == 'base' for command in service.commands):
|
987
1012
|
print("RCCN-Information: Command \'"+self.init_kwargs['name']+"\' doesn\'t have a \'base\' argument. Existing base command for service \'"+service.name+"\' will be used.")
|
988
1013
|
self.init_kwargs['base'] = next(command for command in service.commands if command.name == 'base')
|
989
1014
|
if 'system' in self.init_kwargs and isinstance(self.init_kwargs['system'], Service):
|
@@ -991,7 +1016,7 @@ class RCCNCommand(Command):
|
|
991
1016
|
else:
|
992
1017
|
super().__init__(system=service, *self.init_args, **self.init_kwargs)
|
993
1018
|
self.assignments['apid'] = self.system.system.apid
|
994
|
-
if not 'subtype' in self.assignments and self.name
|
1019
|
+
if not 'subtype' in self.assignments and self.name != 'base':
|
995
1020
|
used_subtypes = [command.assignments['subtype'] if 'subtype' in command.assignments else None for command in self.system.rccn_commands()]
|
996
1021
|
new_subtype = 1
|
997
1022
|
while new_subtype in used_subtypes:
|
@@ -1,7 +1,7 @@
|
|
1
1
|
[package]
|
2
|
-
name = "
|
2
|
+
name = "rccn_user_<<VAR_APP_NAME_SCASE>>"
|
3
3
|
version = "0.1.0"
|
4
|
-
edition = "
|
4
|
+
edition = "2025"
|
5
5
|
|
6
6
|
[dependencies]
|
7
7
|
anyhow = "1.0.91"
|
@@ -14,4 +14,7 @@ spacepackets = "0.12.0"
|
|
14
14
|
tokio = "1.41.1"
|
15
15
|
env_logger = { version = "0.11.7", default-features = false, features = ["color", "humantime"] }
|
16
16
|
num-derive = "0.4"
|
17
|
-
num-traits = "0.2"
|
17
|
+
num-traits = "0.2"
|
18
|
+
rccn_usr_bitstruct_derive = { version = "0.1.0", path = "../rccn_usr_bitstruct_derive" }
|
19
|
+
rccn_usr_pus_macros = { version = "0.1.0", path = "../rccn_usr_pus_macros" }
|
20
|
+
chrono = "0.4.40"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/command/command_module_struct.txt
RENAMED
File without changes
|
File without changes
|
{rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/main/service_module_import_service.txt
RENAMED
File without changes
|
{rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/main/service_module_mod_service.txt
RENAMED
File without changes
|
{rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/main/service_module_register_service.txt
RENAMED
File without changes
|
File without changes
|
{rccn_gen-1.3.1 → rccn_gen-1.3.3}/src/rccn_gen/text_modules/service/command_module_match_cmd.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|