OctoprintKlipperPlugin/octoprint_klipper/static/js/klipper_pid_tuning.js

24 lines
680 B
JavaScript
Raw Normal View History

2018-01-24 19:13:36 +03:00
$(function() {
function KlipperPidTuningViewModel(parameters) {
var self = this;
self.heaterName = ko.observable();
2018-01-24 19:13:36 +03:00
self.targetTemperature = ko.observable();
self.onStartup = function() {
self.heaterName("");
2018-01-24 19:13:36 +03:00
self.targetTemperature(190);
}
self.startTuning = function() {
OctoPrint.control.sendGcode("PID_CALIBRATE HEATER=" + self.heaterName() + " TARGET=" + self.targetTemperature());
2018-01-24 19:13:36 +03:00
}
}
OCTOPRINT_VIEWMODELS.push({
construct: KlipperPidTuningViewModel,
dependencies: [],
elements: ["#klipper_pid_tuning_dialog"]
});
2018-01-30 01:48:40 +03:00
});