From 40a28def7187c7d159c31ea72841ac4168427afa Mon Sep 17 00:00:00 2001 From: mfm Date: Wed, 24 Jan 2018 17:13:36 +0100 Subject: [PATCH] feat: Added pid tuning dialog --- .../static/js/klipper_pid_tuning.js | 23 ++++++++++++++++ .../klipper_pid_tuning_dialog.jinja2 | 26 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 octoprint_klipper/static/js/klipper_pid_tuning.js create mode 100644 octoprint_klipper/templates/klipper_pid_tuning_dialog.jinja2 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