Module SlowDownCoolStrategy
|
|
1 """
2 Allows a layer to cool slowing down the nozzle movement.
3 """
4 from config import config
5 from fabmetheus_utilities import euclidean
6 import gcodes
7
8
12
14 '''Allows a layer to cool slowing down the nozzle movement.'''
16
17 self.minimumLayerTime = config.getfloat('cool','minimum.layer.time')
18
19
20 - def cool(self, layer):
21 '''Apply the cooling by slowing down the print rate.
22 Note: This strategy only sets the feed/flow multiplier for the layer. The gcode
23 engine determines whether this or the minimum layer feed rate is actually used.
24 This allows the speed of the gcode to be modified without having to recalculate
25 the slowdown ratio.
26 '''
27
28 (layerDistance, layerDuration) = layer.getDistanceAndDuration()
29 layer.feedAndFlowRateMultiplier = min(1.0, layerDuration / self.minimumLayerTime)
30