forked from dot-bob/p2pp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
P2PP.py
executable file
·74 lines (62 loc) · 2.38 KB
/
P2PP.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
#!/usr/bin/pythonw
__author__ = 'Tom Van den Eede'
__copyright__ = 'Copyright 2018, Palette2 Splicer Post Processing Project'
__credits__ = ['Tom Van den Eede',
'Tim Brookman'
]
__license__ = 'GPL'
__version__ = '1.0.0'
__maintainer__ = 'Tom Van den Eede'
__email__ = '[email protected]'
__status__ = 'Beta'
import p2pp.mcf as mcf
import argparse
arguments = argparse.ArgumentParser(description='Generates MCF/Omega30 headers from an multi-tool/multi-extruder'
' GCODE derived from Slic3r.')
arguments.add_argument('-i',
'--input-file',
required=True)
arguments.add_argument('-d',
'--output-file',
required=False)
arguments.add_argument('-o',
'--splice-offset',
type=float,
required=False,
default=40.00,
help='Offset position in the purge tower '
'where transition occurs. Similar to transition offset in Chroma.'
' GCODE ;P2PP SPLICEOFFSET=xxx takes precedence over anything set here'
)
arguments.add_argument('-g',
'--gui',
required=False
)
arguments.add_argument('-p',
'--printer-profile',
required=False,
default='',
help='A unique ID linked to a printer configuration'
' profile in the Palette 2 hardware.'
)
arguments.add_argument('-s',
'--silent',
default=False,
help='Omits Summary page after processing from being printed to STDOUT'
)
def main(args):
if not args['gui']:
# CLI Mode
input_file = args['input_file']
mcf.generate(input_file,
args['output_file'],
args['printer_profile'],
args['splice_offset'],
args['silent']
)
# for debugging purposes only - this allows running the tool outside of slicer
else:
# GUI Mode
pass
if __name__ == "__main__":
main(vars(arguments.parse_args()))