Beispiel #1
0
 def _set_temp(self, params, is_bed=False, wait=False):
     temp = self.get_float('S', params, 0.)
     heater = None
     if is_bed:
         heater = self.printer.lookup_object('heater_bed', None)
     elif 'T' in params:
         index = self.get_int('T', params, minval=0)
         section = 'extruder'
         if index:
             section = 'extruder%d' % (index, )
         extruder = self.printer.lookup_object(section, None)
         if extruder is not None:
             heater = extruder.get_heater()
     elif self.extruder is not None:
         heater = self.extruder.get_heater()
     if heater is None:
         if temp > 0.:
             self.respond_error("Heater not configured")
         return
     print_time = self.toolhead.get_last_move_time()
     try:
         heater.set_temp(print_time, temp)
     except heater.error as e:
         raise self.error(str(e))
     if wait and temp:
         self.bg_temp(heater)
Beispiel #2
0
 def set_temp(self, params, is_bed=False, wait=False):
     temp = self.get_float('S', params, 0.)
     heater = None
     if is_bed:
         heater = self.printer.lookup_object('heater_bed', None)
     elif 'T' in params:
         index = self.get_int('T', params, minval=0)
         extruder = self.printer.lookup_object('extruder%d' % (index,), None)
         if extruder is not None:
             heater = extruder.get_heater()
     elif self.extruder is not None:
         heater = self.extruder.get_heater()
     if heater is None:
         if temp > 0.:
             self.respond_error("Heater not configured")
         return
     print_time = self.toolhead.get_last_move_time()
     try:
         heater.set_temp(print_time, temp)
     except heater.error as e:
         raise error(str(e))
     if wait and temp:
         self.bg_temp(heater)