@@ -282,7 +282,6 @@ private void ConvertILTStructure(IFileReaderWriterProgress progress = null)
282282 double sectionProgress = 0 ;
283283 int modelSectionID = 0 ;
284284
285- var markingParamsMap = new MapField < int , MarkingParams > ( ) ;
286285 foreach ( IModelSection section in buildJob . ModelSections )
287286 {
288287 /*convert Modelsection to Part, ignore every "parts" in a Modelsection, since
@@ -291,6 +290,7 @@ they don't provide any information*/
291290 section . ID = modelSectionID ++ ;
292291 job . PartsMap . Add ( section . ID , part ) ;
293292
293+ // initialize with marking param from ILT, but allow each CLI-file to override them
294294 var markingParamsManager = new MarkingParamsManager ( TranslateBuildParams ( section . Parameters ) ) ;
295295 var addedVectorBlocks = new List < VectorBlock > ( ) ;
296296 for ( int i = 0 ; i < section . Geometry . Layers . Count ; i ++ )
@@ -346,7 +346,7 @@ they don't provide any information*/
346346 + ( ( i / ( double ) section . Geometry . Layers . Count ) * 100.0 / buildJob . ModelSections . Count ) ) ) ;
347347 }
348348 }
349- markingParamsMap . MergeFromWithRemap ( markingParamsManager . MarkingParamsMap , out var keyMapping ) ;
349+ job . MarkingParamsMap . MergeFromWithRemap ( markingParamsManager . MarkingParamsMap , out var keyMapping ) ;
350350 foreach ( var vectorBlock in addedVectorBlocks ) // update all vector block marking param keys after merge
351351 vectorBlock . MarkingParamsKey = keyMapping [ vectorBlock . MarkingParamsKey ] ;
352352 sectionProgress ++ ;
@@ -395,8 +395,15 @@ private void ConvertCLIStructure(IFileReaderWriterProgress progress = null)
395395 foreach ( int key in markingParamsManager . MarkingParamsMap . Keys )
396396 job . MarkingParamsMap [ key ] = markingParamsManager . MarkingParamsMap [ key ] ;
397397 job . NumWorkPlanes = job . WorkPlanes . Count ;
398- }
399-
398+ }
399+
400+ /// <summary>
401+ /// Accumulate sequential parameter change commands into a map of ovf MarkingParams.
402+ /// Each parameter set is assigned a unique key and added to the marking params map.
403+ /// Each call to Update() changes the current parameter set. InsertCurrentParams()
404+ /// records the current params (avoiding duplicate entries) and returns the key
405+ /// for retreiving that parameter set from the map.
406+ /// </summary>
400407 private class MarkingParamsManager
401408 {
402409 public MapField < int , MarkingParams > MarkingParamsMap { get ; }
@@ -406,11 +413,6 @@ private class MarkingParamsManager
406413 private bool currentMPlocked = false ;
407414 private int nextMPKey = 0 ;
408415
409- /// <summary>
410- /// Accumulate sequential parameter change commands into ovf MarkingParameters.
411- /// Each parameter set is assigned a unique key and added to the marking params map.
412- /// </summary>
413- /// <param name="markingParamsMap"></param>
414416 public MarkingParamsManager ( MarkingParams initialMarkingParams = null )
415417 {
416418 MarkingParamsMap = new MapField < int , MarkingParams > ( ) ;
@@ -456,7 +458,6 @@ private void SetJobData(IBuildJob buildJob)
456458 int i = 0 ;
457459 foreach ( IModelSection section in buildJob . ModelSections )
458460 {
459- job . MarkingParamsMap . Add ( i , TranslateBuildParams ( section . Parameters ) ) ;
460461 ModelsectionMap . Add ( section , i ) ;
461462 i ++ ;
462463 }
@@ -484,9 +485,6 @@ private VectorBlock TranslateBlockData(IVectorBlock iltBlock, IModelSection mode
484485 //this information gets lost
485486 block . LpbfMetadata . Reexposure = false ;
486487
487- //SetJobData has to be called before using this
488- //block.MarkingParamsKey = ModelsectionMap[modelSection];
489- Debug . Assert ( job . MarkingParamsMap . ContainsKey ( block . MarkingParamsKey ) ) ;
490488 /* vs=Volumen Schraffur, vk=Volumen Kontur, u steht fuer unten-> down,
491489 us=Downskin Schraffur, uk=Downskin Kontur, kv=Kontur Versatz, sx = single vector, support */
492490 switch ( modelSection . SubType )
0 commit comments