Skip to content
Snippets Groups Projects
Commit 7ad8963c authored by Kristina Mazur's avatar Kristina Mazur
Browse files

Initial version :tada:

- Add report_generator & repo CMakeLists and CMakePreset
- Add submodule libs, gitignore, gitmodules, git attributes
- Add pipeline for documentation
- Add LICENCE
- Minor updates in report_generator.cpp to due airfoil directory changes
parent 91b4466b
Branches
Tags 0.1.0
1 merge request!11Initial open source version
Showing
with 7727 additions and 0 deletions
# Exclude all binaries from the diff
*.exe binary
*.dll binary
*.so binary
*.a binary
# Project specific
projects/
*.log
# IDE Files
.vscode
.pdb
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Build directories
build
# Python artifacts
__pycache__
# CMake user files
CMakeUserPresets.json
[submodule "libs"]
path = libs
url = ssh://git@git.rwth-aachen.de/unicado/libraries.git
# Set a recent minimum version
cmake_minimum_required(VERSION 3.29)
# Start the project
project(utilities
VERSION 0.5.0
DESCRIPTION "Utilities for UNICADO"
LANGUAGES CXX
)
# set the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# When GCC is used, check if the version is 10.2.0 or higher
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Check GCC to have filesystem support
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.2.0)
message(FATAL_ERROR "[${PROJECT_NAME}] -> GCC version 10.2.0 or higher is required!")
endif()
endif()
# Disable the min and max macros when building with MSVC
if(MSVC)
add_compile_definitions(NOMINMAX)
endif()
# *optional* Add cppcheck and cpplint
# set(CMAKE_CXX_CPPCHECK "cppcheck")
# set(CMAKE_CXX_CPPLINT "cpplint")
# Option for blackbox testing
option(BUILD_BLACKBOXTESTS "Use blackbox testing" OFF)
# Option for unit testing
option(BUILD_UNITTEST "Use unit testing" OFF)
# Option where to look for the libraries
option(FIND_LIBRARIES_AS_PACKAGE "If true the libraries are included with find_package(), otherwise the submodule is used." OFF)
# *** Important ***
# Add the libraries
if (FIND_LIBRARIES_AS_PACKAGE)
find_package(UnicadoLibs REQUIRED)
else()
add_subdirectory(libs)
endif()
#=== Googletest setup ===
if(BUILD_BLACKBOXTESTS OR BUILD_UNITTEST)
message(STATUS "[${PROJECT_NAME}] -> Building tests")
# Download and unpack googletest at configure time
include(FetchContent)
FetchContent_Declare(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.13.0
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
# *optional* Add gtest to ctest
# enable_testing()
# include(GoogleTest)
endif()
# Add all modules
#add_subdirectory(cpacsInterface)
#add_subdirectory(cpacsInterface/convertUNICADO2CPACS)
#add_subdirectory(designEvaluator)
add_subdirectory(report_generator)
# The parameterStudyMgr is not part of new releases
# add_subdirectory(parameterStudyMgr)
{
"version": 6,
"configurePresets": [
{
"name": "unix-common",
"description": "Common settings for Unix compilers",
"hidden": true,
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-fexceptions -fno-builtin"
}
},
{
"name": "unix-debug",
"description": "Base settings for building debug configuration with Unix compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS_DEBUG": "-Wextra -Wsign-conversion -Wfloat-equal -g"
}
},
{
"name": "unix-release",
"description": "Base settings for building release configuration with Unix compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS_RELEASE": "-O2 -s"
}
},
{
"name": "windows-common",
"description": "Common settings for Windows compilers",
"hidden": true,
"binaryDir": "${sourceDir}/build",
"generator": "Visual Studio 17 2022",
"toolset": "ClangCL",
"toolchainFile": "C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"Python_EXECUTABLE": {"type": "FILEPATH", "value": "$ENV{HOMEPATH}/AppData/Local/Programs/Python/Python311/python.exe"},
"CMAKE_CXX_FLAGS": "/permissive- /EHsc"
}
},
{
"name": "windows-debug",
"description": "Base settings for building debug configuration with Windows compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS_DEBUG": "/W4"
}
},
{
"name": "windows-release",
"description": "Base settings for building release configuration with Windows compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS_RELEASE": "/O2"
}
},
{
"name": "x64-linux-debug",
"description": "Default debug configuration for building on Linux",
"generator": "Unix Makefiles",
"inherits": ["unix-common", "unix-debug"]
},
{
"name": "x64-linux-release",
"description": "Default release configuration for building on Linux",
"generator": "Unix Makefiles",
"inherits": ["unix-common", "unix-release"]
},
{
"name": "x64-mingw-debug",
"description": "Default debug configuration for building with MSYS2/MinGW on Windows",
"generator": "MinGW Makefiles",
"inherits": ["unix-common", "unix-debug"]
},
{
"name": "x64-mingw-release",
"description": "Default release configuration for building with MSYS2/MinGW on Windows",
"generator": "MinGW Makefiles",
"inherits": ["unix-common", "unix-release"]
},
{
"name": "x64-windows-debug",
"description": "Default debug configuration for building on Windows",
"architecture": "x64",
"inherits": ["windows-common", "windows-debug"]
},
{
"name": "x64-windows-release",
"description": "Default release configuration for building on Windows",
"architecture": "x64",
"inherits": ["windows-common", "windows-release"]
}
],
"buildPresets": [
{
"name": "x64-linux-debug",
"description": "Sets the build type to Debug for the Linux build system.",
"configurePreset": "x64-linux-debug"
},
{
"name": "x64-linux-release",
"description": "Sets the build type to Release for the Linux build system.",
"configurePreset": "x64-linux-release"
},
{
"name": "x64-windows-debug",
"description": "Sets the build type to Debug for the Windows build system.",
"configurePreset": "x64-windows-debug",
"configuration": "Debug"
},
{
"name": "x64-windows-release",
"description": "Sets the build type to Release for the Windows build system.",
"configurePreset": "x64-windows-release",
"configuration": "Release"
}
]
}
LICENSE 0 → 100644
This diff is collapsed.
# Copyright (c) UNICADO 2024
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# === Configure pipeline ===
stages:
- deploy
# === Trigger the website deployment when new commit to default branch ===
trigger_documentation:
stage: deploy
image: alpine:latest
tags:
- documentation
before_script:
- apk update && apk add curl
script:
- "curl --fail --request POST --form token=$TRIGGER_DEPLOY_WEBSITE --form ref=main https://git.rwth-aachen.de/api/v4/projects/87829/trigger/pipeline"
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: on_success
libs @ 09182177
Subproject commit 09182177118a6b41e3ae2a097c324541741c9888
# Set name of executable
set(MODULE_NAME report_generator)
# ==============================================
# Add the module executable
#
# *** IMPORTANT ***
# -> Change *.cpp files according to the module
# -> Add main.cpp later since this list is also
# used for the tests
# ==============================================
set(MODULE_SOURCES
src/report_generator.cpp
)
add_executable(${MODULE_NAME}
${MODULE_SOURCES}
src/main.cpp
src/resources.rc
)
# Link the runtime libraries -> Use the actual needed libraries
target_link_libraries(${MODULE_NAME}
PRIVATE
UnicadoLibs::aixml
UnicadoLibs::runtimeInfo
UnicadoLibs::standardFiles
UnicadoLibs::moduleBasics
UnicadoLibs::aircraftGeometry2
)
# Add the other compile definitions, e.g. USE_GNUPLOT
target_compile_definitions(${MODULE_NAME} PRIVATE _POSIX_THREAD_SAFE_FUNCTIONS)
# Set the location where the executable will be placed to the current source directory
set_target_properties(${MODULE_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}$<0:>
)
# Add the tests if enabled
if(BUILD_UNITTEST)
add_subdirectory(test)
endif()
# Add the installation rules
install(TARGETS ${MODULE_NAME} DESTINATION ${MODULE_NAME})
install(FILES ${MODULE_NAME}_conf.xml DESTINATION ${MODULE_NAME})
# Find and include all dependet libraries if dynamically linked
if(BUILD_SHARED_LIBS)
# Install the runtime dependencies
install(RUNTIME_DEPENDENCY_SET ${MODULE_NAME}_dependencies)
endif()
# Find and include all system runtime libraries if enabled
if(PACKAGE_SYSTEM_LIBRARIES)
# Install the runtime dependencies
install( RUNTIME_DEPENDENCY_SET ${MODULE_NAME}_dependencies
PRE_INCLUDE_REGEXES "libgcc.*" "libstdc.*" "libwinpthread.*"
PRE_EXCLUDE_REGEXES ".*\.dll" ".*\.so" # Skip all other system libs for now
DIRECTORIES ${SYSTEM_LIBS_PATH}
DESTINATION softwareTools/${MODULE_NAME}
)
endif()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>UNICADO Report</title>
<link href="style.css" rel="stylesheet" />
</head>
<body>
<div class="logo"></div>
<div class="content">
<h1>UNICADO Report
<font size="2">Version #number
</h1>
<div class="container">
<div class="box data">
<div class="left">
<h2>Top Level Aircraft Requirements (TLARs)</h2>
<div class="left">
<button class="select-items-btn" onclick="openPopup()">Select TLARs</button>
<button class="select-items-btn" onclick="resetSelection()">Reset Selection</button>
<div class="popup" id="popup">
<div class="popup-content">
<button class="close-btn" onclick="closePopup()">x</button>
<div id="dropdownContent" class="dropdown-content">
<label><input type="checkbox" value="maximum structrual payload mass" data-value="30000" data-unit="kg" data-lower="100" data-upper="150000" checked> maximum_structrual_payload_mass</label>
<label><input type="checkbox" value="takeoff distance" data-value="2122" data-unit="m" data-lower="600" data-upper="5000" checked> takeoff_distance</label>
<label><input type="checkbox" value="landing field length" data-value="2387" data-unit="m" data-lower="600" data-upper="5000"> landing_field_length</label>
</div>
</div>
</div>
</div>
<table class="content-table" id="resultTable">
<thead>
<tr>
<th>Item</th>
<th>Value</th>
<th>Unit</th>
<th>Lower Bound</th>
<th>Upper Bound</th>
</tr>
</thead>
<tbody>
<!-- Selected items will be inserted here -->
</tbody>
</table>
</div>
<div class="right">
<h2>Mission Profile</h2>
</div>
</div>
<div class="box link">
<div class="right">
<h2>Aircraft Specifications</h2>
<div class="left">
<button class="cluster-selection off" id="assessment" onclick="toggleButton(this)">Assessment</button>
<button class="cluster-selection off" id="sizingPoint" onclick="toggleButton(this)">Sizing Point</button>
<button class="cluster-selection off" id="aerodynamics" onclick="toggleButton(this)">Aerodynamics</button>
<button class="cluster-selection off" id="liftCoefficients" onclick="toggleButton(this)">Lift Coefficients</button>
<button class="cluster-selection off" id="masses" onclick="toggleButton(this)">Masses</button>
</div>
<table class="content-table" id="aircraftTable">
<thead>
<tr>
<th>Item</th>
<th>Value</th>
<th>Unit</th>
</tr>
</thead>
<tbody>
<!-- Selected items will be inserted here -->
</tbody>
</table>
</div>
<div class="right">
<h2>Aircraft Views</h2>
<div class="left" id="3d-view-container">
<!-- Placeholder for 3D model -->
<canvas id="3d-canvas" style="width: 100%; height: 100%;"></canvas>
</div>
<button class="select-items-btn" onclick="switchImage()">Switch View</button>
</div>
<div class="right">
<h3>More Information</h3>
<h4>Explore detailed reports:</h4>
<ul id = "list of linked reports">
<li><a href = "../../aircraftDesign/projects/reporting/reportHTML/calculateEmissions_report.html" target = "_blank">calculateEmissions report </a> </li>
<li><a href = "../../aircraftDesign/projects/reporting/reportHTML/calculatePerformance_report.html" target = "_blank">calculatePerformance report </a> </li>
<li><a href = "../../aircraftDesign/projects/reporting/reportHTML/calculatePolar_report.html" target = "_blank">calculatePolar report </a> </li>
</ul>
</div>
</div>
</div>
</div>
<script async src="https://cdn.jsdelivr.net/npm/es-module-shims@1.6.3/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three@0.154.0/build/three.module.js",
"stl-loader": "https://cdn.jsdelivr.net/npm/three@0.154.0/examples/jsm/loaders/STLLoader.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.154.0/examples/jsm/"
}
}
</script>
<script type="module">
import * as THREE from 'three';
import { STLLoader } from 'stl-loader';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; // Import OrbitControls
// Get the canvas element where the 3D model will be displayed
const canvas = document.getElementById('3d-canvas');
// Create scene
const scene = new THREE.Scene();
// Create an Orthographic Camera for isometric view
const aspectRatio = window.innerWidth / window.innerHeight;
const zoom = 15; // Controls the "zoom" (distance) of the scene
const camera = new THREE.OrthographicCamera(
-zoom * aspectRatio, // left
zoom * aspectRatio, // right
zoom, // top
-zoom, // bottom
1, // near plane
1000 // far plane
);
// Position the camera for an isometric view
camera.position.set(0, -75, 45); // Position at an angle to get an isometric view
camera.lookAt(0, 0, 0);
// Set up renderer to use the canvas
const renderer = new THREE.WebGLRenderer({ canvas: canvas });
renderer.setClearColor(0xecf0f1, 1);
// Dynamically set the size of the renderer based on the canvas size
const resizeRenderer = () => {
const width = canvas.clientWidth;
const height = canvas.clientHeight;
renderer.setSize(width, height);
camera.aspect = width / height;
camera.updateProjectionMatrix();
};
// Initialize OrbitControls (for interactivity)
const controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true; // Add smooth motion
controls.dampingFactor = 0.1; // Smooth factor
controls.screenSpacePanning = false; // Don't allow panning in screen space
// Initialize renderer size
resizeRenderer();
// Step 2: Create a light source
const light = new THREE.AmbientLight(0x404040); // Ambient light
scene.add(light);
const directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position.set(1, 1, 1).normalize();
scene.add(directionalLight);
// Step 3: Load the STL file using STLLoader
const loadObject = () => {
const loader = new STLLoader();
loader.load("AircraftMesh.stl", function (geometry) {
const material = new THREE.MeshStandardMaterial({ color: 0x2f7ecc, flatShading: true });
// Step 5: Create the mesh from geometry and material
const mesh = new THREE.Mesh(geometry, material);
// Create a group to center the rotation around the mesh's center
const group = new THREE.Group();
scene.add(group); // Add the group to the scene
// Compute the bounding box of the mesh to get the center
geometry.computeBoundingBox();
const center = geometry.boundingBox.getCenter(new THREE.Vector3());
// Center the mesh within the group by adjusting its position
mesh.position.sub(center); // Move the mesh so its center is at the origin of the group
// Add the mesh to the group
group.add(mesh);
// Adjust the camera to view the model
camera.position.z = 25;
camera.position.y = -25;
camera.position.x = -1;
camera.lookAt(0, 0, 0); // Ensure camera is facing the center of the model
// Animation loop
function animate() {
requestAnimationFrame(animate);
// Rotate the group (the mesh will rotate around the group’s origin)
// group.rotation.x += 0.01; // Rotate on the x-axis
// group.rotation.y += 0.01; // Rotate on the y-axis
group.rotation.z += 0.001;
renderer.render(scene, camera);
}
animate();
}, undefined, (error) => {
console.error('An error occurred while loading the STL file:', error);
});
};
// Load the object when the script is ready
loadObject();
// Step 8: Handle window resizing
window.addEventListener('resize', () => {
renderer.setSize(window.innerWidth, window.innerHeight);
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
});
</script>
<script>
const clusters = {
assessment: [
{ item: "Assessment Item 1", value: "100", unit: "kg" },
{ item: "Assessment Item 2", value: "200", unit: "kg" }
],
sizingPoint: [
{ item: "Sizing Point Item 1", value: "1500", unit: "m" },
{ item: "Sizing Point Item 2", value: "2000", unit: "m" }
],
aerodynamics: [
{ item: "Aerodynamics Item 1", value: "1.25", unit: "m/s²" },
{ item: "Aerodynamics Item 2", value: "1.40", unit: "m/s²" }
],
liftCoefficients: [
{ item: "Lift Coefficient Item 1", value: "0.4", unit: "" },
{ item: "Lift Coefficient Item 2", value: "0.5", unit: "" }
],
masses: [
{ item: "Mass Item 1", value: "2000", unit: "kg" },
{ item: "Mass Item 2", value: "2500", unit: "kg" }
]
};
let initialCheckedState = []; // Store initial state of checkboxes
// Function to store the initial checked state of each checkbox
function storeInitialState() {
const checkboxes = document.querySelectorAll('.dropdown-content input[type="checkbox"]');
checkboxes.forEach(checkbox => {
initialCheckedState.push({
checkbox: checkbox,
checked: checkbox.checked
});
});
}
// Function to reset the checkboxes and table to initial state
function resetSelection() {
// Restore the initial checked state
initialCheckedState.forEach(state => {
state.checkbox.checked = state.checked; // Set each checkbox to its initial checked state
});
// Update the table based on the restored checked items
updateTable();
}
// Get references to popup and its content
const popup = document.getElementById('popup');
// Function to open the popup
function openPopup() {
popup.style.display = 'flex';
}
// Function to close the popup
function closePopup() {
popup.style.display = 'none';
}
// Function to update the table automatically when a checkbox is clicked
function updateTable() {
const resultTableBody = document.getElementById('resultTable').getElementsByTagName('tbody')[0];
resultTableBody.innerHTML = ''; // Clear the table
// Get the checked checkboxes
const checkedItems = Array.from(document.querySelectorAll('.dropdown-content input[type="checkbox"]:checked'));
// Insert checked items into the table
checkedItems.forEach(checkbox => {
const item = checkbox.value;
const value = checkbox.getAttribute('data-value');
const unit = checkbox.getAttribute('data-unit');
const lower = checkbox.getAttribute('data-lower');
const upper = checkbox.getAttribute('data-upper');
const row = resultTableBody.insertRow();
row.insertCell(0).textContent = item;
row.insertCell(1).textContent = value;
row.insertCell(2).textContent = unit;
row.insertCell(3).textContent = lower;
row.insertCell(4).textContent = upper;
});
}
// Add event listeners to all checkboxes
popup.querySelectorAll('input[type="checkbox"]').forEach(checkbox => {
checkbox.addEventListener('change', updateTable);
});
function toggleButton(button) {
const clusterKey = button.id;
if (button.classList.contains('off')) {
button.classList.remove('off');
button.classList.add('on');
displayCluster(clusterKey, true);
} else {
button.classList.remove('on');
button.classList.add('off');
displayCluster(clusterKey, false);
}
}
// Function to display or hide a cluster in the table
function displayCluster(clusterKey, show) {
const tableBody = document.getElementById('aircraftTable').getElementsByTagName('tbody')[0];
if (show) {
clusters[clusterKey].forEach(item => {
// Ensure each row has a unique `data-cluster` value
const row = tableBody.insertRow();
row.insertCell(0).textContent = item.item;
row.insertCell(1).textContent = item.value;
row.insertCell(2).textContent = item.unit;
row.dataset.cluster = clusterKey; // Set the cluster key as a data attribute
});
} else {
// Delete rows that belong to the cluster being hidden
const rows = tableBody.getElementsByTagName('tr');
for (let i = rows.length - 1; i >= 0; i--) { // Loop backwards to avoid skipping rows
const row = rows[i];
if (row.dataset.cluster === clusterKey) {
tableBody.deleteRow(i);
}
}
}
}
// Store all images
const images = document.querySelectorAll('.aircraft-image');
let currentIndex = 0; // Keep track of which image is currently visible
// Function to switch to the next image
function switchImage() {
// Hide the current image
images[currentIndex].style.display = 'none';
// Increment index, and if we reach the end, loop back to the first image
currentIndex = (currentIndex + 1) % images.length;
// Show the next image
images[currentIndex].style.display = 'block';
}
window.onload = function() {
storeInitialState();
updateTable();
}
</script>
</body>
</html>
*, *:before, *:after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
background-color: #2a2d33;
font-family: system-ui, sans-serif;
font-size: 1.3rem;
color: #2c3e50;
line-height: 1.3;
background-size: cover;
}
table {
margin-left: 0;
margin-right: auto;
}
.logo {
background-image: url('inc/logos/UNICADO_logo.svg');
height: 75vh;
width: 100%;
opacity: 0.2;
filter: grayscale(100%);
background-size: contain;
background-repeat: no-repeat;
background-position: center center;
position: relative center;
}
.content {
position: absolute;
width: 98%;
height: 85%;
top: 0rem;
left: 1rem;
padding-left: 0rem;
box-sizing: border-box;
min-width: fit-content;
}
.content h1 {
color: #ecf0f1;
margin: 1rem 0.1rem;
font-size: 2.7rem;
font-weight: lighter;
font-variant: small-caps;
}
.container {
position: absolute;
display: flex;
width: 100%;
height: 100%;
}
.box {
width: 50%;
overflow-y: auto;
overflow-x: auto;
scrollbar-width: none;
scrollbar-color: #f0f0f0 #f0f0f0;
padding: 0;
margin-right: 0.2rem;
background-color: #ecf0f1;
box-shadow: 5px 5px 5px black;
border-radius: 0.5rem;
min-width: fit-content;
text-align: center;
flex: 1;
}
.link {
background-color: #ecf0f1;
min-width: fit-content;
max-width: 50%;
}
.data {
background-color: #ecf0f1;
padding: auto;
min-width: fit-content;
max-width: 50%;
}
.plot {
background-color: #ecf0f1;
text-align: center;
max-width: 50%;
}
.box h2 {
margin-left: 0.5rem;
font-weight: normal;
font-variant: small-caps;
font-size: 1.5rem;
text-align: left;
}
.box h3 {
margin-left: 0.5rem;
font-weight: normal;
font-variant: small-caps;
font-size: 1.2rem;
text-align: left;
}
.box h4 {
margin-left: 0.5rem;
font-weight: normal;
font-variant: small-caps;
font-size: 1.0rem;
text-align: left;
}
.box ul {
list-style-type: disc;
margin-left: 0rem;
padding-left: 2rem;
text-align: left;
}
.box ul li {
margin: 0 0 0 0;
padding-left: 0;
font-size: 0.9rem;
font-weight: lighter;
}
.content-table {
margin-left: 2rem;
padding: 0.50rem;
font-size:0.9rem;
flex-basis: 100rem;
font-weight: lighter;
padding-bottom: 2rem;
}
.content-table caption {
text-align: left;
font-weight:600;
font-size: larger;
font-variant: small-caps;
}
.content-table th {
text-align: left;
padding-right: 1rem;
white-space: nowrap;
min-width: 3rem;
font-weight: normal;
}
.content-table td {
padding-right: 1rem;
text-align: left;
}
.content-table td.row-header {
font-weight: normal;
text-align: left;
padding-right: 0.5rem;
}
.content-table td.content-data-number {
text-align: right;
}
.content-table tbody tr:hover {
color: #ee5253;
cursor: pointer;
}
.plot img.image-plot {
min-width: none;
width: 90%;
color: #ecf0f1;
}
/* Popup overlay */
.popup {
display: none; /* Initially hidden */
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
justify-content: center;
align-items: center;
z-index: 9999; /* Make sure it’s on top of other elements */
}
/* Popup content */
.popup-content {
background-color: #fff;
padding: 2rem;
border-radius: 8px;
width: 70%;
max-width: 500px;
text-align: left;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
position: relative;
}
/* Close button */
.close-btn {
position: absolute;
top: 10px;
right: 10px;
background: transparent;
border: none;
font-size: 1rem;
cursor: pointer;
font-weight: bold;
}
/* Remove hover effect on close button */
.close-btn:hover {
background-color: transparent;
color: #000;
}
/* Button to open popup */
.select-items-btn {
display: inline-block; /* Ensure it's inline-block so that it doesn't take up the whole width */
margin: 0.25rem 0.25rem; /* Adjust top and bottom margin for spacing */
padding: 0.25rem 0.75rem;
background-color: #2a2d33; /* Button color */
color: #ecf0f1; /* Light text color */
border: none;
border-radius: 0.25rem;
font-size: 1rem; /* Adjust button font size */
cursor: pointer;
text-align: left; /* Align button text to the left */
font-size: 0.75rem; /* Smaller font size */
width: auto; /* Let the width be based on the content */
}
.select-items-btn:hover {
background-color: #2c3e50;
}
/* Style for the dropdown content inside the popup */
.popup-content .dropdown-content {
max-height: 300px;
overflow-y: auto;
}
.popup-content label {
display: block;
font-size: 0.75rem;
margin-bottom: 0.5rem;
text-align: left;
cursor: pointer;
}
.popup-content label:hover {
background-color: #f1f1f1;
}
.left {
text-align: left;
}
.cluster-selection {
display: inline-block; /* Ensure it's inline-block so that it doesn't take up the whole width */
margin: 0.25rem 0.25rem; /* Adjust top and bottom margin for spacing */
padding: 0.25rem 0.5rem;
background-color: #7e2929; /* Button color */
color: #ecf0f1; /* Light text color */
border: none;
border-radius: 0.25rem;
font-size: 1rem; /* Adjust button font size */
cursor: pointer;
text-align: left; /* Align button text to the left */
font-size: 0.75rem; /* Smaller font size */
width: auto; /* Let the width be based on the content */
}
.on {
background-color: #0b6602;
color: white;
}
.off {
background-color: #7e2929;
color: white;
}
.center {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
#3d-view-container {
width: 100%; /* Full width of the container */
height: 100%; /* Full height of the container */
overflow: hidden; /* Prevents overflow if the canvas exceeds its container */
}
canvas {
padding: 0.25rem 0.75rem;
display: block; /* Removes the default inline display */
width: 100% !important; /* Make sure canvas scales with its parent container */
height: 100% !important; /* Ensure canvas scales to fit the container */
}
\ No newline at end of file
File added
File added
This diff is collapsed.
<?xml version="1.0" encoding="utf-8" ?>
<module_configuration_file name="reportGenerator2_conf.xml">
<control_settings description="General control settings for this tool">
<aircraft_exchange_file_name description="Specify the name of the exchange file">
<value>csmr-2020.xml</value>
</aircraft_exchange_file_name>
<aircraft_exchange_file_directory description="Specify the direction in which the aircraft exchange file can be found">
<value>../projects/</value>
</aircraft_exchange_file_directory>
<own_tool_level description="Specify the tool level of this tool">
<value>1</value>
</own_tool_level>
<console_output description="Selector to specify the console output. Selector: mode_0 (Off) / mode_1 (only out/err/warn) / mode_2 (1 + info) / mode_3 (2 + debug)">
<value>mode_1</value>
</console_output>
<log_file_output description="Selector to specify the log file output. Selector: mode_0 (Off) / mode_1 (only out/err/warn) / mode_2 (1 + info) / mode_3 (2 + debug)">
<value>mode_1</value>
</log_file_output>
<plot_output description="Specify the way plotting shall be handled">
<enable description="Switch to enable plotting. Switch: true (On) / false (Off)">
<value>true</value>
</enable>
<copy_plotting_files description="Switch if plotting files shall be copied. Switch: true (On) / false (Off)">
<value>true</value>
</copy_plotting_files>
<delete_plotting_files_from_tool_folder description="Switch if plotting files shall be deleted from folder. Switch: true (On) / false (Off)">
<value>true</value>
</delete_plotting_files_from_tool_folder>
</plot_output>
<report_output description="Switch to generate an HTML report. Switch: true (On) / false (Off)">
<value>true</value>
</report_output>
<tex_report description="Switch to generate a Tex report. Switch: true (On) / false (Off)">
<value>false</value>
</tex_report>
<write_info_files description="Switch to generate info files. Switch: true (On) / false (Off)">
<value>false</value>
</write_info_files>
<log_file description="Specify the name of the log file">
<value>report_generator.log</value>
</log_file>
<inkscape_path description="Path to the inkscape application (DEFAULT: Use inkscape from the UNICADO repo structure)">
<value>DEFAULT</value>
</inkscape_path>
<gnuplot_path description="Path to the gnuplot application (DEFAULT: Use gnuplot from the UNICADO repo structure)">
<value>DEFAULT</value>
</gnuplot_path>
<program_specific_settings>
<create_batch_file description="Create a batch file that can be executed for ease of access - only for Windows Switch: true (On) / false (Off)">
<value>true</value>
</create_batch_file>
</program_specific_settings>
</control_settings>
</module_configuration_file>
/* Copyright (C) 2023 Chair of Aircraft Design, Technical University Munich
This file is part of UNICADO.
UNICADO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
UNICADO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with UNICADO. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file main.cpp
* @brief Report generator.
* @version 2.0.0
* @date 2024-12-20
*/
/* === Includes === */
#include "report_generator.h"
#include "toolinfo.h"
int main(int argc, char** argv)
{
/* Add exception handling since the constructor of the module can throw. */
try {
ReportGenerator reporting_module(argc, argv, TOOL_NAME, TOOL_VERSION);
return reporting_module.execute();
}
catch (const std::string& error) {
std::cerr << error << std::endl;
}
catch (const std::exception& error) {
std::cerr << error.what() << std::endl;
}
catch (...) {
std::cerr << "Unknown error occurred." << std::endl;
}
return EXIT_FAILURE;
}
This diff is collapsed.
/* Copyright (C) 2023 Chair of Aircraft Design, Technical University Munich
This file is part of UNICADO.
UNICADO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
UNICADO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with UNICADO. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file reportGenerator.h
* @brief Report generator.
* @version 1.0.0
* @date 2024-12-20
*/
#ifndef SRC_REPORT_GENERATOR_H_
#define SRC_REPORT_GENERATOR_H_
/* === Includes === */
#include <algorithm>
#include <cctype>
#include <cstddef>
#include <filesystem>
#include <moduleBasics/module.h>
#include <runtimeInfo/runtimeInfo.h>
#include <stdexcept>
#include <string>
#include <vector>
#include <aircraftGeometry2/geometry/surface.h>
#include <aixml/node.h>
#include <aircraftGeometry2/processing/transform.h>
namespace geometry
{
/* === Typedefs for the geometry components === */
using Fuselage = geom2::MultisectionSurface<geom2::PolygonSection>;
using Wing = geom2::MultisectionSurface<geom2::AirfoilSection>;
using Nacelle = geom2::MultisectionSurface<geom2::PolygonSection>;
using Pylon = geom2::MultisectionSurface<geom2::AirfoilSection>;
/* === Classes === */
/**
* @struct Aircraft
* @brief Groups the aircraft geometry components.
*/
struct Aircraft
{
std::vector<Fuselage> fuselages;
std::vector<Wing> wings;
std::vector<Wing> empennage;
std::vector<Nacelle> nacelle;
std::vector<Pylon> pylon;
};
}
/* === Classes === */
class ReportGenerator : public Module
{
public:
ReportGenerator(const int argc, char** argv, const std::string& toolName, const std::string& toolVersion)
: Module(argc, argv, toolName, toolVersion)
{
}
ReportGenerator(const std::string& toolName, const std::string& toolVersion, const std::filesystem::path& rtConfigXML)
: Module(toolName, toolVersion, rtConfigXML)
{
}
/**
* @brief Destroy the ReportGenerator module instance.
*/
~ReportGenerator() = default;
/* === Populate the module template methods === */
void initialize() override;
void run() override;
void update() override;
void report() override;
void save() override;
private:
/* === Methods === */
/**
* @brief Writes the content of the report sections
*
* @throws
*/
void write_dropdown_content();
/**
* @brief Searches for the TLARs and writes them to the report
* @note This is a recursive function
*
* @param TLAR The root node
*/
void get_all_TLAR(const auto TLAR);
/**
* @brief Formats the provided element
*
* @param element String element to be formatted
* @return element Formatted string element
*/
auto format_element(std::string element)->std::string;
/**
* @brief Writes the links to reports to the report
* @note Only the reporting path is searched,
* reports are assumed to have _report.html in their
* titles
*
* @param reporting_path the path where the reports are located
*/
void add_links(std::filesystem::path reporting_path);
/**
* @brief Writes the clustered aircraft design paramters to
* the report
* @note Clusters are pre-defined
*
*/
void add_clusters();
/**
* @brief Writes the value and unit, or the value of a
* node to the report
*
* @param element The path to the node
* @return label The string element that can be written to the
* report
*/
auto generic_writer(std::string element)->std::string;
/**
* @brief Creates the aircraft geometry, the aircraft
* geometry mesh and writes it to an stl file
* @note The aircraft geometry and mesh is set to null
* if one or more elements of the aircraft are missing
*
*/
void create_aircraft_geometry();
std::shared_ptr<node> aircraft_xml; /** [-] The aircraft xml data. */
std::shared_ptr<node> configuration_xml; /** [-] The configuration xml data. */
std::vector<node*> TLARs; /** [-] Top Level Aircraft Requirements. */
std::fstream htmlcontent; /** [-] The template file for the report. */
std::fstream html_temp; /** [-] The report file. */
std::filesystem::path reporting_path; /** [-] Path to the reports. */
std::shared_ptr<geometry::Aircraft> aircraft_geometry; /** [-] The aircraft geometry. */
geom2::Mesh aircraft_mesh; /** [-] The aircraft mesh. */
};
#endif // SRC_REPORT_GENERATOR_H_
\ No newline at end of file
#include "toolinfo.h"
#ifdef _WIN32
#include <windows.h>
#endif // _WIN32
VS_VERSION_INFO VERSIONINFO
FILEVERSION PRODUCT_VERSION
PRODUCTVERSION PRODUCT_VERSION
{
BLOCK "StringFileInfo"
{
BLOCK "040904b0"
{
VALUE "CompanyName", "RWTH Aachen University"
VALUE "FileDescription", TOOL_NAME
VALUE "FileVersion", TOOL_VERSION
VALUE "LegalCopyright", "(C) 2008-2022 Institute of Aerospace Systems, RWTH Aachen University - All rights reserved."
VALUE "OriginalFilename", "reportGenerator.exe"
VALUE "ProductName", TOOL_NAME
VALUE "ProductVersion", TOOL_VERSION
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x409, 1200
}
}
/* Copyright (C) 2010-2022 Institute of Aerospace Systems, RWTH Aachen University - All rights reserved.
This file is part of UNICADO.
UNICADO is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
UNICADO is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with UNICADO. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef REPORTGENERATOR_SRC_TOOLINFO_H_
#define REPORTGENERATOR_SRC_TOOLINFO_H_
#define TOOL_NAME "report_generator"
#define TOOL_VERSION "2.0.0"
#define PRODUCT_VERSION 2,0,0
#endif // REPORTGENERATOR_SRC_TOOLINFO_H_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment