Merge branch 'devel' into rc
This commit is contained in:
commit
fcc73166e8
|
@ -21,4 +21,4 @@ indent_size = 2
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
[**.jinja2]
|
[**.jinja2]
|
||||||
indent_size = 3
|
indent_size = 2
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
## Fork information:
|
## Fork information:
|
||||||
- This is forked from [the original](https://github.com/mmone/OctoprintKlipperPlugin) version 0.2.5
|
- 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 fork now supports Python3 (hopefully without any new bugs)
|
||||||
- The current version is 0.3.4rc1 and includes the pull requests left on the old plugin page that fixes several bugs and Themify support.
|
- 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:
|
## Fork Installation Information:
|
||||||
- Uninstall any other versions of the plugin using Plugin Manager or other means, as necessary.
|
- Uninstall any other versions of the plugin using Plugin Manager or other means, as necessary.
|
||||||
|
@ -45,9 +45,9 @@ Click on the wrench icon in the titlebar to open OctoPrints settings dialog. Sel
|
||||||
|
|
||||||
Also for the moment this plugin does what I wanted it to do, it is far from finished, pull requests are welcome. If you want to get started, the OctoPrint Plugin API is quite well documented here: [docs.octoprint.org/en/master/plugins](http://docs.octoprint.org/en/master/plugins).
|
Also for the moment this plugin does what I wanted it to do, it is far from finished, pull requests are welcome. If you want to get started, the OctoPrint Plugin API is quite well documented here: [docs.octoprint.org/en/master/plugins](http://docs.octoprint.org/en/master/plugins).
|
||||||
|
|
||||||
The [devel](https://github.com/thelastWallE/OctoprintKlipperPlugin/tree/devel) branch is the branch to merge new features and bugfixes to.
|
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 [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
|
## Screenshots
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 226 KiB After Width: | Height: | Size: 226 KiB |
|
@ -32,6 +32,9 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import ConfigParser as configparser
|
import ConfigParser as configparser
|
||||||
|
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
|
import StringIO
|
||||||
|
|
||||||
class KlipperPlugin(
|
class KlipperPlugin(
|
||||||
octoprint.plugin.StartupPlugin,
|
octoprint.plugin.StartupPlugin,
|
||||||
octoprint.plugin.TemplatePlugin,
|
octoprint.plugin.TemplatePlugin,
|
||||||
|
@ -41,7 +44,7 @@ class KlipperPlugin(
|
||||||
octoprint.plugin.EventHandlerPlugin):
|
octoprint.plugin.EventHandlerPlugin):
|
||||||
|
|
||||||
_parsing_response = False
|
_parsing_response = False
|
||||||
_parsing_check_response = False
|
_parsing_check_response = True
|
||||||
_message = ""
|
_message = ""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -125,7 +128,8 @@ class KlipperPlugin(
|
||||||
old_config="",
|
old_config="",
|
||||||
logpath="/tmp/klippy.log",
|
logpath="/tmp/klippy.log",
|
||||||
reload_command="RESTART",
|
reload_command="RESTART",
|
||||||
navbar=True
|
navbar=True,
|
||||||
|
parse_check=False
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -157,34 +161,49 @@ class KlipperPlugin(
|
||||||
)
|
)
|
||||||
|
|
||||||
if "config" in data:
|
if "config" in data:
|
||||||
try:
|
if self.key_exist(data, "configuration", "parse_check"):
|
||||||
if sys.version_info[0] < 3:
|
check_parse = data["configuration"]["parse_check"]
|
||||||
data["config"] = data["config"].encode('utf-8')
|
else:
|
||||||
|
check_parse = self._settings.get(["configuration", "parse_check"])
|
||||||
|
|
||||||
# check for configpath if it was changed during changing of the configfile
|
if sys.version_info[0] < 3:
|
||||||
if self.key_exist(data, "configuration", "configpath"):
|
data["config"] = data["config"].encode('utf-8')
|
||||||
configpath = os.path.expanduser(
|
|
||||||
data["configuration"]["configpath"]
|
# check for configpath if it was changed during changing of the configfile
|
||||||
)
|
if self.key_exist(data, "configuration", "configpath"):
|
||||||
else:
|
configpath = os.path.expanduser(
|
||||||
# if the configpath was not changed during changing the printer.cfg. Then the configpath would not be in data[]
|
data["configuration"]["configpath"]
|
||||||
configpath = os.path.expanduser(
|
)
|
||||||
self._settings.get(["configuration", "configpath"])
|
else:
|
||||||
)
|
# if the configpath was not changed during changing the printer.cfg. Then the configpath would not be in data[]
|
||||||
if self.file_exist(configpath) and self._parsing_check_response:
|
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 = open(configpath, "w")
|
||||||
f.write(data["config"])
|
f.write(data["config"])
|
||||||
f.close()
|
f.close()
|
||||||
# Restart klippy to reload config
|
|
||||||
self._printer.commands(self._settings.get(
|
|
||||||
["configuration", "reload_command"]))
|
|
||||||
self.log_info("Reloading Klipper Configuration.")
|
|
||||||
self.log_debug("Writing Klipper config to {}".format(configpath))
|
self.log_debug("Writing Klipper config to {}".format(configpath))
|
||||||
except IOError:
|
except IOError:
|
||||||
self.log_error("Error: Couldn't write Klipper config file: {}".format(configpath))
|
self.log_error("Error: Couldn't write Klipper config file: {}".format(configpath))
|
||||||
else:
|
else:
|
||||||
# we dont want to write the klipper conf to the octoprint settings
|
#load the reload command from changed data if it is not existing load the saved setting
|
||||||
data.pop("config", None)
|
if self.key_exist(data, "configuration", "reload_command"):
|
||||||
|
reload_command = os.path.expanduser(
|
||||||
|
data["configuration"]["reload_command"]
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
reload_command = self._settings.get(["configuration", "reload_command"])
|
||||||
|
|
||||||
|
if reload_command != "manually":
|
||||||
|
# Restart klippy to reload config
|
||||||
|
self._printer.commands(reload_command)
|
||||||
|
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
|
# save the rest of changed settings into config.yaml of octoprint
|
||||||
old_debug_logging = self._settings.get_boolean(["configuration", "debug_logging"])
|
old_debug_logging = self._settings.get_boolean(["configuration", "debug_logging"])
|
||||||
|
@ -355,22 +374,32 @@ class KlipperPlugin(
|
||||||
if "FIRMWARE_VERSION" in printerInfo:
|
if "FIRMWARE_VERSION" in printerInfo:
|
||||||
self.log_info("Firmware version: {}".format(
|
self.log_info("Firmware version: {}".format(
|
||||||
printerInfo["FIRMWARE_VERSION"]))
|
printerInfo["FIRMWARE_VERSION"]))
|
||||||
|
elif "// probe" in line:
|
||||||
|
msg = line.strip('/')
|
||||||
|
self.log_info(msg)
|
||||||
|
write_parsing_response_buffer()
|
||||||
elif "//" in line:
|
elif "//" in line:
|
||||||
|
# add lines with // to a buffer
|
||||||
self._message = self._message + line.strip('/')
|
self._message = self._message + line.strip('/')
|
||||||
if not self._parsing_response:
|
if not self._parsing_response:
|
||||||
self.update_status("info", self._message)
|
self.update_status("info", self._message)
|
||||||
self._parsing_response = True
|
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:
|
else:
|
||||||
if self._parsing_response:
|
self.write_parsing_response_buffer()
|
||||||
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)
|
|
||||||
return line
|
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):
|
def get_api_commands(self):
|
||||||
return dict(
|
return dict(
|
||||||
listLogFiles=[],
|
listLogFiles=[],
|
||||||
|
@ -419,17 +448,21 @@ class KlipperPlugin(
|
||||||
configpath)
|
configpath)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|
||||||
self._settings.set(["config"], data["config"])
|
self._settings.set(["config"], data["config"])
|
||||||
# self.send_message("reload", "config", "", data["config"])
|
# self.send_message("reload", "config", "", data["config"])
|
||||||
# send the configdata to frontend to update ace editor
|
# 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"])
|
return flask.jsonify(data=data["config"])
|
||||||
elif command == "checkConfig":
|
elif command == "checkConfig":
|
||||||
if "config" in data:
|
if "config" in data:
|
||||||
if not self.validate_configfile(data["config"]):
|
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"])
|
self._settings.set(["configuration", "old_config"], data["config"])
|
||||||
return flask.jsonify(checkConfig="not OK")
|
return flask.jsonify(checkConfig="not OK")
|
||||||
else:
|
else:
|
||||||
|
self.log_debug("validateConfig ok")
|
||||||
self._settings.set(["configuration", "old_config"], "")
|
self._settings.set(["configuration", "old_config"], "")
|
||||||
return flask.jsonify(checkConfig="OK")
|
return flask.jsonify(checkConfig="OK")
|
||||||
|
|
||||||
|
@ -479,7 +512,6 @@ class KlipperPlugin(
|
||||||
def log_info(self, message):
|
def log_info(self, message):
|
||||||
self._octoklipper_logger.info(message)
|
self._octoklipper_logger.info(message)
|
||||||
self.send_message("log", "info", message, message)
|
self.send_message("log", "info", message, message)
|
||||||
self.send_message("console", "info", message, message)
|
|
||||||
|
|
||||||
def log_debug(self, message):
|
def log_debug(self, message):
|
||||||
self._octoklipper_logger.debug(message)
|
self._octoklipper_logger.debug(message)
|
||||||
|
@ -490,7 +522,6 @@ class KlipperPlugin(
|
||||||
def log_error(self, error):
|
def log_error(self, error):
|
||||||
self._octoklipper_logger.error(error)
|
self._octoklipper_logger.error(error)
|
||||||
self.send_message("log", "error", error, error)
|
self.send_message("log", "error", error, error)
|
||||||
self.send_message("console", "error", error, error)
|
|
||||||
|
|
||||||
def file_exist(self, filepath):
|
def file_exist(self, filepath):
|
||||||
if not os.path.isfile(filepath):
|
if not os.path.isfile(filepath):
|
||||||
|
@ -529,26 +560,36 @@ class KlipperPlugin(
|
||||||
# learn file to be validated
|
# learn file to be validated
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dataToValidated = configparser.RawConfigParser()
|
dataToValidated = configparser.RawConfigParser(strict=False)
|
||||||
dataToValidated.read_string(dataToBeValidated)
|
#
|
||||||
|
if sys.version_info[0] < 3:
|
||||||
|
buf = StringIO.StringIO(dataToBeValidated)
|
||||||
|
dataToValidated.readfp(buf)
|
||||||
|
else:
|
||||||
|
dataToValidated.read_string(dataToBeValidated)
|
||||||
except configparser.Error as error:
|
except configparser.Error as error:
|
||||||
error.message = error.message.replace("\\n","")
|
if sys.version_info[0] < 3:
|
||||||
error.message = error.message.replace("file:","Klipper Configuration", 1)
|
error.message = error.message.replace("\\n","")
|
||||||
error.message = error.message.replace("'","", 2)
|
error.message = error.message.replace("file: u","Klipper Configuration", 1)
|
||||||
error.source = "Klipper config"
|
error.message = error.message.replace("'","", 2)
|
||||||
|
error.message = error.message.replace("u'","'", 1)
|
||||||
|
|
||||||
|
else:
|
||||||
|
error.message = error.message.replace("\\n","")
|
||||||
|
error.message = error.message.replace("file:","Klipper Configuration", 1)
|
||||||
|
error.message = error.message.replace("'","", 2)
|
||||||
self.log_error(
|
self.log_error(
|
||||||
"Error: Invalid Klipper config file:\n" +
|
"Error: Invalid Klipper config file:\n" +
|
||||||
"{}".format(str(error))
|
"{}".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" +
|
"Config got not saved!\n" +
|
||||||
"You can reload your last changes\n" +
|
"You can reload your last changes\n" +
|
||||||
"on the 'Klipper Configuration' tab.\n\n" + str(error))
|
"on the 'Klipper Configuration' tab.\n\n" + str(error))
|
||||||
self._parsing_check_response = False
|
self._parsing_check_response = False
|
||||||
return
|
|
||||||
else:
|
else:
|
||||||
self._parsing_check_response = True
|
self._parsing_check_response = True
|
||||||
return
|
return
|
||||||
|
|
||||||
#incorrectlines = []
|
#incorrectlines = []
|
||||||
# for section in dataToValidated.sections():
|
# for section in dataToValidated.sections():
|
||||||
|
|
|
@ -113,6 +113,14 @@ div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content
|
||||||
margin: 0px 2px 2px 2px;
|
margin: 0px 2px 2px 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group label.inline input.inline-checkbox {
|
||||||
|
vertical-align:-0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group label.inline {
|
||||||
|
display:inline;
|
||||||
|
}
|
||||||
|
|
||||||
#macros #item.control-group {
|
#macros #item.control-group {
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
border: 2px solid #ccc;
|
border: 2px solid #ccc;
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
$(function () {
|
$(function () {
|
||||||
function KlipperViewModel(parameters) {
|
function KlipperViewModel(parameters) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var console_debug = false;
|
|
||||||
|
|
||||||
self.header = OctoPrint.getRequestHeaders({
|
self.header = OctoPrint.getRequestHeaders({
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
|
@ -145,6 +144,7 @@ $(function () {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
self.logMessage(data.time, data.subtype, data.payload);
|
self.logMessage(data.time, data.subtype, data.payload);
|
||||||
|
self.consoleMessage(data.subtype, data.payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if ("warningPopUp" == data.type){
|
//if ("warningPopUp" == data.type){
|
||||||
|
@ -165,7 +165,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({
|
self.logMessages.push({
|
||||||
time: timestamp,
|
time: timestamp,
|
||||||
type: type,
|
type: type,
|
||||||
|
@ -174,14 +178,14 @@ $(function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
self.consoleMessage = function (type, message) {
|
self.consoleMessage = function (type, message) {
|
||||||
if (type == "info"){
|
if (self.settings.settings.plugins.klipper.configuration.debug_logging() === true) {
|
||||||
console.info("OctoKlipper : " + message);
|
if (type == "info"){
|
||||||
} else if (type == "debug"){
|
console.info("OctoKlipper : " + message);
|
||||||
if (console_debug){
|
} else if (type == "debug"){
|
||||||
console.debug("OctoKlipper : " + message);
|
console.debug("OctoKlipper : " + message);
|
||||||
|
} else {
|
||||||
|
console.error("OctoKlipper : " + message);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
console.error("OctoKlipper : " + message);
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
};
|
};
|
||||||
|
@ -200,7 +204,7 @@ $(function () {
|
||||||
$.ajax(settings).done(function (response) {
|
$.ajax(settings).done(function (response) {
|
||||||
self.consoleMessage(
|
self.consoleMessage(
|
||||||
"debug",
|
"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
|
// it under the terms of the GNU Affero General Public License as
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
// License, or (at your option) any later version.
|
// License, or (at your option) any later version.
|
||||||
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU Affero General Public License for more details.
|
// GNU Affero General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// 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/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
function KlipperOffsetDialogViewModel(parameters) {
|
function KlipperOffsetDialogViewModel(parameters) {
|
||||||
var self = this;
|
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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
OCTOPRINT_VIEWMODELS.push({
|
self.klipperViewModel = parameters[0];
|
||||||
construct: KlipperOffsetDialogViewModel,
|
|
||||||
dependencies: [],
|
self.offsetX = ko.observable();
|
||||||
elements: ["#klipper_offset_dialog"]
|
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;
|
var editor = null;
|
||||||
|
|
||||||
self.settings = parameters[0];
|
self.settings = parameters[0];
|
||||||
|
self.klipperViewModel = parameters[1];
|
||||||
|
|
||||||
self.header = OctoPrint.getRequestHeaders({
|
self.header = OctoPrint.getRequestHeaders({
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
|
@ -30,8 +31,8 @@ $(function() {
|
||||||
self.apiUrl = OctoPrint.getSimpleApiUrl("klipper");
|
self.apiUrl = OctoPrint.getSimpleApiUrl("klipper");
|
||||||
|
|
||||||
self.onSettingsBeforeSave = function () {
|
self.onSettingsBeforeSave = function () {
|
||||||
if (editor.session) {
|
if (editor.session && self.settings.settings.plugins.klipper.configuration.parse_check() === true) {
|
||||||
//console.debug("OctoKlipper : onSettingsBeforeSave:" + editor.session.getValue())
|
self.klipperViewModel.consoleMessage("debug", "onSettingsBeforeSave:")
|
||||||
var settings = {
|
var settings = {
|
||||||
"crossDomain": true,
|
"crossDomain": true,
|
||||||
"url": self.apiUrl,
|
"url": self.apiUrl,
|
||||||
|
@ -108,7 +109,7 @@ $(function() {
|
||||||
|
|
||||||
self.loadLastSession = function () {
|
self.loadLastSession = function () {
|
||||||
if (self.settings.settings.plugins.klipper.configuration.old_config() != "") {
|
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) {
|
if (editor.session) {
|
||||||
editor.session.setValue(self.settings.settings.plugins.klipper.configuration.old_config());
|
editor.session.setValue(self.settings.settings.plugins.klipper.configuration.old_config());
|
||||||
editor.clearSelection();
|
editor.clearSelection();
|
||||||
|
@ -194,7 +195,10 @@ $(function() {
|
||||||
|
|
||||||
OCTOPRINT_VIEWMODELS.push({
|
OCTOPRINT_VIEWMODELS.push({
|
||||||
construct: KlipperSettingsViewModel,
|
construct: KlipperSettingsViewModel,
|
||||||
dependencies: ["settingsViewModel"],
|
dependencies: [
|
||||||
|
"settingsViewModel",
|
||||||
|
"klipperViewModel"
|
||||||
|
],
|
||||||
elements: ["#settings_plugin_klipper"]
|
elements: ["#settings_plugin_klipper"]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, exports, module) {
|
ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var oop = require("../lib/oop");
|
var oop = require("../lib/oop");
|
||||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||||
|
|
||||||
var KlipperConfigHighlightRules = function() {
|
var KlipperConfigHighlightRules = function() {
|
||||||
|
|
||||||
this.$rules = {
|
this.$rules = {
|
||||||
start: [{
|
start: [{
|
||||||
include: "#single_line_comment"
|
include: "#single_line_comment"
|
||||||
|
@ -60,7 +60,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
regex: /^\[/,
|
regex: /^\[/,
|
||||||
push: [{
|
push: [{
|
||||||
token: "text",
|
token: "text",
|
||||||
regex: /\]\s*$/,
|
regex: /\]/,
|
||||||
next: "pop"
|
next: "pop"
|
||||||
}, {
|
}, {
|
||||||
include: "#known_config_block_name"
|
include: "#known_config_block_name"
|
||||||
|
@ -238,29 +238,29 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
this.normalizeRules();
|
this.normalizeRules();
|
||||||
};
|
};
|
||||||
|
|
||||||
KlipperConfigHighlightRules.metaData = {
|
KlipperConfigHighlightRules.metaData = {
|
||||||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||||||
name: "Klipper Config",
|
name: "Klipper Config",
|
||||||
scopeName: "source.klipper-config"
|
scopeName: "source.klipper-config"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
oop.inherits(KlipperConfigHighlightRules, TextHighlightRules);
|
oop.inherits(KlipperConfigHighlightRules, TextHighlightRules);
|
||||||
|
|
||||||
exports.KlipperConfigHighlightRules = KlipperConfigHighlightRules;
|
exports.KlipperConfigHighlightRules = KlipperConfigHighlightRules;
|
||||||
});
|
});
|
||||||
|
|
||||||
ace.define("ace/mode/folding/cstyle",[], function(require, exports, module) {
|
ace.define("ace/mode/folding/cstyle",[], function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var oop = require("../../lib/oop");
|
var oop = require("../../lib/oop");
|
||||||
var Range = require("../../range").Range;
|
var Range = require("../../range").Range;
|
||||||
var BaseFoldMode = require("./fold_mode").FoldMode;
|
var BaseFoldMode = require("./fold_mode").FoldMode;
|
||||||
|
|
||||||
var FoldMode = exports.FoldMode = function(commentRegex) {
|
var FoldMode = exports.FoldMode = function(commentRegex) {
|
||||||
if (commentRegex) {
|
if (commentRegex) {
|
||||||
this.foldingStartMarker = new RegExp(
|
this.foldingStartMarker = new RegExp(
|
||||||
|
@ -272,9 +272,9 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
oop.inherits(FoldMode, BaseFoldMode);
|
oop.inherits(FoldMode, BaseFoldMode);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
|
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
|
||||||
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
|
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
|
||||||
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
|
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
|
||||||
|
@ -283,59 +283,59 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
this._getFoldWidgetBase = this.getFoldWidget;
|
this._getFoldWidgetBase = this.getFoldWidget;
|
||||||
this.getFoldWidget = function(session, foldStyle, row) {
|
this.getFoldWidget = function(session, foldStyle, row) {
|
||||||
var line = session.getLine(row);
|
var line = session.getLine(row);
|
||||||
|
|
||||||
if (this.singleLineBlockCommentRe.test(line)) {
|
if (this.singleLineBlockCommentRe.test(line)) {
|
||||||
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
|
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
var fw = this._getFoldWidgetBase(session, foldStyle, row);
|
var fw = this._getFoldWidgetBase(session, foldStyle, row);
|
||||||
|
|
||||||
if (!fw && this.startRegionRe.test(line))
|
if (!fw && this.startRegionRe.test(line))
|
||||||
return "start"; // lineCommentRegionStart
|
return "start"; // lineCommentRegionStart
|
||||||
|
|
||||||
return fw;
|
return fw;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
|
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
|
||||||
var line = session.getLine(row);
|
var line = session.getLine(row);
|
||||||
|
|
||||||
if (this.startRegionRe.test(line))
|
if (this.startRegionRe.test(line))
|
||||||
return this.getCommentRegionBlock(session, line, row);
|
return this.getCommentRegionBlock(session, line, row);
|
||||||
|
|
||||||
var match = line.match(this.foldingStartMarker);
|
var match = line.match(this.foldingStartMarker);
|
||||||
if (match) {
|
if (match) {
|
||||||
var i = match.index;
|
var i = match.index;
|
||||||
|
|
||||||
if (match[1])
|
if (match[1])
|
||||||
return this.openingBracketBlock(session, match[1], row, i);
|
return this.openingBracketBlock(session, match[1], row, i);
|
||||||
|
|
||||||
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
|
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
|
||||||
|
|
||||||
if (range && !range.isMultiLine()) {
|
if (range && !range.isMultiLine()) {
|
||||||
if (forceMultiline) {
|
if (forceMultiline) {
|
||||||
range = this.getSectionRange(session, row);
|
range = this.getSectionRange(session, row);
|
||||||
} else if (foldStyle != "all")
|
} else if (foldStyle != "all")
|
||||||
range = null;
|
range = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foldStyle === "markbegin")
|
if (foldStyle === "markbegin")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var match = line.match(this.foldingStopMarker);
|
var match = line.match(this.foldingStopMarker);
|
||||||
if (match) {
|
if (match) {
|
||||||
var i = match.index + match[0].length;
|
var i = match.index + match[0].length;
|
||||||
|
|
||||||
if (match[1])
|
if (match[1])
|
||||||
return this.closingBracketBlock(session, match[1], row, i);
|
return this.closingBracketBlock(session, match[1], row, i);
|
||||||
|
|
||||||
return session.getCommentFoldRange(row, i, -1);
|
return session.getCommentFoldRange(row, i, -1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getSectionRange = function(session, row) {
|
this.getSectionRange = function(session, row) {
|
||||||
var line = session.getLine(row);
|
var line = session.getLine(row);
|
||||||
var startIndent = line.search(/\S/);
|
var startIndent = line.search(/\S/);
|
||||||
|
@ -352,7 +352,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
if (startIndent > indent)
|
if (startIndent > indent)
|
||||||
break;
|
break;
|
||||||
var subRange = this.getFoldWidgetRange(session, "all", row);
|
var subRange = this.getFoldWidgetRange(session, "all", row);
|
||||||
|
|
||||||
if (subRange) {
|
if (subRange) {
|
||||||
if (subRange.start.row <= startRow) {
|
if (subRange.start.row <= startRow) {
|
||||||
break;
|
break;
|
||||||
|
@ -364,14 +364,14 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
}
|
}
|
||||||
endRow = row;
|
endRow = row;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
|
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
|
||||||
};
|
};
|
||||||
this.getCommentRegionBlock = function(session, line, row) {
|
this.getCommentRegionBlock = function(session, line, row) {
|
||||||
var startColumn = line.search(/\s*$/);
|
var startColumn = line.search(/\s*$/);
|
||||||
var maxRow = session.getLength();
|
var maxRow = session.getLength();
|
||||||
var startRow = row;
|
var startRow = row;
|
||||||
|
|
||||||
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
|
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
|
||||||
var depth = 1;
|
var depth = 1;
|
||||||
while (++row < maxRow) {
|
while (++row < maxRow) {
|
||||||
|
@ -380,38 +380,38 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
|
||||||
if (!m) continue;
|
if (!m) continue;
|
||||||
if (m[1]) depth--;
|
if (m[1]) depth--;
|
||||||
else depth++;
|
else depth++;
|
||||||
|
|
||||||
if (!depth) break;
|
if (!depth) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var endRow = row;
|
var endRow = row;
|
||||||
if (endRow > startRow) {
|
if (endRow > startRow) {
|
||||||
return new Range(startRow, startColumn, endRow, line.length);
|
return new Range(startRow, startColumn, endRow, line.length);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}).call(FoldMode.prototype);
|
}).call(FoldMode.prototype);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ace.define("ace/mode/klipper_config",[], function(require, exports, module) {
|
ace.define("ace/mode/klipper_config",[], function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var oop = require("../lib/oop");
|
var oop = require("../lib/oop");
|
||||||
var TextMode = require("./text").Mode;
|
var TextMode = require("./text").Mode;
|
||||||
var KlipperConfigHighlightRules = require("./klipper_config_highlight_rules").KlipperConfigHighlightRules;
|
var KlipperConfigHighlightRules = require("./klipper_config_highlight_rules").KlipperConfigHighlightRules;
|
||||||
var FoldMode = require("./folding/cstyle").FoldMode;
|
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||||
|
|
||||||
var Mode = function() {
|
var Mode = function() {
|
||||||
this.HighlightRules = KlipperConfigHighlightRules;
|
this.HighlightRules = KlipperConfigHighlightRules;
|
||||||
this.foldingRules = new FoldMode();
|
this.foldingRules = new FoldMode();
|
||||||
};
|
};
|
||||||
oop.inherits(Mode, TextMode);
|
oop.inherits(Mode, TextMode);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
this.$id = "ace/mode/klipper_config"
|
this.$id = "ace/mode/klipper_config"
|
||||||
}).call(Mode.prototype);
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
exports.Mode = Mode;
|
exports.Mode = Mode;
|
||||||
}); (function() {
|
}); (function() {
|
||||||
ace.require(["ace/mode/klipper_config"], function(m) {
|
ace.require(["ace/mode/klipper_config"], function(m) {
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -50,9 +50,11 @@
|
||||||
<select data-bind="value: settings.settings.plugins.klipper.configuration.reload_command">
|
<select data-bind="value: settings.settings.plugins.klipper.configuration.reload_command">
|
||||||
<option value="RESTART">RESTART</option>
|
<option value="RESTART">RESTART</option>
|
||||||
<option value="FIRMWARE_RESTART">FIRMWARE_RESTART</option>
|
<option value="FIRMWARE_RESTART">FIRMWARE_RESTART</option>
|
||||||
|
<option value="manually">Manually</option>
|
||||||
</select>
|
</select>
|
||||||
<span class="help-block">
|
<span class="help-block">
|
||||||
The command that is executed when the Klipper configuration changed and needs to be reloaded.
|
The command that is executed when the Klipper configuration changed and needs to be reloaded.<br>
|
||||||
|
Set this to "Manually" if you don't want to immediately restart klipper.
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -151,19 +153,19 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label">{{ _('Probe Feedrate Z') }}</label>
|
<label class="control-label">{{ _('Probe Feedrate Z') }}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<div class="input-append">
|
<div class="input-append">
|
||||||
<input type="text" class="input-block-level span3" data-bind="value: settings.settings.plugins.klipper.probe.speed_z">
|
<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>
|
<span class="add-on">mm/min</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label">{{ _('Feedrate X/Y') }}</label>
|
<label class="control-label">{{ _('Feedrate X/Y') }}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<div class="input-append">
|
<div class="input-append">
|
||||||
<input type="text" class="input-block-level span3" data-bind="value: settings.settings.plugins.klipper.probe.speed_xy">
|
<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>
|
<span class="add-on">mm/min</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
@ -178,43 +180,45 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div data-bind="foreach: settings.settings.plugins.klipper.probe.points" class="control-group">
|
<div data-bind="foreach: settings.settings.plugins.klipper.probe.points" class="control-group">
|
||||||
<label class="control-label" data-bind="text: $index"></label>
|
<label class="control-label" data-bind="text: $index"></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<div class="row-fluid">
|
<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: 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: x"></div>
|
||||||
<div class="span3"><input type="text" class="input-block-level" data-bind="value: y"></div>
|
<div class="span3"><input type="text" class="input-block-level" data-bind="value: y"></div>
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
<a href='#' data-bind='click: $parent.moveProbePointUp' class="fa fa-chevron-up"></a>
|
<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.moveProbePointDown' class="fa fa-chevron-down"></a>
|
||||||
<a href='#' data-bind='click: $parent.removeProbePoint' class="fa fa-trash-o"></a>
|
<a href='#' data-bind='click: $parent.removeProbePoint' class="fa fa-trash-o"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<a href='#' data-bind='click: addProbePoint' class="fa fa-plus-circle"></a> {{ _('Add Point') }}
|
<a href='#' data-bind='click: addProbePoint' class="fa fa-plus-circle"></a> {{ _('Add Point') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Klipper Conf -->
|
<!-- Klipper Conf -->
|
||||||
<div class="tab-pane" id="conf">
|
<div class="tab-pane" id="conf">
|
||||||
<div class="control-group">
|
<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/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/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>
|
<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'
|
<button class="btn btn-small" data-bind='click: loadLastSession'
|
||||||
title="Reloads the last changes">
|
title="Reloads the last changes">
|
||||||
<i class="fas fa-redo"></i> {{ _('Reload last changes') }}
|
<i class="fas fa-redo"></i> {{ _('Reload last changes') }}
|
||||||
</button><button class="btn btn-small" data-bind='click: reloadFromFile'>
|
</button>
|
||||||
<i class="fas fa-upload"></i></a> {{ _('Reload from file') }}
|
<button class="btn btn-small" data-bind='click: reloadFromFile'>
|
||||||
</button>
|
<i class="fas fa-upload"></i></a> {{ _('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>
|
||||||
<div class="conf-editor">
|
<div class="conf-editor">
|
||||||
<input id="hdnLoadKlipperConfig" type="hidden" data-bind="value: configBound(settings.settings.plugins.klipper.config)" />
|
<input id="hdnLoadKlipperConfig" type="hidden" data-bind="value: configBound(settings.settings.plugins.klipper.config)" />
|
||||||
<div id="plugin-klipper-config"></div>
|
<div id="plugin-klipper-config"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -1,76 +1,112 @@
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
<label>
|
<label> <i class="icon-tasks"></i> {{ _("Messages") }} </label>
|
||||||
<i class="icon-tasks"></i> {{ _('Messages') }}
|
<div class="plugin-klipper-log" data-bind="foreach: logMessages">
|
||||||
</label>
|
<div class="log-item" data-bind="css: type">
|
||||||
<div class="plugin-klipper-log" data-bind="foreach: logMessages">
|
<div data-bind="text: time" class="ts"></div>
|
||||||
<div class="log-item" data-bind="css: type">
|
<div data-bind="html: msg" class="msg"></div>
|
||||||
<div data-bind="text: time" class="ts"></div>
|
|
||||||
<div data-bind="html: msg" class="msg"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<button class="btn btn-mini pull-right clear-btn" data-bind="click: onClearLog"
|
|
||||||
title="Clear Log">
|
<button
|
||||||
<i class="fa fa-trash"></i> {{ _('Clear') }}
|
class="btn btn-mini pull-right clear-btn"
|
||||||
</button>
|
data-bind="click: onClearLog"
|
||||||
</div>
|
title="Clear Log"
|
||||||
<div class="span4">
|
>
|
||||||
|
<i class="fa fa-trash"></i> {{ _("Clear") }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="span4">
|
||||||
|
<div class="control-group">
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="control-group">
|
<div class="controls">
|
||||||
<div class="controls">
|
<label class="control-label"></label>
|
||||||
<label class="control-label"></label>
|
<button
|
||||||
<button class="btn btn-block btn-small" data-bind="click: onGetStatus, enable: isActive()" title="Query Klipper for its current status">
|
class="btn btn-block btn-small"
|
||||||
<i class="fa icon-black fa-info-circle"></i> {{ _('Get Status') }}
|
data-bind="click: onGetStatus, enable: isActive()"
|
||||||
</button>
|
title="Query Klipper for its current status"
|
||||||
<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') }}
|
<i class="fa icon-black fa-info-circle"></i> {{ _("Get Status") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
<button
|
||||||
</div>
|
class="btn btn-block btn-small"
|
||||||
<div class="control-group">
|
data-bind="visible: hasRight('CONFIG', 'Ko'), click: function() {openOctoKlipperSettings('klipper-config');}"
|
||||||
<div class="controls">
|
title="Open the Klipper configurationfile"
|
||||||
<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()"
|
<i class="fa icon-black fa-file-code-o"></i>
|
||||||
title="This will cause the host software to reload its config and perform an internal reset">
|
{{ _("Open Klipper config") }}
|
||||||
{{ _('Host') }}
|
</button>
|
||||||
</button>
|
</div>
|
||||||
<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>
|
<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>
|
</div>
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -19,7 +19,7 @@ plugin_package = "octoprint_klipper"
|
||||||
|
|
||||||
plugin_name = "OctoKlipper"
|
plugin_name = "OctoKlipper"
|
||||||
|
|
||||||
plugin_version = "0.3.4rc5"
|
plugin_version = "0.3.7.2"
|
||||||
|
|
||||||
plugin_description = """A plugin for OctoPrint to configure,control and monitor the Klipper 3D printer software."""
|
plugin_description = """A plugin for OctoPrint to configure,control and monitor the Klipper 3D printer software."""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue