///|
/// Return a stable execution order: datum steps first, then feature order.
pub fn execution_order(plan : MeasurementPlan) -> Array[MeasurementStep] {
let ordered = []
for step in plan.steps {
if step.direction == "datum-aligned" {
ordered.push(step)
}
}
for step in plan.steps {
if step.direction != "datum-aligned" {
ordered.push(step)
}
}
ordered
}
///|
/// Count how many planned steps use repeated sampling.
pub fn repeated_step_count(plan : MeasurementPlan) -> Int {
let mut count = 0
for step in plan.steps {
match step.strategy {
RepeatedPoint(_) | Scan(_) => count += 1
SinglePoint => ()
}
}
count
}