diff --git a/CHANGELOG.md b/CHANGELOG.md index 025e46a..73af8b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# Unreleased + +## AeroCloud + +### Features + + - Add support for `symmetry` to v7 simulations [#174](https://github.com/nablaflow/cli/pull/174) + # 1.5.0 - 2026-08-07 ## AeroCloud diff --git a/schemas/aerocloud.json b/schemas/aerocloud.json index 0f891de..cd92404 100644 --- a/schemas/aerocloud.json +++ b/schemas/aerocloud.json @@ -322,6 +322,9 @@ "revision": { "type": "string" }, + "symmetry": { + "$ref": "#/components/schemas/Symmetry" + }, "yaw_angles": { "$ref": "#/components/schemas/YawAngles" } @@ -407,13 +410,13 @@ "type": "number" }, "ID": { - "example": "019f3c5c-5e48-761b-914b-c3d7970b93c9", + "example": "6bf1fafd-35e9-4b4f-9b21-2ed9b731b12d", "format": "uuid", "title": "ID", "type": "string" }, "IdempotencyKey": { - "example": "019f3c5c-5e48-7c2f-8fc3-718048fd3f48", + "example": "1603dfa0-738c-4273-af9d-7b840a5e3909", "title": "IdempotencyKey", "type": "string" }, @@ -1124,6 +1127,9 @@ "quality": { "$ref": "#/components/schemas/SimulationQuality" }, + "symmetry": { + "$ref": "#/components/schemas/Symmetry" + }, "yaw_angles": { "$ref": "#/components/schemas/YawAngles" } @@ -1548,6 +1554,17 @@ "title": "SimulationV7", "type": "object" }, + "Symmetry": { + "default": "off", + "enum": [ + "off", + "center", + "left", + "right" + ], + "title": "Symmetry", + "type": "string" + }, "Token": { "discriminator": { "propertyName": "type" diff --git a/src/aerocloud/extra_types.rs b/src/aerocloud/extra_types.rs index 35bb3b1..a5a324a 100644 --- a/src/aerocloud/extra_types.rs +++ b/src/aerocloud/extra_types.rs @@ -1,6 +1,7 @@ use crate::aerocloud::types::{ BoundaryLayerTreatment, Ceiling, FileUnit, Fluid, FluidSpeed, GroundOffset, - Id, Quaternion, SimulationQuality, UpdatePartV7Params, YawAngle, YawAngles, + Id, Quaternion, SimulationQuality, Symmetry, UpdatePartV7Params, YawAngle, + YawAngles, }; use color_eyre::eyre; use std::{borrow::Cow, collections::BTreeMap}; @@ -40,6 +41,9 @@ pub struct CreateSimulationV7ParamsFromJson { #[serde(default)] pub assistant: bool, + #[serde(default)] + pub symmetry: Symmetry, + #[serde(default)] pub model_id: Option, diff --git a/src/aerocloud/fmt.rs b/src/aerocloud/fmt.rs index 57c13a9..75571ab 100644 --- a/src/aerocloud/fmt.rs +++ b/src/aerocloud/fmt.rs @@ -1,4 +1,6 @@ -use crate::aerocloud::types::{BoundaryLayerTreatment, SimulationStatus}; +use crate::aerocloud::types::{ + BoundaryLayerTreatment, SimulationStatus, Symmetry, +}; pub fn human_simulation_status(v: SimulationStatus) -> &'static str { match v { @@ -17,3 +19,12 @@ pub fn human_boundary_layer_treatment(v: BoundaryLayerTreatment) -> &'static str } } } + +pub fn human_symmetry(v: Symmetry) -> &'static str { + match v { + Symmetry::Off => "off", + Symmetry::Center => "center", + Symmetry::Left => "left", + Symmetry::Right => "right", + } +} diff --git a/src/commands/aerocloud/v7/batch/simulation_detail.rs b/src/commands/aerocloud/v7/batch/simulation_detail.rs index 7379640..fcd8380 100644 --- a/src/commands/aerocloud/v7/batch/simulation_detail.rs +++ b/src/commands/aerocloud/v7/batch/simulation_detail.rs @@ -196,6 +196,13 @@ impl<'a> SimulationDetail<'a> { Span::styled("Assistant: ", STYLE_BOLD), Span::styled(bool_to_human(sim.params.assistant), STYLE_ACCENT), ])); + + lines.push(Line::default()); + + lines.push(Line::from(vec![ + Span::styled("Symmetry: ", STYLE_BOLD), + Span::styled(fmt::human_symmetry(sim.params.symmetry), STYLE_ACCENT), + ])); } fn new_model(files: &'a [FileParams], lines: &mut Vec>) { diff --git a/src/commands/aerocloud/v7/batch/simulation_params.rs b/src/commands/aerocloud/v7/batch/simulation_params.rs index ce31e37..60880c5 100644 --- a/src/commands/aerocloud/v7/batch/simulation_params.rs +++ b/src/commands/aerocloud/v7/batch/simulation_params.rs @@ -339,6 +339,7 @@ impl SimulationParams { revision, yaw_angles, assistant, + symmetry, .. } = self.params; @@ -356,6 +357,7 @@ impl SimulationParams { project_id, quality, revision, + symmetry: Some(symmetry), yaw_angles, } }