feat: Added pid tuning dialog
This commit is contained in:
parent
38bda28c99
commit
40a28def71
|
@ -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"]
|
||||
});
|
||||
});
|
|
@ -0,0 +1,26 @@
|
|||
<div id="klipper_pid_tuning_dialog" class="modal hide fade small" tabindex="-1" role="dialog" aria-labelledby="klipper_pid_tuning_dialog_label" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h3 id="klipper_pid_tuning_dialog_label">PID Tuning</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Heater Index</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level span3" data-bind="value: heaterIndex">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Target Temperature</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level span3" data-bind="value: targetTemperature">
|
||||
</div>
|
||||
</div>
|
||||
<label class="control-label">The result of the tuning cycle is reported in the terminal.</label>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button class="btn btn-block" data-bind="click: startTuning" data-dismiss="modal">Start Tuning</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue