-
Notifications
You must be signed in to change notification settings - Fork 16
/
checklist.py
106 lines (103 loc) · 25.9 KB
/
checklist.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright 2015 Michael Uttmark
#
# This file is part of Retr3d.
#
# Retr3d is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Retr3d is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Retr3d. If not, see <http://www.gnu.org/licenses/>.
import os
import globalVars as gv
import datetime
import shutil
def create():
#Make dateString and add it to the directory string
date = datetime.date.today().strftime("%m_%d_%Y")
printerDir = gv.printerDir+"Printer_"+date+"/"
if os.path.isdir(printerDir+'/Checklist/'):
shutil.rmtree(printerDir+'/Checklist/')
os.mkdir(printerDir+'Checklist/')
f = open(printerDir+'Checklist/Checklist.html','a')
f.write('<!DOCTYPE html> \n')
f.write('<html> \n')
f.write('<head> \n')
f.write(' <title>Build Checklist</title> \n')
f.write(' <link rel="stylesheet" href="style.css"/> \n')
f.write('</head> \n')
f.write('<body bgcolor="beige"> \n')
f.write('<h1>Build Checklist</h1> \n')
f.write('<div id="content"> \n')
f.write('<h2>Printed Parts</h2> \n')
f.write('<hr> \n')
f.write('<table> \n')
f.write('<tr><td><input type="checkbox" name="1" id="1" class="css-checkbox" /><label for="1" class="css-label">Top Left Print Bed Bushing Holder</label></td><td><input type="checkbox" name="11" id="11" class="css-checkbox" /><label for="11" class="css-label">X Endstop </label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="1.5" id="1.5" class="css-checkbox" /><label for="1.5" class="css-label">Top Right Print Bed Bushing Holder</label></td><td><input type="checkbox" name="11.5" id="11.5" class="css-checkbox" /><label for="11.5" class="css-label">Bottom Left Print Bed Bushing Holder</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="1.75" id="1.75" class="css-checkbox" /><label for="1.75" class="css-label">Bottom Right Print Bed Bushing Holder</label></td><td><input type="checkbox" name="11.75" id="11.75" class="css-checkbox" /><label for="11.75" class="css-label">Y Rod Support Bottom Right Clamp</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="2" id="2" class="css-checkbox" /><label for="2" class="css-label">Y Rod Support Top Right Clamp </label></td><td><input type="checkbox" name="12" id="12" class="css-checkbox" /><label for="12" class="css-label">Y Motor Mount </label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="3" id="3" class="css-checkbox" /><label for="3" class="css-label">Z Rod Support Top Right</label></td><td><input type="checkbox" name="13" id="13" class="css-checkbox" /><label for="13" class="css-label">Z Rod Support Top Left Clamp</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="3.5" id="3.5" class="css-checkbox" /><label for="3.5" class="css-label">Z Rod Support Bottom Right</label></td><td><input type="checkbox" name="13.5" id="13.5" class="css-checkbox" /><label for="13.5" class="css-label">Z Rod Support Bottom Left Clamp</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="4" id="4" class="css-checkbox" /><label for="4" class="css-label">X Rod Clamp Left </label></td><td><input type="checkbox" name="14" id="14" class="css-checkbox" /><label for="14" class="css-label">X Carriage </label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="5" id="5" class="css-checkbox" /><label for="5" class="css-label">X End Z RodHolder Left </label></td><td><input type="checkbox" name="15" id="15" class="css-checkbox" /><label for="15" class="css-label">X Rod Clamp Right </label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="6" id="6" class="css-checkbox" /><label for="6" class="css-label">Y Rod Support Top Left Clamp</label></td><td><input type="checkbox" name="16" id="16" class="css-checkbox" /><label for="16" class="css-label">Y Rod Support Top Right</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="6.5" id="6.5" class="css-checkbox" /><label for="6.5" class="css-label">Y Rod Support Bottom Left Clamp</label></td><td><input type="checkbox" name="16.5" id="16.5" class="css-checkbox" /><label for="16.5" class="css-label">Y Rod Support Bottom Right</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="7" id="7" class="css-checkbox" /><label for="7" class="css-label">Z Rod Support Top Left</label></td><td><input type="checkbox" name="17.5" id="17.5" class="css-checkbox" /><label for="17.5" class="css-label">Y Rod Support Top Left</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="7.5" id="7.5" class="css-checkbox" /><label for="7.5" class="css-label">Z Rod Support Bottom Left</label></td><td><input type="checkbox" name="17" id="17" class="css-checkbox" /><label for="17" class="css-label">Y Rod Support Bottom Left</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="8" id="8" class="css-checkbox" /><label for="8" class="css-label">X End Z RodHolder Right </label></td><td><input type="checkbox" name="18" id="18" class="css-checkbox" /><label for="18" class="css-label">X Endstop Cap </label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="9" id="9" class="css-checkbox" /><label for="9" class="css-label">Y Belt Anchor </label></td><td><input type="checkbox" name="19" id="19" class="css-checkbox" /><label for="19" class="css-label">Right Z Motor Mount</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="9.5" id="9.5" class="css-checkbox" /><label for="9.5" class="css-label">Left Z Motor Mount</label></td><td><input type="checkbox" name="19.5" id="19.5" class="css-checkbox" /><label for="19.5" class="css-label">Z Rod Support Bottom Right Clamp</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="10" id="10" class="css-checkbox" /><label for="10" class="css-label">Z Rod Support Bottom Right Clamp</label></td></tr></table> \n')
f.write('<hr> \n')
f.write('<h2>Frame</h2> \n')
f.write('<hr> \n')
f.write('<table id="full"> \n')
f.write('<tr><td><input type="checkbox" name="20" id="20" class="css-checkbox" /><label for="20" class="css-label">Vertical Bar Left</label></td><td><input type="checkbox" name="21" id="21" class="css-checkbox" /><label for="21" class="css-label">Vertical Bar Right</label></td></tr> \n')
f.write('<tr><td><sub id="subs">Cut at '+str(round(gv.vertBarLength,1))+'mm'+'<sub></td><td><sub id="subs">Cut at '+str(round(gv.vertBarLength,1))+'mm'+'<sub></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="22" id="22" class="css-checkbox" /><label for="22" class="css-label">Top Cross Bar</label></td><td><input type="checkbox" name="23" id="23" class="css-checkbox" /><label for="23" class="css-label">Front Top Cross Bar</label></td></tr> \n')
f.write('<tr><td><sub id="subs">Cut at '+str(round(gv.crossBarLength,1))+'mm'+'<sub></td><td><sub id="subs">Cut at '+str(round(gv.vertBarLength,1))+'mm'+'<sub></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="24" id="24" class="css-checkbox" /><label for="24" class="css-label">Bottom Front Cross Bar</label></td><td><input type="checkbox" name="25" id="25" class="css-checkbox" /><label for="25" class="css-label">Top Back Cross Bar</label></td></tr> \n')
f.write('<tr><td><sub id="subs">Cut at '+str(round(gv.crossBarLength,1))+'mm'+'<sub></td><td><sub id="subs">Cut at '+str(round(gv.vertBarLength,1))+'mm'+'<sub></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="26" id="26" class="css-checkbox" /><label for="26" class="css-label">Bottom Back Cross Bar</label></td><td><input type="checkbox" name="27" id="27" class="css-checkbox" /><label for="27" class="css-label">Top Left Side Bar</label></td></tr> \n')
f.write('<tr><td><sub id="subs">Cut at '+str(round(gv.crossBarLength,1))+'mm'+'<sub></td><td><sub id="subs">Cut at '+str(round(gv.sideBarLength,1))+'mm'+'<sub></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="28" id="28" class="css-checkbox" /><label for="28" class="css-label">Bottom Left Side Bar</label></td><td><input type="checkbox" name="29" id="29" class="css-checkbox" /><label for="29" class="css-label">Bottom Right Side Bar</label></td></tr> \n')
f.write('<tr><td><sub id="subs">Cut at '+str(round(gv.crossBarLength,1))+'mm'+'<sub></td><td><sub id="subs">Cut at '+str(round(gv.sideBarLength,1))+'mm'+'<sub></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="30" id="30" class="css-checkbox" /><label for="30" class="css-label">Top Right Side Bar</label></td><td><input type="checkbox" name="31" id="31" class="css-checkbox" /><label for="31" class="css-label">Front Left Frame Spacer</label></td></tr> \n')
f.write('<tr><td><sub id="subs">Cut at '+str(round(gv.crossBarLength,1))+'mm'+'<sub></td><td><sub id="subs">Cut at '+str(round(gv.frameSpacerLength,1))+'mm'+'<sub></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="32" id="32" class="css-checkbox" /><label for="32" class="css-label">Back Left Frame Spacer</label></td><td><input type="checkbox" name="33" id="33" class="css-checkbox" /><label for="33" class="css-label">Front Right Frame Spacer</label></td></tr> \n')
f.write('<tr><td><sub id="subs">Cut at '+str(round(gv.frameSpacerLength,1))+'mm'+'<sub></td><td><sub id="subs">Cut at '+str(round(gv.frameSpacerLength,1))+'mm'+'<sub></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="34" id="34" class="css-checkbox" /><label for="34" class="css-label">Back Right Frame Spacer</label></td><td></td></tr> \n')
f.write('<tr><td><sub id="subs">Cut at '+str(round(gv.frameSpacerLength,1))+'mm'+'<sub></td><td></td></tr> \n')
f.write('</table> \n')
f.write('<hr> \n')
f.write('<h2>Miscellaneous</h2> \n')
f.write('<hr> \n')
f.write('<table id="full"> \n')
f.write('<tr><td><input type="checkbox" name="41" id="41" class="css-checkbox" /><label for="41" class="css-label">Angle Iron Extruder Mount</label></td><td><input type="checkbox" name="42" id="42" class="css-checkbox" /><label for="42" class="css-label">Extruder Mount Plate</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="43" id="43" class="css-checkbox" /><label for="43" class="css-label">X End Motor Plate</label></td><td><input type="checkbox" name="44" id="44" class="css-checkbox" /><label for="44" class="css-label">X End Idler Plate</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="45" id="45" class="css-checkbox" /><label for="45" class="css-label">Extruder Barrel</label></td><td><input type="checkbox" name="46" id="46" class="css-checkbox" /><label for="46" class="css-label">Extruder Nozzle</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="47" id="47" class="css-checkbox" /><label for="47" class="css-label">Z End Stop</label></td><td><input type="checkbox" name="48" id="48" class="css-checkbox" /><label for="48" class="css-label">Print Bed Support</label></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="49" id="49" class="css-checkbox" /><label for="49" class="css-label">Print Bed</label></td><td></td></tr> \n')
f.write('</table> \n')
f.write('<hr> \n')
f.write('<h2>Smooth Rods</h2> \n')
f.write('<hr> \n')
f.write('<table id="small-table"> \n')
f.write('<tr><td><input type="checkbox" name="35" id="35" class="css-checkbox" /><label for="35" class="css-label">Left Z Rod</label></td><td><input type="checkbox" name="36" id="36" class="css-checkbox" /><label for="36" class="css-label">Right Z Rod</label></td></tr> \n')
f.write('<tr><td><sub id="subs">Diameter: '+str(round(gv.zRodDiaL,1))+'mm'+'<sub></td><td><sub id="subs">Diameter: '+str(round(gv.zRodDiaR,1))+'mm'+'<sub></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="37" id="37" class="css-checkbox" /><label for="37" class="css-label">Top X Rod</label></td><td><input type="checkbox" name="38" id="38" class="css-checkbox" /><label for="38" class="css-label">Bottom X Rod</label></td></tr> \n')
f.write('<tr><td><sub id="subs">Diameter: '+str(round(gv.xRodDiaTop,1))+'mm'+'<sub></td><td><sub id="subs">Diameter: '+str(round(gv.xRodDiaBottom,1))+'mm'+'<sub></td></tr> \n')
f.write('<tr><td><input type="checkbox" name="39" id="39" class="css-checkbox" /><label for="39" class="css-label">Left Y Rod</label></td><td><input type="checkbox" name="40" id="40" class="css-checkbox" /><label for="40" class="css-label">Right Y Rod</label></td></tr> \n')
f.write('<tr><td><sub id="subs">Diameter: '+str(round(gv.yRodDiaL,1))+'mm'+'<sub></td><td><sub id="subs">Diameter: '+str(round(gv.yRodDiaR,1))+'mm'+'<sub></td></tr> \n')
f.write('</table> \n')
f.write('<hr> \n')
f.write('</div></body></html> \n')
f.close()
shutil.copyfile(os.path.dirname(os.path.abspath(__file__))+'/check/style.css', printerDir+'Checklist/style.css')
shutil.copyfile(os.path.dirname(os.path.abspath(__file__))+'/check/checkbox.png', printerDir+'Checklist/checkbox.png')