Iterator¶
-
class
pyslm.analysis.
Iterator
(models, layers)¶ Bases:
abc.ABC
Basic Iterator which parses through both
Layer
andLayerGeometry
groups and incrementally goes through the geometry based on time values generated in conjunction with the associatedModel
.Attributes Summary
The current start time of the active
LayerGeometry
The total layer dwell time [s].
A
Layer
list to be processed by the iteratorA
Model
list to be processed by the iteratorThe re-coater time [s] added after the layer
The current time [s] of the iterator (read only)
A tree of
TimeNode
for the entire buildMethods Summary
Gets the total build-time of the entire list of layers including additional dwell time between layers.
Gets the current layer of the iterator
Gets the current
LayerGeometry
for the current iterationgetLayerByTime
(time)Gets the current
Layer
based on the search timegetLayerGeomTime
(layerId, layerGeomId)Gets the total time for each
LayerGeometry
given a unique aLayer
index and aLayerGeometry
index.getLayerGeometryByTime
(time)- rtype:
LayerGeometry
getLayerGeometryIdByTime
(time)- rtype:
int
Gets the
TimeNode
for aLayerGeometry
given a timegetLayerIdByTime
(time)Gets the current
Layer
index based on the search timegetLayerNodeByTime
(time)- rtype:
Optional
[TimeNode
]
getLayerTime
(layerId)Gets the total time for a
Layer
given a unique aLayer
indexgetTimeByLayerGeometryId
(layerId, layerGeomId)Gets the current time for a
LayerGeometry
given a unique aLayer
index and aLayerGeometry
index.getTimeByLayerId
(layerIdx)Gets the current time in the Build based on the layer index.
seek
(time)Instructs the iterator to seek ahead to a specific time.
seekByLayer
(layerId)Instructs the iterator to seek ahead in time to the specific
Layer
seekByLayerGeometry
(layerId, layerGeomId)Instructs the iterator to seek ahead in time to the specific
LayerGeometry
Attributes Documentation
-
currentLayerGeometryTime
¶ The current start time of the active
LayerGeometry
- Return type:
float
-
dwellTime
¶ The total layer dwell time [s]. This can be re-implemented in a derived class to be a more complex function or provide additional variables which control the overall dwell time per layers such as the number of re-coats and the re-coating speed, often specified by the machine.
- Return type:
float
-
layers
¶ A
Layer
list to be processed by the iterator- Return type:
List
[Layer
]
-
models
¶ A
Model
list to be processed by the iterator- Return type:
List
[Model
]
-
recoaterTime
¶ The re-coater time [s] added after the layer
- Return type:
float
-
time
¶ The current time [s] of the iterator (read only)
- Return type:
float
Methods Documentation
-
getBuildTime
()¶ Gets the total build-time of the entire list of layers including additional dwell time between layers. This function simply parses through the entire
TimeNode
tree and adds on the dwell time per layer.- Return type:
float
-
getCurrentLayer
()¶ Gets the current layer of the iterator
- Return type:
Layer
- Returns:
The current layer
-
getCurrentLayerGeometry
()¶ Gets the current
LayerGeometry
for the current iteration- Return type:
LayerGeometry
- Returns:
The active LayerGeometry
-
getLayerByTime
(time)¶ Gets the current
Layer
based on the search time- Parameters:
time (
float
) – The time for locating theLayer
- Return type:
Layer
- Returns:
The Layer at time t
-
getLayerGeomTime
(layerId, layerGeomId)¶ Gets the total time for each
LayerGeometry
given a unique aLayer
index and aLayerGeometry
index.- Parameters:
layerId (
int
) – The layer index in the listlayerGeomId (
int
) – The layer geometry index within theLayer
- Return type:
float
- Returns:
The time for the LayerGeometry
-
getLayerGeometryByTime
(time)¶ - Return type:
LayerGeometry
-
getLayerGeometryIdByTime
(time)¶ - Return type:
int
-
getLayerGeometryNodeByTime
(time)¶ Gets the
TimeNode
for aLayerGeometry
given a time- Parameters:
time (
float
) – The time- Return type:
TimeNode
- Returns:
The LayerGeometry TimeNode
-
getLayerIdByTime
(time)¶ Gets the current
Layer
index based on the search time- Parameters:
time (
float
) – The time for finding the layer- Return type:
int
- Returns:
The Layer Index in the list if found
-
getLayerNodeByTime
(time)¶ - Return type:
Optional
[TimeNode
]
-
getLayerTime
(layerId)¶ Gets the total time for a
Layer
given a unique aLayer
index- Parameters:
layerId (
int
) – The layer index in the list- Return type:
float
- Returns:
The time fo the layer
-
getTimeByLayerGeometryId
(layerId, layerGeomId)¶ Gets the current time for a
LayerGeometry
given a unique aLayer
index and aLayerGeometry
index.- Parameters:
layerId (
int
) – The layer index in the listlayerGeomId (
int
) – The layer geometry index within theLayer
- Return type:
float
- Returns:
The time for the LayerGeometry
-
getTimeByLayerId
(layerIdx)¶ Gets the current time in the Build based on the layer index.
- Parameters:
layerIdx (
int
) – The layer index- Return type:
float
- Returns:
The time at the start of the Layer
-
seek
(time)¶ Instructs the iterator to seek ahead to a specific time.
- Parameters:
time (
float
) – The time to seek to- Return type:
None
-
seekByLayer
(layerId)¶ Instructs the iterator to seek ahead in time to the specific
Layer
- Parameters:
layerId (
int
) – The index of the layer within the list of layers provided to the iterator- Return type:
None
-
seekByLayerGeometry
(layerId, layerGeomId)¶ Instructs the iterator to seek ahead in time to the specific
LayerGeometry
- Parameters:
layerId (
int
) – The index of the layer within the list of layers provided to the iteratorlayerGeomId (
int
) – The index of the layer geometry within the specified layer
- Return type:
None