diff --git a/octoprint_klipper/static/js/klipper_pid_tuning.js b/octoprint_klipper/static/js/klipper_pid_tuning.js new file mode 100644 index 0000000..265dc42 --- /dev/null +++ b/octoprint_klipper/static/js/klipper_pid_tuning.js @@ -0,0 +1,23 @@ +$(function() { + function KlipperPidTuningViewModel(parameters) { + var self = this; + + self.heaterIndex = ko.observable(); + self.targetTemperature = ko.observable(); + + self.onStartup = function() { + self.heaterIndex(0); + self.targetTemperature(190); + } + + self.startTuning = function() { + OctoPrint.control.sendGcode("PID_TUNE E" + self.heaterIndex() + " S" + self.targetTemperature()); + } + } + + OCTOPRINT_VIEWMODELS.push({ + construct: KlipperPidTuningViewModel, + dependencies: [], + elements: ["#klipper_pid_tuning_dialog"] + }); +}); \ No newline at end of file diff --git a/octoprint_klipper/templates/klipper_pid_tuning_dialog.jinja2 b/octoprint_klipper/templates/klipper_pid_tuning_dialog.jinja2 new file mode 100644 index 0000000..31649fc --- /dev/null +++ b/octoprint_klipper/templates/klipper_pid_tuning_dialog.jinja2 @@ -0,0 +1,26 @@ +
\ No newline at end of file