33
44namespace FluentAAS . Templates . TechnicalData ;
55
6+ /// <summary>
7+ /// Fluent builder for composing an IDTA Technical Data submodel with typed groups,
8+ /// ECLASS semantic mapping and IEC 61360-oriented validation.
9+ /// The builder fails fast so invalid technical parameter sets are rejected during composition.
10+ /// </summary>
611public sealed class TechnicalDataBuilder
712{
813 private readonly IShellBuilder _shellBuilder ;
@@ -29,6 +34,13 @@ internal TechnicalDataBuilder(IShellBuilder shellBuilder, string id, string idSh
2934 _idShort = idShort ;
3035 }
3136
37+ /// <summary>
38+ /// Overrides the submodel identifiers used for the generated Technical Data submodel.
39+ /// This allows callers to align the template with project-specific naming and ID strategies.
40+ /// </summary>
41+ /// <param name="id">Globally unique submodel identifier.</param>
42+ /// <param name="idShort">Human-readable short identifier.</param>
43+ /// <returns>The current builder for fluent chaining.</returns>
3244 public TechnicalDataBuilder WithIds ( string id , string idShort )
3345 {
3446 if ( string . IsNullOrWhiteSpace ( id ) )
@@ -46,6 +58,12 @@ public TechnicalDataBuilder WithIds(string id, string idShort)
4658 return this ;
4759 }
4860
61+ /// <summary>
62+ /// Configures the strongly typed motor performance group.
63+ /// Using this method guarantees that only motor-performance properties are assigned in this group.
64+ /// </summary>
65+ /// <param name="configure">Callback that fills the motor performance properties.</param>
66+ /// <returns>The current builder for fluent chaining.</returns>
4967 public TechnicalDataBuilder WithMotorPerformance ( Action < MotorPerformanceGroupBuilder > configure )
5068 {
5169 ArgumentNullException . ThrowIfNull ( configure ) ;
@@ -56,6 +74,12 @@ public TechnicalDataBuilder WithMotorPerformance(Action<MotorPerformanceGroupBui
5674 return this ;
5775 }
5876
77+ /// <summary>
78+ /// Configures the strongly typed bearing characteristics group.
79+ /// This prevents accidental mixing of unrelated technical parameters.
80+ /// </summary>
81+ /// <param name="configure">Callback that fills the bearing characteristic properties.</param>
82+ /// <returns>The current builder for fluent chaining.</returns>
5983 public TechnicalDataBuilder WithBearingCharacteristics ( Action < BearingCharacteristicsGroupBuilder > configure )
6084 {
6185 ArgumentNullException . ThrowIfNull ( configure ) ;
@@ -66,6 +90,14 @@ public TechnicalDataBuilder WithBearingCharacteristics(Action<BearingCharacteris
6690 return this ;
6791 }
6892
93+ /// <summary>
94+ /// Validates and builds the Technical Data submodel, then attaches it to the parent shell.
95+ /// This central build step ensures required parameters, units and semantics are validated before persistence.
96+ /// </summary>
97+ /// <returns>The parent shell builder to continue composing the AAS.</returns>
98+ /// <exception cref="InvalidOperationException">
99+ /// Thrown when required properties are missing or semantic mappings are invalid.
100+ /// </exception>
69101 public IShellBuilder BuildTechnicalData ( )
70102 {
71103 ValidateRequiredParameters ( ) ;
@@ -193,53 +225,117 @@ private sealed record PropertyAssignment(
193225 string Value ,
194226 string Unit ) ;
195227
228+ /// <summary>
229+ /// Group builder for motor performance properties.
230+ /// The API is deliberately constrained to valid motor fields for safer, more predictable template usage.
231+ /// </summary>
196232 public sealed class MotorPerformanceGroupBuilder ( TechnicalDataBuilder parent )
197233 {
234+ /// <summary>
235+ /// Sets rated voltage with IEC 61360-conform unit and optional explicit semantic check.
236+ /// </summary>
237+ /// <param name="value">Numeric rated voltage value.</param>
238+ /// <param name="unit">Unit symbol (default: V).</param>
239+ /// <param name="semanticId">Optional ECLASS IRDI for explicit semantic conformity check.</param>
240+ /// <returns>The current motor performance builder.</returns>
198241 public MotorPerformanceGroupBuilder WithRatedVoltage ( decimal value , string unit = "V" , string ? semanticId = null )
199242 {
200243 parent . UpsertDecimalProperty ( TechnicalDataIdentifiers . MotorPerformance , TechnicalDataIdentifiers . RatedVoltage , value , unit , semanticId ) ;
201244 return this ;
202245 }
203246
247+ /// <summary>
248+ /// Sets rated current with IEC 61360-conform unit and optional explicit semantic check.
249+ /// </summary>
250+ /// <param name="value">Numeric rated current value.</param>
251+ /// <param name="unit">Unit symbol (default: A).</param>
252+ /// <param name="semanticId">Optional ECLASS IRDI for explicit semantic conformity check.</param>
253+ /// <returns>The current motor performance builder.</returns>
204254 public MotorPerformanceGroupBuilder WithRatedCurrent ( decimal value , string unit = "A" , string ? semanticId = null )
205255 {
206256 parent . UpsertDecimalProperty ( TechnicalDataIdentifiers . MotorPerformance , TechnicalDataIdentifiers . RatedCurrent , value , unit , semanticId ) ;
207257 return this ;
208258 }
209259
260+ /// <summary>
261+ /// Sets rated power with IEC 61360-conform unit and optional explicit semantic check.
262+ /// </summary>
263+ /// <param name="value">Numeric rated power value.</param>
264+ /// <param name="unit">Unit symbol (default: kW).</param>
265+ /// <param name="semanticId">Optional ECLASS IRDI for explicit semantic conformity check.</param>
266+ /// <returns>The current motor performance builder.</returns>
210267 public MotorPerformanceGroupBuilder WithRatedPower ( decimal value , string unit = "kW" , string ? semanticId = null )
211268 {
212269 parent . UpsertDecimalProperty ( TechnicalDataIdentifiers . MotorPerformance , TechnicalDataIdentifiers . RatedPower , value , unit , semanticId ) ;
213270 return this ;
214271 }
215272
273+ /// <summary>
274+ /// Sets rated speed with IEC 61360-conform unit and optional explicit semantic check.
275+ /// </summary>
276+ /// <param name="value">Numeric rated speed value.</param>
277+ /// <param name="unit">Unit symbol (default: 1/min).</param>
278+ /// <param name="semanticId">Optional ECLASS IRDI for explicit semantic conformity check.</param>
279+ /// <returns>The current motor performance builder.</returns>
216280 public MotorPerformanceGroupBuilder WithRatedSpeed ( decimal value , string unit = "1/min" , string ? semanticId = null )
217281 {
218282 parent . UpsertDecimalProperty ( TechnicalDataIdentifiers . MotorPerformance , TechnicalDataIdentifiers . RatedSpeed , value , unit , semanticId ) ;
219283 return this ;
220284 }
221285 }
222286
287+ /// <summary>
288+ /// Group builder for bearing characteristics.
289+ /// The focused API helps callers provide structurally valid bearing data with consistent semantics.
290+ /// </summary>
223291 public sealed class BearingCharacteristicsGroupBuilder ( TechnicalDataBuilder parent )
224292 {
293+ /// <summary>
294+ /// Sets bearing inner diameter with IEC 61360-conform unit and optional explicit semantic check.
295+ /// </summary>
296+ /// <param name="value">Numeric inner diameter value.</param>
297+ /// <param name="unit">Unit symbol (default: mm).</param>
298+ /// <param name="semanticId">Optional ECLASS IRDI for explicit semantic conformity check.</param>
299+ /// <returns>The current bearing characteristics builder.</returns>
225300 public BearingCharacteristicsGroupBuilder WithInnerDiameter ( decimal value , string unit = "mm" , string ? semanticId = null )
226301 {
227302 parent . UpsertDecimalProperty ( TechnicalDataIdentifiers . BearingCharacteristics , TechnicalDataIdentifiers . InnerDiameter , value , unit , semanticId ) ;
228303 return this ;
229304 }
230305
306+ /// <summary>
307+ /// Sets bearing outer diameter with IEC 61360-conform unit and optional explicit semantic check.
308+ /// </summary>
309+ /// <param name="value">Numeric outer diameter value.</param>
310+ /// <param name="unit">Unit symbol (default: mm).</param>
311+ /// <param name="semanticId">Optional ECLASS IRDI for explicit semantic conformity check.</param>
312+ /// <returns>The current bearing characteristics builder.</returns>
231313 public BearingCharacteristicsGroupBuilder WithOuterDiameter ( decimal value , string unit = "mm" , string ? semanticId = null )
232314 {
233315 parent . UpsertDecimalProperty ( TechnicalDataIdentifiers . BearingCharacteristics , TechnicalDataIdentifiers . OuterDiameter , value , unit , semanticId ) ;
234316 return this ;
235317 }
236318
319+ /// <summary>
320+ /// Sets bearing width with IEC 61360-conform unit and optional explicit semantic check.
321+ /// </summary>
322+ /// <param name="value">Numeric width value.</param>
323+ /// <param name="unit">Unit symbol (default: mm).</param>
324+ /// <param name="semanticId">Optional ECLASS IRDI for explicit semantic conformity check.</param>
325+ /// <returns>The current bearing characteristics builder.</returns>
237326 public BearingCharacteristicsGroupBuilder WithWidth ( decimal value , string unit = "mm" , string ? semanticId = null )
238327 {
239328 parent . UpsertDecimalProperty ( TechnicalDataIdentifiers . BearingCharacteristics , TechnicalDataIdentifiers . Width , value , unit , semanticId ) ;
240329 return this ;
241330 }
242331
332+ /// <summary>
333+ /// Sets bearing limiting speed with IEC 61360-conform unit and optional explicit semantic check.
334+ /// </summary>
335+ /// <param name="value">Numeric limiting speed value.</param>
336+ /// <param name="unit">Unit symbol (default: 1/min).</param>
337+ /// <param name="semanticId">Optional ECLASS IRDI for explicit semantic conformity check.</param>
338+ /// <returns>The current bearing characteristics builder.</returns>
243339 public BearingCharacteristicsGroupBuilder WithLimitingSpeed ( decimal value , string unit = "1/min" , string ? semanticId = null )
244340 {
245341 parent . UpsertDecimalProperty ( TechnicalDataIdentifiers . BearingCharacteristics , TechnicalDataIdentifiers . LimitingSpeed , value , unit , semanticId ) ;
0 commit comments