Skip to content

Commit d386dd2

Browse files
Copilotjbrodovsky
andcommitted
Simplify geophysical config prompting functions by adding type alias
Co-authored-by: jbrodovsky <57160841+jbrodovsky@users.noreply.github.com>
1 parent bf63e5b commit d386dd2

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

sim/src/main.rs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,21 @@ fn prompt_enable_geophysical() -> bool {
13971397
}
13981398
}
13991399

1400+
/// Type alias for geophysical measurement configuration returned by prompt functions.
1401+
///
1402+
/// Represents the configuration for a single geophysical measurement type (gravity or magnetic).
1403+
/// Contains:
1404+
/// - `GeoResolution`: The map resolution to use
1405+
/// - `Option<f64>`: Measurement bias (mGal for gravity, nT for magnetic)
1406+
/// - `Option<f64>`: Measurement noise standard deviation (mGal for gravity, nT for magnetic)
1407+
/// - `Option<String>`: Map file path (auto-detected if None)
1408+
type GeoMeasurementConfig = (
1409+
strapdown::sim::GeoResolution,
1410+
Option<f64>,
1411+
Option<f64>,
1412+
Option<String>,
1413+
);
1414+
14001415
/// Prompt for GeoResolution with validation
14011416
fn prompt_geo_resolution(measurement_type: &str) -> strapdown::sim::GeoResolution {
14021417
use std::io::{self, Write};
@@ -1457,12 +1472,7 @@ fn prompt_geo_resolution(measurement_type: &str) -> strapdown::sim::GeoResolutio
14571472
}
14581473

14591474
/// Prompt for gravity measurement configuration
1460-
fn prompt_gravity_config() -> Option<(
1461-
strapdown::sim::GeoResolution,
1462-
Option<f64>,
1463-
Option<f64>,
1464-
Option<String>,
1465-
)> {
1475+
fn prompt_gravity_config() -> Option<GeoMeasurementConfig> {
14661476
use std::io::{self, Write};
14671477

14681478
loop {
@@ -1523,12 +1533,7 @@ fn prompt_gravity_config() -> Option<(
15231533
}
15241534

15251535
/// Prompt for magnetic measurement configuration
1526-
fn prompt_magnetic_config() -> Option<(
1527-
strapdown::sim::GeoResolution,
1528-
Option<f64>,
1529-
Option<f64>,
1530-
Option<String>,
1531-
)> {
1536+
fn prompt_magnetic_config() -> Option<GeoMeasurementConfig> {
15321537
use std::io::{self, Write};
15331538

15341539
loop {

0 commit comments

Comments
 (0)