'Callback when a printer gcode has been sent'

def sentcb(self, line, gline):

    if (not gline):
        pass
    elif (gline.command in ['M104', 'M109']):
        gline_s = gcoder.S(gline)
        if (gline_s is not None):
            temp = gline_s
            if self.display_gauges:
                wx.CallAfter(self.hottgauge.SetTarget, temp)
            if self.display_graph:
                wx.CallAfter(self.graph.SetExtruder0TargetTemperature, temp)
    elif (gline.command in ['M140', 'M190']):
        gline_s = gcoder.S(gline)
        if (gline_s is not None):
            temp = gline_s
            if self.display_gauges:
                wx.CallAfter(self.bedtgauge.SetTarget, temp)
            if self.display_graph:
                wx.CallAfter(self.graph.SetBedTargetTemperature, temp)
    elif (gline.command in ['M106']):
        gline_s = gcoder.S(gline)
        fanpow = 255
        if (gline_s is not None):
            fanpow = gline_s
        if self.display_graph:
            wx.CallAfter(self.graph.SetFanPower, fanpow)
    elif (gline.command in ['M107']):
        if self.display_graph:
            wx.CallAfter(self.graph.SetFanPower, 0)
    elif gline.command.startswith('T'):
        tool = gline.command[1:]
        if hasattr(self, 'extrudersel'):
            wx.CallAfter(self.extrudersel.SetValue, tool)
    if gline.is_move:
        self.sentglines.put_nowait(gline)
