Quantcast
Channel: Reprap Forum
Viewing all articles
Browse latest Browse all 39321

Bug in Pronterface nozzle graph while USB printing (2 replies)

$
0
0
Hi there!

There is a problem with the Pronterface graph.

When I start Pronterface and connect to the printer,
I click "watch" to see the bed and nozzle temperature.

This works perfectly fine, both of the lines are correct.

But when I use the "watch" function while I am USB printing,
the nozzle temperature toggles between 0 and the real value!

Tracing pronterface.py brought me to two points of interest:

1. The function recvcb(self, l)

This function receives the reported temperature and stores it.
It will update all the available temperature values in the graph.

A findall approach is used which works for both "T:" and "T0:".
    def recvcb(self, l):
        if ("T:" in l) or ("T0:" in l) or ("T1:" in l) or ("T2:" in l):
            self.tempreport = l
            wx.CallAfter(self.tempdisp.SetLabel, self.tempreport.strip().replace("ok ", ""))
            temps = re.findall("T[0-9]*:\s*([0-9]+\.[0-9])",self.tempreport.strip())
            try:
                #wx.CallAfter(self.graph.SetExtruder0Temperature, parse_temperature_report(self.tempreport, "T:"))
                #wx.CallAfter(self.graph.SetExtruder0Temperature, parse_temperature_report(self.tempreport, "T0:"))
                wx.CallAfter(self.graph.SetExtruder0Temperature, float(temps[0]))
                #wx.CallAfter(self.graph.SetExtruder1Temperature, parse_temperature_report(self.tempreport, "T1:"))
                if len(temps) > 1:
                    wx.CallAfter(self.graph.SetExtruder1Temperature, float(temps[1]))
                #wx.CallAfter(self.graph.SetExtruder2Temperature, parse_temperature_report(self.tempreport, "T2:"))
                if len(temps) > 2:
                    wx.CallAfter(self.graph.SetExtruder2Temperature, float(temps[2]))
                wx.CallAfter(self.graph.SetBedTemperature, parse_temperature_report(self.tempreport, "B:"))
            except:
                traceback.print_exc()
---8<---
2. The function statuschecker(self)

This function also parses the stored temperature report and also updates the graph...!
---8<---
                #wx.CallAfter(self.graph.SetExtruder0Temperature, parse_temperature_report(self.tempreport, "T:"))
                wx.CallAfter(self.graph.SetExtruder0Temperature, parse_temperature_report(self.tempreport, "T0:"))
                wx.CallAfter(self.graph.SetExtruder1Temperature, parse_temperature_report(self.tempreport, "T1:"))
                wx.CallAfter(self.graph.SetExtruder2Temperature, parse_temperature_report(self.tempreport, "T2:"))
                wx.CallAfter(self.graph.SetBedTemperature, parse_temperature_report(self.tempreport, "B:"))
---8<---
The second parse function looks like this:
def parse_temperature_report(report, key):
    if key in report:
        #print report
        #print report.split()
        return float(filter(lambda x: x.startswith(key), report.split())[0].split(":")[1].split("/")[0])
    else:
        return -1.0
Since the Ormerod temperature report contains: "T:193.2 B:64.7",
it will not be able to find the key "T0:" in the report and returns -1.0

The result: both methods are having a heated temperature argument.

What to do about this situation?

Since the Ormerod will support 3 nozzle temperatures in the future,
we could fast-forward and change the reported nozzle ID to "T0:"...

But that does not improve the current state of Pronterface...

I have noticed that there are a lot of smart people on this forum,
What are your ideas about this bug, and the best way to fix this?

If someone would like to fix this, please go ahead! :)

Viewing all articles
Browse latest Browse all 39321

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>