-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSingleHeater.py
More file actions
35 lines (28 loc) · 1006 Bytes
/
SingleHeater.py
File metadata and controls
35 lines (28 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from ..Script import Script
from SingleHeaterImpl import SingleHeaterImpl
class SingleHeater(Script, SingleHeaterImpl):
def getSettingDataString(self):
return """{
"name": "Single heater",
"key": "SingleHeater",
"metadata": {},
"version": 2,
"settings":
{
}
}"""
def load_parameters(self):
pass
def execute(self, data: list):
"""data is a list. Each index contains a layer"""
self.load_parameters()
zero_temp = False
for index, layer in enumerate(data):
lines = layer.split("\n")
new_layer, zero_temp_inserted = self.processLayer(lines)
data[index] = '\n'.join(new_layer)
zero_temp = zero_temp or zero_temp_inserted
if not zero_temp:
# this shoudn't happened, just in case
data[index] += '\n; WARNING resert temeperature missing\nM104 S0'
return data