Skip to main content

automapper_validation/generated/fv2510/
utilts_conditions_fv2510.rs

1// <auto-generated>
2// Generated by automapper-generator generate-conditions
3// AHB: xml-migs-and-ahbs/FV2510/UTILTS_AHB_1_0_Fehlerkorrektur_20260327.xml
4// Generated: 2026-09-23T08:11:56Z
5// Delegates unchanged conditions to UtiltsConditionEvaluatorFV2504 (FV2504).
6// </auto-generated>
7
8#![allow(clippy::style, clippy::complexity)]
9
10#[allow(unused_imports)]
11use crate::eval::format_validators::*;
12use crate::eval::{ConditionEvaluator, ConditionResult, EvaluationContext};
13use crate::generated::fv2504::UtiltsConditionEvaluatorFV2504;
14
15/// Condition evaluator for UTILTS FV2510.
16///
17/// Delegates to [`UtiltsConditionEvaluatorFV2504`] for conditions whose AHB description is
18/// unchanged from that version. Local overrides: [63].
19pub struct UtiltsConditionEvaluatorFV2510 {
20    fallback: UtiltsConditionEvaluatorFV2504,
21}
22
23impl Default for UtiltsConditionEvaluatorFV2510 {
24    fn default() -> Self {
25        Self {
26            fallback: UtiltsConditionEvaluatorFV2504::default(),
27        }
28    }
29}
30
31/// Condition IDs whose implementation differs from the fallback.
32const FV2510_OVERRIDES: &[u32] = &[63];
33
34/// Overrides that require context from outside the message.
35const FV2510_EXTERNAL: &[u32] = &[63];
36
37impl ConditionEvaluator for UtiltsConditionEvaluatorFV2510 {
38    fn message_type(&self) -> &str {
39        "UTILTS"
40    }
41
42    fn format_version(&self) -> &str {
43        "FV2510"
44    }
45
46    fn evaluate(&self, condition: u32, ctx: &EvaluationContext) -> ConditionResult {
47        match condition {
48            63 => self.evaluate_63(ctx),
49            other => self.fallback.evaluate(other, ctx),
50        }
51    }
52
53    fn is_external(&self, condition: u32) -> bool {
54        if FV2510_OVERRIDES.contains(&condition) {
55            FV2510_EXTERNAL.contains(&condition)
56        } else {
57            self.fallback.is_external(condition)
58        }
59    }
60
61    fn is_known(&self, condition: u32) -> bool {
62        FV2510_OVERRIDES.contains(&condition) || self.fallback.is_known(condition)
63    }
64}
65
66impl UtiltsConditionEvaluatorFV2510 {
67    /// [63] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle NB
68    /// EXTERNAL: Requires context from outside the message.
69    fn evaluate_63(&self, ctx: &EvaluationContext) -> ConditionResult {
70        ctx.external.evaluate("recipient_is_nb")
71    }
72}