Alfredo Monclus 8a8c6c064c
Graph in temp panel, combine preheat and temp (#393)
* Graph in temp panel, combine preheat and temp

* Fix target not working properly

* Fix initial preselect

* Add the ability to change in delta temps

* Make the label translatable

* Add Unit to the label

* Add de/select button to popover

* Warn the user if nothing was selected

* Fix templabel

* Fix to comply with pep8

* Fix colors, thanks Jordan

* Fix popover selection

* Update docs image

* Gain horizontal space

* Gain even more horizontal space (remove target)

* Fix temperature_fan

* Add icon and style to temperature_fan

* List preheat deprecation in breaking changes

* Use the printer maximum temperature

* Cleanup target and fix popover select

* Fix codestyle

* Add extra preheat presets

* Change Class name

* Update docs image

* Improve Maximum temperature handling and Temperature fans
2022-01-11 00:39:42 -05:00

85 lines
2.1 KiB
Python

class KlippyGcodes:
HOME = "G28"
HOME_X = "G28 X"
HOME_Y = "G28 Y"
HOME_Z = "G28 Z"
HOME_XY = "G28 X Y"
Z_TILT = "Z_TILT_ADJUST"
QUAD_GANTRY_LEVEL = "QUAD_GANTRY_LEVEL"
MOVE = "G1"
MOVE_ABSOLUTE = "G90"
MOVE_RELATIVE = "G91"
EXTRUDE_ABS = "M82"
EXTRUDE_REL = "M83"
SET_EXT_TEMP = "M104"
SET_BED_TEMP = "M140"
SET_EXT_FACTOR = "M221"
SET_FAN_SPEED = "M106"
SET_SPD_FACTOR = "M220"
PROBE_CALIBRATE = "PROBE_CALIBRATE"
Z_ENDSTOP_CALIBRATE = "Z_ENDSTOP_CALIBRATE"
TESTZ = "TESTZ Z="
ABORT = "ABORT"
ACCEPT = "ACCEPT"
SAVE_CONFIG = "SAVE_CONFIG"
RESTART = "RESTART"
FIRMWARE_RESTART = "FIRMWARE_RESTART"
@staticmethod
def set_bed_temp(temp):
return "%s S%s" % (KlippyGcodes.SET_BED_TEMP, str(temp))
@staticmethod
def set_ext_temp(temp, tool=0):
return "%s T%s S%s" % (KlippyGcodes.SET_EXT_TEMP, str(tool), str(temp))
@staticmethod
def set_heater_temp(heater, temp):
return 'SET_HEATER_TEMPERATURE heater="%s" target=%s' % (heater, str(temp))
@staticmethod
def set_temp_fan_temp(temp_fan, temp):
return 'SET_TEMPERATURE_FAN_TARGET temperature_fan="%s" target=%s' % (temp_fan, str(temp))
@staticmethod
def set_fan_speed(speed):
speed = str(int(float(int(speed) % 101)/100*255))
return "%s S%s" % (KlippyGcodes.SET_FAN_SPEED, speed)
@staticmethod
def set_extrusion_rate(rate):
return "%s S%s" % (KlippyGcodes.SET_EXT_FACTOR, rate)
@staticmethod
def set_speed_rate(rate):
return "%s S%s" % (KlippyGcodes.SET_SPD_FACTOR, rate)
@staticmethod
def testz_move(dist):
return KlippyGcodes.TESTZ + dist
@staticmethod
def extrude(dist, speed=500):
return "%s E%s F%s" % (KlippyGcodes.MOVE, dist, speed)
@staticmethod
def bed_mesh_load(profile):
return "BED_MESH_PROFILE LOAD='%s'" % profile
@staticmethod
def bed_mesh_remove(profile):
return "BED_MESH_PROFILE REMOVE='%s'" % profile
@staticmethod
def bed_mesh_save(profile):
return "BED_MESH_PROFILE SAVE='%s'" % profile