Merge commit '1c61261320d3c27cccf46782dc06b48de56b6280'
This commit is contained in:
commit
6bef4db302
|
@ -21,4 +21,4 @@ indent_size = 2
|
|||
indent_size = 2
|
||||
|
||||
[**.jinja2]
|
||||
indent_size = 3
|
||||
indent_size = 2
|
||||
|
|
|
@ -11,3 +11,5 @@ dist
|
|||
*.bak
|
||||
.vscode
|
||||
.vscode/**
|
||||
|
||||
thunder-tests
|
|
@ -1,7 +1,6 @@
|
|||
## Fork information:
|
||||
- This is forked from [the original](https://github.com/mmone/OctoprintKlipperPlugin) version 0.2.5
|
||||
- The fork now supports Python3 (hopefully without any new bugs)
|
||||
- The current version is 0.3.5 and includes the pull requests left on the old plugin page that fixes several bugs and Themify support.
|
||||
|
||||
|
||||
## Fork Installation Information:
|
||||
- Uninstall any other versions of the plugin using Plugin Manager or other means, as necessary.
|
||||
|
@ -47,7 +46,7 @@ Also for the moment this plugin does what I wanted it to do, it is far from fini
|
|||
|
||||
The [devel](https://github.com/thelastWallE/OctoprintKlipperPlugin/tree/devel) branch is the branch to merge new features and bugfixes to.
|
||||
The [rc](https://github.com/thelastWallE/OctoprintKlipperPlugin/tree/rc) branch is for Release Candidates and bugfixing them.
|
||||
The [master](https://github.com/thelastWallE/OctoprintKlipperPlugin/tree/master) branch is for Stable Releases.
|
||||
The [master](https://github.com/thelastWallE/OctoprintKlipperPlugin/tree/master) branch is for Stable Releases.
|
||||
|
||||
|
||||
## Screenshots
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
2021-05-06: another day another work on highlighter
|
||||
2021-05-05: update highlighter
|
||||
2021-05-04: work on ace highlighter
|
||||
2021-05-04: update for sensor AD597
|
||||
2021-05-04: shortStatus on sidebar -styling
|
||||
2021-04-26: check values for xyz offsets
|
||||
2021-04-26: more highlight work -closes #48
|
||||
2021-04-15: add probe for z-endstop
|
||||
2021-04-14: fix for config lines with =
|
||||
2021-04-13: fix for config lines with =
|
||||
2021-04-13: more syntax highlighting
|
||||
2021-04-13: more syntax highlighting
|
||||
2021-04-12: improve syntaxhighlight
|
||||
2021-04-11: css
|
||||
2021-04-11: -zooming on editor todo: editor is taking whole dialog
|
||||
2021-04-07: added parsingCheck Checkbox -Strict mode disabled for parsing checks -reworked debug messages
|
||||
2021-04-01: add newline
|
||||
2021-04-01: work on offset dialog -show offset command in the logger -hide the offsetdialog
|
|
@ -44,7 +44,7 @@ class KlipperPlugin(
|
|||
octoprint.plugin.EventHandlerPlugin):
|
||||
|
||||
_parsing_response = False
|
||||
_parsing_check_response = False
|
||||
_parsing_check_response = True
|
||||
_message = ""
|
||||
|
||||
def __init__(self):
|
||||
|
@ -128,7 +128,10 @@ class KlipperPlugin(
|
|||
old_config="",
|
||||
logpath="/tmp/klippy.log",
|
||||
reload_command="RESTART",
|
||||
navbar=True
|
||||
shortStatus_navbar=True,
|
||||
shortStatus_sidebar=True,
|
||||
parse_check=False,
|
||||
fontsize=9
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -160,24 +163,35 @@ class KlipperPlugin(
|
|||
)
|
||||
|
||||
if "config" in data:
|
||||
try:
|
||||
if sys.version_info[0] < 3:
|
||||
data["config"] = data["config"].encode('utf-8')
|
||||
if self.key_exist(data, "configuration", "parse_check"):
|
||||
check_parse = data["configuration"]["parse_check"]
|
||||
else:
|
||||
check_parse = self._settings.get(["configuration", "parse_check"])
|
||||
|
||||
# check for configpath if it was changed during changing of the configfile
|
||||
if self.key_exist(data, "configuration", "configpath"):
|
||||
configpath = os.path.expanduser(
|
||||
data["configuration"]["configpath"]
|
||||
)
|
||||
else:
|
||||
# if the configpath was not changed during changing the printer.cfg. Then the configpath would not be in data[]
|
||||
configpath = os.path.expanduser(
|
||||
self._settings.get(["configuration", "configpath"])
|
||||
)
|
||||
if self.file_exist(configpath) and self._parsing_check_response:
|
||||
if sys.version_info[0] < 3:
|
||||
data["config"] = data["config"].encode('utf-8')
|
||||
|
||||
# check for configpath if it was changed during changing of the configfile
|
||||
if self.key_exist(data, "configuration", "configpath"):
|
||||
configpath = os.path.expanduser(
|
||||
data["configuration"]["configpath"]
|
||||
)
|
||||
else:
|
||||
# if the configpath was not changed during changing the printer.cfg. Then the configpath would not be in data[]
|
||||
configpath = os.path.expanduser(
|
||||
self._settings.get(["configuration", "configpath"])
|
||||
)
|
||||
if self.file_exist(configpath) and (self._parsing_check_response or not check_parse):
|
||||
try:
|
||||
f = open(configpath, "w")
|
||||
f.write(data["config"])
|
||||
f.close()
|
||||
|
||||
|
||||
self.log_debug("Writing Klipper config to {}".format(configpath))
|
||||
except IOError:
|
||||
self.log_error("Error: Couldn't write Klipper config file: {}".format(configpath))
|
||||
else:
|
||||
#load the reload command from changed data if it is not existing load the saved setting
|
||||
if self.key_exist(data, "configuration", "reload_command"):
|
||||
reload_command = os.path.expanduser(
|
||||
|
@ -189,14 +203,9 @@ class KlipperPlugin(
|
|||
if reload_command != "manually":
|
||||
# Restart klippy to reload config
|
||||
self._printer.commands(reload_command)
|
||||
self.log_info("Reloading Klipper Configuration.")
|
||||
|
||||
self.log_debug("Writing Klipper config to {}".format(configpath))
|
||||
except IOError:
|
||||
self.log_error("Error: Couldn't write Klipper config file: {}".format(configpath))
|
||||
else:
|
||||
# we dont want to write the klipper conf to the octoprint settings
|
||||
data.pop("config", None)
|
||||
self.log_info("Restarting Klipper.")
|
||||
# we dont want to write the klipper conf to the octoprint settings
|
||||
data.pop("config", None)
|
||||
|
||||
# save the rest of changed settings into config.yaml of octoprint
|
||||
old_debug_logging = self._settings.get_boolean(["configuration", "debug_logging"])
|
||||
|
@ -224,7 +233,7 @@ class KlipperPlugin(
|
|||
)
|
||||
|
||||
def get_settings_version(self):
|
||||
return 2
|
||||
return 3
|
||||
|
||||
def on_settings_migrate(self, target, current):
|
||||
if current is None:
|
||||
|
@ -271,9 +280,17 @@ class KlipperPlugin(
|
|||
settings.remove(["probePoints"])
|
||||
|
||||
if settings.has(["configPath"]):
|
||||
self.log_info("migrate setting for: configPath")
|
||||
settings.set(["config_path"], settings.get(["configPath"]))
|
||||
settings.remove(["configPath"])
|
||||
|
||||
if target is 3 and current is 2:
|
||||
settings = self._settings
|
||||
if settings.has(["configuration", "navbar"]):
|
||||
self.log_info("migrate setting for: configuration/navbar")
|
||||
settings.set(["configuration", "shortStatus_navbar"], settings.get(["configuration", "navbar"]))
|
||||
settings.remove(["configuration", "navbar"])
|
||||
|
||||
# -- Template Plugin
|
||||
|
||||
def get_template_configs(self):
|
||||
|
@ -367,22 +384,32 @@ class KlipperPlugin(
|
|||
if "FIRMWARE_VERSION" in printerInfo:
|
||||
self.log_info("Firmware version: {}".format(
|
||||
printerInfo["FIRMWARE_VERSION"]))
|
||||
elif "// probe" in line or "// Failed to verify BLTouch" in line:
|
||||
msg = line.strip('/')
|
||||
self.log_info(msg)
|
||||
write_parsing_response_buffer()
|
||||
elif "//" in line:
|
||||
# add lines with // to a buffer
|
||||
self._message = self._message + line.strip('/')
|
||||
if not self._parsing_response:
|
||||
self.update_status("info", self._message)
|
||||
self._parsing_response = True
|
||||
elif "!!" in line:
|
||||
msg = line.strip('!')
|
||||
self.update_status("error", msg)
|
||||
self.log_error(msg)
|
||||
self.write_parsing_response_buffer()
|
||||
else:
|
||||
if self._parsing_response:
|
||||
self._parsing_response = False
|
||||
self.log_info(self._message)
|
||||
self._message = ""
|
||||
if "!!" in line:
|
||||
msg = line.strip('!')
|
||||
self.update_status("error", msg)
|
||||
self.log_error(msg)
|
||||
self.write_parsing_response_buffer()
|
||||
return line
|
||||
|
||||
def write_parsing_response_buffer(self):
|
||||
# write buffer with // lines after a gcode response without //
|
||||
if self._parsing_response:
|
||||
self._parsing_response = False
|
||||
self.log_info(self._message)
|
||||
self._message = ""
|
||||
|
||||
def get_api_commands(self):
|
||||
return dict(
|
||||
listLogFiles=[],
|
||||
|
@ -435,16 +462,17 @@ class KlipperPlugin(
|
|||
self._settings.set(["config"], data["config"])
|
||||
# self.send_message("reload", "config", "", data["config"])
|
||||
# send the configdata to frontend to update ace editor
|
||||
if sys.version_info[0] < 3:
|
||||
data["config"] = data["config"].decode('utf-8')
|
||||
return flask.jsonify(data=data["config"])
|
||||
if sys.version_info[0] < 3:
|
||||
data["config"] = data["config"].decode('utf-8')
|
||||
return flask.jsonify(data=data["config"])
|
||||
elif command == "checkConfig":
|
||||
if "config" in data:
|
||||
if not self.validate_configfile(data["config"]):
|
||||
self.log_debug("validateConfig ->" + data["config"])
|
||||
self.log_debug("validateConfig not ok")
|
||||
self._settings.set(["configuration", "old_config"], data["config"])
|
||||
return flask.jsonify(checkConfig="not OK")
|
||||
else:
|
||||
self.log_debug("validateConfig ok")
|
||||
self._settings.set(["configuration", "old_config"], "")
|
||||
return flask.jsonify(checkConfig="OK")
|
||||
|
||||
|
@ -494,18 +522,18 @@ class KlipperPlugin(
|
|||
def log_info(self, message):
|
||||
self._octoklipper_logger.info(message)
|
||||
self.send_message("log", "info", message, message)
|
||||
self.send_message("console", "info", message, message)
|
||||
|
||||
def log_debug(self, message):
|
||||
self._octoklipper_logger.debug(message)
|
||||
self._logger.info(message)
|
||||
# sends a message to frontend(in klipper.js -> self.onDataUpdaterPluginMessage) and write it to the console.
|
||||
# _mtype, subtype=debug/info, title of message, message)
|
||||
self.send_message("console", "debug", message, message)
|
||||
|
||||
def log_error(self, error):
|
||||
self._octoklipper_logger.error(error)
|
||||
self._logger.info(error)
|
||||
self.send_message("log", "error", error, error)
|
||||
self.send_message("console", "error", error, error)
|
||||
|
||||
def file_exist(self, filepath):
|
||||
if not os.path.isfile(filepath):
|
||||
|
@ -525,34 +553,41 @@ class KlipperPlugin(
|
|||
|
||||
def validate_configfile(self, dataToBeValidated):
|
||||
"""
|
||||
--->For now this just checks if the given data can be parsed<----
|
||||
|
||||
From https://www.opensourceforu.com/2015/03/practical-python-programming-writing-a-config-file-checker/
|
||||
|
||||
Validates a given Config File in filetobevalidated against a correct config file pointed to by goldenfilepath
|
||||
returns a list of erroneous lines as a list[strings]
|
||||
if config file is fine, it should return an empty list
|
||||
--->SyntaxCheck for a given data<----
|
||||
"""
|
||||
#len(ValidateFile('c:\example.cfg', 'c:\example.cfg' ))== 0
|
||||
|
||||
# learn golden file
|
||||
#__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
|
||||
#goldenfilepath = os.path.join(__location__, "goldenprinter.cfg")
|
||||
#goldenconfig = ConfigParser.ConfigParser()
|
||||
# dataToValidated.read(goldenfilepath)
|
||||
|
||||
# learn file to be validated
|
||||
|
||||
try:
|
||||
dataToValidated = configparser.RawConfigParser()
|
||||
dataToValidated = configparser.RawConfigParser(strict=False)
|
||||
#
|
||||
if sys.version_info[0] < 3:
|
||||
buf = StringIO.StringIO(dataToBeValidated)
|
||||
dataToValidated.readfp(buf)
|
||||
else:
|
||||
dataToValidated.read_string(dataToBeValidated)
|
||||
except configparser.DuplicateSectionError:
|
||||
self._parsing_check_response = True
|
||||
|
||||
sections_search_list = ["bltouch",
|
||||
"probe"]
|
||||
value_search_list = [ "x_offset",
|
||||
"y_offset",
|
||||
"z_offset"]
|
||||
try:
|
||||
# cycle through sections and then values
|
||||
for y in sections_search_list:
|
||||
for x in value_search_list:
|
||||
if dataToValidated.has_option(y, x):
|
||||
a_float = dataToValidated.getfloat(y, x)
|
||||
except ValueError as error:
|
||||
self.log_error(
|
||||
"Error: Invalid Value for <b>"+x+"</b> in Section: <b>"+y+"</b>\n" +
|
||||
"{}".format(str(error))
|
||||
)
|
||||
self.send_message("PopUp", "warning", "OctoKlipper: Invalid Config\n",
|
||||
"Config got not saved!\n" +
|
||||
"You can reload your last changes\n" +
|
||||
"on the 'Klipper Configuration' tab.\n\n" +
|
||||
"Invalid Value for <b>"+x+"</b> in Section: <b>"+y+"</b>\n" + "{}".format(str(error)))
|
||||
self._parsing_check_response = False
|
||||
return False
|
||||
except configparser.Error as error:
|
||||
if sys.version_info[0] < 3:
|
||||
error.message = error.message.replace("\\n","")
|
||||
|
@ -568,31 +603,15 @@ class KlipperPlugin(
|
|||
"Error: Invalid Klipper config file:\n" +
|
||||
"{}".format(str(error))
|
||||
)
|
||||
self.send_message("PopUp", "warning", "Invalid Config",
|
||||
self.send_message("PopUp", "warning", "OctoKlipper: Invalid Config data\n",
|
||||
"Config got not saved!\n" +
|
||||
"You can reload your last changes\n" +
|
||||
"on the 'Klipper Configuration' tab.\n\n" + str(error))
|
||||
self._parsing_check_response = False
|
||||
return False
|
||||
else:
|
||||
self._parsing_check_response = True
|
||||
return
|
||||
|
||||
#incorrectlines = []
|
||||
# for section in dataToValidated.sections():
|
||||
# #check each key is present in corresponding golden section
|
||||
# for key in dataToValidated.options(section):
|
||||
# if not goldenconfig.has_option(section,key):
|
||||
# incorrectlines.append(key + "=" + dataToValidated.get(section,key))
|
||||
# # print incorrect lines
|
||||
# if len(incorrectlines) > 0 :
|
||||
# self.send_message("errorPopUp","warning", "OctoKlipper Settings", "Invalid Klipper config file: " + str(incorrectlines))
|
||||
# for k in incorrectlines:
|
||||
# print k
|
||||
# self._logger.error(
|
||||
# "Error: Invalid Klipper config line: {}".format(str(k))
|
||||
# )
|
||||
# return incorrectlines
|
||||
|
||||
return True
|
||||
|
||||
__plugin_name__ = "OctoKlipper"
|
||||
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||
|
|
|
@ -1,519 +0,0 @@
|
|||
# Golden printer.cfg to check against. This should contain all settings under each section that are available.
|
||||
|
||||
[stepper_x]
|
||||
step_pin:
|
||||
# Step GPIO pin (triggered high). This parameter must be provided.
|
||||
dir_pin:
|
||||
# Direction GPIO pin (high indicates positive direction). This
|
||||
# parameter must be provided.
|
||||
enable_pin:
|
||||
# Enable pin (default is enable high; use ! to indicate enable
|
||||
# low). If this parameter is not provided then the stepper motor
|
||||
# driver must always be enabled.
|
||||
rotation_distance:
|
||||
# Distance (in mm) that the axis travels with one full rotation of
|
||||
# the stepper motor. This parameter must be provided.
|
||||
microsteps:
|
||||
# The number of microsteps the stepper motor driver uses. This
|
||||
# parameter must be provided.
|
||||
full_steps_per_rotation: 200
|
||||
# The number of full steps for one rotation of the stepper motor.
|
||||
# Set this to 200 for a 1.8 degree stepper motor or set to 400 for a
|
||||
# 0.9 degree motor. The default is 200.
|
||||
gear_ratio:
|
||||
# The gear ratio if the stepper motor is connected to the axis via a
|
||||
# gearbox. For example, one may specify "5:1" if a 5 to 1 gearbox is
|
||||
# in use. If the axis has multiple gearboxes one may specify a comma
|
||||
# separated list of gear ratios (for example, "57:11, 2:1"). If a
|
||||
# gear_ratio is specified then rotation_distance specifies the
|
||||
# distance the axis travels for one full rotation of the final gear.
|
||||
# The default is to not use a gear ratio.
|
||||
endstop_pin:
|
||||
# Endstop switch detection pin. This parameter must be provided for
|
||||
# the X, Y, and Z steppers on cartesian style printers.
|
||||
position_min: 0
|
||||
# Minimum valid distance (in mm) the user may command the stepper to
|
||||
# move to. The default is 0mm.
|
||||
position_endstop:
|
||||
# Location of the endstop (in mm). This parameter must be provided
|
||||
# for the X, Y, and Z steppers on cartesian style printers.
|
||||
position_max:
|
||||
# Maximum valid distance (in mm) the user may command the stepper to
|
||||
# move to. This parameter must be provided for the X, Y, and Z
|
||||
# steppers on cartesian style printers.
|
||||
homing_speed: 5.0
|
||||
# Maximum velocity (in mm/s) of the stepper when homing. The default
|
||||
# is 5mm/s.
|
||||
homing_retract_dist: 5.0
|
||||
# Distance to backoff (in mm) before homing a second time during
|
||||
# homing. Set this to zero to disable the second home. The default
|
||||
# is 5mm.
|
||||
homing_retract_speed:
|
||||
# Speed to use on the retract move after homing in case this should
|
||||
# be different from the homing speed, which is the default for this
|
||||
# parameter
|
||||
second_homing_speed:
|
||||
# Velocity (in mm/s) of the stepper when performing the second home.
|
||||
# The default is homing_speed/2.
|
||||
homing_positive_dir:
|
||||
# If true, homing will cause the stepper to move in a positive
|
||||
# direction (away from zero); if false, home towards zero. It is
|
||||
# better to use the default than to specify this parameter. The
|
||||
# default is true if position_endstop is near position_max and false
|
||||
# if near position_min.
|
||||
|
||||
[tmc2209 stepper_x]
|
||||
uart_pin: PB15
|
||||
run_current: 0.580
|
||||
hold_current: 0.500
|
||||
stealthchop_threshold: 250
|
||||
|
||||
[stepper_y]
|
||||
step_pin:
|
||||
dir_pin:
|
||||
enable_pin:
|
||||
rotation_distance:
|
||||
microsteps:
|
||||
full_steps_per_rotation: 200
|
||||
gear_ratio:
|
||||
endstop_pin:
|
||||
position_min: 0
|
||||
position_endstop:
|
||||
position_max:
|
||||
homing_speed: 5.0
|
||||
homing_retract_dist: 5.0
|
||||
homing_retract_speed:
|
||||
second_homing_speed:
|
||||
homing_positive_dir:
|
||||
|
||||
[tmc2209 stepper_y]
|
||||
uart_pin: PC6
|
||||
run_current: 0.580
|
||||
hold_current: 0.500
|
||||
stealthchop_threshold: 250
|
||||
|
||||
[stepper_z]
|
||||
step_pin:
|
||||
dir_pin:
|
||||
enable_pin:
|
||||
rotation_distance:
|
||||
microsteps:
|
||||
full_steps_per_rotation: 200
|
||||
gear_ratio:
|
||||
endstop_pin:
|
||||
position_min: 0
|
||||
position_endstop:
|
||||
position_max:
|
||||
homing_speed: 5.0
|
||||
homing_retract_dist: 5.0
|
||||
homing_retract_speed:
|
||||
second_homing_speed:
|
||||
homing_positive_dir:
|
||||
|
||||
[tmc2209 stepper_z]
|
||||
uart_pin: PC10
|
||||
run_current: 0.580
|
||||
hold_current: 0.500
|
||||
stealthchop_threshold: 10
|
||||
|
||||
[safe_z_home]
|
||||
home_xy_position: 70,100
|
||||
speed: 50
|
||||
z_hop: 10
|
||||
z_hop_speed: 4
|
||||
|
||||
# --------------------For Delta Kinematics: --------------------------
|
||||
# The stepper_a section describes the stepper controlling the front
|
||||
# left tower (at 210 degrees). This section also controls the homing
|
||||
# parameters (homing_speed, homing_retract_dist) for all towers.
|
||||
[stepper_a]
|
||||
position_endstop:
|
||||
# Distance (in mm) between the nozzle and the bed when the nozzle is
|
||||
# in the center of the build area and the endstop triggers. This
|
||||
# parameter must be provided for stepper_a; for stepper_b and
|
||||
# stepper_c this parameter defaults to the value specified for
|
||||
# stepper_a.
|
||||
arm_length:
|
||||
# Length (in mm) of the diagonal rod that connects this tower to the
|
||||
# print head. This parameter must be provided for stepper_a; for
|
||||
# stepper_b and stepper_c this parameter defaults to the value
|
||||
# specified for stepper_a.
|
||||
#angle:
|
||||
# This option specifies the angle (in degrees) that the tower is
|
||||
# at. The default is 210 for stepper_a, 330 for stepper_b, and 90
|
||||
# for stepper_c.
|
||||
|
||||
# The stepper_b section describes the stepper controlling the front
|
||||
# right tower (at 330 degrees).
|
||||
[stepper_b]
|
||||
position_endstop:
|
||||
arm_length:
|
||||
|
||||
# The stepper_c section describes the stepper controlling the rear
|
||||
# tower (at 90 degrees).
|
||||
[stepper_c]
|
||||
position_endstop:
|
||||
arm_length:
|
||||
|
||||
# The delta_calibrate section enables a DELTA_CALIBRATE extended
|
||||
# g-code command that can calibrate the tower endstop positions and
|
||||
# angles.
|
||||
[delta_calibrate]
|
||||
radius:
|
||||
# Radius (in mm) of the area that may be probed. This is the radius
|
||||
# of nozzle coordinates to be probed; if using an automatic probe
|
||||
# with an XY offset then choose a radius small enough so that the
|
||||
# probe always fits over the bed. This parameter must be provided.
|
||||
speed: 50
|
||||
# The speed (in mm/s) of non-probing moves during the calibration.
|
||||
# The default is 50.
|
||||
horizontal_move_z: 5
|
||||
# The height (in mm) that the head should be commanded to move to
|
||||
# just prior to starting a probe operation. The default is 5.
|
||||
|
||||
# -------------- For Polar Kinematics ---------------------------
|
||||
# The stepper_bed section is used to describe the stepper controlling
|
||||
# the bed.
|
||||
[stepper_bed]
|
||||
gear_ratio:
|
||||
# A gear_ratio must be specified and rotation_distance may not be
|
||||
# specified. For example, if the bed has an 80 toothed pulley driven
|
||||
# by a stepper with a 16 toothed pulley then one would specify a
|
||||
# gear ratio of "80:16". This parameter must be provided.
|
||||
max_z_velocity:
|
||||
# This sets the maximum velocity (in mm/s) of movement along the z
|
||||
# axis. This setting can be used to restrict the maximum speed of
|
||||
# the z stepper motor. The default is to use max_velocity for
|
||||
# max_z_velocity.
|
||||
max_z_accel:
|
||||
# This sets the maximum acceleration (in mm/s^2) of movement along
|
||||
# the z axis. It limits the acceleration of the z stepper motor. The
|
||||
# default is to use max_accel for max_z_accel.
|
||||
|
||||
# The stepper_arm section is used to describe the stepper controlling
|
||||
# the carriage on the arm.
|
||||
[stepper_arm]
|
||||
|
||||
# --------------------- For
|
||||
|
||||
|
||||
[extruder]
|
||||
step_pin: PB3
|
||||
dir_pin: !PB4
|
||||
enable_pin: !PD2
|
||||
microsteps: 16
|
||||
rotation_distance: 33.400
|
||||
nozzle_diameter: 0.400
|
||||
filament_diameter: 1.750
|
||||
heater_pin: PC8
|
||||
sensor_type: EPCOS 100K B57560G104F
|
||||
sensor_pin: PA0
|
||||
control: pid
|
||||
pid_Kp=26.049
|
||||
pid_Ki=1.258
|
||||
pid_Kd=134.805
|
||||
min_temp: 0
|
||||
max_temp: 250
|
||||
pressure_advance: 0.07
|
||||
pressure_advance_smooth_time: 0.040
|
||||
|
||||
[tmc2209 extruder]
|
||||
uart_pin: PC11
|
||||
run_current: 0.670
|
||||
hold_current: 0.500
|
||||
stealthchop_threshold: 5
|
||||
|
||||
[heater_bed]
|
||||
heater_pin: PC9
|
||||
sensor_type: ATC Semitec 104GT-2
|
||||
sensor_pin: PC3
|
||||
control: pid
|
||||
pid_Kp=72.740
|
||||
pid_Ki=1.569
|
||||
pid_Kd=842.877
|
||||
min_temp: 0
|
||||
max_temp: 130
|
||||
|
||||
[fan]
|
||||
pin: PA8
|
||||
|
||||
[mcu]
|
||||
serial:
|
||||
# The serial port to connect to the MCU. If unsure (or if it
|
||||
# changes) see the "Where's my serial port?" section of the FAQ.
|
||||
# This parameter must be provided when using a serial port.
|
||||
baud: 250000
|
||||
# The baud rate to use. The default is 250000.
|
||||
canbus_uuid:
|
||||
# If using a device connected to a CAN bus then this sets the unique
|
||||
# chip identifier to connect to. This value must be provided when using
|
||||
# CAN bus for communication.
|
||||
canbus_interface:
|
||||
# If using a device connected to a CAN bus then this sets the CAN
|
||||
# network interface to use. The default is 'can0'.
|
||||
pin_map:
|
||||
# This option may be used to enable Arduino pin name aliases. The
|
||||
# default is to not enable the aliases.
|
||||
restart_method:
|
||||
# This controls the mechanism the host will use to reset the
|
||||
# micro-controller. The choices are 'arduino', 'cheetah', 'rpi_usb',
|
||||
# and 'command'. The 'arduino' method (toggle DTR) is common on
|
||||
# Arduino boards and clones. The 'cheetah' method is a special
|
||||
# method needed for some Fysetc Cheetah boards. The 'rpi_usb' method
|
||||
# is useful on Raspberry Pi boards with micro-controllers powered
|
||||
# over USB - it briefly disables power to all USB ports to
|
||||
# accomplish a micro-controller reset. The 'command' method involves
|
||||
# sending a Klipper command to the micro-controller so that it can
|
||||
# reset itself. The default is 'arduino' if the micro-controller
|
||||
# communicates over a serial port, 'command' otherwise.
|
||||
|
||||
[mcu my_extra_mcu]
|
||||
serial:
|
||||
baud: 250000
|
||||
canbus_uuid:
|
||||
canbus_interface:
|
||||
pin_map:
|
||||
restart_method:
|
||||
|
||||
[printer]
|
||||
kinematics:
|
||||
# The type of printer in use. This option may be one of: cartesian,
|
||||
# corexy, corexz, delta, rotary_delta, polar, winch, or none. This
|
||||
# parameter must be specified.
|
||||
max_velocity:
|
||||
# Maximum velocity (in mm/s) of the toolhead (relative to the
|
||||
# print). This parameter must be specified.
|
||||
max_accel:
|
||||
# Maximum acceleration (in mm/s^2) of the toolhead (relative to the
|
||||
# print). This parameter must be specified.
|
||||
max_accel_to_decel:
|
||||
# A pseudo acceleration (in mm/s^2) controlling how fast the
|
||||
# toolhead may go from acceleration to deceleration. It is used to
|
||||
# reduce the top speed of short zig-zag moves (and thus reduce
|
||||
# printer vibration from these moves). The default is half of
|
||||
# max_accel.
|
||||
square_corner_velocity: 5.0
|
||||
# The maximum velocity (in mm/s) that the toolhead may travel a 90
|
||||
# degree corner at. A non-zero value can reduce changes in extruder
|
||||
# flow rates by enabling instantaneous velocity changes of the
|
||||
# toolhead during cornering. This value configures the internal
|
||||
# centripetal velocity cornering algorithm; corners with angles
|
||||
# larger than 90 degrees will have a higher cornering velocity while
|
||||
# corners with angles less than 90 degrees will have a lower
|
||||
# cornering velocity. If this is set to zero then the toolhead will
|
||||
# decelerate to zero at each corner. The default is 5mm/s.
|
||||
#
|
||||
# -----delta Kinematics:------
|
||||
max_z_velocity:
|
||||
# For delta printers this limits the maximum velocity (in mm/s) of
|
||||
# moves with z axis movement. This setting can be used to reduce the
|
||||
# maximum speed of up/down moves (which require a higher step rate
|
||||
# than other moves on a delta printer). The default is to use
|
||||
# max_velocity for max_z_velocity.
|
||||
minimum_z_position: 0
|
||||
# The minimum Z position that the user may command the head to move
|
||||
# to. The default is 0.
|
||||
delta_radius:
|
||||
# Radius (in mm) of the horizontal circle formed by the three linear
|
||||
# axis towers. This parameter may also be calculated as:
|
||||
# delta_radius = smooth_rod_offset - effector_offset - carriage_offset
|
||||
# This parameter must be provided.
|
||||
print_radius:
|
||||
# The radius (in mm) of valid toolhead XY coordinates. One may use
|
||||
# this setting to customize the range checking of toolhead moves. If
|
||||
# a large value is specified here then it may be possible to command
|
||||
# the toolhead into a collision with a tower. The default is to use
|
||||
# delta_radius for print_radius (which would normally prevent a
|
||||
# tower collision).
|
||||
|
||||
max_z_velocity: 5
|
||||
max_z_accel: 100
|
||||
max_accel_to_decel: 1000
|
||||
square_corner_velocity: 5.0
|
||||
|
||||
[bed_screws]
|
||||
screw1: 30,30
|
||||
screw2: 30,200
|
||||
screw3: 200,30
|
||||
screw4: 200,200
|
||||
|
||||
[bed_mesh]
|
||||
speed: 50
|
||||
horizontal_move_z: 5
|
||||
mesh_min: 48,8
|
||||
mesh_max: 200,230
|
||||
probe_count: 7,7
|
||||
fade_start: 1.0
|
||||
fade_end: 0.0
|
||||
umber of
|
||||
algorithm: bicubic
|
||||
|
||||
[static_digital_output usb_pullup_enable]
|
||||
pins: !PC13
|
||||
|
||||
[gcode_arcs]
|
||||
resolution: 1.0
|
||||
|
||||
[bltouch]
|
||||
sensor_pin: ^PC14
|
||||
control_pin: PA1
|
||||
x_offset: 48
|
||||
y_offset: -2
|
||||
z_offset: 1.23
|
||||
pin_move_time: 0.75
|
||||
speed: 1.0
|
||||
lift_speed: 3.0
|
||||
samples: 2
|
||||
sample_retract_dist: 3
|
||||
|
||||
[board_pins]
|
||||
aliases:
|
||||
# EXP1 header
|
||||
EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=<GND>,
|
||||
EXP1_2=PB6, EXP1_4=<RST>, EXP1_6=PB9, EXP1_8=PB7, EXP1_10=<5V>
|
||||
|
||||
[display]
|
||||
lcd_type: st7920
|
||||
cs_pin: EXP1_7
|
||||
sclk_pin: EXP1_6
|
||||
sid_pin: EXP1_8
|
||||
encoder_pins: ^EXP1_5, ^EXP1_3
|
||||
click_pin: ^!EXP1_2
|
||||
|
||||
[output_pin beeper]
|
||||
pin: EXP1_1
|
||||
|
||||
[firmware_retraction]
|
||||
retract_length: 2.7
|
||||
retract_speed: 25
|
||||
unretract_extra_length: 0.0
|
||||
unretract_speed: 25
|
||||
|
||||
[virtual_sdcard]
|
||||
path: /home/pi/.octoprint/uploads
|
||||
|
||||
[gcode_macro DO_MESH]
|
||||
gcode:
|
||||
M140 S60
|
||||
G28
|
||||
M190 S60 ; Heat Bed to 60C
|
||||
BED_MESH_CALIBRATE ;Mesh leveling
|
||||
M140 S0 ;Turn-off bed
|
||||
SAVE_CONFIG
|
||||
|
||||
[gcode_macro CHECK_DISTANCE]
|
||||
gcode:
|
||||
M140 S60
|
||||
G28
|
||||
M190 S60 ; Heat Bed to 60C
|
||||
G1 Z15.8 F1000
|
||||
|
||||
[gcode_macro START_PRINT]
|
||||
gcode:
|
||||
M220 S100 ;Reset Feedrate
|
||||
M221 S100 ;Reset Flowrate
|
||||
G92 E0 ;Reset Extruder
|
||||
G1 Z1.0 F3000 ;Move Z Axis up
|
||||
G1 X0 Y20 Z0.3 F5000.0 ;Move to start position
|
||||
G1 X0 Y200.0 Z0.3 F1500.0 E15 ;Draw the first line
|
||||
G1 X0.4 Y200.0 Z0.3 F5000.0 ;Move to side a little
|
||||
G1 X0.4 Y20 Z0.3 F1500.0 E27 ;Draw the second line
|
||||
G1 Z1.6 F3000 ;Move Z Axis up
|
||||
|
||||
[gcode_macro END_PRINT]
|
||||
gcode:
|
||||
;MESH:ENDGCODE
|
||||
G91 ;Relative positioning
|
||||
G92 E0 ;Reset Extruder
|
||||
G1 F2400 E-8
|
||||
G1 Z0.2 F2400 ;Raise Z
|
||||
G1 X5 Y5 F3000 ;Wipe out
|
||||
G1 Z10 ;Raise Z more
|
||||
G90 ;Absolute positionning
|
||||
G1 X0 Y{machine_depth} ;Present print
|
||||
M106 S0 ;Turn-off fan
|
||||
M140 S0 ;Turn-off bed
|
||||
M84 X Y E ;Disable all steppers but Z
|
||||
|
||||
[gcode_macro SET_RETRACTIONLENGTH]
|
||||
gcode:
|
||||
SET_RETRACTION RETRACT_LENGTH={params.LENGTH|float}
|
||||
GET_RETRACTION
|
||||
|
||||
[pause_resume]
|
||||
# M600: Filament Change. This macro will pause the printer, move the
|
||||
# tool to the change position, and retract the filament 50mm. Adjust
|
||||
# the retraction settings for your own extruder. After filament has
|
||||
# been changed, the print can be resumed from its previous position
|
||||
# with the "RESUME" gcode.
|
||||
|
||||
[gcode_macro PARK]
|
||||
gcode:
|
||||
G1 X125 Y200.0 Z200.0 F4000
|
||||
|
||||
[gcode_macro FILAMENT_LOAD]
|
||||
gcode:
|
||||
M83 ; set e to relative positioning
|
||||
G92 E0.0
|
||||
G1 E70 F500 ; Initially go fast
|
||||
G92 E0.0
|
||||
G1 E10 F200 ; then go slow
|
||||
G92 E0.0
|
||||
|
||||
[gcode_macro FILAMENT_UNLOAD]
|
||||
gcode:
|
||||
M83 ; set e to relative positioning
|
||||
# wiggle filament out of the nozzle
|
||||
G1 E0.5 F1000
|
||||
G1 E-0.5 F1000
|
||||
G1 E1.0 F1000
|
||||
G1 E-1.0 F1000
|
||||
G1 E1.5 F1000
|
||||
G1 E-1.5 F1000
|
||||
G1 E2.0 F1000
|
||||
|
||||
G1 E-100.0 F3000 ;fully unload
|
||||
G92 E0.0
|
||||
|
||||
[gcode_macro M600]
|
||||
default_parameter_X: 0
|
||||
default_parameter_Y: 0
|
||||
default_parameter_Z: 50
|
||||
gcode:
|
||||
SAVE_GCODE_STATE NAME=M600_state
|
||||
PAUSE
|
||||
G91 ;relative
|
||||
G1 E-.2 F2700
|
||||
G1 Z{Z} ;raise nozzle
|
||||
G90 ;absolute
|
||||
G1 X{X} Y{Y} F3000
|
||||
G91 ;relative
|
||||
M300 P1000 ;beep
|
||||
FILAMENT_UNLOAD ;
|
||||
M300 P3000 ;beep
|
||||
G90 ;absolute
|
||||
RESTORE_GCODE_STATE NAME=M600_state
|
||||
|
||||
#*# <---------------------- SAVE_CONFIG ---------------------->
|
||||
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
|
||||
#*#
|
||||
#*# [bed_mesh default]
|
||||
#*# version = 1
|
||||
#*# points =
|
||||
#*# 0.087500, 0.080000, 0.068750, 0.047500, 0.075000, 0.078750, 0.085000
|
||||
#*# 0.068750, 0.065000, 0.055000, 0.028750, 0.052500, 0.055000, 0.057500
|
||||
#*# 0.092500, 0.091250, 0.082500, 0.048750, 0.070000, 0.063750, 0.066250
|
||||
#*# 0.116250, 0.132500, 0.122500, 0.090000, 0.105000, 0.100000, 0.092500
|
||||
#*# 0.128750, 0.135000, 0.130000, 0.086250, 0.096250, 0.076250, 0.076250
|
||||
#*# 0.112500, 0.126250, 0.128750, 0.107500, 0.122500, 0.127500, 0.125000
|
||||
#*# 0.120000, 0.133750, 0.141250, 0.097500, 0.125000, 0.106250, 0.100000
|
||||
#*# tension = 0.2
|
||||
#*# min_x = 48.0
|
||||
#*# algo = bicubic
|
||||
#*# y_count = 7
|
||||
#*# mesh_y_pps = 2
|
||||
#*# min_y = 8.0
|
||||
#*# x_count = 7
|
||||
#*# max_y = 230.0
|
||||
#*# mesh_x_pps = 2
|
||||
#*# max_x = 199.97
|
|
@ -1,16 +1,46 @@
|
|||
.plugin-klipper-sidebar {
|
||||
padding: 1px;
|
||||
height: auto;
|
||||
border: 1px solid #aaa;
|
||||
width: 98%;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
li#navbar_plugin_klipper {
|
||||
cursor: pointer;
|
||||
max-width:360px;
|
||||
max-height:80px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.plugin-klipper-sidebar a {
|
||||
padding: 2px 2px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.plugin-klipper-sidebar a:hover, .plugin-klipper-sidebar a:active {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.plugin-klipper-log {
|
||||
padding: 3px;
|
||||
padding: 0px;
|
||||
overflow-y: scroll;
|
||||
height: 400px;
|
||||
border: 1px solid #eee;
|
||||
width: 100%;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.plugin-klipper-log .log-item {
|
||||
margin: 3px auto 0 auto;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 3px;
|
||||
background-color: #eeeeef;
|
||||
background-color: #efefef;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
|
@ -57,26 +87,30 @@ ul#klipper-settings {
|
|||
|
||||
#tab_plugin_klipper_main .row-fluid {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
flex: row wrap;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
#tab_plugin_klipper_main .span8 {
|
||||
flex-grow: 8;
|
||||
float: left;
|
||||
box-sizing: border-box;
|
||||
@media all and (max-width: 940px) {
|
||||
#tab_plugin_klipper_main .row-fluid {
|
||||
/* On small screens, we are no longer using row direction but column */
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
#tab_plugin_klipper_main #left-side {
|
||||
flex: 3 1;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
#tab_plugin_klipper_main .span8 label {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#tab_plugin_klipper_main .span4 {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 1;
|
||||
/* max-width: 13%; */
|
||||
float: left;
|
||||
box-sizing: border-box;
|
||||
#tab_plugin_klipper_main #right-side {
|
||||
flex: 1 1;
|
||||
max-width: 200px;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
#settings_plugin_klipper {
|
||||
|
@ -94,17 +128,46 @@ ul#klipper-settings {
|
|||
}
|
||||
|
||||
#settings_plugin_klipper form .tab-content .tab-pane {
|
||||
height: calc(100% - 35px);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/*conf editor*/
|
||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group {
|
||||
margin-bottom: 0px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group .editor-controls{
|
||||
margin-bottom: 0px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group div.conf-editor {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
height: calc(100% - 28px);
|
||||
width: 100%;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
/*UIcustomizer fix for responsiveMode*/
|
||||
body.UICResponsiveMode #settings_dialog_content {
|
||||
width: 100%;
|
||||
width: calc(100% - 30px);
|
||||
height: 97%;
|
||||
height: calc(100% - 35px);
|
||||
margin-right: -18px;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
body.UICResponsiveMode div#settings_plugin_klipper form.form-horizontal div.tab-content div.tab-pane div.control-group.row-fluid.UICRemoveFluidRow {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group div.conf-editor div#plugin-klipper-config {
|
||||
position: relative;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group button.btn.btn-small {
|
||||
|
@ -113,6 +176,24 @@ div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content
|
|||
margin: 0px 2px 2px 2px;
|
||||
}
|
||||
|
||||
/*checkboxes*/
|
||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div.tab-pane.active div.control-group input.inline-checkbox {
|
||||
vertical-align: -0.2em;
|
||||
}
|
||||
|
||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div.tab-pane.active div.control-group label.inline {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div.tab-pane.active div.control-group div.controls input.controls-checkbox {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
/*macros*/
|
||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#macros.tab-pane.active div div#item.control-group label.control-label {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
#macros #item.control-group {
|
||||
margin-bottom: 2px;
|
||||
border: 2px solid #ccc;
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
$(function () {
|
||||
function KlipperViewModel(parameters) {
|
||||
var self = this;
|
||||
var console_debug = false;
|
||||
|
||||
self.header = OctoPrint.getRequestHeaders({
|
||||
"content-type": "application/json",
|
||||
|
@ -32,7 +31,8 @@ $(function () {
|
|||
self.paramMacroViewModel = parameters[4];
|
||||
self.access = parameters[5];
|
||||
|
||||
self.shortStatus = ko.observable();
|
||||
self.shortStatus_navbar = ko.observable();
|
||||
self.shortStatus_sidebar = ko.observable();
|
||||
self.logMessages = ko.observableArray();
|
||||
|
||||
self.showPopUp = function(popupType, popupTitle, message){
|
||||
|
@ -141,10 +141,17 @@ $(function () {
|
|||
self.consoleMessage(data.subtype, data.payload);
|
||||
break;
|
||||
case "status":
|
||||
self.shortStatus(data.payload);
|
||||
if (data.payload.length > 36) {
|
||||
var shortText = data.payload.substring(0, 31) + " [..]"
|
||||
self.shortStatus_navbar(shortText);
|
||||
} else {
|
||||
self.shortStatus_navbar(data.payload);
|
||||
}
|
||||
self.shortStatus_sidebar(data.payload);
|
||||
break;
|
||||
default:
|
||||
self.logMessage(data.time, data.subtype, data.payload);
|
||||
self.consoleMessage(data.subtype, data.payload);
|
||||
}
|
||||
|
||||
//if ("warningPopUp" == data.type){
|
||||
|
@ -165,7 +172,11 @@ $(function () {
|
|||
}
|
||||
};
|
||||
|
||||
self.logMessage = function (timestamp, type, message) {
|
||||
self.logMessage = function (timestamp, type="info", message) {
|
||||
if (!timestamp) {
|
||||
var today = new Date();
|
||||
var timestamp = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
|
||||
}
|
||||
self.logMessages.push({
|
||||
time: timestamp,
|
||||
type: type,
|
||||
|
@ -174,14 +185,14 @@ $(function () {
|
|||
};
|
||||
|
||||
self.consoleMessage = function (type, message) {
|
||||
if (type == "info"){
|
||||
console.info("OctoKlipper : " + message);
|
||||
} else if (type == "debug"){
|
||||
if (console_debug){
|
||||
console.debug("OctoKlipper : " + message);
|
||||
if (self.settings.settings.plugins.klipper.configuration.debug_logging() === true) {
|
||||
if (type == "info"){
|
||||
console.info("OctoKlipper : " + message);
|
||||
} else if (type == "debug"){
|
||||
console.debug("OctoKlipper : " + message);
|
||||
} else {
|
||||
console.error("OctoKlipper : " + message);
|
||||
}
|
||||
} else {
|
||||
console.error("OctoKlipper : " + message);
|
||||
}
|
||||
return
|
||||
};
|
||||
|
@ -200,7 +211,7 @@ $(function () {
|
|||
$.ajax(settings).done(function (response) {
|
||||
self.consoleMessage(
|
||||
"debug",
|
||||
"Reloaded from Backend " + response);
|
||||
"Reloaded config file from Backend");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -4,47 +4,73 @@
|
|||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
|
||||
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
$(function() {
|
||||
function KlipperOffsetDialogViewModel(parameters) {
|
||||
var self = this;
|
||||
|
||||
self.offsetX = ko.observable();
|
||||
self.offsetY = ko.observable();
|
||||
self.offsetZ = ko.observable();
|
||||
self.adjust = ko.observable();
|
||||
|
||||
self.onStartup = function() {
|
||||
self.offsetX(0);
|
||||
self.offsetY(0);
|
||||
self.offsetZ(0);
|
||||
self.adjust(false);
|
||||
}
|
||||
|
||||
self.setOffset = function() {
|
||||
if(self.adjust()) {
|
||||
OctoPrint.control.sendGcode("SET_GCODE_OFFSET X_ADJUST=" + self.offsetX() +
|
||||
" Y_ADJUST=" + self.offsetY() +
|
||||
" Z_ADJUST=" + self.offsetZ());
|
||||
} else {
|
||||
OctoPrint.control.sendGcode("SET_GCODE_OFFSET X=" + self.offsetX() +
|
||||
" Y=" + self.offsetY() +
|
||||
" Z=" + self.offsetZ());
|
||||
}
|
||||
}
|
||||
}
|
||||
$(function () {
|
||||
function KlipperOffsetDialogViewModel(parameters) {
|
||||
var self = this;
|
||||
|
||||
OCTOPRINT_VIEWMODELS.push({
|
||||
construct: KlipperOffsetDialogViewModel,
|
||||
dependencies: [],
|
||||
elements: ["#klipper_offset_dialog"]
|
||||
});
|
||||
self.klipperViewModel = parameters[0];
|
||||
|
||||
self.offsetX = ko.observable();
|
||||
self.offsetY = ko.observable();
|
||||
self.offsetZ = ko.observable();
|
||||
self.adjust = ko.observable();
|
||||
|
||||
self.onStartup = function () {
|
||||
self.offsetX(0);
|
||||
self.offsetY(0);
|
||||
self.offsetZ(0);
|
||||
self.adjust(false);
|
||||
};
|
||||
|
||||
self.setOffset = function () {
|
||||
if (self.adjust()) {
|
||||
self.klipperViewModel.logMessage("","info", "SET_GCODE_OFFSET\n X_ADJUST=" +
|
||||
self.offsetX() +
|
||||
" Y_ADJUST=" +
|
||||
self.offsetY() +
|
||||
" Z_ADJUST=" +
|
||||
self.offsetZ())
|
||||
OctoPrint.control.sendGcode(
|
||||
"SET_GCODE_OFFSET X_ADJUST=" +
|
||||
self.offsetX() +
|
||||
" Y_ADJUST=" +
|
||||
self.offsetY() +
|
||||
" Z_ADJUST=" +
|
||||
self.offsetZ()
|
||||
);
|
||||
} else {
|
||||
self.klipperViewModel.logMessage("","info", "SET_GCODE_OFFSET\n X=" +
|
||||
self.offsetX() +
|
||||
" Y=" +
|
||||
self.offsetY() +
|
||||
" Z=" +
|
||||
self.offsetZ())
|
||||
OctoPrint.control.sendGcode(
|
||||
"SET_GCODE_OFFSET X=" +
|
||||
self.offsetX() +
|
||||
" Y=" +
|
||||
self.offsetY() +
|
||||
" Z=" +
|
||||
self.offsetZ()
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
OCTOPRINT_VIEWMODELS.push({
|
||||
construct: KlipperOffsetDialogViewModel,
|
||||
dependencies: ["klipperViewModel"],
|
||||
elements: ["#klipper_offset_dialog"],
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,6 +21,7 @@ $(function() {
|
|||
var editor = null;
|
||||
|
||||
self.settings = parameters[0];
|
||||
self.klipperViewModel = parameters[1];
|
||||
|
||||
self.header = OctoPrint.getRequestHeaders({
|
||||
"content-type": "application/json",
|
||||
|
@ -30,8 +31,8 @@ $(function() {
|
|||
self.apiUrl = OctoPrint.getSimpleApiUrl("klipper");
|
||||
|
||||
self.onSettingsBeforeSave = function () {
|
||||
if (editor.session) {
|
||||
//console.debug("OctoKlipper : onSettingsBeforeSave:" + editor.session.getValue())
|
||||
if (editor.session && self.settings.settings.plugins.klipper.configuration.parse_check() === true) {
|
||||
self.klipperViewModel.consoleMessage("debug", "onSettingsBeforeSave:")
|
||||
var settings = {
|
||||
"crossDomain": true,
|
||||
"url": self.apiUrl,
|
||||
|
@ -106,9 +107,31 @@ $(function() {
|
|||
}
|
||||
}
|
||||
|
||||
self.minusFontsize = function () {
|
||||
self.settings.settings.plugins.klipper.configuration.fontsize(self.settings.settings.plugins.klipper.configuration.fontsize() - 1);
|
||||
if (self.settings.settings.plugins.klipper.configuration.fontsize() < 9) {
|
||||
self.settings.settings.plugins.klipper.configuration.fontsize(9);
|
||||
}
|
||||
if (editor) {
|
||||
editor.setFontSize(self.settings.settings.plugins.klipper.configuration.fontsize());
|
||||
editor.resize();
|
||||
}
|
||||
}
|
||||
|
||||
self.plusFontsize = function () {
|
||||
self.settings.settings.plugins.klipper.configuration.fontsize(self.settings.settings.plugins.klipper.configuration.fontsize() + 1);
|
||||
if (self.settings.settings.plugins.klipper.configuration.fontsize() > 20) {
|
||||
self.settings.settings.plugins.klipper.configuration.fontsize(20);
|
||||
}
|
||||
if (editor) {
|
||||
editor.setFontSize(self.settings.settings.plugins.klipper.configuration.fontsize());
|
||||
editor.resize();
|
||||
}
|
||||
}
|
||||
|
||||
self.loadLastSession = function () {
|
||||
if (self.settings.settings.plugins.klipper.configuration.old_config() != "") {
|
||||
console.debug("OctoKlipper : lastSession:" + self.settings.settings.plugins.klipper.configuration.old_config())
|
||||
self.klipperViewModel.consoleMessage("info","lastSession:" + self.settings.settings.plugins.klipper.configuration.old_config())
|
||||
if (editor.session) {
|
||||
editor.session.setValue(self.settings.settings.plugins.klipper.configuration.old_config());
|
||||
editor.clearSelection();
|
||||
|
@ -155,6 +178,8 @@ $(function() {
|
|||
obKlipperConfig = config.withSilence();
|
||||
if (editor) {
|
||||
editor.setValue(obKlipperConfig());
|
||||
editor.setFontSize(self.settings.settings.plugins.klipper.configuration.fontsize());
|
||||
editor.resize();
|
||||
editor.clearSelection();
|
||||
}
|
||||
return obKlipperConfig;
|
||||
|
@ -165,13 +190,16 @@ $(function() {
|
|||
editor.setTheme("ace/theme/monokai");
|
||||
editor.session.setMode("ace/mode/klipper_config");
|
||||
editor.setOptions({
|
||||
autoScrollEditorIntoView: true,
|
||||
maxLines: "Infinity"
|
||||
hScrollBarAlwaysVisible: true,
|
||||
vScrollBarAlwaysVisible: true,
|
||||
autoScrollEditorIntoView: true,
|
||||
//maxLines: "Infinity"
|
||||
})
|
||||
|
||||
editor.session.on('change', function(delta) {
|
||||
if (obKlipperConfig) {
|
||||
obKlipperConfig.silentUpdate(editor.getValue());
|
||||
editor.resize();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -194,7 +222,10 @@ $(function() {
|
|||
|
||||
OCTOPRINT_VIEWMODELS.push({
|
||||
construct: KlipperSettingsViewModel,
|
||||
dependencies: ["settingsViewModel"],
|
||||
dependencies: [
|
||||
"settingsViewModel",
|
||||
"klipperViewModel"
|
||||
],
|
||||
elements: ["#settings_plugin_klipper"]
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
|
||||
var KlipperConfigHighlightRules = function() {
|
||||
|
||||
|
||||
this.$rules = {
|
||||
start: [{
|
||||
include: "#single_line_comment"
|
||||
}, {
|
||||
include: "#config_block"
|
||||
}, {
|
||||
include: "#config_line_sensor"
|
||||
}, {
|
||||
include: "#config_line"
|
||||
}, {
|
||||
include: "#config_line_display"
|
||||
}, {
|
||||
include: "#number"
|
||||
}, {
|
||||
|
@ -20,17 +24,17 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
}],
|
||||
"#single_line_comment": [{
|
||||
token: "comment.line.number-sign",
|
||||
regex: /#.*$/
|
||||
regex: /(?!#\*#)([^\*]|^)#[^\*].*/
|
||||
}, {
|
||||
token: "comment.line.gcode",
|
||||
regex: /;.*$/
|
||||
}],
|
||||
"#number": [{
|
||||
token: "constant.numeric",
|
||||
regex: /\-?\d+(?:[\.,]\d+)?\b/
|
||||
regex: /\-?\d+(?:[\.]\d+)?\b/
|
||||
}, {
|
||||
token: "constant.numeric",
|
||||
regex: /\-?[\.,]\d+?\b/
|
||||
regex: /\-?[\.]\d+?\b/
|
||||
}],
|
||||
"#boolean": [{
|
||||
token: "constant.language",
|
||||
|
@ -56,11 +60,11 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
}]
|
||||
}],
|
||||
"#config_block": [{
|
||||
token: "text",
|
||||
regex: /^\[/,
|
||||
token: "storage.type",
|
||||
regex: /\[/,
|
||||
push: [{
|
||||
token: "text",
|
||||
regex: /\]\s*$/,
|
||||
token: "storage.type",
|
||||
regex: /\]/,
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "#known_config_block_name"
|
||||
|
@ -72,12 +76,12 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
}],
|
||||
"#known_config_block_name": [{
|
||||
token: "storage.type",
|
||||
regex: /\b(?:ad5206|adc_temperature|bed_mesh|bed_screws|bed_tilt|bltouch|board_pins|controller_fan|delayed_gcode|delta_calibrate|display|display_data|display_template|dotstar|dual_carriage|endstop_phase|extruder_stepper|extruder[1-9]{0,1}|fan|filament_switch_sensor|firmware_retraction|force_move|gcode_arcs|gcode_button|gcode_macro|hall_filament_width_sensor|heater_bed|heater_fan|heater_generic|homing_heaters|homing_override|idle_timeout|include|manual_stepper|mcp4018|mcp4451|mcp4728|mcu|menu|multi_pin|neopixel|output_pin|pause_resume|printer|probe|quad_gantry_level|replicape|respond|safe_z_home|samd_sercom|screws_tilt_adjust|servo|skew_correction|static_digital_output|stepper_(?:bed|arm|[abcdxy]|z[1-9]{0,1})|sx1509|temperature_fan|temperature_sensor|thermistor|tsl1401cl_filament_width_sensor|verify_heater|virtual_sdcard|z_tilt)\b/,
|
||||
regex: /\b(?:ad5206|adxl345|input_shaper|resonance_tester|adc_temperature|bed_mesh|bed_screws|bed_tilt|bltouch|board_pins|controller_fan|delayed_gcode|delta_calibrate|display|display_data|display_template|dotstar|dual_carriage|endstop_phase|extruder_stepper|extruder[1-9]{0,1}|fan|filament_switch_sensor|firmware_retraction|force_move|gcode_arcs|gcode_button|gcode_macro|hall_filament_width_sensor|heater_bed|heater_fan|heater_generic|homing_heaters|homing_override|idle_timeout|include|manual_stepper|mcp4018|mcp4451|mcp4728|mcu|menu|multi_pin|neopixel|output_pin|pause_resume|printer|probe|quad_gantry_level|replicape|respond|safe_z_home|samd_sercom|screws_tilt_adjust|servo|skew_correction|static_digital_output|stepper_(?:bed|arm|[abcdxy]|z[1-9]{0,1})|sx1509|temperature_fan|temperature_sensor|thermistor|tsl1401cl_filament_width_sensor|verify_heater|virtual_sdcard|z_tilt)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#known_driver_type": [{
|
||||
token: "support.type",
|
||||
regex: /\btmc(?:2130|2208|2209|2660|5160)\b/,
|
||||
regex: /\b(?:tmc)(?:2130|2208|2209|2660|5160)\b/,
|
||||
caseInsensitive: true,
|
||||
push: [{
|
||||
token: "text",
|
||||
|
@ -94,7 +98,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
}],
|
||||
"#known_extruder_sensor_type": [{
|
||||
token: "support.type",
|
||||
regex: /\b(?:MAX6675|MAX31855|MAX31856|MAX31865|PT100 INA826|AD595|AD8494|AD8495|AD8496|AD8497|PT1000|BME280)\b/,
|
||||
regex: /\b(?:MAX6675|MAX31855|MAX31856|MAX31865|PT100 INA826|AD595|AD597|AD8494|AD8495|AD8496|AD8497|PT1000|BME280|HTU21D|SI7013|SI7020|SI7021|SHT21|lm75|temperature_mcu|temperature_host|DS18B20)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#known_control_type": [{
|
||||
|
@ -102,30 +106,69 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
regex: /\b(?:watermark|pid)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#known_kinematics_type": [{
|
||||
token: "support.type",
|
||||
regex: /\b(?:cartesian|delta|corexy|corexz|polar|rotary_delta|winch|none)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#known_screws_type": [{
|
||||
token: "support.type",
|
||||
regex: /\b(?:CW-M3|CCW-M3|CW-M4|CCW-M4|CW-M5|CCW-M5)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#known_algo_type": [{
|
||||
token: "support.type",
|
||||
regex: /\b(?:lagrange|bicubic)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#known_samples_result_type": [{
|
||||
token: "support.type",
|
||||
regex: /\b(?:median|average)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#known_shaper_type": [{
|
||||
token: "support.type",
|
||||
regex: /\b(?:zv|mzv|zvd|ei|2hump_ei|and|3hump_ei)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#known_axel_chip": [{
|
||||
token: "support.type",
|
||||
regex: /\b(?:adxl345)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#known_display_type": [{
|
||||
token: "support.type",
|
||||
regex: /\b(?:hd44780|st7920|uc1701|ssd1306|sh1106)\b/,
|
||||
regex: /\b(?:hd44780|st7920|uc1701|ssd1306|emulated_st7920|sh1106)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#serial": [{
|
||||
token: "support.type",
|
||||
regex: /\/dev\/serial\/by-(?:id|path)\/[\d\w\/\-:\.]+/
|
||||
regex: /(?:\/dev\/serial\/by-)(?:id\/|path\/)[\d\w\/\-:\.]+/
|
||||
}],
|
||||
"#known_restart_command": [{
|
||||
token: "support.type",
|
||||
regex: /\b(?:arduino|cheetah|rpi_usb|command)\b/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#pin": [{
|
||||
token: "support.type",
|
||||
regex: /[\^~!]*(?:ar|analog)\d{1,2}/,
|
||||
regex: /[\^~!]*(?:EXP|ar|analog)\d{1,2}|(?:probe:z_virtual_endstop|rpi:)/,
|
||||
caseInsensitive: true
|
||||
}, {
|
||||
token: "support.type",
|
||||
regex: /(?:\b)[\^~!]*(?:z:)?[a-z]{1,2}\d{1,2}(?:\.\d{1,2})?/,
|
||||
regex: /(?:(_\d{1,2}=?))/,
|
||||
caseInsensitive: true
|
||||
}, {
|
||||
token: "support.type",
|
||||
regex: /[\^~!]*(?:z:)?[a-zA-Z]{1,2}\d{1,2}(?:\.\d{1,2})?/,
|
||||
caseInsensitive: true
|
||||
}],
|
||||
"#config_line_start_gcode": [{
|
||||
token: ["variable.name", "text"],
|
||||
token: ["variable.name", "variable.name"],
|
||||
regex: /^(gcode)(\s*[:=]\s*)/,
|
||||
push: [{
|
||||
token: "text",
|
||||
regex: /(?=(\[))/,
|
||||
regex: /(?=(\[|#\*#))/,
|
||||
next: "start"
|
||||
}, {
|
||||
include: "#gcode_line"
|
||||
|
@ -133,9 +176,9 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
include: "#single_line_comment"
|
||||
}]
|
||||
}],
|
||||
"#config_line": [{
|
||||
token: ["variable.name", "text"],
|
||||
regex: /^(?!(gcode))(\w+)(\s*[:=]\s*)/,
|
||||
"#config_line_sensor": [{
|
||||
token: ["variable.name", "variable.name"],
|
||||
regex: /(sensor_type)(\s*[:]\s*)/,
|
||||
push: [{
|
||||
token: "text",
|
||||
regex: /$/,
|
||||
|
@ -144,10 +187,67 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
include: "#known_thermistor_type"
|
||||
}, {
|
||||
include: "#known_extruder_sensor_type"
|
||||
}, {
|
||||
include: "#single_line_comment"
|
||||
}]
|
||||
}],
|
||||
"#config_line": [{
|
||||
token: ["variable.name", "variable.name"],
|
||||
regex: /(?!gcode|sensor_type|rpi:)(\w+)(\s*[:]\s*)/,
|
||||
push: [{
|
||||
token: "text",
|
||||
regex: /$/,
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "#known_control_type"
|
||||
}, {
|
||||
include: "#known_display_type"
|
||||
}, {
|
||||
include: "#known_kinematics_type"
|
||||
}, {
|
||||
include: "#known_screws_type"
|
||||
}, {
|
||||
include: "#known_algo_type"
|
||||
}, {
|
||||
include: "#known_samples_result_type"
|
||||
}, {
|
||||
include: "#known_shaper_type"
|
||||
}, {
|
||||
include: "#known_axel_chip"
|
||||
}, {
|
||||
include: "#pin"
|
||||
}, {
|
||||
include: "#serial"
|
||||
}, {
|
||||
include: "#known_restart_command"
|
||||
}, {
|
||||
include: "#number"
|
||||
}, {
|
||||
include: "#boolean"
|
||||
}, {
|
||||
include: "#single_line_comment"
|
||||
}]
|
||||
}],
|
||||
// For multiple keys on one line eg.: ^EXP1_5, ^EXP1_3
|
||||
"#config_line_display": [{
|
||||
token: ["variable.name", "variable.name", "variable.name"],
|
||||
regex: /(?!(gcode))(\w+)(\s*[=]\s*)/,
|
||||
push: [{
|
||||
token: "text",
|
||||
regex: /,|$/,
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "#known_thermistor_type"
|
||||
}, {
|
||||
include: "#known_extruder_sensor_type"
|
||||
}, {
|
||||
include: "#known_control_type"
|
||||
}, {
|
||||
include: "#known_display_type"
|
||||
}, {
|
||||
include: "#known_kinematics_type"
|
||||
}, {
|
||||
include: "#known_algo_type"
|
||||
}, {
|
||||
include: "#pin"
|
||||
}, {
|
||||
|
@ -160,7 +260,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
include: "#single_line_comment"
|
||||
}]
|
||||
}],
|
||||
"#gcode_line": [{
|
||||
"#gcode_line": [{
|
||||
include: "#gcode_command"
|
||||
}, {
|
||||
include: "#gcode_extended_command"
|
||||
|
@ -173,11 +273,11 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
}],
|
||||
"#gcode_command": [{
|
||||
token: ["text", "keyword.operator"],
|
||||
regex: /^(\s*)([A-z]+)(?![A-z])/,
|
||||
regex: /(\s*)([A-z]+)(?![A-z])/,
|
||||
caseInsensitive: true,
|
||||
push: [{
|
||||
token: "text",
|
||||
regex: /(\s|$)/,
|
||||
regex: /(?=(\s|$|;))/,
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "#number"
|
||||
|
@ -191,7 +291,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
caseInsensitive: true,
|
||||
push: [{
|
||||
token: "text",
|
||||
regex: /(?=(\s|$))/,
|
||||
regex: /(?=(\s|$|;))|^/,
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "#number"
|
||||
|
@ -209,7 +309,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
caseInsensitive: true
|
||||
}],
|
||||
"#gcode_extended_parameter": [{
|
||||
token: ["variable.parameter", "text"],
|
||||
token: ["variable.parameter", "variable.parameter"],
|
||||
regex: /\b(AC|ACCEL|ACCEL_TO_DECEL|AD|ADVANCE|ANGLE|BAND|BD|BLUE|CARRIAGE|CLEAR|COMMAND|CURRENT|DISTANCE|DURATION|ENABLE|EXTRUDER|FACTOR|FIELD|GREEN|HEATER|HOLDCURRENT|ID|INDEX|LED|LIFT_SPEED|LOAD|MACRO|METHOD|MODE|MOVE_SPEED|MSG|NAME|PARAMETER|PGP|PIN|PREFIX|PROBE_SPEED|PULLUP|RED|REMOVE|RETRACT_LENGTH|RETRACT_SPEED|SAMPLE_RETRACT_DIST|SAMPLES|SAMPLES_RESULT|SAMPLES_TOLERANCE|SAMPLES_TOLERANCE_RETRIES|SAVE|SENSOR|SERVO|SET_POSITION|SMOOTH_TIME|SPEED|SQUARE_CORNER_VELOCITY|START|STEPPER|STOP_ON_ENDSTOP|SYNC|TARGET|TIMEOUT|TRANSMIT|TYPE|UNRETRACT_EXTRA_LENGTH|UNRETRACT_SPEED|VALUE|VARIABLE|VELOCITY|WIDTH|WRITE_FILE|X|X_ADJUST|XY|XZ|Y|Y_ADJUST|YZ|Z|Z_ADJUST)(=)/,
|
||||
caseInsensitive: true,
|
||||
push: [{
|
||||
|
@ -218,7 +318,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
next: "pop"
|
||||
}, {
|
||||
token: "constant.language",
|
||||
regex: /5V|average|command|echo|error|manual|median|OD|output_mode_store|pin_down|pin_up|reset|self_test|set_5V_output_mode|set_5V_output_mode|set_OD_output_mode|touch_mode/,
|
||||
regex: /$|5V|average|command|echo|error|manual|median|OD|output_mode_store|pin_down|pin_up|reset|self_test|set_5V_output_mode|set_5V_output_mode|set_OD_output_mode|touch_mode/,
|
||||
caseInsensitive: true
|
||||
}, {
|
||||
include: "#number"
|
||||
|
@ -238,29 +338,29 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
}]
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
|
||||
KlipperConfigHighlightRules.metaData = {
|
||||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||||
name: "Klipper Config",
|
||||
scopeName: "source.klipper-config"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
oop.inherits(KlipperConfigHighlightRules, TextHighlightRules);
|
||||
|
||||
|
||||
exports.KlipperConfigHighlightRules = KlipperConfigHighlightRules;
|
||||
});
|
||||
|
||||
|
||||
ace.define("ace/mode/folding/cstyle",[], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
|
||||
var oop = require("../../lib/oop");
|
||||
var Range = require("../../range").Range;
|
||||
var BaseFoldMode = require("./fold_mode").FoldMode;
|
||||
|
||||
|
||||
var FoldMode = exports.FoldMode = function(commentRegex) {
|
||||
if (commentRegex) {
|
||||
this.foldingStartMarker = new RegExp(
|
||||
|
@ -272,9 +372,9 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
}
|
||||
};
|
||||
oop.inherits(FoldMode, BaseFoldMode);
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
|
||||
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
|
||||
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
|
||||
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
|
||||
|
@ -283,59 +383,59 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
this._getFoldWidgetBase = this.getFoldWidget;
|
||||
this.getFoldWidget = function(session, foldStyle, row) {
|
||||
var line = session.getLine(row);
|
||||
|
||||
|
||||
if (this.singleLineBlockCommentRe.test(line)) {
|
||||
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
var fw = this._getFoldWidgetBase(session, foldStyle, row);
|
||||
|
||||
|
||||
if (!fw && this.startRegionRe.test(line))
|
||||
return "start"; // lineCommentRegionStart
|
||||
|
||||
|
||||
return fw;
|
||||
};
|
||||
|
||||
|
||||
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
|
||||
var line = session.getLine(row);
|
||||
|
||||
|
||||
if (this.startRegionRe.test(line))
|
||||
return this.getCommentRegionBlock(session, line, row);
|
||||
|
||||
|
||||
var match = line.match(this.foldingStartMarker);
|
||||
if (match) {
|
||||
var i = match.index;
|
||||
|
||||
|
||||
if (match[1])
|
||||
return this.openingBracketBlock(session, match[1], row, i);
|
||||
|
||||
|
||||
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
|
||||
|
||||
|
||||
if (range && !range.isMultiLine()) {
|
||||
if (forceMultiline) {
|
||||
range = this.getSectionRange(session, row);
|
||||
} else if (foldStyle != "all")
|
||||
range = null;
|
||||
}
|
||||
|
||||
|
||||
return range;
|
||||
}
|
||||
|
||||
|
||||
if (foldStyle === "markbegin")
|
||||
return;
|
||||
|
||||
|
||||
var match = line.match(this.foldingStopMarker);
|
||||
if (match) {
|
||||
var i = match.index + match[0].length;
|
||||
|
||||
|
||||
if (match[1])
|
||||
return this.closingBracketBlock(session, match[1], row, i);
|
||||
|
||||
|
||||
return session.getCommentFoldRange(row, i, -1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.getSectionRange = function(session, row) {
|
||||
var line = session.getLine(row);
|
||||
var startIndent = line.search(/\S/);
|
||||
|
@ -352,7 +452,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
if (startIndent > indent)
|
||||
break;
|
||||
var subRange = this.getFoldWidgetRange(session, "all", row);
|
||||
|
||||
|
||||
if (subRange) {
|
||||
if (subRange.start.row <= startRow) {
|
||||
break;
|
||||
|
@ -364,14 +464,14 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
}
|
||||
endRow = row;
|
||||
}
|
||||
|
||||
|
||||
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
|
||||
};
|
||||
this.getCommentRegionBlock = function(session, line, row) {
|
||||
var startColumn = line.search(/\s*$/);
|
||||
var maxRow = session.getLength();
|
||||
var startRow = row;
|
||||
|
||||
|
||||
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
|
||||
var depth = 1;
|
||||
while (++row < maxRow) {
|
||||
|
@ -380,38 +480,38 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
|||
if (!m) continue;
|
||||
if (m[1]) depth--;
|
||||
else depth++;
|
||||
|
||||
|
||||
if (!depth) break;
|
||||
}
|
||||
|
||||
|
||||
var endRow = row;
|
||||
if (endRow > startRow) {
|
||||
return new Range(startRow, startColumn, endRow, line.length);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
ace.define("ace/mode/klipper_config",[], function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var KlipperConfigHighlightRules = require("./klipper_config_highlight_rules").KlipperConfigHighlightRules;
|
||||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
|
||||
var Mode = function() {
|
||||
this.HighlightRules = KlipperConfigHighlightRules;
|
||||
this.foldingRules = new FoldMode();
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
||||
(function() {
|
||||
this.$id = "ace/mode/klipper_config"
|
||||
}).call(Mode.prototype);
|
||||
|
||||
|
||||
exports.Mode = Mode;
|
||||
}); (function() {
|
||||
ace.require(["ace/mode/klipper_config"], function(m) {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<!-- ko if: settings.settings.plugins.klipper.configuration.navbar -->
|
||||
<a data-bind="text: shortStatus, click: navbarClicked"></a>
|
||||
<!-- ko if: settings.settings.plugins.klipper.configuration.shortStatus_navbar -->
|
||||
<a title="Go to OctoKlipper Tab" data-bind="text: shortStatus_navbar, click: navbarClicked"></a>
|
||||
<!-- /ko -->
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button class="btn btn-block" data-bind="click: setOffset"><i class="icon-cross"></i> {{ _('Set Offset') }}</button>
|
||||
<button class="btn btn-block" data-bind="click: setOffset" data-dismiss="modal"><i class="icon-cross"></i> {{ _('Set Offset') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -17,19 +17,21 @@
|
|||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Replace Connection Panel') }}</label>
|
||||
<div class="controls">
|
||||
<input type="checkbox" class="input-block-level" data-bind="checked: settings.settings.plugins.klipper.connection.replace_connection_panel">
|
||||
<input class="controls-checkbox" title="{{ _('Replace Connection Panel') }}" type="checkbox" data-bind="checked: settings.settings.plugins.klipper.connection.replace_connection_panel">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Show NavBar Message') }}</label>
|
||||
<label class="control-label">{{ _('Show Short Messages') }}</label>
|
||||
<div class="controls">
|
||||
<input type="checkbox" class="input-block-level" data-bind="checked: settings.settings.plugins.klipper.configuration.navbar">
|
||||
<label class="checkbox" title="{{ _('on NavBar') }}"><input type="checkbox" data-bind="checked: settings.settings.plugins.klipper.configuration.shortStatus_navbar"> {{ _('on NavBar') }}</label>
|
||||
<label class="checkbox" title="{{ _('on SideBar') }}"><input type="checkbox" data-bind="checked: settings.settings.plugins.klipper.configuration.shortStatus_sidebar"> {{ _('on SideBar') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Enable debug logging') }}</label>
|
||||
<div class="controls">
|
||||
<input type="checkbox" class="input-block-level" data-bind="checked: settings.settings.plugins.klipper.configuration.debug_logging">
|
||||
<input class="controls-checkbox" title="{{ _('Enable debug logging') }}" type="checkbox" data-bind="checked: settings.settings.plugins.klipper.configuration.debug_logging">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
|
@ -61,44 +63,43 @@
|
|||
</div>
|
||||
<!-- Macros -->
|
||||
<div class="tab-pane" id="macros">
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<div class="control-group" style="margin-bottom: 0px;">
|
||||
<div class="controls" style="margin-left: 82px;">
|
||||
<div class="row-fluid">
|
||||
<div class="span8" style="text-align: right"><small>{{ _('Add macro button to:') }}</small></div>
|
||||
<div class="span1"><small>{{ _('Klipper Tab') }}</small></div>
|
||||
<div class="span2"><small>{{ _('Sidebar') }}</small></div>
|
||||
<div class="span1" style="margin: auto;text-align: center"><small>{{ _('Klipper Tab') }}</small></div>
|
||||
<div class="span2" style="margin: auto;"><small>{{ _('Sidebar') }}</small></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div data-bind="foreach: settings.settings.plugins.klipper.macros">
|
||||
<div class="control-group" id="item">
|
||||
<label class="control-label">{{ _('Name') }}</label>
|
||||
<div class="controls">
|
||||
<div class="controls" style="margin-left: 82px;">
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<input type="text" class="input-block-level" data-bind="value: name"/>
|
||||
</div>
|
||||
<div class="span1">
|
||||
<input type="checkbox" class="input-block-level" data-bind="checked: tab"/>
|
||||
<div class="span1" style="margin: auto; text-align: center;">
|
||||
<input title="{{ _('Klipper Tab') }}" style="margin: auto;" type="checkbox" class="input-block-level" data-bind="checked: tab"/>
|
||||
</div>
|
||||
<div class="span1">
|
||||
<input type="checkbox" class="input-block-level" data-bind="checked: sidebar"/>
|
||||
<div class="span1" style="margin: auto; text-align: center;">
|
||||
<input title="{{ _('Sidebar') }}" style="margin: auto;" type="checkbox" class="input-block-level" data-bind="checked: sidebar"/>
|
||||
</div>
|
||||
<div class="span2">
|
||||
<a href='#' data-bind='click: $parent.moveMacroUp' class="fa fa-chevron-up"></a>
|
||||
<a href='#' data-bind='click: $parent.moveMacroDown' class="fa fa-chevron-down"></a>
|
||||
<a href='#' data-bind='click: $parent.removeMacro' class="fa fa-trash-o"></a>
|
||||
<div class="span2" style="margin: auto; text-align: center;">
|
||||
<a href='#' style="vertical-align: bottom;" data-bind='click: $parent.moveMacroUp' class="fa fa-chevron-up"></a>
|
||||
<a href='#' style="vertical-align: bottom;" data-bind='click: $parent.moveMacroDown' class="fa fa-chevron-down"></a>
|
||||
<a href='#' style="vertical-align: bottom;" data-bind='click: $parent.removeMacro' class="fa fa-trash-o"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label class="control-label">{{ _('Command') }}</label>
|
||||
<div class="controls">
|
||||
<div class="controls" style="margin-left: 82px;">
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<div class="span12" style="margin-top:2px;">
|
||||
<textarea rows="2" class="block" data-bind="value: macro">
|
||||
</textarea>
|
||||
</div>
|
||||
<div class="span2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -153,19 +154,19 @@
|
|||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Probe Feedrate Z') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input type="text" class="input-block-level span3" data-bind="value: settings.settings.plugins.klipper.probe.speed_z">
|
||||
<span class="add-on">mm/min</span>
|
||||
</div>
|
||||
<div class="input-append">
|
||||
<input type="text" class="input-block-level span3" data-bind="value: settings.settings.plugins.klipper.probe.speed_z">
|
||||
<span class="add-on">mm/min</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Feedrate X/Y') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input type="text" class="input-block-level span3" data-bind="value: settings.settings.plugins.klipper.probe.speed_xy">
|
||||
<span class="add-on">mm/min</span>
|
||||
</div>
|
||||
<div class="input-append">
|
||||
<input type="text" class="input-block-level span3" data-bind="value: settings.settings.plugins.klipper.probe.speed_xy">
|
||||
<span class="add-on">mm/min</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
|
@ -180,43 +181,50 @@
|
|||
</div>
|
||||
</div>
|
||||
<div data-bind="foreach: settings.settings.plugins.klipper.probe.points" class="control-group">
|
||||
<label class="control-label" data-bind="text: $index"></label>
|
||||
<div class="controls">
|
||||
<div class="row-fluid">
|
||||
<div class="span3"><input type="text" class="input-block-level" data-bind="value: name"></div>
|
||||
<div class="span3"><input type="text" class="input-block-level" data-bind="value: x"></div>
|
||||
<div class="span3"><input type="text" class="input-block-level" data-bind="value: y"></div>
|
||||
<div class="span3">
|
||||
<a href='#' data-bind='click: $parent.moveProbePointUp' class="fa fa-chevron-up"></a>
|
||||
<a href='#' data-bind='click: $parent.moveProbePointDown' class="fa fa-chevron-down"></a>
|
||||
<a href='#' data-bind='click: $parent.removeProbePoint' class="fa fa-trash-o"></a>
|
||||
</div>
|
||||
</div>
|
||||
<label class="control-label" data-bind="text: $index"></label>
|
||||
<div class="controls">
|
||||
<div class="row-fluid">
|
||||
<div class="span3"><input type="text" class="input-block-level" data-bind="value: name"></div>
|
||||
<div class="span3"><input type="text" class="input-block-level" data-bind="value: x"></div>
|
||||
<div class="span3"><input type="text" class="input-block-level" data-bind="value: y"></div>
|
||||
<div class="span3">
|
||||
<a href='#' data-bind='click: $parent.moveProbePointUp' class="fa fa-chevron-up"></a>
|
||||
<a href='#' data-bind='click: $parent.moveProbePointDown' class="fa fa-chevron-down"></a>
|
||||
<a href='#' data-bind='click: $parent.removeProbePoint' class="fa fa-trash-o"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<a href='#' data-bind='click: addProbePoint' class="fa fa-plus-circle"></a> {{ _('Add Point') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<a href='#' data-bind="click: addProbePoint" class="fa fa-plus-circle"></a> {{ _('Add Point') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Klipper Conf -->
|
||||
<div class="tab-pane" id="conf">
|
||||
<div class="control-group">
|
||||
<script src="plugin/klipper/static/js/lib/ace/ace.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="plugin/klipper/static/js/lib/ace/theme-monokai.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="plugin/klipper/static/js/lib/ace/mode-klipper_config.js" type="text/javascript"></script>
|
||||
<button class="btn btn-small" data-bind='click: loadLastSession'
|
||||
title="Reloads the last changes">
|
||||
<i class="fas fa-redo"></i> {{ _('Reload last changes') }}
|
||||
</button><button class="btn btn-small" data-bind='click: reloadFromFile'>
|
||||
<i class="fas fa-upload"></i></a> {{ _('Reload from file') }}
|
||||
</button>
|
||||
<div class="conf-editor">
|
||||
<input id="hdnLoadKlipperConfig" type="hidden" data-bind="value: configBound(settings.settings.plugins.klipper.config)" />
|
||||
<div id="plugin-klipper-config"></div>
|
||||
<div class="control-group">
|
||||
<script src="plugin/klipper/static/js/lib/ace/ace.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="plugin/klipper/static/js/lib/ace/theme-monokai.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="plugin/klipper/static/js/lib/ace/mode-klipper_config.js" type="text/javascript"></script>
|
||||
<div class="editor-controls">
|
||||
<button class="btn btn-small" data-bind="click: loadLastSession"
|
||||
title="Reloads the last changes">
|
||||
<i class="fas fa-redo"></i> {{ _('Reload last changes') }}
|
||||
</button>
|
||||
<button class="btn btn-small" data-bind='click: reloadFromFile'>
|
||||
<i class="fas fa-upload"></i> {{ _('Reload from file') }}
|
||||
</button>
|
||||
<label class="inline"><input class="inline-checkbox" type="checkbox" data-bind="checked: settings.settings.plugins.klipper.configuration.parse_check"> {{ _('Check parsing on save') }}</label>
|
||||
|
||||
<a href='#' data-bind="click: minusFontsize" class="fas fa-search-minus"></a>
|
||||
<a href='#' data-bind="click: plusFontsize" class="fas fa-search-plus"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="conf-editor">
|
||||
<input id="hdnLoadKlipperConfig" type="hidden" data-bind="value: configBound(settings.settings.plugins.klipper.config)" />
|
||||
<div id="plugin-klipper-config"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
<button class="btn btn-block" data-bind="visible: hasRight('CONFIG', 'Ko'), click: function() {openOctoKlipperSettings('klipper-config');}">{{ _('Open Klipper config') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ko if: settings.settings.plugins.klipper.configuration.shortStatus_sidebar -->
|
||||
<div class="plugin-klipper-sidebar">
|
||||
<a title="Go to OctoKlipper Tab" data-bind="text: shortStatus_sidebar, click: navbarClicked"></a>
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
<div class="control-group" data-bind="visible: hasRight('MACRO', 'Ko')">
|
||||
<div class="controls">
|
||||
<label class="control-label small"><i class="icon-list-alt"></i> {{ _('Macros') }}</label>
|
||||
|
|
|
@ -1,76 +1,112 @@
|
|||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<label>
|
||||
<i class="icon-tasks"></i> {{ _('Messages') }}
|
||||
</label>
|
||||
<div class="plugin-klipper-log" data-bind="foreach: logMessages">
|
||||
<div class="log-item" data-bind="css: type">
|
||||
<div data-bind="text: time" class="ts"></div>
|
||||
<div data-bind="html: msg" class="msg"></div>
|
||||
</div>
|
||||
<div id="left-side">
|
||||
<label> <i class="icon-tasks"></i> {{ _("Messages") }} </label>
|
||||
<div class="plugin-klipper-log" data-bind="foreach: logMessages">
|
||||
<div class="log-item" data-bind="css: type">
|
||||
<div data-bind="text: time" class="ts"></div>
|
||||
<div data-bind="html: msg" class="msg"></div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-mini pull-right clear-btn" data-bind="click: onClearLog"
|
||||
title="Clear Log">
|
||||
<i class="fa fa-trash"></i> {{ _('Clear') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="span4">
|
||||
</div>
|
||||
|
||||
<button
|
||||
class="btn btn-mini pull-right clear-btn"
|
||||
data-bind="click: onClearLog"
|
||||
title="Clear Log"
|
||||
>
|
||||
<i class="fa fa-trash"></i> {{ _("Clear") }}
|
||||
</button>
|
||||
</div>
|
||||
<div id="right-side">
|
||||
<div class="control-group">
|
||||
<div class="control-group">
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="control-label"></label>
|
||||
<button class="btn btn-block btn-small" data-bind="click: onGetStatus, enable: isActive()" title="Query Klipper for its current status">
|
||||
<i class="fa icon-black fa-info-circle"></i> {{ _('Get Status') }}
|
||||
</button>
|
||||
<button class="btn btn-block btn-small" data-bind="visible: hasRight('CONFIG', 'Ko'), click: function() {openOctoKlipperSettings('klipper-config');}" title="Open the Klipper configurationfile">
|
||||
<i class="fa icon-black fa-file-code-o"></i> {{ _('Open Klipper config') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="control-label small"><i class="icon-refresh"></i> {{ _('Restart') }}</label>
|
||||
<button class="btn btn-block btn-small" data-bind="click: onRestartHost, enable: isActive()"
|
||||
title="This will cause the host software to reload its config and perform an internal reset">
|
||||
{{ _('Host') }}
|
||||
</button>
|
||||
<button class="btn btn-block btn-small" data-bind="click: onRestartFirmware, enable: isActive()"
|
||||
title="Similar to a host restart, but also clears any error state from the micro-controller">
|
||||
{{ _('Firmware') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="control-label"><i class="icon-wrench"></i> {{ _('Tools') }}</label>
|
||||
<button class="btn btn-block btn-small" data-bind="click: showLevelingDialog, enable: isActive()"
|
||||
title="Assists in manually leveling your printbed by moving the head to a configurable set of positions in sequence.">
|
||||
{{ _('Assisted Bed Leveling') }}
|
||||
</button>
|
||||
<button class="btn btn-block btn-small" data-bind="click: showPidTuningDialog, enable: isActive()"
|
||||
title="Determines optimal PID parameters by heat cycling the hotend/bed.">
|
||||
{{ _('PID Tuning') }}
|
||||
</button>
|
||||
<button class="btn btn-block btn-small" data-bind="click: showOffsetDialog, enable: isActive()"
|
||||
title="Sets a offset for subsequent GCODE coordinates.">
|
||||
{{ _('Coordinate Offset') }}
|
||||
</button>
|
||||
<button class="btn btn-block btn-small" data-bind="click: showGraphDialog"
|
||||
title="Assists in debugging performance issues by analyzing the Klipper log files.">
|
||||
{{ _('Analyze Klipper Log') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="controls" data-bind="visible: hasRight('MACRO', 'Ko')">
|
||||
<label class="control-label"><i class="icon-list-alt"></i> {{ _('Macros') }}</label>
|
||||
<div data-bind="foreach: settings.settings.plugins.klipper.macros">
|
||||
<!-- ko if: tab -->
|
||||
<button class="btn btn-block btn-small" data-bind="text: name, click: $parent.executeMacro, enable: $parent.isActive()">
|
||||
</button>
|
||||
<!-- /ko -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<label class="control-label"></label>
|
||||
<button
|
||||
class="btn btn-block btn-small"
|
||||
data-bind="click: onGetStatus, enable: isActive()"
|
||||
title="Query Klipper for its current status"
|
||||
>
|
||||
<i class="fa icon-black fa-info-circle"></i> {{ _("Get Status") }}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-block btn-small"
|
||||
data-bind="visible: hasRight('CONFIG', 'Ko'), click: function() {openOctoKlipperSettings('klipper-config');}"
|
||||
title="Open the Klipper configurationfile"
|
||||
>
|
||||
<i class="fa icon-black fa-file-code-o"></i>
|
||||
{{ _("Open Klipper config") }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="control-label small"
|
||||
><i class="icon-refresh"></i> {{ _("Restart") }}</label
|
||||
>
|
||||
<button
|
||||
class="btn btn-block btn-small"
|
||||
data-bind="click: onRestartHost, enable: isActive()"
|
||||
title="This will cause the host software to reload its config and perform an internal reset"
|
||||
>
|
||||
{{ _("Host") }}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-block btn-small"
|
||||
data-bind="click: onRestartFirmware, enable: isActive()"
|
||||
title="Similar to a host restart, but also clears any error state from the micro-controller"
|
||||
>
|
||||
{{ _("Firmware") }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="control-label"
|
||||
><i class="icon-wrench"></i> {{ _("Tools") }}</label
|
||||
>
|
||||
<button
|
||||
class="btn btn-block btn-small"
|
||||
data-bind="click: showLevelingDialog, enable: isActive()"
|
||||
title="Assists in manually leveling your printbed by moving the head to a configurable set of positions in sequence."
|
||||
>
|
||||
{{ _("Assisted Bed Leveling") }}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-block btn-small"
|
||||
data-bind="click: showPidTuningDialog, enable: isActive()"
|
||||
title="Determines optimal PID parameters by heat cycling the hotend/bed."
|
||||
>
|
||||
{{ _("PID Tuning") }}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-block btn-small"
|
||||
data-bind="click: showOffsetDialog, enable: isActive()"
|
||||
title="Sets a offset for subsequent GCODE coordinates."
|
||||
>
|
||||
{{ _("Coordinate Offset") }}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-block btn-small"
|
||||
data-bind="click: showGraphDialog"
|
||||
title="Assists in debugging performance issues by analyzing the Klipper log files."
|
||||
>
|
||||
{{ _("Analyze Klipper Log") }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="controls" data-bind="visible: hasRight('MACRO', 'Ko')">
|
||||
<label class="control-label"
|
||||
><i class="icon-list-alt"></i> {{ _("Macros") }}</label
|
||||
>
|
||||
<div data-bind="foreach: settings.settings.plugins.klipper.macros">
|
||||
<!-- ko if: tab -->
|
||||
<button
|
||||
class="btn btn-block btn-small"
|
||||
data-bind="text: name, click: $parent.executeMacro, enable: $parent.isActive()"
|
||||
></button>
|
||||
<!-- /ko -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue