juice-simphony 0.1.0__py3-none-any.whl
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.
- juice_simphony/CompositionEngine/Scenario/__init__.py +10 -0
- juice_simphony/CompositionEngine/Scenario/attitude/__init__.py +10 -0
- juice_simphony/CompositionEngine/Scenario/attitude/attitude.py +42 -0
- juice_simphony/CompositionEngine/Scenario/attitude/xml_attitude.py +157 -0
- juice_simphony/CompositionEngine/Scenario/common/__init__.py +10 -0
- juice_simphony/CompositionEngine/Scenario/common/fileHandle.py +69 -0
- juice_simphony/CompositionEngine/Scenario/common/fileHandleEps.py +43 -0
- juice_simphony/CompositionEngine/Scenario/common/fileHandleEps1.py +40 -0
- juice_simphony/CompositionEngine/Scenario/common/fileHandleTml.py +87 -0
- juice_simphony/CompositionEngine/Scenario/common/fileHandleXML.py +69 -0
- juice_simphony/CompositionEngine/Scenario/common/fileName.py +68 -0
- juice_simphony/CompositionEngine/Scenario/common/fileTemplate.py +67 -0
- juice_simphony/CompositionEngine/Scenario/common/utils.py +56 -0
- juice_simphony/CompositionEngine/Scenario/config/__init__.py +10 -0
- juice_simphony/CompositionEngine/Scenario/config/agmCfgFiles.py +30 -0
- juice_simphony/CompositionEngine/Scenario/config/agmIniFile.py +29 -0
- juice_simphony/CompositionEngine/Scenario/config/configuration.py +380 -0
- juice_simphony/CompositionEngine/Scenario/config/epsEvtDefFile.py +45 -0
- juice_simphony/CompositionEngine/Scenario/config/epsFile.py +29 -0
- juice_simphony/CompositionEngine/Scenario/config/mappsIniFile.py +29 -0
- juice_simphony/CompositionEngine/Scenario/definitions/__init__.py +10 -0
- juice_simphony/CompositionEngine/Scenario/definitions/definitions.py +110 -0
- juice_simphony/CompositionEngine/Scenario/definitions/toplevelObsDef.py +28 -0
- juice_simphony/CompositionEngine/Scenario/environment/__init__.py +10 -0
- juice_simphony/CompositionEngine/Scenario/environment/environment.py +310 -0
- juice_simphony/CompositionEngine/Scenario/environment/trajectory.py +206 -0
- juice_simphony/CompositionEngine/Scenario/graphicalPath.py +86 -0
- juice_simphony/CompositionEngine/Scenario/main.py +130 -0
- juice_simphony/CompositionEngine/Scenario/modelling/__init__.py +10 -0
- juice_simphony/CompositionEngine/Scenario/modelling/experiment/experiment.py +44 -0
- juice_simphony/CompositionEngine/Scenario/modelling/experiment/topLevelExpEdf.py +60 -0
- juice_simphony/CompositionEngine/Scenario/modelling/modelling.py +66 -0
- juice_simphony/CompositionEngine/Scenario/modelling/toplevelEdf.py +28 -0
- juice_simphony/CompositionEngine/Scenario/root/__init__.py +10 -0
- juice_simphony/CompositionEngine/Scenario/root/seg_conf.py +262 -0
- juice_simphony/CompositionEngine/Scenario/root/toplevelEvt.py +69 -0
- juice_simphony/CompositionEngine/Scenario/root/toplevelItl.py +75 -0
- juice_simphony/CompositionEngine/Scenario/scenario.py +281 -0
- juice_simphony/CompositionEngine/Scenario/timeline/__init__.py +10 -0
- juice_simphony/CompositionEngine/Scenario/timeline/inst_timeline.py +54 -0
- juice_simphony/CompositionEngine/Scenario/timeline/inst_top_timeline.py +45 -0
- juice_simphony/CompositionEngine/Scenario/timeline/juice_comms.py +89 -0
- juice_simphony/CompositionEngine/Scenario/timeline/plat_prof_timeline.py +66 -0
- juice_simphony/CompositionEngine/Scenario/timeline/segmentation.py +89 -0
- juice_simphony/CompositionEngine/Scenario/timeline/timeline.py +78 -0
- juice_simphony/CompositionEngine/Scenario/timeline/timelineFile.py +51 -0
- juice_simphony/CompositionEngine/SegmentationImporter/SegmentationImporter.py +1469 -0
- juice_simphony/CompositionEngine/SegmentationImporter/__init__.py +10 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/__init__.py +11 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/common/fileHandle.py +69 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/common/fileHandleEps.py +55 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/common/fileName.py +56 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/instToplevelObsDef.py +41 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/obsDefinition.py +95 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/obsDefinitions.py +71 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/profileCsv.py +52 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/segDefinition.py +80 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/timeline.py +100 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/toplevelDefs.py +40 -0
- juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/toplevelObsDef.py +41 -0
- juice_simphony/CompositionEngine/SegmentationImporter/restApiPlan.py +59 -0
- juice_simphony/CompositionEngine/SegmentationImporter/segmentation_profiles.py +851 -0
- juice_simphony/CompositionEngine/SegmentationImporter/shtRestClient.py +576 -0
- juice_simphony/CompositionEngine/__init__.py +10 -0
- juice_simphony/CompositionEngine/trajectory_engine/.gitignore +10 -0
- juice_simphony/CompositionEngine/trajectory_engine/CMakeLists.txt +34 -0
- juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/CMakeLists.txt +48 -0
- juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/EventsFile.cpp +139 -0
- juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/EventsFile.hpp +17 -0
- juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/OrbitDataFile.cpp +190 -0
- juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/OrbitDataFile.hpp +57 -0
- juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/OrbitDefFile.cpp +199 -0
- juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/OrbitDefFile.hpp +58 -0
- juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/TrajectoryEngine.cpp +142 -0
- juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/TrajectoryEngine.hpp +59 -0
- juice_simphony/CompositionEngine/trajectory_engine/README.md +26 -0
- juice_simphony/CompositionEngine/trajectory_engine/Utils/CMakeLists.txt +15 -0
- juice_simphony/CompositionEngine/trajectory_engine/Utils/CommonTypes.hpp +37 -0
- juice_simphony/CompositionEngine/trajectory_engine/Utils/Conversions.hpp +36 -0
- juice_simphony/CompositionEngine/trajectory_engine/Utils/TimeUtils.cpp +1160 -0
- juice_simphony/CompositionEngine/trajectory_engine/Utils/TimeUtils.hpp +196 -0
- juice_simphony/CompositionEngine/trajectory_engine/Utils/rapidcsv.hpp +1431 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceCK.h +155 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceCel.h +441 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceDLA.h +260 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceDSK.h +903 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceDtl.h +251 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceEK.h +448 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceEll.h +115 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceErr.h +141 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceFrm.h +202 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceGF.h +345 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceOccult.h +147 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceOsc.h +86 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpicePln.h +106 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceSPK.h +128 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceSrf.h +94 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceUsr.h +278 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZad.h +209 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZdf.h +260 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZfc.h +13803 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZim.h +1677 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZmc.h +989 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZpl.h +117 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZpr.h +4725 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZrnm.h +82 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZst.h +199 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/f2c.h +683 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/f2cMang.h +390 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/fio.h +107 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/fmt.h +100 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/fp.h +28 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/lio.h +74 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/rawio.h +41 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/signal1.h +118 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/zzalloc.h +133 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/include/zzerror.h +86 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/lib/linux/cspice.a +0 -0
- juice_simphony/CompositionEngine/trajectory_engine/cspice/lib/mac/cspice.a +0 -0
- juice_simphony/CompositionEngine/trajectory_engine/testStub.cpp +37 -0
- juice_simphony/__init__.py +10 -0
- juice_simphony/cli.py +46 -0
- juice_simphony/commons/__init__.py +10 -0
- juice_simphony/commons/commons.py +65 -0
- juice_simphony/data/config_scenario.json +13 -0
- juice_simphony/data/templates/MAPPS_CONF/AGM/CFG_TPL0001A_AGM_CALLISTO.ini +292 -0
- juice_simphony/data/templates/MAPPS_CONF/AGM/CFG_TPL0001A_AGM_EUROPA.ini +292 -0
- juice_simphony/data/templates/MAPPS_CONF/AGM/CFG_TPL0001A_AGM_GANYMEDE.ini +292 -0
- juice_simphony/data/templates/MAPPS_CONF/AGM/CFG_TPL0001A_AGM_JUPITER.ini +309 -0
- juice_simphony/data/templates/MAPPS_CONF/EPS/planning_mtp_mapping.def +92 -0
- juice_simphony/data/templates/MAPPS_CONF/EPS/planning_period_def.xml +239 -0
- juice_simphony/data/templates/MAPPS_CONF/MAPPS/CFG_TPL0001A_CALLISTO_MAPPS.ini +7926 -0
- juice_simphony/data/templates/MAPPS_CONF/MAPPS/CFG_TPL0001A_EUROPA_MAPPS.ini +7926 -0
- juice_simphony/data/templates/MAPPS_CONF/MAPPS/CFG_TPL0001A_GANYMEDE_MAPPS.ini +7944 -0
- juice_simphony/data/templates/MAPPS_CONF/MAPPS/CFG_TPL0001A_JUPITER_MAPPS.ini +7895 -0
- juice_simphony/data/templates/MAPPS_CONF/MAPPS/CFG_TPL0001A_MAPPS.ini +8554 -0
- juice_simphony/data/templates/OBSERVATIONS/JUI/SCENARIO/ODF_JUI_COMMS_template_SXXPYY.def +152 -0
- juice_simphony/data/templates/OBSERVATIONS/JUI/SCENARIO/ODF_NAV_OPNAV_BLOCK_template_SXXPYY.def +21 -0
- juice_simphony/data/templates/OBSERVATIONS/JUI/SCENARIO/ODF_RAD_ON_template_SXXPYY.def +9 -0
- juice_simphony/data/templates/OBSERVATIONS/JUI/SCENARIO/ODF_SCENARIO_JUI_template.def +10 -0
- juice_simphony/data/templates/README.md +2 -0
- juice_simphony/juice_simphony.py +98 -0
- juice_simphony/libs/TrajectoryEngine.dll +0 -0
- juice_simphony/libs/libTrajectoryEngine.dylib +0 -0
- juice_simphony/libs/libTrajectoryEngine.so +0 -0
- juice_simphony/poetry.lock +131 -0
- juice_simphony/spice_interface/__init__.py +10 -0
- juice_simphony/spice_interface/spice_interface.py +204 -0
- juice_simphony-0.1.0.dist-info/LICENSE.txt +212 -0
- juice_simphony-0.1.0.dist-info/METADATA +90 -0
- juice_simphony-0.1.0.dist-info/RECORD +153 -0
- juice_simphony-0.1.0.dist-info/WHEEL +4 -0
- juice_simphony-0.1.0.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
11
|
+
import juice_simphony.CompositionEngine.Scenario.common.utils as utils
|
|
12
|
+
from juice_simphony.CompositionEngine.Scenario.definitions.toplevelObsDef import toplevelObsDef
|
|
13
|
+
from juice_simphony.CompositionEngine.SegmentationImporter.SegmentationImporter import segmentationTimeline
|
|
14
|
+
from juice_simphony.CompositionEngine.Scenario.attitude import xml_attitude as xml_att
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
import os
|
|
18
|
+
|
|
19
|
+
class attitude:
|
|
20
|
+
|
|
21
|
+
def __init__(self, segmentationTimelineInst, root_path, parameters=0):
|
|
22
|
+
self.root_path = root_path
|
|
23
|
+
self.segTimeline = segmentationTimelineInst
|
|
24
|
+
self.parameters = parameters
|
|
25
|
+
self.mainFolderPath = ""
|
|
26
|
+
self.structure = {}
|
|
27
|
+
|
|
28
|
+
def build(self):
|
|
29
|
+
self.createMainFolder('POINTING')
|
|
30
|
+
self.structure["path"] = self.mainFolderPath;
|
|
31
|
+
self.structure["xmlAttitudeFile"] = self.addRootContent()
|
|
32
|
+
return self.structure
|
|
33
|
+
|
|
34
|
+
def createMainFolder(self, folderName):
|
|
35
|
+
self.mainFolderPath = utils.createFolder(self.root_path, folderName)
|
|
36
|
+
|
|
37
|
+
def addRootContent(self):
|
|
38
|
+
xml_seg_attitude = self.segTimeline.getXmlAttitude()
|
|
39
|
+
if xml_seg_attitude["valid"]:
|
|
40
|
+
xml_att_file = xml_att.xml_attitude(self.mainFolderPath, xml_seg_attitude["xml_tree"], self.parameters)
|
|
41
|
+
return xml_att_file.genFile()
|
|
42
|
+
return ""
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
11
|
+
from jinja2 import Template
|
|
12
|
+
import os
|
|
13
|
+
from datetime import datetime
|
|
14
|
+
from xml.etree import ElementTree as et
|
|
15
|
+
import xml.etree.cElementTree as etree
|
|
16
|
+
from xml.dom import minidom
|
|
17
|
+
from copy import deepcopy
|
|
18
|
+
|
|
19
|
+
from juice_simphony.CompositionEngine.Scenario.common.fileHandleEps1 import fileHandleEps1
|
|
20
|
+
from juice_simphony.CompositionEngine.Scenario.common.fileName import fileName
|
|
21
|
+
from juice_simphony.CompositionEngine.Scenario.common.fileHandleXML import fileHandleXML
|
|
22
|
+
|
|
23
|
+
class xml_attitude(fileHandleXML):
|
|
24
|
+
|
|
25
|
+
def __init__(self, path, xml_att_struct, params = 0):
|
|
26
|
+
self.params = {}
|
|
27
|
+
if params!=0:
|
|
28
|
+
self.params.update(params)
|
|
29
|
+
self.path = path
|
|
30
|
+
self.rootPath = path
|
|
31
|
+
self.xml_att_struct = xml_att_struct
|
|
32
|
+
self.params["prefix"] = "PTR"
|
|
33
|
+
self.params["type"] = "SOC"
|
|
34
|
+
self.params["desc"] = ""
|
|
35
|
+
self.params["version"] = "SXXPYY"
|
|
36
|
+
self.params["ext"] = "ptx"
|
|
37
|
+
self.fileName = ""
|
|
38
|
+
self.template = 0
|
|
39
|
+
self.startTime = self.params["startTime"]
|
|
40
|
+
self.endTime = self.params["endTime"]
|
|
41
|
+
self.time_format = "%Y-%m-%dT%H:%M:%S"
|
|
42
|
+
fileName.__init__(self, self.params)
|
|
43
|
+
|
|
44
|
+
def indent(self, elem, level=0):
|
|
45
|
+
i = "\n" + level*" "
|
|
46
|
+
j = "\n" + (level-1)*" "
|
|
47
|
+
if len(elem):
|
|
48
|
+
if not elem.text or not elem.text.strip():
|
|
49
|
+
elem.text = i + " "
|
|
50
|
+
if not elem.tail or not elem.tail.strip():
|
|
51
|
+
elem.tail = i
|
|
52
|
+
for subelem in elem:
|
|
53
|
+
self.indent(subelem, level+1)
|
|
54
|
+
if not elem.tail or not elem.tail.strip():
|
|
55
|
+
elem.tail = j
|
|
56
|
+
else:
|
|
57
|
+
if level and (not elem.tail or not elem.tail.strip()):
|
|
58
|
+
elem.tail = j
|
|
59
|
+
return elem
|
|
60
|
+
|
|
61
|
+
def writeTimelineHeader(self):
|
|
62
|
+
self.writeHeader(self.params["scenarioID"], "JUICE SEGMENTATION ATTITUDE")
|
|
63
|
+
#comment = etree.Comment(' === Some Comment === ')
|
|
64
|
+
#root.insert(1, comment) # 1 is the index where comment is inserted
|
|
65
|
+
self.insertEmptyLine()
|
|
66
|
+
|
|
67
|
+
def write_xml_body(self):
|
|
68
|
+
#print (etree.tostring(self.xml_filtered_att, encoding='utf8', method='xml'))
|
|
69
|
+
#self.indent(self.xml_filtered_att)
|
|
70
|
+
xmlstr = minidom.parseString(etree.tostring(self.xml_filtered_att,encoding="unicode")).toprettyxml(indent = " ")
|
|
71
|
+
line_list = [s for s in xmlstr.splitlines() if s.strip("\r\n").strip()]
|
|
72
|
+
xmlstr = os.linesep.join(line_list)
|
|
73
|
+
# COMMENTED by PE
|
|
74
|
+
#print(xmlstr)
|
|
75
|
+
self.fileHdl.write(xmlstr)
|
|
76
|
+
# et.indent(self.xml_filtered_att, space=' ', level=0)
|
|
77
|
+
# self.fileHdl.write(et.tostring(self.xml_filtered_att,encoding="unicode"))
|
|
78
|
+
|
|
79
|
+
def writeContent(self):
|
|
80
|
+
self.writeTimelineHeader()
|
|
81
|
+
self.xml_filtered_att = self.filterPtr(self.xml_att_struct, self.startTime, self.endTime)
|
|
82
|
+
self.write_xml_body()
|
|
83
|
+
|
|
84
|
+
def filterPtr(self, xml_struct_att, start_time, end_time, cut_block = True):
|
|
85
|
+
start_time_dt = datetime.strptime(start_time, self.time_format)
|
|
86
|
+
end_time_dt = datetime.strptime(end_time, self.time_format)
|
|
87
|
+
|
|
88
|
+
# Get timeline node
|
|
89
|
+
timeline = next(xml_struct_att.iter("timeline"))
|
|
90
|
+
xml_block_list = list(xml_struct_att.iter("block"))
|
|
91
|
+
xml_block_list_out = []
|
|
92
|
+
#xml_block_list_len = len(xml_block_list)
|
|
93
|
+
num_of_filtered_blocks = 0
|
|
94
|
+
for index,xml_block in enumerate(xml_block_list):
|
|
95
|
+
if (xml_block.attrib["ref"] == "SLEW"): continue
|
|
96
|
+
# xml_seg = next(xml_block.iter("segmentation"), None)
|
|
97
|
+
# if not xml_seg == None:
|
|
98
|
+
xml_seg_start_time_dt = datetime.strptime(xml_block.find('startTime').text.strip(), self.time_format)
|
|
99
|
+
xml_seg_end_time_dt = datetime.strptime(xml_block.find('endTime').text.strip(), self.time_format)
|
|
100
|
+
intersect, cutted_block, xml_cut_start_time_dt, xml_cut_end_time_dt = self.intersectTimeRange(start_time_dt, end_time_dt, xml_seg_start_time_dt, xml_seg_end_time_dt, cut_block)
|
|
101
|
+
if intersect:
|
|
102
|
+
if num_of_filtered_blocks >= 1:
|
|
103
|
+
if xml_block_list[index-1].attrib["ref"] == "SLEW":
|
|
104
|
+
xml_block_list_out.append(xml_block_list[index-1])
|
|
105
|
+
num_of_filtered_blocks = num_of_filtered_blocks + 1
|
|
106
|
+
if cutted_block:
|
|
107
|
+
xml_block_start_time = next(xml_block.iter("startTime"), None)
|
|
108
|
+
if not xml_block_start_time == None:
|
|
109
|
+
xml_block_start_time.text = datetime.strftime(xml_cut_start_time_dt, "%Y-%m-%dT%H:%M:%S")
|
|
110
|
+
xml_block_end_time = next(xml_block.iter("endTime"), None)
|
|
111
|
+
if not xml_block_end_time == None:
|
|
112
|
+
xml_block_end_time.text = datetime.strftime(xml_cut_end_time_dt, "%Y-%m-%dT%H:%M:%S")
|
|
113
|
+
xml_block_list_out.append(xml_block)
|
|
114
|
+
last_block_end_time = xml_cut_end_time_dt
|
|
115
|
+
last_block = xml_block_list_out[-1]
|
|
116
|
+
xml_block_end_time = next(last_block.iter("endTime"), None)
|
|
117
|
+
if not xml_block_end_time == None:
|
|
118
|
+
xml_block_end_time.text = datetime.strftime(last_block_end_time, "%Y-%m-%dT%H:%M:%S")
|
|
119
|
+
else:
|
|
120
|
+
end_time_el = et.Element("endTime")
|
|
121
|
+
end_time_el.text = datetime.strftime(last_block_end_time, "%Y-%m-%dT%H:%M:%S")
|
|
122
|
+
last_block.append(end_time_el)
|
|
123
|
+
timeline.clear()
|
|
124
|
+
timeline.attrib["frame"] = "SC";
|
|
125
|
+
timeline.extend(xml_block_list_out)
|
|
126
|
+
|
|
127
|
+
return xml_struct_att
|
|
128
|
+
|
|
129
|
+
def intersectTimeRange(self, startTime, endTime, xml_seg_start_time, xml_seg_end_time, cut_block = True):
|
|
130
|
+
cutted_block = False
|
|
131
|
+
if endTime <= xml_seg_start_time: # st et xml_st xml_et
|
|
132
|
+
return (False, cutted_block, xml_seg_start_time, xml_seg_end_time)
|
|
133
|
+
else:
|
|
134
|
+
if xml_seg_end_time <= startTime: # xml_st xml_et st et
|
|
135
|
+
return (False, cutted_block, xml_seg_start_time, xml_seg_end_time)
|
|
136
|
+
else:
|
|
137
|
+
if cut_block:
|
|
138
|
+
if endTime < xml_seg_end_time: # xml_st et xml_et
|
|
139
|
+
# Cut block end time
|
|
140
|
+
xml_seg_end_time = endTime
|
|
141
|
+
cutted_block = True
|
|
142
|
+
if startTime > xml_seg_start_time: # xml_st st xml_et
|
|
143
|
+
# Cut block start time
|
|
144
|
+
xml_seg_start_time = startTime
|
|
145
|
+
cutted_block = True
|
|
146
|
+
return (True, cutted_block, xml_seg_start_time, xml_seg_end_time)
|
|
147
|
+
|
|
148
|
+
if __name__ == "__main__":
|
|
149
|
+
xml_doc = et.parse(R"Z:\VALIDATION\simphony\pcm\phs_pcm_test_004\input\TMP\CREMA_5_0.xml")
|
|
150
|
+
root = xml_doc.getroot()
|
|
151
|
+
|
|
152
|
+
params = {}
|
|
153
|
+
params["scenarioID"] = "SJS0003C30A"
|
|
154
|
+
params["startTime"] = "2032-09-01T01:00:00"
|
|
155
|
+
params["endTime"] = "2032-09-28T08:00:00"
|
|
156
|
+
#xml_att_file = xml_attitude(path="Z:\VALIDATION\simphony\pcm\phs_pcm_test_001\scenario_generator\output", xml_att_struct=xml_doc.getroot(), params=params)
|
|
157
|
+
#xml_att_file.genFile()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
11
|
+
import configparser
|
|
12
|
+
from jinja2 import Template
|
|
13
|
+
import os
|
|
14
|
+
from juice_simphony.CompositionEngine.Scenario.common.fileName import fileName
|
|
15
|
+
|
|
16
|
+
class fileHandle(fileName):
|
|
17
|
+
|
|
18
|
+
def __init__(self, path, params=0):
|
|
19
|
+
if params!= 0: self.params.update(params)
|
|
20
|
+
self.path = path
|
|
21
|
+
self.fileName = ""
|
|
22
|
+
fileName.__init__(self)
|
|
23
|
+
|
|
24
|
+
def genFile(self):
|
|
25
|
+
|
|
26
|
+
# Generate file name
|
|
27
|
+
self.fileName = self.genBaseFileName() + "." + self.params["ext"]
|
|
28
|
+
destFilePath = os.path.join(self.path, self.fileName)
|
|
29
|
+
#destFilePath = self.path
|
|
30
|
+
|
|
31
|
+
# Open File
|
|
32
|
+
self.fileHdl = open(destFilePath, "w")
|
|
33
|
+
|
|
34
|
+
# Write Content
|
|
35
|
+
self.writeContent()
|
|
36
|
+
|
|
37
|
+
# Close File
|
|
38
|
+
self.fileHdl.close()
|
|
39
|
+
|
|
40
|
+
return destFilePath
|
|
41
|
+
|
|
42
|
+
def loadRefFile(self, filePath):
|
|
43
|
+
with open(filePath) as tplFile:
|
|
44
|
+
self.template = Template(tplFile.read())
|
|
45
|
+
|
|
46
|
+
def writeContent(self):
|
|
47
|
+
a=1
|
|
48
|
+
|
|
49
|
+
def writeHeader(self, title, shortDesc, description=""):
|
|
50
|
+
self.fileHdl.write( "#----------------------------------------------------------------------------------------------------#\n")
|
|
51
|
+
self.fileHdl.write( "# #\n")
|
|
52
|
+
self.fileHdl.write('#{:^100s}#\n'.format(title))
|
|
53
|
+
self.fileHdl.write('#{:^100s}#\n'.format(shortDesc))
|
|
54
|
+
self.fileHdl.write( "# #\n")
|
|
55
|
+
self.fileHdl.write( "#----------------------------------------------------------------------------------------------------#\n")
|
|
56
|
+
|
|
57
|
+
if description != "":
|
|
58
|
+
self.fileHdl.write ("\n")
|
|
59
|
+
|
|
60
|
+
self.fileHdl.write ("#----------------------------------------------------------------------------------------------------#\n")
|
|
61
|
+
self.fileHdl.write ("# DESCRIPTION:\n")
|
|
62
|
+
self.fileHdl.write (description + "\n")
|
|
63
|
+
self.fileHdl.write ("#----------------------------------------------------------------------------------------------------#\n")
|
|
64
|
+
|
|
65
|
+
def insertEmptyLine(self):
|
|
66
|
+
self.fileHdl.write("\n")
|
|
67
|
+
|
|
68
|
+
def insertComment(self,text):
|
|
69
|
+
self.fileHdl.write("# " + text + "\n")
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
from juice_simphony.CompositionEngine.Scenario.common.fileHandle import fileHandle
|
|
14
|
+
|
|
15
|
+
class fileHandleEps(fileHandle):
|
|
16
|
+
def __init__(self, path, params=0):
|
|
17
|
+
if params!= 0: self.params.update(params)
|
|
18
|
+
self.path = path
|
|
19
|
+
fileHandle.__init__(self, path)
|
|
20
|
+
|
|
21
|
+
def insertVersion (self, version = 1):
|
|
22
|
+
self.fileHdl.write("# Timeline version" + "\n")
|
|
23
|
+
self.fileHdl.write("Version: 1" + "\n")
|
|
24
|
+
|
|
25
|
+
def insertTimeWindow (self, startTime, endTime):
|
|
26
|
+
self.fileHdl.write("# Time Window" + "\n")
|
|
27
|
+
self.fileHdl.write("Start_time: " + startTime + "\n")
|
|
28
|
+
self.fileHdl.write("End_time: " + endTime + "\n")
|
|
29
|
+
|
|
30
|
+
def insertInclude(self,params):
|
|
31
|
+
fileNameRel = os.path.relpath(params["filePath"], self.rootPath).replace("\\","/")
|
|
32
|
+
if "fileDescription" in params:
|
|
33
|
+
self.insertEmptyLine()
|
|
34
|
+
self.fileHdl.write("# " + params["fileDescription"] + "\n")
|
|
35
|
+
self.fileHdl.write("Include: " + fileNameRel + "\n")
|
|
36
|
+
|
|
37
|
+
def insertIncludeFile(self,params):
|
|
38
|
+
fileNameRel = os.path.relpath(params["filePath"], self.rootPath).replace("\\","/")
|
|
39
|
+
if "fileDescription" in params:
|
|
40
|
+
self.insertEmptyLine()
|
|
41
|
+
self.fileHdl.write("# " + params["fileDescription"] + "\n")
|
|
42
|
+
self.fileHdl.write("Include_file: " + "\"" + fileNameRel + "\"" + "\n")
|
|
43
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
11
|
+
import os
|
|
12
|
+
from .fileHandle import fileHandle
|
|
13
|
+
|
|
14
|
+
class fileHandleEps1(fileHandle):
|
|
15
|
+
def __init__(self):
|
|
16
|
+
fileHandle.__init__(self,self.path)
|
|
17
|
+
|
|
18
|
+
def insertVersion (self, version = 1):
|
|
19
|
+
self.fileHdl.write("# Timeline version" + "\n")
|
|
20
|
+
self.fileHdl.write("Version: 1" + "\n")
|
|
21
|
+
|
|
22
|
+
def insertTimeWindow (self, startTime, endTime):
|
|
23
|
+
self.fileHdl.write("# Time Window" + "\n")
|
|
24
|
+
self.fileHdl.write("Start_time: " + startTime + "\n")
|
|
25
|
+
self.fileHdl.write("End_time: " + endTime + "\n")
|
|
26
|
+
|
|
27
|
+
def insertInclude(self,params):
|
|
28
|
+
fileNameRel = os.path.relpath(params["filePath"], self.rootPath).replace("\\","/")
|
|
29
|
+
if "fileDescription" in params:
|
|
30
|
+
self.insertEmptyLine()
|
|
31
|
+
self.fileHdl.write("# " + params["fileDescription"] + "\n")
|
|
32
|
+
self.fileHdl.write("Include: " + fileNameRel + "\n")
|
|
33
|
+
|
|
34
|
+
def insertIncludeFile(self,params):
|
|
35
|
+
fileNameRel = os.path.relpath(params["filePath"], self.rootPath).replace("\\","/")
|
|
36
|
+
if "fileDescription" in params:
|
|
37
|
+
self.insertEmptyLine()
|
|
38
|
+
self.fileHdl.write("# " + params["fileDescription"] + "\n")
|
|
39
|
+
self.fileHdl.write("Include_file: " + "\"" + fileNameRel + "\"" + "\n")
|
|
40
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
11
|
+
import os
|
|
12
|
+
from juice_simphony.CompositionEngine.Scenario.common.fileHandleEps import fileHandleEps
|
|
13
|
+
|
|
14
|
+
class fileHandleTml(fileHandleEps):
|
|
15
|
+
def __init__(self, path, params=0):
|
|
16
|
+
if params!= 0: self.params.update(params)
|
|
17
|
+
self.path = path
|
|
18
|
+
self.fileName = ""
|
|
19
|
+
fileHandleEps.__init__(self, self.path, self.params)
|
|
20
|
+
|
|
21
|
+
def insertInitPM (self, param, par_pad, value, value_pad, comment):
|
|
22
|
+
self.fileHdl.write(f'Init_PM: { param : <{par_pad}} {value:<{value_pad}.2f} # {comment}\n')
|
|
23
|
+
|
|
24
|
+
def insertInitMS (self, exp, exp_pad, module, module_pad, mode, mode_pad, comment):
|
|
25
|
+
self.fileHdl.write(f'Init_MS: { exp : <{exp_pad}}{ module : <{module_pad}}{ mode : <{mode_pad}} # {comment}\n')
|
|
26
|
+
|
|
27
|
+
def insertRequestEntry(self,date, exp, mode, action, par_label, par_value, comment):
|
|
28
|
+
comment_lines = comment.splitlines()
|
|
29
|
+
for comment_line in comment_lines:
|
|
30
|
+
if comment_line != "": self.fileHdl.write(f'# {comment_line}\n')
|
|
31
|
+
if 'Z' in date:
|
|
32
|
+
self.fileHdl.write(f'{date} {exp} {mode} {action} ({par_label} = {par_value:12.7f})\n')
|
|
33
|
+
else:
|
|
34
|
+
self.fileHdl.write(f'{date}Z {exp} {mode} {action} ({par_label} = {par_value:12.7f})\n')
|
|
35
|
+
|
|
36
|
+
def insertLine(self,text):
|
|
37
|
+
self.fileHdl.write(text + "\n")
|
|
38
|
+
''''
|
|
39
|
+
# Spacecrat platform initialization
|
|
40
|
+
# ------------------------------------
|
|
41
|
+
|
|
42
|
+
Init_PM: BATTERY_DOD 0.0 # Battery DoD
|
|
43
|
+
Init_MS: JUICE DST_X_R NOM # Antena Receiver always ON
|
|
44
|
+
Init_MS: JUICE PLATFORM ON # Platform ON to enable platform power consumption
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# Set platform profile
|
|
48
|
+
# ---------------------
|
|
49
|
+
2032-01-09T16:44:04Z JUICE * SET_POWER (VALUE=572.9135779720983)
|
|
50
|
+
'''''
|
|
51
|
+
if __name__ == '__main__':
|
|
52
|
+
|
|
53
|
+
param = "BATTERY_DOD"
|
|
54
|
+
par_pad = 8
|
|
55
|
+
value = 0.0
|
|
56
|
+
value_pad = 8
|
|
57
|
+
comment = "Antena Receiver always ON"
|
|
58
|
+
print(f'Init_PM: { param : <{par_pad}} {value:<{value_pad}.2f} # {comment}')
|
|
59
|
+
|
|
60
|
+
exp = "JUICE"
|
|
61
|
+
exp_pad = 8
|
|
62
|
+
module = "DST_X_R"
|
|
63
|
+
module_pad = 9
|
|
64
|
+
mode = "NOM"
|
|
65
|
+
mode_pad = 5
|
|
66
|
+
comment = "Antena Receiver always ON"
|
|
67
|
+
print(f'Init_PM: { exp : <{exp_pad}} { module : <{module_pad}} { mode : <{mode_pad}} # {comment}')
|
|
68
|
+
|
|
69
|
+
exp = "JUICE"
|
|
70
|
+
exp_pad = 8
|
|
71
|
+
module = "PLATFORM"
|
|
72
|
+
module_pad = 9
|
|
73
|
+
mode = "ON"
|
|
74
|
+
mode_pad = 5
|
|
75
|
+
comment = "Platform ON to enable platform power consumption"
|
|
76
|
+
print(f'Init_PM: { exp : <{exp_pad}} { module : <{module_pad}} { mode : <{mode_pad}} # {comment}')
|
|
77
|
+
|
|
78
|
+
date = "2032-01-09T16:44:04Z"
|
|
79
|
+
exp = "JUICE"
|
|
80
|
+
mode = " * "
|
|
81
|
+
action = "SET_POWER"
|
|
82
|
+
par_label = "VALUE"
|
|
83
|
+
par_value = 572.9135779720983
|
|
84
|
+
comment = "This is coming from R[001]"
|
|
85
|
+
print(f'Comment: {comment}')
|
|
86
|
+
# 2032-01-09T16:44:04Z JUICE * SET_POWER (VALUE=572.9135779720983)
|
|
87
|
+
print(f'{date} {exp} {mode} {action} ({par_label} = {par_value:18.13f})')
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
11
|
+
import configparser
|
|
12
|
+
from jinja2 import Template
|
|
13
|
+
import os
|
|
14
|
+
#from common.fileName import fileName
|
|
15
|
+
from juice_simphony.CompositionEngine.Scenario.common.fileName import fileName
|
|
16
|
+
|
|
17
|
+
class fileHandleXML(fileName):
|
|
18
|
+
|
|
19
|
+
def __init__(self, path, params=0):
|
|
20
|
+
if params!= 0: self.params.append(params)
|
|
21
|
+
self.path = path
|
|
22
|
+
self.fileName = ""
|
|
23
|
+
fileName.__init__(self)
|
|
24
|
+
|
|
25
|
+
def genFile(self):
|
|
26
|
+
|
|
27
|
+
# Generate file name
|
|
28
|
+
self.fileName = self.genBaseFileName() + "." + self.params["ext"]
|
|
29
|
+
destFilePath = os.path.join(self.path, self.fileName)
|
|
30
|
+
|
|
31
|
+
# Open File
|
|
32
|
+
self.fileHdl = open(destFilePath, "w")
|
|
33
|
+
|
|
34
|
+
# Write Content
|
|
35
|
+
self.writeContent()
|
|
36
|
+
|
|
37
|
+
# Close File
|
|
38
|
+
self.fileHdl.close()
|
|
39
|
+
|
|
40
|
+
return destFilePath
|
|
41
|
+
|
|
42
|
+
def loadRefFile(self, filePath):
|
|
43
|
+
with open(filePath) as tplFile:
|
|
44
|
+
self.template = Template(tplFile.read())
|
|
45
|
+
|
|
46
|
+
def writeContent(self):
|
|
47
|
+
a=1
|
|
48
|
+
|
|
49
|
+
def writeHeader(self, title, shortDesc, description=""):
|
|
50
|
+
self.fileHdl.write( "<!-- \n")
|
|
51
|
+
self.fileHdl.write( "#----------------------------------------------------------------------------------------------------#\n")
|
|
52
|
+
self.fileHdl.write( "# #\n")
|
|
53
|
+
self.fileHdl.write('#{:^100s}#\n'.format(title))
|
|
54
|
+
self.fileHdl.write('#{:^100s}#\n'.format(shortDesc))
|
|
55
|
+
self.fileHdl.write( "# #\n")
|
|
56
|
+
self.fileHdl.write( "#----------------------------------------------------------------------------------------------------#\n")
|
|
57
|
+
|
|
58
|
+
if description != "":
|
|
59
|
+
self.fileHdl.write ("\n")
|
|
60
|
+
|
|
61
|
+
self.fileHdl.write ("#----------------------------------------------------------------------------------------------------#\n")
|
|
62
|
+
self.fileHdl.write ("# DESCRIPTION:\n")
|
|
63
|
+
self.fileHdl.write (description + "\n")
|
|
64
|
+
self.fileHdl.write ("#----------------------------------------------------------------------------------------------------#\n")
|
|
65
|
+
|
|
66
|
+
self.fileHdl.write( "--> \n")
|
|
67
|
+
|
|
68
|
+
def insertEmptyLine(self):
|
|
69
|
+
self.fileHdl.write("\n")
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
11
|
+
|
|
12
|
+
class fileName():
|
|
13
|
+
|
|
14
|
+
def __init__(self, params=0):
|
|
15
|
+
if params!= 0: self.params.update(params)
|
|
16
|
+
if "addScenarioID" not in self.params: self.params["addScenarioID"] = True
|
|
17
|
+
|
|
18
|
+
# Base File Name Generator
|
|
19
|
+
# ------------------------
|
|
20
|
+
def genBaseFileName(self):
|
|
21
|
+
# General scenario file name structure
|
|
22
|
+
# {prefix}_{type}_{scenarioID}_{desc}_{version}
|
|
23
|
+
type = ""
|
|
24
|
+
desc = ""
|
|
25
|
+
version = ""
|
|
26
|
+
sceID = ""
|
|
27
|
+
if self.params["type"] != "": type = "_" + self.params["type"].upper()
|
|
28
|
+
if self.params["desc"] != "": desc = "_" + self.params["desc"]
|
|
29
|
+
if self.params["version"] != "": version = "_" + str(self.params["version"])
|
|
30
|
+
if self.params["addScenarioID"]: sceID = "_" + self.params["scenarioID"]
|
|
31
|
+
return "{}{}{}{}{}".format(self.params["prefix"],
|
|
32
|
+
type,
|
|
33
|
+
desc,
|
|
34
|
+
sceID,
|
|
35
|
+
version)
|
|
36
|
+
|
|
37
|
+
# Base File Name Without version Generator
|
|
38
|
+
# ----------------------------------------
|
|
39
|
+
def genBaseFileNameNoV(self):
|
|
40
|
+
# General scenario file name structure
|
|
41
|
+
# {prefix}_{type}_{scenarioID}_{desc}_{version}
|
|
42
|
+
type = ""
|
|
43
|
+
desc = ""
|
|
44
|
+
if self.params["type"] != "": type = "_" + self.params["type"].upper()
|
|
45
|
+
if self.params["desc"] != "": desc = "_" + self.params["desc"]
|
|
46
|
+
return "{}{}{}".format(self.params["prefix"],
|
|
47
|
+
type,
|
|
48
|
+
desc)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# Reference File Name Generator
|
|
52
|
+
# -----------------------------
|
|
53
|
+
def genRefFileName(self):
|
|
54
|
+
# General scenario file name structure
|
|
55
|
+
# {prefix}_{type}_{desc}_{refScenarioID}_{version}
|
|
56
|
+
type = ""
|
|
57
|
+
desc = ""
|
|
58
|
+
version = ""
|
|
59
|
+
sceID = ""
|
|
60
|
+
if self.params["type"] != "": type = "_" + self.params["type"].upper()
|
|
61
|
+
if self.params["desc"] != "": desc = "_" + self.params["desc"]
|
|
62
|
+
if self.params["version"] != "": version = "_" + self.params["version"]
|
|
63
|
+
if self.params["addScenarioID"]: sceID = "_" + self.params["refScenarioID"]
|
|
64
|
+
return "{}{}{}{}{}".format(self.params["prefix"],
|
|
65
|
+
type,
|
|
66
|
+
desc,
|
|
67
|
+
sceID,
|
|
68
|
+
version)
|