printrun-src/testtools/gcodeviewer.py

changeset 45
c82943fb205f
parent 15
0bbb006204fc
equal deleted inserted replaced
44:310be640a303 45:c82943fb205f
1 #!/usr/bin/env python 1 #!/usr/bin/env python3
2 2
3 # This file is part of the Printrun suite. 3 # This file is part of the Printrun suite.
4 # 4 #
5 # Printrun is free software: you can redistribute it and/or modify 5 # Printrun is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by 6 # it under the terms of the GNU General Public License as published by
30 app = wx.App(redirect = False) 30 app = wx.App(redirect = False)
31 build_dimensions = [200, 200, 100, -100, -100, 0] 31 build_dimensions = [200, 200, 100, -100, -100, 0]
32 build_dimensions = [200, 200, 100, 0, 0, 0] 32 build_dimensions = [200, 200, 100, 0, 0, 0]
33 frame = GcodeViewFrame(None, wx.ID_ANY, 'Gcode view, shift to move view, mousewheel to set layer', size = (800, 800), build_dimensions = build_dimensions) 33 frame = GcodeViewFrame(None, wx.ID_ANY, 'Gcode view, shift to move view, mousewheel to set layer', size = (800, 800), build_dimensions = build_dimensions)
34 gcode = gcoder.GCode(open(sys.argv[1])) 34 gcode = gcoder.GCode(open(sys.argv[1]))
35 print "Gcode loaded" 35 print("Gcode loaded")
36 frame.addfile(gcode) 36 frame.addfile(gcode)
37 37
38 first_move = None 38 first_move = None
39 for i in range(len(gcode.lines)): 39 for i in range(len(gcode.lines)):
40 if gcode.lines[i].is_move: 40 if gcode.lines[i].is_move:

mercurial