kliment / Printrun

Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software
GNU General Public License v3.0
2.37k stars 997 forks source link

[printrun-20131019] When going to zero in Gcode view, a traceback is shown #438

Closed hroncok closed 10 years ago

hroncok commented 10 years ago

Steps to reproduce:

(use keyboard instead of grabing and you end up with the same)

Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/printrun/gviz.py", line 103, in process_slider
    self.SetStatusText(_("Layer %d - Going Up - Z = %.03f mm") % (self.p.layerindex + 1, self.p.layers[self.p.layerindex]), 0)
TypeError: a float is required

The error does no harm, but in Fedora it is caught by Automatic Bug Reporting Tool.

https://retrace.fedoraproject.org/faf/reports/246456/

Unless you know the proper solution, this fixes the problem:

    def process_slider(self, event):
        self.p.layerindex = self.layerslider.GetValue()
        try:
            self.SetStatusText(_("Layer %d - Going Up - Z = %.03f mm") % (self.p.layerindex + 1, self.p.layers[self.p.layerindex]), 0)
        except TypeError:
            pass
        self.p.dirty = 1
        wx.CallAfter(self.p.Refresh)
iXce commented 10 years ago

I think i know the fix. Will look at it when i get to my computer. Le 19 oct. 2013 14:52, "Miro Hrončok" notifications@github.com a écrit :

Steps to reproduce:

  • Load any Gcode file
  • Open Gcode view
  • Grab the slider and move it up for any amount
  • Grab it down back all to the origin

(use keyboard instead of grabing and you end up with the same)

Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/printrun/gviz.py", line 103, in processslider self.SetStatusText(("Layer %d - Going Up - Z = %.03f mm") % (self.p.layerindex + 1, self.p.layers[self.p.layerindex]), 0) TypeError: a float is required

The error does no harm, but in Fedora it is caught by Automatic Bug Reporting Tool.

https://retrace.fedoraproject.org/faf/reports/246456/

Unless you know the proper solution, this fixes the problem:

def process_slider(self, event):
    self.p.layerindex = self.layerslider.GetValue()
    try:
        self.SetStatusText(_("Layer %d - Going Up - Z = %.03f mm") % (self.p.layerindex + 1, self.p.layers[self.p.layerindex]), 0)
    except TypeError:
        pass
    self.p.dirty = 1
    wx.CallAfter(self.p.Refresh)

— Reply to this email directly or view it on GitHubhttps://github.com/kliment/Printrun/issues/438 .

hroncok commented 10 years ago

Once fixed, don't forget to mention it :P

iXce commented 10 years ago

Oops, here's the potential fix ! Couldn't reproduce the issue though :/ Can you send me a gcode that breaks it if it still happens ?

hroncok commented 10 years ago

It was any gcode I suppose. Will try current master and if it is still present, I'll send you the gcode.

hroncok commented 10 years ago

Nope, fixed in master.

hroncok commented 10 years ago

OK, so this was only fixed when using the mouse.

It still says:

Traceback (most recent call last):
  File "/home/churchyard/RepRap/Printrun/printrun/gviz.py", line 142, in key
    self.p.layerdown()
  File "/home/churchyard/RepRap/Printrun/printrun/gviz.py", line 243, in layerdown
    self.parent.SetStatusText(_("Layer %d - Going Down - Z = %.03f mm") % (self.layerindex + 1, self.layers[self.layerindex]), 0)
TypeError: a float is required

...when using the keyboard.

Now it is not happening on botom level of the slider, but cca here:

printrun-bug

iXce commented 10 years ago

How is it now ? 168db35 should have fixed it for good.

hroncok commented 10 years ago

Seems like a proper fix now, thanks