-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
955 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
<img align="right" height="70" src="../../documents/logos/CEASIOMpy_banner_main.png"> | ||
|
||
# ModuleTemplate | ||
|
||
**Categories:** Template module, Example, Illustration | ||
|
||
**State**: :heavy_check_mark: | ||
|
||
This is a template module. Its purpose is to illustrate how other modules of CEASIOMpy should be structured, set up and documented. | ||
|
||
<p align="center"> | ||
<img height="160" src="files/Spirit_of_St._Louis.jpg"> | ||
</p> | ||
|
||
Example picture. Image in the public domain, from [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Spirit_of_St._Louis.jpg) | ||
|
||
## Inputs | ||
|
||
ModuleTemplate needs no inputs. | ||
|
||
## Analyses | ||
|
||
ModuleTemplate computes nothing. | ||
|
||
## Outputs | ||
|
||
ModuleTemplate outputs nothing. | ||
|
||
## Installation or requirements | ||
|
||
ModuleTemplate is a native CEASIOMpy module, hence it is available and installed by default. | ||
|
||
## Limitations | ||
|
||
ModuleTemplate is limited in every aspect. | ||
|
||
## More information | ||
|
||
* <https://en.wikipedia.org/wiki/Spirit_of_St._Louis> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
from ceasiompy.utils.moduleinterfaces import CPACSInOut | ||
from ceasiompy.utils.commonxpath import CEASIOMPY_XPATH, FUSELAGES_XPATH | ||
|
||
# ===== Module Status ===== | ||
# True if the module is active | ||
# False if the module is disabled (not working or not ready) | ||
module_status = False # Because it is just an example not a real module | ||
|
||
# ===== CPACS inputs and outputs ===== | ||
|
||
cpacs_inout = CPACSInOut() | ||
|
||
include_gui = False | ||
|
||
# ----- Input ----- | ||
|
||
# * In the following example we add three (!) new entries to 'cpacs_inout' | ||
# * Try to use (readable) loops instead of copy-pasting three almost same entries :) | ||
for direction in ["x", "y", "z"]: | ||
cpacs_inout.add_input( | ||
var_name=direction, | ||
var_type=float, | ||
default_value=None, | ||
unit="1", | ||
descr=f"Fuselage scaling on {direction} axis", | ||
xpath=FUSELAGES_XPATH + f"/fuselage/transformation/scaling/{direction}", | ||
gui=include_gui, | ||
gui_name=f"{direction.capitalize()} scaling", | ||
gui_group="Fuselage scaling", | ||
) | ||
|
||
cpacs_inout.add_input( | ||
var_name="test", | ||
var_type=str, | ||
default_value="This is a test", | ||
unit=None, | ||
descr="This is a test of description", | ||
xpath=CEASIOMPY_XPATH + "/test/myTest", | ||
gui=include_gui, | ||
gui_name="My test", | ||
gui_group="Group Test", | ||
) | ||
|
||
cpacs_inout.add_input( | ||
var_name="other_var", | ||
var_type=list, | ||
default_value=[2, 33, 444], | ||
unit="[unit]", | ||
xpath=CEASIOMPY_XPATH + "/test/myList", | ||
gui=include_gui, | ||
gui_name="Choice", | ||
gui_group="My Selection", | ||
) | ||
|
||
# ----- Output ----- | ||
|
||
cpacs_inout.add_output( | ||
var_name="output", | ||
default_value=None, | ||
unit="1", | ||
descr="Description of the output", | ||
xpath=CEASIOMPY_XPATH + "/test/myOutput", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.