Commit 260d6564 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix gviz.py __main__

parent 9dec5488
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Printrun. If not, see <http://www.gnu.org/licenses/>. # along with Printrun. If not, see <http://www.gnu.org/licenses/>.
import wx, time import wx, time
from printrun import gcoder
from printrun_utils import imagefile from printrun_utils import imagefile
...@@ -23,6 +24,10 @@ class window(wx.Frame): ...@@ -23,6 +24,10 @@ class window(wx.Frame):
wx.Frame.__init__(self, None, title = "Gcode view, shift to move view, mousewheel to set layer", size = (size[0], size[1])) wx.Frame.__init__(self, None, title = "Gcode view, shift to move view, mousewheel to set layer", size = (size[0], size[1]))
self.p = gviz(self, size = size, build_dimensions = build_dimensions, grid = grid, extrusion_width = extrusion_width) self.p = gviz(self, size = size, build_dimensions = build_dimensions, grid = grid, extrusion_width = extrusion_width)
if f:
gcode = gcoder.GCode(f)
self.p.addfile(gcode)
vbox = wx.BoxSizer(wx.VERTICAL) vbox = wx.BoxSizer(wx.VERTICAL)
toolbar = wx.ToolBar(self, -1, style = wx.TB_HORIZONTAL | wx.NO_BORDER) toolbar = wx.ToolBar(self, -1, style = wx.TB_HORIZONTAL | wx.NO_BORDER)
toolbar.AddSimpleTool(1, wx.Image(imagefile('zoom_in.png'), wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Zoom In [+]', '') toolbar.AddSimpleTool(1, wx.Image(imagefile('zoom_in.png'), wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Zoom In [+]', '')
...@@ -443,8 +448,8 @@ class gviz(wx.Panel): ...@@ -443,8 +448,8 @@ class gviz(wx.Panel):
self.dirty = 1 self.dirty = 1
if __name__ == '__main__': if __name__ == '__main__':
import sys
app = wx.App(False) app = wx.App(False)
#main = window(open("/home/kliment/designs/spinner/arm_export.gcode")) main = window(open(sys.argv[1]))
main = window(open("jam.gcode"))
main.Show() main.Show()
app.MainLoop() app.MainLoop()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment