Commit 679b1193 authored by Kliment's avatar Kliment

Add gridlines to gviz

parent de535498
...@@ -126,6 +126,14 @@ class gviz(wx.Panel): ...@@ -126,6 +126,14 @@ class gviz(wx.Panel):
dc.SelectObject(self.blitmap) dc.SelectObject(self.blitmap)
dc.SetBackground(wx.Brush((250,250,200))) dc.SetBackground(wx.Brush((250,250,200)))
dc.Clear() dc.Clear()
dc.SetPen(wx.Pen(wx.Colour(100,100,100)))
for i in xrange(max(self.bedsize)/10):
dc.DrawLine(self.translate[0],self.translate[1]+i*self.scale[1]*10,self.translate[0]+self.scale[0]*max(self.bedsize),self.translate[1]+i*self.scale[1]*10)
dc.DrawLine(self.translate[0]+i*self.scale[0]*10,self.translate[1],self.translate[0]+i*self.scale[0]*10,self.translate[1]+self.scale[1]*max(self.bedsize))
dc.SetPen(wx.Pen(wx.Colour(0,0,0)))
for i in xrange(max(self.bedsize)/50):
dc.DrawLine(self.translate[0],self.translate[1]+i*self.scale[1]*50,self.translate[0]+self.scale[0]*max(self.bedsize),self.translate[1]+i*self.scale[1]*50)
dc.DrawLine(self.translate[0]+i*self.scale[0]*50,self.translate[1],self.translate[0]+i*self.scale[0]*50,self.translate[1]+self.scale[1]*max(self.bedsize))
if not self.showall: if not self.showall:
self.size = self.GetSize() self.size = self.GetSize()
dc.SetBrush(wx.Brush((43,144,255))) dc.SetBrush(wx.Brush((43,144,255)))
...@@ -201,8 +209,8 @@ class gviz(wx.Panel): ...@@ -201,8 +209,8 @@ class gviz(wx.Panel):
if __name__ == '__main__': if __name__ == '__main__':
app = wx.App(False) app = wx.App(False)
#main = window(open("/home/kliment/designs/spinner/gearend_export.gcode")) main = window(open("/home/kliment/designs/spinner/arm_export.gcode"))
main = window(open("jam.gcode")) #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